Skip to content

Commit

Permalink
fix(project): wrong export file names for libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
julianpoemp committed Sep 24, 2023
1 parent 19573a2 commit 8c02017
Show file tree
Hide file tree
Showing 17 changed files with 509 additions and 830 deletions.
4 changes: 3 additions & 1 deletion apps/octra/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": []
"types": [
"@angular/localize"
]
},
"files": ["src/main.ts"],
"include": ["src/**/*.d.ts"],
Expand Down
2 changes: 1 addition & 1 deletion libs/annotation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@octra/annotation",
"version": "0.1.6",
"version": "0.1.7",
"peerDependencies": {
"@octra/media": "^0.0.11",
"@octra/utilities": "^0.0.3"
Expand Down
2 changes: 1 addition & 1 deletion libs/annotation/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"executor": "@nx/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"rollupConfig": "libs/annotation/rollup.cjs",
"outputPath": "dist/libs/annotation",
"main": "libs/annotation/src/index.ts",
"tsConfig": "libs/annotation/tsconfig.lib.json",
"external": ["@octra/media", "@octra/utilities"],
"generateExportsField": true,
"project": "libs/annotation/package.json",
"compiler": "tsc",
"format": ["cjs", "esm"],
Expand Down
15 changes: 15 additions & 0 deletions libs/annotation/rollup.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = (config, b) => {
return {
...config,
output: {
...config.output,
entryFileNames: () => {
if (config.output.format === 'cjs') {
return `index.cjs`;
} else {
return `index.mjs`;
}
},
},
};
};
2 changes: 1 addition & 1 deletion libs/assets/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"{options.outputPath}"
],
"options": {
"rollupConfig": "libs/assets/rollup.cjs",
"outputPath": "dist/libs/assets",
"main": "libs/assets/src/index.ts",
"tsConfig": "libs/assets/tsconfig.lib.json",
"generateExportsField": true,
"project": "libs/assets/package.json",
"compiler": "tsc",
"format": [
Expand Down
15 changes: 15 additions & 0 deletions libs/assets/rollup.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = (config, b) => {
return {
...config,
output: {
...config.output,
entryFileNames: () => {
if (config.output.format === 'cjs') {
return `index.cjs`;
} else {
return `index.mjs`;
}
},
},
};
};
2 changes: 1 addition & 1 deletion libs/json-sets/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"executor": "@nx/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"rollupConfig": "libs/json-sets/rollup.cjs",
"outputPath": "dist/libs/json-sets",
"main": "libs/json-sets/src/index.ts",
"tsConfig": "libs/json-sets/tsconfig.lib.json",
"generateExportsField": true,
"assets": [
"libs/json-sets/src/LICENSE.txt",
"libs/json-sets/src/README.md"
Expand Down
15 changes: 15 additions & 0 deletions libs/json-sets/rollup.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = (config, b) => {
return {
...config,
output: {
...config.output,
entryFileNames: () => {
if (config.output.format === 'cjs') {
return `index.cjs`;
} else {
return `index.mjs`;
}
},
},
};
};
4 changes: 2 additions & 2 deletions libs/media/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
"executor": "@nx/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"rollupConfig": "libs/media/rollup.cjs",
"outputPath": "dist/libs/media",
"main": "libs/media/src/index.ts",
"tsConfig": "libs/media/tsconfig.lib.json",
"generateExportsField": true,
"assets": ["libs/media/src/LICENSE.txt", "libs/media/src/README.md"],
"project": "libs/media/package.json",
"compiler": "tsc",
"format": ["cjs"]
"format": ["cjs", "esm"]
}
},
"bundle": {
Expand Down
15 changes: 15 additions & 0 deletions libs/media/rollup.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = (config, b) => {
return {
...config,
output: {
...config.output,
entryFileNames: () => {
if (config.output.format === 'cjs') {
return `index.cjs`;
} else {
return `index.mjs`;
}
},
},
};
};
4 changes: 2 additions & 2 deletions libs/utilities/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@octra/utilities",
"version": "0.0.4",
"version": "0.0.5",
"type": "commonjs",
"main": "./index.cjs",
"module": "./index.js",
"module": "./index.mjs",
"typings": "./src/index.d.ts"
}
2 changes: 1 addition & 1 deletion libs/utilities/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"executor": "@nx/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"rollupConfig": "libs/utilities/rollup.cjs",
"outputPath": "dist/libs/utilities",
"tsConfig": "libs/utilities/tsconfig.lib.json",
"generateExportsField": true,
"main": "libs/utilities/src/index.ts",
"entryFile": "libs/utilities/src/index.ts",
"assets": [
Expand Down
15 changes: 15 additions & 0 deletions libs/utilities/rollup.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = (config, b) => {
return {
...config,
output: {
...config.output,
entryFileNames: () => {
if (config.output.format === 'cjs') {
return `index.cjs`;
} else {
return `index.mjs`;
}
},
},
};
};
2 changes: 1 addition & 1 deletion libs/web-media/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"executor": "@nx/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"rollupConfig": "libs/web-media/rollup.cjs",
"outputPath": "dist/libs/web-media",
"main": "libs/web-media/src/index.ts",
"tsConfig": "libs/web-media/tsconfig.lib.json",
"generateExportsField": true,
"assets": [
"libs/web-media/src/LICENSE.txt",
"libs/web-media/src/README.md"
Expand Down
15 changes: 15 additions & 0 deletions libs/web-media/rollup.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = (config, b) => {
return {
...config,
output: {
...config.output,
entryFileNames: () => {
if (config.output.format === 'cjs') {
return `index.cjs`;
} else {
return `index.mjs`;
}
},
},
};
};
Loading

0 comments on commit 8c02017

Please sign in to comment.