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

Major upgrades and 5.x release #73

Merged
merged 1 commit into from
May 25, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: node_js
node_js:
- 'lts/carbon'
- 'lts/dubnium'
- 'lts/erbium'
- 'lts/fermium'
- 'stable'
cache: yarn
script:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# broccoli-rollup Changelog

## 5.0.0

#### Breaking Changes

- Updated `rollup` to 2.x. See https://github.com/rollup/rollup/blob/master/CHANGELOG.md#200
- Node 12 now required
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Test against these versions of Node.js.
environment:
matrix:
- nodejs_version: '8'
- nodejs_version: '10'
- nodejs_version: '12'
- nodejs_version: '14'
cache:
- "%LOCALAPPDATA%\\Yarn"
# Install scripts. (runs after repo cloning)
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "broccoli-rollup",
"version": "4.1.0",
"version": "5.0.0",
"description": "A broccoli plugin that uses rollup.js on its input",
"keywords": [
"broccoli",
Expand Down Expand Up @@ -46,32 +46,32 @@
"test:fast": "qunit tests"
},
"dependencies": {
"@types/broccoli-plugin": "^1.3.0",
"broccoli-plugin": "^2.0.0",
"@types/broccoli-plugin": "^3.0.0",
"broccoli-plugin": "^4.0.7",
"fs-tree-diff": "^2.0.1",
"heimdalljs": "^0.2.6",
"node-modules-path": "^1.0.1",
"rollup": "^1.12.0",
"rollup": "^2.50.0",
"rollup-pluginutils": "^2.8.1",
"symlink-or-copy": "^1.2.0",
"walk-sync": "^1.1.3"
"walk-sync": "^2.2.0"
},
"devDependencies": {
"@types/node": "^12.0.2",
"@types/node": "^15.6.1",
"@types/qunit": "^2.9.0",
"@types/symlink-or-copy": "^1.2.0",
"broccoli-merge-trees": "^3.0.2",
"broccoli-merge-trees": "^4.2.0",
"broccoli-test-helper": "^2.0.0",
"nyc": "^14.1.1",
"prettier": "^1.17.1",
"nyc": "^15.1.0",
"prettier": "^2.3.0",
"qunit": "^2.9.2",
"source-map": "0.7.3",
"tslint": "^5.16.0",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "^2.0.1",
"typescript": "^3.4.5"
"typescript": "^4.2.4"
},
"engines": {
"node": ">=8.0"
"node": ">=12.0"
}
}
77 changes: 29 additions & 48 deletions tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ export default index;
assert.deepEqual(output.read(), {
dist: {
'out.umd.js':
"(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global = global || self, global.thing = factory());\n}(this, function () { 'use strict';\n\n\tvar add = x => x + x;\n\n\tconst two = add(1);\n\n\treturn two;\n\n}));\n",
"(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.thing = factory());\n}(this, (function () { 'use strict';\n\n\tvar add = x => x + x;\n\n\tconst two = add(1);\n\n\treturn two;\n\n})));\n",
},
});
} finally {
Expand Down Expand Up @@ -461,17 +461,9 @@ export default index;

assert.deepEqual(output.read(), {
dist: {
'out.js': `var add = x => x + x;

const two = add(1);

export default two;
//# sourceMappingURL=out.js.map
`,
'out.js.map':
'{"version":3,"file":"out.js","sources":["../add.js","../index.js"],"sourcesContent":["export default x => x + x;","import add from \\"./add\\"; const two = add(1); export default two;"],"names":[],"mappings":"AAAA,UAAe,CAAC,IAAI,CAAC,GAAG,CAAC;;qBAAC,rBCAD,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;;;;"}',
'out.umd.js':
"(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global = global || self, global.thing = factory());\n}(this, function () { 'use strict';\n\n\tvar add = x => x + x;\n\n\tconst two = add(1);\n\n\treturn two;\n\n}));\n",
'out.js': "var add = x => x + x;\n\nconst two = add(1);\n\nexport default two;\n//# sourceMappingURL=out.js.map\n",
'out.js.map': "{\"version\":3,\"file\":\"out.js\",\"sources\":[\"../add.js\",\"../index.js\"],\"sourcesContent\":[\"export default x => x + x;\",\"import add from \\\"./add\\\"; const two = add(1); export default two;\"],\"names\":[],\"mappings\":\"AAAA,UAAe,CAAC,IAAI,CAAC,GAAG,CAAC;;ACAK,MAAC,GAAG,GAAG,GAAG,CAAC,CAAC;;;;\"}",
'out.umd.js': "(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.thing = factory());\n}(this, (function () { 'use strict';\n\n\tvar add = x => x + x;\n\n\tconst two = add(1);\n\n\treturn two;\n\n})));\n"
},
});
} finally {
Expand Down Expand Up @@ -532,12 +524,10 @@ export default two;

assert.deepEqual(output.read(), {
chunks: {
'a.js':
"import { a as e } from './chunk-9db0917b.js';\n\nconst num1 = 1;\n\nconst out = num1 + e;\n\nexport { out };\n",
'b.js':
"import { a as e } from './chunk-9db0917b.js';\n\nconst num2 = 2;\n\nconst out = num2 + e;\n\nexport { out };\n",
'chunk-9db0917b.js': 'const num3 = 3;\n\nexport { num3 as a };\n',
'f.js': 'const num4 = 4;\n\nexport { num4 };\n',
'a.js': "import { n as num3 } from './e-0f663cdb.js';\n\nconst num1 = 1;\n\nconst out = num1 + num3;\n\nexport { out };\n",
'b.js': "import { n as num3 } from './e-0f663cdb.js';\n\nconst num2 = 2;\n\nconst out = num2 + num3;\n\nexport { out };\n",
'e-0f663cdb.js': "const num3 = 3;\n\nexport { num3 as n };\n",
'f.js': "const num4 = 4;\n\nexport { num4 };\n"
},
});

Expand Down Expand Up @@ -597,12 +587,10 @@ export default two;
// our output should still be the same as before noops and errors
assert.deepEqual(output.read(), {
chunks: {
'a.js':
"import { a as e } from './chunk-9db0917b.js';\n\nconst num1 = 1;\n\nconst out = num1 + e;\n\nexport { out };\n",
'b.js':
"import { a as e } from './chunk-9db0917b.js';\n\nconst num2 = 2;\n\nconst out = num2 + e;\n\nexport { out };\n",
'chunk-9db0917b.js': 'const num3 = 3;\n\nexport { num3 as a };\n',
'f.js': 'const num4 = 4;\n\nexport { num4 };\n',
'a.js': "import { n as num3 } from './e-0f663cdb.js';\n\nconst num1 = 1;\n\nconst out = num1 + num3;\n\nexport { out };\n",
'b.js': "import { n as num3 } from './e-0f663cdb.js';\n\nconst num2 = 2;\n\nconst out = num2 + num3;\n\nexport { out };\n",
'e-0f663cdb.js': "const num3 = 3;\n\nexport { num3 as n };\n",
'f.js': "const num4 = 4;\n\nexport { num4 };\n"
},
});

Expand All @@ -622,12 +610,10 @@ export default two;

assert.deepEqual(output.read(), {
chunks: {
'a.js':
"import { a as e } from './chunk-9db0917b.js';\n\nconst num1 = 1;\n\nconst out = num1 + e;\n\nexport { out };\n",
'b.js':
"import { a as e } from './chunk-9db0917b.js';\n\nconst num2 = 2;\n\nconst out = num2 + e;\n\nexport { out };\n",
'chunk-9db0917b.js': 'const num3 = 3;\n\nexport { num3 as a };\n',
'f.js': 'function foo() {}\n\nexport { foo };\n',
'a.js': "import { n as num3 } from './e-0f663cdb.js';\n\nconst num1 = 1;\n\nconst out = num1 + num3;\n\nexport { out };\n",
'b.js': "import { n as num3 } from './e-0f663cdb.js';\n\nconst num2 = 2;\n\nconst out = num2 + num3;\n\nexport { out };\n",
'e-0f663cdb.js': "const num3 = 3;\n\nexport { num3 as n };\n",
'f.js': "function foo() {}\n\nexport { foo };\n"
},
});

Expand All @@ -641,22 +627,19 @@ export default two;
output.changes(),
{
'chunks/b.js': 'change',
'chunks/chunk-2f73092a.js': 'create',
'chunks/f.js': 'change',
'chunks/d-ebe94d27.js': 'create',
'chunks/f.js': 'change'
},
'only the entry point affected by the change should change',
);

assert.deepEqual(output.read(), {
chunks: {
'a.js':
"import { a as e } from './chunk-9db0917b.js';\n\nconst num1 = 1;\n\nconst out = num1 + e;\n\nexport { out };\n",
'b.js':
"import { a as e } from './chunk-9db0917b.js';\nimport { a as d } from './chunk-2f73092a.js';\n\nconst out = d + e;\n\nexport { out };\n",
'chunk-2f73092a.js':
'const num2 = 2; const foo = "bar";\n\nexport { num2 as a, foo as b };\n',
'chunk-9db0917b.js': 'const num3 = 3;\n\nexport { num3 as a };\n',
'f.js': "export { b as foo } from './chunk-2f73092a.js';\n",
'a.js': "import { n as num3 } from './e-0f663cdb.js';\n\nconst num1 = 1;\n\nconst out = num1 + num3;\n\nexport { out };\n",
'b.js': "import { n as num2 } from './d-ebe94d27.js';\nimport { n as num3 } from './e-0f663cdb.js';\n\nconst out = num2 + num3;\n\nexport { out };\n",
"d-ebe94d27.js": "const num2 = 2; const foo = \"bar\";\n\nexport { foo as f, num2 as n };\n",
'e-0f663cdb.js': "const num3 = 3;\n\nexport { num3 as n };\n",
'f.js': "export { f as foo } from './d-ebe94d27.js';\n"
},
});

Expand All @@ -670,21 +653,19 @@ export default two;
assert.deepEqual(
output.changes(),
{
'chunks/d-ebe94d27.js': 'unlink',
'chunks/b.js': 'change',
'chunks/chunk-2f73092a.js': 'unlink',
'chunks/f.js': 'change',
'chunks/f.js': 'change'
},
'only the entry point affected by the change should change',
);

assert.deepEqual(output.read(), {
chunks: {
'a.js':
"import { a as e } from './chunk-9db0917b.js';\n\nconst num1 = 1;\n\nconst out = num1 + e;\n\nexport { out };\n",
'b.js':
"import { a as e } from './chunk-9db0917b.js';\n\nconst num2 = 2;\n\nconst out = num2 + e;\n\nexport { out };\n",
'chunk-9db0917b.js': 'const num3 = 3;\n\nexport { num3 as a };\n',
'f.js': 'function foo() {}\n\nexport { foo };\n',
'a.js': "import { n as num3 } from './e-0f663cdb.js';\n\nconst num1 = 1;\n\nconst out = num1 + num3;\n\nexport { out };\n",
'b.js': "import { n as num3 } from './e-0f663cdb.js';\n\nconst num2 = 2;\n\nconst out = num2 + num3;\n\nexport { out };\n",
'e-0f663cdb.js': "const num3 = 3;\n\nexport { num3 as n };\n",
'f.js': "function foo() {}\n\nexport { foo };\n"
},
});
});
Expand Down
Loading