jspm 4.3.0 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/cli.js +24 -8
  2. package/dist/jspm.js +9 -9
  3. package/package.json +41 -41
package/dist/cli.js CHANGED
@@ -2725,7 +2725,7 @@ async function getGenerator(flags, configOverride = null, inputMap) {
2725
2725
  inputMap: inputMap || await getInputMap(flags),
2726
2726
  env: await getEnv(flags),
2727
2727
  flattenScopes: flags.flattenScopes === false ? false : Boolean(flags.release || flags.flattenScopes),
2728
- combineSubpaths: flags.combineSubpaths === false ? false : Boolean(flags.release || flags.combineSubpaths),
2728
+ combineSubpaths: flags.combineSubpaths === false ? "none" : "both",
2729
2729
  defaultProvider,
2730
2730
  resolutions: getResolutions(flags),
2731
2731
  cache: getCacheMode(flags),
@@ -29463,7 +29463,13 @@ async function build(flags) {
29463
29463
  const { output } = await bundle.generate({
29464
29464
  format: "esm",
29465
29465
  assetFileNames: "[name][extname]",
29466
- entryFileNames: "[name]",
29466
+ entryFileNames: flags.hashEntries ? (chunkInfo) => {
29467
+ const name = chunkInfo.name;
29468
+ const dotIdx = name.lastIndexOf(".");
29469
+ if (dotIdx !== -1)
29470
+ return `${name.slice(0, dotIdx)}-[hash:8]${name.slice(dotIdx)}`;
29471
+ return "[name]-[hash:8]";
29472
+ } : "[name]",
29467
29473
  chunkFileNames: "lib/[name]-[hash:8].js",
29468
29474
  sourcemap: true,
29469
29475
  compact: flags.minify
@@ -29494,9 +29500,15 @@ async function build(flags) {
29494
29500
  const pjson = JSON.parse(
29495
29501
  readFileSync2(join3(projectConfig.projectPath, "package.json"), "utf8")
29496
29502
  );
29497
- pjson.exports = JSON.parse(
29498
- JSON.stringify(pjson.exports).replace(/\.ts"/g, '.js"').replace(/\.mts"/g, '.mjs"')
29499
- );
29503
+ let exportsStr = JSON.stringify(pjson.exports).replace(/\.ts"/g, '.js"').replace(/\.mts"/g, '.mjs"');
29504
+ if (flags.hashEntries) {
29505
+ for (const chunk of output) {
29506
+ if (chunk.type === "chunk" && chunk.isEntry && chunk.fileName !== chunk.name) {
29507
+ exportsStr = exportsStr.split(chunk.name).join(chunk.fileName);
29508
+ }
29509
+ }
29510
+ }
29511
+ pjson.exports = JSON.parse(exportsStr);
29500
29512
  const outPath = join3(flags.out, "package.json");
29501
29513
  const outDir = dirname3(outPath);
29502
29514
  await mkdir3(outDir, { recursive: true });
@@ -30120,7 +30132,9 @@ async function readJsonFile(filePath, defaultValue = {}) {
30120
30132
  async function eject(flags) {
30121
30133
  const log2 = withType("publish/eject");
30122
30134
  console.warn(
30123
- `${c11.yellow("Warning:")} jspm publish is experimental and should only be used for prototyping. Unlike the https://ga.jspm.io/ CDN which is stable, reliability guarantees are not provided for publishing on https://jspm.io/. For reliable package delivery, use npm publish \u2014 all npm packages are available on the https://ga.jspm.io/ CDN.`
30135
+ `${c11.yellow(
30136
+ "Warning:"
30137
+ )} jspm publish is experimental and should only be used for prototyping. Unlike the https://ga.jspm.io/ CDN which is stable, reliability guarantees are not provided for publishing on https://jspm.io/. For reliable package delivery, use npm publish \u2014 all npm packages are available on the https://ga.jspm.io/ CDN.`
30124
30138
  );
30125
30139
  const pkg = flags.eject;
30126
30140
  if (!pkg.startsWith("app:")) {
@@ -30152,7 +30166,9 @@ async function eject(flags) {
30152
30166
  async function publish(flags = {}) {
30153
30167
  const log2 = withType("publish/publish");
30154
30168
  console.warn(
30155
- `${c11.yellow("Warning:")} jspm publish is experimental and should only be used for prototyping. Unlike the https://ga.jspm.io/ CDN which is stable, reliability guarantees are not provided for publishing on https://jspm.io/. For reliable package delivery, use npm publish \u2014 all npm packages are available on the https://ga.jspm.io/ CDN.`
30169
+ `${c11.yellow(
30170
+ "Warning:"
30171
+ )} jspm publish is experimental and should only be used for prototyping. Unlike the https://ga.jspm.io/ CDN which is stable, reliability guarantees are not provided for publishing on https://jspm.io/. For reliable package delivery, use npm publish \u2014 all npm packages are available on the https://ga.jspm.io/ CDN.`
30156
30172
  );
30157
30173
  const { initProject: initProject2 } = await Promise.resolve().then(() => (init_init(), init_exports));
30158
30174
  try {
@@ -33327,7 +33343,7 @@ generateOpts(
33327
33343
  default: "dist"
33328
33344
  }).option("--install", "Generate import map after build completes", {
33329
33345
  default: true
33330
- }),
33346
+ }).option("--hash-entries", "Hash entry point filenames in the output"),
33331
33347
  true
33332
33348
  )
33333
33349
  ).example(
package/dist/jspm.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import c from "picocolors";
3
- import { cli } from './cli.js';
4
-
5
- try {
6
- cli.parse();
7
- } catch (e) {
8
- if (e.constructor.name === "CACError")
9
- console.error(`${c.red("Err:")} ${e.message}\n`);
10
- }
2
+ import c from "picocolors";
3
+ import { cli } from './cli.js';
4
+
5
+ try {
6
+ cli.parse();
7
+ } catch (e) {
8
+ if (e.constructor.name === "CACError")
9
+ console.error(`${c.red("Err:")} ${e.message}\n`);
10
+ }
package/package.json CHANGED
@@ -1,41 +1,41 @@
1
- {
2
- "name": "jspm",
3
- "type": "module",
4
- "version": "4.3.0",
5
- "description": "Import Map Package Manager",
6
- "license": "Apache-2.0",
7
- "bin": {
8
- "jspm": "./dist/jspm.js"
9
- },
10
- "files": [
11
- "assets",
12
- "dist"
13
- ],
14
- "scripts": {
15
- "build": "chomp build",
16
- "test": "chomp test"
17
- },
18
- "dependencies": {
19
- "@babel/core": "^7.24.7",
20
- "@jspm/generator": "^2.10.0",
21
- "@jspm/plugin-rollup": "^1.2.4",
22
- "ora": "^8.2.0",
23
- "picocolors": "^1.1.1"
24
- },
25
- "devDependencies": {
26
- "@antfu/eslint-config": "^0.34.2",
27
- "@types/node": "^18.15.11",
28
- "amaro": "^0.5.3",
29
- "cac": "^6.7.14",
30
- "esbuild": "^0.16.17",
31
- "eslint": "^9.34.0",
32
- "eslint-config-prettier": "^8.8.0",
33
- "mime": "^4.0.7",
34
- "minimatch": "^10.0.1",
35
- "open": "^10.1.2",
36
- "prettier": "^2.8.7",
37
- "rollup": "^3.29.5",
38
- "tinyspy": "^1.1.1",
39
- "typescript": "^4.9.5"
40
- }
41
- }
1
+ {
2
+ "name": "jspm",
3
+ "type": "module",
4
+ "version": "4.4.0",
5
+ "description": "Import Map Package Manager",
6
+ "license": "Apache-2.0",
7
+ "bin": {
8
+ "jspm": "./dist/jspm.js"
9
+ },
10
+ "files": [
11
+ "assets",
12
+ "dist"
13
+ ],
14
+ "scripts": {
15
+ "build": "chomp build",
16
+ "test": "chomp test"
17
+ },
18
+ "dependencies": {
19
+ "@babel/core": "^7.24.7",
20
+ "@jspm/generator": "^2.11.0",
21
+ "@jspm/plugin-rollup": "^1.2.4",
22
+ "ora": "^8.2.0",
23
+ "picocolors": "^1.1.1"
24
+ },
25
+ "devDependencies": {
26
+ "@antfu/eslint-config": "^0.34.2",
27
+ "@types/node": "^18.15.11",
28
+ "amaro": "^0.5.3",
29
+ "cac": "^6.7.14",
30
+ "esbuild": "^0.16.17",
31
+ "eslint": "^9.34.0",
32
+ "eslint-config-prettier": "^8.8.0",
33
+ "mime": "^4.0.7",
34
+ "minimatch": "^10.0.1",
35
+ "open": "^10.1.2",
36
+ "prettier": "^2.8.7",
37
+ "rollup": "^3.29.5",
38
+ "tinyspy": "^1.1.1",
39
+ "typescript": "^4.9.5"
40
+ }
41
+ }