Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split xforms-engine/ui-solid packages, update naming of other packages #61

Merged
merged 14 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .changeset/afraid-comics-pump.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@odk/xpath': patch
'@odk-web-forms/xpath': patch
---

Initial evaluator implementation
2 changes: 1 addition & 1 deletion .changeset/blue-papayas-know.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@odk/web-forms': patch
'@odk-web-forms/xforms-engine': patch
'odk-scripts': patch
---

Expand Down
2 changes: 1 addition & 1 deletion .changeset/silver-lemons-mate.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'tree-sitter-xpath': patch
'@odk-web-forms/tree-sitter-xpath': patch
---

Initial implementation of XPath grammar for tree-sitter
2 changes: 1 addition & 1 deletion .changeset/thirty-mails-punch.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'tree-sitter-xpath': patch
'@odk-web-forms/tree-sitter-xpath: patch
---

Fix inclusion of types in package
130 changes: 96 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ jobs:
outputs:
root: ${{ steps.changes.outputs.root }}
odk-common: ${{ steps.changes.outputs.odk-common }}
odk-web-forms: ${{ steps.changes.outputs.odk-web-forms }}
odk-xpath: ${{ steps.changes.outputs.odk-xpath }}
tree-sitter-xpath: ${{ steps.changes.outputs.tree-sitter-xpath }}
xforms-engine: ${{ steps.changes.outputs.xforms-engine }}
xpath: ${{ steps.changes.outputs.xpath }}
ui-solid: ${{ steps.changes.outputs.ui-solid }}
ui-vue: ${{ steps.changes.outputs.ui-vue }}

steps:
Expand All @@ -48,17 +49,20 @@ jobs:
odk-common:
- 'packages/common/**'

odk-web-forms:
- 'packages/odk-web-forms/**'

odk-xpath:
- 'packages/odk-xpath/**'

tree-sitter-xpath:
- 'packages/tree-sitter-xpath/grammar.ts'
- 'packages/tree-sitter-xpath/scripts/**'
- 'packages/tree-sitter-xpath/test/**'

xforms-engine:
- 'packages/xforms-engine/**'

xpath:
- 'packages/xpath/**'

ui-solid:
- 'packages/ui-solid/**'

ui-vue:
- 'packages/ui-vue/**'

Expand Down Expand Up @@ -100,7 +104,6 @@ jobs:
path: |
examples/*/dist
packages/*/dist
vendor-packages/*/dist
packages/tree-sitter-xpath/grammar.js
packages/tree-sitter-xpath/src/grammar.json
packages/tree-sitter-xpath/src/parser.c
Expand All @@ -109,7 +112,7 @@ jobs:
packages/tree-sitter-xpath/types
key: build-${{ matrix.node-version }}-${{ github.sha }}

# `@odk/xpath` tests (currently) expect this time zone
# `@odk-web-forms/xpath` tests (currently) expect this time zone
- uses: szenius/set-timezone@v1.2
with:
timezoneLinux: ${{ env.TZ }}
Expand Down Expand Up @@ -151,7 +154,6 @@ jobs:
path: |
examples/*/dist
packages/*/dist
vendor-packages/*/dist
packages/tree-sitter-xpath/grammar.js
packages/tree-sitter-xpath/src/grammar.json
packages/tree-sitter-xpath/src/parser.c
Expand All @@ -164,7 +166,7 @@ jobs:
- run: 'yarn lint'

odk-common:
name: '@odk/common'
name: '@odk-web-forms/common'
needs: ['install-and-build', 'changes']
if: needs.changes.outputs.root == 'true' || needs.changes.outputs.odk-common == 'true'
runs-on: 'ubuntu-latest'
Expand Down Expand Up @@ -207,7 +209,6 @@ jobs:
path: |
examples/*/dist
packages/*/dist
vendor-packages/*/dist
packages/tree-sitter-xpath/grammar.js
packages/tree-sitter-xpath/src/grammar.json
packages/tree-sitter-xpath/src/parser.c
Expand All @@ -218,21 +219,21 @@ jobs:
fail-on-cache-miss: true

- if: ${{ matrix.target == 'Node' }}
run: 'yarn workspace @odk/common test:types'
run: 'yarn workspace @odk-web-forms/common test:types'

- if: ${{ matrix.target == 'Node' }}
run: 'yarn workspace @odk/common test-node:jsdom'
run: 'yarn workspace @odk-web-forms/common test-node:jsdom'

- if: ${{ matrix.target == 'Web' }}
run: 'yarn playwright install ${{ matrix.browser }} --with-deps'

- if: ${{ matrix.target == 'Web' }}
run: 'yarn workspace @odk/common test-browser:${{ matrix.browser }}'
run: 'yarn workspace @odk-web-forms/common test-browser:${{ matrix.browser }}'

odk-web-forms:
name: '@odk/web-forms'
xforms-engine:
name: '@odk-web-forms/xforms-engine'
needs: ['install-and-build', 'changes']
if: needs.changes.outputs.root == 'true' || needs.changes.outputs.odk-web-forms == 'true'
if: needs.changes.outputs.root == 'true' || needs.changes.outputs.xforms-engine == 'true'
runs-on: 'ubuntu-latest'

strategy:
Expand Down Expand Up @@ -273,7 +274,6 @@ jobs:
path: |
examples/*/dist
packages/*/dist
vendor-packages/*/dist
packages/tree-sitter-xpath/grammar.js
packages/tree-sitter-xpath/src/grammar.json
packages/tree-sitter-xpath/src/parser.c
Expand All @@ -284,21 +284,21 @@ jobs:
fail-on-cache-miss: true

- if: ${{ matrix.target == 'Node' }}
run: 'yarn workspace @odk/web-forms test:types'
run: 'yarn workspace @odk-web-forms/xforms-engine test:types'

- if: ${{ matrix.target == 'Node' }}
run: 'yarn workspace @odk/web-forms test-node:jsdom'
run: 'yarn workspace @odk-web-forms/xforms-engine test-node:jsdom'

- if: ${{ matrix.target == 'Web' }}
run: 'yarn playwright install ${{ matrix.browser }} --with-deps'

- if: ${{ matrix.target == 'Web' }}
run: 'yarn workspace @odk/web-forms test-browser:${{ matrix.browser }}'
run: 'yarn workspace @odk-web-forms/xforms-engine test-browser:${{ matrix.browser }}'

odk-xpath:
name: '@odk/xpath'
xpath:
name: '@odk-web-forms/xpath'
needs: ['install-and-build', 'changes']
if: needs.changes.outputs.root == 'true' || needs.changes.outputs.tree-sitter-xpath == 'true' || needs.changes.outputs.odk-xpath == 'true'
if: needs.changes.outputs.root == 'true' || needs.changes.outputs.tree-sitter-xpath == 'true' || needs.changes.outputs.xpath == 'true'
runs-on: 'ubuntu-latest'

strategy:
Expand Down Expand Up @@ -339,7 +339,6 @@ jobs:
path: |
examples/*/dist
packages/*/dist
vendor-packages/*/dist
packages/tree-sitter-xpath/grammar.js
packages/tree-sitter-xpath/src/grammar.json
packages/tree-sitter-xpath/src/parser.c
Expand All @@ -356,19 +355,19 @@ jobs:
timezoneWindows: ${{ env.TZ }}

- if: ${{ matrix.target == 'Node' }}
run: 'yarn workspace @odk/xpath test:types'
run: 'yarn workspace @odk-web-forms/xpath test:types'

- if: ${{ matrix.target == 'Node' }}
run: 'yarn workspace @odk/xpath test-node:jsdom'
run: 'yarn workspace @odk-web-forms/xpath test-node:jsdom'

- if: ${{ matrix.target == 'Web' }}
run: 'yarn playwright install ${{ matrix.browser }} --with-deps'

- if: ${{ matrix.target == 'Web' }}
run: 'yarn workspace @odk/xpath test-browser:${{ matrix.browser }}'
run: 'yarn workspace @odk-web-forms/xpath test-browser:${{ matrix.browser }}'

tree-sitter-xpath:
name: 'tree-sitter-xpath'
name: '@odk-web-forms/tree-sitter-xpath'
needs: ['install-and-build', 'changes']
if: needs.changes.outputs.root == 'true' || needs.changes.outputs.tree-sitter-xpath == 'true'
runs-on: 'ubuntu-latest'
Expand Down Expand Up @@ -400,7 +399,6 @@ jobs:
path: |
examples/*/dist
packages/*/dist
vendor-packages/*/dist
packages/tree-sitter-xpath/grammar.js
packages/tree-sitter-xpath/src/grammar.json
packages/tree-sitter-xpath/src/parser.c
Expand All @@ -410,7 +408,72 @@ jobs:
key: build-${{ matrix.node-version }}-${{ github.sha }}
fail-on-cache-miss: true

- run: 'yarn workspace tree-sitter-xpath test'
- run: 'yarn workspace @odk-web-forms/tree-sitter-xpath test'

ui-solid:
name: 'ui-solid'
needs: ['install-and-build', 'changes']
if: needs.changes.outputs.root == 'true' || needs.changes.outputs.ui-solid == 'true'
runs-on: 'ubuntu-latest'

strategy:
matrix:
target: ['Node']
node-version: ['18.19.1', '20.11.1']
include:
- target: 'Web'
node-version: '20.11.1'
browser: chromium
- target: 'Web'
node-version: '20.11.1'
browser: firefox
- target: 'Web'
node-version: '20.11.1'
browser: webkit

steps:
- uses: 'actions/checkout@v3'

- uses: 'volta-cli/action@v4'
with:
node-version: '${{ matrix.node-version }}'
yarn-version: '1.22.19'

- uses: 'actions/cache@v3'
id: cache-install
with:
path: |
node_modules
**/node_modules
key: install-${{ matrix.node-version }}-${{ hashFiles('yarn.lock', 'examples/*/yarn.lock', 'packages/*/yarn.lock') }}
fail-on-cache-miss: true

- uses: 'actions/cache@v3'
id: cache-build
with:
path: |
examples/*/dist
packages/*/dist
packages/tree-sitter-xpath/grammar.js
packages/tree-sitter-xpath/src/grammar.json
packages/tree-sitter-xpath/src/parser.c
packages/tree-sitter-xpath/src/tree_sitter/parser.h
packages/tree-sitter-xpath/tree-sitter-xpath.wasm
packages/tree-sitter-xpath/types
key: build-${{ matrix.node-version }}-${{ github.sha }}
fail-on-cache-miss: true

- if: ${{ matrix.target == 'Node' }}
run: 'yarn workspace @odk-web-forms/ui-solid test:types'

- if: ${{ matrix.target == 'Node' }}
run: 'yarn workspace @odk-web-forms/ui-solid test-node:jsdom'

- if: ${{ matrix.target == 'Web' }}
run: 'yarn playwright install ${{ matrix.browser }} --with-deps'

- if: ${{ matrix.target == 'Web' }}
run: 'yarn workspace @odk-web-forms/ui-solid test-browser:${{ matrix.browser }}'

ui-vue:
name: 'ui-vue'
Expand Down Expand Up @@ -456,7 +519,6 @@ jobs:
path: |
examples/*/dist
packages/*/dist
vendor-packages/*/dist
packages/tree-sitter-xpath/grammar.js
packages/tree-sitter-xpath/src/grammar.json
packages/tree-sitter-xpath/src/parser.c
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ node_modules/
dist/
examples/**/dist
packages/**/dist
vendor-packages/**/dist

## Specific to tree-sitter and/or tree-sitter-xpath
## Specific to tree-sitter and/or @odk-web-forms/tree-sitter-xpath
packages/tree-sitter-xpath/bindings/
packages/tree-sitter-xpath/build/
packages/tree-sitter-xpath/src/tree_sitter
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
**/node_modules
**/dist
**/fixtures
!packages/odk-web-forms/src/test/fixtures
!packages/xforms-engine/src/test/fixtures
**/vendor

# Directories
Expand Down
6 changes: 1 addition & 5 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ export default tseslint.config(
'packages/tree-sitter-xpath/grammar.js',
'packages/tree-sitter-xpath/bindings/**/*',
'packages/tree-sitter-xpath/types/**/*',
'vendor-packages/**/dist/**/*',
'**/vendor',
],
},
Expand Down Expand Up @@ -265,7 +264,6 @@ export default tseslint.config(
'./packages/ui-vue/tsconfig.node.json',
'./packages/ui-vue/tsconfig.vitest.json',

'./vendor-packages/**/tsconfig.json',
'./scripts/tsconfig.json',
],
},
Expand Down Expand Up @@ -396,8 +394,8 @@ export default tseslint.config(
'packages/*/playwright.config.ts',
'packages/*/vite.config.ts',
'packages/*/vitest.config.ts',
'packages/xforms-engine/vite.*.config.ts',
'packages/*/tools/**/*',
'vendor-packages/*/vite.config.ts',

// TODO: in theory, all e2e tests (if they continue to be run with
// Playwright) are technically run in a "Node" environment, although
Expand Down Expand Up @@ -426,5 +424,3 @@ export default tseslint.config(
},
}
);

globalThis.foo = 'bar';
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
},
"workspaces": [
"packages/*",
"vendor-packages/*",
"scripts"
],
"scripts": {
Expand Down
7 changes: 5 additions & 2 deletions packages/common/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @odk/common (private package)
# @odk-web-forms/common (private package)

An internal package to address common (e.g. the dreaded "utils") concerns across two or more getodk/web-forms packages. There have already been several such cross-cutting concerns.

Expand All @@ -15,4 +15,7 @@ Being an internal package, for now there is no build step: downstream packages s

- downstream package setup concerns
- consideration for downstream build and bundle impact
- usage in a package intended for both internal and external purposes (i.e. packages such as `tree-sitter-xpath` or `@odk/xpath` which are used in `@odk/web-forms` but may also be used on their own)
- usage in a package intended for both internal and external purposes (i.e.
packages such as `@odk-web-forms/tree-sitter-xpath` or `@odk-web-forms/xpath`
which are used in `@odk-web-forms/xforms-engine` but may also be used on their
own)
Loading
Loading