Skip to content

Commit

Permalink
Merge branch 'main' into eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
with-heart committed Sep 19, 2024
2 parents 838e53a + de6591f commit b597d16
Show file tree
Hide file tree
Showing 98 changed files with 20,113 additions and 19,259 deletions.
12 changes: 6 additions & 6 deletions .github/actions/ci-checks/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ runs:
using: 'composite'
steps:
- name: Build
run: yarn build
run: pnpm build
shell: bash

- name: ESLint
run: yarn lint --no-cache
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: yarn 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
NODE_OPTIONS='--openssl-legacy-provider' yarn docs:build
NODE_OPTIONS='--openssl-legacy-provider' pnpm docs:build
- name: Publish docs
uses: JamesIves/[email protected]
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 }}
1 change: 0 additions & 1 deletion .knip.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
],
"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
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
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 b597d16

Please sign in to comment.