Skip to content

Commit

Permalink
chore: update template once again
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranet committed Apr 16, 2024
1 parent aa6833d commit 635b5d5
Show file tree
Hide file tree
Showing 8 changed files with 1,128 additions and 1,023 deletions.
7 changes: 7 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
exclude = ["node_modules/**/*.toml"]

# https://taplo.tamasfe.dev/configuration/formatter-options.html
[formatting]
align_entries = true
indent_tables = true
reorder_keys = true
4 changes: 1 addition & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"rust-analyzer.rustfmt.extraArgs": [
"+nightly"
]
"rust-analyzer.rustfmt.extraArgs": ["+nightly"]
}
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

/* auto-generated by NAPI-RS */

export const enum Player {
export enum Player {
Unset = 0,
Human = 1,
Machine = 2
Expand Down
36 changes: 24 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,16 @@
],
"sideEffects": false,
"scripts": {
"test": "run-p \"test:node\" \"test:rust\"",
"test:node": "vitest --run",
"test:rust": "cargo test",
"fmt": "run-p \"fmt:node\" \"fmt:rust\"",
"fmt:node": "prettier --write .github npm tests index.cjs index.mjs index.d.ts",
"fmt:rust": "cargo +nightly fmt",
"clean": "node scripts/clean.mjs",
"artifacts": "napi artifacts",
"build": "napi build --platform --release --js index.cjs --pipe \"prettier -w\"",
"build:debug": "napi build --platform --js index.cjs --pipe \"prettier -w\"",
"update": "yarn upgrade-interactive",
"build": "napi build --platform --js index.cjs --no-const-enum --release --pipe \"prettier -w\"",
"build:debug": "napi build --platform --js index.cjs --no-const-enum --pipe \"prettier -w\"",
"format": "run-p format:prettier format:rs format:toml",
"format:prettier": "prettier . -w",
"format:toml": "taplo format",
"format:rs": "cargo +nightly fmt",
"lint": "eslint .",
"prepublishOnly": "napi prepublish -t npm",
"test": "vitest run",
"version": "napi version"
},
"napi": {
Expand All @@ -60,12 +58,15 @@
"@commitlint/cli": "^19.2.2",
"@commitlint/config-conventional": "^19.2.2",
"@napi-rs/cli": "^2.18.1",
"@sapphire/eslint-config": "^5.0.4",
"@sapphire/prettier-config": "^2.0.0",
"@sapphire/ts-config": "^5.0.1",
"@taplo/cli": "^0.7.0",
"@types/node": "^20.12.7",
"@vitest/coverage-v8": "^1.5.0",
"npm-run-all": "^4.1.5",
"lint-staged": "^15.2.2",
"npm-run-all2": "^6.1.2",
"prettier": "^3.2.5",
"pretty-quick": "^4.0.0",
"vitest": "^1.5.0"
},
"resolutions": {
Expand Down Expand Up @@ -94,6 +95,17 @@
"publishConfig": {
"access": "public"
},
"lint-staged": {
"*.@(js|ts|tsx)": [
"eslint --fix"
],
"*.@(js|ts|tsx|yml|yaml|md|json)": [
"prettier --write"
],
"*.toml": [
"taplo format"
]
},
"prettier": "@sapphire/prettier-config",
"eslintConfig": {
"extends": "@sapphire"
Expand Down
14 changes: 7 additions & 7 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
hard_tabs=true
max_width=120
newline_style = "Unix"
group_imports = "StdExternalCrate"
hard_tabs = true
imports_granularity = "Crate"
max_width = 120
newline_style = "Unix"
use_field_init_shorthand = true
use_small_heuristics = "Max"
wrap_comments = true
group_imports = "StdExternalCrate"
imports_granularity = "Crate"
use_small_heuristics = "Max"
wrap_comments = true
7 changes: 6 additions & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"extends": "@sapphire/ts-config/extra-strict-without-decorators"
"extends": ["@sapphire/ts-config", "@sapphire/ts-config/extra-strict"],
"compilerOptions": {
"allowJs": true,
"noEmit": true,
"incremental": false
}
}
4 changes: 4 additions & 0 deletions tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.base.json",
"include": ["./index.cjs", "./index.mjs", "./index.d.ts", "tests", "./vitest.config.ts"]
}
Loading

0 comments on commit 635b5d5

Please sign in to comment.