rollup 3.0.0-3 → 3.0.0-6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md CHANGED
@@ -240,35 +240,6 @@ Repository: jonschlinkert/fill-range
240
240
 
241
241
  ---------------------------------------
242
242
 
243
- ## get-package-type
244
- License: MIT
245
- By: Corey Farrell
246
- Repository: git+https://github.com/cfware/get-package-type.git
247
-
248
- > MIT License
249
- >
250
- > Copyright (c) 2020 CFWare, LLC
251
- >
252
- > Permission is hereby granted, free of charge, to any person obtaining a copy
253
- > of this software and associated documentation files (the "Software"), to deal
254
- > in the Software without restriction, including without limitation the rights
255
- > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
256
- > copies of the Software, and to permit persons to whom the Software is
257
- > furnished to do so, subject to the following conditions:
258
- >
259
- > The above copyright notice and this permission notice shall be included in all
260
- > copies or substantial portions of the Software.
261
- >
262
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
263
- > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
264
- > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
265
- > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
266
- > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
267
- > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
268
- > SOFTWARE.
269
-
270
- ---------------------------------------
271
-
272
243
  ## glob-parent
273
244
  License: ISC
274
245
  By: Gulp Team, Elan Shanker, Blaine Bublitz
package/README.md CHANGED
@@ -76,7 +76,7 @@ For example, with CommonJS, the _entire tool or library must be imported_.
76
76
 
77
77
  ```js
78
78
  // import the entire utils object with CommonJS
79
- var utils = require('utils');
79
+ var utils = require('node:utils');
80
80
  var query = 'Rollup';
81
81
  // use the ajax method of the utils object
82
82
  utils.ajax('https://api.example.com?search=' + query).then(handleResponse);
@@ -86,7 +86,7 @@ But with ES modules, instead of importing the whole `utils` object, we can just
86
86
 
87
87
  ```js
88
88
  // import the ajax function with an ES import statement
89
- import { ajax } from 'utils';
89
+ import { ajax } from 'node:utils';
90
90
  var query = 'Rollup';
91
91
  // call the ajax function
92
92
  ajax('https://api.example.com?search=' + query).then(handleResponse);
package/dist/bin/rollup CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  /*
4
4
  @license
5
- Rollup.js v3.0.0-2
6
- Sat, 30 Jul 2022 12:51:34 GMT - commit 41906cedefbc03640d6e8ca23ce6975f3bb5c6a1
5
+ Rollup.js v3.0.0-5
6
+ Tue, 06 Sep 2022 05:29:28 GMT - commit 1d085668121abe6be83c28c212a02c181c16d2b8
7
7
 
8
8
  https://github.com/rollup/rollup
9
9
 
@@ -11,22 +11,24 @@
11
11
  */
12
12
  'use strict';
13
13
 
14
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
14
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
15
15
 
16
- const process$1 = require('process');
16
+ const process$1 = require('node:process');
17
17
  const rollup = require('../shared/rollup.js');
18
18
  const require$$2 = require('util');
19
19
  const require$$0 = require('path');
20
20
  const require$$0$1 = require('fs');
21
21
  const mergeOptions = require('../shared/mergeOptions.js');
22
22
  const loadConfigFile_js = require('../shared/loadConfigFile.js');
23
- require('perf_hooks');
24
- require('crypto');
25
- require('events');
26
- require('url');
23
+ const node_fs = require('node:fs');
24
+ const node_path = require('node:path');
25
+ require('node:perf_hooks');
26
+ require('node:crypto');
27
+ require('node:events');
28
+ require('node:url');
27
29
  require('tty');
28
30
 
29
- const help = "rollup version __VERSION__\n=====================================\n\nUsage: rollup [options] <entry file>\n\nBasic options:\n\n-c, --config <filename> Use this config file (if argument is used but value\n is unspecified, defaults to rollup.config.js)\n-d, --dir <dirname> Directory for chunks (if absent, prints to stdout)\n-e, --external <ids> Comma-separate list of module IDs to exclude\n-f, --format <format> Type of output (amd, cjs, es, iife, umd, system)\n-g, --globals <pairs> Comma-separate list of `moduleID:Global` pairs\n-h, --help Show this help message\n-i, --input <filename> Input (alternative to <entry file>)\n-m, --sourcemap Generate sourcemap (`-m inline` for inline map)\n-n, --name <name> Name for UMD export\n-o, --file <output> Single output file (if absent, prints to stdout)\n-p, --plugin <plugin> Use the plugin specified (may be repeated)\n-v, --version Show version number\n-w, --watch Watch files in bundle and rebuild on changes\n--amd.id <id> ID for AMD module (default is anonymous)\n--amd.autoId Generate the AMD ID based off the chunk name\n--amd.basePath <prefix> Path to prepend to auto generated AMD ID\n--amd.define <name> Function to use in place of `define`\n--assetFileNames <pattern> Name pattern for emitted assets\n--banner <text> Code to insert at top of bundle (outside wrapper)\n--chunkFileNames <pattern> Name pattern for emitted secondary chunks\n--compact Minify wrapper code\n--context <variable> Specify top-level `this` value\n--entryFileNames <pattern> Name pattern for emitted entry chunks\n--environment <values> Settings passed to config file (see example)\n--no-esModule Do not add __esModule property\n--exports <mode> Specify export mode (auto, default, named, none)\n--extend Extend global variable defined by --name\n--no-externalLiveBindings Do not generate code to support live bindings\n--failAfterWarnings Exit with an error if the build produced warnings\n--footer <text> Code to insert at end of bundle (outside wrapper)\n--no-freeze Do not freeze namespace objects\n--generatedCode <preset> Which code features to use (es5/es2015)\n--no-hoistTransitiveImports Do not hoist transitive imports into entry chunks\n--no-indent Don't indent result\n--no-interop Do not include interop block\n--inlineDynamicImports Create single bundle when using dynamic imports\n--intro <text> Code to insert at top of bundle (inside wrapper)\n--no-makeAbsoluteExternalsRelative Prevent normalization of external imports\n--maxParallelFileReads <value> How many files to read in parallel\n--minifyInternalExports Force or disable minification of internal exports\n--noConflict Generate a noConflict method for UMD globals\n--outro <text> Code to insert at end of bundle (inside wrapper)\n--perf Display performance timings\n--no-preserveEntrySignatures Avoid facade chunks for entry points\n--preserveModules Preserve module structure\n--preserveModulesRoot Put preserved modules under this path at root level\n--preserveSymlinks Do not follow symlinks when resolving files\n--no-sanitizeFileName Do not replace invalid characters in file names\n--shimMissingExports Create shim variables for missing exports\n--silent Don't print warnings\n--sourcemapBaseUrl <url> Emit absolute sourcemap URLs with given base\n--sourcemapExcludeSources Do not include source code in source maps\n--sourcemapFile <file> Specify bundle position for source maps\n--stdin=ext Specify file extension used for stdin input\n--no-stdin Do not read \"-\" from stdin\n--no-strict Don't emit `\"use strict\";` in the generated modules\n--strictDeprecations Throw errors for deprecated features\n--systemNullSetters Replace empty SystemJS setters with `null`\n--no-treeshake Disable tree-shaking optimisations\n--no-treeshake.annotations Ignore pure call annotations\n--no-treeshake.moduleSideEffects Assume modules have no side-effects\n--no-treeshake.propertyReadSideEffects Ignore property access side-effects\n--no-treeshake.tryCatchDeoptimization Do not turn off try-catch-tree-shaking\n--no-treeshake.unknownGlobalSideEffects Assume unknown globals do not throw\n--waitForBundleInput Wait for bundle input files\n--watch.buildDelay <number> Throttle watch rebuilds\n--no-watch.clearScreen Do not clear the screen when rebuilding\n--watch.skipWrite Do not write files to disk when watching\n--watch.exclude <files> Exclude files from being watched\n--watch.include <files> Limit watching to specified files\n--watch.onStart <cmd> Shell command to run on `\"START\"` event\n--watch.onBundleStart <cmd> Shell command to run on `\"BUNDLE_START\"` event\n--watch.onBundleEnd <cmd> Shell command to run on `\"BUNDLE_END\"` event\n--watch.onEnd <cmd> Shell command to run on `\"END\"` event\n--watch.onError <cmd> Shell command to run on `\"ERROR\"` event\n--validate Validate output\n\nExamples:\n\n# use settings in config file\nrollup -c\n\n# in config file, process.env.INCLUDE_DEPS === 'true'\n# and process.env.BUILD === 'production'\nrollup -c --environment INCLUDE_DEPS,BUILD:production\n\n# create CommonJS bundle.js from src/main.js\nrollup --format=cjs --file=bundle.js -- src/main.js\n\n# create self-executing IIFE using `window.jQuery`\n# and `window._` as external globals\nrollup -f iife --globals jquery:jQuery,lodash:_ \\\n -i src/app.js -o build/app.js -m build/app.js.map\n\nNotes:\n\n* When piping to stdout, only inline sourcemaps are permitted\n\nFor more information visit https://rollupjs.org\n";
31
+ const help = "rollup version __VERSION__\n=====================================\n\nUsage: rollup [options] <entry file>\n\nBasic options:\n\n-c, --config <filename> Use this config file (if argument is used but value\n is unspecified, defaults to rollup.config.js)\n-d, --dir <dirname> Directory for chunks (if absent, prints to stdout)\n-e, --external <ids> Comma-separate list of module IDs to exclude\n-f, --format <format> Type of output (amd, cjs, es, iife, umd, system)\n-g, --globals <pairs> Comma-separate list of `moduleID:Global` pairs\n-h, --help Show this help message\n-i, --input <filename> Input (alternative to <entry file>)\n-m, --sourcemap Generate sourcemap (`-m inline` for inline map)\n-n, --name <name> Name for UMD export\n-o, --file <output> Single output file (if absent, prints to stdout)\n-p, --plugin <plugin> Use the plugin specified (may be repeated)\n-v, --version Show version number\n-w, --watch Watch files in bundle and rebuild on changes\n--amd.id <id> ID for AMD module (default is anonymous)\n--amd.autoId Generate the AMD ID based off the chunk name\n--amd.basePath <prefix> Path to prepend to auto generated AMD ID\n--amd.define <name> Function to use in place of `define`\n--amd.forceJsExtensionForImports Use `.js` extension in AMD imports\n--assetFileNames <pattern> Name pattern for emitted assets\n--banner <text> Code to insert at top of bundle (outside wrapper)\n--chunkFileNames <pattern> Name pattern for emitted secondary chunks\n--compact Minify wrapper code\n--context <variable> Specify top-level `this` value\n--entryFileNames <pattern> Name pattern for emitted entry chunks\n--environment <values> Settings passed to config file (see example)\n--no-esModule Do not add __esModule property\n--exports <mode> Specify export mode (auto, default, named, none)\n--extend Extend global variable defined by --name\n--no-externalLiveBindings Do not generate code to support live bindings\n--failAfterWarnings Exit with an error if the build produced warnings\n--footer <text> Code to insert at end of bundle (outside wrapper)\n--no-freeze Do not freeze namespace objects\n--generatedCode <preset> Which code features to use (es5/es2015)\n--no-hoistTransitiveImports Do not hoist transitive imports into entry chunks\n--no-indent Don't indent result\n--no-interop Do not include interop block\n--inlineDynamicImports Create single bundle when using dynamic imports\n--intro <text> Code to insert at top of bundle (inside wrapper)\n--no-makeAbsoluteExternalsRelative Prevent normalization of external imports\n--maxParallelFileReads <value> How many files to read in parallel\n--minifyInternalExports Force or disable minification of internal exports\n--noConflict Generate a noConflict method for UMD globals\n--outro <text> Code to insert at end of bundle (inside wrapper)\n--perf Display performance timings\n--no-preserveEntrySignatures Avoid facade chunks for entry points\n--preserveModules Preserve module structure\n--preserveModulesRoot Put preserved modules under this path at root level\n--preserveSymlinks Do not follow symlinks when resolving files\n--no-sanitizeFileName Do not replace invalid characters in file names\n--shimMissingExports Create shim variables for missing exports\n--silent Don't print warnings\n--sourcemapBaseUrl <url> Emit absolute sourcemap URLs with given base\n--sourcemapExcludeSources Do not include source code in source maps\n--sourcemapFile <file> Specify bundle position for source maps\n--stdin=ext Specify file extension used for stdin input\n--no-stdin Do not read \"-\" from stdin\n--no-strict Don't emit `\"use strict\";` in the generated modules\n--strictDeprecations Throw errors for deprecated features\n--systemNullSetters Replace empty SystemJS setters with `null`\n--no-treeshake Disable tree-shaking optimisations\n--no-treeshake.annotations Ignore pure call annotations\n--no-treeshake.moduleSideEffects Assume modules have no side-effects\n--no-treeshake.propertyReadSideEffects Ignore property access side-effects\n--no-treeshake.tryCatchDeoptimization Do not turn off try-catch-tree-shaking\n--no-treeshake.unknownGlobalSideEffects Assume unknown globals do not throw\n--waitForBundleInput Wait for bundle input files\n--watch.buildDelay <number> Throttle watch rebuilds\n--no-watch.clearScreen Do not clear the screen when rebuilding\n--watch.skipWrite Do not write files to disk when watching\n--watch.exclude <files> Exclude files from being watched\n--watch.include <files> Limit watching to specified files\n--watch.onStart <cmd> Shell command to run on `\"START\"` event\n--watch.onBundleStart <cmd> Shell command to run on `\"BUNDLE_START\"` event\n--watch.onBundleEnd <cmd> Shell command to run on `\"BUNDLE_END\"` event\n--watch.onEnd <cmd> Shell command to run on `\"END\"` event\n--watch.onError <cmd> Shell command to run on `\"ERROR\"` event\n--validate Validate output\n\nExamples:\n\n# use settings in config file\nrollup -c\n\n# in config file, process.env.INCLUDE_DEPS === 'true'\n# and process.env.BUILD === 'production'\nrollup -c --environment INCLUDE_DEPS,BUILD:production\n\n# create CommonJS bundle.js from src/main.js\nrollup --format=cjs --file=bundle.js -- src/main.js\n\n# create self-executing IIFE using `window.jQuery`\n# and `window._` as external globals\nrollup -f iife --globals jquery:jQuery,lodash:_ \\\n -i src/app.js -o build/app.js -m build/app.js.map\n\nNotes:\n\n* When piping to stdout, only inline sourcemaps are permitted\n\nFor more information visit https://rollupjs.org\n";
30
32
 
31
33
  /**
32
34
  * @license
@@ -324,11 +326,11 @@ class YargsParser {
324
326
  let next;
325
327
  let value;
326
328
  // any unknown option (except for end-of-options, "--")
327
- if (arg !== '--' && isUnknownOptionAsArg(arg)) {
329
+ if (arg !== '--' && /^-/.test(arg) && isUnknownOptionAsArg(arg)) {
328
330
  pushPositional(arg);
329
331
  // ---, ---=, ----, etc,
330
332
  }
331
- else if (truncatedArg.match(/---+(=|$)/)) {
333
+ else if (truncatedArg.match(/^---+(=|$)/)) {
332
334
  // options without key name are invalid.
333
335
  pushPositional(arg);
334
336
  continue;
@@ -1196,13 +1198,15 @@ function stripQuotes(val) {
1196
1198
  * Copyright (c) 2016, Contributors
1197
1199
  * SPDX-License-Identifier: ISC
1198
1200
  */
1201
+ var _a, _b, _c;
1199
1202
  // See https://github.com/yargs/yargs-parser#supported-nodejs-versions for our
1200
1203
  // version support policy. The YARGS_MIN_NODE_VERSION is used for testing only.
1201
1204
  const minNodeVersion = (process && process.env && process.env.YARGS_MIN_NODE_VERSION)
1202
1205
  ? Number(process.env.YARGS_MIN_NODE_VERSION)
1203
1206
  : 12;
1204
- if (process && process.version) {
1205
- const major = Number(process.version.match(/v([^.]+)/)[1]);
1207
+ const nodeVersion = (_b = (_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node) !== null && _b !== void 0 ? _b : (_c = process === null || process === void 0 ? void 0 : process.version) === null || _c === void 0 ? void 0 : _c.slice(1);
1208
+ if (nodeVersion) {
1209
+ const major = Number(nodeVersion.match(/^([^.]+)/)[1]);
1206
1210
  if (major < minNodeVersion) {
1207
1211
  throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
1208
1212
  }
@@ -1539,19 +1543,9 @@ async function build(inputOptions, warnings, silent = false) {
1539
1543
  }
1540
1544
  const { output: outputs } = await bundle.generate(output);
1541
1545
  for (const file of outputs) {
1542
- let source;
1543
- if (file.type === 'asset') {
1544
- source = file.source;
1545
- }
1546
- else {
1547
- source = file.code;
1548
- if (output.sourcemap === 'inline') {
1549
- source += `\n//# ${rollup.SOURCEMAPPING_URL}=${file.map.toUrl()}\n`;
1550
- }
1551
- }
1552
1546
  if (outputs.length > 1)
1553
1547
  process$1.stdout.write(`\n${loadConfigFile_js.cyan(loadConfigFile_js.bold(`//→ ${file.fileName}:`))}\n`);
1554
- process$1.stdout.write(source);
1548
+ process$1.stdout.write(file.type === 'asset' ? file.source : file.code);
1555
1549
  }
1556
1550
  if (!silent) {
1557
1551
  warnings.flush();
@@ -1572,7 +1566,7 @@ async function build(inputOptions, warnings, silent = false) {
1572
1566
  const DEFAULT_CONFIG_BASE = 'rollup.config';
1573
1567
  async function getConfigPath(commandConfig) {
1574
1568
  if (commandConfig === true) {
1575
- return require$$0.resolve(await findConfigFileNameInCwd());
1569
+ return node_path.resolve(await findConfigFileNameInCwd());
1576
1570
  }
1577
1571
  if (commandConfig.slice(0, 5) === 'node:') {
1578
1572
  const pkgName = commandConfig.slice(5);
@@ -1591,10 +1585,10 @@ async function getConfigPath(commandConfig) {
1591
1585
  }
1592
1586
  }
1593
1587
  }
1594
- return require$$0.resolve(commandConfig);
1588
+ return node_path.resolve(commandConfig);
1595
1589
  }
1596
1590
  async function findConfigFileNameInCwd() {
1597
- const filesInWorkingDir = new Set(await require$$0$1.promises.readdir(process$1.cwd()));
1591
+ const filesInWorkingDir = new Set(await node_fs.promises.readdir(process$1.cwd()));
1598
1592
  for (const extension of ['mjs', 'cjs', 'ts']) {
1599
1593
  const fileName = `${DEFAULT_CONFIG_BASE}.${extension}`;
1600
1594
  if (filesInWorkingDir.has(fileName))
package/dist/es/rollup.js CHANGED
@@ -1,16 +1,17 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0-2
4
- Sat, 30 Jul 2022 12:51:34 GMT - commit 41906cedefbc03640d6e8ca23ce6975f3bb5c6a1
3
+ Rollup.js v3.0.0-5
4
+ Tue, 06 Sep 2022 05:29:28 GMT - commit 1d085668121abe6be83c28c212a02c181c16d2b8
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
8
8
  Released under the MIT License.
9
9
  */
10
10
  export { version as VERSION, defineConfig, rollup, watch } from './shared/rollup.js';
11
+ import 'node:path';
11
12
  import 'path';
12
- import 'process';
13
- import 'perf_hooks';
14
- import 'crypto';
15
- import 'fs';
16
- import 'events';
13
+ import 'node:process';
14
+ import 'node:perf_hooks';
15
+ import 'node:crypto';
16
+ import 'node:fs';
17
+ import 'node:events';