Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to modern package tooling #64

Merged
merged 4 commits into from
Sep 3, 2024
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
3 changes: 0 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
.snapshots/
.next/
.vercel/
build/
dist/
docs/
18 changes: 0 additions & 18 deletions .eslintrc

This file was deleted.

11 changes: 11 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"root": true,
"extends": ["@fisch0920/eslint-config/node"],
"rules": {
"no-console": "off",
"@typescript-eslint/naming-convention": "off",
"import/consistent-type-specifier-style": "off",
"@typescript-eslint/array-type": "off",
"@typescript-eslint/no-inferrable-types": "off"
}
}
41 changes: 41 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on: [push, pull_request]

jobs:
test:
name: Test Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
node-version:
- 18
- 20
- 21
- 22

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.9.0
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile --strict-peer-dependencies

- name: Run build
run: pnpm build

- name: Run test
run: pnpm test
43 changes: 0 additions & 43 deletions .github/workflows/test.yml

This file was deleted.

1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
enable-pre-post-scripts=true
package-manager-strict=false
2 changes: 1 addition & 1 deletion license
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Travis Fischer
Copyright (c) 2024 Travis Fischer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
85 changes: 40 additions & 45 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,58 @@
"description": "Seedable random number generator supporting many common distributions.",
"repository": "transitive-bullshit/random",
"author": "Travis Fischer <[email protected]>",
"license": "MIT",
"type": "module",
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/random.module.js",
"default": "./dist/random.module.js"
},
"files": ["dist"],
"source": "./src/index.ts",
"module": "./dist/random.module.js",
"types": "./dist/index.d.ts",
"sideEffects": false,
"license": "MIT",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"default": "./dist/index.js"
}
},
"files": [
"dist"
],
"engines": {
"node": ">=14"
"node": ">=18"
},
"scripts": {
"start": "run-s build:watch",
"build": "microbundle -f esm --no-compress",
"build:watch": "microbundle -f esm --no-compress --watch",
"build": "tsup",
"dev": "tsup --watch",
"prebuild": "run-s clean",
"prebuild:watch": "run-s clean",
"predev": "run-s clean",
"clean": "del dist",
"prepublishOnly": "run-s build",
"docs": "update-markdown-jsdoc -f dist/random.module.js --shallow",
"pretest": "run-s build",
"test": "run-s test:*",
"test:unit": "ava -v",
"test:lint": "eslint .",
"test:prettier": "prettier '**/*.{js,jsx,ts,tsx}' --check",
"test:lint": "eslint ."
"test:typecheck": "tsc --noEmit",
"test:unit": "vitest run"
},
"dependencies": {
"seedrandom": "^3.0.5"
},
"devDependencies": {
"@fisch0920/eslint-config": "^1.4.0",
"@total-typescript/ts-reset": "^0.6.1",
"@types/node": "^22.5.2",
"@types/seedrandom": "^3.0.2",
"del-cli": "^5.0.0",
"eslint": "^8.57.0",
"husky": "^9.1.5",
"lint-staged": "^15.2.10",
"npm-run-all2": "^6.2.2",
"prettier": "^3.3.3",
"tsup": "^8.2.4",
"tsx": "^4.19.0",
"typescript": "^5.5.4",
"vite": "^5.4.2",
"vitest": "^2.0.5"
},
"keywords": [
"random",
Expand All @@ -53,33 +76,5 @@
"exponential",
"irwinhall",
"bates"
],
"dependencies": {
"seedrandom": "^3.0.5"
},
"devDependencies": {
"@ava/typescript": "^3.0.1",
"@esbuild-kit/esm-loader": "^2.5.0",
"@types/node": "^18.11.9",
"@types/seedrandom": "^3.0.2",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.1",
"ava": "^5.0.1",
"del-cli": "^5.0.0",
"eslint": "^8.27.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"microbundle": "^0.15.1",
"npm-run-all": "^4.1.5",
"prettier": "^2.7.1",
"typescript": "^4.8.4",
"update-markdown-jsdoc": "^1.0.11"
},
"ava": {
"extensions": {
"ts": "module"
},
"nodeArguments": ["--loader=@esbuild-kit/esm-loader"]
}
]
}
Loading