From ecc439a08447a65f846337b2a472e21c7941eea9 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Sat, 30 Jul 2022 08:56:30 +0200 Subject: [PATCH] [v3.0] Browser build (#4593) * [v3.0] New hashing algorithm that "fixes (nearly) everything" (#4543) * Initial new hashing idea * Simplify external import path generation 197 broken tests left * Use correct file names in chunk info 197 broken tests left * Implement first draft for hashing algorithm 189 broken tests left * Remove active deprecations this.emitAsset this.emitChunk this.getAssetFileName this.getChunkFileName import.meta.ROLLUP_ASSET_URL_ import.meta.ROLLUP_CHUNK_URL_ * Reduce render parameters * Always scan all chunks for hashes * Fix asset emission and remaining tests * Reintroduce augmentChunkHash and get OutputChunk by converting RenderedChunk * Provide chunk graph in renderChunk * Handle hash collisions * Remove deprecated hacky asset emission * Allow to configure hash sizes per file * Update documentation * Extend tests * Minor improvements * Improve documentation about hashing * Replace hash in sourcemap file * Provide ChunkInfo in banner/footer/intro/outro * Extract hashing logic * Clean up hashing logic * Add ExternalChunk wrapper * Store inputBase on Chunk * Store snippets on Chunk * Align chunk interfaces * Reduce this. property access * Move dynamicImportFunction warning to options normalization * Restructure rendering logic * Do not run on Node 10 * Update documentation * Try to fix Windows tests * Improve coverage * Remove graph background colors 3.0.0-0 * Set up browser build * Generate commithash inline * Remove execa * Chmod executable from rollup config * Adjust pkg.files * Copy types into build * Work on release script * Continue work on release script * Continue work on release script * Finish release script * Push correct REPL artefacts * Add comments to released PRs and issues * fixup! [v3.0] New hashing algorithm that "fixes (nearly) everything" (#4543) * Add Rollup-in-browser example --- .github/workflows/tests.yml | 2 +- LICENSE.md | 49 -- browser/LICENSE.md | 187 ++++ browser/package.json | 36 + build-plugins/add-cli-entry.ts | 11 +- build-plugins/clean-before-write.ts | 16 + build-plugins/copy-types.ts | 18 + build-plugins/generate-license-file.ts | 27 +- build-plugins/get-banner.ts | 30 + docs/06-faqs.md | 90 ++ package-lock.json | 1111 ++++++++++++++++++++++-- package.json | 31 +- rollup.config.ts | 70 +- scripts/check-release.js | 7 + scripts/colors.js | 8 + scripts/find-config.js | 4 +- scripts/helpers.js | 45 + scripts/perf-init.js | 46 +- scripts/perf.js | 24 +- scripts/release.js | 335 +++++++ scripts/test-package.js | 2 +- scripts/update-git-commit.js | 13 - scripts/update-snapshots.js | 6 +- test/browser/index.js | 2 +- 24 files changed, 1940 insertions(+), 230 deletions(-) create mode 100644 browser/LICENSE.md create mode 100644 browser/package.json create mode 100644 build-plugins/clean-before-write.ts create mode 100644 build-plugins/copy-types.ts create mode 100644 build-plugins/get-banner.ts create mode 100755 scripts/check-release.js create mode 100644 scripts/colors.js create mode 100644 scripts/helpers.js create mode 100755 scripts/release.js delete mode 100644 scripts/update-git-commit.js diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d2015df78d7..ca3d7fa148f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,7 +48,7 @@ jobs: - name: Lint run: npm run ci:lint - name: Vulnerabilities - run: npm run security + run: npm audit - name: Run all tests run: npm run ci:test env: diff --git a/LICENSE.md b/LICENSE.md index 98e89d8a276..f3e20d39822 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -292,35 +292,6 @@ Repository: gulpjs/glob-parent --------------------------------------- -## hash.js -License: MIT -By: Fedor Indutny -Repository: git@github.com:indutny/hash.js - ---------------------------------------- - -## inherits -License: ISC -Repository: git://github.com/isaacs/inherits - -> The ISC License -> -> Copyright (c) Isaac Z. Schlueter -> -> Permission to use, copy, modify, and/or distribute this software for any -> purpose with or without fee is hereby granted, provided that the above -> copyright notice and this permission notice appear in all copies. -> -> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -> FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -> LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -> OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -> PERFORMANCE OF THIS SOFTWARE. - ---------------------------------------- - ## is-binary-path License: MIT By: Sindre Sorhus @@ -454,26 +425,6 @@ Repository: https://github.com/rich-harris/magic-string --------------------------------------- -## minimalistic-assert -License: ISC -Repository: https://github.com/calvinmetcalf/minimalistic-assert.git - -> Copyright 2015 Calvin Metcalf -> -> Permission to use, copy, modify, and/or distribute this software for any purpose -> with or without fee is hereby granted, provided that the above copyright notice -> and this permission notice appear in all copies. -> -> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -> FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -> LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -> OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -> PERFORMANCE OF THIS SOFTWARE. - ---------------------------------------- - ## normalize-path License: MIT By: Jon Schlinkert, Blaine Bublitz diff --git a/browser/LICENSE.md b/browser/LICENSE.md new file mode 100644 index 00000000000..8d9cc1268eb --- /dev/null +++ b/browser/LICENSE.md @@ -0,0 +1,187 @@ +# Rollup core license +Rollup is released under the MIT license: + +The MIT License (MIT) + +Copyright (c) 2017 [these people](https://github.com/rollup/rollup/graphs/contributors) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# Licenses of bundled dependencies +The published Rollup artifact additionally contains code with the following licenses: +MIT, ISC + +# Bundled dependencies: +## @rollup/pluginutils +License: MIT +By: Rich Harris +Repository: rollup/plugins + +--------------------------------------- + +## acorn +License: MIT +By: Marijn Haverbeke, Ingvar Stepanyan, Adrian Heine +Repository: https://github.com/acornjs/acorn.git + +> MIT License +> +> Copyright (C) 2012-2022 by various contributors (see AUTHORS) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## acorn-walk +License: MIT +By: Marijn Haverbeke, Ingvar Stepanyan, Adrian Heine +Repository: https://github.com/acornjs/acorn.git + +> MIT License +> +> Copyright (C) 2012-2020 by various contributors (see AUTHORS) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +--------------------------------------- + +## hash.js +License: MIT +By: Fedor Indutny +Repository: git@github.com:indutny/hash.js + +--------------------------------------- + +## inherits +License: ISC +Repository: git://github.com/isaacs/inherits + +> The ISC License +> +> Copyright (c) Isaac Z. Schlueter +> +> Permission to use, copy, modify, and/or distribute this software for any +> purpose with or without fee is hereby granted, provided that the above +> copyright notice and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +> FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +> LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +> OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +> PERFORMANCE OF THIS SOFTWARE. + +--------------------------------------- + +## is-reference +License: MIT +By: Rich Harris +Repository: git+https://github.com/Rich-Harris/is-reference.git + +--------------------------------------- + +## locate-character +License: MIT +By: Rich Harris +Repository: Rich-Harris/locate-character + +--------------------------------------- + +## magic-string +License: MIT +By: Rich Harris +Repository: https://github.com/rich-harris/magic-string + +> Copyright 2018 Rich Harris +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------- + +## minimalistic-assert +License: ISC +Repository: https://github.com/calvinmetcalf/minimalistic-assert.git + +> Copyright 2015 Calvin Metcalf +> +> Permission to use, copy, modify, and/or distribute this software for any purpose +> with or without fee is hereby granted, provided that the above copyright notice +> and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +> FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +> LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +> OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +> PERFORMANCE OF THIS SOFTWARE. + +--------------------------------------- + +## sourcemap-codec +License: MIT +By: Rich Harris +Repository: https://github.com/Rich-Harris/sourcemap-codec + +> The MIT License +> +> Copyright (c) 2015 Rich Harris +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. diff --git a/browser/package.json b/browser/package.json new file mode 100644 index 00000000000..05d311fc74c --- /dev/null +++ b/browser/package.json @@ -0,0 +1,36 @@ +{ + "name": "@rollup/browser", + "version": "3.0.0-2", + "description": "Next-generation ES module bundler browser build", + "main": "dist/rollup.browser.js", + "module": "dist/es/rollup.browser.js", + "types": "dist/rollup.browser.d.ts", + "repository": "rollup/rollup", + "keywords": [ + "modules", + "bundler", + "bundling", + "es6", + "optimizer", + "browser" + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/rollup/rollup/issues" + }, + "homepage": "https://rollupjs.org/", + "files": [ + "dist/**/*.js", + "dist/*.d.ts", + "dist/es/package.json", + "dist/rollup.browser.js.map" + ], + "exports": { + ".": { + "types": "./dist/rollup.d.ts", + "require": "./dist/rollup.browser.js", + "import": "./dist/es/rollup.browser.js" + }, + "./dist/*": "./dist/*" + } +} diff --git a/build-plugins/add-cli-entry.ts b/build-plugins/add-cli-entry.ts index eb32e55acd5..fbc16150c6d 100644 --- a/build-plugins/add-cli-entry.ts +++ b/build-plugins/add-cli-entry.ts @@ -1,11 +1,15 @@ +import { chmod } from 'fs/promises'; +import { resolve } from 'path'; import MagicString from 'magic-string'; import type { Plugin } from 'rollup'; +const CLI_CHUNK = 'bin/rollup'; + export default function addCliEntry(): Plugin { return { buildStart() { this.emitFile({ - fileName: 'bin/rollup', + fileName: CLI_CHUNK, id: 'cli/cli.ts', preserveSignature: false, type: 'chunk' @@ -13,12 +17,15 @@ export default function addCliEntry(): Plugin { }, name: 'add-cli-entry', renderChunk(code, chunkInfo) { - if (chunkInfo.fileName === 'bin/rollup') { + if (chunkInfo.fileName === CLI_CHUNK) { const magicString = new MagicString(code); magicString.prepend('#!/usr/bin/env node\n\n'); return { code: magicString.toString(), map: magicString.generateMap({ hires: true }) }; } return null; + }, + writeBundle({ dir }) { + return chmod(resolve(dir!, CLI_CHUNK), '755'); } }; } diff --git a/build-plugins/clean-before-write.ts b/build-plugins/clean-before-write.ts new file mode 100644 index 00000000000..fc9109e7119 --- /dev/null +++ b/build-plugins/clean-before-write.ts @@ -0,0 +1,16 @@ +import { remove } from 'fs-extra'; +import type { Plugin } from 'rollup'; + +export default function cleanBeforeWrite(dir: string): Plugin { + let removePromise: Promise | null = null; + return { + generateBundle(_options, _bundle, isWrite) { + if (isWrite) { + // Only remove before first write, but make all writes wait on the removal + removePromise ||= remove(dir); + return removePromise; + } + }, + name: 'clean-before-write' + }; +} diff --git a/build-plugins/copy-types.ts b/build-plugins/copy-types.ts new file mode 100644 index 00000000000..b2956e2218f --- /dev/null +++ b/build-plugins/copy-types.ts @@ -0,0 +1,18 @@ +import { resolve } from 'path'; +import { readFile } from 'fs-extra'; +import type { Plugin } from 'rollup'; + +export default function copyTypes(fileName: string): Plugin { + return { + async generateBundle(_options, _bundle, isWrite) { + if (isWrite) { + this.emitFile({ + fileName, + source: await readFile(resolve('src/rollup/types.d.ts'), 'utf8'), + type: 'asset' + }); + } + }, + name: 'copy-types' + }; +} diff --git a/build-plugins/generate-license-file.ts b/build-plugins/generate-license-file.ts index 1ebc97d873a..ecc514d2aa2 100644 --- a/build-plugins/generate-license-file.ts +++ b/build-plugins/generate-license-file.ts @@ -1,11 +1,16 @@ import { promises as fs } from 'fs'; +import { join } from 'path'; import type { PluginImpl } from 'rollup'; import license, { type Dependency, type Person } from 'rollup-plugin-license'; -async function generateLicenseFile(dependencies: readonly Dependency[]): Promise { +async function generateLicenseFile( + dir: string, + dependencies: readonly Dependency[] +): Promise { const coreLicense = await fs.readFile('LICENSE-CORE.md', 'utf8'); const licenses = new Set(); const dependencyLicenseTexts = Array.from(dependencies) + .filter(({ name }) => name !== '@rollup/browser') .sort(({ name: nameA }, { name: nameB }) => (nameA! > nameB! ? 1 : -1)) .map(({ name, license, licenseText, author, maintainers, contributors, repository }) => { let text = `## ${name}\n`; @@ -52,9 +57,10 @@ async function generateLicenseFile(dependencies: readonly Dependency[]): Promise `${Array.from(licenses).join(', ')}\n\n` + `# Bundled dependencies:\n` + dependencyLicenseTexts; - const existingLicenseText = await fs.readFile('LICENSE.md', 'utf8'); + const licenseFile = join(dir, 'LICENSE.md'); + const existingLicenseText = await fs.readFile(licenseFile, 'utf8'); if (existingLicenseText !== licenseText) { - await fs.writeFile('LICENSE.md', licenseText); + await fs.writeFile(licenseFile, licenseText); console.warn('LICENSE.md updated. You should commit the updated file.'); } } @@ -64,23 +70,22 @@ interface LicenseHandler { writeLicense: PluginImpl; } -export default function getLicenseHandler(): LicenseHandler { +export default function getLicenseHandler(dir: string): LicenseHandler { const licenses = new Map(); + function addLicenses(dependencies: readonly Dependency[]) { + for (const dependency of dependencies) { + licenses.set(dependency.name!, dependency); + } + } return { collectLicenses() { - function addLicenses(dependencies: readonly Dependency[]) { - for (const dependency of dependencies) { - licenses.set(dependency.name!, dependency); - } - } - return license({ thirdParty: addLicenses }); }, writeLicense() { return { name: 'write-license', writeBundle() { - return generateLicenseFile(Array.from(licenses.values())); + return generateLicenseFile(dir, Array.from(licenses.values())); } }; } diff --git a/build-plugins/get-banner.ts b/build-plugins/get-banner.ts new file mode 100644 index 00000000000..a406f75a3cb --- /dev/null +++ b/build-plugins/get-banner.ts @@ -0,0 +1,30 @@ +import { exec } from 'child_process'; +import { env } from 'process'; +import { promisify } from 'util'; +import { version } from '../package.json'; + +const execPromise = promisify(exec); + +function generateBanner(commitHash: string): string { + const date = new Date( + env.SOURCE_DATE_EPOCH ? 1000 * +env.SOURCE_DATE_EPOCH : Date.now() + ).toUTCString(); + + return `/* + @license + Rollup.js v${version} + ${date} - commit ${commitHash} + + https://github.com/rollup/rollup + + Released under the MIT License. +*/`; +} + +let getBannerPromise: Promise | null = null; + +export default async function getBanner(): Promise { + return (getBannerPromise ||= execPromise('git rev-parse HEAD').then(({ stdout }) => + generateBanner(stdout.trim()) + )); +} diff --git a/docs/06-faqs.md b/docs/06-faqs.md index 99fc03e2768..0d6e4827a54 100755 --- a/docs/06-faqs.md +++ b/docs/06-faqs.md @@ -102,6 +102,96 @@ This is however a problem for polyfills, as those usually need to be executed fi Rollup is already used by many major JavaScript libraries, and can also be used to build the vast majority of applications. However if you want to use code-splitting or dynamic imports with older browsers, you will need an additional runtime to handle loading missing chunks. We recommend using the [SystemJS Production Build](https://github.com/systemjs/systemjs#browser-production) as it integrates nicely with Rollup's system format output and is capable of properly handling all the ES module live bindings and re-export edge cases. Alternatively, an AMD loader can be used as well. +#### How do I run Rollup itself in a browser + +While the regular Rollup build relies on some NodeJS features, there is also a browser build available that only uses browser APIs. You can install it via + +``` +npm install @rollup/browser +``` + +and in your script, import it via + +```js +import { rollup } from '@rollup/browser'; +``` + +Alternatively, you can import from a CDN, e.g. for the ESM build + +```js +import * as rollup from 'https://unpkg.com/@rollup/browser/dist/es/rollup.browser.js'; +``` + +and for the UMD build + +```html + +``` + +which will create a global variable `window.rollup`. As the browser build cannot access the file system, you need to provide plugins that resolve and load all modules you want to bundle. Here is a contrived example that does this: + +```js +const modules = { + 'main.js': "import foo from 'foo.js'; console.log(foo);", + 'foo.js': 'export default 42;' +}; + +rollup + .rollup({ + input: 'main.js', + plugins: [ + { + name: 'loader', + resolveId(source) { + if (modules.hasOwnProperty(source)) { + return source; + } + }, + load(id) { + if (modules.hasOwnProperty(id)) { + return modules[id]; + } + } + } + ] + }) + .then(bundle => bundle.generate({ format: 'es' })) + .then(({ output }) => console.log(output[0].code)); +``` + +This example only supports two imports, `"main.js"` and `"foo.js"`, and no relative imports. Here is another example that uses absolute URLs as entry points and supports relative imports. In that case, we are just re-bundling Rollup itself, but it could be used on any other URL that exposes an ES module: + +```js +rollup + .rollup({ + input: 'https://unpkg.com/rollup/dist/es/rollup.js', + plugins: [ + { + name: 'url-resolver', + resolveId(source, importer) { + if (source[0] !== '.') { + try { + new URL(source); + // If it is a valid URL, return it + return source; + } catch { + // Otherwise make it external + return { id: source, external: true }; + } + } + return new URL(source, importer).href; + }, + async load(id) { + const response = await fetch(id); + return response.text(); + } + } + ] + }) + .then(bundle => bundle.generate({ format: 'es' })) + .then(({ output }) => console.log(output)); +``` + #### Who made the Rollup logo? It's lovely. [Julian Lloyd](https://twitter.com/jlmakes)! diff --git a/package-lock.json b/package-lock.json index ab456df2db1..efa85d88270 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,11 @@ "name": "rollup", "version": "3.0.0-2", "license": "MIT", + "dependencies": { + "github-api": "^3.4.0", + "inquirer": "^9.0.2", + "semver": "^7.3.7" + }, "bin": { "rollup": "dist/bin/rollup" }, @@ -40,7 +45,6 @@ "eslint-config-prettier": "^8.5.0", "eslint-plugin-import": "^2.26.0", "eslint-plugin-prettier": "^4.2.1", - "execa": "^6.1.0", "fixturify": "^2.1.1", "fs-extra": "^10.1.0", "get-package-type": "^0.1.0", @@ -1525,12 +1529,39 @@ "node": ">=8" } }, + "node_modules/axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "dependencies": { + "follow-redirects": "^1.14.0" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -1540,6 +1571,16 @@ "node": ">=8" } }, + "node_modules/bl": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-5.0.0.tgz", + "integrity": "sha512-8vxFNZ0pflFfi0WXA3WQXlj6CaMEwsmh63I1CNp0q+wWv8sD0ARx1KovSQd0l2GkwrMIOyedq0EF1FxI+RCZLQ==", + "dependencies": { + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -1644,6 +1685,29 @@ "sourcemap-codec": "^1.4.8" } }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -1738,6 +1802,11 @@ "node": ">=4" } }, + "node_modules/chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" + }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -1786,6 +1855,17 @@ "node": ">=8" } }, + "node_modules/cli-spinners": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", + "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/cli-truncate": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-3.1.0.tgz", @@ -1802,6 +1882,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/cli-width": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.0.0.tgz", + "integrity": "sha512-ZksGS2xpa/bYkNzN3BAw1wEjsLV/ZKOf/CCrJ/QOBsxx6fOARIkwTutxp1XIOIohi6HKmOFjMoK/XaqDVUpEEw==", + "engines": { + "node": ">= 12" + } + }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -1842,6 +1930,14 @@ "node": ">=8" } }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "engines": { + "node": ">=0.8" + } + }, "node_modules/color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -1992,6 +2088,14 @@ "node": ">=8" } }, + "node_modules/defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha512-s82itHOnYrN0Ib8r+z7laQz3sdE+4FP3d9Q7VLO7U+KRT+CR0GsWuyHxzdAY82I7cXv0G/twrqomTJLOssO5HA==", + "dependencies": { + "clone": "^1.0.2" + } + }, "node_modules/define-properties": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", @@ -2044,8 +2148,7 @@ "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, "node_modules/electron-to-chromium": { "version": "1.4.184", @@ -2056,8 +2159,7 @@ "node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, "node_modules/ensure-posix-path": { "version": "1.1.1", @@ -2628,6 +2730,19 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -2677,6 +2792,43 @@ "reusify": "^1.0.4" } }, + "node_modules/figures": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/figures/-/figures-4.0.1.tgz", + "integrity": "sha512-rElJwkA/xS04Vfg+CaZodpso7VqBknOYbzi6I76hI4X80RUjkSxO2oAyPmGbuXUppywjqndOrQDl817hDnI++w==", + "dependencies": { + "escape-string-regexp": "^5.0.0", + "is-unicode-supported": "^1.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/figures/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/figures/node_modules/is-unicode-supported": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.2.0.tgz", + "integrity": "sha512-wH+U77omcRzevfIG8dDhTS0V9zZyweakfD01FULl97+0EHiJTTZtJqxPSkIIo/SDPv/i07k/C9jAPY+jwLLeUQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -2807,6 +2959,25 @@ "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", "dev": true }, + "node_modules/follow-redirects": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", + "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/foreground-child": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", @@ -2996,6 +3167,30 @@ "get-symbol-from-current-process-h": "^1.0.1" } }, + "node_modules/github-api": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/github-api/-/github-api-3.4.0.tgz", + "integrity": "sha512-2yYqYS6Uy4br1nw0D3VrlYWxtGTkUhIZrumBrcBwKdBOzMT8roAe8IvI6kjIOkxqxapKR5GkEsHtz3Du/voOpA==", + "dependencies": { + "axios": "^0.21.1", + "debug": "^2.2.0", + "js-base64": "^2.1.9", + "utf8": "^2.1.1" + } + }, + "node_modules/github-api/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/github-api/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -3224,6 +3419,36 @@ "url": "https://github.com/sponsors/typicode" } }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/ignore": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", @@ -3280,8 +3505,171 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/inquirer": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.0.2.tgz", + "integrity": "sha512-AqmDHmz3bIe573OiM4svTZzajBzff1xpuzYAimW8gjzW5ncuPllWB8t/GKl+NSuKRJaKyIF2bU2RCx8H1dwqyQ==", + "dependencies": { + "ansi-escapes": "^5.0.0", + "chalk": "^5.0.1", + "cli-cursor": "^4.0.0", + "cli-width": "^4.0.0", + "external-editor": "^3.0.3", + "figures": "^4.0.1", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^6.1.2", + "run-async": "^2.4.0", + "rxjs": "^7.5.6", + "string-width": "^5.1.2", + "strip-ansi": "^7.0.1", + "through": "^2.3.6", + "wrap-ansi": "^8.0.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/inquirer/node_modules/ansi-escapes": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", + "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", + "dependencies": { + "type-fest": "^1.0.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/inquirer/node_modules/ansi-styles": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.1.0.tgz", + "integrity": "sha512-VbqNsoz55SYGczauuup0MFUyXNQviSpFTj1RQtFzmQLk18qbVSpTFFGMT293rmDaQuKCT6InmbuEyUne4mTuxQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/inquirer/node_modules/chalk": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", + "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/inquirer/node_modules/cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "dependencies": { + "restore-cursor": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/inquirer/node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/inquirer/node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/wrap-ansi": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.0.1.tgz", + "integrity": "sha512-QFF+ufAqhoYHvoHdajT/Po7KoXVBPXS2bgjIam5isfWJPfIOnQZ50JtUiVvCv/sjgacf3yRrt2ZKUZ/V4itN4g==", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } }, "node_modules/internal-slot": { "version": "1.0.3", @@ -3430,6 +3818,17 @@ "node": ">=0.10.0" } }, + "node_modules/is-interactive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", + "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", @@ -3785,6 +4184,11 @@ "node": ">=8" } }, + "node_modules/js-base64": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz", + "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==" + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -4044,8 +4448,7 @@ "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "node_modules/lodash.flattendeep": { "version": "4.4.0", @@ -4260,7 +4663,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -4623,6 +5025,11 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "node_modules/mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" + }, "node_modules/nanoid": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", @@ -5063,7 +5470,150 @@ "word-wrap": "^1.2.3" }, "engines": { - "node": ">= 0.8.0" + "node": ">= 0.8.0" + } + }, + "node_modules/ora": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/ora/-/ora-6.1.2.tgz", + "integrity": "sha512-EJQ3NiP5Xo94wJXIzAyOtSb0QEIAUu7m8t6UZ9krbz0vAJqr92JpcK/lEXg91q6B9pEGqrykkd2EQplnifDSBw==", + "dependencies": { + "bl": "^5.0.0", + "chalk": "^5.0.0", + "cli-cursor": "^4.0.0", + "cli-spinners": "^2.6.1", + "is-interactive": "^2.0.0", + "is-unicode-supported": "^1.1.0", + "log-symbols": "^5.1.0", + "strip-ansi": "^7.0.1", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ora/node_modules/chalk": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", + "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ora/node_modules/cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "dependencies": { + "restore-cursor": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/is-unicode-supported": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.2.0.tgz", + "integrity": "sha512-wH+U77omcRzevfIG8dDhTS0V9zZyweakfD01FULl97+0EHiJTTZtJqxPSkIIo/SDPv/i07k/C9jAPY+jwLLeUQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/log-symbols": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", + "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", + "dependencies": { + "chalk": "^5.0.0", + "is-unicode-supported": "^1.1.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/ora/node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "engines": { + "node": ">=0.10.0" } }, "node_modules/p-limit": { @@ -5432,6 +5982,19 @@ "safe-buffer": "^5.1.0" } }, + "node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -5776,6 +6339,14 @@ "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", "dev": true }, + "node_modules/run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "engines": { + "node": ">=0.12.0" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -5800,10 +6371,9 @@ } }, "node_modules/rxjs": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.5.tgz", - "integrity": "sha512-sy+H0pQofO95VDmFLzyaw9xNJU4KTRSwQIGM6+iG3SypAtCiLDzpeG8sJrNCWn2Up9km+KhkvTdbkrdy+yzZdw==", - "dev": true, + "version": "7.5.6", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.6.tgz", + "integrity": "sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw==", "dependencies": { "tslib": "^2.1.0" } @@ -5814,11 +6384,15 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, "node_modules/semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -5925,8 +6499,7 @@ "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, "node_modules/slash": { "version": "3.0.0", @@ -6081,6 +6654,33 @@ "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "dev": true }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/string-argv": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", @@ -6094,7 +6694,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -6111,7 +6710,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, "engines": { "node": ">=12" }, @@ -6123,7 +6721,6 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", - "dev": true, "dependencies": { "ansi-regex": "^6.0.1" }, @@ -6284,8 +6881,7 @@ "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" }, "node_modules/time-zone": { "version": "2.0.0", @@ -6299,6 +6895,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -6356,8 +6963,7 @@ "node_modules/tslib": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", - "dev": true + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" }, "node_modules/tsutils": { "version": "3.21.0", @@ -6525,6 +7131,16 @@ "punycode": "^2.1.0" } }, + "node_modules/utf8": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.2.tgz", + "integrity": "sha512-QXo+O/QkLP/x1nyi54uQiG0XrODxdysuQvE5dtVqv7F5K2Qb6FsN+qbr6KhF5wQ20tfcV3VQp0/2x1e1MRSPWg==" + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, "node_modules/uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -6555,6 +7171,14 @@ "node": "8.* || >= 10.*" } }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "dependencies": { + "defaults": "^1.0.3" + } + }, "node_modules/weak-napi": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/weak-napi/-/weak-napi-2.0.2.tgz", @@ -6728,8 +7352,7 @@ "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/yaml": { "version": "2.1.1", @@ -7950,18 +8573,41 @@ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true }, + "axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "requires": { + "follow-redirects": "^1.14.0" + } + }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, "binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true }, + "bl": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-5.0.0.tgz", + "integrity": "sha512-8vxFNZ0pflFfi0WXA3WQXlj6CaMEwsmh63I1CNp0q+wWv8sD0ARx1KovSQd0l2GkwrMIOyedq0EF1FxI+RCZLQ==", + "requires": { + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -8038,6 +8684,15 @@ } } }, + "buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -8101,6 +8756,11 @@ "supports-color": "^5.3.0" } }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" + }, "chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -8132,6 +8792,11 @@ "restore-cursor": "^3.1.0" } }, + "cli-spinners": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", + "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==" + }, "cli-truncate": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-3.1.0.tgz", @@ -8142,6 +8807,11 @@ "string-width": "^5.0.0" } }, + "cli-width": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.0.0.tgz", + "integrity": "sha512-ZksGS2xpa/bYkNzN3BAw1wEjsLV/ZKOf/CCrJ/QOBsxx6fOARIkwTutxp1XIOIohi6HKmOFjMoK/XaqDVUpEEw==" + }, "cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -8178,6 +8848,11 @@ } } }, + "clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==" + }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -8294,6 +8969,14 @@ "strip-bom": "^4.0.0" } }, + "defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha512-s82itHOnYrN0Ib8r+z7laQz3sdE+4FP3d9Q7VLO7U+KRT+CR0GsWuyHxzdAY82I7cXv0G/twrqomTJLOssO5HA==", + "requires": { + "clone": "^1.0.2" + } + }, "define-properties": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", @@ -8331,8 +9014,7 @@ "eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, "electron-to-chromium": { "version": "1.4.184", @@ -8343,8 +9025,7 @@ "emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, "ensure-posix-path": { "version": "1.1.1", @@ -8782,6 +9463,16 @@ "strip-final-newline": "^3.0.0" } }, + "external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -8828,6 +9519,27 @@ "reusify": "^1.0.4" } }, + "figures": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/figures/-/figures-4.0.1.tgz", + "integrity": "sha512-rElJwkA/xS04Vfg+CaZodpso7VqBknOYbzi6I76hI4X80RUjkSxO2oAyPmGbuXUppywjqndOrQDl817hDnI++w==", + "requires": { + "escape-string-regexp": "^5.0.0", + "is-unicode-supported": "^1.2.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==" + }, + "is-unicode-supported": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.2.0.tgz", + "integrity": "sha512-wH+U77omcRzevfIG8dDhTS0V9zZyweakfD01FULl97+0EHiJTTZtJqxPSkIIo/SDPv/i07k/C9jAPY+jwLLeUQ==" + } + } + }, "file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -8930,6 +9642,11 @@ "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", "dev": true }, + "follow-redirects": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", + "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==" + }, "foreground-child": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", @@ -9059,6 +9776,32 @@ "get-symbol-from-current-process-h": "^1.0.1" } }, + "github-api": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/github-api/-/github-api-3.4.0.tgz", + "integrity": "sha512-2yYqYS6Uy4br1nw0D3VrlYWxtGTkUhIZrumBrcBwKdBOzMT8roAe8IvI6kjIOkxqxapKR5GkEsHtz3Du/voOpA==", + "requires": { + "axios": "^0.21.1", + "debug": "^2.2.0", + "js-base64": "^2.1.9", + "utf8": "^2.1.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + } + } + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -9214,6 +9957,19 @@ "integrity": "sha512-xs7/chUH/CKdOCs7Zy0Aev9e/dKOMZf3K1Az1nar3tzlv0jfqnYtu235bstsWTmXOR0EfINrPa97yy4Lz6RiKw==", "dev": true }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, "ignore": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", @@ -9255,8 +10011,107 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "inquirer": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.0.2.tgz", + "integrity": "sha512-AqmDHmz3bIe573OiM4svTZzajBzff1xpuzYAimW8gjzW5ncuPllWB8t/GKl+NSuKRJaKyIF2bU2RCx8H1dwqyQ==", + "requires": { + "ansi-escapes": "^5.0.0", + "chalk": "^5.0.1", + "cli-cursor": "^4.0.0", + "cli-width": "^4.0.0", + "external-editor": "^3.0.3", + "figures": "^4.0.1", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^6.1.2", + "run-async": "^2.4.0", + "rxjs": "^7.5.6", + "string-width": "^5.1.2", + "strip-ansi": "^7.0.1", + "through": "^2.3.6", + "wrap-ansi": "^8.0.1" + }, + "dependencies": { + "ansi-escapes": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", + "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", + "requires": { + "type-fest": "^1.0.2" + } + }, + "ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==" + }, + "ansi-styles": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.1.0.tgz", + "integrity": "sha512-VbqNsoz55SYGczauuup0MFUyXNQviSpFTj1RQtFzmQLk18qbVSpTFFGMT293rmDaQuKCT6InmbuEyUne4mTuxQ==" + }, + "chalk": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", + "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==" + }, + "cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "requires": { + "restore-cursor": "^4.0.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "requires": { + "ansi-regex": "^6.0.1" + } + }, + "type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==" + }, + "wrap-ansi": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.0.1.tgz", + "integrity": "sha512-QFF+ufAqhoYHvoHdajT/Po7KoXVBPXS2bgjIam5isfWJPfIOnQZ50JtUiVvCv/sjgacf3yRrt2ZKUZ/V4itN4g==", + "requires": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + } + } + } }, "internal-slot": { "version": "1.0.3", @@ -9357,6 +10212,11 @@ "is-extglob": "^2.1.1" } }, + "is-interactive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", + "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==" + }, "is-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", @@ -9620,6 +10480,11 @@ } } }, + "js-base64": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz", + "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==" + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -9811,8 +10676,7 @@ "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "lodash.flattendeep": { "version": "4.4.0", @@ -9974,7 +10838,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, "requires": { "yallist": "^4.0.0" } @@ -10235,6 +11098,11 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" + }, "nanoid": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", @@ -10569,6 +11437,91 @@ "word-wrap": "^1.2.3" } }, + "ora": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/ora/-/ora-6.1.2.tgz", + "integrity": "sha512-EJQ3NiP5Xo94wJXIzAyOtSb0QEIAUu7m8t6UZ9krbz0vAJqr92JpcK/lEXg91q6B9pEGqrykkd2EQplnifDSBw==", + "requires": { + "bl": "^5.0.0", + "chalk": "^5.0.0", + "cli-cursor": "^4.0.0", + "cli-spinners": "^2.6.1", + "is-interactive": "^2.0.0", + "is-unicode-supported": "^1.1.0", + "log-symbols": "^5.1.0", + "strip-ansi": "^7.0.1", + "wcwidth": "^1.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==" + }, + "chalk": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", + "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==" + }, + "cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "requires": { + "restore-cursor": "^4.0.0" + } + }, + "is-unicode-supported": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.2.0.tgz", + "integrity": "sha512-wH+U77omcRzevfIG8dDhTS0V9zZyweakfD01FULl97+0EHiJTTZtJqxPSkIIo/SDPv/i07k/C9jAPY+jwLLeUQ==" + }, + "log-symbols": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", + "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", + "requires": { + "chalk": "^5.0.0", + "is-unicode-supported": "^1.1.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "requires": { + "ansi-regex": "^6.0.1" + } + } + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==" + }, "p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", @@ -10809,6 +11762,16 @@ "safe-buffer": "^5.1.0" } }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, "readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -11069,6 +12032,11 @@ } } }, + "run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==" + }, "run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -11079,10 +12047,9 @@ } }, "rxjs": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.5.tgz", - "integrity": "sha512-sy+H0pQofO95VDmFLzyaw9xNJU4KTRSwQIGM6+iG3SypAtCiLDzpeG8sJrNCWn2Up9km+KhkvTdbkrdy+yzZdw==", - "dev": true, + "version": "7.5.6", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.6.tgz", + "integrity": "sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw==", "requires": { "tslib": "^2.1.0" } @@ -11093,11 +12060,15 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, "semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dev": true, "requires": { "lru-cache": "^6.0.0" } @@ -11177,8 +12148,7 @@ "signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, "slash": { "version": "3.0.0", @@ -11313,6 +12283,21 @@ "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "dev": true }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + } + } + }, "string-argv": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", @@ -11323,7 +12308,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, "requires": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -11333,14 +12317,12 @@ "ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==" }, "strip-ansi": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", - "dev": true, "requires": { "ansi-regex": "^6.0.1" } @@ -11457,8 +12439,7 @@ "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" }, "time-zone": { "version": "2.0.0", @@ -11466,6 +12447,14 @@ "integrity": "sha512-2cp/YLRm7ly33CzvySyXqo/QEOu4KMn6fCof0gpqosWY3PEJUJJhXP/Cb2wXFUuCzWWJYEmPvdHNzjLlfXC49A==", "dev": true }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "requires": { + "os-tmpdir": "~1.0.2" + } + }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -11513,8 +12502,7 @@ "tslib": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", - "dev": true + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" }, "tsutils": { "version": "3.21.0", @@ -11628,6 +12616,16 @@ "punycode": "^2.1.0" } }, + "utf8": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.2.tgz", + "integrity": "sha512-QXo+O/QkLP/x1nyi54uQiG0XrODxdysuQvE5dtVqv7F5K2Qb6FsN+qbr6KhF5wQ20tfcV3VQp0/2x1e1MRSPWg==" + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, "uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -11652,6 +12650,14 @@ "minimatch": "^3.0.4" } }, + "wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "requires": { + "defaults": "^1.0.3" + } + }, "weak-napi": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/weak-napi/-/weak-napi-2.0.2.tgz", @@ -11790,8 +12796,7 @@ "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "yaml": { "version": "2.1.1", diff --git a/package.json b/package.json index 22876ae4445..60abf839a11 100644 --- a/package.json +++ b/package.json @@ -4,14 +4,14 @@ "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js", - "typings": "dist/rollup.d.ts", + "types": "dist/rollup.d.ts", "bin": { "rollup": "dist/bin/rollup" }, "scripts": { - "build": "shx rm -rf dist && node scripts/update-git-commit.js && rollup --config rollup.config.ts --configPlugin typescript && shx cp src/rollup/types.d.ts dist/rollup.d.ts && shx chmod a+x dist/bin/rollup", - "build:cjs": "shx rm -rf dist && rollup --config rollup.config.ts --configPlugin typescript --configTest && shx cp src/rollup/types.d.ts dist/rollup.d.ts && shx chmod a+x dist/bin/rollup", - "build:bootstrap": "node dist/bin/rollup --config rollup.config.ts --configPlugin typescript && shx cp src/rollup/types.d.ts dist/rollup.d.ts && shx chmod a+x dist/bin/rollup && cp -r dist browser/", + "build": "rollup --config rollup.config.ts --configPlugin typescript", + "build:cjs": "rollup --config rollup.config.ts --configPlugin typescript --configTest", + "build:bootstrap": "node dist/bin/rollup --config rollup.config.ts --configPlugin typescript", "ci:lint": "npm run lint:nofix", "ci:test": "npm run build:cjs && npm run build:bootstrap && npm run test:all", "ci:test:only": "npm run build:cjs && npm run build:bootstrap && npm run test:only", @@ -21,10 +21,9 @@ "lint:markdown": "prettier --write \"**/*.md\"", "perf": "npm run build:cjs && node --expose-gc scripts/perf.js", "perf:init": "node scripts/perf-init.js", - "postpublish": "git push && git push --tags", - "prepare": "husky install && npm run build", - "prepublishOnly": "git pull --ff-only && npm ci && npm run lint:nofix && npm run security && npm run build:bootstrap && npm run test:all", - "security": "npm audit", + "prepare": "husky install && scripts/check-release.js || npm run build", + "prepublishOnly": "scripts/check-release.js", + "release": "node scripts/release.js", "test": "npm run build && npm run test:all", "test:cjs": "npm run build:cjs && npm run test:only", "test:quick": "mocha -b test/test.js", @@ -84,7 +83,6 @@ "eslint-config-prettier": "^8.5.0", "eslint-plugin-import": "^2.26.0", "eslint-plugin-prettier": "^4.2.1", - "execa": "^6.1.0", "fixturify": "^2.1.1", "fs-extra": "^10.1.0", "get-package-type": "^0.1.0", @@ -121,8 +119,7 @@ "dist/**/*.js", "dist/*.d.ts", "dist/bin/rollup", - "dist/es/package.json", - "dist/rollup.browser.js.map" + "dist/es/package.json" ], "engines": { "node": ">=14.0.0", @@ -131,14 +128,16 @@ "exports": { ".": { "types": "./dist/rollup.d.ts", - "node": { - "require": "./dist/rollup.js", - "import": "./dist/es/rollup.js" - }, - "default": "./dist/es/rollup.browser.js" + "require": "./dist/rollup.js", + "import": "./dist/es/rollup.js" }, "./loadConfigFile": "./dist/loadConfigFile.js", "./dist/loadConfigFile": "./dist/loadConfigFile.js", "./dist/*": "./dist/*" + }, + "dependencies": { + "github-api": "^3.4.0", + "inquirer": "^9.0.2", + "semver": "^7.3.7" } } diff --git a/rollup.config.ts b/rollup.config.ts index 01783d5ca12..89dcfe0ab12 100644 --- a/rollup.config.ts +++ b/rollup.config.ts @@ -1,6 +1,5 @@ -import { promises as fs } from 'fs'; import { resolve } from 'path'; -import { env } from 'process'; +import { fileURLToPath } from 'url'; import alias from '@rollup/plugin-alias'; import commonjs from '@rollup/plugin-commonjs'; import json from '@rollup/plugin-json'; @@ -10,36 +9,14 @@ import type { Plugin, RollupOptions, WarningHandlerWithDefault } from 'rollup'; import { string } from 'rollup-plugin-string'; import { terser } from 'rollup-plugin-terser'; import addCliEntry from './build-plugins/add-cli-entry'; +import cleanBeforeWrite from './build-plugins/clean-before-write'; import conditionalFsEventsImport from './build-plugins/conditional-fsevents-import'; +import copyTypes from './build-plugins/copy-types'; import emitModulePackageFile from './build-plugins/emit-module-package-file'; import esmDynamicImport from './build-plugins/esm-dynamic-import'; import getLicenseHandler from './build-plugins/generate-license-file'; +import getBanner from './build-plugins/get-banner'; import replaceBrowserModules from './build-plugins/replace-browser-modules'; -import { version } from './package.json'; - -async function getBanner(): Promise { - let commitHash: string; - - try { - commitHash = await fs.readFile('.commithash', 'utf8'); - } catch { - commitHash = 'unknown'; - } - - const date = new Date( - env.SOURCE_DATE_EPOCH ? 1000 * +env.SOURCE_DATE_EPOCH : Date.now() - ).toUTCString(); - - return `/* - @license - Rollup.js v${version} - ${date} - commit ${commitHash} - - https://github.com/rollup/rollup - - Released under the MIT License. -*/`; -} const onwarn: WarningHandlerWithDefault = warning => { // eslint-disable-next-line no-console @@ -75,14 +52,16 @@ const nodePlugins: Plugin[] = [ ignoreTryCatch: false, include: 'node_modules/**' }), - typescript() + typescript(), + cleanBeforeWrite('dist') ]; export default async function ( command: Record ): Promise { - const banner = await getBanner(); - const { collectLicenses, writeLicense } = getLicenseHandler(); + const { collectLicenses, writeLicense } = getLicenseHandler( + fileURLToPath(new URL('.', import.meta.url)) + ); const commonJSBuild: RollupOptions = { // 'fsevents' is a dependency of 'chokidar' that cannot be bundled as it contains binary code @@ -93,7 +72,7 @@ export default async function ( }, onwarn, output: { - banner, + banner: getBanner, chunkFileNames: 'shared/[name].js', dir: 'dist', entryFileNames: '[name]', @@ -110,7 +89,8 @@ export default async function ( ...nodePlugins, addCliEntry(), esmDynamicImport(), - !command.configTest && collectLicenses() + !command.configTest && collectLicenses(), + !command.configTest && copyTypes('rollup.d.ts') ], strictDeprecations: true, treeshake @@ -130,15 +110,30 @@ export default async function ( minifyInternalExports: false, sourcemap: false }, - plugins: [...nodePlugins, emitModulePackageFile(), collectLicenses()] + plugins: [...nodePlugins, emitModulePackageFile(), collectLicenses(), writeLicense()] }; + const { collectLicenses: collectLicensesBrowser, writeLicense: writeLicenseBrowser } = + getLicenseHandler(fileURLToPath(new URL('browser', import.meta.url))); + const browserBuilds: RollupOptions = { input: 'src/browser-entry.ts', onwarn, output: [ - { banner, file: 'dist/rollup.browser.js', format: 'umd', name: 'rollup', sourcemap: true }, - { banner, file: 'dist/es/rollup.browser.js', format: 'es' } + { + banner: getBanner, + file: 'browser/dist/rollup.browser.js', + format: 'umd', + name: 'rollup', + plugins: [copyTypes('rollup.browser.d.ts')], + sourcemap: true + }, + { + banner: getBanner, + file: 'browser/dist/es/rollup.browser.js', + format: 'es', + plugins: [emitModulePackageFile()] + } ], plugins: [ replaceBrowserModules(), @@ -148,8 +143,9 @@ export default async function ( commonjs(), typescript(), terser({ module: true, output: { comments: 'some' } }), - collectLicenses(), - writeLicense() + collectLicensesBrowser(), + writeLicenseBrowser(), + cleanBeforeWrite('browser/dist') ], strictDeprecations: true, treeshake diff --git a/scripts/check-release.js b/scripts/check-release.js new file mode 100755 index 00000000000..165633c6f1f --- /dev/null +++ b/scripts/check-release.js @@ -0,0 +1,7 @@ +#!/usr/bin/env node + +import { env, exit } from 'node:process'; + +if (env.ROLLUP_RELEASE !== 'releasing') { + exit(1); +} diff --git a/scripts/colors.js b/scripts/colors.js new file mode 100644 index 00000000000..6713d2ff96d --- /dev/null +++ b/scripts/colors.js @@ -0,0 +1,8 @@ +import { env } from 'node:process'; +import { createColors } from 'colorette'; + +// @see https://no-color.org +// @see https://www.npmjs.com/package/chalk +export const { bold, cyan, green, red } = createColors({ + useColor: env.FORCE_COLOR !== '0' && !env.NO_COLOR +}); diff --git a/scripts/find-config.js b/scripts/find-config.js index eba93586b43..023529ac115 100644 --- a/scripts/find-config.js +++ b/scripts/find-config.js @@ -1,5 +1,5 @@ -import { promises as fs } from 'fs'; -import { resolve } from 'path'; +import { promises as fs } from 'node:fs'; +import { resolve } from 'node:path'; export async function findConfigFileName(targetDir) { const filesInWorkingDir = new Set(await fs.readdir(targetDir)); diff --git a/scripts/helpers.js b/scripts/helpers.js new file mode 100644 index 00000000000..4d47b87dfe5 --- /dev/null +++ b/scripts/helpers.js @@ -0,0 +1,45 @@ +import { spawn } from 'node:child_process'; +import { bold, cyan, green } from './colors.js'; + +export function runWithEcho(command, args, options) { + return new Promise((resolve, reject) => { + const cmdString = formatCommand(command, args); + console.error(bold(`\n${cyan`Run>`} ${cmdString}`)); + + const childProcess = spawn(command, args, options); + + childProcess.stdout.pipe(process.stdout); + childProcess.stderr.pipe(process.stderr); + + childProcess.on('close', code => { + if (code) { + reject(new Error(`"${cmdString}" exited with code ${code}.`)); + } else { + console.error(bold(`${green`Finished>`} ${cmdString}\n`)); + resolve(); + } + }); + }); +} + +export function runAndGetStdout(command, args) { + return new Promise((resolve, reject) => { + const childProcess = spawn(command, args); + let stdout = ''; + + childProcess.stderr.pipe(process.stderr); + childProcess.stdout.on('data', data => (stdout += String(data))); + + childProcess.on('close', code => { + if (code) { + reject(new Error(`"${formatCommand(command, args)}" exited with code ${code}.`)); + } else { + resolve(stdout.trim()); + } + }); + }); +} + +function formatCommand(command, args) { + return [command, ...args].join(' '); +} diff --git a/scripts/perf-init.js b/scripts/perf-init.js index 9f719110c00..22e930eb4c4 100644 --- a/scripts/perf-init.js +++ b/scripts/perf-init.js @@ -1,20 +1,21 @@ /* eslint-disable no-console */ -import { fileURLToPath } from 'url'; -import { execa } from 'execa'; +import { argv, chdir, exit } from 'node:process'; +import { fileURLToPath } from 'node:url'; import fs from 'fs-extra'; import { findConfigFileName } from './find-config.js'; +import { runWithEcho } from './helpers.js'; const TARGET_DIR = fileURLToPath(new URL('../perf', import.meta.url).href); const VALID_REPO = /^([^/\s#]+\/[^/\s#]+)(#([^/\s#]+))?$/; -const repoWithBranch = process.argv[2]; +const repoWithBranch = argv[2]; -if (process.argv.length !== 3 || !VALID_REPO.test(repoWithBranch)) { +if (argv.length !== 3 || !VALID_REPO.test(repoWithBranch)) { console.error( 'You need to provide a GitHub repo in the form / or /#branch, e.g. ' + '"npm run perf:init rollup/rollup"' ); - process.exit(1); + exit(1); } console.error(`Cleaning up '${TARGET_DIR}'...`); @@ -22,28 +23,15 @@ fs.removeSync(TARGET_DIR); const [, repo, , branch] = VALID_REPO.exec(repoWithBranch); -setupNewRepo(repo, branch).catch(error => { - console.error(error.message); - process.exit(1); -}); - -function execWithOutput(command, args) { - const call = execa(command, args); - call.stderr.pipe(process.stderr); - return call; -} - -async function setupNewRepo(repo, branch) { - const gitArgs = ['clone', '--depth', 1, '--progress']; - if (branch) { - console.error(`Cloning branch "${branch}" of "${repo}"...`); - gitArgs.push('--branch', branch); - } else { - console.error(`Cloning "${repo}"...`); - } - gitArgs.push(`https://github.com/${repo}.git`, TARGET_DIR); - await execWithOutput('git', gitArgs); - await findConfigFileName(TARGET_DIR); - process.chdir(TARGET_DIR); - await execWithOutput('npm', ['install']); +const gitArgs = ['clone', '--depth', 1, '--progress']; +if (branch) { + console.error(`Cloning branch "${branch}" of "${repo}"...`); + gitArgs.push('--branch', branch); +} else { + console.error(`Cloning "${repo}"...`); } +gitArgs.push(`https://github.com/${repo}.git`, TARGET_DIR); +await runWithEcho('git', gitArgs); +await findConfigFileName(TARGET_DIR); +chdir(TARGET_DIR); +await runWithEcho('npm', ['install']); diff --git a/scripts/perf.js b/scripts/perf.js index 989588efbe0..fc6491235ae 100644 --- a/scripts/perf.js +++ b/scripts/perf.js @@ -1,9 +1,9 @@ /* eslint-disable import/no-unresolved */ /* global gc */ -import { readFileSync, writeFileSync } from 'fs'; -import { cwd } from 'process'; -import { fileURLToPath } from 'url'; +import { readFileSync, writeFileSync } from 'node:fs'; +import { argv, chdir, cwd, exit } from 'node:process'; +import { fileURLToPath } from 'node:url'; import { createColors } from 'colorette'; import prettyBytes from 'pretty-bytes'; import loadConfigFile from '../dist/loadConfigFile.js'; @@ -17,7 +17,7 @@ const { bold, underline, cyan, red, green } = createColors(); const MIN_ABSOLUTE_TIME_DEVIATION = 10; const RELATIVE_DEVIATION_FOR_COLORING = 5; -process.chdir(targetDir); +chdir(targetDir); const configFile = await findConfigFileName(targetDir); const configs = await loadConfigFile( configFile, @@ -26,10 +26,10 @@ const configs = await loadConfigFile( let numberOfRunsToAverage = 6; let numberOfDiscardedResults = 3; -if (process.argv.length >= 3) { - numberOfRunsToAverage = Number.parseInt(process.argv[2]); - if (process.argv.length >= 4) { - numberOfDiscardedResults = Number.parseInt(process.argv[3]); +if (argv.length >= 3) { + numberOfRunsToAverage = Number.parseInt(argv[2]); + if (argv.length >= 4) { + numberOfDiscardedResults = Number.parseInt(argv[3]); } } if (!(numberOfDiscardedResults >= 0) || !(numberOfDiscardedResults < numberOfRunsToAverage)) { @@ -38,7 +38,7 @@ if (!(numberOfDiscardedResults >= 0) || !(numberOfDiscardedResults < numberOfRun 'Usage: "npm run perf [ []]"\n' + 'where 0 <= < ' ); - process.exit(1); + exit(1); } console.info( bold( @@ -114,9 +114,9 @@ async function buildAndGetTimings(config) { config.output = config.output[0]; } gc(); - process.chdir(targetDir); + chdir(targetDir); const bundle = await rollup(config); - process.chdir(initialDir); + chdir(initialDir); await bundle.generate(config.output); return bundle.getTimings(); } @@ -169,7 +169,7 @@ function persistTimings(timings) { console.info(bold(`Saving performance information to new reference file ${cyan(perfFile)}.`)); } catch (e) { console.error(bold(`Could not persist performance information in ${cyan(perfFile)}.`)); - process.exit(1); + exit(1); } } diff --git a/scripts/release.js b/scripts/release.js new file mode 100755 index 00000000000..8590103f5c2 --- /dev/null +++ b/scripts/release.js @@ -0,0 +1,335 @@ +#!/usr/bin/env node + +import { readFile, writeFile } from 'fs/promises'; +import { fileURLToPath } from 'node:url'; +import { chdir, exit } from 'process'; +import GitHub from 'github-api'; +import inquirer from 'inquirer'; +import semverInc from 'semver/functions/inc.js'; +import semverParse from 'semver/functions/parse.js'; +import semverPreRelease from 'semver/functions/prerelease.js'; +import { cyan, red } from './colors.js'; +import { runAndGetStdout, runWithEcho } from './helpers.js'; + +// We execute everything from the main directory +chdir(fileURLToPath(new URL('..', import.meta.url))); + +const MAIN_BRANCH = 'master'; +const MAIN_PKG = 'package.json'; +const BROWSER_PKG = 'browser/package.json'; +const CHANGELOG = 'CHANGELOG.md'; + +const [gh, currentBranch] = await Promise.all([ + getGithubApi(), + runAndGetStdout('git', ['branch', '--show-current']), + runWithEcho('git', ['pull', '--ff-only']) +]); +const [pkg, browserPkg, repo, issues, changelog] = await Promise.all([ + readJson(MAIN_PKG), + readJson(BROWSER_PKG), + gh.getRepo('rollup', 'rollup'), + gh.getIssues('rollup', 'rollup'), + readFile(CHANGELOG, 'utf8') +]); +const isMainBranch = currentBranch === MAIN_BRANCH; +const [newVersion, includedPRs] = await Promise.all([ + getNewVersion(pkg, isMainBranch), + getIncludedPRs(changelog, repo) +]); +if (isMainBranch) { + await addStubChangelogEntry(newVersion, repo, includedPRs, changelog); +} + +await installDependenciesBuildAndTest(); +const changelogEntry = isMainBranch ? await waitForChangelogUpdate(newVersion) : ''; +await updatePackages(pkg, browserPkg); +const gitTag = `v${newVersion}`; +await commitChanges(newVersion, gitTag); +await releasePackages(newVersion); +await pushChanges(gitTag); +if (changelogEntry) { + await createReleaseNotes(changelogEntry, gitTag); +} +await postReleaseComments(includedPRs, issues, newVersion); + +async function getGithubApi() { + const GITHUB_TOKEN = '.github_token'; + try { + const token = (await readFile(GITHUB_TOKEN, 'utf8')).trim(); + return new GitHub({ token }); + } catch (err) { + if (err.code === 'ENOENT') { + console.error( + `Could not find GitHub token file. Please create "${GITHUB_TOKEN}" containing a token with the following permissions: +- public_repo` + ); + exit(1); + } else { + throw err; + } + } +} + +async function readJson(file) { + const content = await readFile(file, 'utf8'); + return JSON.parse(content); +} + +async function getNewVersion(pkg, isMainBranch) { + const { version } = pkg; + const availableIncrements = isMainBranch + ? ['patch', 'minor'] + : semverPreRelease(version) + ? ['prerelease'] + : ['premajor', 'preminor', 'prepatch']; + + const { newVersion } = await inquirer.prompt([ + { + choices: availableIncrements.map(increment => { + const value = semverInc(version, increment); + return { + name: `${increment} (${value})`, + short: increment, + value + }; + }), + message: `Select type of release (currently "${version}" on branch "${currentBranch}"):`, + name: 'newVersion', + type: 'list' + } + ]); + return newVersion; +} + +async function addStubChangelogEntry(version, repo, changelog, includedPRs) { + const { currentVersion, index } = getFirstChangelogEntry(changelog); + if (currentVersion === version) { + console.error( + `Changelog entry for version "${version}" already exists. Please remove the entry and commit the change before trying again.` + ); + exit(1); + } + + await writeFile( + CHANGELOG, + changelog.slice(0, index) + + getNewLogEntry(version, includedPRs) + + '\n\n' + + changelog.slice(index) + ); + + console.log( + cyan(`A stub for the release notes was added to the beginning of "${CHANGELOG}". +Please edit this file to add useful information about bug fixes, features and +breaking changes in the release while the tests are running.`) + ); +} + +function getFirstChangelogEntry(changelog) { + const match = changelog.match( + /(?## (?\d+\.\d+\.\d+)[\s\S]*?)\n+## (?\d+\.\d+\.\d+)/ + ); + if (!match) { + throw new Error('Could not detect any changelog entry.'); + } + const { + groups: { text, currentVersion, previousVersion }, + index + } = match; + return { currentVersion, index, previousVersion, text }; +} + +async function getIncludedPRs(changelog, repo) { + const { currentVersion } = getFirstChangelogEntry(changelog); + const commits = await runAndGetStdout('git', [ + '--no-pager', + 'log', + `v${currentVersion}..HEAD`, + '--pretty=tformat:%s' + ]); + const getPrRegExp = /^([^(]+)\s\(#(\d+)\)$/gm; + const prs = []; + let match; + while ((match = getPrRegExp.exec(commits))) { + prs.push({ pr: match[2], text: match[1].split('\n')[0] }); + } + prs.sort((a, b) => (a.pr > b.pr ? 1 : -1)); + return Promise.all( + prs.map(async ({ pr, text }) => { + const { data } = await repo.getPullRequest(pr); + const bodyWithoutComments = data.body.replace(//g, ''); + const closedIssuesRegexp = /(fix(es|ed)?|(close|resolve)[sd]?) #(\d+)/g; + const closed = []; + while ((match = closedIssuesRegexp.exec(bodyWithoutComments))) { + closed.push(match[4]); + } + return { + author: data.user.login, + closed, + pr, + text + }; + }) + ); +} + +function getNewLogEntry(version, prs) { + if (prs.length === 0) { + throw new Error(`Release does not contain any PRs`); + } + const firstPr = prs[0].pr; + const date = new Date().toISOString().slice(0, 10); + const { minor, patch } = semverParse(version); + let sections = getDummyLogSection('Bug Fixes', firstPr); + if (patch === 0) { + sections = getDummyLogSection('Features', firstPr) + sections; + if (minor === 0) { + sections = getDummyLogSection('Breaking Changes', firstPr) + sections; + } + } + return `## ${version} + +_${date}_ + +${sections}### Pull Requests + +${prs + .map( + ({ text, pr, author }) => + `- [#${pr}](https://github.com/rollup/rollup/pull/${pr}): ${text} (@${author})` + ) + .join('\n')}`; +} + +function getDummyLogSection(headline, pr) { + return `### ${headline} + +- [replace me] (#${pr}) + +`; +} + +async function installDependenciesBuildAndTest() { + await Promise.all([runWithEcho('npm', ['ci']), runWithEcho('npm', ['audit'])]); + await Promise.all([ + runWithEcho('npm', ['run', 'lint:nofix']), + runWithEcho('npm', ['run', 'build:bootstrap']) + ]); + await runWithEcho('npm', ['run', 'test:all']); +} + +async function waitForChangelogUpdate(version) { + const { changelogUpdated } = await inquirer.prompt([ + { + message: `Please confirm that the changelog has been updated to continue`, + name: 'changelogUpdated', + type: 'confirm' + } + ]); + + if (!changelogUpdated) { + console.log(red`Aborting release.`); + exit(); + } + + let changelogEntry = ''; + while (true) { + await runWithEcho('npx', ['prettier', '--write', CHANGELOG]); + const changelog = await readFile(CHANGELOG, 'utf8'); + const { text: newEntry } = getFirstChangelogEntry(changelog); + if (newEntry !== changelogEntry) { + changelogEntry = newEntry; + console.log(cyan('You generated the following changelog entry:\n') + changelogEntry); + const { changelogConfirmed } = await inquirer.prompt([ + { + message: `Please edit the changelog again or confirm the changelog is acceptable to continue to release "${version}".`, + name: 'changelogConfirmed', + type: 'confirm' + } + ]); + if (!changelogConfirmed) { + console.log(red`Aborting release.`); + exit(); + } + continue; + } + break; + } + + console.log(cyan('No further changes, continuing release.')); + return changelogEntry; +} + +function updatePackages(pkg, browserPkg) { + return Promise.all([ + writeFile(MAIN_PKG, getPkgStringWithVersion(pkg, newVersion)), + writeFile(BROWSER_PKG, getPkgStringWithVersion(browserPkg, newVersion)) + ]); +} + +function getPkgStringWithVersion(pkg, version) { + return JSON.stringify({ ...pkg, version }, null, 2) + '\n'; +} + +async function commitChanges(newVersion, gitTag) { + await runWithEcho('git', ['add', MAIN_PKG, BROWSER_PKG]); + await runWithEcho('git', ['commit', '-m', newVersion]); + await runWithEcho('git', ['tag', gitTag]); +} + +function releasePackages(newVersion) { + const releaseEnv = { ...process.env, ROLLUP_RELEASE: 'releasing' }; + const releaseTag = semverPreRelease(newVersion) ? ['--tag', 'beta'] : []; + return Promise.all([ + runWithEcho('npm', ['publish', ...releaseTag], { + cwd: new URL('..', import.meta.url), + env: releaseEnv + }), + runWithEcho('npm', ['publish', ...releaseTag], { + cwd: new URL('../browser', import.meta.url), + env: releaseEnv + }) + ]); +} + +function pushChanges(gitTag) { + return Promise.all([ + runWithEcho('git', ['push', 'origin', 'HEAD']), + runWithEcho('git', ['push', 'origin', gitTag]) + ]); +} + +function createReleaseNotes(changelog, tag) { + return repo.createRelease({ + body: changelog, + name: tag, + tag_name: tag + }); +} + +function postReleaseComments(includedPRs, issues, version) { + const isPreRelease = semverPreRelease(newVersion); + const installNote = isPreRelease + ? `Note that this is a pre-release, so to test it, you need to install Rollup via \`npm install rollup@${newVersion}\` or \`npm install rollup@beta\`. It will likely become part of a regular release later.` + : 'You can test it via `npm install rollup`.'; + return Promise.all( + includedPRs.map(({ pr, closed }) => + Promise.all([ + issues + .createIssueComment( + pr, + `This PR has been released as part of rollup@${version}. ${installNote}`, + ...closed.map(closedPr => + issues + .createIssueComment( + closedPr, + `This issue has been resolved via #${pr} as part of rollup@${version}. ${installNote}` + ) + .then(() => console.log(cyan(`Added fix comment to #${closedPr} via #${pr}.`))) + ) + ) + .then(() => console.log(cyan(`Added release comment to #${pr}.`))) + ]) + ) + ); +} diff --git a/scripts/test-package.js b/scripts/test-package.js index bc63ffaadc8..fbd98106389 100644 --- a/scripts/test-package.js +++ b/scripts/test-package.js @@ -1,4 +1,4 @@ -import { readFile } from 'fs/promises'; +import { readFile } from 'node:fs/promises'; const pkg = JSON.parse(await readFile(new URL('../package.json', import.meta.url), 'utf8')); const chokidarPkg = JSON.parse( diff --git a/scripts/update-git-commit.js b/scripts/update-git-commit.js deleted file mode 100644 index 06a200e5cb6..00000000000 --- a/scripts/update-git-commit.js +++ /dev/null @@ -1,13 +0,0 @@ -import { execSync } from 'child_process'; -import { writeFileSync } from 'fs'; -import { dirname, join } from 'path'; -import { fileURLToPath } from 'url'; - -let revision; -try { - revision = execSync('git rev-parse HEAD').toString().trim(); -} catch (e) { - console.warn('Could not determine git commit when building Rollup.'); - revision = '(could not be determined)'; -} -writeFileSync(join(dirname(fileURLToPath(import.meta.url)), '../.commithash'), revision); diff --git a/scripts/update-snapshots.js b/scripts/update-snapshots.js index fda68a2b21c..936bd7d3bcd 100755 --- a/scripts/update-snapshots.js +++ b/scripts/update-snapshots.js @@ -1,8 +1,8 @@ #!/usr/bin/env node -import { readdirSync } from 'fs'; -import { dirname, join, resolve } from 'path'; -import { fileURLToPath } from 'url'; +import { readdirSync } from 'node:fs'; +import { dirname, join, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; import fs from 'fs-extra'; const basePath = resolve(dirname(fileURLToPath(import.meta.url)), '../test'); diff --git a/test/browser/index.js b/test/browser/index.js index f3aa646a980..d9359152e89 100644 --- a/test/browser/index.js +++ b/test/browser/index.js @@ -5,7 +5,7 @@ global.performance = require('perf_hooks').performance; const { basename, resolve } = require('path'); const fixturify = require('fixturify'); -const { rollup } = require('../../dist/rollup.browser.js'); +const { rollup } = require('../../browser/dist/rollup.browser.js'); const { assertFilesAreEqual, runTestSuiteWithSamples, compareError } = require('../utils.js'); runTestSuiteWithSamples('browser', resolve(__dirname, 'samples'), (dir, config) => {