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/CHANGELOG.md +6748 -0
- package/LICENSE.md +0 -29
- package/README.md +2 -2
- package/dist/bin/rollup +21 -27
- package/dist/es/rollup.js +8 -7
- package/dist/es/shared/rollup.js +408 -285
- package/dist/es/shared/watch.js +27 -19
- package/dist/loadConfigFile.js +11 -11
- package/dist/rollup.d.ts +101 -111
- package/dist/rollup.js +9 -8
- package/dist/shared/index.js +2 -2
- package/dist/shared/loadConfigFile.js +63 -166
- package/dist/shared/mergeOptions.js +3 -3
- package/dist/shared/rollup.js +481 -335
- package/dist/shared/watch-cli.js +13 -10
- package/dist/shared/watch.js +29 -21
- package/package.json +18 -19
package/dist/shared/watch-cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v3.0.0-
|
|
4
|
-
|
|
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
|
|
|
@@ -11,23 +11,26 @@
|
|
|
11
11
|
|
|
12
12
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
const process$2 = require('process');
|
|
14
|
+
const node_fs = require('node:fs');
|
|
15
|
+
const process$2 = require('node:process');
|
|
16
16
|
const index = require('./index.js');
|
|
17
17
|
const cli = require('../bin/rollup');
|
|
18
18
|
const rollup = require('./rollup.js');
|
|
19
19
|
const require$$0 = require('assert');
|
|
20
20
|
const require$$0$1 = require('events');
|
|
21
21
|
const loadConfigFile_js = require('./loadConfigFile.js');
|
|
22
|
-
const
|
|
22
|
+
const node_child_process = require('node:child_process');
|
|
23
|
+
require('fs');
|
|
23
24
|
require('util');
|
|
24
25
|
require('stream');
|
|
25
26
|
require('path');
|
|
26
27
|
require('os');
|
|
27
28
|
require('./mergeOptions.js');
|
|
28
|
-
require('
|
|
29
|
-
require('
|
|
30
|
-
require('
|
|
29
|
+
require('node:path');
|
|
30
|
+
require('node:perf_hooks');
|
|
31
|
+
require('node:crypto');
|
|
32
|
+
require('node:events');
|
|
33
|
+
require('node:url');
|
|
31
34
|
require('tty');
|
|
32
35
|
|
|
33
36
|
function timeZone(date = new Date()) {
|
|
@@ -376,7 +379,7 @@ function createWatchHooks(command) {
|
|
|
376
379
|
try {
|
|
377
380
|
// !! important - use stderr for all writes from execSync
|
|
378
381
|
const stdio = [process.stdin, process.stderr, process.stderr];
|
|
379
|
-
|
|
382
|
+
node_child_process.execSync(cmd, { stdio: command.silent ? 'ignore' : stdio });
|
|
380
383
|
}
|
|
381
384
|
catch (e) {
|
|
382
385
|
loadConfigFile_js.stderr(e.message);
|
|
@@ -407,7 +410,7 @@ async function watch(command) {
|
|
|
407
410
|
await reloadConfigFile();
|
|
408
411
|
async function reloadConfigFile() {
|
|
409
412
|
try {
|
|
410
|
-
const newConfigFileData = await
|
|
413
|
+
const newConfigFileData = await node_fs.promises.readFile(configFile, 'utf8');
|
|
411
414
|
if (newConfigFileData === configFileData) {
|
|
412
415
|
return;
|
|
413
416
|
}
|
package/dist/shared/watch.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v3.0.0-
|
|
4
|
-
|
|
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
|
|
|
@@ -11,18 +11,22 @@
|
|
|
11
11
|
|
|
12
12
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
const process = require('process');
|
|
14
|
+
const node_path = require('node:path');
|
|
15
|
+
const process = require('node:process');
|
|
16
16
|
const rollup = require('./rollup.js');
|
|
17
17
|
const mergeOptions = require('./mergeOptions.js');
|
|
18
|
-
const
|
|
18
|
+
const node_os = require('node:os');
|
|
19
19
|
const index = require('./index.js');
|
|
20
|
-
require('
|
|
21
|
-
require('
|
|
20
|
+
require('path');
|
|
21
|
+
require('node:perf_hooks');
|
|
22
|
+
require('node:crypto');
|
|
23
|
+
require('node:fs');
|
|
24
|
+
require('node:events');
|
|
22
25
|
require('fs');
|
|
23
|
-
require('events');
|
|
24
26
|
require('util');
|
|
25
27
|
require('stream');
|
|
28
|
+
require('os');
|
|
29
|
+
require('events');
|
|
26
30
|
|
|
27
31
|
class FileWatcher {
|
|
28
32
|
constructor(task, chokidarOptions) {
|
|
@@ -58,7 +62,7 @@ class FileWatcher {
|
|
|
58
62
|
}
|
|
59
63
|
createWatcher(transformWatcherId) {
|
|
60
64
|
const task = this.task;
|
|
61
|
-
const isLinux =
|
|
65
|
+
const isLinux = node_os.platform() === 'linux';
|
|
62
66
|
const isTransformDependency = transformWatcherId !== null;
|
|
63
67
|
const handleChange = (id, event) => {
|
|
64
68
|
const changedId = transformWatcherId || id;
|
|
@@ -101,6 +105,7 @@ class Watcher {
|
|
|
101
105
|
constructor(configs, emitter) {
|
|
102
106
|
this.buildDelay = 0;
|
|
103
107
|
this.buildTimeout = null;
|
|
108
|
+
this.closed = false;
|
|
104
109
|
this.invalidatedIds = new Map();
|
|
105
110
|
this.rerun = false;
|
|
106
111
|
this.running = true;
|
|
@@ -113,12 +118,15 @@ class Watcher {
|
|
|
113
118
|
process.nextTick(() => this.run());
|
|
114
119
|
}
|
|
115
120
|
async close() {
|
|
121
|
+
if (this.closed)
|
|
122
|
+
return;
|
|
123
|
+
this.closed = true;
|
|
116
124
|
if (this.buildTimeout)
|
|
117
125
|
clearTimeout(this.buildTimeout);
|
|
118
126
|
for (const task of this.tasks) {
|
|
119
127
|
task.close();
|
|
120
128
|
}
|
|
121
|
-
await this.emitter.
|
|
129
|
+
await this.emitter.emit('close');
|
|
122
130
|
this.emitter.removeAllListeners();
|
|
123
131
|
}
|
|
124
132
|
invalidate(file) {
|
|
@@ -145,20 +153,20 @@ class Watcher {
|
|
|
145
153
|
this.buildTimeout = setTimeout(async () => {
|
|
146
154
|
this.buildTimeout = null;
|
|
147
155
|
try {
|
|
148
|
-
await Promise.all([...this.invalidatedIds].map(([id, event]) => this.emitter.
|
|
156
|
+
await Promise.all([...this.invalidatedIds].map(([id, event]) => this.emitter.emit('change', id, { event })));
|
|
149
157
|
this.invalidatedIds.clear();
|
|
150
|
-
this.emitter.emit('restart');
|
|
151
|
-
this.emitter.
|
|
158
|
+
await this.emitter.emit('restart');
|
|
159
|
+
this.emitter.removeListenersForCurrentRun();
|
|
152
160
|
this.run();
|
|
153
161
|
}
|
|
154
162
|
catch (error) {
|
|
155
163
|
this.invalidatedIds.clear();
|
|
156
|
-
this.emitter.emit('event', {
|
|
164
|
+
await this.emitter.emit('event', {
|
|
157
165
|
code: 'ERROR',
|
|
158
166
|
error,
|
|
159
167
|
result: null
|
|
160
168
|
});
|
|
161
|
-
this.emitter.emit('event', {
|
|
169
|
+
await this.emitter.emit('event', {
|
|
162
170
|
code: 'END'
|
|
163
171
|
});
|
|
164
172
|
}
|
|
@@ -166,14 +174,14 @@ class Watcher {
|
|
|
166
174
|
}
|
|
167
175
|
async run() {
|
|
168
176
|
this.running = true;
|
|
169
|
-
this.emitter.emit('event', {
|
|
177
|
+
await this.emitter.emit('event', {
|
|
170
178
|
code: 'START'
|
|
171
179
|
});
|
|
172
180
|
for (const task of this.tasks) {
|
|
173
181
|
await task.run();
|
|
174
182
|
}
|
|
175
183
|
this.running = false;
|
|
176
|
-
this.emitter.emit('event', {
|
|
184
|
+
await this.emitter.emit('event', {
|
|
177
185
|
code: 'END'
|
|
178
186
|
});
|
|
179
187
|
if (this.rerun) {
|
|
@@ -195,7 +203,7 @@ class Task {
|
|
|
195
203
|
this.outputs = this.options.output;
|
|
196
204
|
this.outputFiles = this.outputs.map(output => {
|
|
197
205
|
if (output.file || output.dir)
|
|
198
|
-
return
|
|
206
|
+
return node_path.resolve(output.file || output.dir);
|
|
199
207
|
return undefined;
|
|
200
208
|
});
|
|
201
209
|
const watchOptions = this.options.watch || {};
|
|
@@ -231,7 +239,7 @@ class Task {
|
|
|
231
239
|
cache: this.cache
|
|
232
240
|
};
|
|
233
241
|
const start = Date.now();
|
|
234
|
-
this.watcher.emitter.emit('event', {
|
|
242
|
+
await this.watcher.emitter.emit('event', {
|
|
235
243
|
code: 'BUNDLE_START',
|
|
236
244
|
input: this.options.input,
|
|
237
245
|
output: this.outputFiles
|
|
@@ -244,7 +252,7 @@ class Task {
|
|
|
244
252
|
}
|
|
245
253
|
this.updateWatchedFiles(result);
|
|
246
254
|
this.skipWrite || (await Promise.all(this.outputs.map(output => result.write(output))));
|
|
247
|
-
this.watcher.emitter.emit('event', {
|
|
255
|
+
await this.watcher.emitter.emit('event', {
|
|
248
256
|
code: 'BUNDLE_END',
|
|
249
257
|
duration: Date.now() - start,
|
|
250
258
|
input: this.options.input,
|
|
@@ -263,7 +271,7 @@ class Task {
|
|
|
263
271
|
this.cache.modules = this.cache.modules.filter(module => module.id !== error.id);
|
|
264
272
|
}
|
|
265
273
|
}
|
|
266
|
-
this.watcher.emitter.emit('event', {
|
|
274
|
+
await this.watcher.emitter.emit('event', {
|
|
267
275
|
code: 'ERROR',
|
|
268
276
|
error,
|
|
269
277
|
result
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rollup",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-6",
|
|
4
4
|
"description": "Next-generation ES module bundler",
|
|
5
5
|
"main": "dist/rollup.js",
|
|
6
6
|
"module": "dist/es/rollup.js",
|
|
@@ -57,50 +57,49 @@
|
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@rollup/plugin-alias": "^3.1.9",
|
|
59
59
|
"@rollup/plugin-buble": "^0.21.3",
|
|
60
|
-
"@rollup/plugin-commonjs": "^22.0.
|
|
60
|
+
"@rollup/plugin-commonjs": "^22.0.2",
|
|
61
61
|
"@rollup/plugin-json": "^4.1.0",
|
|
62
62
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
63
63
|
"@rollup/plugin-replace": "^4.0.0",
|
|
64
|
-
"@rollup/plugin-typescript": "^8.
|
|
64
|
+
"@rollup/plugin-typescript": "^8.4.0",
|
|
65
65
|
"@rollup/pluginutils": "^4.2.1",
|
|
66
|
-
"@types/estree": "0.0
|
|
67
|
-
"@types/node": "^14.18.
|
|
66
|
+
"@types/estree": "1.0.0",
|
|
67
|
+
"@types/node": "^14.18.26",
|
|
68
68
|
"@types/signal-exit": "^3.0.1",
|
|
69
69
|
"@types/yargs-parser": "^21.0.0",
|
|
70
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
71
|
-
"@typescript-eslint/parser": "^5.
|
|
72
|
-
"acorn": "^8.
|
|
70
|
+
"@typescript-eslint/eslint-plugin": "^5.36.1",
|
|
71
|
+
"@typescript-eslint/parser": "^5.36.1",
|
|
72
|
+
"acorn": "^8.8.0",
|
|
73
73
|
"acorn-jsx": "^5.3.2",
|
|
74
74
|
"acorn-walk": "^8.2.0",
|
|
75
75
|
"buble": "^0.20.0",
|
|
76
76
|
"chokidar": "^3.5.3",
|
|
77
77
|
"colorette": "^2.0.19",
|
|
78
|
-
"core-js": "^3.
|
|
78
|
+
"core-js": "^3.25.0",
|
|
79
79
|
"date-time": "^4.0.0",
|
|
80
80
|
"es5-shim": "^4.6.7",
|
|
81
81
|
"es6-shim": "^0.35.6",
|
|
82
|
-
"eslint": "^8.
|
|
82
|
+
"eslint": "^8.22.0",
|
|
83
83
|
"eslint-config-prettier": "^8.5.0",
|
|
84
84
|
"eslint-plugin-import": "^2.26.0",
|
|
85
85
|
"eslint-plugin-prettier": "^4.2.1",
|
|
86
86
|
"fixturify": "^2.1.1",
|
|
87
87
|
"fs-extra": "^10.1.0",
|
|
88
|
-
"get-package-type": "^0.1.0",
|
|
89
88
|
"github-api": "^3.4.0",
|
|
90
89
|
"hash.js": "^1.1.7",
|
|
91
90
|
"husky": "^8.0.1",
|
|
92
|
-
"inquirer": "^9.0
|
|
91
|
+
"inquirer": "^9.1.0",
|
|
93
92
|
"is-reference": "^3.0.0",
|
|
94
93
|
"lint-staged": "^13.0.3",
|
|
95
94
|
"locate-character": "^2.0.5",
|
|
96
|
-
"magic-string": "^0.26.
|
|
95
|
+
"magic-string": "^0.26.3",
|
|
97
96
|
"mocha": "^10.0.0",
|
|
98
97
|
"nyc": "^15.1.0",
|
|
99
98
|
"prettier": "^2.7.1",
|
|
100
99
|
"pretty-bytes": "^6.0.0",
|
|
101
100
|
"pretty-ms": "^8.0.0",
|
|
102
101
|
"requirejs": "^2.3.6",
|
|
103
|
-
"rollup": "^2.
|
|
102
|
+
"rollup": "^2.79.0",
|
|
104
103
|
"rollup-plugin-license": "^2.8.1",
|
|
105
104
|
"rollup-plugin-string": "^3.0.0",
|
|
106
105
|
"rollup-plugin-terser": "^7.0.2",
|
|
@@ -111,12 +110,12 @@
|
|
|
111
110
|
"source-map": "^0.7.4",
|
|
112
111
|
"source-map-support": "^0.5.21",
|
|
113
112
|
"sourcemap-codec": "^1.4.8",
|
|
114
|
-
"systemjs": "^6.12.
|
|
115
|
-
"terser": "^5.
|
|
113
|
+
"systemjs": "^6.12.4",
|
|
114
|
+
"terser": "^5.15.0",
|
|
116
115
|
"tslib": "^2.4.0",
|
|
117
|
-
"typescript": "^4.
|
|
116
|
+
"typescript": "^4.8.2",
|
|
118
117
|
"weak-napi": "^2.0.2",
|
|
119
|
-
"yargs-parser": "^21.
|
|
118
|
+
"yargs-parser": "^21.1.1"
|
|
120
119
|
},
|
|
121
120
|
"files": [
|
|
122
121
|
"dist/**/*.js",
|
|
@@ -125,7 +124,7 @@
|
|
|
125
124
|
"dist/es/package.json"
|
|
126
125
|
],
|
|
127
126
|
"engines": {
|
|
128
|
-
"node": ">=14.
|
|
127
|
+
"node": ">=14.18.0",
|
|
129
128
|
"npm": ">=8.0.0"
|
|
130
129
|
},
|
|
131
130
|
"exports": {
|