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
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# editorconfig.org
root = true

[*.{js,cjs,mjs,jsx,ts,cts,mts,tsx,json,jsonc}]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 120
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ jobs:
- run: npm run lint
name: Run linter
- run: npm run format:check
name: Run Prettier check
name: Run format check
- run: npm run test
name: Run unit tests
37 changes: 0 additions & 37 deletions .releaserc

This file was deleted.

15 changes: 0 additions & 15 deletions eslint.config.mjs

This file was deleted.

1 change: 1 addition & 0 deletions lib/asyncbox.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {limitFunction} from 'p-limit';

import type {
CancellablePromise,
LongSleepOptions,
Expand Down
6 changes: 6 additions & 0 deletions oxfmt.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import appiumConfig, {defineConfig, ignorePatterns} from '@appium/oxc-config/oxfmt';

export default defineConfig({
...appiumConfig,
ignorePatterns: [...ignorePatterns],
});
6 changes: 6 additions & 0 deletions oxlint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import appiumConfig, {defineConfig, ignorePatterns} from '@appium/oxc-config/oxlint';

export default defineConfig({
extends: [appiumConfig],
ignorePatterns: [...ignorePatterns],
});
69 changes: 30 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
{
"name": "asyncbox",
"version": "6.4.0",
"description": "A collection of small async/await utilities",
"tags": [
"keywords": [
"async",
"async/await",
"es7",
"async"
"es7"
],
"version": "6.4.0",
"author": "jlipps@gmail.com",
"bugs": {
"url": "https://github.com/appium/asyncbox/issues"
},
"license": "Apache-2.0",
"author": "jlipps@gmail.com",
"repository": {
"type": "git",
"url": "https://github.com/appium/asyncbox.git"
},
"bugs": {
"url": "https://github.com/appium/asyncbox/issues"
},
"engines": {
"node": "^20.19.0 || ^22.12.0 || >=24.0.0",
"npm": ">=10"
"bin": {},
"directories": {
"lib": "./lib"
},
"files": [
"lib/**/*",
"build/cjs/lib/**/*",
"build/cjs/package.json",
"build/esm/lib/**/*",
"build/esm/package.json"
],
"type": "module",
"main": "./build/cjs/lib/asyncbox.js",
"module": "./build/esm/lib/asyncbox.js",
Expand All @@ -37,17 +44,6 @@
},
"./package.json": "./package.json"
},
"bin": {},
"directories": {
"lib": "./lib"
},
"files": [
"lib/**/*",
"build/cjs/lib/**/*",
"build/cjs/package.json",
"build/esm/lib/**/*",
"build/esm/package.json"
],
"scripts": {
"build": "tsc -b tsconfig.esm.json tsconfig.cjs.json",
"postbuild": "node scripts/postbuild.mjs",
Expand All @@ -56,28 +52,23 @@
"dev": "npm run build -- --watch",
"prepare": "npm run rebuild",
"test": "node --test --enable-source-maps --test-force-exit --test-timeout=60000 \"./build/esm/test/**/*.spec.js\" \"./test/*.spec.cjs\"",
"lint": "eslint .",
"format": "prettier -w ./lib ./test",
"format:check": "prettier --check ./lib ./test",
"lint": "oxlint -c oxlint.config.mjs .",
"lint:fix": "oxlint -c oxlint.config.mjs --fix .",
"format": "oxfmt -c oxfmt.config.mjs .",
"format:check": "oxfmt -c oxfmt.config.mjs --check .",
"watch": "npm run dev"
},
"prettier": {
"bracketSpacing": false,
"printWidth": 100,
"singleQuote": true
},
"dependencies": {
"p-limit": "^7.2.0"
},
"devDependencies": {
"@appium/eslint-config-appium-ts": "^3.2.3",
"@appium/tsconfig": "^1.0.0",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
"@types/node": "^26.1.0",
"conventional-changelog-conventionalcommits": "^9.0.0",
"prettier": "^3.0.0",
"semantic-release": "^25.0.2",
"typescript": "^6.0.3"
"@appium/oxc-config": "^1.1.0",
"@appium/semantic-release-config": "^1.1.0",
"@appium/tsconfig": "^1.2.0",
"@types/node": "^26.1.0"
},
"engines": {
"node": "^20.19.0 || ^22.12.0 || >=24.0.0",
"npm": ">=10"
}
}
3 changes: 3 additions & 0 deletions release.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import releaseConfig from '@appium/semantic-release-config';

export default releaseConfig();
10 changes: 4 additions & 6 deletions test/asyncbox.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import assert from 'node:assert/strict';
import {it, describe, beforeEach} from 'node:test';

import {
sleep,
longSleep,
Expand All @@ -11,8 +14,6 @@ import {
PromiseCancellationError,
type SleepOptions,
} from '../lib/asyncbox.js';
import {it, describe, beforeEach} from 'node:test';
import assert from 'node:assert/strict';

describe('sleep', function () {
it('should work like setTimeout', async function () {
Expand Down Expand Up @@ -93,10 +94,7 @@ describe('sleep', function () {
assert.throws(() => sleep([] as unknown as number), /finite number or an object with ms/);
});
it('should throw TypeError when object has invalid ms', function () {
assert.throws(
() => sleep({} as unknown as SleepOptions),
/options\.ms must be a finite number/,
);
assert.throws(() => sleep({} as unknown as SleepOptions), /options\.ms must be a finite number/);
assert.throws(() => sleep({ms: Number.NaN}), /options\.ms must be a finite number/);
});
it('should accept a null-prototype object with ms', async function () {
Expand Down
5 changes: 1 addition & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
"types": ["node"],
"checkJs": true
},
"include": [
"lib",
"test"
],
"include": ["lib", "test"],
"exclude": ["test/*.cjs"]
}