Skip to content

Commit 826d3cd

Browse files
committed
refactor: rebuild bundler impls, improve plugin loader, upgrade minimize plugin
1 parent f8bed8f commit 826d3cd

22 files changed

+947
-969
lines changed

.babelrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"useBuiltIns": false,
77
"exclude": ["transform-regenerator", "transform-async-to-generator"],
88
"targets": {
9-
"node": "7.10.1"
9+
"node": "16"
1010
}
1111
}]
1212
],

.eslintrc

+22-74
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,30 @@
11
{
2+
"root": true,
3+
"extends": [
4+
"eslint:recommended",
5+
"plugin:@typescript-eslint/recommended"
6+
],
7+
"parser": "@typescript-eslint/parser",
8+
"parserOptions": {
9+
"project": ["./tsconfig.json"]
10+
},
11+
"plugins": [
12+
"@typescript-eslint"
13+
],
214
"env": {
315
"browser": true,
416
"node": true,
517
"es6": true
618
},
7-
8-
"parserOptions": {
9-
"ecmaVersion": 2018,
10-
"sourceType": "module",
11-
"ecmaFeatures": {
12-
"arrowFunctions": true,
13-
"binaryLiterals": true,
14-
"blockBindings": true,
15-
"classes": true,
16-
"defaultParams": true,
17-
"destructuring": true,
18-
"forOf": true,
19-
"generators": true,
20-
"modules": true,
21-
"objectLiteralComputedProperties": true,
22-
"objectLiteralDuplicateProperties": true,
23-
"objectLiteralShorthandMethods": true,
24-
"objectLiteralShorthandProperties": true,
25-
"octalLiterals": true,
26-
"regexUFlag": true,
27-
"regexYFlag": true,
28-
"spread": true,
29-
"superInFunctions": true,
30-
"templateStrings": true,
31-
"unicodeCodePointEscapes": true,
32-
"globalReturn": true,
33-
"jsx": true
34-
}
35-
},
36-
3719
"rules": {
38-
39-
//
40-
//Possible Errors
41-
//
42-
// The following rules point out areas where you might have made mistakes.
43-
//
44-
"no-const-assign": 2, // disallow reassignment const variable
45-
"comma-dangle": 2, // disallow or enforce trailing commas
46-
"no-cond-assign": 0, // allow assignment in conditional expressions
47-
"no-console": 1, // disallow use of console (off by default in the node environment)
48-
"no-constant-condition": 2, // disallow use of constant expressions in conditions
49-
"no-control-regex": 2, // disallow control characters in regular expressions
50-
"no-debugger": 2, // disallow use of debugger
51-
"no-dupe-args": 2, // disallow duplicate arguments in functions
52-
"no-dupe-keys": 2, // disallow duplicate keys when creating object literals
53-
"no-duplicate-case": 2, // disallow a duplicate case label.
54-
"no-ex-assign": 2, // disallow assigning to the exception in a catch block
55-
"no-extra-boolean-cast": 2, // disallow double-negation boolean casts in a boolean context
56-
"no-extra-parens": 0, // disallow unnecessary parentheses (off by default)
57-
"no-extra-semi": 2, // disallow unnecessary semicolons
58-
"no-func-assign": 2, // disallow overwriting functions written as function declarations
59-
"no-inner-declarations": 2, // disallow function or variable declarations in nested blocks
60-
"no-invalid-regexp": 2, // disallow invalid regular expression strings in the RegExp constructor
61-
"no-irregular-whitespace": 2, // disallow irregular whitespace outside of strings and comments
62-
"no-negated-in-lhs": 2, // disallow negation of the left operand of an in expression
63-
"no-obj-calls": 2, // disallow the use of object properties of the global object (Math and JSON) as functions
64-
"no-regex-spaces": 2, // disallow multiple spaces in a regular expression literal
65-
"no-sparse-arrays": 2, // disallow sparse arrays
66-
"no-unreachable": 2, // disallow unreachable statements after a return, throw, continue, or break statement
67-
"use-isnan": 2, // disallow comparisons with the value NaN
68-
"valid-typeof": 2, // Ensure that the results of typeof are compared against a valid string
69-
70-
// Variables
71-
//
72-
// These rules have to do with variable declarations.
73-
//
74-
"no-catch-shadow": 2, // disallow the catch clause parameter name being the same as a variable in the outer scope (off by default in the node environment)
75-
"no-delete-var": 2, // disallow deletion of variables
76-
"no-label-var": 2, // disallow labels that share a name with a variable
77-
"no-shadow-restricted-names": 2, // disallow shadowing of names such as arguments
78-
"no-undef": 2, // disallow use of undeclared variables unless mentioned in a /*global */ block
79-
"no-undef-init": 2, // disallow use of undefined when initializing variables
80-
"no-unused-vars": 2 // disallow declaration of variables that are not used in the code
81-
}
20+
"@typescript-eslint/no-explicit-any": 0
21+
},
22+
"overrides": [
23+
{
24+
"files": ["*.ts"],
25+
"rules": {
26+
"no-undef": 0
27+
}
28+
}
29+
]
8230
}

.fssrc.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import progressPlugin from 'rollup-plugin-progress'
2-
import typescript from '@rollup/plugin-typescript'
3-
import eslint from '@rollup/plugin-eslint'
42

53
import { name, version, license, author, description, dependencies } from './package.json'
64

@@ -33,15 +31,15 @@ export default {
3331
entry: [
3432
{
3533
input: 'src/index.ts',
36-
plugins: [ 'resolve', [typescript], 'commonjs', /* eslint, */ progress ],
34+
plugins: [ 'resolve', 'typescript', 'commonjs', progress ],
3735
output: [
3836
{ file: 'lib/rollup-worker.js', format: 'cjs', banner: banner(name, true) },
3937
{ file: 'lib/rollup-worker.es.js', format: 'es', banner: banner(name, true) }
4038
]
4139
},
4240
{
4341
input: 'src/bin/cli.ts',
44-
plugins: [ 'resolve', [typescript], 'commonjs', /* eslint, */ progress ],
42+
plugins: [ 'resolve', 'typescript', 'commonjs', progress ],
4543
output: [
4644
{
4745
file: 'bin/cli.js',

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ module.exports = {
6969
buffer: false
7070
} : {}
7171
},
72-
minify: { // for terser
72+
minimize: { // for terser
7373
ie8: false
7474
},
7575
replace: {

package.json

+22-18
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rollup-worker",
3-
"version": "2.0.1",
3+
"version": "2.1.0",
44
"description": "Rollup worker for multiple entry bundle with customize distributes.",
55
"main": "lib/rollup-worker.js",
66
"module": "lib/rollup-worker.es.js",
@@ -19,59 +19,63 @@
1919
},
2020
"scripts": {
2121
"lint": "npm run lint:ts && npm run lint:js",
22-
"lint:ts": "tslint --project .",
22+
"lint:ts": "eslint --project .",
2323
"lint:js": "standard \"test/*.js\"",
24-
"lint:fix": "tslint --project . --fix && standard \"src/*.js\" --fix",
24+
"lint:fix": "eslint --project . --fix && standard \"src/*.js\" --fix",
2525
"build": "rb -c && chmod a+x bin/cli.js",
2626
"watch": "export NODE_ENV='development' && rb -c -w",
2727
"test": "npm run lint"
2828
},
2929
"author": "allex <[email protected]> (http://iallex.com/)",
3030
"license": "MIT",
3131
"dependencies": {
32-
"@allex/md5": "^1.0.4",
3332
"@allex/rollup-plugin-node-globals": "^0.0.2",
3433
"@babel/core": "^7.5.5",
35-
"@babel/plugin-proposal-class-properties": "7.5.5",
3634
"@babel/plugin-syntax-import-meta": "^7.10.4",
3735
"@babel/plugin-syntax-jsx": "^7.2.0",
3836
"@babel/plugin-transform-flow-strip-types": "^7.4.4",
3937
"@babel/plugin-transform-react-jsx": "^7.3.0",
4038
"@babel/preset-env": "^7.5.5",
4139
"@babel/preset-flow": "^7.0.0",
42-
"@rollup/plugin-babel": "^5",
43-
"@rollup/plugin-commonjs": "^19",
44-
"@rollup/plugin-eslint": "^8.0.1",
45-
"@rollup/plugin-node-resolve": "^13",
46-
"@rollup/plugin-replace": "^2",
40+
"@rollup/plugin-babel": "^6",
41+
"@rollup/plugin-commonjs": "^25",
42+
"@rollup/plugin-eslint": "^9",
43+
"@rollup/plugin-node-resolve": "^15",
44+
"@rollup/plugin-replace": "^5",
45+
"@rollup/plugin-terser": "^0.4.4",
4746
"@rollup/plugin-typescript": "^11",
4847
"autoprefixer": "^9",
4948
"babel-plugin-macros": "^2.7.0",
5049
"babel-plugin-transform-async-to-promises": "^0.8.15",
5150
"babel-plugin-transform-replace-expressions": "^0.2.0",
51+
"chokidar": "^3.5.3",
5252
"colorette": "^2.0.20",
53-
"cssnano": "^4",
53+
"cssnano": "^6",
5454
"debug": "^3.1.0",
5555
"postcss": "^8.x",
5656
"resolve-from": "^5.0.0",
5757
"rollup": "^2",
5858
"rollup-plugin-json5": "^1",
59-
"rollup-plugin-jspacker": "^1",
59+
"rollup-plugin-minimize": "^1",
6060
"rollup-plugin-node-builtins": "^2",
6161
"rollup-plugin-postcss": "^4",
62-
"rollup-plugin-progress": "^1"
62+
"rollup-plugin-progress": "^1",
63+
"typescript": "^5"
6364
},
6465
"devDependencies": {
6566
"@fdio/utils": "^1",
67+
"@types/node": "^20.9.0",
68+
"@typescript-eslint/eslint-plugin": "^6.11.0",
69+
"@typescript-eslint/parser": "^6.11.0",
6670
"ansi-escapes": "^3.1.0",
6771
"babel-plugin-alter-object-assign": "^1.0.2",
6872
"date-time": "^2.1.0",
73+
"eslint": "^8.53.0",
6974
"mkdirp": "^0.5.1",
70-
"pretty-bytes": "^5.1.0",
71-
"pretty-ms": "^3.1.0",
75+
"pretty-bytes": "^5",
76+
"pretty-ms": "^7",
7277
"signal-exit": "^3.0.2",
73-
"tslib": "^2",
74-
"tslint": "^5.12.1"
78+
"tslib": "^2"
7579
},
7680
"eslintIgnore": [
7781
"node_modules",
@@ -84,6 +88,6 @@
8488
"bin"
8589
],
8690
"engines": {
87-
"node": ">=7.10.1"
91+
"node": ">=16"
8892
}
8993
}

src/bin/alternateScreen.ts

-43
This file was deleted.

0 commit comments

Comments
 (0)