Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Dec 2, 2020
1 parent 9a30104 commit 9bf9a5f
Show file tree
Hide file tree
Showing 30 changed files with 2,342 additions and 2,302 deletions.
2 changes: 1 addition & 1 deletion cli/run/build.ts
Expand Up @@ -53,7 +53,7 @@ export default async function build(
}
}
if (outputs.length > 1) process.stdout.write(`\n${cyan(bold(`//→ ${file.fileName}:`))}\n`);
process.stdout.write(source);
process.stdout.write(source as Buffer);
}
if (!silent) {
warnings.flush();
Expand Down
5 changes: 4 additions & 1 deletion cli/run/resetScreen.ts
Expand Up @@ -3,7 +3,10 @@ import { stderr } from '../logging';

const CLEAR_SCREEN = '\u001Bc';

export function getResetScreen(configs: MergedRollupOptions[], allowClearScreen: boolean) {
export function getResetScreen(
configs: MergedRollupOptions[],
allowClearScreen: boolean | undefined
) {
let clearScreen = allowClearScreen;
for (const config of configs) {
if (config.watch && config.watch.clearScreen === false) {
Expand Down
1,044 changes: 438 additions & 606 deletions package-lock.json

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions package.json
Expand Up @@ -60,70 +60,70 @@
"devDependencies": {
"@rollup/plugin-alias": "^3.1.1",
"@rollup/plugin-buble": "^0.21.3",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.3.3",
"@rollup/plugin-node-resolve": "^10.0.0",
"@rollup/plugin-replace": "^2.3.4",
"@types/micromatch": "^4.0.1",
"@types/node": "^14.10.2",
"@types/node": "^10.17.48",
"@types/require-relative": "^0.8.0",
"@types/signal-exit": "^3.0.0",
"@types/yargs-parser": "^15.0.0",
"acorn": "^8.0.3",
"acorn": "^8.0.4",
"acorn-class-fields": "^0.3.7",
"acorn-jsx": "^5.3.1",
"acorn-numeric-separator": "^0.3.6",
"acorn-static-class-features": "^0.2.4",
"acorn-walk": "^8.0.0",
"buble": "^0.20.0",
"chokidar": "^3.4.2",
"codecov": "^3.7.2",
"chokidar": "^3.4.3",
"codecov": "^3.8.1",
"colorette": "^1.2.1",
"core-js": "^3.6.5",
"core-js": "^3.8.0",
"date-time": "^3.1.0",
"es5-shim": "^4.5.14",
"es6-shim": "^0.35.5",
"eslint": "^7.10.0",
"es6-shim": "^0.35.6",
"eslint": "^7.14.0",
"eslint-plugin-import": "^2.22.1",
"execa": "^4.0.3",
"execa": "^4.1.0",
"fixturify": "^2.1.0",
"hash.js": "^1.1.7",
"husky": "^4.3.0",
"is-reference": "^1.2.1",
"lint-staged": "^10.4.0",
"lint-staged": "^10.5.2",
"locate-character": "^2.0.5",
"magic-string": "^0.25.7",
"markdownlint-cli": "^0.24.0",
"markdownlint-cli": "^0.25.0",
"micromatch": "^4.0.2",
"mocha": "^8.1.3",
"mocha": "^8.2.1",
"node-fetch": "^2.6.1",
"nyc": "^15.1.0",
"prettier": "^2.1.2",
"prettier": "^2.2.1",
"pretty-bytes": "^5.4.1",
"pretty-ms": "^7.0.1",
"require-relative": "^0.8.7",
"requirejs": "^2.3.6",
"rollup": "^2.28.2",
"rollup": "^2.34.0",
"rollup-plugin-license": "^2.2.0",
"rollup-plugin-string": "^3.0.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-thatworks": "^1.0.4",
"rollup-plugin-typescript": "^1.0.1",
"rollup-pluginutils": "^2.8.2",
"sander": "^0.6.0",
"shx": "^0.3.2",
"shx": "^0.3.3",
"signal-exit": "^3.0.3",
"source-map": "^0.7.3",
"source-map-support": "^0.5.19",
"sourcemap-codec": "^1.4.8",
"systemjs": "^6.6.1",
"terser": "^5.3.4",
"tslib": "^2.0.1",
"systemjs": "^6.8.1",
"terser": "^5.5.1",
"tslib": "^2.0.3",
"tslint": "^6.1.3",
"typescript": "^4.0.3",
"typescript": "^4.1.2",
"url-parse": "^1.4.7",
"weak-napi": "^2.0.2",
"yargs-parser": "^20.2.1"
"yargs-parser": "^20.2.4"
},
"files": [
"dist/**/*.js",
Expand Down
9 changes: 4 additions & 5 deletions src/utils/FileEmitter.ts
Expand Up @@ -103,11 +103,10 @@ export const FILE_PLACEHOLDER: FilePlaceholder = {
function hasValidType(
emittedFile: unknown
): emittedFile is { type: 'asset' | 'chunk'; [key: string]: unknown } {
return (
emittedFile &&
((emittedFile as { [key: string]: unknown }).type === 'asset' ||
(emittedFile as { [key: string]: unknown }).type === 'chunk')
);
return emittedFile
? (emittedFile as { [key: string]: unknown }).type === 'asset' ||
(emittedFile as { [key: string]: unknown }).type === 'chunk'
: false;
}

function hasValidName(emittedFile: {
Expand Down
24 changes: 11 additions & 13 deletions src/watch/watch.ts
Expand Up @@ -17,20 +17,20 @@ import { FileWatcher } from './fileWatcher';
const eventsRewrites: Record<ChangeEvent, Record<ChangeEvent, ChangeEvent | 'buggy' | null>> = {
create: {
create: 'buggy',
delete: null, //delete file from map
update: 'create',
delete: null, //delete file from map
update: 'create'
},
delete: {
create: 'update',
delete: 'buggy',
update: 'buggy',
update: 'buggy'
},
update: {
create: 'buggy',
delete: 'delete',
update: 'update',
update: 'update'
}
}
};

export class Watcher {
emitter: RollupWatcher;
Expand Down Expand Up @@ -66,12 +66,10 @@ export class Watcher {
this.emitter.removeAllListeners();
}

invalidate(file?: {event: ChangeEvent, id: string}) {
invalidate(file?: { event: ChangeEvent; id: string }) {
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
Expand All @@ -92,7 +90,7 @@ export class Watcher {
this.buildTimeout = setTimeout(() => {
this.buildTimeout = null;
for (const [id, event] of this.invalidatedIds.entries()) {
this.emitter.emit('change', id, {event});
this.emitter.emit('change', id, { event });
}
this.invalidatedIds.clear();
this.emitter.emit('restart');
Expand Down Expand Up @@ -150,7 +148,7 @@ export class Task {
this.closed = false;
this.watched = new Set();

this.skipWrite = config.watch && !!(config.watch as GenericConfigObject).skipWrite;
this.skipWrite = Boolean(config.watch && (config.watch as GenericConfigObject).skipWrite);
this.options = mergeOptions(config);
this.outputs = this.options.output;
this.outputFiles = this.outputs.map(output => {
Expand All @@ -172,7 +170,7 @@ export class Task {
this.fileWatcher.close();
}

invalidate(id: string, details: {event: ChangeEvent, isTransformDependency?: boolean}) {
invalidate(id: string, details: { event: ChangeEvent; isTransformDependency?: boolean }) {
this.invalidated = true;
if (details.isTransformDependency) {
for (const module of this.cache.modules) {
Expand All @@ -181,7 +179,7 @@ export class Task {
module.originalCode = null as any;
}
}
this.watcher.invalidate({id, event: details.event});
this.watcher.invalidate({ id, event: details.event });
}

async run() {
Expand Down
Expand Up @@ -3,6 +3,7 @@ const resolve = require('@rollup/plugin-node-resolve').default;

module.exports = {
description: 'confirm preserveModulesRoot restructures src appropriately',
expectedWarnings: ['MIXED_EXPORTS'],
options: {
input: ['src/under-build.js', 'src/below/module.js'],
plugins: [
Expand Down

This file was deleted.

Expand Up @@ -2,6 +2,6 @@ define(['../custom_modules/@my-scope/my-base-pkg/index'], function (index) { 'us



return index.myBasePkg;
return index['default'];

});
@@ -1,7 +1,7 @@
define(['../custom_modules/@my-scope/my-base-pkg/index'], function (index) { 'use strict';

var module = {
base2: index.myBasePkg,
base2: index['default'],
};

return module;
Expand Down
@@ -1,15 +1,15 @@
define(['exports', '../../../_virtual/_commonjsHelpers'], function (exports, _commonjsHelpers) { 'use strict';

var myBasePkg = _commonjsHelpers.createCommonjsModule(function (module, exports) {

Object.defineProperty(exports, '__esModule', { value: true });
define(['exports'], function (exports) { 'use strict';

var hello = 'world';

exports.hello = hello;
});
var hello_1 = hello;

var myBasePkg = /*#__PURE__*/Object.defineProperty({
hello: hello_1
}, '__esModule', {value: true});

exports.myBasePkg = myBasePkg;
exports.default = myBasePkg;
exports.hello = hello_1;

Object.defineProperty(exports, '__esModule', { value: true });

Expand Down
@@ -1,7 +1,7 @@
define(['./custom_modules/@my-scope/my-base-pkg/index'], function (index) { 'use strict';

var underBuild = {
base: index.myBasePkg
base: index['default']
};

return underBuild;
Expand Down

This file was deleted.

Expand Up @@ -4,4 +4,4 @@ var index = require('../custom_modules/@my-scope/my-base-pkg/index.js');



module.exports = index.myBasePkg;
module.exports = index['default'];
Expand Up @@ -3,7 +3,7 @@
var index = require('../custom_modules/@my-scope/my-base-pkg/index.js');

var module$1 = {
base2: index.myBasePkg,
base2: index['default'],
};

module.exports = module$1;
Expand Up @@ -2,15 +2,13 @@

Object.defineProperty(exports, '__esModule', { value: true });

var _commonjsHelpers = require('../../../_virtual/_commonjsHelpers.js');

var myBasePkg = _commonjsHelpers.createCommonjsModule(function (module, exports) {

Object.defineProperty(exports, '__esModule', { value: true });

var hello = 'world';

exports.hello = hello;
});
var hello_1 = hello;

var myBasePkg = /*#__PURE__*/Object.defineProperty({
hello: hello_1
}, '__esModule', {value: true});

exports.myBasePkg = myBasePkg;
exports.default = myBasePkg;
exports.hello = hello_1;
Expand Up @@ -3,7 +3,7 @@
var index = require('./custom_modules/@my-scope/my-base-pkg/index.js');

var underBuild = {
base: index.myBasePkg
base: index['default']
};

module.exports = underBuild;

This file was deleted.

@@ -1,2 +1,2 @@
import { m as myBasePkg } from '../custom_modules/@my-scope/my-base-pkg/index.js';
export { m as default } from '../custom_modules/@my-scope/my-base-pkg/index.js';
import myBasePkg from '../custom_modules/@my-scope/my-base-pkg/index.js';
export { default } from '../custom_modules/@my-scope/my-base-pkg/index.js';
@@ -1,4 +1,4 @@
import { m as myBasePkg } from '../custom_modules/@my-scope/my-base-pkg/index.js';
import myBasePkg from '../custom_modules/@my-scope/my-base-pkg/index.js';

var module = {
base2: myBasePkg,
Expand Down

0 comments on commit 9bf9a5f

Please sign in to comment.