Skip to content

Commit

Permalink
feat: upgrade all the things
Browse files Browse the repository at this point in the history
  • Loading branch information
TomerAberbach committed Apr 13, 2024
1 parent 17827d8 commit 88ddac4
Show file tree
Hide file tree
Showing 19 changed files with 9,313 additions and 2,915 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,24 @@ name: CI

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Node.js v${{ matrix.nodejs }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
nodejs: [12, 14]
os: [ubuntu-latest, windows-latest, macOS-latest]
nodejs: [18, 20]
os: [ubuntu-latest, macOS-latest]
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.nodejs }}

Expand All @@ -39,5 +43,14 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Format
run: pnpm format -- --no-write

- name: Lint
run: pnpm lint -- --no-fix

- name: Typecheck
run: pnpm typecheck

- name: Test
run: pnpm test
run: pnpm test -- --coverage
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules
.eslintcache
coverage
/dist/
*.tsbuildinfo
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

1 change: 0 additions & 1 deletion bench/.npmrc

This file was deleted.

2 changes: 1 addition & 1 deletion bench/deque.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ bench(
fc.anything().map(value => deque => deque.unshift(value)),
fc.constant(deque => deque.shift()),
),
1000000,
1_000_000,
),
)
8 changes: 4 additions & 4 deletions bench/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"private": true,
"type": "module",
"devDependencies": {
"benchmark": "2.1.4",
"denque": "1.5.0",
"benchmark": "^2.1.4",
"denque": "^2.1.0",
"double-ended-queue": "2.1.0-0",
"fast-check": "2.17.0",
"yocto-queue": "0.1.0"
"fast-check": "^3.17.1",
"yocto-queue": "^1.0.0"
}
}
87 changes: 57 additions & 30 deletions bench/pnpm-lock.yaml

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

8 changes: 5 additions & 3 deletions bench/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,16 @@ bench(
fc.anything().map(value => queue => queue.enqueue(value)),
fc.constant(queue => queue.dequeue()),
),
1000000,
1_000_000,
),
)
console.log()

console.log(`100,000 push calls followed by 100,000 shift calls:`)
const enqueue = queue => queue.enqueue({})
const dequeue = queue => queue.dequeue()
bench(
Array.from({ length: 100000 }, () => queue => queue.enqueue({})).concat(
Array.from({ length: 100000 }, () => queue => queue.dequeue()),
Array.from({ length: 100_000 }, () => enqueue).concat(
Array.from({ length: 100_000 }, () => dequeue),
),
)
29 changes: 29 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import config from 'tomer/eslint'

export default [
...config,
{
rules: {
'unicorn/new-for-builtins': `off`,
'unicorn/no-array-push-push': `off`,
'unicorn/no-new-array': `off`,
'unicorn/no-useless-undefined': `off`,
},
},
]
37 changes: 22 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,40 +39,47 @@
"src/index.d.ts"
],
"type": "module",
"sideEffects": false,
"engines": {
"node": ">= 12.17"
"node": ">= 18"
},
"browserslist": [
"defaults",
"not IE 11",
"not op_mini all"
],
"exports": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
"types": "./dist/index.d.ts",
"require": "./dist/index.min.cjs",
"import": "./dist/index.min.js"
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./src/index.d.ts",
"types": "./dist/index.d.ts",
"main": "./dist/index.min.cjs",
"module": "./dist/index.min.js",
"scripts": {
"prepare": "tomer install",
"lint": "tomer lint -g",
"format": "tomer format",
"lint": "tomer lint",
"typecheck": "tomer typecheck",
"test": "tomer test",
"build": "tomer build -f \"esm,cjs\" src/index.js",
"prepublishOnly": "pnpm run build"
"build": "tomer build",
"clean": "tomer clean dist",
"prepublishOnly": "tomer build"
},
"prettier": "tomer/prettier",
"terser": {
"mangle": {
"properties": {
"regex": "_.+"
"regex": "^_[^_]+"
}
}
},
"devDependencies": {
"ava": "3.15.0",
"ava-fast-check": "4.0.2",
"fast-check": "2.17.0",
"tomer": "0.0.16",
"tsd": "0.17.0"
"@types/jest": "^29.5.12",
"eslint": "^8.57.0",
"jest": "^29.7.0",
"prettier": "^3.2.5",
"tomer": "^3.1.4",
"typescript": "^5.4.5"
}
}
Loading

0 comments on commit 88ddac4

Please sign in to comment.