Skip to content

Commit

Permalink
add knip to ci-checks (#5030)
Browse files Browse the repository at this point in the history
* add knip to ci-checks

* add workspace preconstruct entrypoints to knip config

* resolve knip errors
  • Loading branch information
with-heart authored Sep 2, 2024
1 parent 26aabae commit f91eb14
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/actions/ci-checks/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ runs:
- name: Svelte Check
run: yarn --cwd packages/xstate-svelte svelte-check
shell: bash

- name: Knip
run: yarn knip
shell: bash
16 changes: 16 additions & 0 deletions .knip.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
"entry": ["scripts/*.js"],
"project": ["scripts/*.js"]
},
"packages/core": {
"entry": [
"src/index.ts",
"src/actions.ts",
"src/actors/index.ts",
"src/guards.ts",
"src/dev/index.ts"
]
},
"packages/xstate-inspect": {
"entry": ["src/index.ts", "src/server.ts"]
},
"packages/xstate-store": {
"entry": ["src/index.ts", "src/react.ts", "src/solid.ts"]
},
"packages/xstate-svelte": {
"typescript": "test/tsconfig.json"
}
Expand All @@ -22,6 +37,7 @@
"synckit",
// package.json#exports aren't added as entry points, because `dist/` is .gitignored
"react",
"solid-js",
"xstate",
"@types/ws"
]
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/State.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import type {
} from './types.ts';
import { matchesState } from './utils.ts';

export type ToTestStateValue<TStateValue extends StateValue> =
type ToTestStateValue<TStateValue extends StateValue> =
TStateValue extends string
? TStateValue
: IsNever<keyof TStateValue> extends true
Expand Down
2 changes: 1 addition & 1 deletion packages/xstate-store/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,6 @@ export function createStoreTransition<
}

// create a unique 6-char id
export function uniqueId() {
function uniqueId() {
return Math.random().toString(36).slice(6);
}

0 comments on commit f91eb14

Please sign in to comment.