create-microact-app 1.0.1
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/index.js +95 -0
- package/package.json +21 -0
- package/templates/vanilla/.github/workflows/deploy.yml +38 -0
- package/templates/vanilla/index.html +13 -0
- package/templates/vanilla/node_modules/.package-lock.json +207 -0
- package/templates/vanilla/node_modules/@esbuild/darwin-x64/README.md +3 -0
- package/templates/vanilla/node_modules/@esbuild/darwin-x64/bin/esbuild +0 -0
- package/templates/vanilla/node_modules/@esbuild/darwin-x64/package.json +17 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/README.md +154 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.cjs.js +1749 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.cjs.js.map +1 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.esm.js +1743 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.esm.js.map +1 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.umd.js +2 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.umd.js.map +1 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/example/index.html +13 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/example/index.js +63 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/package.json +38 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/rollup.config.cjs +30 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/Component.js +831 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/DOMUpdater.js +320 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/EventBus.js +123 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/Router.js +253 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/UpdateScheduler.js +218 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/index.js +6 -0
- package/templates/vanilla/node_modules/esbuild/LICENSE.md +21 -0
- package/templates/vanilla/node_modules/esbuild/README.md +3 -0
- package/templates/vanilla/node_modules/esbuild/bin/esbuild +0 -0
- package/templates/vanilla/node_modules/esbuild/install.js +287 -0
- package/templates/vanilla/node_modules/esbuild/lib/main.d.ts +660 -0
- package/templates/vanilla/node_modules/esbuild/lib/main.js +2393 -0
- package/templates/vanilla/node_modules/esbuild/package.json +42 -0
- package/templates/vanilla/node_modules/nanoid/LICENSE +20 -0
- package/templates/vanilla/node_modules/nanoid/README.md +39 -0
- package/templates/vanilla/node_modules/nanoid/async/index.browser.cjs +69 -0
- package/templates/vanilla/node_modules/nanoid/async/index.browser.js +34 -0
- package/templates/vanilla/node_modules/nanoid/async/index.cjs +71 -0
- package/templates/vanilla/node_modules/nanoid/async/index.d.ts +56 -0
- package/templates/vanilla/node_modules/nanoid/async/index.js +35 -0
- package/templates/vanilla/node_modules/nanoid/async/index.native.js +26 -0
- package/templates/vanilla/node_modules/nanoid/async/package.json +12 -0
- package/templates/vanilla/node_modules/nanoid/bin/nanoid.cjs +55 -0
- package/templates/vanilla/node_modules/nanoid/index.browser.cjs +72 -0
- package/templates/vanilla/node_modules/nanoid/index.browser.js +34 -0
- package/templates/vanilla/node_modules/nanoid/index.cjs +85 -0
- package/templates/vanilla/node_modules/nanoid/index.d.cts +91 -0
- package/templates/vanilla/node_modules/nanoid/index.d.ts +91 -0
- package/templates/vanilla/node_modules/nanoid/index.js +45 -0
- package/templates/vanilla/node_modules/nanoid/nanoid.js +1 -0
- package/templates/vanilla/node_modules/nanoid/non-secure/index.cjs +34 -0
- package/templates/vanilla/node_modules/nanoid/non-secure/index.d.ts +33 -0
- package/templates/vanilla/node_modules/nanoid/non-secure/index.js +21 -0
- package/templates/vanilla/node_modules/nanoid/non-secure/package.json +6 -0
- package/templates/vanilla/node_modules/nanoid/package.json +89 -0
- package/templates/vanilla/node_modules/nanoid/url-alphabet/index.cjs +7 -0
- package/templates/vanilla/node_modules/nanoid/url-alphabet/index.js +3 -0
- package/templates/vanilla/node_modules/nanoid/url-alphabet/package.json +6 -0
- package/templates/vanilla/node_modules/picocolors/LICENSE +15 -0
- package/templates/vanilla/node_modules/picocolors/README.md +21 -0
- package/templates/vanilla/node_modules/picocolors/package.json +25 -0
- package/templates/vanilla/node_modules/picocolors/picocolors.browser.js +4 -0
- package/templates/vanilla/node_modules/picocolors/picocolors.d.ts +5 -0
- package/templates/vanilla/node_modules/picocolors/picocolors.js +75 -0
- package/templates/vanilla/node_modules/picocolors/types.d.ts +51 -0
- package/templates/vanilla/node_modules/postcss/LICENSE +20 -0
- package/templates/vanilla/node_modules/postcss/README.md +29 -0
- package/templates/vanilla/node_modules/postcss/lib/at-rule.d.ts +140 -0
- package/templates/vanilla/node_modules/postcss/lib/at-rule.js +25 -0
- package/templates/vanilla/node_modules/postcss/lib/comment.d.ts +68 -0
- package/templates/vanilla/node_modules/postcss/lib/comment.js +13 -0
- package/templates/vanilla/node_modules/postcss/lib/container.d.ts +483 -0
- package/templates/vanilla/node_modules/postcss/lib/container.js +447 -0
- package/templates/vanilla/node_modules/postcss/lib/css-syntax-error.d.ts +248 -0
- package/templates/vanilla/node_modules/postcss/lib/css-syntax-error.js +133 -0
- package/templates/vanilla/node_modules/postcss/lib/declaration.d.ts +151 -0
- package/templates/vanilla/node_modules/postcss/lib/declaration.js +24 -0
- package/templates/vanilla/node_modules/postcss/lib/document.d.ts +69 -0
- package/templates/vanilla/node_modules/postcss/lib/document.js +33 -0
- package/templates/vanilla/node_modules/postcss/lib/fromJSON.d.ts +9 -0
- package/templates/vanilla/node_modules/postcss/lib/fromJSON.js +54 -0
- package/templates/vanilla/node_modules/postcss/lib/input.d.ts +227 -0
- package/templates/vanilla/node_modules/postcss/lib/input.js +265 -0
- package/templates/vanilla/node_modules/postcss/lib/lazy-result.d.ts +190 -0
- package/templates/vanilla/node_modules/postcss/lib/lazy-result.js +550 -0
- package/templates/vanilla/node_modules/postcss/lib/list.d.ts +60 -0
- package/templates/vanilla/node_modules/postcss/lib/list.js +58 -0
- package/templates/vanilla/node_modules/postcss/lib/map-generator.js +368 -0
- package/templates/vanilla/node_modules/postcss/lib/no-work-result.d.ts +46 -0
- package/templates/vanilla/node_modules/postcss/lib/no-work-result.js +138 -0
- package/templates/vanilla/node_modules/postcss/lib/node.d.ts +556 -0
- package/templates/vanilla/node_modules/postcss/lib/node.js +449 -0
- package/templates/vanilla/node_modules/postcss/lib/parse.d.ts +9 -0
- package/templates/vanilla/node_modules/postcss/lib/parse.js +42 -0
- package/templates/vanilla/node_modules/postcss/lib/parser.js +611 -0
- package/templates/vanilla/node_modules/postcss/lib/postcss.d.mts +69 -0
- package/templates/vanilla/node_modules/postcss/lib/postcss.d.ts +458 -0
- package/templates/vanilla/node_modules/postcss/lib/postcss.js +101 -0
- package/templates/vanilla/node_modules/postcss/lib/postcss.mjs +30 -0
- package/templates/vanilla/node_modules/postcss/lib/previous-map.d.ts +81 -0
- package/templates/vanilla/node_modules/postcss/lib/previous-map.js +144 -0
- package/templates/vanilla/node_modules/postcss/lib/processor.d.ts +115 -0
- package/templates/vanilla/node_modules/postcss/lib/processor.js +67 -0
- package/templates/vanilla/node_modules/postcss/lib/result.d.ts +205 -0
- package/templates/vanilla/node_modules/postcss/lib/result.js +42 -0
- package/templates/vanilla/node_modules/postcss/lib/root.d.ts +87 -0
- package/templates/vanilla/node_modules/postcss/lib/root.js +61 -0
- package/templates/vanilla/node_modules/postcss/lib/rule.d.ts +126 -0
- package/templates/vanilla/node_modules/postcss/lib/rule.js +27 -0
- package/templates/vanilla/node_modules/postcss/lib/stringifier.d.ts +46 -0
- package/templates/vanilla/node_modules/postcss/lib/stringifier.js +353 -0
- package/templates/vanilla/node_modules/postcss/lib/stringify.d.ts +9 -0
- package/templates/vanilla/node_modules/postcss/lib/stringify.js +11 -0
- package/templates/vanilla/node_modules/postcss/lib/symbols.js +5 -0
- package/templates/vanilla/node_modules/postcss/lib/terminal-highlight.js +70 -0
- package/templates/vanilla/node_modules/postcss/lib/tokenize.js +266 -0
- package/templates/vanilla/node_modules/postcss/lib/warn-once.js +13 -0
- package/templates/vanilla/node_modules/postcss/lib/warning.d.ts +147 -0
- package/templates/vanilla/node_modules/postcss/lib/warning.js +37 -0
- package/templates/vanilla/node_modules/postcss/package.json +88 -0
- package/templates/vanilla/node_modules/rollup/LICENSE.md +695 -0
- package/templates/vanilla/node_modules/rollup/README.md +125 -0
- package/templates/vanilla/node_modules/rollup/dist/bin/rollup +1715 -0
- package/templates/vanilla/node_modules/rollup/dist/es/getLogFilter.js +64 -0
- package/templates/vanilla/node_modules/rollup/dist/es/package.json +1 -0
- package/templates/vanilla/node_modules/rollup/dist/es/rollup.js +17 -0
- package/templates/vanilla/node_modules/rollup/dist/es/shared/node-entry.js +27273 -0
- package/templates/vanilla/node_modules/rollup/dist/es/shared/watch.js +4857 -0
- package/templates/vanilla/node_modules/rollup/dist/getLogFilter.d.ts +5 -0
- package/templates/vanilla/node_modules/rollup/dist/getLogFilter.js +69 -0
- package/templates/vanilla/node_modules/rollup/dist/loadConfigFile.d.ts +20 -0
- package/templates/vanilla/node_modules/rollup/dist/loadConfigFile.js +29 -0
- package/templates/vanilla/node_modules/rollup/dist/rollup.d.ts +1012 -0
- package/templates/vanilla/node_modules/rollup/dist/rollup.js +31 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/fsevents-importer.js +37 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/index.js +4571 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/loadConfigFile.js +546 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/rollup.js +27351 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/watch-cli.js +561 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/watch-proxy.js +87 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/watch.js +316 -0
- package/templates/vanilla/node_modules/rollup/package.json +181 -0
- package/templates/vanilla/node_modules/source-map-js/LICENSE +28 -0
- package/templates/vanilla/node_modules/source-map-js/README.md +765 -0
- package/templates/vanilla/node_modules/source-map-js/lib/array-set.js +121 -0
- package/templates/vanilla/node_modules/source-map-js/lib/base64-vlq.js +140 -0
- package/templates/vanilla/node_modules/source-map-js/lib/base64.js +67 -0
- package/templates/vanilla/node_modules/source-map-js/lib/binary-search.js +111 -0
- package/templates/vanilla/node_modules/source-map-js/lib/mapping-list.js +79 -0
- package/templates/vanilla/node_modules/source-map-js/lib/quick-sort.js +132 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-map-consumer.d.ts +1 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-map-generator.d.ts +1 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-map-generator.js +444 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-node.d.ts +1 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-node.js +413 -0
- package/templates/vanilla/node_modules/source-map-js/lib/util.js +594 -0
- package/templates/vanilla/node_modules/source-map-js/package.json +71 -0
- package/templates/vanilla/node_modules/source-map-js/source-map.d.ts +104 -0
- package/templates/vanilla/node_modules/source-map-js/source-map.js +8 -0
- package/templates/vanilla/node_modules/vite/LICENSE.md +3396 -0
- package/templates/vanilla/node_modules/vite/README.md +20 -0
- package/templates/vanilla/node_modules/vite/bin/openChrome.applescript +95 -0
- package/templates/vanilla/node_modules/vite/bin/vite.js +61 -0
- package/templates/vanilla/node_modules/vite/client.d.ts +281 -0
- package/templates/vanilla/node_modules/vite/dist/client/client.mjs +725 -0
- package/templates/vanilla/node_modules/vite/dist/client/client.mjs.map +1 -0
- package/templates/vanilla/node_modules/vite/dist/client/env.mjs +30 -0
- package/templates/vanilla/node_modules/vite/dist/client/env.mjs.map +1 -0
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-7ec6f216.js +914 -0
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-827b23df.js +66713 -0
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-c423598f.js +561 -0
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-f0c7dae0.js +7930 -0
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-f1e8587f.js +7646 -0
- package/templates/vanilla/node_modules/vite/dist/node/cli.js +929 -0
- package/templates/vanilla/node_modules/vite/dist/node/constants.js +130 -0
- package/templates/vanilla/node_modules/vite/dist/node/index.d.ts +3548 -0
- package/templates/vanilla/node_modules/vite/dist/node/index.js +158 -0
- package/templates/vanilla/node_modules/vite/dist/node-cjs/publicUtils.cjs +4555 -0
- package/templates/vanilla/node_modules/vite/index.cjs +34 -0
- package/templates/vanilla/node_modules/vite/package.json +173 -0
- package/templates/vanilla/node_modules/vite/types/customEvent.d.ts +35 -0
- package/templates/vanilla/node_modules/vite/types/hmrPayload.d.ts +61 -0
- package/templates/vanilla/node_modules/vite/types/hot.d.ts +32 -0
- package/templates/vanilla/node_modules/vite/types/importGlob.d.ts +97 -0
- package/templates/vanilla/node_modules/vite/types/importMeta.d.ts +26 -0
- package/templates/vanilla/node_modules/vite/types/metadata.d.ts +10 -0
- package/templates/vanilla/node_modules/vite/types/package.json +4 -0
- package/templates/vanilla/package-lock.json +589 -0
- package/templates/vanilla/package.json +17 -0
- package/templates/vanilla/src/components/App.js +60 -0
- package/templates/vanilla/src/components/Card.js +21 -0
- package/templates/vanilla/src/components/Hero.js +15 -0
- package/templates/vanilla/src/components/InteractiveDemo.js +59 -0
- package/templates/vanilla/src/main.js +9 -0
- package/templates/vanilla/src/style/main.css +172 -0
- package/templates/vanilla/vite.config.js +8 -0
- package/templates/web3/.env.example +15 -0
- package/templates/web3/.github/workflows/deploy.yml +38 -0
- package/templates/web3/README.md +33 -0
- package/templates/web3/contracts/foundry.toml +11 -0
- package/templates/web3/contracts/script/Deploy.s.sol +13 -0
- package/templates/web3/contracts/src/Counter.sol +21 -0
- package/templates/web3/index.html +13 -0
- package/templates/web3/package.json +25 -0
- package/templates/web3/scripts/chain-start.mjs +305 -0
- package/templates/web3/scripts/chain-stop.mjs +34 -0
- package/templates/web3/scripts/deploy.mjs +155 -0
- package/templates/web3/scripts/setup.mjs +42 -0
- package/templates/web3/src/components/App.js +49 -0
- package/templates/web3/src/components/CounterCard.js +111 -0
- package/templates/web3/src/main.js +54 -0
- package/templates/web3/src/style/main.css +345 -0
- package/templates/web3/vite.config.js +29 -0
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
/*
|
|
2
|
+
@license
|
|
3
|
+
Rollup.js v3.29.4
|
|
4
|
+
Sat, 21 Sep 2024 06:29:06 GMT - commit 2ef77c00ec2635d42697cff2c0567ccc8db34fb4
|
|
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
|
+
const node_path = require('node:path');
|
|
15
|
+
const process = require('node:process');
|
|
16
|
+
const rollup = require('./rollup.js');
|
|
17
|
+
const node_os = require('node:os');
|
|
18
|
+
const index = require('./index.js');
|
|
19
|
+
require('tty');
|
|
20
|
+
require('path');
|
|
21
|
+
require('node:perf_hooks');
|
|
22
|
+
require('node:crypto');
|
|
23
|
+
require('node:fs/promises');
|
|
24
|
+
require('fs');
|
|
25
|
+
require('util');
|
|
26
|
+
require('stream');
|
|
27
|
+
require('os');
|
|
28
|
+
require('./fsevents-importer.js');
|
|
29
|
+
require('events');
|
|
30
|
+
|
|
31
|
+
class FileWatcher {
|
|
32
|
+
constructor(task, chokidarOptions) {
|
|
33
|
+
this.transformWatchers = new Map();
|
|
34
|
+
this.chokidarOptions = chokidarOptions;
|
|
35
|
+
this.task = task;
|
|
36
|
+
this.watcher = this.createWatcher(null);
|
|
37
|
+
}
|
|
38
|
+
close() {
|
|
39
|
+
this.watcher.close();
|
|
40
|
+
for (const watcher of this.transformWatchers.values()) {
|
|
41
|
+
watcher.close();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
unwatch(id) {
|
|
45
|
+
this.watcher.unwatch(id);
|
|
46
|
+
const transformWatcher = this.transformWatchers.get(id);
|
|
47
|
+
if (transformWatcher) {
|
|
48
|
+
this.transformWatchers.delete(id);
|
|
49
|
+
transformWatcher.close();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
watch(id, isTransformDependency) {
|
|
53
|
+
if (isTransformDependency) {
|
|
54
|
+
const watcher = this.transformWatchers.get(id) ?? this.createWatcher(id);
|
|
55
|
+
watcher.add(id);
|
|
56
|
+
this.transformWatchers.set(id, watcher);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
this.watcher.add(id);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
createWatcher(transformWatcherId) {
|
|
63
|
+
const task = this.task;
|
|
64
|
+
const isLinux = node_os.platform() === 'linux';
|
|
65
|
+
const isTransformDependency = transformWatcherId !== null;
|
|
66
|
+
const handleChange = (id, event) => {
|
|
67
|
+
const changedId = transformWatcherId || id;
|
|
68
|
+
if (isLinux) {
|
|
69
|
+
// unwatching and watching fixes an issue with chokidar where on certain systems,
|
|
70
|
+
// a file that was unlinked and immediately recreated would create a change event
|
|
71
|
+
// but then no longer any further events
|
|
72
|
+
watcher.unwatch(changedId);
|
|
73
|
+
watcher.add(changedId);
|
|
74
|
+
}
|
|
75
|
+
task.invalidate(changedId, { event, isTransformDependency });
|
|
76
|
+
};
|
|
77
|
+
const watcher = index.chokidar
|
|
78
|
+
.watch([], this.chokidarOptions)
|
|
79
|
+
.on('add', id => handleChange(id, 'create'))
|
|
80
|
+
.on('change', id => handleChange(id, 'update'))
|
|
81
|
+
.on('unlink', id => handleChange(id, 'delete'));
|
|
82
|
+
return watcher;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const eventsRewrites = {
|
|
87
|
+
create: {
|
|
88
|
+
create: 'buggy',
|
|
89
|
+
delete: null,
|
|
90
|
+
update: 'create'
|
|
91
|
+
},
|
|
92
|
+
delete: {
|
|
93
|
+
create: 'update',
|
|
94
|
+
delete: 'buggy',
|
|
95
|
+
update: 'buggy'
|
|
96
|
+
},
|
|
97
|
+
update: {
|
|
98
|
+
create: 'buggy',
|
|
99
|
+
delete: 'delete',
|
|
100
|
+
update: 'update'
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
class Watcher {
|
|
104
|
+
constructor(optionsList, emitter) {
|
|
105
|
+
this.buildDelay = 0;
|
|
106
|
+
this.buildTimeout = null;
|
|
107
|
+
this.closed = false;
|
|
108
|
+
this.invalidatedIds = new Map();
|
|
109
|
+
this.rerun = false;
|
|
110
|
+
this.running = true;
|
|
111
|
+
this.emitter = emitter;
|
|
112
|
+
emitter.close = this.close.bind(this);
|
|
113
|
+
this.tasks = optionsList.map(options => new Task(this, options));
|
|
114
|
+
for (const { watch } of optionsList) {
|
|
115
|
+
if (watch && typeof watch.buildDelay === 'number') {
|
|
116
|
+
this.buildDelay = Math.max(this.buildDelay, watch.buildDelay);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
process.nextTick(() => this.run());
|
|
120
|
+
}
|
|
121
|
+
async close() {
|
|
122
|
+
if (this.closed)
|
|
123
|
+
return;
|
|
124
|
+
this.closed = true;
|
|
125
|
+
if (this.buildTimeout)
|
|
126
|
+
clearTimeout(this.buildTimeout);
|
|
127
|
+
for (const task of this.tasks) {
|
|
128
|
+
task.close();
|
|
129
|
+
}
|
|
130
|
+
await this.emitter.emit('close');
|
|
131
|
+
this.emitter.removeAllListeners();
|
|
132
|
+
}
|
|
133
|
+
invalidate(file) {
|
|
134
|
+
if (file) {
|
|
135
|
+
const previousEvent = this.invalidatedIds.get(file.id);
|
|
136
|
+
const event = previousEvent ? eventsRewrites[previousEvent][file.event] : file.event;
|
|
137
|
+
if (event === 'buggy') {
|
|
138
|
+
//TODO: throws or warn? Currently just ignore, uses new event
|
|
139
|
+
this.invalidatedIds.set(file.id, file.event);
|
|
140
|
+
}
|
|
141
|
+
else if (event === null) {
|
|
142
|
+
this.invalidatedIds.delete(file.id);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
this.invalidatedIds.set(file.id, event);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (this.running) {
|
|
149
|
+
this.rerun = true;
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
if (this.buildTimeout)
|
|
153
|
+
clearTimeout(this.buildTimeout);
|
|
154
|
+
this.buildTimeout = setTimeout(async () => {
|
|
155
|
+
this.buildTimeout = null;
|
|
156
|
+
try {
|
|
157
|
+
await Promise.all([...this.invalidatedIds].map(([id, event]) => this.emitter.emit('change', id, { event })));
|
|
158
|
+
this.invalidatedIds.clear();
|
|
159
|
+
await this.emitter.emit('restart');
|
|
160
|
+
this.emitter.removeListenersForCurrentRun();
|
|
161
|
+
this.run();
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
this.invalidatedIds.clear();
|
|
165
|
+
await this.emitter.emit('event', {
|
|
166
|
+
code: 'ERROR',
|
|
167
|
+
error,
|
|
168
|
+
result: null
|
|
169
|
+
});
|
|
170
|
+
await this.emitter.emit('event', {
|
|
171
|
+
code: 'END'
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}, this.buildDelay);
|
|
175
|
+
}
|
|
176
|
+
async run() {
|
|
177
|
+
this.running = true;
|
|
178
|
+
await this.emitter.emit('event', {
|
|
179
|
+
code: 'START'
|
|
180
|
+
});
|
|
181
|
+
for (const task of this.tasks) {
|
|
182
|
+
await task.run();
|
|
183
|
+
}
|
|
184
|
+
this.running = false;
|
|
185
|
+
await this.emitter.emit('event', {
|
|
186
|
+
code: 'END'
|
|
187
|
+
});
|
|
188
|
+
if (this.rerun) {
|
|
189
|
+
this.rerun = false;
|
|
190
|
+
this.invalidate();
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
class Task {
|
|
195
|
+
constructor(watcher, options) {
|
|
196
|
+
this.cache = { modules: [] };
|
|
197
|
+
this.watchFiles = [];
|
|
198
|
+
this.closed = false;
|
|
199
|
+
this.invalidated = true;
|
|
200
|
+
this.watched = new Set();
|
|
201
|
+
this.watcher = watcher;
|
|
202
|
+
this.options = options;
|
|
203
|
+
this.skipWrite = Boolean(options.watch && options.watch.skipWrite);
|
|
204
|
+
this.outputs = this.options.output;
|
|
205
|
+
this.outputFiles = this.outputs.map(output => {
|
|
206
|
+
if (output.file || output.dir)
|
|
207
|
+
return node_path.resolve(output.file || output.dir);
|
|
208
|
+
return undefined;
|
|
209
|
+
});
|
|
210
|
+
const watchOptions = this.options.watch || {};
|
|
211
|
+
this.filter = rollup.createFilter(watchOptions.include, watchOptions.exclude);
|
|
212
|
+
this.fileWatcher = new FileWatcher(this, {
|
|
213
|
+
...watchOptions.chokidar,
|
|
214
|
+
disableGlobbing: true,
|
|
215
|
+
ignoreInitial: true
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
close() {
|
|
219
|
+
this.closed = true;
|
|
220
|
+
this.fileWatcher.close();
|
|
221
|
+
}
|
|
222
|
+
invalidate(id, details) {
|
|
223
|
+
this.invalidated = true;
|
|
224
|
+
if (details.isTransformDependency) {
|
|
225
|
+
for (const module of this.cache.modules) {
|
|
226
|
+
if (!module.transformDependencies.includes(id))
|
|
227
|
+
continue;
|
|
228
|
+
// effective invalidation
|
|
229
|
+
module.originalCode = null;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
this.watcher.invalidate({ event: details.event, id });
|
|
233
|
+
}
|
|
234
|
+
async run() {
|
|
235
|
+
if (!this.invalidated)
|
|
236
|
+
return;
|
|
237
|
+
this.invalidated = false;
|
|
238
|
+
const options = {
|
|
239
|
+
...this.options,
|
|
240
|
+
cache: this.cache
|
|
241
|
+
};
|
|
242
|
+
const start = Date.now();
|
|
243
|
+
await this.watcher.emitter.emit('event', {
|
|
244
|
+
code: 'BUNDLE_START',
|
|
245
|
+
input: this.options.input,
|
|
246
|
+
output: this.outputFiles
|
|
247
|
+
});
|
|
248
|
+
let result = null;
|
|
249
|
+
try {
|
|
250
|
+
result = await rollup.rollupInternal(options, this.watcher.emitter);
|
|
251
|
+
if (this.closed) {
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
this.updateWatchedFiles(result);
|
|
255
|
+
this.skipWrite || (await Promise.all(this.outputs.map(output => result.write(output))));
|
|
256
|
+
await this.watcher.emitter.emit('event', {
|
|
257
|
+
code: 'BUNDLE_END',
|
|
258
|
+
duration: Date.now() - start,
|
|
259
|
+
input: this.options.input,
|
|
260
|
+
output: this.outputFiles,
|
|
261
|
+
result
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
catch (error) {
|
|
265
|
+
if (!this.closed) {
|
|
266
|
+
if (Array.isArray(error.watchFiles)) {
|
|
267
|
+
for (const id of error.watchFiles) {
|
|
268
|
+
this.watchFile(id);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
if (error.id) {
|
|
272
|
+
this.cache.modules = this.cache.modules.filter(module => module.id !== error.id);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
await this.watcher.emitter.emit('event', {
|
|
276
|
+
code: 'ERROR',
|
|
277
|
+
error,
|
|
278
|
+
result
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
updateWatchedFiles(result) {
|
|
283
|
+
const previouslyWatched = this.watched;
|
|
284
|
+
this.watched = new Set();
|
|
285
|
+
this.watchFiles = result.watchFiles;
|
|
286
|
+
this.cache = result.cache;
|
|
287
|
+
for (const id of this.watchFiles) {
|
|
288
|
+
this.watchFile(id);
|
|
289
|
+
}
|
|
290
|
+
for (const module of this.cache.modules) {
|
|
291
|
+
for (const depId of module.transformDependencies) {
|
|
292
|
+
this.watchFile(depId, true);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
for (const id of previouslyWatched) {
|
|
296
|
+
if (!this.watched.has(id)) {
|
|
297
|
+
this.fileWatcher.unwatch(id);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
watchFile(id, isTransformDependency = false) {
|
|
302
|
+
if (!this.filter(id))
|
|
303
|
+
return;
|
|
304
|
+
this.watched.add(id);
|
|
305
|
+
if (this.outputFiles.includes(id)) {
|
|
306
|
+
throw new Error('Cannot import the generated bundle');
|
|
307
|
+
}
|
|
308
|
+
// this is necessary to ensure that any 'renamed' files
|
|
309
|
+
// continue to be watched following an error
|
|
310
|
+
this.fileWatcher.watch(id, isTransformDependency);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
exports.Task = Task;
|
|
315
|
+
exports.Watcher = Watcher;
|
|
316
|
+
//# sourceMappingURL=watch.js.map
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rollup",
|
|
3
|
+
"version": "3.29.5",
|
|
4
|
+
"description": "Next-generation ES module bundler",
|
|
5
|
+
"main": "dist/rollup.js",
|
|
6
|
+
"module": "dist/es/rollup.js",
|
|
7
|
+
"types": "dist/rollup.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"rollup": "dist/bin/rollup"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "rollup --config rollup.config.ts --configPlugin typescript",
|
|
13
|
+
"dev": "vitepress dev docs",
|
|
14
|
+
"build:cjs": "rollup --config rollup.config.ts --configPlugin typescript --configTest",
|
|
15
|
+
"build:bootstrap": "node dist/bin/rollup --config rollup.config.ts --configPlugin typescript",
|
|
16
|
+
"build:docs": "vitepress build docs",
|
|
17
|
+
"preview:docs": "vitepress preview docs",
|
|
18
|
+
"ci:lint": "concurrently 'npm:lint:js:nofix' 'npm:lint:markdown:nofix'",
|
|
19
|
+
"ci:test": "npm run build:cjs && npm run build:bootstrap && npm run test:all",
|
|
20
|
+
"ci:test:only": "npm run build:cjs && npm run build:bootstrap && npm run test:only",
|
|
21
|
+
"ci:coverage": "npm run build:cjs && npm run build:bootstrap && nyc --reporter lcovonly mocha",
|
|
22
|
+
"lint": "concurrently -c red,green 'npm:lint:js' 'npm:lint:markdown'",
|
|
23
|
+
"lint:js": "eslint . --fix --cache",
|
|
24
|
+
"lint:js:nofix": "eslint . --cache",
|
|
25
|
+
"lint:markdown": "prettier --write \"**/*.md\"",
|
|
26
|
+
"lint:markdown:nofix": "prettier --check \"**/*.md\"",
|
|
27
|
+
"perf": "npm run build:cjs && node --expose-gc scripts/perf.js",
|
|
28
|
+
"perf:init": "node scripts/perf-init.js",
|
|
29
|
+
"prepare": "husky install && node scripts/check-release.js || npm run build",
|
|
30
|
+
"prepublishOnly": "node scripts/check-release.js",
|
|
31
|
+
"release": "node scripts/release.js",
|
|
32
|
+
"release:docs": "git fetch --update-head-ok origin master:master && git branch --force documentation-published master && git push origin documentation-published",
|
|
33
|
+
"test": "npm run build && npm run test:all",
|
|
34
|
+
"test:update-snapshots": "node scripts/update-snapshots.js",
|
|
35
|
+
"test:cjs": "npm run build:cjs && npm run test:only",
|
|
36
|
+
"test:quick": "mocha -b test/test.js",
|
|
37
|
+
"test:all": "concurrently --kill-others-on-fail -c green,blue,magenta,cyan,red 'npm:test:only' 'npm:test:browser' 'npm:test:typescript' 'npm:test:leak' 'npm:test:package' 'npm:test:options'",
|
|
38
|
+
"test:coverage": "npm run build:cjs && shx rm -rf coverage/* && nyc --reporter html mocha test/test.js",
|
|
39
|
+
"test:coverage:browser": "npm run build && shx rm -rf coverage/* && nyc mocha test/browser/index.js",
|
|
40
|
+
"test:leak": "node --expose-gc test/leak/index.js",
|
|
41
|
+
"test:package": "node scripts/test-package.js",
|
|
42
|
+
"test:options": "node scripts/test-options.js",
|
|
43
|
+
"test:only": "mocha test/test.js",
|
|
44
|
+
"test:typescript": "shx rm -rf test/typescript/dist && shx cp -r dist test/typescript/ && tsc --noEmit -p test/typescript && tsc --noEmit",
|
|
45
|
+
"test:browser": "mocha test/browser/index.js",
|
|
46
|
+
"watch": "rollup --config rollup.config.ts --configPlugin typescript --watch"
|
|
47
|
+
},
|
|
48
|
+
"repository": "rollup/rollup",
|
|
49
|
+
"keywords": [
|
|
50
|
+
"modules",
|
|
51
|
+
"bundler",
|
|
52
|
+
"bundling",
|
|
53
|
+
"es6",
|
|
54
|
+
"optimizer"
|
|
55
|
+
],
|
|
56
|
+
"author": "Rich Harris",
|
|
57
|
+
"license": "MIT",
|
|
58
|
+
"bugs": {
|
|
59
|
+
"url": "https://github.com/rollup/rollup/issues"
|
|
60
|
+
},
|
|
61
|
+
"homepage": "https://rollupjs.org/",
|
|
62
|
+
"optionalDependencies": {
|
|
63
|
+
"fsevents": "~2.3.2"
|
|
64
|
+
},
|
|
65
|
+
"devDependenciesComments": {
|
|
66
|
+
"@rollup/plugin-typescript": "It appears that 11.1.3 breaks sourcemaps"
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"@codemirror/commands": "^6.2.5",
|
|
70
|
+
"@codemirror/lang-javascript": "^6.2.1",
|
|
71
|
+
"@codemirror/language": "^6.9.0",
|
|
72
|
+
"@codemirror/search": "^6.5.3",
|
|
73
|
+
"@codemirror/state": "^6.2.1",
|
|
74
|
+
"@codemirror/view": "^6.19.0",
|
|
75
|
+
"@jridgewell/sourcemap-codec": "^1.4.15",
|
|
76
|
+
"@mermaid-js/mermaid-cli": "^10.4.0",
|
|
77
|
+
"@rollup/plugin-alias": "^5.0.0",
|
|
78
|
+
"@rollup/plugin-buble": "^1.0.2",
|
|
79
|
+
"@rollup/plugin-commonjs": "^25.0.4",
|
|
80
|
+
"@rollup/plugin-json": "^6.0.0",
|
|
81
|
+
"@rollup/plugin-node-resolve": "^15.2.1",
|
|
82
|
+
"@rollup/plugin-replace": "^5.0.2",
|
|
83
|
+
"@rollup/plugin-terser": "^0.4.3",
|
|
84
|
+
"@rollup/plugin-typescript": "11.1.2",
|
|
85
|
+
"@rollup/pluginutils": "^5.0.4",
|
|
86
|
+
"@types/estree": "1.0.1",
|
|
87
|
+
"@types/mocha": "^10.0.1",
|
|
88
|
+
"@types/node": "~14.18.61",
|
|
89
|
+
"@types/yargs-parser": "^21.0.0",
|
|
90
|
+
"@typescript-eslint/eslint-plugin": "^6.7.2",
|
|
91
|
+
"@typescript-eslint/parser": "^6.7.2",
|
|
92
|
+
"@vue/eslint-config-prettier": "^8.0.0",
|
|
93
|
+
"@vue/eslint-config-typescript": "^12.0.0",
|
|
94
|
+
"acorn": "^8.10.0",
|
|
95
|
+
"acorn-import-assertions": "^1.9.0",
|
|
96
|
+
"acorn-jsx": "^5.3.2",
|
|
97
|
+
"acorn-walk": "^8.2.0",
|
|
98
|
+
"buble": "^0.20.0",
|
|
99
|
+
"builtin-modules": "^3.3.0",
|
|
100
|
+
"chokidar": "^3.5.3",
|
|
101
|
+
"colorette": "^2.0.20",
|
|
102
|
+
"concurrently": "^8.2.1",
|
|
103
|
+
"core-js": "^3.32.2",
|
|
104
|
+
"date-time": "^4.0.0",
|
|
105
|
+
"es5-shim": "^4.6.7",
|
|
106
|
+
"es6-shim": "^0.35.8",
|
|
107
|
+
"eslint": "^8.49.0",
|
|
108
|
+
"eslint-config-prettier": "^9.0.0",
|
|
109
|
+
"eslint-plugin-import": "^2.28.1",
|
|
110
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
111
|
+
"eslint-plugin-unicorn": "^48.0.1",
|
|
112
|
+
"eslint-plugin-vue": "^9.17.0",
|
|
113
|
+
"fixturify": "^3.0.0",
|
|
114
|
+
"flru": "^1.0.2",
|
|
115
|
+
"fs-extra": "^11.1.1",
|
|
116
|
+
"github-api": "^3.4.0",
|
|
117
|
+
"hash.js": "^1.1.7",
|
|
118
|
+
"husky": "^8.0.3",
|
|
119
|
+
"inquirer": "^9.2.11",
|
|
120
|
+
"is-reference": "^3.0.2",
|
|
121
|
+
"lint-staged": "^14.0.1",
|
|
122
|
+
"locate-character": "^3.0.0",
|
|
123
|
+
"magic-string": "^0.30.3",
|
|
124
|
+
"mocha": "^10.2.0",
|
|
125
|
+
"nyc": "^15.1.0",
|
|
126
|
+
"pinia": "^2.1.6",
|
|
127
|
+
"prettier": "^3.0.3",
|
|
128
|
+
"pretty-bytes": "^6.1.1",
|
|
129
|
+
"pretty-ms": "^8.0.0",
|
|
130
|
+
"requirejs": "^2.3.6",
|
|
131
|
+
"rollup": "^3.29.2",
|
|
132
|
+
"rollup-plugin-license": "^3.1.0",
|
|
133
|
+
"rollup-plugin-string": "^3.0.0",
|
|
134
|
+
"rollup-plugin-thatworks": "^1.0.4",
|
|
135
|
+
"semver": "^7.5.4",
|
|
136
|
+
"shx": "^0.3.4",
|
|
137
|
+
"signal-exit": "^4.1.0",
|
|
138
|
+
"source-map": "^0.7.4",
|
|
139
|
+
"source-map-support": "^0.5.21",
|
|
140
|
+
"systemjs": "^6.14.2",
|
|
141
|
+
"terser": "^5.19.4",
|
|
142
|
+
"tslib": "^2.6.2",
|
|
143
|
+
"typescript": "^5.2.2",
|
|
144
|
+
"vite": "^4.4.9",
|
|
145
|
+
"vitepress": "^1.0.0-rc.14",
|
|
146
|
+
"vue": "^3.3.4",
|
|
147
|
+
"weak-napi": "^2.0.2",
|
|
148
|
+
"yargs-parser": "^21.1.1"
|
|
149
|
+
},
|
|
150
|
+
"overrides": {
|
|
151
|
+
"semver": "^7.5.4"
|
|
152
|
+
},
|
|
153
|
+
"files": [
|
|
154
|
+
"dist/**/*.js",
|
|
155
|
+
"dist/*.d.ts",
|
|
156
|
+
"dist/bin/rollup",
|
|
157
|
+
"dist/es/package.json"
|
|
158
|
+
],
|
|
159
|
+
"engines": {
|
|
160
|
+
"node": ">=14.18.0",
|
|
161
|
+
"npm": ">=8.0.0"
|
|
162
|
+
},
|
|
163
|
+
"exports": {
|
|
164
|
+
".": {
|
|
165
|
+
"types": "./dist/rollup.d.ts",
|
|
166
|
+
"require": "./dist/rollup.js",
|
|
167
|
+
"import": "./dist/es/rollup.js"
|
|
168
|
+
},
|
|
169
|
+
"./loadConfigFile": {
|
|
170
|
+
"types": "./dist/loadConfigFile.d.ts",
|
|
171
|
+
"require": "./dist/loadConfigFile.js",
|
|
172
|
+
"default": "./dist/loadConfigFile.js"
|
|
173
|
+
},
|
|
174
|
+
"./getLogFilter": {
|
|
175
|
+
"types": "./dist/getLogFilter.d.ts",
|
|
176
|
+
"require": "./dist/getLogFilter.js",
|
|
177
|
+
"import": "./dist/es/getLogFilter.js"
|
|
178
|
+
},
|
|
179
|
+
"./dist/*": "./dist/*"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
Copyright (c) 2009-2011, Mozilla Foundation and contributors
|
|
3
|
+
All rights reserved.
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
* Neither the names of the Mozilla Foundation nor the names of project
|
|
16
|
+
contributors may be used to endorse or promote products derived from this
|
|
17
|
+
software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
20
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
21
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|