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

Upgrade Rollup, its plugins, Jest and more #492

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
5 changes: 5 additions & 0 deletions .changeset/pretty-humans-greet.md
@@ -0,0 +1,5 @@
---
"@preconstruct/cli": major
---

Update Rollup, various Rollup plugins and `jest-worker` which require Node 14
14 changes: 7 additions & 7 deletions packages/cli/package.json
Expand Up @@ -20,11 +20,11 @@
"@babel/helper-module-imports": "^7.10.4",
"@babel/runtime": "^7.7.7",
"@preconstruct/hook": "^0.4.0",
"@rollup/plugin-alias": "^3.1.1",
"@rollup/plugin-commonjs": "^15.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^11.2.1",
"@rollup/plugin-replace": "^2.4.1",
"@rollup/plugin-alias": "^5.0.0",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.2",
"@rollup/plugin-replace": "^5.0.2",
"builtin-modules": "^3.1.0",
"chalk": "^4.1.0",
"dataloader": "^2.0.0",
Expand All @@ -36,7 +36,7 @@
"fs-extra": "^9.0.1",
"is-ci": "^2.0.0",
"is-reference": "^1.2.1",
"jest-worker": "^26.3.0",
"jest-worker": "^29.5.0",
"magic-string": "^0.30.0",
"meow": "^7.1.0",
"ms": "^2.1.2",
Expand All @@ -48,7 +48,7 @@
"quick-lru": "^5.1.1",
"resolve": "^1.17.0",
"resolve-from": "^5.0.0",
"rollup": "^2.79.1",
"rollup": "^3.20.2",
"semver": "^7.3.4",
"terser": "^5.16.8",
"v8-compile-cache": "^2.1.1"
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/build/__tests__/__snapshots__/basic.ts.snap
Expand Up @@ -7,7 +7,7 @@ Object.defineProperty(exports, '__esModule', { value: true });

var index = "something";

exports["default"] = index;
exports.default = index;
"
`;

Expand All @@ -29,7 +29,7 @@ Object.defineProperty(exports, '__esModule', { value: true });

var index = "something";

exports["default"] = index;
exports.default = index;
"
`;

Expand Down
22 changes: 12 additions & 10 deletions packages/cli/src/build/__tests__/__snapshots__/build.ts.snap
Expand Up @@ -70,7 +70,7 @@ function doSomething(arg) {
}
var index = "wow";

exports["default"] = index;
exports.default = index;
exports.doSomething = doSomething;
"
`;
Expand Down Expand Up @@ -103,7 +103,7 @@ function doSomething(arg) {
}
var index = "wow";

exports["default"] = index;
exports.default = index;
exports.doSomething = doSomething;
"
`;
Expand All @@ -125,7 +125,7 @@ Object.defineProperty(exports, '__esModule', { value: true });

var index = 2;

exports["default"] = index;
exports.default = index;
"
`;

Expand All @@ -147,7 +147,7 @@ Object.defineProperty(exports, '__esModule', { value: true });

var index = 2;

exports["default"] = index;
exports.default = index;
"
`;

Expand Down Expand Up @@ -309,7 +309,7 @@ Object.defineProperty(exports, '__esModule', { value: true });

var index = 1;

exports["default"] = index;
exports.default = index;
"
`;

Expand All @@ -331,7 +331,7 @@ Object.defineProperty(exports, '__esModule', { value: true });

var index = 1;

exports["default"] = index;
exports.default = index;
"
`;

Expand All @@ -349,7 +349,7 @@ Object.defineProperty(exports, '__esModule', { value: true });

var index = 2;

exports["default"] = index;
exports.default = index;
"
`;

Expand All @@ -371,7 +371,7 @@ Object.defineProperty(exports, '__esModule', { value: true });

var index = 2;

exports["default"] = index;
exports.default = index;
"
`;

Expand All @@ -389,7 +389,7 @@ Object.defineProperty(exports, '__esModule', { value: true });

var index = "this does not have a module build";

exports["default"] = index;
exports.default = index;
"
`;

Expand All @@ -411,7 +411,7 @@ Object.defineProperty(exports, '__esModule', { value: true });

var index = "this does not have a module build";

exports["default"] = index;
exports.default = index;
"
`;

Expand All @@ -424,6 +424,7 @@ function thing() {
if (process.env.NODE_ENV !== "production") {
return "not prod";
}

return "prod";
}

Expand All @@ -448,6 +449,7 @@ exports[`prod checks: prod-checks.cjs.prod.js 1`] = `
Object.defineProperty(exports, '__esModule', { value: true });

function thing() {

return "prod";
}

Expand Down
24 changes: 11 additions & 13 deletions packages/cli/src/build/__tests__/__snapshots__/entrypoints.ts.snap
Expand Up @@ -83,7 +83,7 @@ exports[`two entrypoints with a common dependency: dist/common-dependency-two-en

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

var identity = require('./identity-some-hash.cjs.dev.js');
var identity = require('./identity-b6f976d1.cjs.dev.js');

let sum = (a, b) => identity.identity(a + b);

Expand All @@ -108,7 +108,7 @@ exports[`two entrypoints with a common dependency: dist/common-dependency-two-en

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

var identity = require('./identity-some-hash.cjs.prod.js');
var identity = require('./identity-b6f976d1.cjs.prod.js');

let sum = (a, b) => identity.identity(a + b);

Expand All @@ -118,23 +118,22 @@ exports.sum = sum;
`;

exports[`two entrypoints with a common dependency: dist/common-dependency-two-entrypoints.esm.js 1`] = `
"import { i as identity } from './identity-some-hash.esm.js';
export { i as identity } from './identity-some-hash.esm.js';
"import { i as identity } from './identity-88ce9a57.esm.js';

let sum = (a, b) => identity(a + b);

export { sum };
export { identity, sum };
"
`;

exports[`two entrypoints with a common dependency: dist/identity-this-is-not-the-real-hash-09d8aa2cd41dd37e55ea1ca5c8546d35.esm.js 1`] = `
exports[`two entrypoints with a common dependency: dist/identity-88ce9a57.esm.js 1`] = `
"let identity = x => x;

export { identity as i };
"
`;

exports[`two entrypoints with a common dependency: dist/identity-this-is-not-the-real-hash-f57161fefd97e3101601d153708a46b8.cjs.dev.js 1`] = `
exports[`two entrypoints with a common dependency: dist/identity-b6f976d1.cjs.dev.js 1`] = `
"'use strict';

let identity = x => x;
Expand All @@ -143,7 +142,7 @@ exports.identity = identity;
"
`;

exports[`two entrypoints with a common dependency: dist/identity-this-is-not-the-real-hash-f57161fefd97e3101601d153708a46b8.cjs.prod.js 1`] = `
exports[`two entrypoints with a common dependency: dist/identity-b6f976d1.cjs.prod.js 1`] = `
"'use strict';

let identity = x => x;
Expand All @@ -157,7 +156,7 @@ exports[`two entrypoints with a common dependency: multiply/dist/common-dependen

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

var identity = require('../../dist/identity-some-hash.cjs.dev.js');
var identity = require('../../dist/identity-b6f976d1.cjs.dev.js');

let multiply = (a, b) => identity.identity(a * b);

Expand All @@ -182,7 +181,7 @@ exports[`two entrypoints with a common dependency: multiply/dist/common-dependen

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

var identity = require('../../dist/identity-some-hash.cjs.prod.js');
var identity = require('../../dist/identity-b6f976d1.cjs.prod.js');

let multiply = (a, b) => identity.identity(a * b);

Expand All @@ -192,12 +191,11 @@ exports.multiply = multiply;
`;

exports[`two entrypoints with a common dependency: multiply/dist/common-dependency-two-entrypoints-multiply.esm.js 1`] = `
"import { i as identity } from '../../dist/identity-some-hash.esm.js';
export { i as identity } from '../../dist/identity-some-hash.esm.js';
"import { i as identity } from '../../dist/identity-88ce9a57.esm.js';

let multiply = (a, b) => identity(a * b);

export { multiply };
export { identity, multiply };
"
`;

Expand Down
23 changes: 16 additions & 7 deletions packages/cli/src/build/__tests__/__snapshots__/other.ts.snap
Expand Up @@ -6,15 +6,18 @@ exports[`browser no module: dist/browser-no-module.browser.cjs.js 1`] = `
Object.defineProperty(exports, '__esModule', { value: true });

let thing = "wow";

{
thing = "something";
}

{
thing += "other";
}

var thing$1 = thing;

exports["default"] = thing$1;
exports.default = thing$1;
"
`;

Expand All @@ -24,15 +27,18 @@ exports[`browser no module: dist/browser-no-module.cjs.dev.js 1`] = `
Object.defineProperty(exports, '__esModule', { value: true });

let thing = "wow";

if (typeof window !== "undefined") {
thing = "something";
}

if (typeof document !== undefined) {
thing += "other";
}

var thing$1 = thing;

exports["default"] = thing$1;
exports.default = thing$1;
"
`;

Expand All @@ -53,15 +59,18 @@ exports[`browser no module: dist/browser-no-module.cjs.prod.js 1`] = `
Object.defineProperty(exports, '__esModule', { value: true });

let thing = "wow";

if (typeof window !== "undefined") {
thing = "something";
}

if (typeof document !== undefined) {
thing += "other";
}

var thing$1 = thing;

exports["default"] = thing$1;
exports.default = thing$1;
"
`;

Expand Down Expand Up @@ -96,7 +105,7 @@ Object.defineProperty(exports, '__esModule', { value: true });

var index = "something";

exports["default"] = index;
exports.default = index;
"
`;

Expand All @@ -118,7 +127,7 @@ Object.defineProperty(exports, '__esModule', { value: true });

var index = "something";

exports["default"] = index;
exports.default = index;
"
`;

Expand Down Expand Up @@ -251,7 +260,7 @@ var Foo = /*#__PURE__*/_createClass(function Foo() {
_classCallCheck(this, Foo);
});

exports["default"] = Foo;
exports.default = Foo;
"
`;

Expand All @@ -278,7 +287,7 @@ var Foo = /*#__PURE__*/_createClass(function Foo() {
_classCallCheck(this, Foo);
});

exports["default"] = Foo;
exports.default = Foo;
"
`;

Expand Down