Ajout de promotion et de commande

This commit is contained in:
Aubert Marvin
2026-04-25 15:28:39 +02:00
parent eddb103755
commit faa3d7718c
8428 changed files with 1126442 additions and 6 deletions
+679
View File
File diff suppressed because it is too large Load Diff
+134
View File
File diff suppressed because one or more lines are too long
+1912
View File
File diff suppressed because one or more lines are too long
+64
View File
@@ -0,0 +1,64 @@
/*
@license
Rollup.js v4.60.0
Sun, 22 Mar 2026 06:57:22 GMT - commit 6ecd69fb2ce736c8aabb50829edd227d1792c957
https://github.com/rollup/rollup
Released under the MIT License.
*/
const getLogFilter = filters => {
if (filters.length === 0)
return () => true;
const normalizedFilters = filters.map(filter => filter.split('&').map(subFilter => {
const inverted = subFilter[0] === '!';
if (inverted)
subFilter = subFilter.slice(1);
const [key, ...value] = subFilter.split(':');
return { inverted, key: key.split('.'), parts: value.join(':').split('*') };
}));
return (log) => {
nextIntersectedFilter: for (const intersectedFilters of normalizedFilters) {
for (const { inverted, key, parts } of intersectedFilters) {
const isFilterSatisfied = testFilter(log, key, parts);
if (inverted ? isFilterSatisfied : !isFilterSatisfied) {
continue nextIntersectedFilter;
}
}
return true;
}
return false;
};
};
const testFilter = (log, key, parts) => {
let rawValue = log;
for (let index = 0; index < key.length; index++) {
if (!rawValue) {
return false;
}
const part = key[index];
if (!(part in rawValue)) {
return false;
}
rawValue = rawValue[part];
}
let value = typeof rawValue === 'object' ? JSON.stringify(rawValue) : String(rawValue);
if (parts.length === 1) {
return value === parts[0];
}
if (!value.startsWith(parts[0])) {
return false;
}
const lastPartIndex = parts.length - 1;
for (let index = 1; index < lastPartIndex; index++) {
const part = parts[index];
const position = value.indexOf(part);
if (position === -1) {
return false;
}
value = value.slice(position + part.length);
}
return value.endsWith(parts[lastPartIndex]);
};
export { getLogFilter };
+1
View File
@@ -0,0 +1 @@
{"type":"module"}
+12
View File
@@ -0,0 +1,12 @@
/*
@license
Rollup.js v4.60.0
Sun, 22 Mar 2026 06:57:22 GMT - commit 6ecd69fb2ce736c8aabb50829edd227d1792c957
https://github.com/rollup/rollup
Released under the MIT License.
*/
import '../native.js';
export { parseAst, parseAstAsync } from './shared/parseAst.js';
import 'node:path';
+17
View File
@@ -0,0 +1,17 @@
/*
@license
Rollup.js v4.60.0
Sun, 22 Mar 2026 06:57:22 GMT - commit 6ecd69fb2ce736c8aabb50829edd227d1792c957
https://github.com/rollup/rollup
Released under the MIT License.
*/
export { version as VERSION, defineConfig, rollup, watch } from './shared/node-entry.js';
import './shared/parseAst.js';
import '../native.js';
import 'node:path';
import 'path';
import 'node:process';
import 'node:perf_hooks';
import 'node:fs/promises';
+24122
View File
File diff suppressed because one or more lines are too long
+2124
View File
File diff suppressed because one or more lines are too long
+9297
View File
File diff suppressed because it is too large Load Diff
+5
View File
@@ -0,0 +1,5 @@
import type { RollupLog } from './rollup';
export type GetLogFilter = typeof getLogFilter;
export function getLogFilter(filters: string[]): (log: RollupLog) => boolean;
+69
View File
@@ -0,0 +1,69 @@
/*
@license
Rollup.js v4.60.0
Sun, 22 Mar 2026 06:57:22 GMT - commit 6ecd69fb2ce736c8aabb50829edd227d1792c957
https://github.com/rollup/rollup
Released under the MIT License.
*/
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const getLogFilter = filters => {
if (filters.length === 0)
return () => true;
const normalizedFilters = filters.map(filter => filter.split('&').map(subFilter => {
const inverted = subFilter[0] === '!';
if (inverted)
subFilter = subFilter.slice(1);
const [key, ...value] = subFilter.split(':');
return { inverted, key: key.split('.'), parts: value.join(':').split('*') };
}));
return (log) => {
nextIntersectedFilter: for (const intersectedFilters of normalizedFilters) {
for (const { inverted, key, parts } of intersectedFilters) {
const isFilterSatisfied = testFilter(log, key, parts);
if (inverted ? isFilterSatisfied : !isFilterSatisfied) {
continue nextIntersectedFilter;
}
}
return true;
}
return false;
};
};
const testFilter = (log, key, parts) => {
let rawValue = log;
for (let index = 0; index < key.length; index++) {
if (!rawValue) {
return false;
}
const part = key[index];
if (!(part in rawValue)) {
return false;
}
rawValue = rawValue[part];
}
let value = typeof rawValue === 'object' ? JSON.stringify(rawValue) : String(rawValue);
if (parts.length === 1) {
return value === parts[0];
}
if (!value.startsWith(parts[0])) {
return false;
}
const lastPartIndex = parts.length - 1;
for (let index = 1; index < lastPartIndex; index++) {
const part = parts[index];
const position = value.indexOf(part);
if (position === -1) {
return false;
}
value = value.slice(position + part.length);
}
return value.endsWith(parts[lastPartIndex]);
};
exports.getLogFilter = getLogFilter;
//# sourceMappingURL=getLogFilter.js.map
+20
View File
@@ -0,0 +1,20 @@
import type { LogHandler, MergedRollupOptions, RollupLog } from './rollup';
export interface BatchWarnings {
add: (warning: RollupLog) => void;
readonly count: number;
flush: () => void;
log: LogHandler;
readonly warningOccurred: boolean;
}
export type LoadConfigFile = typeof loadConfigFile;
export function loadConfigFile(
fileName: string,
commandOptions: any,
watchMode?: boolean
): Promise<{
options: MergedRollupOptions[];
warnings: BatchWarnings;
}>;
+29
View File
@@ -0,0 +1,29 @@
/*
@license
Rollup.js v4.60.0
Sun, 22 Mar 2026 06:57:22 GMT - commit 6ecd69fb2ce736c8aabb50829edd227d1792c957
https://github.com/rollup/rollup
Released under the MIT License.
*/
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
require('node:fs/promises');
require('node:path');
require('node:process');
require('node:url');
require('./shared/rollup.js');
require('./shared/parseAst.js');
const loadConfigFile_js = require('./shared/loadConfigFile.js');
require('path');
require('./native.js');
require('node:perf_hooks');
require('./getLogFilter.js');
exports.loadConfigFile = loadConfigFile_js.loadConfigFile;
//# sourceMappingURL=loadConfigFile.js.map
+161
View File
@@ -0,0 +1,161 @@
const { existsSync } = require('node:fs');
const path = require('node:path');
const { platform, arch, report } = require('node:process');
const { spawnSync } = require('node:child_process');
const getReportHeader = () => {
try {
if (platform !== 'win32') {
return report.getReport().header;
}
// This is needed because report.getReport() crashes the process on Windows sometimes.
const script =
"console.log(JSON.stringify(require('node:process').report.getReport().header));";
const child = spawnSync(process.execPath, ['-p', script], {
encoding: 'utf8',
timeout: 3000,
windowsHide: true
});
if (child.status !== 0) {
return null;
}
// The output from node -p might include a trailing 'undefined' and newline
const stdout = child.stdout?.replace(/undefined\r?\n?$/, '').trim();
if (!stdout) {
return null;
}
return JSON.parse(stdout);
} catch {
return null;
}
};
let reportHeader;
const isMingw32 = () => {
reportHeader ??= getReportHeader();
return reportHeader?.osName?.startsWith('MINGW32_NT') ?? false;
};
const isMusl = () => {
reportHeader ??= getReportHeader();
return reportHeader ? !reportHeader.glibcVersionRuntime : false;
};
const bindingsByPlatformAndArch = {
android: {
arm: { base: 'android-arm-eabi' },
arm64: { base: 'android-arm64' }
},
darwin: {
arm64: { base: 'darwin-arm64' },
x64: { base: 'darwin-x64' }
},
freebsd: {
arm64: { base: 'freebsd-arm64' },
x64: { base: 'freebsd-x64' }
},
linux: {
arm: { base: 'linux-arm-gnueabihf', musl: 'linux-arm-musleabihf' },
arm64: { base: 'linux-arm64-gnu', musl: 'linux-arm64-musl' },
loong64: { base: 'linux-loong64-gnu', musl: 'linux-loong64-musl' },
ppc64: { base: 'linux-ppc64-gnu', musl: 'linux-ppc64-musl' },
riscv64: { base: 'linux-riscv64-gnu', musl: 'linux-riscv64-musl' },
s390x: { base: 'linux-s390x-gnu', musl: null },
x64: { base: 'linux-x64-gnu', musl: 'linux-x64-musl' }
},
openbsd: {
x64: { base: 'openbsd-x64' }
},
openharmony: {
arm64: { base: 'openharmony-arm64' }
},
win32: {
arm64: { base: 'win32-arm64-msvc' },
ia32: { base: 'win32-ia32-msvc' },
x64: {
base: isMingw32() ? 'win32-x64-gnu' : 'win32-x64-msvc'
}
}
};
const msvcLinkFilenameByArch = {
arm64: 'vc_redist.arm64.exe',
ia32: 'vc_redist.x86.exe',
x64: 'vc_redist.x64.exe'
};
const packageBase = getPackageBase();
const localName = `./rollup.${packageBase}.node`;
const requireWithFriendlyError = id => {
try {
return require(id);
} catch (error) {
if (
platform === 'win32' &&
error instanceof Error &&
error.code === 'ERR_DLOPEN_FAILED' &&
error.message.includes('The specified module could not be found')
) {
const msvcDownloadLink = `https://aka.ms/vs/17/release/${msvcLinkFilenameByArch[arch]}`;
throw new Error(
`Failed to load module ${id}. ` +
'Required DLL was not found. ' +
'This error usually happens when Microsoft Visual C++ Redistributable is not installed. ' +
`You can download it from ${msvcDownloadLink}`,
{ cause: error }
);
}
throw new Error(
`Cannot find module ${id}. ` +
`npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
{ cause: error }
);
}
};
const { parse, parseAsync, xxhashBase64Url, xxhashBase36, xxhashBase16 } = requireWithFriendlyError(
existsSync(path.join(__dirname, localName)) ? localName : `@rollup/rollup-${packageBase}`
);
function getPackageBase() {
const imported = bindingsByPlatformAndArch[platform]?.[arch];
if (!imported) {
throwUnsupportedError(false);
}
if ('musl' in imported && isMusl()) {
return imported.musl || throwUnsupportedError(true);
}
return imported.base;
}
function throwUnsupportedError(isMusl) {
throw new Error(
`Your current platform "${platform}${isMusl ? ' (musl)' : ''}" and architecture "${arch}" combination is not yet supported by the native Rollup build. Please use the WASM build "@rollup/wasm-node" instead.
The following platform-architecture combinations are supported:
${Object.entries(bindingsByPlatformAndArch)
.flatMap(([platformName, architectures]) =>
Object.entries(architectures).flatMap(([architectureName, { musl }]) => {
const name = `${platformName}-${architectureName}`;
return musl ? [name, `${name} (musl)`] : [name];
})
)
.join('\n')}
If this is important to you, please consider supporting Rollup to make a native build for your platform and architecture available.`
);
}
module.exports.parse = parse;
module.exports.parseAsync = parseAsync;
module.exports.xxhashBase64Url = xxhashBase64Url;
module.exports.xxhashBase36 = xxhashBase36;
module.exports.xxhashBase16 = xxhashBase16;
+4
View File
@@ -0,0 +1,4 @@
import type { ParseAst, ParseAstAsync } from './rollup';
export const parseAst: ParseAst;
export const parseAstAsync: ParseAstAsync;
+22
View File
@@ -0,0 +1,22 @@
/*
@license
Rollup.js v4.60.0
Sun, 22 Mar 2026 06:57:22 GMT - commit 6ecd69fb2ce736c8aabb50829edd227d1792c957
https://github.com/rollup/rollup
Released under the MIT License.
*/
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
require('./native.js');
const parseAst_js = require('./shared/parseAst.js');
require('node:path');
exports.parseAst = parseAst_js.parseAst;
exports.parseAstAsync = parseAst_js.parseAstAsync;
//# sourceMappingURL=parseAst.js.map
+1225
View File
File diff suppressed because it is too large Load Diff
+127
View File
@@ -0,0 +1,127 @@
/*
@license
Rollup.js v4.60.0
Sun, 22 Mar 2026 06:57:22 GMT - commit 6ecd69fb2ce736c8aabb50829edd227d1792c957
https://github.com/rollup/rollup
Released under the MIT License.
*/
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const rollup = require('./shared/rollup.js');
const parseAst_js = require('./shared/parseAst.js');
const fseventsImporter = require('./shared/fsevents-importer.js');
require('node:process');
require('node:path');
require('path');
require('./native.js');
require('node:perf_hooks');
require('node:fs/promises');
class WatchEmitter {
constructor() {
this.currentHandlers = Object.create(null);
this.persistentHandlers = Object.create(null);
}
// Will be overwritten by Rollup
async close() { }
emit(event, ...parameters) {
return Promise.all([...this.getCurrentHandlers(event), ...this.getPersistentHandlers(event)].map(handler => handler(...parameters)));
}
off(event, listener) {
const listeners = this.persistentHandlers[event];
if (listeners) {
// A hack stolen from "mitt": ">>> 0" does not change numbers >= 0, but -1
// (which would remove the last array element if used unchanged) is turned
// into max_int, which is outside the array and does not change anything.
listeners.splice(listeners.indexOf(listener) >>> 0, 1);
}
return this;
}
on(event, listener) {
this.getPersistentHandlers(event).push(listener);
return this;
}
onCurrentRun(event, listener) {
this.getCurrentHandlers(event).push(listener);
return this;
}
once(event, listener) {
const selfRemovingListener = (...parameters) => {
this.off(event, selfRemovingListener);
return listener(...parameters);
};
this.on(event, selfRemovingListener);
return this;
}
removeAllListeners() {
this.removeListenersForCurrentRun();
this.persistentHandlers = Object.create(null);
return this;
}
removeListenersForCurrentRun() {
this.currentHandlers = Object.create(null);
return this;
}
getCurrentHandlers(event) {
return this.currentHandlers[event] || (this.currentHandlers[event] = []);
}
getPersistentHandlers(event) {
return this.persistentHandlers[event] || (this.persistentHandlers[event] = []);
}
}
function watch(configs) {
const emitter = new WatchEmitter();
watchInternal(configs, emitter).catch(error => {
rollup.handleError(error);
});
return emitter;
}
function ensureTrailingSlash(path) {
if (path[path.length - 1] !== '/') {
return `${path}/`;
}
return path;
}
function checkWatchConfig(config) {
for (const item of config) {
if (typeof item.watch !== 'boolean' && item.watch?.allowInputInsideOutputPath) {
break;
}
if (item.input && item.output) {
const input = typeof item.input === 'string' ? rollup.ensureArray(item.input) : item.input;
const outputs = rollup.ensureArray(item.output);
for (const index in input) {
const inputPath = input[index];
if (typeof inputPath !== 'string') {
continue;
}
const outputWithInputAsSubPath = outputs.find(({ dir }) => dir && ensureTrailingSlash(inputPath).startsWith(ensureTrailingSlash(dir)));
if (outputWithInputAsSubPath) {
parseAst_js.error(parseAst_js.logInvalidOption('watch', parseAst_js.URL_WATCH, `the input "${inputPath}" is a subpath of the output "${outputWithInputAsSubPath.dir}"`));
}
}
}
}
}
async function watchInternal(configs, emitter) {
const optionsList = await Promise.all(rollup.ensureArray(configs).map(config => rollup.mergeOptions(config, true)));
const watchOptionsList = optionsList.filter(config => config.watch !== false);
if (watchOptionsList.length === 0) {
return parseAst_js.error(parseAst_js.logInvalidOption('watch', parseAst_js.URL_WATCH, 'there must be at least one config where "watch" is not set to "false"'));
}
checkWatchConfig(watchOptionsList);
await fseventsImporter.loadFsEvents();
const { Watcher } = await Promise.resolve().then(() => require('./shared/watch.js'));
new Watcher(watchOptionsList, emitter);
}
exports.VERSION = rollup.version;
exports.defineConfig = rollup.defineConfig;
exports.rollup = rollup.rollup;
exports.watch = watch;
//# sourceMappingURL=rollup.js.map
+37
View File
@@ -0,0 +1,37 @@
/*
@license
Rollup.js v4.60.0
Sun, 22 Mar 2026 06:57:22 GMT - commit 6ecd69fb2ce736c8aabb50829edd227d1792c957
https://github.com/rollup/rollup
Released under the MIT License.
*/
'use strict';
let fsEvents;
let fsEventsImportError;
async function loadFsEvents() {
try {
({ default: fsEvents } = await import('fsevents'));
}
catch (error) {
fsEventsImportError = error;
}
}
// A call to this function will be injected into the chokidar code
function getFsEvents() {
if (fsEventsImportError)
throw fsEventsImportError;
return fsEvents;
}
const fseventsImporter = /*#__PURE__*/Object.defineProperty({
__proto__: null,
getFsEvents,
loadFsEvents
}, Symbol.toStringTag, { value: 'Module' });
exports.fseventsImporter = fseventsImporter;
exports.loadFsEvents = loadFsEvents;
//# sourceMappingURL=fsevents-importer.js.map
+9003
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+2361
View File
File diff suppressed because one or more lines are too long
+24044
View File
File diff suppressed because it is too large Load Diff
+542
View File
File diff suppressed because it is too large Load Diff
+324
View File
@@ -0,0 +1,324 @@
/*
@license
Rollup.js v4.60.0
Sun, 22 Mar 2026 06:57:22 GMT - commit 6ecd69fb2ce736c8aabb50829edd227d1792c957
https://github.com/rollup/rollup
Released under the MIT License.
*/
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const rollup = require('./rollup.js');
const path = require('node:path');
const process = require('node:process');
const index = require('./index.js');
const node_os = require('node:os');
require('./parseAst.js');
require('../native.js');
require('path');
require('node:perf_hooks');
require('node:fs/promises');
require('fs');
require('util');
require('stream');
require('os');
require('./fsevents-importer.js');
require('events');
class FileWatcher {
constructor(task, chokidarOptions) {
this.transformWatchers = new Map();
this.chokidarOptions = chokidarOptions;
this.task = task;
this.watcher = this.createWatcher(null);
}
close() {
this.watcher.close();
for (const watcher of this.transformWatchers.values()) {
watcher.close();
}
}
unwatch(id) {
this.watcher.unwatch(id);
const transformWatcher = this.transformWatchers.get(id);
if (transformWatcher) {
this.transformWatchers.delete(id);
transformWatcher.close();
}
}
watch(id, isTransformDependency) {
if (isTransformDependency) {
const watcher = this.transformWatchers.get(id) ?? this.createWatcher(id);
watcher.add(id);
this.transformWatchers.set(id, watcher);
}
else {
this.watcher.add(id);
}
}
createWatcher(transformWatcherId) {
const task = this.task;
const isLinux = node_os.platform() === 'linux';
const isFreeBSD = node_os.platform() === 'freebsd';
const isTransformDependency = transformWatcherId !== null;
const handleChange = (id, event) => {
const changedId = transformWatcherId || id;
if (isLinux || isFreeBSD) {
// unwatching and watching fixes an issue with chokidar where on certain systems,
// a file that was unlinked and immediately recreated would create a change event
// but then no longer any further events
watcher.unwatch(changedId);
watcher.add(changedId);
}
task.invalidate(changedId, { event, isTransformDependency });
};
const watcher = index.chokidar
.watch([], this.chokidarOptions)
.on('add', id => handleChange(id, 'create'))
.on('change', id => handleChange(id, 'update'))
.on('unlink', id => handleChange(id, 'delete'));
return watcher;
}
}
const eventsRewrites = {
create: {
create: 'buggy',
delete: null, //delete file from map
update: 'create'
},
delete: {
create: 'update',
delete: 'buggy',
update: 'buggy'
},
update: {
create: 'buggy',
delete: 'delete',
update: 'update'
}
};
class Watcher {
constructor(optionsList, emitter) {
this.buildDelay = 0;
this.buildTimeout = null;
this.closed = false;
this.invalidatedIds = new Map();
this.rerun = false;
this.running = true;
this.emitter = emitter;
emitter.close = this.close.bind(this);
this.tasks = optionsList.map(options => new Task(this, options));
for (const { watch } of optionsList) {
if (watch && typeof watch.buildDelay === 'number') {
this.buildDelay = Math.max(this.buildDelay, watch.buildDelay);
}
}
process.nextTick(() => this.run());
}
async close() {
if (this.closed)
return;
this.closed = true;
if (this.buildTimeout)
clearTimeout(this.buildTimeout);
for (const task of this.tasks) {
task.close();
}
await this.emitter.emit('close');
this.emitter.removeAllListeners();
}
invalidate(file) {
if (file) {
const previousEvent = this.invalidatedIds.get(file.id);
const event = previousEvent ? eventsRewrites[previousEvent][file.event] : file.event;
if (event === 'buggy') {
//TODO: throws or warn? Currently just ignore, uses new event
this.invalidatedIds.set(file.id, file.event);
}
else if (event === null) {
this.invalidatedIds.delete(file.id);
}
else {
this.invalidatedIds.set(file.id, event);
}
}
if (this.running) {
this.rerun = true;
return;
}
if (this.buildTimeout)
clearTimeout(this.buildTimeout);
this.buildTimeout = setTimeout(async () => {
this.buildTimeout = null;
try {
await Promise.all([...this.invalidatedIds].map(([id, event]) => this.emitter.emit('change', id, { event })));
this.invalidatedIds.clear();
await this.emitter.emit('restart');
this.emitter.removeListenersForCurrentRun();
this.run();
}
catch (error) {
this.invalidatedIds.clear();
await this.emitter.emit('event', {
code: 'ERROR',
error,
result: null
});
await this.emitter.emit('event', {
code: 'END'
});
}
}, this.buildDelay);
}
async run() {
this.running = true;
await this.emitter.emit('event', {
code: 'START'
});
for (const task of this.tasks) {
await task.run();
}
this.running = false;
await this.emitter.emit('event', {
code: 'END'
});
if (this.rerun) {
this.rerun = false;
this.invalidate();
}
}
}
class Task {
constructor(watcher, options) {
this.cache = { modules: [] };
this.watchFiles = [];
this.closed = false;
this.invalidated = true;
this.watched = new Set();
this.watcher = watcher;
this.options = options;
this.skipWrite = Boolean(options.watch && options.watch.skipWrite);
this.outputs = this.options.output;
this.outputFiles = this.outputs.map(output => {
if (output.file || output.dir)
return path.resolve(output.file || output.dir);
return undefined;
});
this.watchOptions = this.options.watch || {};
this.filter = rollup.createFilter(this.watchOptions.include, this.watchOptions.exclude);
this.fileWatcher = new FileWatcher(this, {
...this.watchOptions.chokidar,
disableGlobbing: true,
ignoreInitial: true
});
}
close() {
this.closed = true;
this.fileWatcher.close();
}
invalidate(id, details) {
this.invalidated = true;
if (details.isTransformDependency) {
for (const module of this.cache.modules) {
if (!module.transformDependencies.includes(id))
continue;
// effective invalidation
module.originalCode = null;
}
}
this.watcher.invalidate({ event: details.event, id });
this.watchOptions.onInvalidate?.(id);
}
async run() {
if (!this.invalidated)
return;
this.invalidated = false;
const options = {
...this.options,
cache: this.cache
};
const start = Date.now();
await this.watcher.emitter.emit('event', {
code: 'BUNDLE_START',
input: this.options.input,
output: this.outputFiles
});
let result = null;
try {
result = await rollup.rollupInternal(options, this.watcher.emitter);
if (this.closed) {
return;
}
this.updateWatchedFiles(result);
if (!this.skipWrite) {
await Promise.all(this.outputs.map(output => result.write(output)));
if (this.closed) {
return;
}
this.updateWatchedFiles(result);
}
await this.watcher.emitter.emit('event', {
code: 'BUNDLE_END',
duration: Date.now() - start,
input: this.options.input,
output: this.outputFiles,
result
});
}
catch (error) {
if (!this.closed) {
if (Array.isArray(error.watchFiles)) {
for (const id of error.watchFiles) {
this.watchFile(id);
}
}
if (error.id) {
this.cache.modules = this.cache.modules.filter(module => module.id !== error.id);
}
}
await this.watcher.emitter.emit('event', {
code: 'ERROR',
error,
result
});
}
}
updateWatchedFiles(result) {
const previouslyWatched = this.watched;
this.watched = new Set();
this.watchFiles = result.watchFiles;
this.cache = result.cache;
for (const id of this.watchFiles) {
this.watchFile(id);
}
for (const module of this.cache.modules) {
for (const depId of module.transformDependencies) {
this.watchFile(depId, true);
}
}
for (const id of previouslyWatched) {
if (!this.watched.has(id)) {
this.fileWatcher.unwatch(id);
}
}
}
watchFile(id, isTransformDependency = false) {
if (!this.filter(id))
return;
this.watched.add(id);
if (this.outputFiles.includes(id)) {
throw new Error('Cannot import the generated bundle');
}
// this is necessary to ensure that any 'renamed' files
// continue to be watched following an error
this.fileWatcher.watch(id, isTransformDependency);
}
}
exports.Task = Task;
exports.Watcher = Watcher;
//# sourceMappingURL=watch.js.map
+289
View File
@@ -0,0 +1,289 @@
{
"name": "rollup",
"version": "4.60.0",
"description": "Next-generation ES module bundler",
"main": "dist/rollup.js",
"module": "dist/es/rollup.js",
"types": "dist/rollup.d.ts",
"bin": {
"rollup": "dist/bin/rollup"
},
"napi": {
"binaryName": "rollup",
"packageName": "@rollup/rollup",
"targets": [
"aarch64-apple-darwin",
"aarch64-linux-android",
"aarch64-pc-windows-msvc",
"aarch64-unknown-freebsd",
"aarch64-unknown-linux-gnu",
"aarch64-unknown-linux-musl",
"armv7-linux-androideabi",
"armv7-unknown-linux-gnueabihf",
"armv7-unknown-linux-musleabihf",
"i686-pc-windows-msvc",
"loongarch64-unknown-linux-gnu",
"loongarch64-unknown-linux-musl",
"riscv64gc-unknown-linux-gnu",
"riscv64gc-unknown-linux-musl",
"powerpc64le-unknown-linux-gnu",
"powerpc64le-unknown-linux-musl",
"s390x-unknown-linux-gnu",
"x86_64-apple-darwin",
"x86_64-pc-windows-gnu",
"x86_64-pc-windows-msvc",
"x86_64-unknown-freebsd",
"x86_64-unknown-linux-gnu",
"x86_64-unknown-linux-musl",
"x86_64-unknown-openbsd",
"aarch64-unknown-linux-ohos"
]
},
"scripts": {
"build": "concurrently -c green,blue \"npm run build:wasm\" \"npm:build:ast-converters\" && concurrently -c green,blue \"npm run build:napi -- --release\" \"npm:build:js\" && npm run build:copy-native",
"build:quick": "concurrently -c green,blue 'npm:build:napi' 'npm:build:cjs' && npm run build:copy-native",
"build:napi": "napi build --cwd rust/bindings_napi --platform --dts ../../native.d.ts --no-js --output-dir ../.. --package-json-path ../../package.json",
"build:wasm": "wasm-pack build rust/bindings_wasm --out-dir ../../wasm --target web --no-pack && shx rm wasm/.gitignore",
"build:wasm:node": "wasm-pack build rust/bindings_wasm --out-dir ../../wasm-node --target nodejs --no-pack && shx rm wasm-node/.gitignore",
"update:napi": "npm run build:napi && npm run build:copy-native",
"build:js": "rollup --config rollup.config.ts --configPlugin typescript --forceExit",
"build:js:node": "rollup --config rollup.config.ts --configPlugin typescript --configIsBuildNode --forceExit",
"build:prepare": "concurrently -c green,blue \"npm run build:napi -- --release\" \"npm:build:js:node\" && npm run build:copy-native",
"update:js": "npm run build:js && npm run build:copy-native",
"build:copy-native": "shx mkdir -p dist && shx cp rollup.*.node dist/",
"dev": "concurrently -kc green,blue 'nodemon --watch rust -e rs --exec \"npm run build:wasm\"' 'vitepress dev docs'",
"build:cjs": "rollup --config rollup.config.ts --configPlugin typescript --configTest --forceExit",
"build:bootstrap": "shx mv dist dist-build && node dist-build/bin/rollup --config rollup.config.ts --configPlugin typescript --forceExit && shx rm -rf dist-build",
"build:bootstrap:cjs": "shx mv dist dist-build && node dist-build/bin/rollup --config rollup.config.ts --configPlugin typescript --configTest --forceExit && shx rm -rf dist-build",
"build:docs": "vitepress build docs",
"build:ast-converters": "node scripts/generate-ast-converters.js",
"preview:docs": "vitepress preview docs",
"ci:artifacts": "napi artifacts",
"ci:lint": "concurrently -c red,yellow,green,blue 'npm:lint:js:nofix' 'npm:lint:native-js' 'npm:lint:markdown:nofix' 'npm:lint:rust:nofix'",
"ci:test:all": "concurrently --kill-others-on-fail -c green,blue,magenta,cyan 'npm:test:only' 'npm:test:typescript' 'npm:test:leak' 'npm:test:browser'",
"ci:coverage": "NODE_OPTIONS=--no-experimental-require-module nyc --reporter lcovonly mocha",
"lint": "concurrently -c red,yellow,green,blue 'npm:lint:js' 'npm:lint:native-js' 'npm:lint:markdown' 'npm:lint:rust'",
"lint:js": "eslint . --fix --cache --concurrency auto",
"lint:js:nofix": "eslint . --cache --concurrency auto",
"lint:native-js": "node scripts/lint-native-js.js",
"lint:markdown": "prettier --write \"**/*.md\"",
"lint:markdown:nofix": "prettier --check \"**/*.md\"",
"lint:rust": "cd rust && cargo fmt && cargo clippy --fix --allow-dirty",
"lint:rust:nofix": "cd rust && cargo fmt --check && cargo clippy",
"perf": "npm run build:bootstrap:cjs && node --expose-gc scripts/perf-report/index.js",
"prepare": "husky && npm run prepare:patch && node scripts/check-release.js || npm run build:prepare",
"prepare:patch": "patch-package",
"prepublishOnly": "node scripts/check-release.js && node scripts/prepublish.js",
"postpublish": "node scripts/postpublish.js",
"prepublish:napi": "napi prepublish --no-gh-release",
"release": "node scripts/prepare-release.js",
"release:docs": "git fetch --update-head-ok origin master:master && git branch --force documentation-published master && git push origin documentation-published",
"check-audit": "check-audit",
"resolve-audit": "resolve-audit",
"test": "npm run build && npm run test:all",
"test:update-snapshots": "node scripts/update-snapshots.js",
"test:cjs": "npm run build:cjs && npm run test:only",
"test:quick": "mocha -b test/test.js",
"test:all": "concurrently --kill-others-on-fail -c green,blue,magenta,cyan,red 'npm:test:only' 'npm:test:browser' 'npm:test:typescript' 'npm:test:package' 'npm:test:options'",
"test:coverage": "npm run build:cjs && shx rm -rf coverage/* && nyc --reporter html mocha test/test.js",
"test:coverage:browser": "npm run build && shx rm -rf coverage/* && nyc mocha test/browser/index.js",
"test:leak": "npm install --no-save weak-napi && node --expose-gc test/leak/index.js",
"test:package": "node scripts/test-package.js",
"test:options": "node scripts/test-options.js",
"test:only": "mocha test/test.js",
"test:typescript": "shx rm -rf test/typescript/dist && shx cp -r dist test/typescript/ && tsc --noEmit -p test/typescript && tsc --noEmit -p . && tsc --noEmit -p scripts && vue-tsc --noEmit -p docs",
"test:browser": "mocha test/browser/index.js",
"watch": "rollup --config rollup.config.ts --configPlugin typescript --watch"
},
"repository": {
"type": "git",
"url": "git+https://github.com/rollup/rollup.git"
},
"keywords": [
"modules",
"bundler",
"bundling",
"es6",
"optimizer"
],
"author": "Rich Harris",
"license": "MIT",
"bugs": {
"url": "https://github.com/rollup/rollup/issues"
},
"homepage": "https://rollupjs.org/",
"optionalDependencies": {
"fsevents": "~2.3.2",
"@rollup/rollup-darwin-arm64": "4.60.0",
"@rollup/rollup-android-arm64": "4.60.0",
"@rollup/rollup-win32-arm64-msvc": "4.60.0",
"@rollup/rollup-freebsd-arm64": "4.60.0",
"@rollup/rollup-linux-arm64-gnu": "4.60.0",
"@rollup/rollup-linux-arm64-musl": "4.60.0",
"@rollup/rollup-android-arm-eabi": "4.60.0",
"@rollup/rollup-linux-arm-gnueabihf": "4.60.0",
"@rollup/rollup-linux-arm-musleabihf": "4.60.0",
"@rollup/rollup-win32-ia32-msvc": "4.60.0",
"@rollup/rollup-linux-loong64-gnu": "4.60.0",
"@rollup/rollup-linux-loong64-musl": "4.60.0",
"@rollup/rollup-linux-riscv64-gnu": "4.60.0",
"@rollup/rollup-linux-riscv64-musl": "4.60.0",
"@rollup/rollup-linux-ppc64-gnu": "4.60.0",
"@rollup/rollup-linux-ppc64-musl": "4.60.0",
"@rollup/rollup-linux-s390x-gnu": "4.60.0",
"@rollup/rollup-darwin-x64": "4.60.0",
"@rollup/rollup-win32-x64-gnu": "4.60.0",
"@rollup/rollup-win32-x64-msvc": "4.60.0",
"@rollup/rollup-freebsd-x64": "4.60.0",
"@rollup/rollup-linux-x64-gnu": "4.60.0",
"@rollup/rollup-linux-x64-musl": "4.60.0",
"@rollup/rollup-openbsd-x64": "4.60.0",
"@rollup/rollup-openharmony-arm64": "4.60.0"
},
"dependencies": {
"@types/estree": "1.0.8"
},
"devDependenciesComments": {
"core-js": "We only update manually as every update requires a snapshot update"
},
"devDependencies": {
"@codemirror/commands": "^6.10.3",
"@codemirror/lang-javascript": "^6.2.5",
"@codemirror/language": "^6.12.2",
"@codemirror/search": "^6.6.0",
"@codemirror/state": "^6.6.0",
"@codemirror/view": "^6.40.0",
"@eslint/js": "^10.0.1",
"@inquirer/prompts": "^7.10.1",
"@jridgewell/sourcemap-codec": "^1.5.5",
"@mermaid-js/mermaid-cli": "^11.12.0",
"@napi-rs/cli": "3.4.1",
"@rollup/plugin-alias": "^6.0.0",
"@rollup/plugin-buble": "^1.0.3",
"@rollup/plugin-commonjs": "^29.0.2",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^16.0.3",
"@rollup/plugin-replace": "^6.0.3",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.3.0",
"@rollup/pluginutils": "^5.3.0",
"@shikijs/vitepress-twoslash": "^4.0.2",
"@types/mocha": "^10.0.10",
"@types/node": "^20.19.37",
"@types/picomatch": "^4.0.2",
"@types/semver": "^7.7.1",
"@types/yargs-parser": "^21.0.3",
"@vue/language-server": "^3.2.5",
"acorn": "^8.16.0",
"acorn-import-assertions": "^1.9.0",
"acorn-import-phases": "^1.0.4",
"acorn-jsx": "^5.3.2",
"buble": "^0.20.0",
"builtin-modules": "^5.0.0",
"chokidar": "^3.6.0",
"concurrently": "^9.2.1",
"core-js": "3.38.1",
"cross-env": "^10.1.0",
"date-time": "^4.0.0",
"es5-shim": "^4.6.7",
"es6-shim": "^0.35.8",
"eslint": "^10.1.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.5",
"eslint-plugin-unicorn": "^63.0.0",
"eslint-plugin-vue": "^10.8.0",
"fixturify": "^3.0.0",
"flru": "^1.0.2",
"fs-extra": "^11.3.4",
"github-api": "^3.4.0",
"globals": "^17.4.0",
"husky": "^9.1.7",
"is-reference": "^3.0.3",
"lint-staged": "^16.4.0",
"locate-character": "^3.0.0",
"magic-string": "^0.30.21",
"memfs": "^4.56.11",
"mocha": "11.7.5",
"nodemon": "^3.1.14",
"npm-audit-resolver": "^3.0.0-RC.0",
"nyc": "^18.0.0",
"patch-package": "^8.0.1",
"picocolors": "^1.1.1",
"picomatch": "^4.0.3",
"pinia": "^3.0.4",
"prettier": "^3.8.1",
"prettier-plugin-organize-imports": "^4.3.0",
"pretty-bytes": "^7.1.0",
"pretty-ms": "^9.3.0",
"requirejs": "^2.3.8",
"rollup": "^4.59.0",
"rollup-plugin-license": "^3.7.0",
"semver": "^7.7.4",
"shx": "^0.4.0",
"signal-exit": "^4.1.0",
"source-map": "^0.7.6",
"source-map-support": "^0.5.21",
"systemjs": "^6.15.1",
"terser": "^5.46.1",
"tslib": "^2.8.1",
"typescript": "^5.9.3",
"typescript-eslint": "^8.57.1",
"vite": "^7.3.1",
"vitepress": "^1.6.4",
"vue": "^3.5.30",
"vue-eslint-parser": "^10.4.0",
"vue-tsc": "^3.2.5",
"wasm-pack": "^0.14.0",
"yargs-parser": "^21.1.1"
},
"overrides": {
"axios": "^1.13.6",
"esbuild": ">0.24.2",
"lodash-es": ">4.17.22",
"path-scurry": {
"lru-cache": "^11.2.7"
},
"readable-stream": "npm:@built-in/readable-stream@1",
"semver": "^7.7.4",
"tar": ">7.5.6",
"vite": "$vite"
},
"comments": {
"vue-tsc": "This is necessary so that prettier-plugin-organize-imports works correctly in Vue templatges"
},
"files": [
"dist/*.node",
"dist/**/*.js",
"dist/*.d.ts",
"dist/bin/rollup",
"dist/es/package.json"
],
"engines": {
"node": ">=18.0.0",
"npm": ">=8.0.0"
},
"exports": {
".": {
"types": "./dist/rollup.d.ts",
"import": "./dist/es/rollup.js",
"require": "./dist/rollup.js"
},
"./loadConfigFile": {
"types": "./dist/loadConfigFile.d.ts",
"require": "./dist/loadConfigFile.js",
"default": "./dist/loadConfigFile.js"
},
"./getLogFilter": {
"types": "./dist/getLogFilter.d.ts",
"import": "./dist/es/getLogFilter.js",
"require": "./dist/getLogFilter.js"
},
"./parseAst": {
"types": "./dist/parseAst.d.ts",
"import": "./dist/es/parseAst.js",
"require": "./dist/parseAst.js"
},
"./dist/*": "./dist/*",
"./package.json": "./package.json"
}
}