Skip to content

Commit cb464dd

Browse files
committed
chore: Updated toolchain.
1 parent b1272a1 commit cb464dd

File tree

7 files changed

+86
-2401
lines changed

7 files changed

+86
-2401
lines changed

.github/workflows/ci.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,28 @@ jobs:
116116

117117
- name: Run lint command
118118
run: npm run lint
119+
120+
build-wasm:
121+
name: Build WebAssembly
122+
runs-on: ubuntu-latest
123+
steps:
124+
- name: Fetch code
125+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
126+
with:
127+
fetch-depth: 1
128+
129+
# Skip macOS & Windows, cache there is slower
130+
- name: Restore node_modules cache for Linux
131+
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
132+
if: runner.os == 'Linux'
133+
with:
134+
path: ~/.npm
135+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
136+
restore-keys: |
137+
${{ runner.os }}-node-
138+
139+
- name: Install dependencies
140+
run: npm ci --ignore-scripts
141+
142+
- name: Build WebAssembly
143+
run: npm run build-wasm

bin/generate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { dirname, resolve } from 'path';
66
import { CHeaders, HTTP } from '../src/llhttp';
77

88
// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
9-
// eslint-disable-next-line @stylistic/js/max-len
9+
// eslint-disable-next-line @stylistic/max-len
1010
const semverRE = /^(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
1111

1212
const C_FILE = resolve(__dirname, '../build/c/llhttp.c');

eslint.config.mjs

Lines changed: 33 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,47 @@
1-
import stylisticJs from '@stylistic/eslint-plugin-js'
2-
import eslint from '@eslint/js';
3-
import tseslint from 'typescript-eslint';
4-
import globals from 'globals';
1+
import eslint from "@eslint/js";
2+
import tseslint from "typescript-eslint";
3+
import stylistic from "@stylistic/eslint-plugin";
54

65
export default tseslint.config(
7-
{ ignores: ["build", "lib", "examples", "bench"] },
6+
{
7+
ignores: ["build", "lib", "examples", "bench", "eslint.config.mjs"]
8+
},
89
eslint.configs.recommended,
910
...tseslint.configs.recommended,
10-
...tseslint.configs.stylistic,
1111
{
12-
"languageOptions": {
13-
"parser": tseslint.parser,
14-
"parserOptions": {
15-
"lib": ["es2023"],
16-
"module": "commonjs",
17-
"moduleResolution": "node",
18-
"target": "es2022",
19-
20-
"strict": true,
21-
"esModuleInterop": true,
22-
"skipLibCheck": true,
23-
"include": [
24-
"bin/**/*.ts",
25-
"src/**/*.ts",
26-
"test/**/*.ts"
27-
],
28-
"outDir": "./lib",
29-
"declaration": true,
30-
"pretty": true,
31-
"sourceMap": true
32-
},
33-
"globals": {
34-
...globals.commonjs,
35-
...globals.node,
36-
...globals.es6
12+
languageOptions: {
13+
parser: tseslint.parser,
14+
parserOptions: {
15+
projectService: true
3716
},
3817
},
3918
},
4019
{
4120
plugins: {
42-
'@stylistic/js': stylisticJs
21+
"@stylistic": stylistic,
4322
},
44-
files: [
45-
"bin/**/*.ts",
46-
'bench/**/*.ts',
47-
'src/**/*.ts',
48-
'test/**/*.ts',
49-
],
23+
files: ["bin/**/*.ts", "bench/**/*.ts", "src/**/*.ts", "test/**/*.ts"],
5024
rules: {
51-
'@stylistic/js/max-len': [ 2, {
52-
'code': 120,
53-
'ignoreComments': true
54-
} ],
55-
"@stylistic/js/array-bracket-spacing": ["error", "always"],
56-
"@stylistic/js/operator-linebreak": ["error", "after"],
57-
"@stylistic/js/linebreak-style": ["error", "unix"],
58-
"@stylistic/js/brace-style": ["error", "1tbs", { "allowSingleLine": true }],
59-
'@stylistic/js/indent': ["error", 2, {
60-
"SwitchCase": 1,
61-
"FunctionDeclaration": { "parameters": "first" },
62-
"FunctionExpression": { "parameters": "first" }
63-
}],
64-
}
25+
"@stylistic/max-len": [
26+
2,
27+
{
28+
code: 120,
29+
ignoreComments: true,
30+
},
31+
],
32+
"@stylistic/array-bracket-spacing": ["error", "always"],
33+
"@stylistic/operator-linebreak": ["error", "after"],
34+
"@stylistic/linebreak-style": ["error", "unix"],
35+
"@stylistic/brace-style": ["error", "1tbs", { allowSingleLine: true }],
36+
"@stylistic/indent": [
37+
"error",
38+
2,
39+
{
40+
SwitchCase: 1,
41+
FunctionDeclaration: { parameters: "first" },
42+
FunctionExpression: { parameters: "first" },
43+
},
44+
],
45+
},
6546
}
6647
);

0 commit comments

Comments
 (0)