Skip to content

Commit

Permalink
test: add typecheck test
Browse files Browse the repository at this point in the history
  • Loading branch information
mewton committed Oct 14, 2023
1 parent e874080 commit 46f874a
Show file tree
Hide file tree
Showing 25 changed files with 411 additions and 59 deletions.
27 changes: 25 additions & 2 deletions .github/actions/init-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,35 @@ runs:
with:
path: |
./node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('./yarn.lock') }}
./**/node_modules
./.yarn/cache
key: node-modules-${{ runner.os }}-${{ hashFiles('./**/yarn.lock') }}
restore-keys: |
node-modules-${{ runner.os }}-${{ hashFiles('./yarn.lock') }}
node-modules-${{ runner.os }}-${{ hashFiles('./**/yarn.lock') }}
node-modules-${{ runner.os }}-
node-modules--
- if: steps.cache_node_modules.outputs.cache-hit != 'true'
run: yarn --immutable
shell: bash

- if: steps.cache_node_modules.outputs.cache-hit != 'true'
working-directory: ./examples/enclosure-vue3
run: yarn --immutable
shell: bash

- if: steps.cache_node_modules.outputs.cache-hit != 'true'
working-directory: ./examples/enclosure-vue2.7
run: yarn --immutable
shell: bash

- if: steps.cache_node_modules.outputs.cache-hit != 'true'
working-directory: ./examples/insider-vue3
run: yarn --immutable
shell: bash

- if: steps.cache_node_modules.outputs.cache-hit != 'true'
working-directory: ./examples/insider-vue2.7
run: yarn --immutable
shell: bash

65 changes: 63 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ jobs:
- uses: ./.github/actions/build-and-cache
- run: yarn test

test__typecheck:
name: 'Test: TypeCheck'
test__typecheck__enclosure_vue:
name: 'Test: [package/enclosure-vue] TypeCheck'
runs-on: ubuntu-latest
needs:
- build
Expand All @@ -50,3 +50,64 @@ jobs:
- uses: ./.github/actions/init-node
- uses: ./.github/actions/build-and-cache
- run: yarn typecheck
working-directory: packages/enclosure-vue

test__typecheck__insider_vue:
name: 'Test: [package/insider-vue] TypeCheck'
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/init-node
- uses: ./.github/actions/build-and-cache
- run: yarn typecheck
working-directory: packages/insider-vue

test__typecheck__example_enclosure_vue_3:
name: 'Test: [example/enclosure-vue3] TypeCheck'
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/init-node
- uses: ./.github/actions/build-and-cache
- run: yarn typecheck
working-directory: example/enclosure-vue3

test__typecheck__example_enclosure_vue_2_7:
name: 'Test: [example/enclosure-vue2.7] TypeCheck'
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/init-node
- uses: ./.github/actions/build-and-cache
- run: yarn typecheck
working-directory: example/enclosure-vue2.7

test__typecheck__example_insider_vue_3:
name: 'Test: [example/insider-vue3] TypeCheck'
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/init-node
- uses: ./.github/actions/build-and-cache
- run: yarn typecheck
working-directory: example/insider-vue3

test__typecheck__example_insider_vue_2_7:
name: 'Test: [example/insider-vue2.7] TypeCheck'
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/init-node
- uses: ./.github/actions/build-and-cache
- run: yarn typecheck
working-directory: example/insider-vue2.7
5 changes: 3 additions & 2 deletions examples/enclosure-vue2.7/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "module",
"scripts": {
"dev": "vite . --port 5173",
"typecheck": "tsc --noEmit"
"typecheck": "vue-tsc --noEmit --composite false"
},
"devDependencies": {
"@passerelle/enclosure-vue": "file:../../packages/enclosure-vue",
Expand All @@ -13,6 +13,7 @@
"vite-plugin-vue2": "^2.0.3",
"vue": "~2.7.0",
"vue-router": "~3.6.5",
"vue-template-compiler": "~2.7.0"
"vue-template-compiler": "~2.7.0",
"vue-tsc": "^1.6.5"
}
}
133 changes: 126 additions & 7 deletions examples/enclosure-vue2.7/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ __metadata:
languageName: node
linkType: hard

"@babel/parser@npm:^7.17.9, @babel/parser@npm:^7.18.4, @babel/parser@npm:^7.22.15, @babel/parser@npm:^7.23.0":
"@babel/parser@npm:^7.17.9, @babel/parser@npm:^7.18.4, @babel/parser@npm:^7.21.3, @babel/parser@npm:^7.22.15, @babel/parser@npm:^7.23.0":
version: 7.23.0
resolution: "@babel/parser@npm:7.23.0"
bin:
Expand Down Expand Up @@ -854,6 +854,33 @@ __metadata:
languageName: node
linkType: hard

"@volar/language-core@npm:1.10.4, @volar/language-core@npm:~1.10.4":
version: 1.10.4
resolution: "@volar/language-core@npm:1.10.4"
dependencies:
"@volar/source-map": 1.10.4
checksum: 9e9a010d8fedc11a7408f6e8bcf1f746671ec7dbbfe8ed00e5c0363c077cb074775c6626838829ce77fd02bc1cc3061938cb4fc5267a421b0056f3f8c8c2a7d7
languageName: node
linkType: hard

"@volar/source-map@npm:1.10.4, @volar/source-map@npm:~1.10.4":
version: 1.10.4
resolution: "@volar/source-map@npm:1.10.4"
dependencies:
muggle-string: ^0.3.1
checksum: 03b39d96e955f9953aef25a4776b2ae046d78e752f4c95784f633555fa5ff94072aef5a73cbe3862c2e1f4463c6138b44fad9fb8b1d9cf3bc77be264dec75307
languageName: node
linkType: hard

"@volar/typescript@npm:~1.10.4":
version: 1.10.4
resolution: "@volar/typescript@npm:1.10.4"
dependencies:
"@volar/language-core": 1.10.4
checksum: 528602d520df712eb302fe34a865dfa396b053b118984207f8284eb602a67266ba043c2eadd3af8bcdcf0cd063245c060af8ed0c17df6a74f89f72df9a2a3e4d
languageName: node
linkType: hard

"@vue/babel-helper-vue-jsx-merge-props@npm:^1.2.1, @vue/babel-helper-vue-jsx-merge-props@npm:^1.4.0":
version: 1.4.0
resolution: "@vue/babel-helper-vue-jsx-merge-props@npm:1.4.0"
Expand Down Expand Up @@ -972,6 +999,28 @@ __metadata:
languageName: node
linkType: hard

"@vue/compiler-core@npm:3.3.4":
version: 3.3.4
resolution: "@vue/compiler-core@npm:3.3.4"
dependencies:
"@babel/parser": ^7.21.3
"@vue/shared": 3.3.4
estree-walker: ^2.0.2
source-map-js: ^1.0.2
checksum: 5437942ea6575b316c9cd84f4f128a44939713da8b6958060e152c599e6d771d5db056c398d7574ee706ff8092e0d99ac4f14e7eef8712a8dd923d2323201b9e
languageName: node
linkType: hard

"@vue/compiler-dom@npm:^3.3.0":
version: 3.3.4
resolution: "@vue/compiler-dom@npm:3.3.4"
dependencies:
"@vue/compiler-core": 3.3.4
"@vue/shared": 3.3.4
checksum: 1c2ac0c89de8eef7be1c568d57504e6245adaaec40c2c4d9717bc231ca10bf682d918a3b358d24c786eeaf8e0d7eb8a65f57d9044775a304783fde1d069a1896
languageName: node
linkType: hard

"@vue/compiler-sfc@npm:2.7.14":
version: 2.7.14
resolution: "@vue/compiler-sfc@npm:2.7.14"
Expand Down Expand Up @@ -1003,6 +1052,53 @@ __metadata:
languageName: node
linkType: hard

"@vue/language-core@npm:1.8.19":
version: 1.8.19
resolution: "@vue/language-core@npm:1.8.19"
dependencies:
"@volar/language-core": ~1.10.4
"@volar/source-map": ~1.10.4
"@vue/compiler-dom": ^3.3.0
"@vue/reactivity": ^3.3.0
"@vue/shared": ^3.3.0
minimatch: ^9.0.3
muggle-string: ^0.3.1
vue-template-compiler: ^2.7.14
peerDependencies:
typescript: "*"
peerDependenciesMeta:
typescript:
optional: true
checksum: f540cde61849786252f2964aeee37f04ec5810c8bca378ff2554c0888e595121b531915b88c5f9cd8d128bf88ae6bda877a57de4e900014c83e224b7a4c8b947
languageName: node
linkType: hard

"@vue/reactivity@npm:^3.3.0":
version: 3.3.4
resolution: "@vue/reactivity@npm:3.3.4"
dependencies:
"@vue/shared": 3.3.4
checksum: 81c3d0c587d23656a57a7a31afb51357274f6512b51baffc67cda183b2361a7e65e646029c26a8bc28587f26b65bba808dcd93cdd3bacab48d2b99d11ad0ec97
languageName: node
linkType: hard

"@vue/shared@npm:3.3.4, @vue/shared@npm:^3.3.0":
version: 3.3.4
resolution: "@vue/shared@npm:3.3.4"
checksum: 12fe53ff816bfa29ea53f89212067a86512c626b8d30149ff28b36705820f6150e1fb4e4e46897ad9eddb1d1cfc02d8941053939910eed69a905f7a5509baabe
languageName: node
linkType: hard

"@vue/typescript@npm:1.8.19":
version: 1.8.19
resolution: "@vue/typescript@npm:1.8.19"
dependencies:
"@volar/typescript": ~1.10.4
"@vue/language-core": 1.8.19
checksum: 52226a298f40b5378ec89387f30f62e4cb46f41c56fb5c6a6bf56ebdae9c735e3ec95bfb33de841fddafd277f6948197327fc6fd3b50881b8ea6b6d5cc65b3d4
languageName: node
linkType: hard

"abbrev@npm:^1.0.0":
version: 1.1.1
resolution: "abbrev@npm:1.1.1"
Expand Down Expand Up @@ -1551,7 +1647,7 @@ __metadata:
languageName: node
linkType: hard

"estree-walker@npm:^2.0.1":
"estree-walker@npm:^2.0.1, estree-walker@npm:^2.0.2":
version: 2.0.2
resolution: "estree-walker@npm:2.0.2"
checksum: 6151e6f9828abe2259e57f5fd3761335bb0d2ebd76dc1a01048ccee22fabcfef3c0859300f6d83ff0d1927849368775ec5a6d265dde2f6de5a1be1721cd94efc
Expand All @@ -1578,6 +1674,7 @@ __metadata:
vue: ~2.7.0
vue-router: ~3.6.5
vue-template-compiler: ~2.7.0
vue-tsc: ^1.6.5
languageName: unknown
linkType: soft

Expand All @@ -1597,11 +1694,11 @@ __metadata:

"fixtures-enclosure@file:../../fixtures/enclosure::locator=example-enclosure-vue2%40workspace%3A.":
version: 0.0.0
resolution: "fixtures-enclosure@file:../../fixtures/enclosure#../../fixtures/enclosure::hash=d260b0&locator=example-enclosure-vue2%40workspace%3A."
resolution: "fixtures-enclosure@file:../../fixtures/enclosure#../../fixtures/enclosure::hash=ea5636&locator=example-enclosure-vue2%40workspace%3A."
dependencies:
json-editor-vue: ^0.10.19
vanilla-jsoneditor: ^0.18.8
checksum: 1daf7c662fcbedea95238ee5cf65b6c10786510202e41bd3b2c891c6125e6e1f5e93fcb09c2a1a1508f554bc0328ff3728ec4e7e39372e129c7f21cd8527cc5d
checksum: e76644bdf7e36079c6afc9f4b974e6e4e8f8e3926b0e6356309ae85608791e8da77b2ae99ea7e89a9eb72523a2d12a45f42febbe726f2d54a41d18a9427d695e
languageName: node
linkType: hard

Expand Down Expand Up @@ -2097,7 +2194,7 @@ __metadata:
languageName: node
linkType: hard

"minimatch@npm:^9.0.1":
"minimatch@npm:^9.0.1, minimatch@npm:^9.0.3":
version: 9.0.3
resolution: "minimatch@npm:9.0.3"
dependencies:
Expand Down Expand Up @@ -2213,6 +2310,13 @@ __metadata:
languageName: node
linkType: hard

"muggle-string@npm:^0.3.1":
version: 0.3.1
resolution: "muggle-string@npm:0.3.1"
checksum: f2357f906e0160b7df0179c77838cf859f3ca23cb74eca7c043b9fc9e1e416d91497c80fbe2f3c9aeb003c14ad15857fc4e94f1631e8a6695b07e4135626d305
languageName: node
linkType: hard

"nanoid@npm:^3.3.6":
version: 3.3.6
resolution: "nanoid@npm:3.3.6"
Expand Down Expand Up @@ -2512,7 +2616,7 @@ __metadata:
languageName: node
linkType: hard

"semver@npm:^7.3.5":
"semver@npm:^7.3.5, semver@npm:^7.5.4":
version: 7.5.4
resolution: "semver@npm:7.5.4"
dependencies:
Expand Down Expand Up @@ -2971,7 +3075,7 @@ __metadata:
languageName: node
linkType: hard

"vue-template-compiler@npm:~2.7.0":
"vue-template-compiler@npm:^2.7.14, vue-template-compiler@npm:~2.7.0":
version: 2.7.14
resolution: "vue-template-compiler@npm:2.7.14"
dependencies:
Expand All @@ -2988,6 +3092,21 @@ __metadata:
languageName: node
linkType: hard

"vue-tsc@npm:^1.6.5":
version: 1.8.19
resolution: "vue-tsc@npm:1.8.19"
dependencies:
"@vue/language-core": 1.8.19
"@vue/typescript": 1.8.19
semver: ^7.5.4
peerDependencies:
typescript: "*"
bin:
vue-tsc: bin/vue-tsc.js
checksum: 0d5e9d2a06a3643a1a1f4d5421bec6e40c4948be3b6517e0d88f142292772a090393c8986de72d245e8b050393286d4227f110470359ca19f875bff0c62a2b3d
languageName: node
linkType: hard

"vue@npm:~2.7.0":
version: 2.7.14
resolution: "vue@npm:2.7.14"
Expand Down
2 changes: 1 addition & 1 deletion examples/enclosure-vue3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "module",
"scripts": {
"dev": "vite . --port 5173",
"typecheck": "vue-tsc --noEmit"
"typecheck": "vue-tsc --noEmit --composite false"
},
"devDependencies": {
"@passerelle/enclosure-vue": "file:../../packages/enclosure-vue",
Expand Down
3 changes: 2 additions & 1 deletion examples/enclosure-vue3/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import HomeView from '../views/HomeView.vue'
import BridgeView from '../views/BridgeView.vue'

const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
// eslint-disable-next-line @typescript-eslint/no-explicit-any
history: createWebHistory((import.meta as any).env.BASE_URL),
routes: [
{
path: "/",
Expand Down
Loading

0 comments on commit 46f874a

Please sign in to comment.