Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #3893

Merged
merged 2 commits into from Dec 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/node-windows.yml
@@ -1,14 +1,18 @@
name: Node

on: [push, pull_request]
on:
push:
branches:
- master
pull_request:

jobs:
build:
runs-on: windows-2019

strategy:
matrix:
node: ['14', '12', '10']
node: [ '14', '12', '10' ]

name: ${{ matrix.node }} (Windows)
steps:
Expand All @@ -20,7 +24,7 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Run tests
run: npm test
Expand Down
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
2 changes: 1 addition & 1 deletion cli/run/loadConfigFile.ts
Expand Up @@ -85,7 +85,7 @@ async function getDefaultFromTranspiledConfigFile(
async function loadConfigFromBundledFile(fileName: string, bundledCode: string) {
const resolvedFileName = fs.realpathSync(fileName);
const extension = path.extname(resolvedFileName);
const defaultLoader = require.extensions[extension]!;
const defaultLoader = require.extensions[extension];
require.extensions[extension] = (module: NodeModule, requiredFileName: string) => {
if (requiredFileName === resolvedFileName) {
(module as NodeModuleWithCompile)._compile(bundledCode, requiredFileName);
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
6 changes: 3 additions & 3 deletions src/utils/FileEmitter.ts
Expand Up @@ -103,10 +103,10 @@ export const FILE_PLACEHOLDER: FilePlaceholder = {
function hasValidType(
emittedFile: unknown
): emittedFile is { type: 'asset' | 'chunk'; [key: string]: unknown } {
return (
return Boolean(
emittedFile &&
((emittedFile as { [key: string]: unknown }).type === 'asset' ||
(emittedFile as { [key: string]: unknown }).type === 'chunk')
((emittedFile as { [key: string]: unknown }).type === 'asset' ||
(emittedFile as { [key: string]: unknown }).type === 'chunk')
);
}

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;