Skip to content

Commit

Permalink
Merge pull request #44 from retejs/lit-stack
Browse files Browse the repository at this point in the history
Lit stack
  • Loading branch information
Ni55aN authored Aug 20, 2024
2 parents 86d7e10 + d1c934c commit fe8fa0f
Show file tree
Hide file tree
Showing 69 changed files with 147 additions and 88 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
name: react
version: ${{ matrix.version }}
node: 18

vue:
strategy:
fail-fast: false
Expand All @@ -41,7 +41,7 @@ jobs:
name: vue
version: ${{ matrix.version }}
node: 18

svelte:
strategy:
fail-fast: false
Expand All @@ -53,3 +53,15 @@ jobs:
name: svelte
version: ${{ matrix.version }}
node: 18

lit:
strategy:
fail-fast: false
max-parallel: 1
matrix:
version: [3]
uses: ./.github/workflows/regression.yml
with:
name: lit-vite
version: ${{ matrix.version }}
node: 20
3 changes: 2 additions & 1 deletion .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ on:
- vue
- angular
- svelte
- lit-vite
version:
required: true
type: number
Expand Down Expand Up @@ -71,7 +72,7 @@ jobs:
name: Initialize ${{ inputs.name }} v${{ inputs.version }} app
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [tools,deps]
needs: [tools,deps]
if: |
always() &&
!contains(needs.*.result, 'failure') &&
Expand Down
24 changes: 22 additions & 2 deletions .github/workflows/update-all-snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
skip-tools: true
qa-path: ${{ needs.tools.outputs.qa-path }}
kit-path: ${{ needs.tools.outputs.kit-path }}

vue:
needs: tools
strategy:
Expand All @@ -84,7 +84,7 @@ jobs:
skip-tools: true
qa-path: ${{ needs.tools.outputs.qa-path }}
kit-path: ${{ needs.tools.outputs.kit-path }}

svelte:
needs: tools
strategy:
Expand All @@ -104,3 +104,23 @@ jobs:
skip-tools: true
qa-path: ${{ needs.tools.outputs.qa-path }}
kit-path: ${{ needs.tools.outputs.kit-path }}

lit:
needs: tools
strategy:
fail-fast: false
max-parallel: 1
matrix:
version: [3]
uses: ./.github/workflows/update-snapshots.yml
secrets: inherit
with:
name: lit-vite
version: ${{ matrix.version }}
node: 20
branch: ${{ inputs.branch }}
qa: ${{ needs.tools.outputs.qa-artifact }}
kit: ${{ needs.tools.outputs.kit-artifact }}
skip-tools: true
qa-path: ${{ needs.tools.outputs.qa-path }}
kit-path: ${{ needs.tools.outputs.kit-path }}
13 changes: 7 additions & 6 deletions .github/workflows/update-snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ on:
- vue
- angular
- svelte
- lit-vite
version:
required: true
type: number
Expand Down Expand Up @@ -131,7 +132,7 @@ jobs:
name: snapshots-${{ inputs.name }}-v${{ inputs.version }}
path: ${{ steps.get_snapshots.outputs.path }}
retention-days: 7

send:
runs-on: ubuntu-latest
needs: update
Expand All @@ -155,15 +156,15 @@ jobs:
- name: Get path to snapshots
id: snapshots_folder
run: echo "path=./snapshots/${{ inputs.name }}${{ inputs.version }}" >> $GITHUB_OUTPUT

- name: Clear old snapshots
run: rm -rf ${{ steps.snapshots_folder.outputs.path }}

- uses: actions/download-artifact@v3
with:
name: snapshots-${{ inputs.name }}-v${{ inputs.version }}
path: ${{ steps.snapshots_folder.outputs.path }}

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
Expand All @@ -175,5 +176,5 @@ jobs:
branch: update-snapshots-${{ inputs.name }}-v${{ inputs.version }}-${{ inputs.branch }}
body: "Snapshots update for ${{ inputs.name }} v${{ inputs.version }}"
reviewers: Ni55aN


1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules/
/playwright/.cache/
/.rete-qa
/dist
/coverage
90 changes: 17 additions & 73 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"scripts": {
"build": "tsc",
"dev": "tsc --watch",
"lint": "rete lint"
"lint": "rete lint",
"test": "rete test"
},
"author": "Vitaliy Stoliarov",
"license": "MIT",
Expand All @@ -29,11 +30,11 @@
"devDependencies": {
"@types/tinycolor2": "^1.4.3",
"nodemon": "^2.0.20",
"rete-kit": "^1.7.0",
"rete-kit": "^1.8.3",
"typescript": "^4.9.5"
},
"peerDependencies": {
"rete-kit": "^1.7.0"
"rete-kit": "^1.8.3"
},
"dependencies": {
"@playwright/test": "^1.37.1",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added snapshots/lit-vite3/chromium/added-pin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added snapshots/lit-vite3/chromium/customization.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added snapshots/lit-vite3/chromium/disconnected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added snapshots/lit-vite3/chromium/disconnecting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added snapshots/lit-vite3/chromium/initial.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added snapshots/lit-vite3/chromium/moved-pin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added snapshots/lit-vite3/chromium/perf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added snapshots/lit-vite3/chromium/removed-pin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added snapshots/lit-vite3/chromium/scopes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added snapshots/lit-vite3/chromium/selected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added snapshots/lit-vite3/chromium/translate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added snapshots/lit-vite3/firefox/added-pin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added snapshots/lit-vite3/firefox/customization.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added snapshots/lit-vite3/firefox/disconnected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added snapshots/lit-vite3/firefox/disconnecting.png
Binary file added snapshots/lit-vite3/firefox/initial.png
Binary file added snapshots/lit-vite3/firefox/moved-pin.png
Binary file added snapshots/lit-vite3/firefox/perf.png
Binary file added snapshots/lit-vite3/firefox/removed-pin.png
Binary file added snapshots/lit-vite3/firefox/scopes.png
Binary file added snapshots/lit-vite3/firefox/selected.png
Binary file added snapshots/lit-vite3/firefox/translate.png
Binary file added snapshots/lit-vite3/webkit/added-pin.png
Binary file added snapshots/lit-vite3/webkit/customization.png
Binary file added snapshots/lit-vite3/webkit/disconnected.png
Binary file added snapshots/lit-vite3/webkit/disconnecting.png
Binary file added snapshots/lit-vite3/webkit/initial.png
Binary file added snapshots/lit-vite3/webkit/moved-pin.png
Binary file added snapshots/lit-vite3/webkit/perf.png
Binary file added snapshots/lit-vite3/webkit/removed-pin.png
Binary file added snapshots/lit-vite3/webkit/scopes.png
Binary file added snapshots/lit-vite3/webkit/selected.png
Binary file added snapshots/lit-vite3/webkit/translate.png
77 changes: 77 additions & 0 deletions src/commands/init/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import { beforeEach, describe, expect, it } from '@jest/globals'
import { App } from 'rete-kit'

import { fixtures, getFeatures, validate } from './index'

describe('Features', () => {
fixtures.forEach(fixture => {
describe(`Stack: ${fixture.stack}, Version: ${fixture.version}`, () => {
let features: ReturnType<typeof getFeatures> = []

beforeEach(() => {
const next = false

features = getFeatures(fixture, next).filter(Boolean)
})

it('has common features', () => {
expect(features).toContainEqual(expect.any(App.Features.ZoomAt))
expect(features).toContainEqual(expect.any(App.Features.OrderNodes))
expect(features).toContainEqual(expect.any(App.Features.Dataflow))
expect(features).toContainEqual(expect.any(App.Features.Selectable))
expect(features).toContainEqual(expect.any(App.Features.Minimap))
expect(features).toContainEqual(expect.any(App.Features.Reroute))
})

it('has stack specific features', () => {
if (fixture.stack === 'angular') {
expect(features).toContainEqual(expect.any(App.Features.Angular))
} else if (fixture.stack === 'react') {
expect(features).toContainEqual(expect.any(App.Features.React))
} else if (fixture.stack === 'vue') {
expect(features).toContainEqual(expect.any(App.Features.Vue))
} else if (fixture.stack === 'svelte') {
expect(features).toContainEqual(expect.any(App.Features.Svelte))
}
})
})
})
})

describe('Validation', () => {
it('rejects unknown stack names', () => {
const stacks = ['react', 'angular', 'unknown']
const stackVersions = null

const result = validate(stacks, stackVersions)

expect(result.error).toBe('Unknown stack names: unknown')
})

it('throws an error if versions are specified for multiple stacks', () => {
const stacks = ['react', 'angular']
const stackVersions = ['16', '12']

const result = validate(stacks, stackVersions)

expect(result.error).toBe(`You can't specify versions for multiple stacks`)
})

it('throws an error if unsupported versions are specified', () => {
const stacks = ['react']
const stackVersions = ['unknown']

const result = validate(stacks, stackVersions)

expect(result.error).toBe('Unknown stack versions: unknown')
})

it('should return null if no errors are found', () => {
const stacks = ['react']
const stackVersions = ['16', '17']

const result = validate(stacks, stackVersions)

expect(result.error).toBeNull()
})
})
Loading

0 comments on commit fe8fa0f

Please sign in to comment.