Skip to content

Commit

Permalink
Merge pull request #479 from NullVoxPopuli/xstate5-implementation
Browse files Browse the repository at this point in the history
Implement XState 5 API support in templates
  • Loading branch information
NullVoxPopuli authored Oct 17, 2024
2 parents 6d24bd8 + 5b34c41 commit ae25a0b
Show file tree
Hide file tree
Showing 95 changed files with 5,341 additions and 5,937 deletions.
144 changes: 41 additions & 103 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,160 +1,98 @@
name: CI
"on":
workflow_dispatch: {}
pull_request: null
push:
branches:
- main
schedule:
- cron: "0 3 * * 0 "
env:
CI: true
dist: ember-statechart-component/dist
jobs:
install_dependencies:
name: Install Dependencies
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3

eslint:
name: ESLint
needs:
- install_dependencies
jobs:
lint:
name: Lint
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
path:
- ./ember-statechart-component
- ./testing/ember-app
- ./test-app
steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
- name: ESLint
run: cd ${{ matrix.path }} && pnpm run lint:js
- run: cd ${{ matrix.path }} && pnpm run lint

build:
name: Build Tests
needs:
- install_dependencies
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
- name: Build and Assert Output
run: |-
echo 'target: ember-statechart-component/dist
setup:
run: pnpm build:js
cwd: ./ember-statechart-component
expect: |
index.js
index.js.map
index.d.ts
glint.d.ts
glint.d.ts.map
glint.js
glint.js.map
' >> assert-contents.config.yml
npx assert-folder-contents
- uses: actions/upload-artifact@v3
with:
name: dist
path: ${{ env.dist }}
tests:
name: Default Tests
timeout-minutes: 5
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
- name: Download built package from cache
uses: actions/download-artifact@v3
with:
name: dist
path: ${{ env.dist }}
- run: pnpm --filter ember-app run test:ember
- run: pnpm --filter test-app run test:ember

floating-deps-tests:
name: Floating Deps Test
timeout-minutes: 5
runs-on: ubuntu-latest
needs:
- build
needs: tests
steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
with:
args: '--no-lockfile'
- name: Download built package from cache
uses: actions/download-artifact@v3
with:
name: dist
path: ${{ env.dist }}
- run: pnpm --filter ember-app run test:ember
- run: pnpm --filter test-app run test:ember

try-scenarios:
name: ${{ matrix.ember-try-scenario }}
timeout-minutes: 10
runs-on: ubuntu-latest
needs:
- tests
strategy:
fail-fast: true
matrix:
ember-try-scenario:
- ember-5.1
- ember-5.4
- ember-release
- ember-beta
- ember-canary
steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
- name: Download built package from cache
uses: actions/download-artifact@v3
with:
name: dist
path: ${{ env.dist }}
- name: test
working-directory: ./testing/ember-app
run: >-
node_modules/.bin/ember try:one ${{ matrix.ember-try-scenario }}
--skip-cleanup
# This seems to not work at the moment -- can't connect to browser
# try-scenarios:
# name: ${{ matrix.ember-try-scenario }}
# timeout-minutes: 10
# runs-on: ubuntu-latest
# needs: tests
# strategy:
# fail-fast: true
# matrix:
# ember-try-scenario:
# - ember-5.1
# - ember-5.4
# - ember-5.8
# - ember-5.12
# - ember-release
# - ember-beta
# - ember-canary
# steps:
# - uses: actions/checkout@v4
# - uses: wyvox/action-setup-pnpm@v3
# - name: test
# working-directory: ./test-app
# run: node_modules/.bin/ember try:one ${{ matrix.ember-try-scenario }}
# --skip-cleanup

typescript-compatibility:
name: ${{ matrix.typescript-scenario }}
timeout-minutes: 5
runs-on: ubuntu-latest
continue-on-error: true
needs:
- build
needs: tests
strategy:
fail-fast: true
matrix:
typescript-scenario:
- typescript@5.0
- typescript@5.1
- typescript@5.2
- typescript@5.3
- typescript@5.4
- typescript@5.5
- typescript@5.6
steps:
- uses: actions/checkout@v3
- uses: wyvox/action-setup-pnpm@v3
- name: Download built package from cache
uses: actions/download-artifact@v3
with:
name: dist
path: ${{ env.dist }}
- name: Update TS Version
run: pnpm add --save-dev ${{ matrix.typescript-scenario }}
working-directory: ./testing/ember-app
working-directory: ./test-app
- name: Type checking
run: >-
pnpm --filter ember-app exec tsc -v; pnpm --filter ember-app exec
glint --version; pnpm --filter ember-app exec glint
pnpm --filter test-app exec tsc -v;
pnpm --filter test-app exec glint --version;
pnpm --filter test-app exec glint
5 changes: 5 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ resolution-mode=highest
# super strict mode
auto-install-peers=false
resolve-peers-from-workspace-root=false

# default is true, we do this to try to have more isolation
# since we test with incompatible sets of TS types.
; shared-workspace-lockfile=false

41 changes: 41 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
'use strict';

module.exports = {
plugins: ['prettier-plugin-ember-template-tag'],
singleQuote: true,
overrides: [
{
files: ['*.js', '*.ts', '*.cjs', '.mjs', '.cts', '.mts', '.cts'],
options: {
singleQuote: true,
trailingComma: 'es5',
},
},
{
files: ['*.html'],
options: {
singleQuote: false,
},
},
{
files: ['*.json'],
options: {
singleQuote: false,
},
},
{
files: ['*.hbs'],
options: {
singleQuote: false,
},
},
{
files: ['*.gjs', '*.gts'],
options: {
singleQuote: true,
templateSingleQuote: false,
trailingComma: 'es5',
},
},
],
};
Loading

0 comments on commit ae25a0b

Please sign in to comment.