Skip to content

Commit

Permalink
Merge branch 'main' into davidkpiano/enqueue-all-the-things
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkpiano committed Oct 30, 2024
2 parents 7b935fe + d67b71d commit 8b1a355
Show file tree
Hide file tree
Showing 232 changed files with 27,136 additions and 24,619 deletions.
6 changes: 6 additions & 0 deletions .changeset/four-countries-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@xstate/react': patch
'@xstate/store': patch
---

Add React 19 as a peer dependency
11 changes: 0 additions & 11 deletions .changeset/mean-news-sell.md

This file was deleted.

24 changes: 0 additions & 24 deletions .changeset/mean-peaches-decide.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/pretty-chicken-lie.md

This file was deleted.

63 changes: 0 additions & 63 deletions .changeset/two-hounds-march.md

This file was deleted.

4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
71183da18ae6b0b6b2e8f0c52ea9976232e54f41
94037fe9c429839f0508ddcd287718b659276e3b
f51bf4d8907307ace083a0decb34668176c7fad3

# lint fixes
8bff3b8ad57516e9816278b77ff5e0fffafd85ca
aeec38a6ef56bb534ff8bc968b95107ff54959cc
16 changes: 12 additions & 4 deletions .github/actions/ci-checks/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,25 @@ runs:
using: 'composite'
steps:
- name: Build
run: yarn build
run: pnpm build
shell: bash

- name: ESLint
run: pnpm lint --no-cache
shell: bash

- name: Typecheck
run: yarn typecheck
run: pnpm typecheck
shell: bash

- name: Test
run: yarn test --silent
run: pnpm test --silent
shell: bash

- name: Svelte Check
run: yarn --cwd packages/xstate-svelte svelte-check
run: pnpm --filter @xstate/svelte svelte-check
shell: bash

- name: Knip
run: pnpm knip
shell: bash
7 changes: 6 additions & 1 deletion .github/actions/ci-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ name: 'CI setup'
runs:
using: 'composite'
steps:
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'

- name: Install Dependencies
run: yarn
run: pnpm install
shell: bash
8 changes: 2 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@ jobs:

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: ./.github/actions/ci-setup

- name: Build docs
working-directory: docs
run: |
yarn install
yarn docs:build
NODE_OPTIONS='--openssl-legacy-provider' pnpm docs:build
- name: Publish docs
uses: JamesIves/github-pages-deploy-action@4.1.0
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions: {}

jobs:
release:
permissions:
Expand All @@ -30,8 +31,8 @@ jobs:
- name: Create Release Pull Request or Publish to npm
uses: changesets/action@v1
with:
publish: yarn run release
version: yarn run version
publish: pnpm run release
version: pnpm run version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# eslint
.eslintcache

# Logs
logs
*.log
Expand Down
17 changes: 16 additions & 1 deletion .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 @@ -17,11 +32,11 @@
],
"ignoreBinaries": ["svelte-check", "docs:build"],
"ignoreDependencies": [
"@xstate-repo/jest-utils",
"@xstate-repo/jest-utils/setup",
"synckit",
// package.json#exports aren't added as entry points, because `dist/` is .gitignored
"react",
"solid-js",
"xstate",
"@types/ws"
]
Expand Down
2 changes: 2 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"type": "node",
"request": "launch",
"name": "Jest Current File",
"runtimeExecutable": "sh",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["${file}", "--config", "jest.config.js", "--no-cache"],
"console": "integratedTerminal",
Expand All @@ -17,6 +18,7 @@
"type": "node",
"request": "launch",
"name": "Jest Current File (no timeout)",
"runtimeExecutable": "sh",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"${file}",
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Please read [our code of conduct](https://github.com/statelyai/xstate/blob/main/
## Environment

- Ensure you have the latest version of Node and Yarn.
- Run `yarn` to install all needed dev dependencies.
- Run `pnpm i` to install all needed dev dependencies.

## Making changes

Expand All @@ -24,9 +24,9 @@ Pull requests are encouraged. If you want to add a feature or fix a bug:
1. [Fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) and [clone](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository) the [repository](https://github.com/statelyai/xstate).
1. [Create a separate branch](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/managing-branches) for your changes.
1. Make your changes, and write tests that validate your change and/or fix.
1. Run `yarn test` (for all packages) or `yarn test:core` (for only changes to core XState).
1. Run `yarn typecheck` to make sure that there are no type errors.
1. Create a changeset by running `yarn changeset`. [More about changesets](https://github.com/atlassian/changesets).
1. Run `pnpm test` (for all packages) or `pnpm test:core` (for only changes to core XState).
1. Run `pnpm typecheck` to make sure that there are no type errors.
1. Create a changeset by running `pnpm changeset`. [More about changesets](https://github.com/atlassian/changesets).
1. Push your branch and open a PR 🚀

PRs are reviewed promptly and merged in within a day or two (or even within an hour) if everything looks good.
Expand Down Expand Up @@ -61,7 +61,7 @@ The [xstate.js.org](https://xstate.js.org) landing page is currently stored at `

### Building

We are using [preconstruct](https://preconstruct.tools/) to build our packages. It comes with a handy trick which allows us to always use source files of packages contained in this monorepo. It creates hook/redirecting files in place of dist files during development. This always happens after installing packages (during `postinstall` step) and you shouldn't be worried about it, but if you actually build packages you destroy those redirecting files and to run tests, typechecking etc correctly you need to bring them back by running `yarn postinstall`.
We are using [preconstruct](https://preconstruct.tools/) to build our packages. It comes with a handy trick which allows us to always use source files of packages contained in this monorepo. It creates hook/redirecting files in place of dist files during development. This always happens after installing packages (during `postinstall` step) and you shouldn't be worried about it, but if you actually build packages you destroy those redirecting files and to run tests, typechecking etc correctly you need to bring them back by running `pnpm postinstall`.

### Publishing

Expand Down
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,16 @@ Read [📽 the slides](http://slides.com/davidkhourshid/finite-state-machines) (

## Packages

| Package | Description |
| --------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| 🤖 `xstate` | Core finite state machine and statecharts library + interpreter |
| [📉 `@xstate/graph`](https://github.com/statelyai/xstate/tree/main/packages/xstate-graph) | Graph traversal and model-based testing utilities using XState |
| [⚛️ `@xstate/react`](https://github.com/statelyai/xstate/tree/main/packages/xstate-react) | React hooks and utilities for using XState in React applications |
| [💚 `@xstate/vue`](https://github.com/statelyai/xstate/tree/main/packages/xstate-vue) | Vue composition functions and utilities for using XState in Vue applications |
| [🎷 `@xstate/svelte`](https://github.com/statelyai/xstate/tree/main/packages/xstate-svelte) | Svelte utilities for using XState in Svelte applications |
| [🥏 `@xstate/solid`](https://github.com/statelyai/xstate/tree/main/packages/xstate-solid) | Solid hooks and utilities for using XState in Solid applications |
| [🔍 `@statelyai/inspect`](https://github.com/statelyai/inspect) | Inspection utilities for XState |
| Package | Description |
| ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| 🤖 `xstate` | Core finite state machine and statecharts library + interpreter |
| [📉 `@xstate/graph`](https://github.com/statelyai/xstate/tree/main/packages/xstate-graph) | Graph traversal and model-based testing utilities using XState |
| [⚛️ `@xstate/react`](https://github.com/statelyai/xstate/tree/main/packages/xstate-react) | React hooks and utilities for using XState in React applications |
| [💚 `@xstate/vue`](https://github.com/statelyai/xstate/tree/main/packages/xstate-vue) | Vue composition functions and utilities for using XState in Vue applications |
| [🎷 `@xstate/svelte`](https://github.com/statelyai/xstate/tree/main/packages/xstate-svelte) | Svelte utilities for using XState in Svelte applications |
| [🥏 `@xstate/solid`](https://github.com/statelyai/xstate/tree/main/packages/xstate-solid) | Solid hooks and utilities for using XState in Solid applications |
| [🔍 `@statelyai/inspect`](https://github.com/statelyai/inspect) | Inspection utilities for XState |
| [🏪 `@xstate/store`](https://github.com/statelyai/xstate/tree/main/packages/xstate-store) | Small library for simple state management |

## Finite State Machines

Expand Down
3 changes: 0 additions & 3 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
const { NODE_ENV } = process.env;
const isTest = NODE_ENV === 'test';

module.exports = {
assumptions: {
constantReexports: true, // only matters for tests (since only there we transpile to CJS using Babel), it makes debugging easier
Expand Down
2 changes: 1 addition & 1 deletion docs/fr/sandboxes/todomvc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
"xstate",
"react"
],
"name": "xstate-todomvc",
"name": "xstate-todomvc-fr",
"description": "The TodoMVC app implemented with React (using hooks) and XState version 4."
}
8 changes: 4 additions & 4 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
"author": "David Khourshid",
"license": "MIT",
"scripts": {
"docs:dev": "yarn vuepress dev .",
"docs:dev": "pnpm vuepress dev .",
"docs:readme": "cpy ../README.md .",
"docs:build": "npm run docs:readme && vuepress build .",
"docs:pdf": "npm run docs:build && vuepress export .",
"docs:publish": "npm run docs:build && gh-pages --dist .vuepress/dist --dest ./docs"
"docs:build": "pnpm run docs:readme && vuepress build .",
"docs:pdf": "pnpm run docs:build && vuepress export .",
"docs:publish": "pnpm run docs:build && gh-pages --dist .vuepress/dist --dest ./docs"
},
"dependencies": {
"@vuepress/plugin-google-analytics": "^1.8.2",
Expand Down
Loading

0 comments on commit 8b1a355

Please sign in to comment.