@rollup/wasm-node 4.0.0-23 → 4.0.0-25

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.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.0.0-23
4
- Tue, 26 Sep 2023 20:13:39 GMT - commit f1d93caae901c556ffb1e2f553428754038d65c1
3
+ Rollup.js v4.0.0-25
4
+ Thu, 05 Oct 2023 14:11:47 GMT - commit 1ac6bbc437c7ed0de3ad23e4e0904f00783e703d
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -17,9 +17,9 @@ import require$$1 from 'stream';
17
17
  import require$$0$2 from 'path';
18
18
  import require$$2$1 from 'os';
19
19
  import require$$0$3 from 'events';
20
- import 'node:perf_hooks';
21
- import 'node:crypto';
20
+ import './parseAst.js';
22
21
  import '../../native.js';
22
+ import 'node:perf_hooks';
23
23
  import 'node:fs/promises';
24
24
  import 'tty';
25
25
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.0.0-23
4
- Tue, 26 Sep 2023 20:13:39 GMT - commit f1d93caae901c556ffb1e2f553428754038d65c1
3
+ Rollup.js v4.0.0-25
4
+ Thu, 05 Oct 2023 14:11:47 GMT - commit 1ac6bbc437c7ed0de3ad23e4e0904f00783e703d
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.0.0-23
4
- Tue, 26 Sep 2023 20:13:39 GMT - commit f1d93caae901c556ffb1e2f553428754038d65c1
3
+ Rollup.js v4.0.0-25
4
+ Thu, 05 Oct 2023 14:11:47 GMT - commit 1ac6bbc437c7ed0de3ad23e4e0904f00783e703d
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -16,11 +16,11 @@ require('node:path');
16
16
  require('node:process');
17
17
  require('node:url');
18
18
  require('./shared/rollup.js');
19
+ require('./shared/parseAst.js');
19
20
  const loadConfigFile_js = require('./shared/loadConfigFile.js');
20
21
  require('tty');
21
22
  require('path');
22
23
  require('node:perf_hooks');
23
- require('node:crypto');
24
24
  require('./native.js');
25
25
  require('./getLogFilter.js');
26
26
 
@@ -0,0 +1,3 @@
1
+ import type { ParseAst } from './rollup';
2
+
3
+ export const parseAst: ParseAst;
@@ -0,0 +1,21 @@
1
+ /*
2
+ @license
3
+ Rollup.js v4.0.0-25
4
+ Thu, 05 Oct 2023 14:11:47 GMT - commit 1ac6bbc437c7ed0de3ad23e4e0904f00783e703d
5
+
6
+ https://github.com/rollup/rollup
7
+
8
+ Released under the MIT License.
9
+ */
10
+ 'use strict';
11
+
12
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13
+
14
+ require('./native.js');
15
+ const parseAst_js = require('./shared/parseAst.js');
16
+ require('node:path');
17
+
18
+
19
+
20
+ exports.parseAst = parseAst_js.parseAst;
21
+ //# sourceMappingURL=parseAst.js.map
package/dist/rollup.d.ts CHANGED
@@ -201,6 +201,11 @@ type LoggingFunctionWithPosition = (
201
201
  pos?: number | { column: number; line: number }
202
202
  ) => void;
203
203
 
204
+ export type ParseAst = (
205
+ input: string,
206
+ options?: { allowReturnOutsideFunction?: boolean }
207
+ ) => AstNode;
208
+
204
209
  export interface PluginContext extends MinimalPluginContext {
205
210
  addWatchFile: (id: string) => void;
206
211
  cache: PluginCache;
@@ -215,7 +220,7 @@ export interface PluginContext extends MinimalPluginContext {
215
220
  load: (
216
221
  options: { id: string; resolveDependencies?: boolean } & Partial<PartialNull<ModuleOptions>>
217
222
  ) => Promise<ModuleInfo>;
218
- parse: (input: string, options?: { allowReturnOutsideFunction?: boolean }) => AstNode;
223
+ parse: ParseAst;
219
224
  resolve: (
220
225
  source: string,
221
226
  importer?: string,
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.0.0-23
4
- Tue, 26 Sep 2023 20:13:39 GMT - commit f1d93caae901c556ffb1e2f553428754038d65c1
3
+ Rollup.js v4.0.0-25
4
+ Thu, 05 Oct 2023 14:11:47 GMT - commit 1ac6bbc437c7ed0de3ad23e4e0904f00783e703d
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -13,13 +13,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13
13
 
14
14
  const rollup = require('./shared/rollup.js');
15
15
  const watchProxy = require('./shared/watch-proxy.js');
16
+ require('./shared/parseAst.js');
17
+ require('./native.js');
18
+ require('node:path');
16
19
  require('node:process');
17
20
  require('tty');
18
- require('node:path');
19
21
  require('path');
20
22
  require('node:perf_hooks');
21
- require('node:crypto');
22
- require('./native.js');
23
23
  require('node:fs/promises');
24
24
  require('./shared/fsevents-importer.js');
25
25
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.0.0-23
4
- Tue, 26 Sep 2023 20:13:39 GMT - commit f1d93caae901c556ffb1e2f553428754038d65c1
3
+ Rollup.js v4.0.0-25
4
+ Thu, 05 Oct 2023 14:11:47 GMT - commit 1ac6bbc437c7ed0de3ad23e4e0904f00783e703d
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.0.0-23
4
- Tue, 26 Sep 2023 20:13:39 GMT - commit f1d93caae901c556ffb1e2f553428754038d65c1
3
+ Rollup.js v4.0.0-25
4
+ Thu, 05 Oct 2023 14:11:47 GMT - commit 1ac6bbc437c7ed0de3ad23e4e0904f00783e703d
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.0.0-23
4
- Tue, 26 Sep 2023 20:13:39 GMT - commit f1d93caae901c556ffb1e2f553428754038d65c1
3
+ Rollup.js v4.0.0-25
4
+ Thu, 05 Oct 2023 14:11:47 GMT - commit 1ac6bbc437c7ed0de3ad23e4e0904f00783e703d
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -14,6 +14,7 @@ const node_path = require('node:path');
14
14
  const process$1 = require('node:process');
15
15
  const node_url = require('node:url');
16
16
  const rollup = require('./rollup.js');
17
+ const parseAst_js = require('./parseAst.js');
17
18
  const getLogFilter_js = require('../getLogFilter.js');
18
19
 
19
20
  function batchWarnings(command) {
@@ -57,10 +58,10 @@ function batchWarnings(command) {
57
58
  if (!logFilter(log))
58
59
  return;
59
60
  switch (level) {
60
- case rollup.LOGLEVEL_WARN: {
61
+ case parseAst_js.LOGLEVEL_WARN: {
61
62
  return add(log);
62
63
  }
63
- case rollup.LOGLEVEL_DEBUG: {
64
+ case parseAst_js.LOGLEVEL_DEBUG: {
64
65
  if (!silent) {
65
66
  rollup.stderr(rollup.bold(rollup.blue(log.message)));
66
67
  defaultBody(log);
@@ -83,7 +84,7 @@ function batchWarnings(command) {
83
84
  const immediateHandlers = {
84
85
  MISSING_NODE_BUILTINS(warning) {
85
86
  title(`Missing shims for Node.js built-ins`);
86
- rollup.stderr(`Creating a browser bundle that depends on ${rollup.printQuotedStringList(warning.ids)}. You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node`);
87
+ rollup.stderr(`Creating a browser bundle that depends on ${parseAst_js.printQuotedStringList(warning.ids)}. You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node`);
87
88
  },
88
89
  UNKNOWN_OPTION(warning) {
89
90
  title(`You have passed an unrecognized option`);
@@ -95,7 +96,7 @@ const deferredHandlers = {
95
96
  title(`Circular dependenc${warnings.length > 1 ? 'ies' : 'y'}`);
96
97
  const displayed = warnings.length > 5 ? warnings.slice(0, 3) : warnings;
97
98
  for (const warning of displayed) {
98
- rollup.stderr(warning.ids.map(rollup.relativeId).join(' -> '));
99
+ rollup.stderr(warning.ids.map(parseAst_js.relativeId).join(' -> '));
99
100
  }
100
101
  if (warnings.length > displayed.length) {
101
102
  rollup.stderr(`...and ${warnings.length - displayed.length} more`);
@@ -103,25 +104,25 @@ const deferredHandlers = {
103
104
  },
104
105
  EMPTY_BUNDLE(warnings) {
105
106
  title(`Generated${warnings.length === 1 ? ' an' : ''} empty ${warnings.length > 1 ? 'chunks' : 'chunk'}`);
106
- rollup.stderr(rollup.printQuotedStringList(warnings.map(warning => warning.names[0])));
107
+ rollup.stderr(parseAst_js.printQuotedStringList(warnings.map(warning => warning.names[0])));
107
108
  },
108
109
  EVAL(warnings) {
109
110
  title('Use of eval is strongly discouraged');
110
- info(rollup.getRollupUrl(rollup.URL_AVOIDING_EVAL));
111
+ info(parseAst_js.getRollupUrl(parseAst_js.URL_AVOIDING_EVAL));
111
112
  showTruncatedWarnings(warnings);
112
113
  },
113
114
  MISSING_EXPORT(warnings) {
114
115
  title('Missing exports');
115
- info(rollup.getRollupUrl(rollup.URL_NAME_IS_NOT_EXPORTED));
116
+ info(parseAst_js.getRollupUrl(parseAst_js.URL_NAME_IS_NOT_EXPORTED));
116
117
  for (const warning of warnings) {
117
- rollup.stderr(rollup.bold(rollup.relativeId(warning.id)));
118
- rollup.stderr(`${warning.binding} is not exported by ${rollup.relativeId(warning.exporter)}`);
118
+ rollup.stderr(rollup.bold(parseAst_js.relativeId(warning.id)));
119
+ rollup.stderr(`${warning.binding} is not exported by ${parseAst_js.relativeId(warning.exporter)}`);
119
120
  rollup.stderr(rollup.gray(warning.frame));
120
121
  }
121
122
  },
122
123
  MISSING_GLOBAL_NAME(warnings) {
123
124
  title(`Missing global variable ${warnings.length > 1 ? 'names' : 'name'}`);
124
- info(rollup.getRollupUrl(rollup.URL_OUTPUT_GLOBALS));
125
+ info(parseAst_js.getRollupUrl(parseAst_js.URL_OUTPUT_GLOBALS));
125
126
  rollup.stderr(`Use "output.globals" to specify browser global variable names corresponding to external modules:`);
126
127
  for (const warning of warnings) {
127
128
  rollup.stderr(`${rollup.bold(warning.id)} (guessing "${warning.names[0]}")`);
@@ -129,12 +130,12 @@ const deferredHandlers = {
129
130
  },
130
131
  MIXED_EXPORTS(warnings) {
131
132
  title('Mixing named and default exports');
132
- info(rollup.getRollupUrl(rollup.URL_OUTPUT_EXPORTS));
133
+ info(parseAst_js.getRollupUrl(parseAst_js.URL_OUTPUT_EXPORTS));
133
134
  rollup.stderr(rollup.bold('The following entry modules are using named and default exports together:'));
134
135
  warnings.sort((a, b) => (a.id < b.id ? -1 : 1));
135
136
  const displayedWarnings = warnings.length > 5 ? warnings.slice(0, 3) : warnings;
136
137
  for (const warning of displayedWarnings) {
137
- rollup.stderr(rollup.relativeId(warning.id));
138
+ rollup.stderr(parseAst_js.relativeId(warning.id));
138
139
  }
139
140
  if (displayedWarnings.length < warnings.length) {
140
141
  rollup.stderr(`...and ${warnings.length - displayedWarnings.length} other entry modules`);
@@ -144,7 +145,7 @@ const deferredHandlers = {
144
145
  NAMESPACE_CONFLICT(warnings) {
145
146
  title(`Conflicting re-exports`);
146
147
  for (const warning of warnings) {
147
- rollup.stderr(`"${rollup.bold(rollup.relativeId(warning.reexporter))}" re-exports "${warning.binding}" from both "${rollup.relativeId(warning.ids[0])}" and "${rollup.relativeId(warning.ids[1])}" (will be ignored).`);
148
+ rollup.stderr(`"${rollup.bold(parseAst_js.relativeId(warning.reexporter))}" re-exports "${warning.binding}" from both "${parseAst_js.relativeId(warning.ids[0])}" and "${parseAst_js.relativeId(warning.ids[1])}" (will be ignored).`);
148
149
  }
149
150
  },
150
151
  PLUGIN_WARNING(warnings) {
@@ -159,7 +160,7 @@ const deferredHandlers = {
159
160
  info((lastUrl = warning.url));
160
161
  const id = warning.id || warning.loc?.file;
161
162
  if (id) {
162
- let loc = rollup.relativeId(id);
163
+ let loc = parseAst_js.relativeId(id);
163
164
  if (warning.loc) {
164
165
  loc += `: (${warning.loc.line}:${warning.loc.column})`;
165
166
  }
@@ -173,24 +174,24 @@ const deferredHandlers = {
173
174
  },
174
175
  SOURCEMAP_BROKEN(warnings) {
175
176
  title(`Broken sourcemap`);
176
- info(rollup.getRollupUrl(rollup.URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT));
177
+ info(parseAst_js.getRollupUrl(parseAst_js.URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT));
177
178
  const plugins = [...new Set(warnings.map(({ plugin }) => plugin).filter(Boolean))];
178
- rollup.stderr(`Plugins that transform code (such as ${rollup.printQuotedStringList(plugins)}) should generate accompanying sourcemaps.`);
179
+ rollup.stderr(`Plugins that transform code (such as ${parseAst_js.printQuotedStringList(plugins)}) should generate accompanying sourcemaps.`);
179
180
  },
180
181
  THIS_IS_UNDEFINED(warnings) {
181
182
  title('"this" has been rewritten to "undefined"');
182
- info(rollup.getRollupUrl(rollup.URL_THIS_IS_UNDEFINED));
183
+ info(parseAst_js.getRollupUrl(parseAst_js.URL_THIS_IS_UNDEFINED));
183
184
  showTruncatedWarnings(warnings);
184
185
  },
185
186
  UNRESOLVED_IMPORT(warnings) {
186
187
  title('Unresolved dependencies');
187
- info(rollup.getRollupUrl(rollup.URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY));
188
+ info(parseAst_js.getRollupUrl(parseAst_js.URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY));
188
189
  const dependencies = new Map();
189
190
  for (const warning of warnings) {
190
- rollup.getOrCreate(dependencies, rollup.relativeId(warning.exporter), rollup.getNewArray).push(rollup.relativeId(warning.id));
191
+ rollup.getOrCreate(dependencies, parseAst_js.relativeId(warning.exporter), rollup.getNewArray).push(parseAst_js.relativeId(warning.id));
191
192
  }
192
193
  for (const [dependency, importers] of dependencies) {
193
- rollup.stderr(`${rollup.bold(dependency)} (imported by ${rollup.printQuotedStringList(importers)})`);
194
+ rollup.stderr(`${rollup.bold(dependency)} (imported by ${parseAst_js.printQuotedStringList(importers)})`);
194
195
  }
195
196
  },
196
197
  UNUSED_EXTERNAL_IMPORT(warnings) {
@@ -200,19 +201,19 @@ const deferredHandlers = {
200
201
  ' imported from external module "' +
201
202
  warning.exporter +
202
203
  '" but never used in ' +
203
- rollup.printQuotedStringList(warning.ids.map(rollup.relativeId)) +
204
+ parseAst_js.printQuotedStringList(warning.ids.map(parseAst_js.relativeId)) +
204
205
  '.');
205
206
  }
206
207
  }
207
208
  };
208
209
  function defaultBody(log) {
209
210
  if (log.url) {
210
- info(rollup.getRollupUrl(log.url));
211
+ info(parseAst_js.getRollupUrl(log.url));
211
212
  }
212
213
  const id = log.loc?.file || log.id;
213
214
  if (id) {
214
- const loc = log.loc ? `${rollup.relativeId(id)} (${log.loc.line}:${log.loc.column})` : rollup.relativeId(id);
215
- rollup.stderr(rollup.bold(rollup.relativeId(loc)));
215
+ const loc = log.loc ? `${parseAst_js.relativeId(id)} (${log.loc.line}:${log.loc.column})` : parseAst_js.relativeId(id);
216
+ rollup.stderr(rollup.bold(parseAst_js.relativeId(loc)));
216
217
  }
217
218
  if (log.frame)
218
219
  info(log.frame);
@@ -243,7 +244,7 @@ function showTruncatedWarnings(warnings) {
243
244
  const nestedByModule = nest(warnings, 'id');
244
245
  const displayedByModule = nestedByModule.length > 5 ? nestedByModule.slice(0, 3) : nestedByModule;
245
246
  for (const { key: id, items } of displayedByModule) {
246
- rollup.stderr(rollup.bold(rollup.relativeId(id)));
247
+ rollup.stderr(rollup.bold(parseAst_js.relativeId(id)));
247
248
  rollup.stderr(rollup.gray(items[0].frame));
248
249
  if (items.length > 1) {
249
250
  rollup.stderr(`...and ${items.length - 1} other ${items.length > 2 ? 'occurrences' : 'occurrence'}`);
@@ -448,7 +449,7 @@ async function getConfigFileExport(fileName, commandOptions, watchMode) {
448
449
  }
449
450
  catch (error_) {
450
451
  if (error_.message.includes('not defined in ES module scope')) {
451
- return rollup.error(rollup.logCannotBundleConfigAsEsm(error_));
452
+ return parseAst_js.error(parseAst_js.logCannotBundleConfigAsEsm(error_));
452
453
  }
453
454
  throw error_;
454
455
  }
@@ -470,10 +471,10 @@ async function getConfigFileExport(fileName, commandOptions, watchMode) {
470
471
  }
471
472
  catch (error_) {
472
473
  if (cannotLoadEsm) {
473
- return rollup.error(rollup.logCannotLoadConfigAsCjs(error_));
474
+ return parseAst_js.error(parseAst_js.logCannotLoadConfigAsCjs(error_));
474
475
  }
475
476
  if (error_.message.includes('not defined in ES module scope')) {
476
- return rollup.error(rollup.logCannotLoadConfigAsEsm(error_));
477
+ return parseAst_js.error(parseAst_js.logCannotLoadConfigAsEsm(error_));
477
478
  }
478
479
  throw error_;
479
480
  }
@@ -514,7 +515,7 @@ async function loadTranspiledConfigFile(fileName, commandOptions) {
514
515
  ]
515
516
  });
516
517
  if (!silent && warnings.count > 0) {
517
- rollup.stderr(rollup.bold(`loaded ${rollup.relativeId(fileName)} with warnings`));
518
+ rollup.stderr(rollup.bold(`loaded ${parseAst_js.relativeId(fileName)} with warnings`));
518
519
  warnings.flush();
519
520
  }
520
521
  return loadConfigFromWrittenFile(node_path.join(node_path.dirname(fileName), `rollup.config-${Date.now()}.${bundleConfigAsCjs ? 'cjs' : 'mjs'}`), code);
@@ -534,7 +535,7 @@ async function getConfigList(configFileExport, commandOptions) {
534
535
  ? configFileExport(commandOptions)
535
536
  : configFileExport);
536
537
  if (Object.keys(config).length === 0) {
537
- return rollup.error(rollup.logMissingConfig());
538
+ return parseAst_js.error(parseAst_js.logMissingConfig());
538
539
  }
539
540
  return Array.isArray(config) ? config : [config];
540
541
  }