Skip to content

Commit b72222d

Browse files
authored
feat!: bump library (#5)
1 parent d3c83f9 commit b72222d

File tree

8 files changed

+147
-36
lines changed

8 files changed

+147
-36
lines changed

.github/workflows/ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
on:
2+
push:
3+
branches:
4+
- current
5+
- next
6+
- 'v*'
7+
pull_request:
8+
9+
name: CI
10+
11+
jobs:
12+
lint:
13+
name: Lint
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
17+
- name: Install Node.js
18+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
19+
with:
20+
node-version: v20.x
21+
- name: Install dependencies
22+
run: npm install
23+
- name: Check linting
24+
run: npm run lint
25+
26+
tests:
27+
needs: [lint]
28+
name: Tests
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
os: [ubuntu-latest, macos-latest, windows-latest]
33+
node-version: [20.x, 22.x, 24.x]
34+
runs-on: ${{matrix.os}}
35+
steps:
36+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
37+
with:
38+
persist-credentials: false
39+
40+
- name: Use Node.js ${{ matrix.node-version }}
41+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
42+
with:
43+
node-version: ${{ matrix.node-version }}
44+
cache: 'npm'
45+
cache-dependency-path: package.json
46+
47+
- name: Install Dependencies
48+
run: npm install
49+
- name: Run Tests
50+
run: npm run test
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Create release PR
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
create-pr:
8+
runs-on: ubuntu-latest
9+
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
14+
# Let's try to trigger releases only after this release PR gets merged
15+
# so we might need to verify who the author is to do so
16+
steps:
17+
- uses: googleapis/release-please-action@c2a5a2bd6a758a0937f1ddb1e8950609867ed15c # v4.3.0
18+
with:
19+
# this is a built-in strategy in release-please, see "Action Inputs"
20+
# for more options
21+
release-type: node
22+
skip-github-release: true
23+
skip-labeling: true

.github/workflows/publish.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
on:
2+
push:
3+
branches:
4+
- current
5+
6+
name: publish
7+
8+
permissions:
9+
id-token: write # Required for OIDC
10+
contents: read
11+
12+
jobs:
13+
publish:
14+
if: >
15+
github.event.head_commit.author.username == 'github-actions[bot]' && github.event.head_commit.author.email == '41898282+github-actions[bot]@users.noreply.github.com'
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
19+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
20+
with:
21+
node-version: 24
22+
registry-url: 'https://registry.npmjs.org'
23+
- run: npm install -g npm@latest
24+
- run: npm install
25+
- run: npm publish --access public

.github/workflows/release.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- 'v[0-9]+.[0-9]+.[0-9]+'
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
name: Release Creation
13+
steps:
14+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
15+
- uses: ncipollo/release-action@bcfe5470707e8832e12347755757cec0eb3c22af # v1.18.0
16+
with:
17+
bodyFile: "CHANGELOG.md"
18+
token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ node_modules
33
package-lock.json
44
dist
55
coverage
6+
.worktrees

eslint.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use strict';
2+
3+
module.exports = require('neostandard')({
4+
semi: true,
5+
ts: true,
6+
noStyle: true,
7+
ignores: ['dist', 'node_modules', 'docs/build', 'docs/.docusaurus'],
8+
globals: {
9+
SharedArrayBuffer: true,
10+
Atomics: true,
11+
AbortController: true,
12+
MessageChannel: true,
13+
},
14+
});

package.json

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "piscina-priority-queue",
2+
"name": "@piscina/priority-queue",
33
"version": "3.0.0",
44
"description": "A Priority TaskQueue implementation for Piscina",
55
"main": "./dist/src/index.js",
@@ -10,7 +10,7 @@
1010
"types": "./dist/src/index.d.ts",
1111
"scripts": {
1212
"build": "tsc && gen-esm-wrapper . dist/esm-wrapper.mjs",
13-
"lint": "standardx \"**/*.{ts,mjs,js,cjs}\" | snazzy",
13+
"lint": "eslint",
1414
"test": "npm run lint && npm run build && npm run test-only",
1515
"test-only": "tap --ts",
1616
"prepack": "npm run build"
@@ -29,41 +29,21 @@
2929
],
3030
"license": "MIT",
3131
"devDependencies": {
32-
"@types/node": "^15.0.1",
33-
"@typescript-eslint/eslint-plugin": "^4.9.0",
34-
"@typescript-eslint/parser": "^4.9.0",
32+
"@types/node": "^24.10.0",
33+
"eslint": "^9.39.1",
3534
"gen-esm-wrapper": "^1.1.1",
36-
"piscina": "3",
35+
"neostandard": "^0.12.2",
36+
"piscina": "^5.1.4",
3737
"snazzy": "^9.0.0",
3838
"standardx": "^7.0.0",
3939
"tap": "^15.0.6",
40-
"ts-node": "^9.1.1",
41-
"typescript": "^4.1.2"
40+
"ts-node": "^10.9.2",
41+
"typescript": "^5.9.3"
4242
},
4343
"peerDependencies": {
44-
"piscina": "^3.0.0"
44+
"piscina": "^5.0.0"
4545
},
4646
"dependencies": {
4747
"shuffled-priority-queue": "^2.1.0"
48-
},
49-
"eslintConfig": {
50-
"rules": {
51-
"semi": [
52-
"error",
53-
"always"
54-
],
55-
"no-unused-vars": "off",
56-
"@typescript-eslint/no-unused-vars": "error"
57-
},
58-
"globals": {
59-
"SharedArrayBuffer": true,
60-
"Atomics": true
61-
}
62-
},
63-
"standardx": {
64-
"parser": "@typescript-eslint/parser",
65-
"plugins": [
66-
"@typescript-eslint/eslint-plugin"
67-
]
6848
}
6949
}

test/simple-test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ test('PiscinaPriorityQueue works', async ({ equal }) => {
1010
queue.push(task);
1111
equal(queue.size, 1);
1212
queue.remove(null);
13-
queue.remove(({} as any));
13+
queue.remove({} as any);
1414
equal(queue.size, 1);
1515
queue.remove(task);
1616
equal(queue.size, 0);
@@ -22,14 +22,14 @@ test('PiscinaPriorityQueue works with Piscina', async () => {
2222
filename: resolve(__dirname, 'fixtures/eval.js'),
2323
taskQueue: queue,
2424
maxThreads: 1,
25-
minThreads: 1
25+
minThreads: 1,
2626
});
2727

2828
await Promise.all([
29-
pool.runTask(PiscinaPriorityQueue.makeTask({}, 1)),
30-
pool.runTask(PiscinaPriorityQueue.makeTask({}, 2)),
31-
pool.runTask(PiscinaPriorityQueue.makeTask({})),
32-
pool.runTask(PiscinaPriorityQueue.makeTask({}, null)),
33-
pool.runTask({})
29+
pool.run(PiscinaPriorityQueue.makeTask({}, 1)),
30+
pool.run(PiscinaPriorityQueue.makeTask({}, 2)),
31+
pool.run(PiscinaPriorityQueue.makeTask({})),
32+
pool.run(PiscinaPriorityQueue.makeTask({}, null)),
33+
pool.run({}),
3434
]);
3535
});

0 commit comments

Comments
 (0)