Skip to content

Commit 8105f81

Browse files
committed
Upgrade dependencies of the widget package
1 parent 094714f commit 8105f81

File tree

18 files changed

+825
-2928
lines changed

18 files changed

+825
-2928
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ build/Release
4040
# Dependency directories
4141
node_modules/
4242
jspm_packages/
43+
tmp/
4344

4445
# TypeScript v1 declaration files
4546
typings/

packages/push/rollup.test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import config from './rollup.config.js';
2+
import multi from '@rollup/plugin-multi-entry';
3+
import mocha from 'rollup-plugin-mocha';
4+
5+
export default {
6+
input: {
7+
include: ['test/index.js', 'test/channel.js'],
8+
},
9+
output: {
10+
file: 'tmp/test.cjs',
11+
format: 'cjs',
12+
},
13+
plugins: [
14+
...config.plugins,
15+
multi(),
16+
mocha({
17+
cache: true,
18+
}),
19+
],
20+
};

packages/widget/.babelrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/widget/.eslintrc.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

packages/widget/.mocharc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extension": ["js"],
3+
"package": "./package.json",
4+
"require": ["@babel/register", "test/helper.js"],
5+
"recursive": true,
6+
"colors": true
7+
}

packages/widget/.prettierrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export default {
2+
overrides: [
3+
{
4+
files: '*.{js,ts,mjs,mts,cjs,cts}',
5+
options: {
6+
singleQuote: true,
7+
trailingComma: 'es5',
8+
printWidth: 120,
9+
},
10+
}
11+
],
12+
};

packages/widget/babel.config.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": ["@babel/preset-env"],
3+
"plugins": ["@babel/plugin-transform-runtime"],
4+
"generatorOpts": { "importAttributesKeyword": "with" }
5+
}

packages/widget/eslint.config.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import globals from 'globals';
2+
3+
import js from '@eslint/js';
4+
import prettier from 'eslint-plugin-prettier/recommended';
5+
6+
import babelParser from '@babel/eslint-parser';
7+
8+
export default [
9+
js.configs.recommended,
10+
prettier,
11+
{
12+
languageOptions: {
13+
globals: {
14+
...globals.node,
15+
...globals.mocha,
16+
window: 'readonly',
17+
document: 'readonly',
18+
},
19+
20+
parser: babelParser,
21+
ecmaVersion: 2018,
22+
sourceType: 'module',
23+
},
24+
},
25+
{
26+
linterOptions: {
27+
reportUnusedDisableDirectives: 'error',
28+
},
29+
},
30+
{
31+
ignores: ['node_modules', 'dist', '!**/.*'],
32+
},
33+
];

packages/widget/package.json

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"author": "Benedikt Deicke <[email protected]>",
66
"homepage": "https://github.com/userlist/userlist-javascript",
77
"license": "MIT",
8+
"type": "module",
89
"main": "dist/index.cjs.js",
910
"module": "dist/index.esm.js",
1011
"files": [
@@ -13,6 +14,12 @@
1314
"src",
1415
"test"
1516
],
17+
"exports": {
18+
".": {
19+
"import": "./dist/index.esm.js",
20+
"require": "./dist/index.cjs.js"
21+
}
22+
},
1623
"publishConfig": {
1724
"access": "public"
1825
},
@@ -24,7 +31,7 @@
2431
"lint": "eslint src test",
2532
"build": "rollup -c",
2633
"serve": "rollup -c rollup.serve.js",
27-
"test": "mocha --require ignore-styles --require test/helper --require @babel/register --recursive --colors",
34+
"test": "rollup -c rollup.test.js",
2835
"test:watch": "pnpm test --watch",
2936
"prepublish": "pnpm lint && pnpm test && pnpm build"
3037
},
@@ -33,24 +40,36 @@
3340
},
3441
"devDependencies": {
3542
"@babel/core": "^7.9.0",
43+
"@babel/eslint-parser": "^7.26.10",
3644
"@babel/plugin-transform-runtime": "^7.9.0",
3745
"@babel/preset-env": "^7.9.0",
3846
"@babel/register": "^7.9.0",
3947
"@babel/runtime": "^7.9.2",
40-
"@rollup/plugin-commonjs": "^11.0.2",
41-
"@rollup/plugin-node-resolve": "^7.1.1",
42-
"autoprefixer": "^9.7.5",
43-
"chai": "^4.2.0",
44-
"eslint": "6.8.0",
48+
"@eslint/js": "^9.22.0",
49+
"@rollup/plugin-babel": "^6.0.0",
50+
"@rollup/plugin-commonjs": "^28.0.0",
51+
"@rollup/plugin-node-resolve": "^16.0.0",
52+
"autoprefixer": "^10.0.0",
53+
"chai": "^5.0.0",
54+
"eslint": "^9.0.0",
55+
"eslint-config-prettier": "^10.1.1",
56+
"eslint-plugin-prettier": "^5.2.3",
57+
"globals": "^16.0.0",
4558
"ignore-styles": "^5.0.1",
46-
"jsdom": "^16.2.1",
47-
"mocha": "^7.1.1",
59+
"jsdom": "^26.0.0",
60+
"mocha": "^11.0.0",
61+
"postcss": "^8.5.3",
4862
"postcss-initial": "^3.0.2",
49-
"rollup": "^2.2.0",
50-
"rollup-plugin-babel": "^4.4.0",
51-
"rollup-plugin-postcss": "^2.5.0",
52-
"rollup-plugin-serve": "^1.0.1",
53-
"sinon": "^9.0.1",
54-
"sinon-chai": "^3.5.0"
63+
"prettier": "^3.5.3",
64+
"rollup": "^4.0.0",
65+
"rollup-plugin-import-css": "^3.5.8",
66+
"rollup-plugin-mocha": "^0.0.1",
67+
"rollup-plugin-postcss": "^4.0.0",
68+
"rollup-plugin-serve": "^3.0.0",
69+
"sinon": "^19.0.0",
70+
"sinon-chai": "^4.0.0"
71+
},
72+
"dependencies": {
73+
"@rollup/plugin-multi-entry": "^6.0.1"
5574
}
5675
}

packages/widget/rollup.config.js

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,35 @@
1-
import babel from 'rollup-plugin-babel';
2-
import postcss from 'rollup-plugin-postcss';
3-
1+
import babel from '@rollup/plugin-babel';
42
import resolve from '@rollup/plugin-node-resolve';
53
import commonjs from '@rollup/plugin-commonjs';
4+
import postcss from 'rollup-plugin-postcss';
65

76
import autoprefixer from 'autoprefixer';
87
import initial from 'postcss-initial';
98

10-
import pkg from './package.json';
9+
import pkg from './package.json' with { type: 'json' };
1110

1211
export default {
1312
input: 'src/index.js',
1413
output: [
1514
{
1615
file: pkg.main,
17-
format: 'cjs'
16+
format: 'cjs',
1817
},
1918
{
2019
file: pkg.module,
21-
format: 'esm'
22-
}
20+
format: 'esm',
21+
},
2322
],
2423
plugins: [
2524
resolve(),
2625
babel({
27-
runtimeHelpers: true
26+
babelHelpers: 'runtime',
2827
}),
2928
commonjs(),
3029
postcss({
3130
inject: false,
3231
minimize: true,
33-
plugins: [
34-
autoprefixer,
35-
initial
36-
]
37-
})
38-
]
32+
plugins: [autoprefixer, initial],
33+
}),
34+
],
3935
};

0 commit comments

Comments
 (0)