Skip to content
This repository was archived by the owner on May 19, 2023. It is now read-only.

Commit 83391ba

Browse files
committed
build: drop legacy support
1 parent 88f5a65 commit 83391ba

File tree

4 files changed

+24
-35
lines changed

4 files changed

+24
-35
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@
5353
"@babel/preset-typescript": "^7.12.7",
5454
"@commitlint/cli": "^12.1.1",
5555
"@commitlint/config-conventional": "^12.1.1",
56-
"@rollup/plugin-babel": "^5.2.2",
5756
"@rollup/plugin-beep": "^0.2.0",
5857
"@rollup/plugin-commonjs": "19.0.0",
58+
"@rollup/plugin-eslint": "^8.0.1",
5959
"@rollup/plugin-node-resolve": "11.2.0",
6060
"@rollup/plugin-strip": "^2.0.0",
6161
"@testing-library/dom": "^7.28.1",

rollup.config.js

+11-22
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,19 @@ import resolve from '@rollup/plugin-node-resolve';
33
import commonjs from '@rollup/plugin-commonjs';
44
import { terser } from 'rollup-plugin-terser';
55
import filesize from 'rollup-plugin-filesize';
6-
import babel from '@rollup/plugin-babel';
6+
import eslint from '@rollup/plugin-eslint';
77
import strip from '@rollup/plugin-strip';
88
import beep from '@rollup/plugin-beep';
99

1010
const name = 'Lucia';
11-
const legacy = () => {
12-
return babel({
13-
extensions: ['.ts'],
14-
babelHelpers: 'bundled',
15-
include: ['src/**/*'],
16-
});
17-
};
1811

1912
const generateConfig = (input, config) => ({
2013
input,
2114
external: [],
2215
plugins: [
16+
eslint(),
2317
commonjs(),
2418
resolve({ extensions: ['.ts'] }),
25-
filesize({
26-
showBrotliSize: true,
27-
showMinifiedSize: false,
28-
showGzippedSize: false,
29-
}),
3019
typescript({
3120
useTsconfigDeclarationDir: true,
3221
typescript: require('ttypescript'),
@@ -45,7 +34,6 @@ const generateConfig = (input, config) => ({
4534
include: '**/*.(ts)',
4635
}),
4736
beep(),
48-
config.legacy ? legacy() : undefined,
4937
],
5038
output: config.output,
5139
onwarn: () => {},
@@ -67,15 +55,22 @@ export const build = (input, config) => {
6755
buildOutput.push({
6856
file: config.output[1],
6957
format: config.format,
70-
plugins: [terser({ format: { comments: false } })],
58+
plugins: [
59+
terser(),
60+
filesize({
61+
showBrotliSize: true,
62+
showMinifiedSize: false,
63+
showBeforeSizes: 'release',
64+
showGzippedSize: false,
65+
}),
66+
],
7167
name,
7268
globals: {},
7369
strict: true,
7470
});
7571

7672
return generateConfig(input, {
7773
output: buildOutput,
78-
legacy: config.legacy,
7974
target: config.target,
8075
});
8176
};
@@ -96,10 +91,4 @@ export default [
9691
format: 'cjs',
9792
target: 'es2018',
9893
}),
99-
build('./src/index.ts', {
100-
output: ['dist/legacy/lucia.cjs.js', 'dist/legacy/lucia.cjs.min.js'],
101-
format: 'cjs',
102-
target: 'es5',
103-
legacy: true,
104-
}),
10594
];

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@
2727
"strict": true
2828
},
2929
"include": ["./src/**/*.ts"],
30-
"exclude": ["node_modules", "build", "dist", "src/**/*.js", "src/**/*.spec.ts"]
30+
"exclude": ["node_modules", "dist", "src/**/*.js", "src/**/*.spec.ts"]
3131
}

yarn.lock

+11-11
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
dependencies:
149149
"@babel/types" "^7.13.12"
150150

151-
"@babel/helper-module-imports@^7.10.4", "@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.13.12":
151+
"@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.13.12":
152152
version "7.13.12"
153153
resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz#c6a369a6f3621cb25da014078684da9196b61977"
154154
integrity sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==
@@ -1347,14 +1347,6 @@
13471347
node-gyp "^7.1.0"
13481348
read-package-json-fast "^2.0.1"
13491349

1350-
"@rollup/plugin-babel@^5.2.2":
1351-
version "5.3.0"
1352-
resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.3.0.tgz#9cb1c5146ddd6a4968ad96f209c50c62f92f9879"
1353-
integrity sha512-9uIC8HZOnVLrLHxayq/PTzw+uS25E14KPUBh5ktF+18Mjo5yK0ToMMx6epY0uEgkjwJw0aBW4x2horYXh8juWw==
1354-
dependencies:
1355-
"@babel/helper-module-imports" "^7.10.4"
1356-
"@rollup/pluginutils" "^3.1.0"
1357-
13581350
"@rollup/plugin-beep@^0.2.0":
13591351
version "0.2.0"
13601352
resolved "https://registry.yarnpkg.com/@rollup/plugin-beep/-/plugin-beep-0.2.0.tgz#5c210555cd4acb22549bfc29bc3ea3e07182d846"
@@ -1373,6 +1365,14 @@
13731365
magic-string "^0.25.7"
13741366
resolve "^1.17.0"
13751367

1368+
"@rollup/plugin-eslint@^8.0.1":
1369+
version "8.0.1"
1370+
resolved "https://registry.yarnpkg.com/@rollup/plugin-eslint/-/plugin-eslint-8.0.1.tgz#bf7462f96027613729b8a805caaa951dc23c333e"
1371+
integrity sha512-rTMAY4tKGBdbkHHQDaVhXNJg9tRmW7ihRAg7NQHiPUv13NFYBygIr+OYgpVNwSnGOH146BgCITSBAoMxMQGPTQ==
1372+
dependencies:
1373+
"@rollup/pluginutils" "^4.0.0"
1374+
eslint "^7.12.0"
1375+
13761376
"@rollup/plugin-node-resolve@11.2.0":
13771377
version "11.2.0"
13781378
resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.0.tgz#a5ab88c35bb7622d115f44984dee305112b6f714"
@@ -1403,7 +1403,7 @@
14031403
estree-walker "^1.0.1"
14041404
picomatch "^2.2.2"
14051405

1406-
"@rollup/pluginutils@^4.1.0":
1406+
"@rollup/pluginutils@^4.0.0", "@rollup/pluginutils@^4.1.0":
14071407
version "4.1.0"
14081408
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.1.0.tgz#0dcc61c780e39257554feb7f77207dceca13c838"
14091409
integrity sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ==
@@ -2878,7 +2878,7 @@ eslint-visitor-keys@^2.0.0:
28782878
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303"
28792879
integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==
28802880

2881-
eslint@^7.24.0:
2881+
eslint@^7.12.0, eslint@^7.24.0:
28822882
version "7.26.0"
28832883
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.26.0.tgz#d416fdcdcb3236cd8f282065312813f8c13982f6"
28842884
integrity sha512-4R1ieRf52/izcZE7AlLy56uIHHDLT74Yzz2Iv2l6kDaYvEu9x+wMB5dZArVL8SYGXSYV2YAg70FcW5Y5nGGNIg==

0 commit comments

Comments
 (0)