Skip to content

Commit

Permalink
[v2.0.0] Update minimum required Node version to 10 (#3346)
Browse files Browse the repository at this point in the history
* Update CI to only run on Node 10 and 12, add engines to package.json

* Update TypeScript target

* Remove Bublé as a transpilation option from tests (it is still needed in sourcemap tests)

* Remove minNodeVersion form tests

* Reformat package.json
  • Loading branch information
lukastaegert committed Jan 20, 2020
1 parent 56cbbdc commit 72f1ade
Show file tree
Hide file tree
Showing 39 changed files with 61 additions and 212 deletions.
29 changes: 0 additions & 29 deletions .circleci/config.yml
Expand Up @@ -9,15 +9,6 @@ unit_tests: &unit_tests
name: Run unit tests.
command: npm run ci:test

unit_tests_12: &unit_tests_12
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Run unit tests.
command: npm run ci:test_12

jobs:
analysis:
docker:
Expand All @@ -39,14 +30,6 @@ jobs:
key: dependency-cache-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
node-v6-latest:
docker:
- image: rollupcabal/circleci-node-v6:latest
<<: *unit_tests
node-v8-latest:
docker:
- image: rollupcabal/circleci-node-v8:latest
<<: *unit_tests
node-v10-latest:
docker:
- image: rollupcabal/circleci-node-v10:latest
Expand All @@ -70,18 +53,6 @@ workflows:
filters:
tags:
only: /.*/
- node-v6-latest:
requires:
- analysis
filters:
tags:
only: /.*/
- node-v8-latest:
requires:
- analysis
filters:
tags:
only: /.*/
- node-v10-latest:
requires:
- analysis
Expand Down
35 changes: 15 additions & 20 deletions .github/workflows/node-windows.yml
Expand Up @@ -4,30 +4,25 @@ on: [push]

jobs:
build:

runs-on: windows-2019

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

name: ${{ matrix.node }} (Windows)
steps:
- name: Configure git line-breaks
run: git config --global core.autocrlf false
- name: Checkout Commit
uses: actions/checkout@v1
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Check npm version
# This is only necessary until we dump Node 6
run: if [ ${{ matrix.node }} -lt 8 ]; then npm i npm@5 -g; fi;
shell: bash
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Run tests
run: npm test
env:
CI: true
- name: Configure git line-breaks
run: git config --global core.autocrlf false
- name: Checkout Commit
uses: actions/checkout@v1
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Run tests
run: npm test
env:
CI: true
65 changes: 1 addition & 64 deletions LICENSE.md
Expand Up @@ -25,7 +25,7 @@ THE SOFTWARE.

# Licenses of bundled dependencies
The published Rollup artifact additionally contains code with the following licenses:
MIT, ISC, Apache-2.0
MIT, ISC

# Bundled dependencies:
## acorn-export-ns-from
Expand Down Expand Up @@ -489,69 +489,6 @@ Repository: git+https://github.com/micromatch/to-regex-range.git
---------------------------------------

## tslib
License: Apache-2.0
By: Microsoft Corp.
Repository: https://github.com/Microsoft/tslib.git

> Apache License
>
> Version 2.0, January 2004
>
> http://www.apache.org/licenses/
>
> TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
>
> 1. Definitions.
>
> "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
>
> "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
>
> "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
>
> "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
>
> "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
>
> "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
>
> "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
>
> "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
>
> "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
>
> "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
>
> 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
>
> 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
>
> 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
>
> You must give any other recipients of the Work or Derivative Works a copy of this License; and
>
> You must cause any modified files to carry prominent notices stating that You changed the files; and
>
> You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
>
> If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
>
> 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
>
> 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
>
> 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
>
> 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
>
> 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
>
> END OF TERMS AND CONDITIONS
---------------------------------------

## turbocolor
License: MIT
By: Jorge Bucaran
Expand Down
11 changes: 5 additions & 6 deletions package.json
Expand Up @@ -54,15 +54,11 @@
"optimizer"
],
"author": "Rich Harris",
"contributors": [
"Oskar Segersvärd <victorystick@gmail.com>",
"Bogdan Chadkin <trysound@yandex.ru>"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/rollup/rollup/issues"
},
"homepage": "https://github.com/rollup/rollup",
"homepage": "https://rollupjs.org/",
"dependencies": {
"@types/estree": "*",
"@types/node": "*",
Expand Down Expand Up @@ -135,5 +131,8 @@
"dist/**/*.js",
"dist/*.d.ts",
"dist/bin/rollup"
]
],
"engines": {
"node": ">=10.0.0"
}
}
2 changes: 1 addition & 1 deletion src/utils/defaultPlugin.ts
Expand Up @@ -34,7 +34,7 @@ function findFile(file: string, preserveSymlinks: boolean): string | void {

if (files.indexOf(name) !== -1) return file;
}
} catch (err) {
} catch {
// suppress
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/watch/chokidar.ts
Expand Up @@ -5,7 +5,7 @@ let chokidar: typeof chokidarType;

try {
chokidar = relative('chokidar', process.cwd());
} catch (err) {
} catch {
chokidar = null as any;
}

Expand Down
7 changes: 0 additions & 7 deletions test/cli/index.js
@@ -1,7 +1,6 @@
const path = require('path');
const assert = require('assert');
const sander = require('sander');
const buble = require('buble');
const { exec } = require('child_process');
const {
normaliseOutput,
Expand Down Expand Up @@ -55,12 +54,6 @@ runTestSuiteWithSamples(

if (config.execute) {
try {
if (config.buble) {
code = buble.transform(code, {
transforms: { modules: false }
}).code;
}

const fn = new Function('require', 'module', 'exports', 'assert', code);
const module = {
exports: {}
Expand Down
11 changes: 0 additions & 11 deletions test/function/index.js
@@ -1,6 +1,5 @@
const path = require('path');
const assert = require('assert');
const buble = require('buble');
const rollup = require('../../dist/rollup');
const { compareError, compareWarnings, extend, runTestSuiteWithSamples } = require('../utils.js');

Expand Down Expand Up @@ -104,16 +103,6 @@ runTestSuiteWithSamples('function', path.resolve(__dirname, 'samples'), (dir, co
if (unintendedError) throw unintendedError;
if (config.error || config.generateError) return;

if (config.buble) {
for (const chunk of result) {
if (chunk.code) {
chunk.code = buble.transform(chunk.code, {
transforms: { modules: false }
}).code;
}
}
}

const codeMap = result.reduce((codeMap, chunk) => {
codeMap[chunk.fileName] = chunk.code;
return codeMap;
Expand Down
@@ -1,4 +1,3 @@
module.exports = {
description: 'allows unknown binary operators',
buble: true
description: 'allows unknown binary operators'
};
3 changes: 1 addition & 2 deletions test/function/samples/assignment-patterns/_config.js
@@ -1,4 +1,3 @@
module.exports = {
description: 'allows reassigments to default parameters that shadow imports',
buble: true
description: 'allows reassigments to default parameters that shadow imports'
};
@@ -1,4 +1,3 @@
module.exports = {
description: 'arrow function without braces returning a function (#1032)',
buble: true
description: 'arrow function without braces returning a function (#1032)'
};
3 changes: 1 addition & 2 deletions test/function/samples/class-methods-not-renamed/_config.js
Expand Up @@ -2,6 +2,5 @@ module.exports = {
description: 'does not rename class methods incorrectly',
options: {
external: ['path']
},
buble: true
}
};
3 changes: 1 addition & 2 deletions test/function/samples/custom-iterator-2/_config.js
@@ -1,4 +1,3 @@
module.exports = {
description: 'handles manually defined iterators',
minNodeVersion: 6
description: 'handles manually defined iterators'
};
3 changes: 1 addition & 2 deletions test/function/samples/custom-iterator/_config.js
@@ -1,4 +1,3 @@
module.exports = {
description: 'handles manually defined iterators',
minNodeVersion: 6
description: 'handles manually defined iterators'
};
1 change: 0 additions & 1 deletion test/function/samples/cycles-pathological-2/_config.js
@@ -1,6 +1,5 @@
module.exports = {
description: 'resolves even more pathological cyclical dependencies gracefully',
buble: true,
warnings: [
{
code: 'CIRCULAR_DEPENDENCY',
Expand Down
10 changes: 5 additions & 5 deletions test/function/samples/cycles-pathological-2/b.js
Expand Up @@ -3,9 +3,9 @@ import { d, dv } from './d';
import { c, cv } from './c';

export function b() {
a(av);
d(dv);
c(cv);
};
a(av);
d(dv);
c(cv);
}

export const bv = av + dv + cv;
export var bv = av + dv + cv;
8 changes: 4 additions & 4 deletions test/function/samples/cycles-pathological-2/c.js
Expand Up @@ -2,8 +2,8 @@ import { b, bv } from './b';
import { a, av } from './main';

export function c() {
a(av);
b(bv);
};
a(av);
b(bv);
}

export const cv = av + bv;
export var cv = av + bv;
6 changes: 3 additions & 3 deletions test/function/samples/cycles-pathological-2/d.js
@@ -1,7 +1,7 @@
import { c, cv } from './c';

export function d() {
c(cv);
};
c(cv);
}

export const dv = cv;
export var dv = cv;
10 changes: 5 additions & 5 deletions test/function/samples/cycles-pathological-2/main.js
Expand Up @@ -3,9 +3,9 @@ import { d, dv } from './d';
import { c, cv } from './c';

export function a() {
b(bv);
d(dv);
c(cv);
};
b(bv);
d(dv);
c(cv);
}

export const av = bv + dv + cv;
export var av = bv + dv + cv;
3 changes: 1 addition & 2 deletions test/function/samples/deconflicts-classes/_config.js
@@ -1,4 +1,3 @@
module.exports = {
description: 'deconflicts top-level classes',
buble: true
description: 'deconflicts top-level classes'
};
Expand Up @@ -2,7 +2,6 @@ const assert = require('assert');

module.exports = {
description: 'allows destructuring in exported variable declarations, synthetic or otherwise',
buble: true,
exports(exports) {
assert.equal(exports.a, 1);
assert.equal(exports.d, 4);
Expand Down
@@ -1,4 +1,3 @@
module.exports = {
description: 'correctly deshadows destructured function parameters (#1008)',
buble: true
description: 'correctly deshadows destructured function parameters (#1008)'
};
1 change: 0 additions & 1 deletion test/function/samples/export-destruction/_config.js
Expand Up @@ -2,7 +2,6 @@ const assert = require('assert');

module.exports = {
description: 'handle destruction patterns in export declarations',
buble: true,

exports(exports) {
assert.deepEqual(Object.keys(exports), ['baz', 'quux']);
Expand Down
@@ -1,4 +1,3 @@
module.exports = {
description: 'handles properties created by an object rest spread operator',
minNodeVersion: 8
description: 'handles properties created by an object rest spread operator'
};

0 comments on commit 72f1ade

Please sign in to comment.