diff --git a/.github/workflows/build-and-tests.yml b/.github/workflows/build-and-tests.yml index 19318d0c9..aafd91638 100644 --- a/.github/workflows/build-and-tests.yml +++ b/.github/workflows/build-and-tests.yml @@ -246,7 +246,7 @@ jobs: with: version: 0.14.1 - name: Install cargo-zigbuild - uses: taiki-e/install-action@b9c5db3aef04caffaf95a1d03931de10fb2a140f # v2.65.1 + uses: taiki-e/install-action@4c6723ec9c638cccae824b8957c5085b695c8085 # v2.65.7 if: ${{ matrix.settings.cross == 'zig' }} env: GITHUB_TOKEN: ${{ github.token }} diff --git a/build-plugins/load-cli-help.ts b/build-plugins/load-cli-help.ts new file mode 100644 index 000000000..ab4d32336 --- /dev/null +++ b/build-plugins/load-cli-help.ts @@ -0,0 +1,21 @@ +import { readFile } from 'node:fs/promises'; +import type { Plugin } from 'rollup'; + +export default function loadCliHelp(): Plugin { + return { + async load(id) { + if (id.endsWith('help.md')) { + const [rawHelpFile, packageFile] = await Promise.all([ + readFile(id, 'utf8'), + readFile(new URL('../package.json', import.meta.url), 'utf8') + ]); + const finalHelpFile = rawHelpFile + .replaceAll(/^\/\/\s*#(end)?region[^\n]*\n/gm, '') + .replace('__VERSION__', JSON.parse(packageFile).version); + return `export default ${JSON.stringify(finalHelpFile)};`; + } + return null; + }, + name: 'load-cli-help' + }; +} diff --git a/cli/cli.ts b/cli/cli.ts index 2f4f105a5..87a9e3392 100644 --- a/cli/cli.ts +++ b/cli/cli.ts @@ -12,7 +12,7 @@ const command = argParser(process.argv.slice(2), { }); if (command.help || (process.argv.length <= 2 && process.stdin.isTTY)) { - console.log(`\n${help.replace('__VERSION__', version)}\n`); + console.log(`\n${help}\n`); } else if (command.version) { console.log(`rollup v${version}`); } else { diff --git a/cli/help.md b/cli/help.md index 8c5560d02..c042bdd35 100644 --- a/cli/help.md +++ b/cli/help.md @@ -3,10 +3,13 @@ rollup version __VERSION__ Usage: rollup [options] -Basic options: +Options: +// #region options -c, --config Use this config file (if argument is used but value - is unspecified, defaults to rollup.config.js) + is unspecified, Rollup will try to load configuration files in + the following order: + rollup.config.mjs -> rollup.config.cjs -> rollup.config.js) -d, --dir Directory for chunks (if absent, prints to stdout) -e, --external Comma-separate list of module IDs to exclude -f, --format Type of output (amd, cjs, es, iife, umd, system) @@ -91,7 +94,7 @@ Basic options: --validate Validate output --waitForBundleInput Wait for bundle input files --watch.allowInputInsideOutputPath Whether the input path is allowed to be a - subpath of the output path + subpath of the output path --watch.buildDelay Throttle watch rebuilds --no-watch.clearScreen Do not clear the screen when rebuilding --watch.exclude Exclude files from being watched @@ -102,6 +105,7 @@ Basic options: --watch.onError Shell command to run on `"ERROR"` event --watch.onStart Shell command to run on `"START"` event --watch.skipWrite Do not write files to disk when watching +// #endregion options Examples: diff --git a/docs/command-line-interface/index.md b/docs/command-line-interface/index.md index 2373a0b5c..8265e681a 100755 --- a/docs/command-line-interface/index.md +++ b/docs/command-line-interface/index.md @@ -374,6 +374,7 @@ export default { 许多选项都有等效的命令行标志。在这些情况下,如果你正在使用配置文件,则此处传递的任何参数都将覆盖配置文件。以下是所有支持的选项列表: +<<<<<<< HEAD ``` -c, --config 使用此配置文件 (如果使用参数但未指定值,则默认为 rollup.config.js) @@ -472,6 +473,9 @@ export default { --watch.onStart 在 "START" 事件上运行的 Shell 命令 --watch.skipWrite 在监视时不要将文件写入磁盘 ``` +======= +<<< ../../cli/help.md#options{text} +>>>>>>> 644bebd053ce3b8a16018efbaf41a412646847aa 以下标志仅通过命令行界面可用。所有其他标志都对应并覆盖其配置文件等效项,请参阅[选项大列表](../configuration-options/index.md)获取详细信息。 diff --git a/package-lock.json b/package-lock.json index ba2f22260..3df0347b1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "@codemirror/language": "^6.12.1", "@codemirror/search": "^6.5.11", "@codemirror/state": "^6.5.3", - "@codemirror/view": "^6.39.5", + "@codemirror/view": "^6.39.7", "@eslint/js": "^9.39.2", "@inquirer/prompts": "^7.10.1", "@jridgewell/sourcemap-codec": "^1.5.5", @@ -85,7 +85,6 @@ "requirejs": "^2.3.8", "rollup": "^4.54.0", "rollup-plugin-license": "^3.6.0", - "rollup-plugin-string": "^3.0.0", "semver": "^7.7.3", "shx": "^0.4.0", "signal-exit": "^4.1.0", @@ -95,7 +94,7 @@ "terser": "^5.44.1", "tslib": "^2.8.1", "typescript": "^5.9.3", - "typescript-eslint": "^8.50.1", + "typescript-eslint": "^8.51.0", "vite": "^7.3.0", "vitepress": "^1.6.4", "vue": "^3.5.26", @@ -801,9 +800,9 @@ } }, "node_modules/@codemirror/view": { - "version": "6.39.7", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.39.7.tgz", - "integrity": "sha512-3Vif9hnNHJnl2YgOtkR/wzGzhYcQ8gy3LGdUhkLUU8xSBbgsTxrE8he/CMTpeINm5TgxLe2FmzvF6IYQL/BSAg==", + "version": "6.39.8", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.39.8.tgz", + "integrity": "sha512-1rASYd9Z/mE3tkbC9wInRlCNyCkSn+nLsiQKZhEDUUJiUfs/5FHDpCUDaQpoTIaNGeDc6/bhaEAyLmeEucEFPw==", "dev": true, "license": "MIT", "dependencies": { @@ -1447,9 +1446,9 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", - "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1764,9 +1763,9 @@ } }, "node_modules/@iconify-json/simple-icons": { - "version": "1.2.63", - "resolved": "https://registry.npmjs.org/@iconify-json/simple-icons/-/simple-icons-1.2.63.tgz", - "integrity": "sha512-xZl2UWCwE58VlqZ+pDPmaUhE2tq8MVSTJRr4/9nzzHlDdjJ0Ud1VxNXPrwTSgESKY29iCQw3S0r2nJTSNNngHw==", + "version": "1.2.64", + "resolved": "https://registry.npmjs.org/@iconify-json/simple-icons/-/simple-icons-1.2.64.tgz", + "integrity": "sha512-SMmm//tjZBvHnT0EAzZLnBTL6bukSkncM0pwkOXjr0FsAeCqjQtqoxBR0Mp+PazIJjXJKHm1Ju0YgnCIPOodJg==", "dev": true, "license": "CC0-1.0", "dependencies": { @@ -3335,9 +3334,9 @@ } }, "node_modules/@napi-rs/wasm-runtime": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.0.tgz", - "integrity": "sha512-Fq6DJW+Bb5jaWE69/qOE0D1TUN9+6uWhCeZpdnSBk14pjLcCWR7Q8n49PTSPHazM37JqrsdpEthXy2xn6jWWiA==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.1.tgz", + "integrity": "sha512-p64ah1M1ld8xjWv3qbvFwHiFVWrq1yFvV4f7w+mzaqiR4IlSgkqhcRdHwsGgomwzBH51sRY4NEowLxnaBjcW/A==", "dev": true, "license": "MIT", "optional": true, @@ -3345,6 +3344,10 @@ "@emnapi/core": "^1.7.1", "@emnapi/runtime": "^1.7.1", "@tybys/wasm-util": "^0.10.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" } }, "node_modules/@napi-rs/wasm-tools": { @@ -4681,13 +4684,13 @@ } }, "node_modules/@tanstack/react-virtual": { - "version": "3.13.13", - "resolved": "https://registry.npmjs.org/@tanstack/react-virtual/-/react-virtual-3.13.13.tgz", - "integrity": "sha512-4o6oPMDvQv+9gMi8rE6gWmsOjtUZUYIJHv7EB+GblyYdi8U6OqLl8rhHWIUZSL1dUU2dPwTdTgybCKf9EjIrQg==", + "version": "3.13.14", + "resolved": "https://registry.npmjs.org/@tanstack/react-virtual/-/react-virtual-3.13.14.tgz", + "integrity": "sha512-WG0d7mBD54eA7dgA3+sO5csS0B49QKqM6Gy5Rf31+Oq/LTKROQSao9m2N/vz1IqVragOKU5t5k1LAcqh/DfTxw==", "dev": true, "license": "MIT", "dependencies": { - "@tanstack/virtual-core": "3.13.13" + "@tanstack/virtual-core": "3.13.14" }, "funding": { "type": "github", @@ -4699,9 +4702,9 @@ } }, "node_modules/@tanstack/virtual-core": { - "version": "3.13.13", - "resolved": "https://registry.npmjs.org/@tanstack/virtual-core/-/virtual-core-3.13.13.tgz", - "integrity": "sha512-uQFoSdKKf5S8k51W5t7b2qpfkyIbdHMzAn+AMQvHPxKUPeo1SsGaA4JRISQT87jm28b7z8OEqPcg1IOZagQHcA==", + "version": "3.13.14", + "resolved": "https://registry.npmjs.org/@tanstack/virtual-core/-/virtual-core-3.13.14.tgz", + "integrity": "sha512-b5Uvd8J2dc7ICeX9SRb/wkCxWk7pUwN214eEPAQsqrsktSKTCmyLxOQWSMgogBByXclZeAdgZ3k4o0fIYUIBqQ==", "dev": true, "license": "MIT", "funding": { @@ -5240,20 +5243,20 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.50.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.50.1.tgz", - "integrity": "sha512-PKhLGDq3JAg0Jk/aK890knnqduuI/Qj+udH7wCf0217IGi4gt+acgCyPVe79qoT+qKUvHMDQkwJeKW9fwl8Cyw==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.51.0.tgz", + "integrity": "sha512-XtssGWJvypyM2ytBnSnKtHYOGT+4ZwTnBVl36TA4nRO2f4PRNGz5/1OszHzcZCvcBMh+qb7I06uoCmLTRdR9og==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.50.1", - "@typescript-eslint/type-utils": "8.50.1", - "@typescript-eslint/utils": "8.50.1", - "@typescript-eslint/visitor-keys": "8.50.1", + "@typescript-eslint/scope-manager": "8.51.0", + "@typescript-eslint/type-utils": "8.51.0", + "@typescript-eslint/utils": "8.51.0", + "@typescript-eslint/visitor-keys": "8.51.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", - "ts-api-utils": "^2.1.0" + "ts-api-utils": "^2.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5263,7 +5266,7 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.50.1", + "@typescript-eslint/parser": "^8.51.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } @@ -5279,16 +5282,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.50.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.50.1.tgz", - "integrity": "sha512-hM5faZwg7aVNa819m/5r7D0h0c9yC4DUlWAOvHAtISdFTc8xB86VmX5Xqabrama3wIPJ/q9RbGS1worb6JfnMg==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.51.0.tgz", + "integrity": "sha512-3xP4XzzDNQOIqBMWogftkwxhg5oMKApqY0BAflmLZiFYHqyhSOxv/cd/zPQLTcCXr4AkaKb25joocY0BD1WC6A==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.50.1", - "@typescript-eslint/types": "8.50.1", - "@typescript-eslint/typescript-estree": "8.50.1", - "@typescript-eslint/visitor-keys": "8.50.1", + "@typescript-eslint/scope-manager": "8.51.0", + "@typescript-eslint/types": "8.51.0", + "@typescript-eslint/typescript-estree": "8.51.0", + "@typescript-eslint/visitor-keys": "8.51.0", "debug": "^4.3.4" }, "engines": { @@ -5304,14 +5307,14 @@ } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.50.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.50.1.tgz", - "integrity": "sha512-E1ur1MCVf+YiP89+o4Les/oBAVzmSbeRB0MQLfSlYtbWU17HPxZ6Bhs5iYmKZRALvEuBoXIZMOIRRc/P++Ortg==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.51.0.tgz", + "integrity": "sha512-Luv/GafO07Z7HpiI7qeEW5NW8HUtZI/fo/kE0YbtQEFpJRUuR0ajcWfCE5bnMvL7QQFrmT/odMe8QZww8X2nfQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.50.1", - "@typescript-eslint/types": "^8.50.1", + "@typescript-eslint/tsconfig-utils": "^8.51.0", + "@typescript-eslint/types": "^8.51.0", "debug": "^4.3.4" }, "engines": { @@ -5326,14 +5329,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.50.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.50.1.tgz", - "integrity": "sha512-mfRx06Myt3T4vuoHaKi8ZWNTPdzKPNBhiblze5N50//TSHOAQQevl/aolqA/BcqqbJ88GUnLqjjcBc8EWdBcVw==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.51.0.tgz", + "integrity": "sha512-JhhJDVwsSx4hiOEQPeajGhCWgBMBwVkxC/Pet53EpBVs7zHHtayKefw1jtPaNRXpI9RA2uocdmpdfE7T+NrizA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.50.1", - "@typescript-eslint/visitor-keys": "8.50.1" + "@typescript-eslint/types": "8.51.0", + "@typescript-eslint/visitor-keys": "8.51.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5344,9 +5347,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.50.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.50.1.tgz", - "integrity": "sha512-ooHmotT/lCWLXi55G4mvaUF60aJa012QzvLK0Y+Mp4WdSt17QhMhWOaBWeGTFVkb2gDgBe19Cxy1elPXylslDw==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.51.0.tgz", + "integrity": "sha512-Qi5bSy/vuHeWyir2C8u/uqGMIlIDu8fuiYWv48ZGlZ/k+PRPHtaAu7erpc7p5bzw2WNNSniuxoMSO4Ar6V9OXw==", "dev": true, "license": "MIT", "engines": { @@ -5361,17 +5364,17 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.50.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.50.1.tgz", - "integrity": "sha512-7J3bf022QZE42tYMO6SL+6lTPKFk/WphhRPe9Tw/el+cEwzLz1Jjz2PX3GtGQVxooLDKeMVmMt7fWpYRdG5Etg==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.51.0.tgz", + "integrity": "sha512-0XVtYzxnobc9K0VU7wRWg1yiUrw4oQzexCG2V2IDxxCxhqBMSMbjB+6o91A+Uc0GWtgjCa3Y8bi7hwI0Tu4n5Q==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.50.1", - "@typescript-eslint/typescript-estree": "8.50.1", - "@typescript-eslint/utils": "8.50.1", + "@typescript-eslint/types": "8.51.0", + "@typescript-eslint/typescript-estree": "8.51.0", + "@typescript-eslint/utils": "8.51.0", "debug": "^4.3.4", - "ts-api-utils": "^2.1.0" + "ts-api-utils": "^2.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5386,9 +5389,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.50.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.50.1.tgz", - "integrity": "sha512-v5lFIS2feTkNyMhd7AucE/9j/4V9v5iIbpVRncjk/K0sQ6Sb+Np9fgYS/63n6nwqahHQvbmujeBL7mp07Q9mlA==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.51.0.tgz", + "integrity": "sha512-TizAvWYFM6sSscmEakjY3sPqGwxZRSywSsPEiuZF6d5GmGD9Gvlsv0f6N8FvAAA0CD06l3rIcWNbsN1e5F/9Ag==", "dev": true, "license": "MIT", "engines": { @@ -5400,21 +5403,21 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.50.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.50.1.tgz", - "integrity": "sha512-woHPdW+0gj53aM+cxchymJCrh0cyS7BTIdcDxWUNsclr9VDkOSbqC13juHzxOmQ22dDkMZEpZB+3X1WpUvzgVQ==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.51.0.tgz", + "integrity": "sha512-1qNjGqFRmlq0VW5iVlcyHBbCjPB7y6SxpBkrbhNWMy/65ZoncXCEPJxkRZL8McrseNH6lFhaxCIaX+vBuFnRng==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.50.1", - "@typescript-eslint/tsconfig-utils": "8.50.1", - "@typescript-eslint/types": "8.50.1", - "@typescript-eslint/visitor-keys": "8.50.1", + "@typescript-eslint/project-service": "8.51.0", + "@typescript-eslint/tsconfig-utils": "8.51.0", + "@typescript-eslint/types": "8.51.0", + "@typescript-eslint/visitor-keys": "8.51.0", "debug": "^4.3.4", "minimatch": "^9.0.4", "semver": "^7.6.0", "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.1.0" + "ts-api-utils": "^2.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5454,16 +5457,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.50.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.50.1.tgz", - "integrity": "sha512-lCLp8H1T9T7gPbEuJSnHwnSuO9mDf8mfK/Nion5mZmiEaQD9sWf9W4dfeFqRyqRjF06/kBuTmAqcs9sewM2NbQ==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.51.0.tgz", + "integrity": "sha512-11rZYxSe0zabiKaCP2QAwRf/dnmgFgvTmeDTtZvUvXG3UuAdg/GU02NExmmIXzz3vLGgMdtrIosI84jITQOxUA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.50.1", - "@typescript-eslint/types": "8.50.1", - "@typescript-eslint/typescript-estree": "8.50.1" + "@typescript-eslint/scope-manager": "8.51.0", + "@typescript-eslint/types": "8.51.0", + "@typescript-eslint/typescript-estree": "8.51.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5478,13 +5481,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.50.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.50.1.tgz", - "integrity": "sha512-IrDKrw7pCRUR94zeuCSUWQ+w8JEf5ZX5jl/e6AHGSLi1/zIr0lgutfn/7JpfCey+urpgQEdrZVYzCaVVKiTwhQ==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.51.0.tgz", + "integrity": "sha512-mM/JRQOzhVN1ykejrvwnBRV3+7yTKK8tVANVN3o1O0t0v7o+jqdVu9crPy5Y9dov15TJk/FTIgoUGHrTOVL3Zg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.50.1", + "@typescript-eslint/types": "8.51.0", "eslint-visitor-keys": "^4.2.1" }, "engines": { @@ -5941,9 +5944,9 @@ "license": "BSD-2-Clause" }, "node_modules/@zenuml/core": { - "version": "3.43.2", - "resolved": "https://registry.npmjs.org/@zenuml/core/-/core-3.43.2.tgz", - "integrity": "sha512-p08Wu7wlTb2sHNjE7NrUhlEA9c/TLhi9T13lysHhEwxa1VFsdkwJr5x4wK622VtH2Lq3t7TDNXELvcjWp2kp0Q==", + "version": "3.43.3", + "resolved": "https://registry.npmjs.org/@zenuml/core/-/core-3.43.3.tgz", + "integrity": "sha512-GcjQ73YAR/NAKIJDC3NAueQQ/5EbJOYVpnHjpVIXaLPqs8b046dqwV8q/7q2+E4EIfZGKER2HvC3BRc3JprQ7Q==", "dev": true, "license": "MIT", "dependencies": { @@ -6437,9 +6440,9 @@ } }, "node_modules/basic-ftp": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.5.tgz", - "integrity": "sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.1.0.tgz", + "integrity": "sha512-RkaJzeJKDbaDWTIPiJwubyljaEPwpVWkm9Rt5h9Nd6h7tEXTJ3VB4qxdZBioV7JO5yLUaOKwz7vDOzlncUsegw==", "dev": true, "license": "MIT", "peer": true, @@ -6833,9 +6836,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001761", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001761.tgz", - "integrity": "sha512-JF9ptu1vP2coz98+5051jZ4PwQgd2ni8A+gYSN7EA7dPKIMf0pDlSUxhdmVOaV3/fYK5uWBkgSXJaRLr4+3A6g==", + "version": "1.0.30001762", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001762.tgz", + "integrity": "sha512-PxZwGNvH7Ak8WX5iXzoK1KPZttBXNPuaOvI2ZYU7NrlM+d9Ov+TUvlLOBNGzVXAntMSMMlJPd+jY6ovrVjSmUw==", "dev": true, "funding": [ { @@ -9084,9 +9087,9 @@ } }, "node_modules/esquery": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", - "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -9596,13 +9599,13 @@ } }, "node_modules/focus-trap": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-7.7.0.tgz", - "integrity": "sha512-DJJDHpEgoSbP8ZE1MNeU2IzCpfFyFdNZZRilqmfH2XiQsPK6PtD8AfJqWzEBudUQB2yHwZc5iq54rjTaGQ+ljw==", + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-7.7.1.tgz", + "integrity": "sha512-Pkp8m55GjxBLnhBoT6OXdMvfRr4TjMAKLvFM566zlIryq5plbhaTmLAJWTGR0EkRwLjEte1lCOG9MxF1ipJrOg==", "dev": true, "license": "MIT", "dependencies": { - "tabbable": "^6.3.0" + "tabbable": "^6.4.0" } }, "node_modules/follow-redirects": { @@ -14206,9 +14209,9 @@ } }, "node_modules/prettier-linter-helpers": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", - "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.1.tgz", + "integrity": "sha512-SxToR7P8Y2lWmv/kTzVLC1t/GDI2WGjMwNhLLE9qtH8Q13C+aEmuRlzDst4Up4s0Wc8sF2M+J57iB3cMLqftfg==", "dev": true, "license": "MIT", "dependencies": { @@ -14972,33 +14975,6 @@ "rollup": "^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0" } }, - "node_modules/rollup-plugin-string": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-string/-/rollup-plugin-string-3.0.0.tgz", - "integrity": "sha512-vqyzgn9QefAgeKi+Y4A7jETeIAU1zQmS6VotH6bzm/zmUQEnYkpIGRaOBPY41oiWYV4JyBoGAaBjYMYuv+6wVw==", - "dev": true, - "license": "MIT", - "dependencies": { - "rollup-pluginutils": "^2.4.1" - } - }, - "node_modules/rollup-pluginutils": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", - "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "estree-walker": "^0.6.1" - } - }, - "node_modules/rollup-pluginutils/node_modules/estree-walker": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", - "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", - "dev": true, - "license": "MIT" - }, "node_modules/roughjs": { "version": "4.6.6", "resolved": "https://registry.npmjs.org/roughjs/-/roughjs-4.6.6.tgz", @@ -15867,9 +15843,9 @@ "license": "MIT" }, "node_modules/tabbable": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.3.0.tgz", - "integrity": "sha512-EIHvdY5bPLuWForiR/AN2Bxngzpuwn1is4asboytXtpTgsArc+WmSJKVLlhdh71u7jFcryDqB2A8lQvj78MkyQ==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.4.0.tgz", + "integrity": "sha512-05PUHKSNE8ou2dwIxTngl4EzcnsCDZGJ/iCLtDflR/SHB/ny14rXc+qU5P4mG9JkusiV7EivzY9Mhm55AzAvCg==", "dev": true, "license": "MIT" }, @@ -16264,9 +16240,9 @@ } }, "node_modules/ts-api-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", - "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.3.0.tgz", + "integrity": "sha512-6eg3Y9SF7SsAvGzRHQvvc1skDAhwI4YQ32ui1scxD1Ccr0G5qIIbUBT3pFTKX8kmWIQClHobtUdNuaBgwdfdWg==", "dev": true, "license": "MIT", "engines": { @@ -16422,16 +16398,16 @@ } }, "node_modules/typescript-eslint": { - "version": "8.50.1", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.50.1.tgz", - "integrity": "sha512-ytTHO+SoYSbhAH9CrYnMhiLx8To6PSSvqnvXyPUgPETCvB6eBKmTI9w6XMPS3HsBRGkwTVBX+urA8dYQx6bHfQ==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.51.0.tgz", + "integrity": "sha512-jh8ZuM5oEh2PSdyQG9YAEM1TCGuWenLSuSUhf/irbVUNW9O5FhbFVONviN2TgMTBnUmyHv7E56rYnfLZK6TkiA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.50.1", - "@typescript-eslint/parser": "8.50.1", - "@typescript-eslint/typescript-estree": "8.50.1", - "@typescript-eslint/utils": "8.50.1" + "@typescript-eslint/eslint-plugin": "8.51.0", + "@typescript-eslint/parser": "8.51.0", + "@typescript-eslint/typescript-estree": "8.51.0", + "@typescript-eslint/utils": "8.51.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" diff --git a/package.json b/package.json index dc5de0d2e..182fe6851 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "@codemirror/language": "^6.12.1", "@codemirror/search": "^6.5.11", "@codemirror/state": "^6.5.3", - "@codemirror/view": "^6.39.5", + "@codemirror/view": "^6.39.7", "@eslint/js": "^9.39.2", "@inquirer/prompts": "^7.10.1", "@jridgewell/sourcemap-codec": "^1.5.5", @@ -189,7 +189,6 @@ "requirejs": "^2.3.8", "rollup": "^4.54.0", "rollup-plugin-license": "^3.6.0", - "rollup-plugin-string": "^3.0.0", "semver": "^7.7.3", "shx": "^0.4.0", "signal-exit": "^4.1.0", @@ -199,7 +198,7 @@ "terser": "^5.44.1", "tslib": "^2.8.1", "typescript": "^5.9.3", - "typescript-eslint": "^8.50.1", + "typescript-eslint": "^8.51.0", "vite": "^7.3.0", "vitepress": "^1.6.4", "vue": "^3.5.26", diff --git a/rollup.config.ts b/rollup.config.ts index 9a213ffb0..360377fab 100644 --- a/rollup.config.ts +++ b/rollup.config.ts @@ -7,7 +7,6 @@ import terser from '@rollup/plugin-terser'; import typescript from '@rollup/plugin-typescript'; import { fileURLToPath } from 'node:url'; import type { Plugin, RollupOptions, WarningHandlerWithDefault } from 'rollup'; -import { string } from 'rollup-plugin-string'; import addCliEntry from './build-plugins/add-cli-entry'; import { moduleAliases } from './build-plugins/aliases'; import cleanBeforeWrite from './build-plugins/clean-before-write'; @@ -20,6 +19,7 @@ import { externalNativeImport } from './build-plugins/external-native-import'; import { fsEventsReplacement } from './build-plugins/fs-events-replacement'; import getLicenseHandler from './build-plugins/generate-license-file'; import getBanner from './build-plugins/get-banner'; +import loadCliHelp from './build-plugins/load-cli-help'; import replaceBrowserModules from './build-plugins/replace-browser-modules'; import './typings/declarations'; @@ -43,7 +43,7 @@ const nodePlugins: readonly Plugin[] = [ alias(moduleAliases), nodeResolve({ preferBuiltins: true }), json(), - string({ include: '**/*.md' }), + loadCliHelp(), commonjs({ ignoreTryCatch: false, include: 'node_modules/**' diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 039360738..afd50366f 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -652,9 +652,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee5b5339afb4c41626dde77b7a611bd4f2c202b897852b4bcf5d03eddc61010" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] name = "js-sys" @@ -725,9 +725,9 @@ dependencies = [ [[package]] name = "napi" -version = "3.7.1" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2e120bab0f106264eec9f55c3d339a0fad90cc46e0905983b1b53be19e42be6" +checksum = "000f205daae6646003fdc38517be6232af2b150bad4b67bdaf4c5aadb119d738" dependencies = [ "bitflags", "ctor", @@ -746,9 +746,9 @@ checksum = "d376940fd5b723c6893cd1ee3f33abbfd86acb1cd1ec079f3ab04a2a3bc4d3b1" [[package]] name = "napi-derive" -version = "3.4.1" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e9161f3ef917aa415ee0bf123656ccee609db7752582b213d59d9e69f37586a" +checksum = "97ef4e39564b008771df9a4983e4ea6c1f7fa6ad5252347b6dbf7f347a8f689a" dependencies = [ "convert_case", "ctor", @@ -760,9 +760,9 @@ dependencies = [ [[package]] name = "napi-derive-backend" -version = "4.0.1" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "724788c8ae2e79ba98905ced435d414c01e1444c91bf43abab455d62eb565b1c" +checksum = "eb0d9a16e3fbfd6397f97e4eaafe9fbefb888a6120dd289dd12869fdb16af372" dependencies = [ "convert_case", "proc-macro2", @@ -995,9 +995,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.103" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +checksum = "9695f8df41bb4f3d222c95a67532365f569318332d03d5f3f67f37b20e6ebdf0" dependencies = [ "unicode-ident", ] @@ -1110,9 +1110,9 @@ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62049b2877bf12821e8f9ad256ee38fdc31db7387ec2d3b3f403024de2034aea" +checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984" [[package]] name = "ryu-js" @@ -1176,9 +1176,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.147" +version = "1.0.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6af14725505314343e673e9ecb7cd7e8a36aa9791eb936235a3567cc31447ae4" +checksum = "3084b546a1dd6289475996f182a22aba973866ea8e8b02c51d9f46b1336a22da" dependencies = [ "itoa", "memchr", @@ -1316,9 +1316,9 @@ dependencies = [ [[package]] name = "swc_compiler_base" -version = "41.0.0" +version = "43.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1583da0d977424f5b637daf962cd8b0a08115c2e5b1e4563c8a159b19f5c3ba" +checksum = "651029fd98d105e6082dff8a77b637b9cbe73938203ef2d7b0276dbab486860c" dependencies = [ "anyhow", "base64", @@ -1430,9 +1430,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "38.0.1" +version = "40.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5c8d16175fe77d4df22505885ae16770c72b440898a2c7d44126a599bdb8488" +checksum = "767255ba2a7b13a2d4985313afbc69787e2b40fc9ffe00a3ddacb9c6c659066c" dependencies = [ "arrayvec", "bitflags", @@ -1466,9 +1466,9 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "29.0.2" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e63984b544fe1d8f66e9ce616e57429bb878572fcf1504851ef9d9f4f5260e2b" +checksum = "3fb84a1b1b605c85c38a982f8f6dac4908ca73721aee9f9924d6a60e27339290" dependencies = [ "bitflags", "either", @@ -1487,9 +1487,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "32.0.0" +version = "33.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "499486ed875ba49af2f36d0d809f61ce6e42943a3aa1d97f592d96f10fe734cc" +checksum = "00691748cc689f93316bb699051eadf058852b6326930c0355fe375110318ab5" dependencies = [ "better_scoped_tls", "indexmap", @@ -1509,9 +1509,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "34.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7678b46f04eff0937a86bf98b2db3235818e10cfd63590653482302a905c3911" +checksum = "78357477172085963b461ae9afd1724b607d2314298d732c5504676f96df21af" dependencies = [ "bytes-str", "dashmap", @@ -1533,9 +1533,9 @@ dependencies = [ [[package]] name = "swc_ecma_usage_analyzer" -version = "26.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb7998f23f765b1fad1e8e015e9f58a0cdff31bfec783f708aa416e44bd5fd2" +checksum = "2e5215c48b139422dcf54958d746b5e9a7b31bab8fc126f28e4049c4985505d5" dependencies = [ "bitflags", "indexmap", @@ -1645,9 +1645,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.111" +version = "2.0.112" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" +checksum = "21f182278bf2d2bcb3c88b1b08a37df029d71ce3d3ae26168e3c653b213b99d4" dependencies = [ "proc-macro2", "quote", @@ -2038,6 +2038,6 @@ dependencies = [ [[package]] name = "zmij" -version = "0.1.9" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0095ecd462946aa3927d9297b63ef82fb9a5316d7a37d134eeb36e58228615a" +checksum = "aac060176f7020d62c3bcc1cdbcec619d54f48b07ad1963a3f80ce7a0c17755f" diff --git a/rust/parse_ast/Cargo.toml b/rust/parse_ast/Cargo.toml index 2dd6781e6..407a5927a 100644 --- a/rust/parse_ast/Cargo.toml +++ b/rust/parse_ast/Cargo.toml @@ -8,9 +8,9 @@ edition = "2021" [dependencies] anyhow = "1.0.100" swc_atoms = "9.0.0" -swc_compiler_base = "41.0.0" +swc_compiler_base = "43.0.0" swc_config = "3.1.2" swc_common = { version = "18.0.1", features = ["parking_lot"] } swc_ecma_ast = "19.0.0" -swc_ecma_parser = "29.0.2" +swc_ecma_parser = "30.0.0" parking_lot = "0.12.5" diff --git a/scripts/test-options.js b/scripts/test-options.js index 088aa24b6..f4fe9e1a5 100644 --- a/scripts/test-options.js +++ b/scripts/test-options.js @@ -1,10 +1,9 @@ import { readFile } from 'node:fs/promises'; import { exit } from 'node:process'; -const [optionsText, helpText, commandReferenceText] = await Promise.all([ +const [optionsText, helpText] = await Promise.all([ readFile(new URL('../docs/configuration-options/index.md', import.meta.url), 'utf8'), - readFile(new URL('../cli/help.md', import.meta.url), 'utf8'), - readFile(new URL('../docs/command-line-interface/index.md', import.meta.url), 'utf8') + readFile(new URL('../cli/help.md', import.meta.url), 'utf8') ]); const optionSections = optionsText.split('\n## '); @@ -72,27 +71,3 @@ for (const line of splitHelpText) { exit(1); } } - -const helpOptionLines = splitHelpText.filter(line => line[0] === '-'); - -const cliFlagsText = commandReferenceText - .split('\n## ') - .find(text => text.startsWith('Command line flags')); -if (!cliFlagsText) { - throw new Error('Could not find "Command line flags" section.'); -} -const cliMarkdownSection = cliFlagsText.match(/```\n([\S\s]*?)\n```/); -if (!cliMarkdownSection) { - throw new Error('Could not find markdown section in "Command line flags" section.'); -} -const optionListLines = cliMarkdownSection[1].split('\n').filter(line => line[0] === '-'); - -for (const [index, line] of helpOptionLines.entries()) { - const optionListLine = optionListLines[index]; - if (line !== optionListLine) { - console.error( - `The command lines in command-line-interface/index.md do not match help.md. Expected line:\n${line}\n\nReceived line:\n${optionListLine}` - ); - exit(1); - } -} diff --git a/test/cli/samples/help/_config.js b/test/cli/samples/help/_config.js new file mode 100644 index 000000000..b6f16a441 --- /dev/null +++ b/test/cli/samples/help/_config.js @@ -0,0 +1,14 @@ +const { readFileSync } = require('node:fs'); +const { join } = require('node:path'); +const assert = require('node:assert'); + +module.exports = defineTest({ + description: 'displays the help text', + spawnArgs: ['--help'], + result(stdout) { + const [firstLine, ...restLines] = stdout.trim().split('\n'); + assert.match(firstLine, /^rollup version \d+\.\d+\.\d+$/); + const expected = readFileSync(join(__dirname, '_expected'), 'utf8'); + assert.equal([...restLines].join('\n'), expected.trim()); + } +}); diff --git a/test/cli/samples/help/_expected b/test/cli/samples/help/_expected new file mode 100644 index 000000000..388ecfadb --- /dev/null +++ b/test/cli/samples/help/_expected @@ -0,0 +1,128 @@ +===================================== + +Usage: rollup [options] + +Options: + +-c, --config Use this config file (if argument is used but value + is unspecified, Rollup will try to load configuration files in + the following order: + rollup.config.mjs -> rollup.config.cjs -> rollup.config.js) +-d, --dir Directory for chunks (if absent, prints to stdout) +-e, --external Comma-separate list of module IDs to exclude +-f, --format Type of output (amd, cjs, es, iife, umd, system) +-g, --globals Comma-separate list of `moduleID:Global` pairs +-h, --help Show this help message +-i, --input Input (alternative to ) +-m, --sourcemap Generate sourcemap (`-m inline` for inline map) +-n, --name Name for UMD export +-o, --file Single output file (if absent, prints to stdout) +-p, --plugin Use the plugin specified (may be repeated) +-v, --version Show version number +-w, --watch Watch files in bundle and rebuild on changes +--amd.autoId Generate the AMD ID based off the chunk name +--amd.basePath Path to prepend to auto generated AMD ID +--amd.define Function to use in place of `define` +--amd.forceJsExtensionForImports Use `.js` extension in AMD imports +--amd.id ID for AMD module (default is anonymous) +--assetFileNames Name pattern for emitted assets +--banner Code to insert at top of bundle (outside wrapper) +--chunkFileNames Name pattern for emitted secondary chunks +--compact Minify wrapper code +--context Specify top-level `this` value +--no-dynamicImportInCjs Write external dynamic CommonJS imports as require +--entryFileNames Name pattern for emitted entry chunks +--environment Settings passed to config file (see example) +--no-esModule Do not add __esModule property +--exports Specify export mode (auto, default, named, none) +--extend Extend global variable defined by --name +--no-externalImportAttributes Omit import attributes in "es" output +--no-externalLiveBindings Do not generate code to support live bindings +--failAfterWarnings Exit with an error if the build produced warnings +--filterLogs Filter log messages +--footer Code to insert at end of bundle (outside wrapper) +--forceExit Force exit the process when done +--no-freeze Do not freeze namespace objects +--generatedCode Which code features to use (es5/es2015) +--generatedCode.arrowFunctions Use arrow functions in generated code +--generatedCode.constBindings Use "const" in generated code +--generatedCode.objectShorthand Use shorthand properties in generated code +--no-generatedCode.reservedNamesAsProps Always quote reserved names as props +--generatedCode.symbols Use symbols in generated code +--hashCharacters Use the specified character set for file hashes +--no-hoistTransitiveImports Do not hoist transitive imports into entry chunks +--importAttributesKey Use the specified keyword for import attributes +--no-indent Don't indent result +--inlineDynamicImports Create single bundle when using dynamic imports +--no-interop Do not include interop block +--intro Code to insert at top of bundle (inside wrapper) +--logLevel Which kind of logs to display +--no-makeAbsoluteExternalsRelative Prevent normalization of external imports +--maxParallelFileOps How many files to read in parallel +--minifyInternalExports Force or disable minification of internal exports +--noConflict Generate a noConflict method for UMD globals +--outro Code to insert at end of bundle (inside wrapper) +--perf Display performance timings +--no-preserveEntrySignatures Avoid facade chunks for entry points +--preserveModules Preserve module structure +--preserveModulesRoot Put preserved modules under this path at root level +--preserveSymlinks Do not follow symlinks when resolving files +--no-reexportProtoFromExternal Ignore `__proto__` in star re-exports +--no-sanitizeFileName Do not replace invalid characters in file names +--shimMissingExports Create shim variables for missing exports +--silent Don't print warnings +--sourcemapBaseUrl Emit absolute sourcemap URLs with given base +--sourcemapDebugIds Emit unique debug ids in source and sourcemaps +--sourcemapExcludeSources Do not include source code in source maps +--sourcemapFile Specify bundle position for source maps +--sourcemapFileNames Name pattern for emitted sourcemaps +--stdin=ext Specify file extension used for stdin input +--no-stdin Do not read "-" from stdin +--no-strict Don't emit `"use strict";` in the generated modules +--strictDeprecations Throw errors for deprecated features +--no-systemNullSetters Do not replace empty SystemJS setters with `null` +--no-treeshake Disable tree-shaking optimisations +--no-treeshake.annotations Ignore pure call annotations +--treeshake.correctVarValueBeforeDeclaration Deoptimize variables until declared +--treeshake.manualPureFunctions Manually declare functions as pure +--no-treeshake.moduleSideEffects Assume modules have no side effects +--no-treeshake.propertyReadSideEffects Ignore property access side effects +--no-treeshake.tryCatchDeoptimization Do not turn off try-catch-tree-shaking +--no-treeshake.unknownGlobalSideEffects Assume unknown globals do not throw +--validate Validate output +--waitForBundleInput Wait for bundle input files +--watch.allowInputInsideOutputPath Whether the input path is allowed to be a + subpath of the output path +--watch.buildDelay Throttle watch rebuilds +--no-watch.clearScreen Do not clear the screen when rebuilding +--watch.exclude Exclude files from being watched +--watch.include Limit watching to specified files +--watch.onBundleEnd Shell command to run on `"BUNDLE_END"` event +--watch.onBundleStart Shell command to run on `"BUNDLE_START"` event +--watch.onEnd Shell command to run on `"END"` event +--watch.onError Shell command to run on `"ERROR"` event +--watch.onStart Shell command to run on `"START"` event +--watch.skipWrite Do not write files to disk when watching + +Examples: + +# use settings in config file +rollup -c + +# in config file, process.env.INCLUDE_DEPS === 'true' +# and process.env.BUILD === 'production' +rollup -c --environment INCLUDE_DEPS,BUILD:production + +# create CommonJS bundle.js from src/main.js +rollup --format=cjs --file=bundle.js -- src/main.js + +# create self-executing IIFE using `window.jQuery` +# and `window._` as external globals +rollup -f iife --globals jquery:jQuery,lodash:_ \ + -i src/app.js -o build/app.js -m build/app.js.map + +Notes: + +* When piping to stdout, only inline sourcemaps are permitted + +For more information visit https://rollupjs.org diff --git a/test/watch/index.js b/test/watch/index.js index 988dab98d..168edf7b6 100644 --- a/test/watch/index.js +++ b/test/watch/index.js @@ -565,7 +565,7 @@ describe('rollup.watch', function () { }, 'START', 'BUNDLE_START', - "ERROR:main.js (1:7): Expected '{', got 'nope'", + "ERROR:main.js (1:7): Expected '{', got 'ident'", 'END', () => { atomicWriteFileSync(ENTRY_FILE, 'export default 43;'); @@ -713,7 +713,7 @@ describe('rollup.watch', function () { }, 'START', 'BUNDLE_START', - "ERROR:main.js (1:7): Expected '{', got 'nope'", + "ERROR:main.js (1:7): Expected '{', got 'ident'", 'END', () => { unlinkSync(ENTRY_FILE); @@ -751,7 +751,7 @@ describe('rollup.watch', function () { }, 'START', 'BUNDLE_START', - "ERROR:dep.js (1:7): Expected '{', got 'nope'", + "ERROR:dep.js (1:7): Expected '{', got 'ident'", 'END', () => { unlinkSync(path.join(INPUT_DIR, 'dep.js')); diff --git a/typings/declarations.ts b/typings/declarations.ts index 9831d8522..a69e86633 100644 --- a/typings/declarations.ts +++ b/typings/declarations.ts @@ -5,12 +5,6 @@ declare module 'help.md' { } // external libs -declare module 'rollup-plugin-string' { - import type { PluginImpl } from 'rollup'; - - export const string: PluginImpl; -} - declare module 'acorn-import-assertions' { export const importAssertions: () => unknown; } diff --git a/wasm/bindings_wasm.d.ts b/wasm/bindings_wasm.d.ts index 2ba9aa75b..6e11f7e99 100644 --- a/wasm/bindings_wasm.d.ts +++ b/wasm/bindings_wasm.d.ts @@ -1,10 +1,14 @@ /* tslint:disable */ /* eslint-disable */ + export function parse(code: string, allow_return_outside_function: boolean, jsx: boolean): Uint8Array; -export function xxhashBase64Url(input: Uint8Array): string; -export function xxhashBase36(input: Uint8Array): string; + export function xxhashBase16(input: Uint8Array): string; +export function xxhashBase36(input: Uint8Array): string; + +export function xxhashBase64Url(input: Uint8Array): string; + export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; export interface InitOutput { @@ -20,6 +24,7 @@ export interface InitOutput { } export type SyncInitInput = BufferSource | WebAssembly.Module; + /** * Instantiates the given `module`, which can either be bytes or * a precompiled `WebAssembly.Module`.