@jsenv/js-module-fallback 1.5.3 → 1.6.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/js-module-fallback",
3
- "version": "1.5.3",
3
+ "version": "1.6.1",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -8,6 +8,9 @@
8
8
  "directory": "packages/internal/js-module-fallback"
9
9
  },
10
10
  "license": "MIT",
11
+ "engines": {
12
+ "node": "^22.18.0 || >=24.11.0"
13
+ },
11
14
  "main": "./src/main.js",
12
15
  "exports": {
13
16
  ".": {
@@ -28,14 +31,13 @@
28
31
  "prepublishOnly": "npm run build"
29
32
  },
30
33
  "dependencies": {
31
- "@babel/parser": "7.29.8",
32
- "@babel/plugin-transform-dynamic-import": "7.29.7",
33
- "@babel/plugin-transform-modules-systemjs": "7.29.8",
34
- "@babel/plugin-transform-modules-umd": "7.29.7",
35
- "@jsenv/ast": "6.9.3",
34
+ "@babel/parser": "8.0.4",
35
+ "@babel/plugin-transform-dynamic-import": "8.0.1",
36
+ "@babel/plugin-transform-modules-systemjs": "8.0.1",
37
+ "@babel/plugin-transform-modules-umd": "8.0.1",
38
+ "@jsenv/ast": "6.10.0",
36
39
  "@jsenv/sourcemap": "1.4.3",
37
- "@jsenv/urls": "2.9.10",
38
- "babel-plugin-transform-async-to-promises": "0.8.18"
40
+ "@jsenv/urls": "2.9.10"
39
41
  },
40
42
  "devDependencies": {
41
43
  "@jsenv/core": "../../../",
@@ -1,12 +1,10 @@
1
- import { applyBabelPlugins } from "@jsenv/ast";
2
- import { composeTwoSourcemaps } from "@jsenv/sourcemap";
1
+ import { applyBabelPlugins, babelPluginAsyncToPromises } from "@jsenv/ast";
2
+ import { composeTwoSourcemaps, SOURCEMAP } from "@jsenv/sourcemap";
3
3
  import { urlToRelativeUrl } from "@jsenv/urls";
4
4
  import { createRequire } from "node:module";
5
5
 
6
6
  import { babelPluginTransformImportMetaResolve } from "./internal/babel_plugin_transform_import_meta_resolve.js";
7
7
  import { babelPluginTransformImportMetaUrl } from "./internal/babel_plugin_transform_import_meta_url.js";
8
- // because of https://github.com/rpetrich/babel-plugin-transform-async-to-promises/issues/84
9
- import customAsyncToPromises from "./internal/async-to-promises.js";
10
8
 
11
9
  export const systemJsClientFileUrlDefault = import.meta
12
10
  .resolve("./client/s.js?as_js_classic");
@@ -68,7 +66,7 @@ export const convertJsModuleToJsClassic = async ({
68
66
  ],
69
67
  require("@babel/plugin-transform-modules-systemjs"),
70
68
  [
71
- customAsyncToPromises,
69
+ babelPluginAsyncToPromises,
72
70
  {
73
71
  asyncAwait: false, // already handled + we might not needs it at all
74
72
  topLevelAwait: "return",
@@ -77,7 +75,7 @@ export const convertJsModuleToJsClassic = async ({
77
75
  ]
78
76
  : [
79
77
  [
80
- require("babel-plugin-transform-async-to-promises"),
78
+ babelPluginAsyncToPromises,
81
79
  {
82
80
  asyncAwait: false, // already handled + we might not needs it at all
83
81
  topLevelAwait: "simple",
@@ -92,7 +90,13 @@ export const convertJsModuleToJsClassic = async ({
92
90
  require("@babel/plugin-transform-modules-umd"),
93
91
  ]),
94
92
  ],
95
- input,
93
+ // the sourcemap is passed as "inputSourcemap"; a "sourceMappingURL" comment
94
+ // left in the content names the file produced by the previous step and would
95
+ // send babel looking for that ".map" next to "inputUrl"
96
+ input: SOURCEMAP.removeComment({
97
+ contentType: "text/javascript",
98
+ content: input,
99
+ }),
96
100
  inputIsJsModule: true,
97
101
  inputUrl,
98
102
  outputUrl,