Skip to content

Commit fe05b71

Browse files
authored
feat: esm update (#20)
BREAKING CHANGE: convert to ESM, update deps * chore: add semaphore config * feat: uses ESM only * chore: ensure compile runs
1 parent cafa30d commit fe05b71

12 files changed

Lines changed: 6701 additions & 5930 deletions
File renamed without changes.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
.project
77
.settings
88
.tmp
9+
*.tsbuildinfo
910

1011
# Ignore node stuff
1112
node_modules/
@@ -30,4 +31,4 @@ tags
3031
.cache
3132

3233
reports
33-
lib
34+
lib

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"`npm x -- mdep bin commitlint`" --edit $1

.husky/prepare-commit-msg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
case "$2,$3" in
2+
merge,)
3+
ex "+%s/Merge branch '\([^']\+\)'/chore(merge): \1/i" -scwq $1 ;;
4+
*) ;;
5+
esac

.mocharc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"import": "@swc-node/register/esm-register",
3+
"extension": "ts",
4+
"reporter": "spec"
5+
}

.semaphore/semaphore.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
version: v1.0
2+
name: callback-queue
3+
agent:
4+
machine:
5+
type: e1-standard-2
6+
os_image: ubuntu2004
7+
8+
fail_fast:
9+
stop:
10+
when: "branch != 'master'"
11+
12+
auto_cancel:
13+
running:
14+
when: "branch != 'master'"
15+
16+
global_job_config:
17+
prologue:
18+
commands:
19+
- set -e
20+
- sem-version node 22
21+
- corepack enable pnpm
22+
- checkout
23+
- cache restore node-$(checksum pnpm-lock.yaml)
24+
- pnpm i --frozen-lockfile --prefer-offline --ignore-scripts
25+
- cache store node-$(checksum pnpm-lock.yaml) $(pnpm store path)
26+
27+
blocks:
28+
- name: tests
29+
dependencies: []
30+
task:
31+
jobs:
32+
- name: test the project
33+
commands:
34+
- pnpm run test
35+
36+
- name: release
37+
dependencies: ["tests"]
38+
skip:
39+
when: "branch != 'master'"
40+
task:
41+
secrets:
42+
- name: semantic-release
43+
jobs:
44+
- name: release
45+
commands:
46+
- pnpm run semantic-release

package.json

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,22 @@
33
"version": "3.0.0",
44
"description": "Put your callbacks into queue to make sure that concurrent requests that you might want to perform will only be executed once",
55
"main": "./lib/callback-queue.js",
6+
"type": "module",
7+
"exports": {
8+
".": {
9+
"import": "./lib/callback-queue.js",
10+
"default": "./lib/callback-queue.js",
11+
"types": "./lib/callback-queue.d.ts"
12+
}
13+
},
614
"publishConfig": {
715
"access": "public"
816
},
917
"scripts": {
10-
"test": "yarn lint && mocha -r ts-node/register -R spec test/*.spec.ts",
18+
"test": "pnpm lint && pnpm compile && mocha test/*.spec.ts",
1119
"lint": "eslint ./src",
12-
"pretest": "yarn compile",
1320
"compile": "tsc --build ./tsconfig.build.json",
14-
"prepublishOnly": "yarn compile",
21+
"prepublishOnly": "pnpm compile",
1522
"semantic-release": "semantic-release"
1623
},
1724
"repository": {
@@ -30,41 +37,31 @@
3037
"author": "Vitaly Aminev <v@aminev.me>",
3138
"license": "MIT",
3239
"dependencies": {
33-
"debug": "^4.1.1"
40+
"debug": "^4.4.0"
3441
},
3542
"engine": {
36-
"node": ">= 12.15.x"
43+
"node": ">= 22.13.0"
3744
},
3845
"devDependencies": {
39-
"@makeomatic/deploy": "^10.4.0",
40-
"@types/bluebird": "^3.5.33",
41-
"@types/debug": "^4.1.5",
42-
"@types/ioredis": "^4.22.3",
43-
"@types/mocha": "^8.2.2",
44-
"@types/node": "^14.14.41",
45-
"@types/sinon": "^10.0.0",
46-
"@types/uuid": "^8.3.0",
47-
"@typescript-eslint/eslint-plugin": "^4.22.0",
48-
"@typescript-eslint/parser": "^4.22.0",
46+
"@makeomatic/deploy": "^13.1.0",
47+
"@swc-node/register": "^1.10.9",
48+
"@types/debug": "^4.1.12",
49+
"@types/mocha": "^10.0.10",
50+
"@types/node": "^22.10.7",
51+
"@types/sinon": "^17.0.3",
52+
"@typescript-eslint/eslint-plugin": "^7.18.0",
53+
"@typescript-eslint/parser": "^7.18.0",
4954
"cross-env": "^7.0.3",
50-
"eslint": "^7.24.0",
51-
"eslint-config-makeomatic": "^5.0.4",
52-
"eslint-plugin-import": "^2.22.1",
53-
"eslint-plugin-promise": "^5.1.0",
54-
"ioredis": "^4.26.0",
55-
"mocha": "^8.3.2",
56-
"sinon": "^10.0.0",
57-
"ts-node": "^9.1.1",
58-
"typescript": "^4.2.3"
55+
"eslint": "^8.57.1",
56+
"eslint-config-makeomatic": "^6.0.0",
57+
"eslint-plugin-import": "^2.31.0",
58+
"eslint-plugin-promise": "^7.2.1",
59+
"mocha": "^11.0.1",
60+
"sinon": "^19.0.2",
61+
"typescript": "^5.7.3"
5962
},
6063
"files": [
6164
"src/",
6265
"lib/"
63-
],
64-
"husky": {
65-
"hooks": {
66-
"commit-msg": "commitlint -e $HUSKY_GIT_PARAMS",
67-
"prepare-commit-msg": "./node_modules/@makeomatic/deploy/git-hooks/prepare-commit-msg $HUSKY_GIT_PARAMS"
68-
}
69-
}
66+
]
7067
}

0 commit comments

Comments
 (0)