Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: statelyai/xstate
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.3.0
Choose a base ref
...
head repository: statelyai/xstate
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: @xstate/immer@0.3.1
Choose a head ref
Loading
Showing 761 changed files with 117,746 additions and 4,277 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
13 changes: 13 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://unpkg.com/@changesets/config@1.6.3/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "statelyai/xstate" }],
"commit": false,
"linked": [],
"access": "public",
"baseBranch": "main",
"ignore": ["@xstate/analytics", "@xstate/scxml"],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true,
"useCalculatedVersionForSnapshots": true
}
}
10 changes: 10 additions & 0 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"packages": [
"packages/core",
"packages/xstate-fsm",
"packages/xstate-graph",
"packages/xstate-react",
"packages/xstate-test"
],
"sandboxes": ["xstate-example-template-m4ckv", "xstate-react-template-3t2tg"]
}
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: davidkpiano
patreon: # Replace with a single Patreon username
open_collective: xstate
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: 🐞 Bug report
about: Report an issue with XState or any XState-related tooling.
title: ''
labels: ''
assignees: ''

---

**Description**
<!-- A clear and concise description of what the bug is. -->

**Expected Result**
<!-- A clear and concise description of what you expected to happen. -->

**Actual Result**
<!-- A clear and concise description of what happened instead. -->

**Reproduction**
<!-- Create a reproduction of the issue from one of the following templates: -->
- [CodeSandbox template (JavaScript)](https://codesandbox.io/s/xstate-example-template-m4ckv)
- [CodeSandbox template (TypeScript)](https://codesandbox.io/s/xstate-typescript-template-s9kz8)
- ⚛︎ [CodeSandbox template (React)](https://codesandbox.io/s/xstate-react-template-3t2tg)
- ⚛︎ [CodeSandbox template (React + TypeScript)](https://codesandbox.io/s/xstate-react-typescript-template-wjdvn)
- 💚 [CodeSandbox template (Vue + Composition API)](https://codesandbox.io/s/xstate-vue-template-composition-api-1n23l)
- [XState Visualizer](https://stately.ai/viz/)

**Additional context**
<!-- Add any other context about the problem here (e.g., XState version) -->
56 changes: 56 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Bug Report
description: File a bug report
title: "Bug: "
labels: [bug, triage]
assignees:
body:
- type: markdown
attributes:
value: |
Report an issue with XState or any XState-related tooling.
- type: textarea
id: description
attributes:
label: Description
description: Please provide a clear and concise description of what the bug is.
placeholder: Something is broken!
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected result
description: What did you expect to happen?
placeholder: I expected this to work.
validations:
required: true
- type: textarea
id: actual
attributes:
label: Actual result
description: What was the actual observed result?
placeholder: This did not work.
validations:
required: true
- type: input
id: version
attributes:
label: Reproduction
description: |
Please provide a reproducible example. You can use one of the following templates:
- [CodeSandbox template (JavaScript)](https://codesandbox.io/s/xstate-example-template-m4ckv)
- [CodeSandbox template (TypeScript)](https://codesandbox.io/s/xstate-typescript-template-s9kz8)
- ⚛︎ [CodeSandbox template (React)](https://codesandbox.io/s/xstate-react-template-3t2tg)
- ⚛︎ [CodeSandbox template (React + TypeScript)](https://codesandbox.io/s/xstate-react-typescript-template-wjdvn)
- 💚 [CodeSandbox template (Vue + Composition API)](https://codesandbox.io/s/xstate-vue-template-composition-api-1n23l)
- [XState Visualizer](https://stately.ai/viz/)
validations:
required: true
- type: textarea
id: additional
attributes:
label: Additional context
description: Add any other context about the problem here (e.g., XState version)
validations:
required: false
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: ✨ Feature Request
url: https://github.com/statelyai/xstate/discussions/new
about: Have an idea for a new feature or integration? Share it here!
- name: ❓ Ask a Question
url: https://github.com/statelyai/xstate/discussions/new
about: If you have any questions about how to do something in XState, ask it here.
81 changes: 81 additions & 0 deletions .github/workflows/codesee-arch-diagram.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
on:
push:
branches:
- main
pull_request_target:
types: [opened, synchronize, reopened]

name: CodeSee Map

jobs:
test_map_action:
runs-on: ubuntu-latest
continue-on-error: true
name: Run CodeSee Map Analysis
steps:
- name: checkout
id: checkout
uses: actions/checkout@v2
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

# codesee-detect-languages has an output with id languages.
- name: Detect Languages
id: detect-languages
uses: Codesee-io/codesee-detect-languages-action@latest

- name: Configure JDK 16
uses: actions/setup-java@v2
if: ${{ fromJSON(steps.detect-languages.outputs.languages).java }}
with:
java-version: '16'
distribution: 'zulu'

# CodeSee Maps Go support uses a static binary so there's no setup step required.

- name: Configure Node.js 14
uses: actions/setup-node@v2
if: ${{ fromJSON(steps.detect-languages.outputs.languages).javascript }}
with:
node-version: '14'

- name: Configure Python 3.x
uses: actions/setup-python@v2
if: ${{ fromJSON(steps.detect-languages.outputs.languages).python }}
with:
python-version: '3.x'
architecture: 'x64'

- name: Configure Ruby '3.x'
uses: ruby/setup-ruby@v1
if: ${{ fromJSON(steps.detect-languages.outputs.languages).ruby }}
with:
ruby-version: '3.0'

# CodeSee Maps Rust support uses a static binary so there's no setup step required.

- name: Generate Map
id: generate-map
uses: Codesee-io/codesee-map-action@latest
with:
step: map
github_ref: ${{ github.ref }}
languages: ${{ steps.detect-languages.outputs.languages }}

- name: Upload Map
id: upload-map
uses: Codesee-io/codesee-map-action@latest
with:
step: mapUpload
api_token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }}
github_ref: ${{ github.ref }}

- name: Insights
id: insights
uses: Codesee-io/codesee-map-action@latest
with:
step: insights
api_token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }}
github_ref: ${{ github.ref }}
30 changes: 30 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Docs

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]

steps:
- uses: actions/checkout@v2

- name: Build docs
working-directory: docs
run: |
yarn install
yarn docs:build
- name: Publish docs
uses: JamesIves/github-pages-deploy-action@4.1.0
with:
branch: gh-pages
folder: docs/.vuepress/dist
target-folder: docs
30 changes: 30 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Node CI

on: [push, pull_request]

jobs:
build:
timeout-minutes: 20

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: yarn install

- name: Build
run: yarn build

- name: Test
run: yarn test --silent
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
push:
branches:
- main

jobs:
release:
if: github.repository == 'statelyai/xstate'

timeout-minutes: 20

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
# This makes action fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Use Node.js 14.x
uses: actions/setup-node@v2
with:
node-version: 14.x

- name: Install Dependencies
run: yarn

- name: Create Release Pull Request or Publish to npm
uses: changesets/action@v1
with:
publish: yarn run release
version: yarn run version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ lib-cov

# Coverage directory used by tools like istanbul
coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
@@ -25,3 +26,29 @@ build/Release
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

# Other
.DS_Store
dist/
lib/
es/
editor/
_examples/
__examples/
.vscode/
!.vscode/settings.json
src/invoke.ts
*.tsbuildinfo

# Documentation
docs-src/
netlify/
docs/.cache
!docs/examples/
*.pdf

./public/
.cache

# Docs
api/
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": true
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
Loading