Skip to content

Commit c65fea1

Browse files
author
Joel Denning
authored
upgrade dependencies (#25)
* upgrade dependencies * Self review * Remove duplicate typescript declaration generation * Update build * Upgrade lock file
1 parent 9e2c03c commit c65fea1

File tree

11 files changed

+4375
-4555
lines changed

11 files changed

+4375
-4555
lines changed

.eslintrc

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

.github/workflows/build-and-test.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v2
13-
- uses: actions/setup-node@v2
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
1414
with:
15-
node-version: "15"
16-
- uses: pnpm/[email protected]
17-
with:
18-
version: 5.14.1
15+
node-version: "22"
16+
- uses: pnpm/action-setup@v4
1917
- run: pnpm install --frozen-lockfile
2018
- run: pnpm test
2119
- run: pnpm run build

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm exec pretty-quick --staged && pnpm exec concurrently pnpm:lint pnpm:test

ExposeRuntimeCssAssetsPlugin.cjs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ExposedCssRuntimeModule extends RuntimeModule {
1515
return Template.asString(
1616
`${RuntimeGlobals.require}.cssAssets = ${JSON.stringify([
1717
this.chunk.id,
18-
])};`
18+
])};`,
1919
);
2020
}
2121
}
@@ -34,7 +34,7 @@ module.exports = class ExposeRuntimeCssAssetsPlugin {
3434
compilation.hooks.contentHash.tap(pluginName, (chunk) => {
3535
const modules = chunkGraph.getChunkModulesIterableBySourceType(
3636
chunk,
37-
MODULE_TYPE
37+
MODULE_TYPE,
3838
);
3939

4040
if (modules) {
@@ -68,15 +68,12 @@ module.exports = class ExposeRuntimeCssAssetsPlugin {
6868
const { outputOptions, chunkGraph } = compilation;
6969
const modules = chunkGraph.getChunkModulesIterableBySourceType(
7070
chunk,
71-
MODULE_TYPE
71+
MODULE_TYPE,
7272
);
7373

7474
if (modules) {
75-
const {
76-
hashFunction,
77-
hashDigest,
78-
hashDigestLength,
79-
} = outputOptions;
75+
const { hashFunction, hashDigest, hashDigestLength } =
76+
outputOptions;
8077
const hash = webpack.util.createHash(hashFunction);
8178

8279
for (const m of modules) {
@@ -99,12 +96,12 @@ module.exports = class ExposeRuntimeCssAssetsPlugin {
9996
(referencedChunk) => {
10097
return this.options.filename;
10198
},
102-
true
103-
)
99+
true,
100+
),
104101
);
105102
compilation.addRuntimeModule(
106103
chunk,
107-
new ExposedCssRuntimeModule()
104+
new ExposedCssRuntimeModule(),
108105
);
109106
}
110107
}

eslint.config.mjs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import babelParser from "babel-eslint";
2+
import path from "node:path";
3+
import { fileURLToPath } from "node:url";
4+
import js from "@eslint/js";
5+
import { FlatCompat } from "@eslint/eslintrc";
6+
7+
const __filename = fileURLToPath(import.meta.url);
8+
const __dirname = path.dirname(__filename);
9+
const compat = new FlatCompat({
10+
baseDirectory: __dirname,
11+
recommendedConfig: js.configs.recommended,
12+
allConfig: js.configs.all,
13+
});
14+
15+
export default [
16+
...compat.extends("ts-important-stuff"),
17+
{
18+
languageOptions: {
19+
parser: babelParser,
20+
},
21+
},
22+
// https://github.com/eslint/rewrite/tree/main/packages/migrate-config#--ext
23+
{
24+
files: ["**/*.ts"],
25+
},
26+
];

jest.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
export default {
1+
/** @type {import('jest').Config} */
2+
const config = {
3+
testEnvironment: "jsdom",
24
setupFilesAfterEnv: ["<rootDir>/src/jest-setup.js"],
35
};
6+
7+
export default config;

package.json

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,17 @@
44
"description": "Lifecycle helpers for loading CSS",
55
"type": "module",
66
"main": "lib/esm/single-spa-css.min.js",
7-
"types": "lib/types/single-spa-css.d.ts",
7+
"types": "lib/esm/single-spa-css.d.ts",
88
"scripts": {
99
"test": "jest",
1010
"clean": "rimraf lib",
11-
"build": "pnpm run clean && concurrently pnpm:build:*",
11+
"build": "pnpm run clean && rollup -c",
1212
"prepublishOnly": "pnpm run build",
1313
"check-format": "prettier --check .",
14-
"build:code": "rollup -c",
1514
"watch:build": "rollup -cw",
16-
"build:types": "tsc",
1715
"format": "prettier --write .",
18-
"lint": "eslint src --ext ts"
19-
},
20-
"husky": {
21-
"hooks": {
22-
"pre-commit": "pretty-quick --staged && concurrently pnpm:lint pnpm:test"
23-
}
16+
"lint": "eslint src",
17+
"prepare": "husky"
2418
},
2519
"files": [
2620
"lib",
@@ -40,28 +34,30 @@
4034
"@babel/core": "^7.12.10",
4135
"@babel/preset-env": "^7.12.11",
4236
"@babel/preset-typescript": "^7.12.7",
43-
"@rollup/plugin-typescript": "^8.1.0",
44-
"@testing-library/dom": "^7.29.4",
45-
"@testing-library/jest-dom": "^5.11.9",
46-
"@types/jest": "^26.0.20",
47-
"babel-eslint": "^11.0.0-beta.2",
48-
"babel-jest": "^26.6.3",
49-
"concurrently": "^5.3.0",
50-
"eslint": "^7.19.0",
37+
"@rollup/plugin-typescript": "^12.1.2",
38+
"@testing-library/dom": "^10.4.0",
39+
"@testing-library/jest-dom": "^6.6.3",
40+
"@types/jest": "^29.5.14",
41+
"babel-eslint": "11.0.0-beta.2",
42+
"babel-jest": "^29.7.0",
43+
"concurrently": "^9.1.2",
44+
"eslint": "^9.19.0",
5145
"eslint-config-ts-important-stuff": "^1.1.0",
52-
"husky": "^4.3.8",
53-
"jest": "^26.6.3",
54-
"jest-cli": "^26.6.3",
55-
"prettier": "^2.2.1",
56-
"pretty-quick": "^3.1.0",
57-
"rimraf": "^3.0.2",
58-
"rollup": "^2.37.1",
46+
"husky": "^9.1.7",
47+
"jest": "^29.7.0",
48+
"jest-cli": "^29.7.0",
49+
"jest-environment-jsdom": "^29.7.0",
50+
"prettier": "^3.4.2",
51+
"pretty-quick": "^4.0.0",
52+
"rimraf": "^6.0.1",
53+
"rollup": "^4.32.0",
5954
"rollup-plugin-terser": "^7.0.2",
60-
"single-spa": "^5.9.0",
55+
"single-spa": "^6.0.3",
6156
"tslib": "^2.1.0",
62-
"typescript": "^4.1.3"
57+
"typescript": "^5.7.3"
6358
},
6459
"dependencies": {
6560
"@types/webpack-env": "^1.16.0"
66-
}
61+
},
62+
"packageManager": "[email protected]"
6763
}

0 commit comments

Comments
 (0)