Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
31 changes: 21 additions & 10 deletions .github/workflows/build.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
name: Build
name: CI

on:
pull_request:
branches: [main]
push:
branches: [main]
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read

jobs:
build:
test:
name: Checks and tests
runs-on: ubuntu-latest
strategy:
Expand All @@ -19,12 +24,18 @@ jobs:
- 22
- 24.0.0
- lts/* # currently 24
- 26.0.0
- latest # currently 26
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
- name: Check out repository
uses: actions/checkout@v7
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run check
- run: npm test
- name: Install dependencies
run: npm ci --engine-strict
- name: Lint and formatting
run: npm run check
- name: Run tests
run: npm test
21 changes: 14 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,26 @@ on:
- "v*"

permissions:
id-token: write
contents: read
id-token: write

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
- name: Check out repository
uses: actions/checkout@v7
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: lts/*
registry-url: https://registry.npmjs.org
- run: npm ci
- run: npm run check
- run: npm test
- run: npm publish
- name: Install dependencies
run: npm ci --engine-strict
- name: Lint and formatting
run: npm run check
- name: Run tests
run: npm test
- name: Publish to npm
run: npm publish
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/node_modules/
node_modules/
npm-debug.log*
12 changes: 9 additions & 3 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import domenicConfig from "@domenic/eslint-config";
import stylisticConfig from "@domenic/eslint-config/stylistic";
import domenicStylisticConfig from "@domenic/eslint-config/stylistic";
import globals from "globals";

export default [
...domenicConfig,
...domenicStylisticConfig,
{
files: ["**/*.js"],
languageOptions: {
sourceType: "commonjs",
globals: globals.node,
},
},
...domenicConfig,
...stylisticConfig,
{
files: ["**/*.mjs"],
languageOptions: {
globals: globals.nodeBuiltin,
},
},
];
52 changes: 14 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,21 @@
"files": [
"lib/"
],
"type": "commonjs",
"main": "lib/html-encoding-sniffer.js",
"scripts": {
"test": "node --test",
"check": "npm run lint && npm run fmt:check",
"lint": "eslint",
"lint:fix": "eslint --fix",
"fmt": "oxfmt",
"fmt:check": "oxfmt --check"
"fmt:check": "oxfmt --check",
"test": "node --test"
},
"dependencies": {
"@exodus/bytes": "^1.15.1"
"@exodus/bytes": "^1.16.0"
},
"devDependencies": {
"@domenic/eslint-config": "^6.0.0",
"@domenic/eslint-config": "^6.1.0",
"@stylistic/eslint-plugin": "^5.10.0",
"eslint": "^10.13.0",
"globals": "^17.13.0",
Expand Down
Loading