Skip to content

Commit

Permalink
fix: Use existing importmap for build by passing --map flag (#2555)
Browse files Browse the repository at this point in the history
* fix: Allow `--map` to be passed while using jspm build

* Update to latest version of @jspm/generator

* fix tests by upgrading es-module-lexer version

* Disabling esm.sh provider because of a bug from the provider
  • Loading branch information
JayaKrishnaNamburu authored Dec 9, 2023
1 parent 9a6def4 commit 4bd0867
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"jspm.js"
],
"dependencies": {
"@jspm/generator": "^1.1.10",
"@jspm/generator": "^1.1.12",
"cac": "^6.7.14",
"ora": "^6.3.0",
"picocolors": "^1.0.0",
Expand Down
1 change: 1 addition & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ Clears the global module fetch cache, for situations where the contents of a dep

cli
.command("build [entry]", "Build the module using importmap")
.option(...mapOpt)
.option(...buildConfigOpt)
.option(...buildOutputOpt)
.action(wrapCommand(build));
Expand Down
6 changes: 5 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ export const availableProviders = [
"jsdelivr",
"skypack",
"unpkg",
"esm.sh",
/*
Disabling esm.sh provider for now. There is a bug for installing lit.
https://github.com/jspm/generator/issues/335
*/
// "esm.sh",
"jspm.io#system",
];

Expand Down
4 changes: 2 additions & 2 deletions test/ownname.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ const scenarios: Scenario[] = [
commands: ["jspm install app"],
validationFn: async (files: Map<string, string>) => {
// Installing the own-name package "app" should result in the version of
// es-module-lexer in the import map being upgraded to 1.3.1, since it's a
// es-module-lexer in the import map being upgraded to 1.4.1, since it's a
// transitive dependency of "./app.js".
const map = JSON.parse(files.get("importmap.json"));
assert(
map?.imports?.["es-module-lexer"]?.includes("es-module-lexer@1.3.1")
map?.imports?.["es-module-lexer"]?.includes("es-module-lexer@1.4.1")
);
},
},
Expand Down

0 comments on commit 4bd0867

Please sign in to comment.