From b378e388796dbf4316f4d22635f1c05f62a87d91 Mon Sep 17 00:00:00 2001 From: mew-ton Date: Mon, 23 Oct 2023 00:26:59 +0900 Subject: [PATCH] feat: #6 support vue2 / optional API (#7) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: composable の構成を変更 (optional api サポートと vue2 向け) * fix: 微修正 * fix: 微調整 * fix: 微調整 * fix: 微調整 * fix: 微調整 * update: dependencies * fix: structure * fix: support vue2, vue-router4 * chore: ついで * fix: script * fix: nuxt 配下の playground を移設 * feat: [wip] 一旦 enclosure-nuxt で nuxt2 向けのビルドができるところまでは対応 * fix: 構成変更 * fix: vue2 の playground を頑張って作ってみたけど、 packages 周りでしんどくなったところまで * fix: monorepo の分離 * fix: 構造変更と型安全にならない問題の対応 * feat: add example vue2.6 * feat: example/insider-vue2* 以外は動いた * WIP * fix: example でデバッグしながらライブラリの出力をきれいにした * fix: enclosure-vue 2.7 で iframe に src が反映されない問題の対応 * fix: example の細かい対応漏れの修正 * fix: テスト用コンポーネントの更新と、見つかった細かい不具合の修正 * fix: layout 取得のテスト vue3 はできたが・・ vue2.7 x optionalがまだ * test: add typecheck test * fix: update yarn.lock * fix: update yarn.lock * fix: failed actions * fix: failed actions * fix: failed actions * fix: failed actions * fix: failed actions * fix: failed actions * fix: failed actions * fix: failed actions * fix: failed typecheck * fix: types * fix: types * update misc * fix: failed tests * fix: syntax error * fix: min * versioning --------- Co-authored-by: mewton --- .changeset/funny-hounds-promise.md | 6 + .changeset/sixty-rocks-tan.md | 6 +- .github/actions/build-and-cache/action.yml | 20 - .github/actions/init-node/action.yml | 50 +- .github/workflows/release.yml | 5 +- .github/workflows/test.yml | 68 +- .gitignore | 29 + .vscode/project.code-workspace | 39 +- examples/enclosure-vue2.7/.yarnrc.yml | 3 + examples/enclosure-vue2.7/index.html | 13 + examples/enclosure-vue2.7/package.json | 24 + examples/enclosure-vue2.7/src/App.vue | 42 + .../enclosure-vue2.7}/src/assets/css/base.css | 0 .../enclosure-vue2.7}/src/assets/css/main.css | 8 +- .../enclosure-vue2.7}/src/assets/logo.svg | 0 .../src/components/Header.vue | 22 +- examples/enclosure-vue2.7/src/main.ts | 17 + examples/enclosure-vue2.7/src/router/index.ts | 21 + .../enclosure-vue2.7/src/views/BridgeView.vue | 64 + .../enclosure-vue2.7/src/views/HomeView.vue | 5 + examples/enclosure-vue2.7/tsconfig.json | 12 + examples/enclosure-vue2.7/vite.config.ts | 17 + examples/enclosure-vue2.7/yarn.lock | 3194 +++++ examples/enclosure-vue3/.yarnrc.yml | 3 + .../enclosure-vue3}/index.html | 0 examples/enclosure-vue3/package.json | 23 + .../enclosure-vue3}/src/App.vue | 4 +- .../enclosure-vue3}/src/assets/css/base.css | 0 .../enclosure-vue3}/src/assets/css/main.css | 0 .../enclosure-vue3}/src/assets/logo.svg | 0 .../enclosure-vue3}/src/components/Header.vue | 2 +- .../enclosure-vue3}/src/main.ts | 4 - .../enclosure-vue3}/src/router/index.ts | 3 +- .../enclosure-vue3}/src/views/BridgeView.vue | 32 +- .../enclosure-vue3}/src/views/HomeView.vue | 0 examples/enclosure-vue3/tsconfig.json | 12 + .../enclosure-vue3}/vite.config.ts | 5 +- examples/enclosure-vue3/yarn.lock | 2148 +++ examples/insider-vue2.7/.yarnrc.yml | 3 + .../insider-vue2.7}/index.html | 0 examples/insider-vue2.7/package.json | 24 + examples/insider-vue2.7/src/App.vue | 31 + .../insider-vue2.7}/src/assets/css/base.css | 0 .../insider-vue2.7}/src/assets/css/main.css | 0 examples/insider-vue2.7/src/assets/logo.svg | 1 + .../insider-vue2.7}/src/components/Header.vue | 21 +- .../insider-vue2.7}/src/lib/types.ts | 2 +- examples/insider-vue2.7/src/main.ts | 21 + .../insider-vue2.7}/src/router/index.ts | 6 +- .../insider-vue2.7/src/views/AboutView.vue | 5 + .../insider-vue2.7/src/views/ContactView.vue | 5 + .../insider-vue2.7/src/views/WorksView.vue | 5 + examples/insider-vue2.7/tsconfig.json | 12 + examples/insider-vue2.7/vite.config.ts | 18 + examples/insider-vue2.7/yarn.lock | 3188 +++++ examples/insider-vue3/.yarnrc.yml | 3 + examples/insider-vue3/index.html | 13 + examples/insider-vue3/package.json | 23 + .../insider-vue3}/src/App.vue | 8 +- .../insider-vue3}/src/assets/css/base.css | 0 .../insider-vue3}/src/assets/css/main.css | 0 examples/insider-vue3/src/assets/logo.svg | 1 + .../insider-vue3}/src/components/Header.vue | 5 +- examples/insider-vue3/src/lib/types.ts | 10 + .../insider-vue3}/src/main.ts | 4 +- examples/insider-vue3/src/router/index.ts | 28 + .../insider-vue3}/src/views/AboutView.vue | 0 .../insider-vue3}/src/views/ContactView.vue | 0 .../insider-vue3}/src/views/WorksView.vue | 0 examples/insider-vue3/tsconfig.json | 9 + .../insider-vue3}/vite.config.ts | 4 +- examples/insider-vue3/yarn.lock | 2132 +++ .../env.d.ts | 2 +- fixtures/enclosure/package.json | 20 + fixtures/enclosure/src/index.ts | 3 + .../enclosure/src/internals/Playground.vue | 86 + .../src/internals/Tag.vue | 9 +- fixtures/enclosure/src/internals/Tags.vue | 109 + .../internals/composition/DataReceivedLog.vue | 43 + .../src/internals/composition/DataSender.vue | 48 + .../internals/composition/TransitionLog.vue | 101 + .../internals/optional/DataReceivedLog.vue | 40 + .../src/internals/optional/DataSender.vue | 48 + .../src/internals/optional/TransitionLog.vue | 109 + fixtures/enclosure/src/internals/type.ts | 5 + .../tsconfig.json | 3 +- fixtures/insider/env.d.ts | 5 + fixtures/insider/package.json | 22 + fixtures/insider/src/index.ts | 4 + fixtures/insider/src/internals/Playground.vue | 90 + fixtures/insider/src/internals/Tag.vue | 62 + fixtures/insider/src/internals/Tags.vue | 110 + .../internals/composition/DataReceivedLog.vue | 18 + .../src/internals/composition/DataSender.vue | 43 + .../src/internals/composition/LayoutView.vue | 59 + .../internals/composition/TransitionLog.vue | 60 + .../internals/optional/DataReceivedLog.vue | 27 + .../src/internals/optional/DataSender.vue | 42 + .../src/internals/optional/LayoutView.vue | 73 + .../src/internals/optional/TransitionLog.vue | 69 + fixtures/insider/src/internals/type.ts | 5 + fixtures/insider/tsconfig.json | 9 + fixtures/playground-enclosure/package.json | 17 - .../playground-enclosure/static/index.html | 0 fixtures/playground-insider/package.json | 17 - .../playground-insider/static/assets/base.css | 74 - .../static/assets/layout.css | 55 - .../playground-insider/static/assets/logo.svg | 8 - fixtures/playground-insider/static/index.html | 54 - .../playground-vue-components/package.json | 11 - .../playground-vue-components/src/index.ts | 3 - .../src/internals/DataReceivedLog.vue | 1 - .../src/internals/DataSender.vue | 1 - .../src/internals/LayoutView.vue | 1 - .../src/internals/Tags.vue | 80 - .../src/internals/TransitionLog.vue | 7 - .../src/internals/index.vue | 88 - .../src/internals/type.ts | 10 - package.json | 9 +- packages/enclosure-nuxt/.gitignore | 56 - packages/enclosure-nuxt/.npmrc | 2 - packages/enclosure-nuxt/.nuxtrc | 2 - packages/enclosure-nuxt/README.md | 1 - packages/enclosure-nuxt/package.json | 59 - .../enclosure-nuxt/playground/nuxt.config.ts | 13 - .../enclosure-nuxt/playground/package.json | 8 - .../enclosure-nuxt/playground/src/app.vue | 5 - .../playground/src/assets/logo.svg | 3 - .../playground/src/layouts/default.vue | 21 - .../playground/src/pages/bridge/[...path].vue | 47 - .../playground/src/pages/index.vue | 1 - .../enclosure-nuxt/playground/tsconfig.json | 3 - packages/enclosure-nuxt/src/module.ts | 23 - packages/enclosure-nuxt/test/basic.test.ts | 15 - .../test/fixtures/basic/app.vue | 6 - .../test/fixtures/basic/nuxt.config.ts | 7 - .../test/fixtures/basic/package.json | 5 - packages/enclosure-nuxt/tsconfig.json | 3 - packages/enclosure-vue/README.md | 171 + packages/enclosure-vue/env.d.ts | 6 +- packages/enclosure-vue/package.json | 33 +- .../enclosure-vue/playground/tsconfig.json | 9 - packages/enclosure-vue/src/component.ts | 203 + .../src/components/BridgeFrame.vue | 156 - packages/enclosure-vue/src/composables.ts | 175 + .../src/composables/useIframeBridge.ts | 78 - packages/enclosure-vue/src/index.ts | 16 +- packages/enclosure-vue/src/lib/types.ts | 25 - packages/enclosure-vue/src/types.ts | 54 + packages/enclosure-vue/tsconfig.json | 3 +- packages/enclosure-vue/vite.config.ts | 3 + packages/insider-nuxt/.npmrc | 2 - packages/insider-nuxt/.nuxtrc | 2 - packages/insider-nuxt/README.md | 1 - packages/insider-nuxt/package.json | 59 - .../insider-nuxt/playground/nuxt.config.ts | 17 - packages/insider-nuxt/playground/package.json | 8 - packages/insider-nuxt/playground/src/app.vue | 5 - .../playground/src/assets/logo.svg | 3 - .../playground/src/layouts/default.vue | 12 - .../playground/src/pages/about.vue | 1 - .../playground/src/pages/contact.vue | 1 - .../playground/src/pages/index.vue | 1 - .../playground/src/pages/works.vue | 1 - .../insider-nuxt/playground/tsconfig.json | 3 - packages/insider-nuxt/src/module.ts | 60 - packages/insider-nuxt/test/basic.test.ts | 15 - .../insider-nuxt/test/fixtures/basic/app.vue | 6 - .../test/fixtures/basic/nuxt.config.ts | 7 - .../test/fixtures/basic/package.json | 5 - packages/insider-nuxt/tsconfig.json | 3 - packages/insider-vue/README.md | 155 +- packages/insider-vue/env.d.ts | 4 + packages/insider-vue/package.json | 27 +- packages/insider-vue/src/communicator.ts | 190 +- packages/insider-vue/src/composables.ts | 65 +- packages/insider-vue/src/index.ts | 33 +- packages/insider-vue/tsconfig.json | 2 +- packages/insider-vue/vite.config.ts | 28 +- turbo.json | 8 +- yarn.lock | 11521 ++++------------ 181 files changed, 16418 insertions(+), 10282 deletions(-) create mode 100644 .changeset/funny-hounds-promise.md delete mode 100644 .github/actions/build-and-cache/action.yml create mode 100644 examples/enclosure-vue2.7/.yarnrc.yml create mode 100644 examples/enclosure-vue2.7/index.html create mode 100644 examples/enclosure-vue2.7/package.json create mode 100644 examples/enclosure-vue2.7/src/App.vue rename {packages/enclosure-nuxt/playground => examples/enclosure-vue2.7}/src/assets/css/base.css (100%) rename {packages/enclosure-nuxt/playground => examples/enclosure-vue2.7}/src/assets/css/main.css (79%) rename {packages/enclosure-vue/playground => examples/enclosure-vue2.7}/src/assets/logo.svg (100%) rename {packages/enclosure-nuxt/playground => examples/enclosure-vue2.7}/src/components/Header.vue (68%) create mode 100644 examples/enclosure-vue2.7/src/main.ts create mode 100644 examples/enclosure-vue2.7/src/router/index.ts create mode 100644 examples/enclosure-vue2.7/src/views/BridgeView.vue create mode 100644 examples/enclosure-vue2.7/src/views/HomeView.vue create mode 100644 examples/enclosure-vue2.7/tsconfig.json create mode 100644 examples/enclosure-vue2.7/vite.config.ts create mode 100644 examples/enclosure-vue2.7/yarn.lock create mode 100644 examples/enclosure-vue3/.yarnrc.yml rename {packages/enclosure-vue/playground => examples/enclosure-vue3}/index.html (100%) create mode 100644 examples/enclosure-vue3/package.json rename {packages/enclosure-vue/playground => examples/enclosure-vue3}/src/App.vue (76%) rename {packages/enclosure-vue/playground => examples/enclosure-vue3}/src/assets/css/base.css (100%) rename {packages/enclosure-vue/playground => examples/enclosure-vue3}/src/assets/css/main.css (100%) rename {packages/insider-vue/playground => examples/enclosure-vue3}/src/assets/logo.svg (100%) rename {packages/enclosure-vue/playground => examples/enclosure-vue3}/src/components/Header.vue (96%) rename {packages/enclosure-vue/playground => examples/enclosure-vue3}/src/main.ts (71%) rename {packages/enclosure-vue/playground => examples/enclosure-vue3}/src/router/index.ts (75%) rename {packages/enclosure-vue/playground => examples/enclosure-vue3}/src/views/BridgeView.vue (57%) rename {packages/enclosure-vue/playground => examples/enclosure-vue3}/src/views/HomeView.vue (100%) create mode 100644 examples/enclosure-vue3/tsconfig.json rename {packages/enclosure-vue/playground => examples/enclosure-vue3}/vite.config.ts (70%) create mode 100644 examples/enclosure-vue3/yarn.lock create mode 100644 examples/insider-vue2.7/.yarnrc.yml rename {packages/insider-vue/playground => examples/insider-vue2.7}/index.html (100%) create mode 100644 examples/insider-vue2.7/package.json create mode 100644 examples/insider-vue2.7/src/App.vue rename {packages/insider-nuxt/playground => examples/insider-vue2.7}/src/assets/css/base.css (100%) rename {packages/insider-nuxt/playground => examples/insider-vue2.7}/src/assets/css/main.css (100%) create mode 100644 examples/insider-vue2.7/src/assets/logo.svg rename {packages/insider-nuxt/playground => examples/insider-vue2.7}/src/components/Header.vue (69%) rename {packages/insider-vue/playground => examples/insider-vue2.7}/src/lib/types.ts (76%) create mode 100644 examples/insider-vue2.7/src/main.ts rename {packages/insider-vue/playground => examples/insider-vue2.7}/src/router/index.ts (75%) create mode 100644 examples/insider-vue2.7/src/views/AboutView.vue create mode 100644 examples/insider-vue2.7/src/views/ContactView.vue create mode 100644 examples/insider-vue2.7/src/views/WorksView.vue create mode 100644 examples/insider-vue2.7/tsconfig.json create mode 100644 examples/insider-vue2.7/vite.config.ts create mode 100644 examples/insider-vue2.7/yarn.lock create mode 100644 examples/insider-vue3/.yarnrc.yml create mode 100644 examples/insider-vue3/index.html create mode 100644 examples/insider-vue3/package.json rename {packages/insider-vue/playground => examples/insider-vue3}/src/App.vue (73%) rename {packages/insider-vue/playground => examples/insider-vue3}/src/assets/css/base.css (100%) rename {packages/insider-vue/playground => examples/insider-vue3}/src/assets/css/main.css (100%) create mode 100644 examples/insider-vue3/src/assets/logo.svg rename {packages/insider-vue/playground => examples/insider-vue3}/src/components/Header.vue (89%) create mode 100644 examples/insider-vue3/src/lib/types.ts rename {packages/insider-vue/playground => examples/insider-vue3}/src/main.ts (65%) create mode 100644 examples/insider-vue3/src/router/index.ts rename {packages/insider-vue/playground => examples/insider-vue3}/src/views/AboutView.vue (100%) rename {packages/insider-vue/playground => examples/insider-vue3}/src/views/ContactView.vue (100%) rename {packages/insider-vue/playground => examples/insider-vue3}/src/views/WorksView.vue (100%) create mode 100644 examples/insider-vue3/tsconfig.json rename {packages/insider-vue/playground => examples/insider-vue3}/vite.config.ts (71%) create mode 100644 examples/insider-vue3/yarn.lock rename fixtures/{playground-vue-components => enclosure}/env.d.ts (64%) create mode 100644 fixtures/enclosure/package.json create mode 100644 fixtures/enclosure/src/index.ts create mode 100644 fixtures/enclosure/src/internals/Playground.vue rename fixtures/{playground-vue-components => enclosure}/src/internals/Tag.vue (85%) create mode 100644 fixtures/enclosure/src/internals/Tags.vue create mode 100644 fixtures/enclosure/src/internals/composition/DataReceivedLog.vue create mode 100644 fixtures/enclosure/src/internals/composition/DataSender.vue create mode 100644 fixtures/enclosure/src/internals/composition/TransitionLog.vue create mode 100644 fixtures/enclosure/src/internals/optional/DataReceivedLog.vue create mode 100644 fixtures/enclosure/src/internals/optional/DataSender.vue create mode 100644 fixtures/enclosure/src/internals/optional/TransitionLog.vue create mode 100644 fixtures/enclosure/src/internals/type.ts rename fixtures/{playground-vue-components => enclosure}/tsconfig.json (82%) create mode 100644 fixtures/insider/env.d.ts create mode 100644 fixtures/insider/package.json create mode 100644 fixtures/insider/src/index.ts create mode 100644 fixtures/insider/src/internals/Playground.vue create mode 100644 fixtures/insider/src/internals/Tag.vue create mode 100644 fixtures/insider/src/internals/Tags.vue create mode 100644 fixtures/insider/src/internals/composition/DataReceivedLog.vue create mode 100644 fixtures/insider/src/internals/composition/DataSender.vue create mode 100644 fixtures/insider/src/internals/composition/LayoutView.vue create mode 100644 fixtures/insider/src/internals/composition/TransitionLog.vue create mode 100644 fixtures/insider/src/internals/optional/DataReceivedLog.vue create mode 100644 fixtures/insider/src/internals/optional/DataSender.vue create mode 100644 fixtures/insider/src/internals/optional/LayoutView.vue create mode 100644 fixtures/insider/src/internals/optional/TransitionLog.vue create mode 100644 fixtures/insider/src/internals/type.ts create mode 100644 fixtures/insider/tsconfig.json delete mode 100644 fixtures/playground-enclosure/package.json delete mode 100644 fixtures/playground-enclosure/static/index.html delete mode 100644 fixtures/playground-insider/package.json delete mode 100644 fixtures/playground-insider/static/assets/base.css delete mode 100644 fixtures/playground-insider/static/assets/layout.css delete mode 100644 fixtures/playground-insider/static/assets/logo.svg delete mode 100644 fixtures/playground-insider/static/index.html delete mode 100644 fixtures/playground-vue-components/package.json delete mode 100644 fixtures/playground-vue-components/src/index.ts delete mode 100644 fixtures/playground-vue-components/src/internals/DataReceivedLog.vue delete mode 100644 fixtures/playground-vue-components/src/internals/DataSender.vue delete mode 100644 fixtures/playground-vue-components/src/internals/LayoutView.vue delete mode 100644 fixtures/playground-vue-components/src/internals/Tags.vue delete mode 100644 fixtures/playground-vue-components/src/internals/TransitionLog.vue delete mode 100644 fixtures/playground-vue-components/src/internals/index.vue delete mode 100644 fixtures/playground-vue-components/src/internals/type.ts delete mode 100644 packages/enclosure-nuxt/.gitignore delete mode 100644 packages/enclosure-nuxt/.npmrc delete mode 100644 packages/enclosure-nuxt/.nuxtrc delete mode 100644 packages/enclosure-nuxt/README.md delete mode 100644 packages/enclosure-nuxt/package.json delete mode 100644 packages/enclosure-nuxt/playground/nuxt.config.ts delete mode 100644 packages/enclosure-nuxt/playground/package.json delete mode 100644 packages/enclosure-nuxt/playground/src/app.vue delete mode 100644 packages/enclosure-nuxt/playground/src/assets/logo.svg delete mode 100644 packages/enclosure-nuxt/playground/src/layouts/default.vue delete mode 100644 packages/enclosure-nuxt/playground/src/pages/bridge/[...path].vue delete mode 100644 packages/enclosure-nuxt/playground/src/pages/index.vue delete mode 100644 packages/enclosure-nuxt/playground/tsconfig.json delete mode 100644 packages/enclosure-nuxt/src/module.ts delete mode 100644 packages/enclosure-nuxt/test/basic.test.ts delete mode 100644 packages/enclosure-nuxt/test/fixtures/basic/app.vue delete mode 100644 packages/enclosure-nuxt/test/fixtures/basic/nuxt.config.ts delete mode 100644 packages/enclosure-nuxt/test/fixtures/basic/package.json delete mode 100644 packages/enclosure-nuxt/tsconfig.json delete mode 100644 packages/enclosure-vue/playground/tsconfig.json create mode 100644 packages/enclosure-vue/src/component.ts delete mode 100644 packages/enclosure-vue/src/components/BridgeFrame.vue create mode 100644 packages/enclosure-vue/src/composables.ts delete mode 100644 packages/enclosure-vue/src/composables/useIframeBridge.ts delete mode 100644 packages/enclosure-vue/src/lib/types.ts create mode 100644 packages/enclosure-vue/src/types.ts delete mode 100644 packages/insider-nuxt/.npmrc delete mode 100644 packages/insider-nuxt/.nuxtrc delete mode 100644 packages/insider-nuxt/README.md delete mode 100644 packages/insider-nuxt/package.json delete mode 100644 packages/insider-nuxt/playground/nuxt.config.ts delete mode 100644 packages/insider-nuxt/playground/package.json delete mode 100644 packages/insider-nuxt/playground/src/app.vue delete mode 100644 packages/insider-nuxt/playground/src/assets/logo.svg delete mode 100644 packages/insider-nuxt/playground/src/layouts/default.vue delete mode 100644 packages/insider-nuxt/playground/src/pages/about.vue delete mode 100644 packages/insider-nuxt/playground/src/pages/contact.vue delete mode 100644 packages/insider-nuxt/playground/src/pages/index.vue delete mode 100644 packages/insider-nuxt/playground/src/pages/works.vue delete mode 100644 packages/insider-nuxt/playground/tsconfig.json delete mode 100644 packages/insider-nuxt/src/module.ts delete mode 100644 packages/insider-nuxt/test/basic.test.ts delete mode 100644 packages/insider-nuxt/test/fixtures/basic/app.vue delete mode 100644 packages/insider-nuxt/test/fixtures/basic/nuxt.config.ts delete mode 100644 packages/insider-nuxt/test/fixtures/basic/package.json delete mode 100644 packages/insider-nuxt/tsconfig.json diff --git a/.changeset/funny-hounds-promise.md b/.changeset/funny-hounds-promise.md new file mode 100644 index 00000000..28558937 --- /dev/null +++ b/.changeset/funny-hounds-promise.md @@ -0,0 +1,6 @@ +--- +"@passerelle/enclosure-vue": minor +"@passerelle/insider-vue": minor +--- + +feat: support-vue2.7+, fix main feature interfaces. diff --git a/.changeset/sixty-rocks-tan.md b/.changeset/sixty-rocks-tan.md index 4edfa090..7d496576 100644 --- a/.changeset/sixty-rocks-tan.md +++ b/.changeset/sixty-rocks-tan.md @@ -1,8 +1,6 @@ --- -"@passerelle/enclosure-nuxt": major -"@passerelle/enclosure-vue": major -"@passerelle/insider-nuxt": major -"@passerelle/insider-vue": major +"@passerelle/enclosure-vue": minor +"@passerelle/insider-vue": minor --- feat: main feature for vue3, nuxt3 diff --git a/.github/actions/build-and-cache/action.yml b/.github/actions/build-and-cache/action.yml deleted file mode 100644 index 5c354d68..00000000 --- a/.github/actions/build-and-cache/action.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Build and Cache -description: This composite action runs build command and rtestores from cache if available. - -runs: - using: 'composite' - - steps: - - name: cache and restore "build result" - id: cache_build_results - uses: actions/cache@v3 - with: - path: | - ./**/dist - ./**/.nuxt - key: cache-build-results-${{ runner.os }}-${{ github.sha }} - - - if: steps.cache_build_results.outputs.cache-hit != 'true' - run: yarn build - shell: bash diff --git a/.github/actions/init-node/action.yml b/.github/actions/init-node/action.yml index 70d576ee..838c5436 100644 --- a/.github/actions/init-node/action.yml +++ b/.github/actions/init-node/action.yml @@ -1,6 +1,6 @@ --- -name: Install Dependencies and Cache -description: This composite action installs dependencies and restores from cache if available. +name: Install Dependencies and Build +description: Install dependencies and build runs: using: 'composite' @@ -17,12 +17,52 @@ runs: with: path: | ./node_modules - key: node-modules-${{ runner.os }}-${{ hashFiles('./yarn.lock') }} + ./**/node_modules + ./.yarn/cache + !./node_modules/.cache + !./**/node_modules/.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' + - name: cache and restore "build result" + id: cache_build_results + uses: actions/cache@v3 + with: + path: | + ./**/dist + ./**/.nuxt + ./**/node_modules/.cache/turbo + key: cache-build-results-${{ runner.os }}-${{ github.sha }} + + - name: install [root] dependencies + run: yarn --immutable + shell: bash + + - name: build + run: yarn build + shell: bash + + # The directories under the example directory do not consider the strictness of yarn.lock + - name: install [examples/enclosure-vue3] dependencies + working-directory: ./examples/enclosure-vue3 run: yarn --immutable shell: bash + + - name: install [examples/enclosure-vue2.7] dependencies + working-directory: ./examples/enclosure-vue2.7 + run: yarn --immutable + shell: bash + + - name: install [examples/insider-vue3] dependencies + working-directory: ./examples/insider-vue3 + run: yarn --immutable + shell: bash + + - name: install [examples/insider-vue2.7] dependencies + working-directory: ./examples/insider-vue2.7 + run: yarn --immutable + shell: bash + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 86994cc6..952dedda 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,12 +22,9 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - - name: Install dependencies + - name: Install dependencies and build uses: ./.github/actions/init-node - - name: Build - uses: ./.github/actions/build-and-cache - - name: Create Release Pull Request or Publish to npm uses: changesets/action@v1 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9093f9c6..d69f7aff 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,34 +19,78 @@ jobs: - uses: actions/checkout@v3 - uses: ./.github/actions/init-node - build: - name: 'Build' + test__code_spec: + name: 'Test: Code Specifigation' runs-on: ubuntu-latest needs: - init__node steps: - uses: actions/checkout@v3 - uses: ./.github/actions/init-node - - uses: ./.github/actions/build-and-cache + - run: yarn test - test__code_spec: - name: 'Test: Code Specifigation' + test__typecheck__enclosure_vue: + name: 'Test: [package/enclosure-vue] TypeCheck' runs-on: ubuntu-latest needs: - - build + - init__node steps: - uses: actions/checkout@v3 - uses: ./.github/actions/init-node - - uses: ./.github/actions/build-and-cache - - run: yarn test + - run: yarn typecheck + working-directory: packages/enclosure-vue - test__typecheck: - name: 'Test: TypeCheck' + test__typecheck__insider_vue: + name: 'Test: [package/insider-vue] TypeCheck' runs-on: ubuntu-latest needs: - - build + - init__node + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/init-node + - 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: + - init__node + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/init-node + - run: yarn typecheck + working-directory: ./examples/enclosure-vue3 + + test__typecheck__example_enclosure_vue_2_7: + name: 'Test: [example/enclosure-vue2.7] TypeCheck' + runs-on: ubuntu-latest + needs: + - init__node + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/init-node + - run: yarn typecheck + working-directory: ./examples/enclosure-vue2.7 + + test__typecheck__example_insider_vue_3: + name: 'Test: [example/insider-vue3] TypeCheck' + runs-on: ubuntu-latest + needs: + - init__node + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/init-node + - run: yarn typecheck + working-directory: ./examples/insider-vue3 + + test__typecheck__example_insider_vue_2_7: + name: 'Test: [example/insider-vue2.7] TypeCheck' + runs-on: ubuntu-latest + needs: + - init__node steps: - uses: actions/checkout@v3 - uses: ./.github/actions/init-node - - uses: ./.github/actions/build-and-cache - run: yarn typecheck + working-directory: ./examples/insider-vue2.7 diff --git a/.gitignore b/.gitignore index 92cfce01..fea1964e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,27 @@ +# VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets +!.vscode/*.code-workspace + +# Intellij idea +*.iml +.idea + +# OSX +.DS_Store +.AppleDouble +.LSOverride +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + + # Logs logs *.log @@ -123,10 +147,15 @@ dist .vscode-test # yarn v2 +examples/*/.yarn .yarn/cache .yarn/unplugged .yarn/build-state.yml .yarn/install-state.gz .pnp.* +# turborepo .turbo + +# vite timestamp +vite.config.ts.timestamp-* diff --git a/.vscode/project.code-workspace b/.vscode/project.code-workspace index fcb8fb94..23ea5d03 100644 --- a/.vscode/project.code-workspace +++ b/.vscode/project.code-workspace @@ -5,8 +5,8 @@ "name": "#root" }, { - "path": "../docs", - "name": "#documentation" + "path": "./_n", + "name": "___PACKAGES___" }, { "path": "../packages/enclosure-vue", @@ -17,28 +17,36 @@ "name": "@passerelle/insider-vue" }, { - "path": "../packages/enclosure-nuxt", - "name": "@passerelle/enclosure-nuxt" + "path": "./_e", + "name": "___EXAMPLES___" }, { - "path": "../packages/insider-nuxt", - "name": "@passerelle/insider-nuxt" + "path": "../examples/enclosure-vue2.7", + "name": "#example/enclosure-vue2.7" }, { - "path": "../packages/insider-nuxt", - "name": "@passerelle/insider-nuxt" + "path": "../examples/enclosure-vue3", + "name": "#example/enclosure-vue3" }, { - "path": "../fixtures/playground-enclosure", - "name": "#fixtures/playground-enclosure" + "path": "../examples/insider-vue2.7", + "name": "#example/insider-vue2.7" }, { - "path": "../fixtures/playground-insider", - "name": "#fixtures/playground-insider" + "path": "../examples/insider-vue3", + "name": "#example/insider-vue3" }, { - "path": "../fixtures/playground-vue-components", - "name": "#fixtures/playground-vue-components" + "path": "./_f", + "name": "___FIXTURES___" + }, + { + "path": "../fixtures/enclosure", + "name": "#fixtures/enclosure" + }, + { + "path": "../fixtures/insider", + "name": "#fixtures/insider" } ], "settings": { @@ -57,7 +65,8 @@ "editor.rulers": [150], "editor.defaultFormatter": "esbenp.prettier-vscode" }, - "typescript.tsdk": "node_modules/typescript/lib" + "typescript.tsdk": "node_modules/typescript/lib", + "liveServer.settings.multiRootWorkspaceName": "#root" }, "extensions": { "recommendations": [ diff --git a/examples/enclosure-vue2.7/.yarnrc.yml b/examples/enclosure-vue2.7/.yarnrc.yml new file mode 100644 index 00000000..c5df637d --- /dev/null +++ b/examples/enclosure-vue2.7/.yarnrc.yml @@ -0,0 +1,3 @@ +--- +nodeLinker: node-modules +yarnPath: ../../.yarn/releases/yarn-3.6.3.cjs diff --git a/examples/enclosure-vue2.7/index.html b/examples/enclosure-vue2.7/index.html new file mode 100644 index 00000000..3895b00c --- /dev/null +++ b/examples/enclosure-vue2.7/index.html @@ -0,0 +1,13 @@ + + + + + + + Vite App + + +
+ + + diff --git a/examples/enclosure-vue2.7/package.json b/examples/enclosure-vue2.7/package.json new file mode 100644 index 00000000..eca326c4 --- /dev/null +++ b/examples/enclosure-vue2.7/package.json @@ -0,0 +1,24 @@ +{ + "name": "example-enclosure-vue2", + "private": true, + "type": "module", + "scripts": { + "dev": "vite . --port 5173", + "typecheck": "vue-tsc --noEmit --composite false" + }, + "devDependencies": { + "@passerelle/enclosure-vue": "*", + "@vue/tsconfig": "^0.4.0", + "fixtures-enclosure": "*", + "vite": "^4.3.0", + "vite-plugin-vue2": "^2.0.3", + "vue": "~2.7.0", + "vue-router": "~3.6.5", + "vue-template-compiler": "~2.7.0", + "vue-tsc": "^1.6.5" + }, + "resolutions": { + "@passerelle/enclosure-vue": "portal:../../packages/enclosure-vue", + "fixtures-enclosure": "portal:../../fixtures/enclosure" + } +} diff --git a/examples/enclosure-vue2.7/src/App.vue b/examples/enclosure-vue2.7/src/App.vue new file mode 100644 index 00000000..91cf2a63 --- /dev/null +++ b/examples/enclosure-vue2.7/src/App.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/packages/enclosure-nuxt/playground/src/assets/css/base.css b/examples/enclosure-vue2.7/src/assets/css/base.css similarity index 100% rename from packages/enclosure-nuxt/playground/src/assets/css/base.css rename to examples/enclosure-vue2.7/src/assets/css/base.css diff --git a/packages/enclosure-nuxt/playground/src/assets/css/main.css b/examples/enclosure-vue2.7/src/assets/css/main.css similarity index 79% rename from packages/enclosure-nuxt/playground/src/assets/css/main.css rename to examples/enclosure-vue2.7/src/assets/css/main.css index d1a8285c..3df1969c 100644 --- a/packages/enclosure-nuxt/playground/src/assets/css/main.css +++ b/examples/enclosure-vue2.7/src/assets/css/main.css @@ -1,6 +1,6 @@ @import './base.css'; -#__nuxt { +body { max-width: 1280px; margin: 0 auto; padding: 2rem; @@ -26,10 +26,4 @@ a, display: flex; place-items: center; } - - #__nuxt { - display: grid; - grid-template-columns: 1fr 1fr; - padding: 0 2rem; - } } diff --git a/packages/enclosure-vue/playground/src/assets/logo.svg b/examples/enclosure-vue2.7/src/assets/logo.svg similarity index 100% rename from packages/enclosure-vue/playground/src/assets/logo.svg rename to examples/enclosure-vue2.7/src/assets/logo.svg diff --git a/packages/enclosure-nuxt/playground/src/components/Header.vue b/examples/enclosure-vue2.7/src/components/Header.vue similarity index 68% rename from packages/enclosure-nuxt/playground/src/components/Header.vue rename to examples/enclosure-vue2.7/src/components/Header.vue index 29c80178..8134c8be 100644 --- a/packages/enclosure-nuxt/playground/src/components/Header.vue +++ b/examples/enclosure-vue2.7/src/components/Header.vue @@ -1,3 +1,15 @@ + +