Skip to content

Commit

Permalink
feat: esm update (#20)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: convert to ESM, update deps

* chore: add semaphore config
* feat: uses ESM only
* chore: ensure compile runs
  • Loading branch information
AVVS authored Jan 19, 2025
1 parent cafa30d commit fe05b71
Show file tree
Hide file tree
Showing 12 changed files with 6,701 additions and 5,930 deletions.
File renamed without changes.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.project
.settings
.tmp
*.tsbuildinfo

# Ignore node stuff
node_modules/
Expand All @@ -30,4 +31,4 @@ tags
.cache

reports
lib
lib
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"`npm x -- mdep bin commitlint`" --edit $1
5 changes: 5 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
case "$2,$3" in
merge,)
ex "+%s/Merge branch '\([^']\+\)'/chore(merge): \1/i" -scwq $1 ;;
*) ;;
esac
5 changes: 5 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"import": "@swc-node/register/esm-register",
"extension": "ts",
"reporter": "spec"
}
46 changes: 46 additions & 0 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version: v1.0
name: callback-queue
agent:
machine:
type: e1-standard-2
os_image: ubuntu2004

fail_fast:
stop:
when: "branch != 'master'"

auto_cancel:
running:
when: "branch != 'master'"

global_job_config:
prologue:
commands:
- set -e
- sem-version node 22
- corepack enable pnpm
- checkout
- cache restore node-$(checksum pnpm-lock.yaml)
- pnpm i --frozen-lockfile --prefer-offline --ignore-scripts
- cache store node-$(checksum pnpm-lock.yaml) $(pnpm store path)

blocks:
- name: tests
dependencies: []
task:
jobs:
- name: test the project
commands:
- pnpm run test

- name: release
dependencies: ["tests"]
skip:
when: "branch != 'master'"
task:
secrets:
- name: semantic-release
jobs:
- name: release
commands:
- pnpm run semantic-release
59 changes: 28 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@
"version": "3.0.0",
"description": "Put your callbacks into queue to make sure that concurrent requests that you might want to perform will only be executed once",
"main": "./lib/callback-queue.js",
"type": "module",
"exports": {
".": {
"import": "./lib/callback-queue.js",
"default": "./lib/callback-queue.js",
"types": "./lib/callback-queue.d.ts"
}
},
"publishConfig": {
"access": "public"
},
"scripts": {
"test": "yarn lint && mocha -r ts-node/register -R spec test/*.spec.ts",
"test": "pnpm lint && pnpm compile && mocha test/*.spec.ts",
"lint": "eslint ./src",
"pretest": "yarn compile",
"compile": "tsc --build ./tsconfig.build.json",
"prepublishOnly": "yarn compile",
"prepublishOnly": "pnpm compile",
"semantic-release": "semantic-release"
},
"repository": {
Expand All @@ -30,41 +37,31 @@
"author": "Vitaly Aminev <v@aminev.me>",
"license": "MIT",
"dependencies": {
"debug": "^4.1.1"
"debug": "^4.4.0"
},
"engine": {
"node": ">= 12.15.x"
"node": ">= 22.13.0"
},
"devDependencies": {
"@makeomatic/deploy": "^10.4.0",
"@types/bluebird": "^3.5.33",
"@types/debug": "^4.1.5",
"@types/ioredis": "^4.22.3",
"@types/mocha": "^8.2.2",
"@types/node": "^14.14.41",
"@types/sinon": "^10.0.0",
"@types/uuid": "^8.3.0",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"@makeomatic/deploy": "^13.1.0",
"@swc-node/register": "^1.10.9",
"@types/debug": "^4.1.12",
"@types/mocha": "^10.0.10",
"@types/node": "^22.10.7",
"@types/sinon": "^17.0.3",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"cross-env": "^7.0.3",
"eslint": "^7.24.0",
"eslint-config-makeomatic": "^5.0.4",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-promise": "^5.1.0",
"ioredis": "^4.26.0",
"mocha": "^8.3.2",
"sinon": "^10.0.0",
"ts-node": "^9.1.1",
"typescript": "^4.2.3"
"eslint": "^8.57.1",
"eslint-config-makeomatic": "^6.0.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-promise": "^7.2.1",
"mocha": "^11.0.1",
"sinon": "^19.0.2",
"typescript": "^5.7.3"
},
"files": [
"src/",
"lib/"
],
"husky": {
"hooks": {
"commit-msg": "commitlint -e $HUSKY_GIT_PARAMS",
"prepare-commit-msg": "./node_modules/@makeomatic/deploy/git-hooks/prepare-commit-msg $HUSKY_GIT_PARAMS"
}
}
]
}
Loading

0 comments on commit fe05b71

Please sign in to comment.