From 60b5edcf5d96c26877134febbdf0a247ee56b9c7 Mon Sep 17 00:00:00 2001 From: Jeff Posnick Date: 2022年8月23日 17:00:40 -0400 Subject: [PATCH 01/13] Add example of exports.types field (#992) * Add example of exports.types field * Update README.md Co-authored-by: Ryan Christian <33403762+rschristian@users.noreply.github.com> --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0135a1bb..2b6d70fa 100644 --- a/README.md +++ b/README.md @@ -166,12 +166,13 @@ The filenames and paths for generated bundles in each format are defined by the "source": "src/index.js", // input "main": "dist/foo.js", // CommonJS output bundle "umd:main": "dist/foo.umd.js", // UMD output bundle - "module": "dist/foo.mjs", // ES Modules output bundle + "module": "dist/foo.mjs", // ES Modules output bundle "exports": { + "types": "./dist/foo.d.ts", // TypeScript typings for NodeNext modules "require": "./dist/foo.js", // CommonJS output bundle "default": "./dist/foo.modern.mjs", // Modern ES Modules output bundle }, - "types": "dist/foo.d.ts" // TypeScript typings directory + "types": "dist/foo.d.ts" // TypeScript typings } ``` @@ -230,6 +231,8 @@ To ensure Microbundle does not process extraneous files, by default it only incl If you're using TypeScript with CSS Modules, you will want to set `"include": ["node_modules/microbundle/index.d.ts"]` in your `tsconfig.json` to tell TypeScript how to handle your CSS Module imports. +To ensure that your module's `.d.ts` type info is visible to other TypeScript projects that use [`moduleResolution: 'NodeNext'`](https://www.typescriptlang.org/docs/handbook/esm-node.html), add a [`types` key](https://www.typescriptlang.org/docs/handbook/esm-node.html#packagejson-exports-imports-and-self-referencing) to your `package.json`'s corresponding `exports` mapping. + ### CSS and CSS Modules Importing CSS files is supported via `import "./foo.css"`. By default, generated CSS output is written to disk. The `--css inline` command line option will inline generated CSS into your bundles as a string, returning the CSS string from the import: From 124c9c607cfc1c33fd2376bd86ddd15531b507d6 Mon Sep 17 00:00:00 2001 From: Franco Arza Date: 2022年8月25日 20:20:17 -0300 Subject: [PATCH 02/13] Update README.md (#993) --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2b6d70fa..fd79e1b7 100644 --- a/README.md +++ b/README.md @@ -382,8 +382,11 @@ Here's what's coming up for Microbundle: - [routex.js](https://github.com/alexhoma/routex.js) A dynamic routing library for Next.js. - [hooked-form](https://github.com/JoviDeCroock/hooked-form) A lightweight form-management library for React. - [goober](https://github.com/cristianbote/goober) Less than 1KB css-in-js alternative with a familiar API. -- [react-model](https://github.com/byte-fe/react-model) The next generation state management library for React -- [Teaful](https://github.com/teafuljs/teaful) Tiny, easy and powerful (P)React state management +- [react-model](https://github.com/byte-fe/react-model) The next generation state management library for React. +- [Teaful](https://github.com/teafuljs/teaful) Tiny, easy and powerful (P)React state management. +- [@studio-freight/lenis](https://github.com/studio-freight/lenis) Tiny, Performant, Vanilla JS, Smooth Scroll library. +- [@studio-freight/tempus](https://github.com/studio-freight/tempus) One rAF to rule them all. +- [@studio-freight/hamo](https://github.com/studio-freight/hamo) Collection of React hooks. ## 🥂 License From 22187fba8a2d404a9f3dc5db357e243cd45e8479 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: 2022年9月18日 09:27:43 +0200 Subject: [PATCH 03/13] Fix `mangle.json` indentation style not preserved (#999) --- .changeset/gold-berries-march.md | 5 +++++ src/index.js | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .changeset/gold-berries-march.md diff --git a/.changeset/gold-berries-march.md b/.changeset/gold-berries-march.md new file mode 100644 index 00000000..a96679e4 --- /dev/null +++ b/.changeset/gold-berries-march.md @@ -0,0 +1,5 @@ +--- +'microbundle': patch +--- + +Fix indentation style in `mangle.json` not preserved diff --git a/src/index.js b/src/index.js index ddf90f2d..99e6a8fc 100644 --- a/src/index.js +++ b/src/index.js @@ -408,9 +408,11 @@ function createConfig(options, entry, format, writeMeta) { let endsWithNewLine = false; + let nameCacheIndentTabs = false; function loadNameCache() { try { const data = fs.readFileSync(getNameCachePath(), 'utf8'); + nameCacheIndentTabs = /^\t+/gm.test(data); endsWithNewLine = data.endsWith(EOL); nameCache = JSON.parse(data); // mangle.json can contain a "minify" field, same format as the pkg.mangle: @@ -628,7 +630,11 @@ function createConfig(options, entry, format, writeMeta) { writeBundle() { if (writeMeta && nameCache) { let filename = getNameCachePath(); - let json = JSON.stringify(nameCache, null, 2); + let json = JSON.stringify( + nameCache, + null, + nameCacheIndentTabs ? '\t' : 2, + ); if (endsWithNewLine) json += EOL; fs.writeFile(filename, json, () => {}); } From bb8713c74706f466672b3109552c7d3e675b5325 Mon Sep 17 00:00:00 2001 From: Ryan Christian <33403762+rschristian@users.noreply.github.com> Date: 2023年2月23日 11:32:18 -0600 Subject: [PATCH 04/13] chore: Silence Rollup's `this is undefined` warnings (#991) * chore: Silence Rollup's `this is undefined` warning * docs: Adding changeset --- .changeset/swift-plums-fix.md | 5 +++++ src/index.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/swift-plums-fix.md diff --git a/.changeset/swift-plums-fix.md b/.changeset/swift-plums-fix.md new file mode 100644 index 00000000..941c04d4 --- /dev/null +++ b/.changeset/swift-plums-fix.md @@ -0,0 +1,5 @@ +--- +'microbundle': patch +--- + +Silence Rollup's noisy (and usually harmless) `The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten.` warnings diff --git a/src/index.js b/src/index.js index 99e6a8fc..06a36d29 100644 --- a/src/index.js +++ b/src/index.js @@ -475,7 +475,7 @@ function createConfig(options, entry, format, writeMeta) { `\n ↳ to depend on a module via import/require, install it to "dependencies".`, ); return; - } + } else if (warning.code === 'THIS_IS_UNDEFINED') return; warn(warning); }, From 105a09b9aa686ac46dc728e774d7ae3aef00aed8 Mon Sep 17 00:00:00 2001 From: Don McCurdy Date: 2023年4月26日 18:28:40 -0400 Subject: [PATCH 05/13] Add glTF Transform to "Built with Microbundle" list (#1040) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fd79e1b7..c10bddaf 100644 --- a/README.md +++ b/README.md @@ -387,7 +387,7 @@ Here's what's coming up for Microbundle: - [@studio-freight/lenis](https://github.com/studio-freight/lenis) Tiny, Performant, Vanilla JS, Smooth Scroll library. - [@studio-freight/tempus](https://github.com/studio-freight/tempus) One rAF to rule them all. - [@studio-freight/hamo](https://github.com/studio-freight/hamo) Collection of React hooks. - +- [glTF Transform](https://github.com/donmccurdy/glTF-Transform) Library for working with .gltf and .glb 3D models. ## 🥂 License From ef8376ee9076b2f56aca42fd9e4c8fd4dcaf8fd0 Mon Sep 17 00:00:00 2001 From: Diego Tonini Date: 2023年6月30日 00:19:18 +0200 Subject: [PATCH 06/13] chore: add eta js to readme (#1051) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c10bddaf..69aab462 100644 --- a/README.md +++ b/README.md @@ -388,6 +388,7 @@ Here's what's coming up for Microbundle: - [@studio-freight/tempus](https://github.com/studio-freight/tempus) One rAF to rule them all. - [@studio-freight/hamo](https://github.com/studio-freight/hamo) Collection of React hooks. - [glTF Transform](https://github.com/donmccurdy/glTF-Transform) Library for working with .gltf and .glb 3D models. +- [eta](https://github.com/eta-dev/eta) Lightweight, powerful, pluggable embedded JS template engine ## 🥂 License From b8755477f82f20ac52e6783984092dbb9dc55347 Mon Sep 17 00:00:00 2001 From: Oskar Legner Date: 2023年8月24日 10:31:15 +0200 Subject: [PATCH 07/13] Fix typo in comment (#1056) --- src/lib/css-modules.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/css-modules.js b/src/lib/css-modules.js index fcda6dc7..e4fa1889 100644 --- a/src/lib/css-modules.js +++ b/src/lib/css-modules.js @@ -33,9 +33,9 @@ export function cssModulesConfig(options) { } /** - * This is done because if you use the cli default property, you get a primiatve "null" or "false", + * This is done because if you use the cli default property, you get a primitive "null" or "false", * but when using the cli arguments, you always get back strings. This method aims at correcting those - * for both realms. So that both realms _convert_ into primatives. + * for both realms. So that both realms _convert_ into primitives. */ function processCssmodulesArgument(options) { if (options['css-modules'] === 'true' || options['css-modules'] === true) From 3aca5a0a8f9b0df57a1603f044fdd8e86da79ae7 Mon Sep 17 00:00:00 2001 From: Philipp Daun Date: 2023年9月18日 19:22:19 +0200 Subject: [PATCH 08/13] Add swup to example projects (#1061) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 69aab462..2f4dbb48 100644 --- a/README.md +++ b/README.md @@ -389,6 +389,7 @@ Here's what's coming up for Microbundle: - [@studio-freight/hamo](https://github.com/studio-freight/hamo) Collection of React hooks. - [glTF Transform](https://github.com/donmccurdy/glTF-Transform) Library for working with .gltf and .glb 3D models. - [eta](https://github.com/eta-dev/eta) Lightweight, powerful, pluggable embedded JS template engine +- [swup](https://github.com/swup/swup) Page transition library for server-rendered websites. ## 🥂 License From 4724a779917bae462113a81f66684cbad2351a6e Mon Sep 17 00:00:00 2001 From: Jude Agboola Date: Tue, 5 Dec 2023 17:49:01 +0100 Subject: [PATCH 09/13] remove brazillian-utils from readme (#1062) --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 2f4dbb48..03471c77 100644 --- a/README.md +++ b/README.md @@ -375,7 +375,6 @@ Here's what's coming up for Microbundle: - [Microenvi](https://github.com/fwilkerson/microenvi) Bundle, serve, and hot reload with one command. - [Theme UI](https://github.com/system-ui/theme-ui) Build consistent, themeable React apps based on constraint-based design principles. - [react-recomponent](https://github.com/philipp-spiess/react-recomponent) Reason-style reducer components for React using ES6 classes. -- [brazilian-utils](https://github.com/brazilian-utils/brazilian-utils) Utils library for specific Brazilian businesses. - [react-hooks-lib](https://github.com/beizhedenglong/react-hooks-lib) A set of reusable react hooks. - [mdx-deck-live-code](https://github.com/JReinhold/mdx-deck-live-code) A library for [mdx-deck](https://github.com/jxnblk/mdx-deck) to do live React and JS coding directly in slides. - [react-router-ext](https://github.com/ri7nz/react-router-ext) An Extended [react-router-dom](https://github.com/ReactTraining/react-router/tree/master/packages/react-router-dom) with simple usage. From 4b11285f27e7fa5a5f9ff4733489bb75e8a0763d Mon Sep 17 00:00:00 2001 From: Luke Edwards Date: 2024年1月23日 21:23:07 -0800 Subject: [PATCH 10/13] chore: add licenses badge (#1074) this service recursively checks/lists all licenses within a package's dependency graph. I remember there being a fair number of pieces involved here so was happy to see that all 400+ licenses involved are green! --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 03471c77..e8dc7bff 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@

Microbundle - npm travis + npm travis licenses

The zero-configuration bundler for tiny modules, powered by Rollup.

From aae1611ef4f95f17332057018b595ef7b2794b2d Mon Sep 17 00:00:00 2001 From: Ryan Christian <33403762+rschristian@users.noreply.github.com> Date: Tue, 4 Feb 2025 14:20:33 -0600 Subject: [PATCH 11/13] fix: Incorrect UMD sourcemaps (#1043) --- .changeset/violet-falcons-dream.md | 5 ++++ .github/workflows/size.yml | 4 +++- package-lock.json | 25 +++++++++++--------- package.json | 1 + src/index.js | 34 +++++++++++++++++++++------ test/__snapshots__/index.test.js.snap | 2 +- 6 files changed, 51 insertions(+), 20 deletions(-) create mode 100644 .changeset/violet-falcons-dream.md diff --git a/.changeset/violet-falcons-dream.md b/.changeset/violet-falcons-dream.md new file mode 100644 index 00000000..9cd3e61b --- /dev/null +++ b/.changeset/violet-falcons-dream.md @@ -0,0 +1,5 @@ +--- +'microbundle': patch +--- + +Fixes positioning bug with UMD sourcemaps diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml index 0e541a0d..e1d7f789 100644 --- a/.github/workflows/size.yml +++ b/.github/workflows/size.yml @@ -21,5 +21,7 @@ jobs: uses: preactjs/compressed-size-action@v2 with: pattern: 'test/fixtures/**/dist/!(*.map)' - build-script: 'test' + # We're using this to report size differences, not test, so update snapshots if they fail. + # The CI can catch the test failures instead. + build-script: 'test -- -u' repo-token: '${{ secrets.GITHUB_TOKEN }}' diff --git a/package-lock.json b/package-lock.json index adec7f6b..6603abea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "microbundle", - "version": "0.15.0", + "version": "0.15.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "microbundle", - "version": "0.15.0", + "version": "0.15.1", "license": "MIT", "dependencies": { "@babel/core": "^7.12.10", @@ -38,6 +38,7 @@ "gzip-size": "^6.0.0", "kleur": "^4.1.3", "lodash.merge": "^4.6.2", + "magic-string": "^0.25.9", "postcss": "^8.2.1", "pretty-bytes": "^5.4.1", "rollup": "^2.35.1", @@ -11320,11 +11321,12 @@ } }, "node_modules/magic-string": { - "version": "0.25.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", - "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", + "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", + "license": "MIT", "dependencies": { - "sourcemap-codec": "^1.4.4" + "sourcemap-codec": "^1.4.8" } }, "node_modules/make-dir": { @@ -16050,7 +16052,8 @@ "node_modules/sourcemap-codec": { "version": "1.4.8", "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", + "deprecated": "Please use @jridgewell/sourcemap-codec instead" }, "node_modules/spawndamnit": { "version": "2.0.0", @@ -26937,11 +26940,11 @@ } }, "magic-string": { - "version": "0.25.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", - "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", + "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", "requires": { - "sourcemap-codec": "^1.4.4" + "sourcemap-codec": "^1.4.8" } }, "make-dir": { diff --git a/package.json b/package.json index 6cf2034f..1f4488f5 100644 --- a/package.json +++ b/package.json @@ -97,6 +97,7 @@ "gzip-size": "^6.0.0", "kleur": "^4.1.3", "lodash.merge": "^4.6.2", + "magic-string": "^0.25.9", "postcss": "^8.2.1", "pretty-bytes": "^5.4.1", "rollup": "^2.35.1", diff --git a/src/index.js b/src/index.js index 06a36d29..c1e2f151 100644 --- a/src/index.js +++ b/src/index.js @@ -39,6 +39,7 @@ import { import { getConfigFromPkgJson, getName } from './lib/package-info'; import { shouldCssModules, cssModulesConfig } from './lib/css-modules'; import { EOL } from 'os'; +import MagicString from 'magic-string'; // Extensions to use when resolving modules const EXTENSIONS = ['.ts', '.tsx', '.js', '.jsx', '.es6', '.es', '.mjs']; @@ -653,17 +654,36 @@ function createConfig(options, entry, format, writeMeta) { // So we remove the globalThis check, replacing it with `this||self` to match Rollup 1's output: renderChunk(code, chunk, opts) { if (opts.format === 'umd') { - // minified: - code = code.replace( + // Can swap this out with MagicString.replace() when we bump it: + // https://github.com/developit/microbundle/blob/f815a01cb63d90b9f847a4dcad2a64e6b2f8596f/src/index.js#L657-L671 + const s = new MagicString(code); + + const minified = code.match( /([a-zA-Z$_]+)="undefined"!=typeof globalThis\?globalThis:(1円\|\|self)/, - '2ドル', ); - // unminified: - code = code.replace( + if (minified) { + s.overwrite( + minified.index, + minified.index + minified[0].length, + minified[2], + ); + } + + const unminified = code.match( /(global *= *)typeof +globalThis *!== *['"]undefined['"] *\? *globalThis *: *(global *\|\| *self)/, - '1ドル2ドル', ); - return { code, map: null }; + if (unminified) { + s.overwrite( + unminified.index, + unminified.index + unminified[0].length, + unminified[1] + unminified[2], + ); + } + + return { + code: s.toString(), + map: s.generateMap({ hires: true }), + }; } }, // Grab size info before writing files to disk: diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap index 1155d4f2..cabd2132 100644 --- a/test/__snapshots__/index.test.js.snap +++ b/test/__snapshots__/index.test.js.snap @@ -1930,7 +1930,7 @@ exports[`fixtures build inline-source-map with microbundle 4`] = ` exports[`fixtures build inline-source-map with microbundle 5`] = ` "!function(e,n){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=n():\\"function\\"==typeof define&&define.amd?define(n):(e||self).inlineSourceMap=n()}(this,function(){var e=function(){try{var e=arguments;return Promise.resolve([].slice.call(e).reduce(function(e,n){return e+n},0))}catch(e){return Promise.reject(e)}};return function(){try{var n=arguments,r=[].slice.call(n);return Promise.resolve(e.apply(void 0,r)).then(function(n){return Promise.resolve(e.apply(void 0,r)).then(function(e){return[n,e]})})}catch(e){return Promise.reject(e)}}}); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lLXNvdXJjZS1tYXAudW1kLmpzIiwic291cmNlcyI6WyIuLi9zcmMvdHdvLmpzIiwiLi4vc3JjL2luZGV4LmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBhc3luYyBmdW5jdGlvbiB0d28oLi4uYXJncykge1xuXHRyZXR1cm4gYXJncy5yZWR1Y2UoKHRvdGFsLCB2YWx1ZSkgPT4gdG90YWwgKyB2YWx1ZSwgMCk7XG59XG4iLCJpbXBvcnQgeyB0d28gfSBmcm9tICcuL3R3byc7XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uKC4uLmFyZ3MpIHtcblx0cmV0dXJuIFthd2FpdCB0d28oLi4uYXJncyksIGF3YWl0IHR3byguLi5hcmdzKV07XG59XG4iXSwibmFtZXMiOlsidHdvIiwicmVkdWNlIiwidG90YWwiLCJ2YWx1ZSIsImFyZ3MiXSwibWFwcGluZ3MiOiJzT0FBc0JBLGlDQUNyQix1QkFBTyxpQkFBS0MsT0FBTyxTQUFDQyxFQUFPQyxVQUFVRCxFQUFRQyxHQUFPLElBRHJELDBFQ0VpQ0MsMENBQ2xCSixlQUFPSSw0Q0FBYUosZUFBT0kscUJBQXpDLE1BQU8sVUFEUiJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lLXNvdXJjZS1tYXAudW1kLmpzIiwic291cmNlcyI6WyIuLi9zcmMvdHdvLmpzIiwiLi4vc3JjL2luZGV4LmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBhc3luYyBmdW5jdGlvbiB0d28oLi4uYXJncykge1xuXHRyZXR1cm4gYXJncy5yZWR1Y2UoKHRvdGFsLCB2YWx1ZSkgPT4gdG90YWwgKyB2YWx1ZSwgMCk7XG59XG4iLCJpbXBvcnQgeyB0d28gfSBmcm9tICcuL3R3byc7XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uKC4uLmFyZ3MpIHtcblx0cmV0dXJuIFthd2FpdCB0d28oLi4uYXJncyksIGF3YWl0IHR3byguLi5hcmdzKV07XG59XG4iXSwibmFtZXMiOlsidHdvIiwicmVkdWNlIiwidG90YWwiLCJ2YWx1ZSIsImFyZ3MiXSwibWFwcGluZ3MiOiIwTEFBc0JBLGlDQUNyQix1QkFBTyxpQkFBS0MsT0FBTyxTQUFDQyxFQUFPQyxVQUFVRCxFQUFRQyxHQUFPLElBRHJELDBFQ0VpQ0MsMENBQ2xCSixlQUFPSSw0Q0FBYUosZUFBT0kscUJBQXpDLE1BQU8sVUFEUiJ9 " `; From 00016d892b1eb89df3ececbbb896b1cd3bddde7d Mon Sep 17 00:00:00 2001 From: Ryan Christian <33403762+rschristian@users.noreply.github.com> Date: 2025年10月23日 20:01:00 -0500 Subject: [PATCH 12/13] ci: Bump CI actions (#1082) * ci: Bump CI versions * ci: Limit compressed-size to microbundle itself * ci: Limit push CI to master * test: Drop output messages from tests, not reliable enough nor completely necessary * ci: Revert removal of test reporter * ci: Downgrade Node versions * revert: Try reverting this whilst we're at it * ci: Bump release workflow --- .github/workflows/nodejs.yml | 22 +++++----------------- .github/workflows/release.yml | 8 ++++---- .github/workflows/size.yml | 2 +- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 51f60d6f..5cc3932f 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -3,9 +3,8 @@ name: Node CI on: pull_request: {} push: - branches-ignore: - - trying.tmp - - staging.tmp + branches: + - master jobs: build: @@ -16,23 +15,12 @@ jobs: node-version: [12.x, 14.x] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - - name: Cache node modules - uses: actions/cache@v1 - env: - cache-name: cache-node-modules - with: - path: ~/.npm - # This uses the same name as the build-action so we can share the caches. - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- + cache: npm - run: npm ci --ignore-scripts - name: npm build and test run: npm test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9548e01c..d3fd15c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,15 +11,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@master + uses: actions/checkout@v4 with: # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits fetch-depth: 0 - - name: Setup Node.js 12.x - uses: actions/setup-node@master + - name: Setup Node.js 22.x + uses: actions/setup-node@v4 with: - node-version: 12.x + node-version: 22.x - name: Install Dependencies run: npm install diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml index e1d7f789..d6fc9378 100644 --- a/.github/workflows/size.yml +++ b/.github/workflows/size.yml @@ -8,7 +8,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: compressed-size-action uses: preactjs/compressed-size-action@v2 From 9f56e06b0d1d412f3f0aa4c94d332e77791dd09b Mon Sep 17 00:00:00 2001 From: Andre Wiggins <459878+andrewiggins@users.noreply.github.com> Date: 2025年10月23日 18:08:29 -0700 Subject: [PATCH 13/13] Format repo (#1096) Ran `npm run format` to fix up some formatting issues in the repo --- test/__snapshots__/index.test.js.snap | 6 +++--- test/fixtures/basic-compress-false/src/index.js | 2 +- test/fixtures/basic-css/src/index.js | 2 +- test/fixtures/basic-dashed-external/src/index.js | 2 +- test/fixtures/basic-json/src/index.js | 2 +- test/fixtures/basic-no-compress/src/index.js | 2 +- test/fixtures/basic-no-pkg-main/src/index.js | 2 +- test/fixtures/basic-with-cwd/basic/src/index.js | 2 +- test/fixtures/basic/src/index.js | 2 +- test/fixtures/css-modules--false/src/index.js | 2 +- test/fixtures/css-modules--null/src/index.js | 2 +- test/fixtures/css-modules--string/src/index.js | 2 +- test/fixtures/css-modules--true/src/index.js | 2 +- test/fixtures/custom-outputs-alt/src/index.js | 2 +- test/fixtures/custom-outputs/src/index.js | 2 +- .../custom-source/src/custom-source.js | 2 +- test/fixtures/custom-source/src/custom-source.js | 2 +- test/fixtures/inline-source-map/src/index.js | 2 +- test/fixtures/mangle-json-file/src/index.js | 2 +- test/fixtures/minify-config/src/index.js | 2 +- test/fixtures/minify-path-config/src/index.js | 2 +- .../minify-path-parent-dir/index.js | 2 +- test/fixtures/modern-generators/src/index.js | 2 +- test/fixtures/modern/src/index.js | 2 +- test/fixtures/name-custom-amd/src/index.js | 2 +- test/fixtures/name-custom-cli/src/index.js | 2 +- test/fixtures/no-pkg-name/src/index.js | 2 +- test/fixtures/no-pkg/src/index.js | 2 +- 28 files changed, 30 insertions(+), 30 deletions(-) diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap index cabd2132..27dedc37 100644 --- a/test/__snapshots__/index.test.js.snap +++ b/test/__snapshots__/index.test.js.snap @@ -1918,19 +1918,19 @@ exports[`fixtures build inline-source-map with microbundle 2`] = `3`; exports[`fixtures build inline-source-map with microbundle 3`] = ` "var r=function(){try{var r=arguments;return Promise.resolve([].slice.call(r).reduce(function(r,e){return r+e},0))}catch(r){return Promise.reject(r)}};export default function(){try{var e=arguments,t=[].slice.call(e);return Promise.resolve(r.apply(void 0,t)).then(function(e){return Promise.resolve(r.apply(void 0,t)).then(function(r){return[e,r]})})}catch(r){return Promise.reject(r)}} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lLXNvdXJjZS1tYXAuZXNtLm1qcyIsInNvdXJjZXMiOlsiLi4vc3JjL3R3by5qcyIsIi4uL3NyYy9pbmRleC5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgYXN5bmMgZnVuY3Rpb24gdHdvKC4uLmFyZ3MpIHtcblx0cmV0dXJuIGFyZ3MucmVkdWNlKCh0b3RhbCwgdmFsdWUpID0+IHRvdGFsICsgdmFsdWUsIDApO1xufVxuIiwiaW1wb3J0IHsgdHdvIH0gZnJvbSAnLi90d28nO1xuXG5leHBvcnQgZGVmYXVsdCBhc3luYyBmdW5jdGlvbiguLi5hcmdzKSB7XG5cdHJldHVybiBbYXdhaXQgdHdvKC4uLmFyZ3MpLCBhd2FpdCB0d28oLi4uYXJncyldO1xufVxuIl0sIm5hbWVzIjpbInR3byIsInJlZHVjZSIsInRvdGFsIiwidmFsdWUiLCJhcmdzIl0sIm1hcHBpbmdzIjoiSUFBc0JBLGlDQUNyQix1QkFBTyxpQkFBS0MsT0FBTyxTQUFDQyxFQUFPQyxVQUFVRCxFQUFRQyxHQUFPLElBRHJELGtGQ0VpQ0MsMENBQ2xCSixlQUFPSSw0Q0FBYUosZUFBT0kscUJBQXpDLE1BQU8sVUFEUiJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lLXNvdXJjZS1tYXAuZXNtLm1qcyIsInNvdXJjZXMiOlsiLi4vc3JjL3R3by5qcyIsIi4uL3NyYy9pbmRleC5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgYXN5bmMgZnVuY3Rpb24gdHdvKC4uLmFyZ3MpIHtcblx0cmV0dXJuIGFyZ3MucmVkdWNlKCh0b3RhbCwgdmFsdWUpID0+IHRvdGFsICsgdmFsdWUsIDApO1xufVxuIiwiaW1wb3J0IHsgdHdvIH0gZnJvbSAnLi90d28nO1xuXG5leHBvcnQgZGVmYXVsdCBhc3luYyBmdW5jdGlvbiAoLi4uYXJncykge1xuXHRyZXR1cm4gW2F3YWl0IHR3byguLi5hcmdzKSwgYXdhaXQgdHdvKC4uLmFyZ3MpXTtcbn1cbiJdLCJuYW1lcyI6WyJ0d28iLCJyZWR1Y2UiLCJ0b3RhbCIsInZhbHVlIiwiYXJncyJdLCJtYXBwaW5ncyI6IklBQXNCQSxpQ0FDckIsdUJBQU8saUJBQUtDLE9BQU8sU0FBQ0MsRUFBT0MsVUFBVUQsRUFBUUMsR0FBTyxJQURyRCxrRkNFa0NDLDBDQUNuQkosZUFBT0ksNENBQWFKLGVBQU9JLHFCQUF6QyxNQUFPLFVBRFIifQ== " `; exports[`fixtures build inline-source-map with microbundle 4`] = ` "var r=function(){try{var r=arguments;return Promise.resolve([].slice.call(r).reduce(function(r,e){return r+e},0))}catch(r){return Promise.reject(r)}};module.exports=function(){try{var e=arguments,t=[].slice.call(e);return Promise.resolve(r.apply(void 0,t)).then(function(e){return Promise.resolve(r.apply(void 0,t)).then(function(r){return[e,r]})})}catch(r){return Promise.reject(r)}}; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lLXNvdXJjZS1tYXAuanMiLCJzb3VyY2VzIjpbIi4uL3NyYy90d28uanMiLCIuLi9zcmMvaW5kZXguanMiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHR3byguLi5hcmdzKSB7XG5cdHJldHVybiBhcmdzLnJlZHVjZSgodG90YWwsIHZhbHVlKSA9PiB0b3RhbCArIHZhbHVlLCAwKTtcbn1cbiIsImltcG9ydCB7IHR3byB9IGZyb20gJy4vdHdvJztcblxuZXhwb3J0IGRlZmF1bHQgYXN5bmMgZnVuY3Rpb24oLi4uYXJncykge1xuXHRyZXR1cm4gW2F3YWl0IHR3byguLi5hcmdzKSwgYXdhaXQgdHdvKC4uLmFyZ3MpXTtcbn1cbiJdLCJuYW1lcyI6WyJ0d28iLCJyZWR1Y2UiLCJ0b3RhbCIsInZhbHVlIiwiYXJncyJdLCJtYXBwaW5ncyI6IklBQXNCQSxpQ0FDckIsdUJBQU8saUJBQUtDLE9BQU8sU0FBQ0MsRUFBT0MsVUFBVUQsRUFBUUMsR0FBTyxJQURyRCxrRkNFaUNDLDBDQUNsQkosZUFBT0ksNENBQWFKLGVBQU9JLHFCQUF6QyxNQUFPLFVBRFIifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lLXNvdXJjZS1tYXAuanMiLCJzb3VyY2VzIjpbIi4uL3NyYy90d28uanMiLCIuLi9zcmMvaW5kZXguanMiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHR3byguLi5hcmdzKSB7XG5cdHJldHVybiBhcmdzLnJlZHVjZSgodG90YWwsIHZhbHVlKSA9PiB0b3RhbCArIHZhbHVlLCAwKTtcbn1cbiIsImltcG9ydCB7IHR3byB9IGZyb20gJy4vdHdvJztcblxuZXhwb3J0IGRlZmF1bHQgYXN5bmMgZnVuY3Rpb24gKC4uLmFyZ3MpIHtcblx0cmV0dXJuIFthd2FpdCB0d28oLi4uYXJncyksIGF3YWl0IHR3byguLi5hcmdzKV07XG59XG4iXSwibmFtZXMiOlsidHdvIiwicmVkdWNlIiwidG90YWwiLCJ2YWx1ZSIsImFyZ3MiXSwibWFwcGluZ3MiOiJJQUFzQkEsaUNBQ3JCLHVCQUFPLGlCQUFLQyxPQUFPLFNBQUNDLEVBQU9DLFVBQVVELEVBQVFDLEdBQU8sSUFEckQsa0ZDRWtDQywwQ0FDbkJKLGVBQU9JLDRDQUFhSixlQUFPSSxxQkFBekMsTUFBTyxVQURSIn0= " `; exports[`fixtures build inline-source-map with microbundle 5`] = ` "!function(e,n){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=n():\\"function\\"==typeof define&&define.amd?define(n):(e||self).inlineSourceMap=n()}(this,function(){var e=function(){try{var e=arguments;return Promise.resolve([].slice.call(e).reduce(function(e,n){return e+n},0))}catch(e){return Promise.reject(e)}};return function(){try{var n=arguments,r=[].slice.call(n);return Promise.resolve(e.apply(void 0,r)).then(function(n){return Promise.resolve(e.apply(void 0,r)).then(function(e){return[n,e]})})}catch(e){return Promise.reject(e)}}}); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lLXNvdXJjZS1tYXAudW1kLmpzIiwic291cmNlcyI6WyIuLi9zcmMvdHdvLmpzIiwiLi4vc3JjL2luZGV4LmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBhc3luYyBmdW5jdGlvbiB0d28oLi4uYXJncykge1xuXHRyZXR1cm4gYXJncy5yZWR1Y2UoKHRvdGFsLCB2YWx1ZSkgPT4gdG90YWwgKyB2YWx1ZSwgMCk7XG59XG4iLCJpbXBvcnQgeyB0d28gfSBmcm9tICcuL3R3byc7XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uKC4uLmFyZ3MpIHtcblx0cmV0dXJuIFthd2FpdCB0d28oLi4uYXJncyksIGF3YWl0IHR3byguLi5hcmdzKV07XG59XG4iXSwibmFtZXMiOlsidHdvIiwicmVkdWNlIiwidG90YWwiLCJ2YWx1ZSIsImFyZ3MiXSwibWFwcGluZ3MiOiIwTEFBc0JBLGlDQUNyQix1QkFBTyxpQkFBS0MsT0FBTyxTQUFDQyxFQUFPQyxVQUFVRCxFQUFRQyxHQUFPLElBRHJELDBFQ0VpQ0MsMENBQ2xCSixlQUFPSSw0Q0FBYUosZUFBT0kscUJBQXpDLE1BQU8sVUFEUiJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lLXNvdXJjZS1tYXAudW1kLmpzIiwic291cmNlcyI6WyIuLi9zcmMvdHdvLmpzIiwiLi4vc3JjL2luZGV4LmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBhc3luYyBmdW5jdGlvbiB0d28oLi4uYXJncykge1xuXHRyZXR1cm4gYXJncy5yZWR1Y2UoKHRvdGFsLCB2YWx1ZSkgPT4gdG90YWwgKyB2YWx1ZSwgMCk7XG59XG4iLCJpbXBvcnQgeyB0d28gfSBmcm9tICcuL3R3byc7XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uICguLi5hcmdzKSB7XG5cdHJldHVybiBbYXdhaXQgdHdvKC4uLmFyZ3MpLCBhd2FpdCB0d28oLi4uYXJncyldO1xufVxuIl0sIm5hbWVzIjpbInR3byIsInJlZHVjZSIsInRvdGFsIiwidmFsdWUiLCJhcmdzIl0sIm1hcHBpbmdzIjoiMExBQXNCQSxpQ0FDckIsdUJBQU8saUJBQUtDLE9BQU8sU0FBQ0MsRUFBT0MsVUFBVUQsRUFBUUMsR0FBTyxJQURyRCwwRUNFa0NDLDBDQUNuQkosZUFBT0ksNENBQWFKLGVBQU9JLHFCQUF6QyxNQUFPLFVBRFIifQ== " `; diff --git a/test/fixtures/basic-compress-false/src/index.js b/test/fixtures/basic-compress-false/src/index.js index a756a0a4..c0a2efb0 100644 --- a/test/fixtures/basic-compress-false/src/index.js +++ b/test/fixtures/basic-compress-false/src/index.js @@ -1,5 +1,5 @@ import { two } from './two'; -export default async function(...args) { +export default async function (...args) { return [await two(...args), await two(...args)]; } diff --git a/test/fixtures/basic-css/src/index.js b/test/fixtures/basic-css/src/index.js index 3a807d79..69d12538 100644 --- a/test/fixtures/basic-css/src/index.js +++ b/test/fixtures/basic-css/src/index.js @@ -1,6 +1,6 @@ import './two.css'; -export default function() { +export default function () { const el = document.createElement('div'); el.className = 'testing'; return el; diff --git a/test/fixtures/basic-dashed-external/src/index.js b/test/fixtures/basic-dashed-external/src/index.js index f1fd29e2..dd7e2f97 100644 --- a/test/fixtures/basic-dashed-external/src/index.js +++ b/test/fixtures/basic-dashed-external/src/index.js @@ -3,6 +3,6 @@ console.log(tinyglob); import { two } from './two'; -export default async function(...args) { +export default async function (...args) { return [await two(...args), await two(...args)]; } diff --git a/test/fixtures/basic-json/src/index.js b/test/fixtures/basic-json/src/index.js index c00eab09..88442f08 100644 --- a/test/fixtures/basic-json/src/index.js +++ b/test/fixtures/basic-json/src/index.js @@ -1,5 +1,5 @@ import two from './two.json'; -export default async function(...args) { +export default async function (...args) { return two; } diff --git a/test/fixtures/basic-no-compress/src/index.js b/test/fixtures/basic-no-compress/src/index.js index a756a0a4..c0a2efb0 100644 --- a/test/fixtures/basic-no-compress/src/index.js +++ b/test/fixtures/basic-no-compress/src/index.js @@ -1,5 +1,5 @@ import { two } from './two'; -export default async function(...args) { +export default async function (...args) { return [await two(...args), await two(...args)]; } diff --git a/test/fixtures/basic-no-pkg-main/src/index.js b/test/fixtures/basic-no-pkg-main/src/index.js index a756a0a4..c0a2efb0 100644 --- a/test/fixtures/basic-no-pkg-main/src/index.js +++ b/test/fixtures/basic-no-pkg-main/src/index.js @@ -1,5 +1,5 @@ import { two } from './two'; -export default async function(...args) { +export default async function (...args) { return [await two(...args), await two(...args)]; } diff --git a/test/fixtures/basic-with-cwd/basic/src/index.js b/test/fixtures/basic-with-cwd/basic/src/index.js index a756a0a4..c0a2efb0 100644 --- a/test/fixtures/basic-with-cwd/basic/src/index.js +++ b/test/fixtures/basic-with-cwd/basic/src/index.js @@ -1,5 +1,5 @@ import { two } from './two'; -export default async function(...args) { +export default async function (...args) { return [await two(...args), await two(...args)]; } diff --git a/test/fixtures/basic/src/index.js b/test/fixtures/basic/src/index.js index a756a0a4..c0a2efb0 100644 --- a/test/fixtures/basic/src/index.js +++ b/test/fixtures/basic/src/index.js @@ -1,5 +1,5 @@ import { two } from './two'; -export default async function(...args) { +export default async function (...args) { return [await two(...args), await two(...args)]; } diff --git a/test/fixtures/css-modules--false/src/index.js b/test/fixtures/css-modules--false/src/index.js index 6edf3533..430e7c19 100644 --- a/test/fixtures/css-modules--false/src/index.js +++ b/test/fixtures/css-modules--false/src/index.js @@ -1,4 +1,4 @@ import './not_scoped.css'; import './not_scoped.module.css'; -export default function() {} +export default function () {} diff --git a/test/fixtures/css-modules--null/src/index.js b/test/fixtures/css-modules--null/src/index.js index e2bfa463..74b754fb 100644 --- a/test/fixtures/css-modules--null/src/index.js +++ b/test/fixtures/css-modules--null/src/index.js @@ -1,7 +1,7 @@ import './not_scoped.css'; import scoped from './scoped.module.css'; -export default function() { +export default function () { const el = document.createElement('div'); el.className = scoped.scoped_class; return el; diff --git a/test/fixtures/css-modules--string/src/index.js b/test/fixtures/css-modules--string/src/index.js index 7fac50a4..ef4849de 100644 --- a/test/fixtures/css-modules--string/src/index.js +++ b/test/fixtures/css-modules--string/src/index.js @@ -1,7 +1,7 @@ import global from './scoped.css'; import scoped from './scoped.module.css'; -export default function() { +export default function () { const el = document.createElement('div'); el.className = scoped.scoped_class + ' ' + global.test_class_that_should_be_scoped; diff --git a/test/fixtures/css-modules--true/src/index.js b/test/fixtures/css-modules--true/src/index.js index 7fac50a4..ef4849de 100644 --- a/test/fixtures/css-modules--true/src/index.js +++ b/test/fixtures/css-modules--true/src/index.js @@ -1,7 +1,7 @@ import global from './scoped.css'; import scoped from './scoped.module.css'; -export default function() { +export default function () { const el = document.createElement('div'); el.className = scoped.scoped_class + ' ' + global.test_class_that_should_be_scoped; diff --git a/test/fixtures/custom-outputs-alt/src/index.js b/test/fixtures/custom-outputs-alt/src/index.js index a756a0a4..c0a2efb0 100644 --- a/test/fixtures/custom-outputs-alt/src/index.js +++ b/test/fixtures/custom-outputs-alt/src/index.js @@ -1,5 +1,5 @@ import { two } from './two'; -export default async function(...args) { +export default async function (...args) { return [await two(...args), await two(...args)]; } diff --git a/test/fixtures/custom-outputs/src/index.js b/test/fixtures/custom-outputs/src/index.js index a756a0a4..c0a2efb0 100644 --- a/test/fixtures/custom-outputs/src/index.js +++ b/test/fixtures/custom-outputs/src/index.js @@ -1,5 +1,5 @@ import { two } from './two'; -export default async function(...args) { +export default async function (...args) { return [await two(...args), await two(...args)]; } diff --git a/test/fixtures/custom-source-with-cwd/custom-source/src/custom-source.js b/test/fixtures/custom-source-with-cwd/custom-source/src/custom-source.js index a756a0a4..c0a2efb0 100644 --- a/test/fixtures/custom-source-with-cwd/custom-source/src/custom-source.js +++ b/test/fixtures/custom-source-with-cwd/custom-source/src/custom-source.js @@ -1,5 +1,5 @@ import { two } from './two'; -export default async function(...args) { +export default async function (...args) { return [await two(...args), await two(...args)]; } diff --git a/test/fixtures/custom-source/src/custom-source.js b/test/fixtures/custom-source/src/custom-source.js index a756a0a4..c0a2efb0 100644 --- a/test/fixtures/custom-source/src/custom-source.js +++ b/test/fixtures/custom-source/src/custom-source.js @@ -1,5 +1,5 @@ import { two } from './two'; -export default async function(...args) { +export default async function (...args) { return [await two(...args), await two(...args)]; } diff --git a/test/fixtures/inline-source-map/src/index.js b/test/fixtures/inline-source-map/src/index.js index a756a0a4..c0a2efb0 100644 --- a/test/fixtures/inline-source-map/src/index.js +++ b/test/fixtures/inline-source-map/src/index.js @@ -1,5 +1,5 @@ import { two } from './two'; -export default async function(...args) { +export default async function (...args) { return [await two(...args), await two(...args)]; } diff --git a/test/fixtures/mangle-json-file/src/index.js b/test/fixtures/mangle-json-file/src/index.js index 8d0f5527..cca8c9ac 100644 --- a/test/fixtures/mangle-json-file/src/index.js +++ b/test/fixtures/mangle-json-file/src/index.js @@ -1,6 +1,6 @@ import { two } from './two'; -export default function() { +export default function () { console.log(two.prop1); console.log(two._prop2); return two; diff --git a/test/fixtures/minify-config/src/index.js b/test/fixtures/minify-config/src/index.js index 8d0f5527..cca8c9ac 100644 --- a/test/fixtures/minify-config/src/index.js +++ b/test/fixtures/minify-config/src/index.js @@ -1,6 +1,6 @@ import { two } from './two'; -export default function() { +export default function () { console.log(two.prop1); console.log(two._prop2); return two; diff --git a/test/fixtures/minify-path-config/src/index.js b/test/fixtures/minify-path-config/src/index.js index 8d0f5527..cca8c9ac 100644 --- a/test/fixtures/minify-path-config/src/index.js +++ b/test/fixtures/minify-path-config/src/index.js @@ -1,6 +1,6 @@ import { two } from './two'; -export default function() { +export default function () { console.log(two.prop1); console.log(two._prop2); return two; diff --git a/test/fixtures/minify-path-parent-dir-with-cwd/minify-path-parent-dir/index.js b/test/fixtures/minify-path-parent-dir-with-cwd/minify-path-parent-dir/index.js index 8d0f5527..cca8c9ac 100644 --- a/test/fixtures/minify-path-parent-dir-with-cwd/minify-path-parent-dir/index.js +++ b/test/fixtures/minify-path-parent-dir-with-cwd/minify-path-parent-dir/index.js @@ -1,6 +1,6 @@ import { two } from './two'; -export default function() { +export default function () { console.log(two.prop1); console.log(two._prop2); return two; diff --git a/test/fixtures/modern-generators/src/index.js b/test/fixtures/modern-generators/src/index.js index a9d95a89..551eefcf 100644 --- a/test/fixtures/modern-generators/src/index.js +++ b/test/fixtures/modern-generators/src/index.js @@ -1,6 +1,6 @@ import { idMaker } from './two'; -export default async function() { +export default async function () { const gen = idMaker(); return [gen.next().value, gen.next().value]; } diff --git a/test/fixtures/modern/src/index.js b/test/fixtures/modern/src/index.js index a756a0a4..c0a2efb0 100644 --- a/test/fixtures/modern/src/index.js +++ b/test/fixtures/modern/src/index.js @@ -1,5 +1,5 @@ import { two } from './two'; -export default async function(...args) { +export default async function (...args) { return [await two(...args), await two(...args)]; } diff --git a/test/fixtures/name-custom-amd/src/index.js b/test/fixtures/name-custom-amd/src/index.js index a756a0a4..c0a2efb0 100644 --- a/test/fixtures/name-custom-amd/src/index.js +++ b/test/fixtures/name-custom-amd/src/index.js @@ -1,5 +1,5 @@ import { two } from './two'; -export default async function(...args) { +export default async function (...args) { return [await two(...args), await two(...args)]; } diff --git a/test/fixtures/name-custom-cli/src/index.js b/test/fixtures/name-custom-cli/src/index.js index a756a0a4..c0a2efb0 100644 --- a/test/fixtures/name-custom-cli/src/index.js +++ b/test/fixtures/name-custom-cli/src/index.js @@ -1,5 +1,5 @@ import { two } from './two'; -export default async function(...args) { +export default async function (...args) { return [await two(...args), await two(...args)]; } diff --git a/test/fixtures/no-pkg-name/src/index.js b/test/fixtures/no-pkg-name/src/index.js index a756a0a4..c0a2efb0 100644 --- a/test/fixtures/no-pkg-name/src/index.js +++ b/test/fixtures/no-pkg-name/src/index.js @@ -1,5 +1,5 @@ import { two } from './two'; -export default async function(...args) { +export default async function (...args) { return [await two(...args), await two(...args)]; } diff --git a/test/fixtures/no-pkg/src/index.js b/test/fixtures/no-pkg/src/index.js index a756a0a4..c0a2efb0 100644 --- a/test/fixtures/no-pkg/src/index.js +++ b/test/fixtures/no-pkg/src/index.js @@ -1,5 +1,5 @@ import { two } from './two'; -export default async function(...args) { +export default async function (...args) { return [await two(...args), await two(...args)]; }

AltStyle によって変換されたページ (->オリジナル) /