mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-21 14:13:36 +08:00
chore:更换到主分支
This commit is contained in:
46
node_modules/rollup/dist/bin/rollup
generated
vendored
46
node_modules/rollup/dist/bin/rollup
generated
vendored
File diff suppressed because one or more lines are too long
6
node_modules/rollup/dist/es/rollup.browser.js
generated
vendored
6
node_modules/rollup/dist/es/rollup.browser.js
generated
vendored
File diff suppressed because one or more lines are too long
4
node_modules/rollup/dist/es/rollup.js
generated
vendored
4
node_modules/rollup/dist/es/rollup.js
generated
vendored
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
@license
|
||||
Rollup.js v2.33.1
|
||||
Mon, 02 Nov 2020 06:50:50 GMT - commit d861c91c068bc4e64d84db3b84232d3fb7f1d073
|
||||
Rollup.js v2.40.0
|
||||
Fri, 26 Feb 2021 14:39:44 GMT - commit 0a0958ff926554abe9916178f56762ba71301ddd
|
||||
|
||||
|
||||
https://github.com/rollup/rollup
|
||||
|
||||
2180
node_modules/rollup/dist/es/shared/rollup.js
generated
vendored
2180
node_modules/rollup/dist/es/shared/rollup.js
generated
vendored
File diff suppressed because it is too large
Load Diff
991
node_modules/rollup/dist/es/shared/watch.js
generated
vendored
991
node_modules/rollup/dist/es/shared/watch.js
generated
vendored
File diff suppressed because it is too large
Load Diff
10
node_modules/rollup/dist/loadConfigFile.js
generated
vendored
10
node_modules/rollup/dist/loadConfigFile.js
generated
vendored
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
@license
|
||||
Rollup.js v2.33.1
|
||||
Mon, 02 Nov 2020 06:50:50 GMT - commit d861c91c068bc4e64d84db3b84232d3fb7f1d073
|
||||
Rollup.js v2.40.0
|
||||
Fri, 26 Feb 2021 14:39:44 GMT - commit 0a0958ff926554abe9916178f56762ba71301ddd
|
||||
|
||||
|
||||
https://github.com/rollup/rollup
|
||||
@@ -10,14 +10,14 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
require('./shared/rollup.js');
|
||||
var loadConfigFile_js = require('./shared/loadConfigFile.js');
|
||||
require('fs');
|
||||
require('path');
|
||||
require('url');
|
||||
require('./shared/rollup.js');
|
||||
require('./shared/mergeOptions.js');
|
||||
var loadConfigFile_js = require('./shared/loadConfigFile.js');
|
||||
require('crypto');
|
||||
require('events');
|
||||
require('url');
|
||||
|
||||
|
||||
|
||||
|
||||
7
node_modules/rollup/dist/rollup.browser.js
generated
vendored
7
node_modules/rollup/dist/rollup.browser.js
generated
vendored
File diff suppressed because one or more lines are too long
66
node_modules/rollup/dist/rollup.d.ts
generated
vendored
66
node_modules/rollup/dist/rollup.d.ts
generated
vendored
@@ -320,8 +320,12 @@ export type ResolveFileUrlHook = (
|
||||
export type AddonHookFunction = (this: PluginContext) => string | Promise<string>;
|
||||
export type AddonHook = string | AddonHookFunction;
|
||||
|
||||
export type ChangeEvent = 'create' | 'update' | 'delete'
|
||||
export type WatchChangeHook = (this: PluginContext, id: string, change: {event: ChangeEvent}) => void
|
||||
export type ChangeEvent = 'create' | 'update' | 'delete';
|
||||
export type WatchChangeHook = (
|
||||
this: PluginContext,
|
||||
id: string,
|
||||
change: { event: ChangeEvent }
|
||||
) => void;
|
||||
|
||||
/**
|
||||
* use this type for plugin annotation
|
||||
@@ -350,6 +354,7 @@ export interface OutputBundleWithPlaceholders {
|
||||
export interface PluginHooks extends OutputPluginHooks {
|
||||
buildEnd: (this: PluginContext, err?: Error) => Promise<void> | void;
|
||||
buildStart: (this: PluginContext, options: NormalizedInputOptions) => Promise<void> | void;
|
||||
closeBundle: (this: PluginContext) => Promise<void> | void;
|
||||
closeWatcher: (this: PluginContext) => void;
|
||||
load: LoadHook;
|
||||
moduleParsed: ModuleParsedHook;
|
||||
@@ -412,7 +417,8 @@ export type AsyncPluginHooks =
|
||||
| 'resolveDynamicImport'
|
||||
| 'resolveId'
|
||||
| 'transform'
|
||||
| 'writeBundle';
|
||||
| 'writeBundle'
|
||||
| 'closeBundle';
|
||||
|
||||
export type PluginValueHooks = 'banner' | 'footer' | 'intro' | 'outro';
|
||||
|
||||
@@ -447,7 +453,8 @@ export type ParallelPluginHooks =
|
||||
| 'outro'
|
||||
| 'renderError'
|
||||
| 'renderStart'
|
||||
| 'writeBundle';
|
||||
| 'writeBundle'
|
||||
| 'closeBundle';
|
||||
|
||||
interface OutputPluginValueHooks {
|
||||
banner: AddonHook;
|
||||
@@ -572,11 +579,39 @@ export type InteropType = boolean | 'auto' | 'esModule' | 'default' | 'defaultOn
|
||||
|
||||
export type GetInterop = (id: string | null) => InteropType;
|
||||
|
||||
export type AmdOptions = (
|
||||
| {
|
||||
autoId?: false;
|
||||
id: string;
|
||||
}
|
||||
| {
|
||||
autoId: true;
|
||||
basePath?: string;
|
||||
id?: undefined;
|
||||
}
|
||||
| {
|
||||
autoId?: false;
|
||||
id?: undefined;
|
||||
}
|
||||
) & {
|
||||
define?: string;
|
||||
};
|
||||
|
||||
export type NormalizedAmdOptions = (
|
||||
| {
|
||||
autoId: false;
|
||||
id?: string;
|
||||
}
|
||||
| {
|
||||
autoId: true;
|
||||
basePath: string;
|
||||
}
|
||||
) & {
|
||||
define: string;
|
||||
};
|
||||
|
||||
export interface OutputOptions {
|
||||
amd?: {
|
||||
define?: string;
|
||||
id?: string;
|
||||
};
|
||||
amd?: AmdOptions;
|
||||
assetFileNames?: string | ((chunkInfo: PreRenderedAsset) => string);
|
||||
banner?: string | (() => string | Promise<string>);
|
||||
chunkFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
|
||||
@@ -618,13 +653,11 @@ export interface OutputOptions {
|
||||
sourcemapPathTransform?: SourcemapPathTransformOption;
|
||||
strict?: boolean;
|
||||
systemNullSetters?: boolean;
|
||||
validate?: boolean;
|
||||
}
|
||||
|
||||
export interface NormalizedOutputOptions {
|
||||
amd: {
|
||||
define: string;
|
||||
id?: string;
|
||||
};
|
||||
amd: NormalizedAmdOptions;
|
||||
assetFileNames: string | ((chunkInfo: PreRenderedAsset) => string);
|
||||
banner: () => string | Promise<string>;
|
||||
chunkFileNames: string | ((chunkInfo: PreRenderedChunk) => string);
|
||||
@@ -664,6 +697,7 @@ export interface NormalizedOutputOptions {
|
||||
sourcemapPathTransform: SourcemapPathTransformOption | undefined;
|
||||
strict: boolean;
|
||||
systemNullSetters: boolean;
|
||||
validate: boolean;
|
||||
}
|
||||
|
||||
export type WarningHandlerWithDefault = (
|
||||
@@ -740,6 +774,8 @@ export interface RollupOutput {
|
||||
|
||||
export interface RollupBuild {
|
||||
cache: RollupCache | undefined;
|
||||
close: () => Promise<void>;
|
||||
closed: boolean;
|
||||
generate: (outputOptions: OutputOptions) => Promise<RollupOutput>;
|
||||
getTimings?: () => SerializedTimings;
|
||||
watchFiles: string[];
|
||||
@@ -794,7 +830,7 @@ export interface RollupWatchOptions extends InputOptions {
|
||||
watch?: WatcherOptions | false;
|
||||
}
|
||||
|
||||
interface TypedEventEmitter<T extends {[event: string]: (...args: any) => any}> {
|
||||
interface TypedEventEmitter<T extends { [event: string]: (...args: any) => any }> {
|
||||
addListener<K extends keyof T>(event: K, listener: T[K]): this;
|
||||
emit<K extends keyof T>(event: K, ...args: Parameters<T[K]>): boolean;
|
||||
eventNames(): Array<keyof T>;
|
||||
@@ -823,11 +859,11 @@ export type RollupWatcherEvent =
|
||||
result: RollupBuild;
|
||||
}
|
||||
| { code: 'END' }
|
||||
| { code: 'ERROR'; error: RollupError };
|
||||
| { code: 'ERROR'; error: RollupError; result: RollupBuild | null };
|
||||
|
||||
export interface RollupWatcher
|
||||
extends TypedEventEmitter<{
|
||||
change: (id: string, change: {event: ChangeEvent}) => void;
|
||||
change: (id: string, change: { event: ChangeEvent }) => void;
|
||||
close: () => void;
|
||||
event: (event: RollupWatcherEvent) => void;
|
||||
restart: () => void;
|
||||
|
||||
6
node_modules/rollup/dist/rollup.js
generated
vendored
6
node_modules/rollup/dist/rollup.js
generated
vendored
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
@license
|
||||
Rollup.js v2.33.1
|
||||
Mon, 02 Nov 2020 06:50:50 GMT - commit d861c91c068bc4e64d84db3b84232d3fb7f1d073
|
||||
Rollup.js v2.40.0
|
||||
Fri, 26 Feb 2021 14:39:44 GMT - commit 0a0958ff926554abe9916178f56762ba71301ddd
|
||||
|
||||
|
||||
https://github.com/rollup/rollup
|
||||
@@ -13,9 +13,9 @@
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var rollup = require('./shared/rollup.js');
|
||||
require('fs');
|
||||
require('path');
|
||||
require('crypto');
|
||||
require('fs');
|
||||
require('events');
|
||||
|
||||
|
||||
|
||||
873
node_modules/rollup/dist/shared/index.js
generated
vendored
873
node_modules/rollup/dist/shared/index.js
generated
vendored
File diff suppressed because it is too large
Load Diff
20
node_modules/rollup/dist/shared/loadConfigFile.js
generated
vendored
20
node_modules/rollup/dist/shared/loadConfigFile.js
generated
vendored
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
@license
|
||||
Rollup.js v2.33.1
|
||||
Mon, 02 Nov 2020 06:50:50 GMT - commit d861c91c068bc4e64d84db3b84232d3fb7f1d073
|
||||
Rollup.js v2.40.0
|
||||
Fri, 26 Feb 2021 14:39:44 GMT - commit 0a0958ff926554abe9916178f56762ba71301ddd
|
||||
|
||||
|
||||
https://github.com/rollup/rollup
|
||||
@@ -10,11 +10,11 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var rollup = require('./rollup.js');
|
||||
var fs = require('fs');
|
||||
var sysPath = require('path');
|
||||
var mergeOptions = require('./mergeOptions.js');
|
||||
var path = require('path');
|
||||
var url = require('url');
|
||||
var rollup = require('./rollup.js');
|
||||
var mergeOptions = require('./mergeOptions.js');
|
||||
|
||||
let enabled =
|
||||
!("NO_COLOR" in process.env) &&
|
||||
@@ -116,7 +116,7 @@ function batchWarnings() {
|
||||
const id = (warning.loc && warning.loc.file) || warning.id;
|
||||
if (id) {
|
||||
const loc = warning.loc
|
||||
? `${rollup.relativeId(id)}: (${warning.loc.line}:${warning.loc.column})`
|
||||
? `${rollup.relativeId(id)} (${warning.loc.line}:${warning.loc.column})`
|
||||
: rollup.relativeId(id);
|
||||
stderr(bold(rollup.relativeId(loc)));
|
||||
}
|
||||
@@ -426,7 +426,7 @@ function loadAndRegisterPlugin(inputOptions, pluginText) {
|
||||
if (!plugin) {
|
||||
try {
|
||||
if (pluginText[0] == '.')
|
||||
pluginText = sysPath.resolve(pluginText);
|
||||
pluginText = path.resolve(pluginText);
|
||||
plugin = require(pluginText);
|
||||
}
|
||||
catch (ex) {
|
||||
@@ -475,7 +475,7 @@ async function loadAndParseConfigFile(fileName, commandOptions = {}) {
|
||||
}
|
||||
}
|
||||
async function loadConfigFile(fileName, commandOptions) {
|
||||
const extension = sysPath.extname(fileName);
|
||||
const extension = path.extname(fileName);
|
||||
const configFileExport = extension === '.mjs' && supportsNativeESM()
|
||||
? (await import(url.pathToFileURL(fileName).href)).default
|
||||
: extension === '.cjs'
|
||||
@@ -489,7 +489,7 @@ function getDefaultFromCjs(namespace) {
|
||||
async function getDefaultFromTranspiledConfigFile(fileName, silent) {
|
||||
const warnings = batchWarnings();
|
||||
const bundle = await rollup.rollup({
|
||||
external: (id) => (id[0] !== '.' && !sysPath.isAbsolute(id)) || id.slice(-5, id.length) === '.json',
|
||||
external: (id) => (id[0] !== '.' && !path.isAbsolute(id)) || id.slice(-5, id.length) === '.json',
|
||||
input: fileName,
|
||||
onwarn: warnings.add,
|
||||
treeshake: false
|
||||
@@ -506,7 +506,7 @@ async function getDefaultFromTranspiledConfigFile(fileName, silent) {
|
||||
}
|
||||
async function loadConfigFromBundledFile(fileName, bundledCode) {
|
||||
const resolvedFileName = fs.realpathSync(fileName);
|
||||
const extension = sysPath.extname(resolvedFileName);
|
||||
const extension = path.extname(resolvedFileName);
|
||||
const defaultLoader = require.extensions[extension];
|
||||
require.extensions[extension] = (module, requiredFileName) => {
|
||||
if (requiredFileName === resolvedFileName) {
|
||||
|
||||
7
node_modules/rollup/dist/shared/mergeOptions.js
generated
vendored
7
node_modules/rollup/dist/shared/mergeOptions.js
generated
vendored
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
@license
|
||||
Rollup.js v2.33.1
|
||||
Mon, 02 Nov 2020 06:50:50 GMT - commit d861c91c068bc4e64d84db3b84232d3fb7f1d073
|
||||
Rollup.js v2.40.0
|
||||
Fri, 26 Feb 2021 14:39:44 GMT - commit 0a0958ff926554abe9916178f56762ba71301ddd
|
||||
|
||||
|
||||
https://github.com/rollup/rollup
|
||||
@@ -159,7 +159,8 @@ function mergeOutputOptions(config, overrides, warn) {
|
||||
sourcemapFile: getOption('sourcemapFile'),
|
||||
sourcemapPathTransform: getOption('sourcemapPathTransform'),
|
||||
strict: getOption('strict'),
|
||||
systemNullSetters: getOption('systemNullSetters')
|
||||
systemNullSetters: getOption('systemNullSetters'),
|
||||
validate: getOption('validate')
|
||||
};
|
||||
rollup.warnUnknownOptions(config, Object.keys(outputOptions), 'output options', warn);
|
||||
return outputOptions;
|
||||
|
||||
2267
node_modules/rollup/dist/shared/rollup.js
generated
vendored
2267
node_modules/rollup/dist/shared/rollup.js
generated
vendored
File diff suppressed because it is too large
Load Diff
83
node_modules/rollup/dist/shared/watch-cli.js
generated
vendored
83
node_modules/rollup/dist/shared/watch-cli.js
generated
vendored
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
@license
|
||||
Rollup.js v2.33.1
|
||||
Mon, 02 Nov 2020 06:50:50 GMT - commit d861c91c068bc4e64d84db3b84232d3fb7f1d073
|
||||
Rollup.js v2.40.0
|
||||
Fri, 26 Feb 2021 14:39:44 GMT - commit 0a0958ff926554abe9916178f56762ba71301ddd
|
||||
|
||||
|
||||
https://github.com/rollup/rollup
|
||||
@@ -10,23 +10,25 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var cli = require('../bin/rollup');
|
||||
var rollup = require('./rollup.js');
|
||||
require('util');
|
||||
var fs = require('fs');
|
||||
require('path');
|
||||
require('./mergeOptions.js');
|
||||
var loadConfigFile_js = require('./loadConfigFile.js');
|
||||
require('crypto');
|
||||
var require$$0 = require('events');
|
||||
require('module');
|
||||
require('url');
|
||||
var index = require('./index.js');
|
||||
var loadConfigFile_js = require('./loadConfigFile.js');
|
||||
var fs = require('fs');
|
||||
var cli = require('../bin/rollup');
|
||||
var require$$0 = require('assert');
|
||||
var require$$0$1 = require('events');
|
||||
var rollup = require('./rollup.js');
|
||||
require('path');
|
||||
require('util');
|
||||
require('stream');
|
||||
require('os');
|
||||
var assert = require('assert');
|
||||
require('url');
|
||||
require('./mergeOptions.js');
|
||||
require('module');
|
||||
require('crypto');
|
||||
|
||||
var timeZone = date => {
|
||||
var dateTime$2 = {exports: {}};
|
||||
|
||||
var timeZone$1 = date => {
|
||||
const offset = (date || new Date()).getTimezoneOffset();
|
||||
const absOffset = Math.abs(offset);
|
||||
const hours = Math.floor(absOffset / 60);
|
||||
@@ -36,6 +38,8 @@ var timeZone = date => {
|
||||
return (offset < 0 ? '+' : '-') + hours + minutesOut;
|
||||
};
|
||||
|
||||
const timeZone = timeZone$1;
|
||||
|
||||
const dateTime = options => {
|
||||
options = Object.assign({
|
||||
date: new Date(),
|
||||
@@ -67,12 +71,17 @@ const dateTime = options => {
|
||||
.replace(/\..+/, end);
|
||||
};
|
||||
|
||||
var dateTime_1 = dateTime;
|
||||
dateTime$2.exports = dateTime;
|
||||
// TODO: Remove this for the next major release
|
||||
var _default = dateTime;
|
||||
dateTime_1.default = _default;
|
||||
dateTime$2.exports.default = dateTime;
|
||||
|
||||
var signals = rollup.createCommonjsModule(function (module) {
|
||||
var dateTime$1 = dateTime$2.exports;
|
||||
|
||||
var signalExit = {exports: {}};
|
||||
|
||||
var signals$1 = {exports: {}};
|
||||
|
||||
(function (module) {
|
||||
// This is not the set of all possible signals.
|
||||
//
|
||||
// It IS, however, the set of all signals that trigger
|
||||
@@ -126,16 +135,16 @@ if (process.platform === 'linux') {
|
||||
'SIGUNUSED'
|
||||
);
|
||||
}
|
||||
});
|
||||
}(signals$1));
|
||||
|
||||
// Note: since nyc uses this module to output coverage, any lines
|
||||
// that are in the direct sync flow of nyc's outputCoverage are
|
||||
// ignored, since we can never get coverage for them.
|
||||
|
||||
var signals$1 = signals;
|
||||
var assert = require$$0;
|
||||
var signals = signals$1.exports;
|
||||
var isWin = /^win/i.test(process.platform);
|
||||
|
||||
var EE = require$$0;
|
||||
var EE = require$$0$1;
|
||||
/* istanbul ignore if */
|
||||
if (typeof EE !== 'function') {
|
||||
EE = EE.EventEmitter;
|
||||
@@ -159,7 +168,7 @@ if (!emitter.infinite) {
|
||||
emitter.infinite = true;
|
||||
}
|
||||
|
||||
var signalExit = function (cb, opts) {
|
||||
signalExit.exports = function (cb, opts) {
|
||||
assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler');
|
||||
|
||||
if (loaded === false) {
|
||||
@@ -183,14 +192,14 @@ var signalExit = function (cb, opts) {
|
||||
return remove
|
||||
};
|
||||
|
||||
var unload_1 = unload;
|
||||
signalExit.exports.unload = unload;
|
||||
function unload () {
|
||||
if (!loaded) {
|
||||
return
|
||||
}
|
||||
loaded = false;
|
||||
|
||||
signals$1.forEach(function (sig) {
|
||||
signals.forEach(function (sig) {
|
||||
try {
|
||||
process.removeListener(sig, sigListeners[sig]);
|
||||
} catch (er) {}
|
||||
@@ -210,7 +219,7 @@ function emit (event, code, signal) {
|
||||
|
||||
// { <signal>: <listener fn>, ... }
|
||||
var sigListeners = {};
|
||||
signals$1.forEach(function (sig) {
|
||||
signals.forEach(function (sig) {
|
||||
sigListeners[sig] = function listener () {
|
||||
// If there are no other listeners, an exit is coming!
|
||||
// Simplest way: remove us and then re-send the signal.
|
||||
@@ -233,11 +242,11 @@ signals$1.forEach(function (sig) {
|
||||
};
|
||||
});
|
||||
|
||||
var signals_1 = function () {
|
||||
return signals$1
|
||||
signalExit.exports.signals = function () {
|
||||
return signals
|
||||
};
|
||||
|
||||
var load_1 = load;
|
||||
signalExit.exports.load = load;
|
||||
|
||||
var loaded = false;
|
||||
|
||||
@@ -253,7 +262,7 @@ function load () {
|
||||
// handle it instead of us.
|
||||
emitter.count += 1;
|
||||
|
||||
signals$1 = signals$1.filter(function (sig) {
|
||||
signals = signals.filter(function (sig) {
|
||||
try {
|
||||
process.on(sig, sigListeners[sig]);
|
||||
return true
|
||||
@@ -291,9 +300,8 @@ function processEmit (ev, arg) {
|
||||
return originalProcessEmit.apply(this, arguments)
|
||||
}
|
||||
}
|
||||
signalExit.unload = unload_1;
|
||||
signalExit.signals = signals_1;
|
||||
signalExit.load = load_1;
|
||||
|
||||
var onExit = signalExit.exports;
|
||||
|
||||
const CLEAR_SCREEN = '\u001Bc';
|
||||
function getResetScreen(configs, allowClearScreen) {
|
||||
@@ -324,7 +332,7 @@ async function watch(command) {
|
||||
let watcher;
|
||||
let configWatcher;
|
||||
const configFile = command.config ? cli.getConfigPath(command.config) : null;
|
||||
signalExit(close);
|
||||
onExit(close);
|
||||
process.on('uncaughtException', close);
|
||||
if (!process.stdin.isTTY) {
|
||||
process.stdin.on('end', close);
|
||||
@@ -418,9 +426,12 @@ async function watch(command) {
|
||||
break;
|
||||
case 'END':
|
||||
if (!silent && isTTY) {
|
||||
loadConfigFile_js.stderr(`\n[${dateTime_1()}] waiting for changes...`);
|
||||
loadConfigFile_js.stderr(`\n[${dateTime$1()}] waiting for changes...`);
|
||||
}
|
||||
}
|
||||
if ('result' in event && event.result) {
|
||||
event.result.close().catch(error => loadConfigFile_js.handleError(error, true));
|
||||
}
|
||||
});
|
||||
}
|
||||
function close(code) {
|
||||
|
||||
123
node_modules/rollup/dist/shared/watch.js
generated
vendored
123
node_modules/rollup/dist/shared/watch.js
generated
vendored
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
@license
|
||||
Rollup.js v2.33.1
|
||||
Mon, 02 Nov 2020 06:50:50 GMT - commit d861c91c068bc4e64d84db3b84232d3fb7f1d073
|
||||
Rollup.js v2.40.0
|
||||
Fri, 26 Feb 2021 14:39:44 GMT - commit 0a0958ff926554abe9916178f56762ba71301ddd
|
||||
|
||||
|
||||
https://github.com/rollup/rollup
|
||||
@@ -10,17 +10,21 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var rollup = require('./rollup.js');
|
||||
var util = require('util');
|
||||
require('fs');
|
||||
var sysPath = require('path');
|
||||
var mergeOptions = require('./mergeOptions.js');
|
||||
require('crypto');
|
||||
require('events');
|
||||
var path = require('path');
|
||||
var require$$0 = require('util');
|
||||
var index = require('./index.js');
|
||||
var rollup = require('./rollup.js');
|
||||
var mergeOptions = require('./mergeOptions.js');
|
||||
var require$$2 = require('os');
|
||||
require('events');
|
||||
require('fs');
|
||||
require('stream');
|
||||
var require$$1 = require('os');
|
||||
require('crypto');
|
||||
|
||||
const util = require$$0;
|
||||
const braces = index.braces_1;
|
||||
const picomatch = index.picomatch;
|
||||
const utils = index.utils;
|
||||
const isEmptyString = val => typeof val === 'string' && (val === '' || val === './');
|
||||
|
||||
/**
|
||||
@@ -58,7 +62,7 @@ const micromatch = (list, patterns, options) => {
|
||||
};
|
||||
|
||||
for (let i = 0; i < patterns.length; i++) {
|
||||
let isMatch = index.picomatch(String(patterns[i]), { ...options, onResult }, true);
|
||||
let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
|
||||
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
||||
if (negated) negatives++;
|
||||
|
||||
@@ -118,7 +122,7 @@ micromatch.match = micromatch;
|
||||
* @api public
|
||||
*/
|
||||
|
||||
micromatch.matcher = (pattern, options) => index.picomatch(pattern, options);
|
||||
micromatch.matcher = (pattern, options) => picomatch(pattern, options);
|
||||
|
||||
/**
|
||||
* Returns true if **any** of the given glob `patterns` match the specified `string`.
|
||||
@@ -137,7 +141,7 @@ micromatch.matcher = (pattern, options) => index.picomatch(pattern, options);
|
||||
* @api public
|
||||
*/
|
||||
|
||||
micromatch.isMatch = (str, patterns, options) => index.picomatch(patterns, options)(str);
|
||||
micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
||||
|
||||
/**
|
||||
* Backwards compatibility
|
||||
@@ -245,7 +249,7 @@ micromatch.contains = (str, pattern, options) => {
|
||||
*/
|
||||
|
||||
micromatch.matchKeys = (obj, patterns, options) => {
|
||||
if (!index.utils.isObject(obj)) {
|
||||
if (!utils.isObject(obj)) {
|
||||
throw new TypeError('Expected the first argument to be an object');
|
||||
}
|
||||
let keys = micromatch(Object.keys(obj), patterns, options);
|
||||
@@ -277,7 +281,7 @@ micromatch.some = (list, patterns, options) => {
|
||||
let items = [].concat(list);
|
||||
|
||||
for (let pattern of [].concat(patterns)) {
|
||||
let isMatch = index.picomatch(String(pattern), options);
|
||||
let isMatch = picomatch(String(pattern), options);
|
||||
if (items.some(item => isMatch(item))) {
|
||||
return true;
|
||||
}
|
||||
@@ -313,7 +317,7 @@ micromatch.every = (list, patterns, options) => {
|
||||
let items = [].concat(list);
|
||||
|
||||
for (let pattern of [].concat(patterns)) {
|
||||
let isMatch = index.picomatch(String(pattern), options);
|
||||
let isMatch = picomatch(String(pattern), options);
|
||||
if (!items.every(item => isMatch(item))) {
|
||||
return false;
|
||||
}
|
||||
@@ -353,7 +357,7 @@ micromatch.all = (str, patterns, options) => {
|
||||
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
||||
}
|
||||
|
||||
return [].concat(patterns).every(p => index.picomatch(p, options)(str));
|
||||
return [].concat(patterns).every(p => picomatch(p, options)(str));
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -376,9 +380,9 @@ micromatch.all = (str, patterns, options) => {
|
||||
*/
|
||||
|
||||
micromatch.capture = (glob, input, options) => {
|
||||
let posix = index.utils.isWindows(options);
|
||||
let regex = index.picomatch.makeRe(String(glob), { ...options, capture: true });
|
||||
let match = regex.exec(posix ? index.utils.toPosixSlashes(input) : input);
|
||||
let posix = utils.isWindows(options);
|
||||
let regex = picomatch.makeRe(String(glob), { ...options, capture: true });
|
||||
let match = regex.exec(posix ? utils.toPosixSlashes(input) : input);
|
||||
|
||||
if (match) {
|
||||
return match.slice(1).map(v => v === void 0 ? '' : v);
|
||||
@@ -401,7 +405,7 @@ micromatch.capture = (glob, input, options) => {
|
||||
* @api public
|
||||
*/
|
||||
|
||||
micromatch.makeRe = (...args) => index.picomatch.makeRe(...args);
|
||||
micromatch.makeRe = (...args) => picomatch.makeRe(...args);
|
||||
|
||||
/**
|
||||
* Scan a glob pattern to separate the pattern into segments. Used
|
||||
@@ -417,7 +421,7 @@ micromatch.makeRe = (...args) => index.picomatch.makeRe(...args);
|
||||
* @api public
|
||||
*/
|
||||
|
||||
micromatch.scan = (...args) => index.picomatch.scan(...args);
|
||||
micromatch.scan = (...args) => picomatch.scan(...args);
|
||||
|
||||
/**
|
||||
* Parse a glob pattern to create the source string for a regular
|
||||
@@ -436,8 +440,8 @@ micromatch.scan = (...args) => index.picomatch.scan(...args);
|
||||
micromatch.parse = (patterns, options) => {
|
||||
let res = [];
|
||||
for (let pattern of [].concat(patterns || [])) {
|
||||
for (let str of index.braces_1(String(pattern), options)) {
|
||||
res.push(index.picomatch.parse(str, options));
|
||||
for (let str of braces(String(pattern), options)) {
|
||||
res.push(picomatch.parse(str, options));
|
||||
}
|
||||
}
|
||||
return res;
|
||||
@@ -465,7 +469,7 @@ micromatch.braces = (pattern, options) => {
|
||||
if ((options && options.nobrace === true) || !/\{.*\}/.test(pattern)) {
|
||||
return [pattern];
|
||||
}
|
||||
return index.braces_1(pattern, options);
|
||||
return braces(pattern, options);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -495,7 +499,7 @@ function getMatcherString(id, resolutionBase) {
|
||||
if (resolutionBase === false) {
|
||||
return id;
|
||||
}
|
||||
return sysPath.resolve(...(typeof resolutionBase === 'string' ? [resolutionBase, id] : [id]));
|
||||
return path.resolve(...(typeof resolutionBase === 'string' ? [resolutionBase, id] : [id]));
|
||||
}
|
||||
const createFilter = function createFilter(include, exclude, options) {
|
||||
const resolutionBase = options && options.resolve;
|
||||
@@ -504,7 +508,7 @@ const createFilter = function createFilter(include, exclude, options) {
|
||||
? id
|
||||
: {
|
||||
test: micromatch_1.matcher(getMatcherString(id, resolutionBase)
|
||||
.split(sysPath.sep)
|
||||
.split(path.sep)
|
||||
.join('/'), { dot: true })
|
||||
};
|
||||
};
|
||||
@@ -515,7 +519,7 @@ const createFilter = function createFilter(include, exclude, options) {
|
||||
return false;
|
||||
if (/\0/.test(id))
|
||||
return false;
|
||||
id = id.split(sysPath.sep).join('/');
|
||||
id = id.split(path.sep).join('/');
|
||||
for (let i = 0; i < excludeMatchers.length; ++i) {
|
||||
const matcher = excludeMatchers[i];
|
||||
if (matcher.test(id))
|
||||
@@ -563,7 +567,7 @@ class FileWatcher {
|
||||
}
|
||||
createWatcher(transformWatcherId) {
|
||||
const task = this.task;
|
||||
const isLinux = require$$1.platform() === 'linux';
|
||||
const isLinux = require$$2.platform() === 'linux';
|
||||
const isTransformDependency = transformWatcherId !== null;
|
||||
const handleChange = (id, event) => {
|
||||
const changedId = transformWatcherId || id;
|
||||
@@ -589,17 +593,17 @@ const eventsRewrites = {
|
||||
create: {
|
||||
create: 'buggy',
|
||||
delete: null,
|
||||
update: 'create',
|
||||
update: 'create'
|
||||
},
|
||||
delete: {
|
||||
create: 'update',
|
||||
delete: 'buggy',
|
||||
update: 'buggy',
|
||||
update: 'buggy'
|
||||
},
|
||||
update: {
|
||||
create: 'buggy',
|
||||
delete: 'delete',
|
||||
update: 'update',
|
||||
update: 'update'
|
||||
}
|
||||
};
|
||||
class Watcher {
|
||||
@@ -629,9 +633,7 @@ class Watcher {
|
||||
invalidate(file) {
|
||||
if (file) {
|
||||
const prevEvent = this.invalidatedIds.get(file.id);
|
||||
const event = prevEvent
|
||||
? eventsRewrites[prevEvent][file.event]
|
||||
: file.event;
|
||||
const event = prevEvent ? eventsRewrites[prevEvent][file.event] : file.event;
|
||||
if (event === 'buggy') {
|
||||
//TODO: throws or warn? Currently just ignore, uses new event
|
||||
this.invalidatedIds.set(file.id, file.event);
|
||||
@@ -664,22 +666,13 @@ class Watcher {
|
||||
this.emitter.emit('event', {
|
||||
code: 'START'
|
||||
});
|
||||
try {
|
||||
for (const task of this.tasks) {
|
||||
await task.run();
|
||||
}
|
||||
this.running = false;
|
||||
this.emitter.emit('event', {
|
||||
code: 'END'
|
||||
});
|
||||
}
|
||||
catch (error) {
|
||||
this.running = false;
|
||||
this.emitter.emit('event', {
|
||||
code: 'ERROR',
|
||||
error
|
||||
});
|
||||
for (const task of this.tasks) {
|
||||
await task.run();
|
||||
}
|
||||
this.running = false;
|
||||
this.emitter.emit('event', {
|
||||
code: 'END'
|
||||
});
|
||||
if (this.rerun) {
|
||||
this.rerun = false;
|
||||
this.invalidate();
|
||||
@@ -694,12 +687,12 @@ class Task {
|
||||
this.watcher = watcher;
|
||||
this.closed = false;
|
||||
this.watched = new Set();
|
||||
this.skipWrite = config.watch && !!config.watch.skipWrite;
|
||||
this.skipWrite = Boolean(config.watch && config.watch.skipWrite);
|
||||
this.options = mergeOptions.mergeOptions(config);
|
||||
this.outputs = this.options.output;
|
||||
this.outputFiles = this.outputs.map(output => {
|
||||
if (output.file || output.dir)
|
||||
return sysPath.resolve(output.file || output.dir);
|
||||
return path.resolve(output.file || output.dir);
|
||||
return undefined;
|
||||
});
|
||||
const watchOptions = this.options.watch || {};
|
||||
@@ -740,8 +733,9 @@ class Task {
|
||||
input: this.options.input,
|
||||
output: this.outputFiles
|
||||
});
|
||||
let result = null;
|
||||
try {
|
||||
const result = await rollup.rollupInternal(options, this.watcher.emitter);
|
||||
result = await rollup.rollupInternal(options, this.watcher.emitter);
|
||||
if (this.closed) {
|
||||
return;
|
||||
}
|
||||
@@ -756,18 +750,21 @@ class Task {
|
||||
});
|
||||
}
|
||||
catch (error) {
|
||||
if (this.closed) {
|
||||
return;
|
||||
}
|
||||
if (Array.isArray(error.watchFiles)) {
|
||||
for (const id of error.watchFiles) {
|
||||
this.watchFile(id);
|
||||
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);
|
||||
}
|
||||
}
|
||||
if (error.id) {
|
||||
this.cache.modules = this.cache.modules.filter(module => module.id !== error.id);
|
||||
}
|
||||
throw error;
|
||||
this.watcher.emitter.emit('event', {
|
||||
code: 'ERROR',
|
||||
error,
|
||||
result
|
||||
});
|
||||
}
|
||||
}
|
||||
updateWatchedFiles(result) {
|
||||
|
||||
Reference in New Issue
Block a user