diff --git a/packages/packemon/package.json b/packages/packemon/package.json index ba09e33b..48a51c15 100644 --- a/packages/packemon/package.json +++ b/packages/packemon/package.json @@ -56,6 +56,8 @@ "@babel/core": "^7.24.5", "@babel/plugin-external-helpers": "^7.24.1", "@babel/plugin-proposal-decorators": "^7.24.1", + "@babel/plugin-proposal-json-modules": "^7.24.3", + "@babel/plugin-syntax-import-attributes": "^7.24.1", "@babel/plugin-transform-runtime": "^7.24.3", "@babel/preset-env": "^7.24.5", "@babel/preset-flow": "^7.24.1", diff --git a/packages/packemon/src/babel/config.ts b/packages/packemon/src/babel/config.ts index a91401b7..5785b866 100644 --- a/packages/packemon/src/babel/config.ts +++ b/packages/packemon/src/babel/config.ts @@ -113,6 +113,11 @@ function getSharedConfig( presets: PluginItem[], features: FeatureFlags, ): ConfigStructure { + plugins.push( + resolve('@babel/plugin-syntax-import-attributes'), + resolve('@babel/plugin-proposal-json-modules'), + ); + return { caller: { name: 'packemon', diff --git a/packages/packemon/src/rollup/config.ts b/packages/packemon/src/rollup/config.ts index 783780e2..149dc50b 100644 --- a/packages/packemon/src/rollup/config.ts +++ b/packages/packemon/src/rollup/config.ts @@ -119,6 +119,7 @@ export function getRollupOutputConfig( objectShorthand: true, symbols: isEsm, }, + importAttributesKey: 'with', // Output specific plugins plugins: [ preserveDynamicImport(platform, format), diff --git a/packages/packemon/tests/babel/__snapshots__/config.test.ts.snap b/packages/packemon/tests/babel/__snapshots__/config.test.ts.snap index a0bca932..d8532591 100644 --- a/packages/packemon/tests/babel/__snapshots__/config.test.ts.snap +++ b/packages/packemon/tests/babel/__snapshots__/config.test.ts.snap @@ -13,6 +13,8 @@ exports[`getBabelInputConfig() > can mutate config 1`] = ` "strictMode": undefined, }, "plugins": [ + "@babel/plugin-syntax-import-attributes", + "@babel/plugin-proposal-json-modules", "babel-plugin-example", ], "presets": [], @@ -32,7 +34,10 @@ exports[`getBabelInputConfig() > doesnt include typescript decorators if \`types "sourceType": "unambiguous", "strictMode": undefined, }, - "plugins": [], + "plugins": [ + "@babel/plugin-syntax-import-attributes", + "@babel/plugin-proposal-json-modules", + ], "presets": [], } `; @@ -60,7 +65,10 @@ exports[`getBabelInputConfig() > includes no plugins or presets by default 1`] = "sourceType": "unambiguous", "strictMode": undefined, }, - "plugins": [], + "plugins": [ + "@babel/plugin-syntax-import-attributes", + "@babel/plugin-proposal-json-modules", + ], "presets": [], } `; @@ -142,6 +150,8 @@ exports[`getBabelInputConfig() > includes typescript decorators if \`typescript\ "loose": true, }, ], + "@babel/plugin-syntax-import-attributes", + "@babel/plugin-proposal-json-modules", ], "presets": [ [ @@ -214,6 +224,8 @@ exports[`getBabelInputConfig() > supports private properties with decorators if "loose": true, }, ], + "@babel/plugin-syntax-import-attributes", + "@babel/plugin-proposal-json-modules", ], "presets": [ [ @@ -255,6 +267,8 @@ exports[`getBabelOutputConfig() > can mutate config 1`] = ` ], "babel-plugin-conditional-invariant", "babel-plugin-env-constants", + "@babel/plugin-syntax-import-attributes", + "@babel/plugin-proposal-json-modules", "babel-plugin-example", ], "presets": [ @@ -960,6 +974,8 @@ exports[`getBabelOutputConfig() > transforms async/await to promises when \`brow ], "babel-plugin-conditional-invariant", "babel-plugin-env-constants", + "@babel/plugin-syntax-import-attributes", + "@babel/plugin-proposal-json-modules", ], "presets": [ [ @@ -1015,6 +1031,8 @@ exports[`getBabelOutputConfig() > transforms async/await to promises when \`brow ], "babel-plugin-conditional-invariant", "babel-plugin-env-constants", + "@babel/plugin-syntax-import-attributes", + "@babel/plugin-proposal-json-modules", ], "presets": [ [ @@ -1073,6 +1091,8 @@ exports[`getBabelOutputConfig() > uses built-in destructuring and object spread ], "babel-plugin-conditional-invariant", "babel-plugin-env-constants", + "@babel/plugin-syntax-import-attributes", + "@babel/plugin-proposal-json-modules", ], "presets": [ [ @@ -1131,6 +1151,8 @@ exports[`getBabelOutputConfig() > uses built-in destructuring and object spread ], "babel-plugin-conditional-invariant", "babel-plugin-env-constants", + "@babel/plugin-syntax-import-attributes", + "@babel/plugin-proposal-json-modules", ], "presets": [ [ diff --git a/packages/packemon/tests/examples/__snapshots__/importAttributes.test.ts.snap b/packages/packemon/tests/examples/__snapshots__/importAttributes.test.ts.snap new file mode 100644 index 00000000..15ead0ae --- /dev/null +++ b/packages/packemon/tests/examples/__snapshots__/importAttributes.test.ts.snap @@ -0,0 +1,1617 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Import attributes > babel > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: browser, Support: current, Format: esm + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-browser-current-esm.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: browser, Support: current, Format: lib + +'use strict'; + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-browser-current-lib.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: browser, Support: current, Format: umd + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-browser-current-umd.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: browser, Support: experimental, Format: esm + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-browser-experimental-esm.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: browser, Support: experimental, Format: lib + +'use strict'; + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-browser-experimental-lib.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: browser, Support: experimental, Format: umd + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-browser-experimental-umd.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: browser, Support: legacy, Format: esm + +var data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-browser-legacy-esm.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: browser, Support: legacy, Format: lib + +'use strict'; + +var data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-browser-legacy-lib.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: browser, Support: legacy, Format: umd + +var data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-browser-legacy-umd.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: browser, Support: stable, Format: esm + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-browser-stable-esm.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: browser, Support: stable, Format: lib + +'use strict'; + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-browser-stable-lib.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: browser, Support: stable, Format: umd + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-browser-stable-umd.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: electron, Support: current, Format: esm + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-electron-current-esm.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: electron, Support: current, Format: lib + +'use strict'; + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-electron-current-lib.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: electron, Support: experimental, Format: esm + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-electron-experimental-esm.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: electron, Support: experimental, Format: lib + +'use strict'; + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-electron-experimental-lib.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: electron, Support: legacy, Format: esm + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-electron-legacy-esm.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: electron, Support: legacy, Format: lib + +'use strict'; + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-electron-legacy-lib.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: electron, Support: stable, Format: esm + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-electron-stable-esm.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: electron, Support: stable, Format: lib + +'use strict'; + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-electron-stable-lib.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: native-current-esm > esm/index-native-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: native, Support: current, Format: esm + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-native-current-esm.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: native, Support: current, Format: lib + +'use strict'; + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-native-current-lib.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: native-experimental-esm > esm/index-native-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: native, Support: experimental, Format: esm + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-native-experimental-esm.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: native, Support: experimental, Format: lib + +'use strict'; + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-native-experimental-lib.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: native-legacy-esm > esm/index-native-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: native, Support: legacy, Format: esm + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-native-legacy-esm.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: native, Support: legacy, Format: lib + +'use strict'; + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-native-legacy-lib.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: native-stable-esm > esm/index-native-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: native, Support: stable, Format: esm + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-native-stable-esm.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: native, Support: stable, Format: lib + +'use strict'; + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-native-stable-lib.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: current, Format: cjs + +'use strict'; + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-current-cjs.cjs.map +" +`; + +exports[`Import attributes > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-current-cjs.cjs';" +`; + +exports[`Import attributes > babel > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: current, Format: lib + +'use strict'; + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-current-lib.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: current, Format: mjs + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-current-mjs.mjs.map +" +`; + +exports[`Import attributes > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: experimental, Format: cjs + +'use strict'; + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-experimental-cjs.cjs.map +" +`; + +exports[`Import attributes > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-experimental-cjs.cjs';" +`; + +exports[`Import attributes > babel > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: experimental, Format: lib + +'use strict'; + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-experimental-lib.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: experimental, Format: mjs + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-experimental-mjs.mjs.map +" +`; + +exports[`Import attributes > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: legacy, Format: cjs + +'use strict'; + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-legacy-cjs.cjs.map +" +`; + +exports[`Import attributes > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-legacy-cjs.cjs';" +`; + +exports[`Import attributes > babel > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: legacy, Format: lib + +'use strict'; + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-legacy-lib.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: legacy, Format: mjs + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-legacy-mjs.mjs.map +" +`; + +exports[`Import attributes > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: stable, Format: cjs + +'use strict'; + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-stable-cjs.cjs.map +" +`; + +exports[`Import attributes > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-stable-cjs.cjs';" +`; + +exports[`Import attributes > babel > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: stable, Format: lib + +'use strict'; + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-stable-lib.js.map +" +`; + +exports[`Import attributes > babel > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: stable, Format: mjs + +const data = { + list: ["foo", "bar", "baz"], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-stable-mjs.mjs.map +" +`; + +exports[`Import attributes > swc > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: browser, Support: current, Format: esm +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-browser-current-esm.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: browser, Support: current, Format: lib +'use strict'; +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-browser-current-lib.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function(global, factory) { + if (typeof module === "object" && typeof module.exports === "object") factory(); + else if (typeof define === "function" && define.amd) define([], factory); + else if (global = typeof globalThis !== "undefined" ? globalThis : global || self) factory(); +})(this, function() { + "use strict"; + const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } + }; + console.log(data); +}); +//# sourceMappingURL=index-browser-current-umd.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: browser, Support: experimental, Format: esm +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-browser-experimental-esm.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: browser, Support: experimental, Format: lib +'use strict'; +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-browser-experimental-lib.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function(global, factory) { + if (typeof module === "object" && typeof module.exports === "object") factory(); + else if (typeof define === "function" && define.amd) define([], factory); + else if (global = typeof globalThis !== "undefined" ? globalThis : global || self) factory(); +})(this, function() { + "use strict"; + const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } + }; + console.log(data); +}); +//# sourceMappingURL=index-browser-experimental-umd.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: browser, Support: legacy, Format: esm +var data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-browser-legacy-esm.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: browser, Support: legacy, Format: lib +'use strict'; +var data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-browser-legacy-lib.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function(global, factory) { + if (typeof module === "object" && typeof module.exports === "object") factory(); + else if (typeof define === "function" && define.amd) define([], factory); + else if (global = typeof globalThis !== "undefined" ? globalThis : global || self) factory(); +})(this, function() { + "use strict"; + var data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } + }; + console.log(data); +}); +//# sourceMappingURL=index-browser-legacy-umd.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: browser, Support: stable, Format: esm +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-browser-stable-esm.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: browser, Support: stable, Format: lib +'use strict'; +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-browser-stable-lib.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function(global, factory) { + if (typeof module === "object" && typeof module.exports === "object") factory(); + else if (typeof define === "function" && define.amd) define([], factory); + else if (global = typeof globalThis !== "undefined" ? globalThis : global || self) factory(); +})(this, function() { + "use strict"; + const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } + }; + console.log(data); +}); +//# sourceMappingURL=index-browser-stable-umd.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: electron, Support: current, Format: esm +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-electron-current-esm.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: electron, Support: current, Format: lib +'use strict'; +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-electron-current-lib.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: electron, Support: experimental, Format: esm +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-electron-experimental-esm.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: electron, Support: experimental, Format: lib +'use strict'; +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-electron-experimental-lib.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: electron, Support: legacy, Format: esm +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-electron-legacy-esm.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: electron, Support: legacy, Format: lib +'use strict'; +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-electron-legacy-lib.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: electron, Support: stable, Format: esm +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-electron-stable-esm.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: electron, Support: stable, Format: lib +'use strict'; +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-electron-stable-lib.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: native-current-esm > esm/index-native-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: native, Support: current, Format: esm +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-native-current-esm.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: native, Support: current, Format: lib +'use strict'; +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-native-current-lib.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: native-experimental-esm > esm/index-native-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: native, Support: experimental, Format: esm +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-native-experimental-esm.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: native, Support: experimental, Format: lib +'use strict'; +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-native-experimental-lib.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: native-legacy-esm > esm/index-native-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: native, Support: legacy, Format: esm +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-native-legacy-esm.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: native, Support: legacy, Format: lib +'use strict'; +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-native-legacy-lib.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: native-stable-esm > esm/index-native-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: native, Support: stable, Format: esm +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-native-stable-esm.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: native, Support: stable, Format: lib +'use strict'; +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-native-stable-lib.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: current, Format: cjs +'use strict'; +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-current-cjs.cjs.map +" +`; + +exports[`Import attributes > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-current-cjs.cjs';" +`; + +exports[`Import attributes > swc > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: current, Format: lib +'use strict'; +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-current-lib.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: current, Format: mjs +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-current-mjs.mjs.map +" +`; + +exports[`Import attributes > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: experimental, Format: cjs +'use strict'; +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-experimental-cjs.cjs.map +" +`; + +exports[`Import attributes > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-experimental-cjs.cjs';" +`; + +exports[`Import attributes > swc > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: experimental, Format: lib +'use strict'; +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-experimental-lib.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: experimental, Format: mjs +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-experimental-mjs.mjs.map +" +`; + +exports[`Import attributes > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: legacy, Format: cjs +'use strict'; +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-legacy-cjs.cjs.map +" +`; + +exports[`Import attributes > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-legacy-cjs.cjs';" +`; + +exports[`Import attributes > swc > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: legacy, Format: lib +'use strict'; +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-legacy-lib.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: legacy, Format: mjs +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-legacy-mjs.mjs.map +" +`; + +exports[`Import attributes > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: stable, Format: cjs +'use strict'; +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-stable-cjs.cjs.map +" +`; + +exports[`Import attributes > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-stable-cjs.cjs';" +`; + +exports[`Import attributes > swc > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: stable, Format: lib +'use strict'; +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-stable-lib.js.map +" +`; + +exports[`Import attributes > swc > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: stable, Format: mjs +const data = { + list: [ + "foo", + "bar", + "baz" + ], + number: 123, + string: "abc", + object: { + foo: true + } +}; +console.log(data); +//# sourceMappingURL=index-node-stable-mjs.mjs.map +" +`; diff --git a/packages/packemon/tests/examples/importAttributes.test.ts b/packages/packemon/tests/examples/importAttributes.test.ts new file mode 100644 index 00000000..e6e5e1eb --- /dev/null +++ b/packages/packemon/tests/examples/importAttributes.test.ts @@ -0,0 +1,7 @@ +import { describe } from 'vitest'; +import { testExampleOutput } from '../helpers'; + +describe('Import attributes', () => { + testExampleOutput('import-attributes.ts', 'babel'); + testExampleOutput('import-attributes.ts', 'swc'); +}); diff --git a/packages/packemon/tests/rollup/config.test.ts b/packages/packemon/tests/rollup/config.test.ts index 5a2e5db1..e64c1875 100644 --- a/packages/packemon/tests/rollup/config.test.ts +++ b/packages/packemon/tests/rollup/config.test.ts @@ -148,6 +148,7 @@ describe('getRollupConfig()', () => { ...generatedCode, symbols: false, }, + importAttributesKey: 'with', interop: 'auto', originalFormat: 'lib', paths: {}, @@ -168,6 +169,7 @@ describe('getRollupConfig()', () => { ...generatedCode, symbols: true, }, + importAttributesKey: 'with', interop: 'auto', originalFormat: 'esm', paths: {}, @@ -188,6 +190,7 @@ describe('getRollupConfig()', () => { ...generatedCode, symbols: true, }, + importAttributesKey: 'with', interop: 'auto', originalFormat: 'mjs', paths: {}, @@ -227,6 +230,7 @@ describe('getRollupConfig()', () => { ...generatedCode, symbols: false, }, + importAttributesKey: 'with', interop: 'auto', originalFormat: 'lib', paths: {}, @@ -266,6 +270,7 @@ describe('getRollupConfig()', () => { ...generatedCode, symbols: false, }, + importAttributesKey: 'with', interop: 'auto', originalFormat: 'lib', paths: {}, @@ -383,6 +388,7 @@ describe('getRollupOutputConfig()', () => { ...generatedCode, symbols: false, }, + importAttributesKey: 'with', interop: 'auto', originalFormat: 'lib', paths: {}, @@ -427,6 +433,7 @@ describe('getRollupOutputConfig()', () => { exports: 'auto', format: 'cjs', generatedCode: 'es5', + importAttributesKey: 'with', interop: 'auto', originalFormat: 'lib', paths: {}, @@ -597,6 +604,7 @@ describe('getRollupOutputConfig()', () => { ...generatedCode, symbols: false, }, + importAttributesKey: 'with', interop: 'auto', originalFormat: 'umd', paths: {}, diff --git a/tests/__fixtures__/examples/import-attributes.ts b/tests/__fixtures__/examples/import-attributes.ts new file mode 100644 index 00000000..1d4554a3 --- /dev/null +++ b/tests/__fixtures__/examples/import-attributes.ts @@ -0,0 +1,3 @@ +import data from './data.json' with { type: 'json ' }; + +console.log(data); diff --git a/tests/__fixtures__/examples/tsconfig.json b/tests/__fixtures__/examples/tsconfig.json index 82da710a..aeda6037 100644 --- a/tests/__fixtures__/examples/tsconfig.json +++ b/tests/__fixtures__/examples/tsconfig.json @@ -1,4 +1,8 @@ { + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext" + }, "include": [ "*" ] diff --git a/yarn.lock b/yarn.lock index eab94a73..8841b4bf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -397,6 +397,18 @@ __metadata: languageName: node linkType: hard +"@babel/helper-import-to-platform-api@npm:^7.24.1": + version: 7.24.1 + resolution: "@babel/helper-import-to-platform-api@npm:7.24.1" + dependencies: + "@babel/helper-compilation-targets": "npm:^7.23.6" + "@babel/helper-module-imports": "npm:^7.24.1" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10/1d054a8136a378b530c4af88c81a8ae599112a1469ccfce8c609e65fd2544f0c814676e5055c138155c1c5fbf3c5d875de80001b7014abe0c529662455872c18 + languageName: node + linkType: hard + "@babel/helper-member-expression-to-functions@npm:^7.23.0, @babel/helper-member-expression-to-functions@npm:^7.24.5": version: 7.24.5 resolution: "@babel/helper-member-expression-to-functions@npm:7.24.5" @@ -680,6 +692,19 @@ __metadata: languageName: node linkType: hard +"@babel/plugin-proposal-json-modules@npm:^7.24.3": + version: 7.24.3 + resolution: "@babel/plugin-proposal-json-modules@npm:7.24.3" + dependencies: + "@babel/helper-import-to-platform-api": "npm:^7.24.1" + "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/plugin-syntax-import-attributes": "npm:^7.24.1" + peerDependencies: + "@babel/core": ^7.22.0 + checksum: 10/0002c144aff4b136b9439507096d63b9aa3796f086f43f9e1da341ff8a5dfd26b59a195fbdef168c4b3e2a09d33577017f3e1744526cd3734bd28faeb34de053 + languageName: node + linkType: hard + "@babel/plugin-proposal-private-methods@npm:^7.18.6": version: 7.18.6 resolution: "@babel/plugin-proposal-private-methods@npm:7.18.6" @@ -19081,6 +19106,8 @@ __metadata: "@babel/core": "npm:^7.24.5" "@babel/plugin-external-helpers": "npm:^7.24.1" "@babel/plugin-proposal-decorators": "npm:^7.24.1" + "@babel/plugin-proposal-json-modules": "npm:^7.24.3" + "@babel/plugin-syntax-import-attributes": "npm:^7.24.1" "@babel/plugin-transform-runtime": "npm:^7.24.3" "@babel/preset-env": "npm:^7.24.5" "@babel/preset-flow": "npm:^7.24.1"