Skip to content

Commit

Permalink
Fixes the generator not being able to import the @canonical/utils pac…
Browse files Browse the repository at this point in the history
…kage at runtime
  • Loading branch information
jmuzina committed Jan 17, 2025
1 parent 7607ee8 commit 31a53b3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/generator-ds/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## 0.7.1-experimental.0
- [chore]: Updated the `package.json` to define a `module` script instead of `main` script, since this is an ESM package.
2 changes: 1 addition & 1 deletion packages/generator-ds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"homepage": "https://github.com/canonical/ds25#readme",
"files": ["generators"],
"type": "module",
"main": "generators/index.js",
"module": "generators/index.js",
"scripts": {
"build": "bun run build:tsc && bun run build:copyfiles",
"build:tsc": "tsc",
Expand Down
2 changes: 2 additions & 0 deletions packages/utils/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## 0.7.1-experimental.0
- [chore]: Added explicit `exports` to `package.json` for better compatibility with `@canonical/generator-ds` at runtime. This prevents errors where Yeoman cannot resolve the import of the utils package.
7 changes: 7 additions & 0 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
"email": "[email protected]",
"name": "Canonical Webteam"
},
"exports": {
".": {
"import": "./dist/esm/index.js",
"types": "./dist/types/index.d.ts",
"default": "./dist/esm/index.js"
}
},
"repository": {
"type": "git",
"url": "https://github.com/canonical/ds25"
Expand Down

0 comments on commit 31a53b3

Please sign in to comment.