From 1a49a0810eb41245894d3f0708b49232d01158d4 Mon Sep 17 00:00:00 2001 From: dapotatoman Date: Wed, 3 Apr 2024 18:10:58 +0600 Subject: [PATCH] refactor: playground structure --- playground/.env.local | 1 - playground/nuxt/.env.local | 5 +++++ playground/{ => nuxt}/app.vue | 0 playground/{ => nuxt}/nuxt.config.ts | 10 +++++++--- playground/{ => nuxt}/package.json | 2 +- playground/{ => nuxt}/server/tsconfig.json | 0 playground/{ => nuxt}/tsconfig.json | 0 {playground-vite => playground/vite}/index.html | 0 {playground-vite => playground/vite}/outlook.html | 0 {playground-vite => playground/vite}/package.json | 0 {playground-vite => playground/vite}/tsconfig.json | 0 {playground-vite => playground/vite}/vite.config.ts | 2 +- pnpm-lock.yaml | 11 ++++++++++- pnpm-workspace.yaml | 2 +- test/basic.test.ts | 2 +- 15 files changed, 26 insertions(+), 9 deletions(-) delete mode 100644 playground/.env.local create mode 100644 playground/nuxt/.env.local rename playground/{ => nuxt}/app.vue (100%) rename playground/{ => nuxt}/nuxt.config.ts (62%) rename playground/{ => nuxt}/package.json (85%) rename playground/{ => nuxt}/server/tsconfig.json (100%) rename playground/{ => nuxt}/tsconfig.json (100%) rename {playground-vite => playground/vite}/index.html (100%) rename {playground-vite => playground/vite}/outlook.html (100%) rename {playground-vite => playground/vite}/package.json (100%) rename {playground-vite => playground/vite}/tsconfig.json (100%) rename {playground-vite => playground/vite}/vite.config.ts (93%) diff --git a/playground/.env.local b/playground/.env.local deleted file mode 100644 index b50df60..0000000 --- a/playground/.env.local +++ /dev/null @@ -1 +0,0 @@ -VITE_OFFICE_DOMAIN=https://www.northwindtraders.com \ No newline at end of file diff --git a/playground/nuxt/.env.local b/playground/nuxt/.env.local new file mode 100644 index 0000000..4cdc76c --- /dev/null +++ b/playground/nuxt/.env.local @@ -0,0 +1,5 @@ +VITE_OFFICE_ID=c6890c26-5bbb-40ed-a321-37f07909a2f0 +VITE_OFFICE_DOMAIN=https://www.contoso.com +VITE_OFFICE_PROVIDER_NAME=Contoso, Ltd +VITE_OFFICE_DISPLAY_NAME=Contoso App +VITE_OFFICE_DESCRIPTION=Office add-in for Contoso App \ No newline at end of file diff --git a/playground/app.vue b/playground/nuxt/app.vue similarity index 100% rename from playground/app.vue rename to playground/nuxt/app.vue diff --git a/playground/nuxt.config.ts b/playground/nuxt/nuxt.config.ts similarity index 62% rename from playground/nuxt.config.ts rename to playground/nuxt/nuxt.config.ts index 1123c4b..2359c9d 100644 --- a/playground/nuxt.config.ts +++ b/playground/nuxt/nuxt.config.ts @@ -1,17 +1,21 @@ import { resolve } from 'node:path' +const root = resolve(__dirname, '../..') + export default defineNuxtConfig({ - modules: ['../src/module'], devtools: { enabled: true }, + modules: [ + resolve(root, 'src/module'), + ], msOfficeAddin: { manifests: [ { - src: resolve(__dirname, '../manifest.xml'), + src: resolve(root, 'manifest.xml'), route: '/office-app/manifest.xml', }, { - src: resolve(__dirname, '../manifest.xml'), + src: resolve(root, 'manifest.xml'), route: '/office-app-alt/manifest.xml', }, ], diff --git a/playground/package.json b/playground/nuxt/package.json similarity index 85% rename from playground/package.json rename to playground/nuxt/package.json index 05d5e2c..7db4ae6 100644 --- a/playground/package.json +++ b/playground/nuxt/package.json @@ -1,5 +1,5 @@ { - "name": "msoffice-addin-playground", + "name": "playground-nuxt", "type": "module", "private": true, "scripts": { diff --git a/playground/server/tsconfig.json b/playground/nuxt/server/tsconfig.json similarity index 100% rename from playground/server/tsconfig.json rename to playground/nuxt/server/tsconfig.json diff --git a/playground/tsconfig.json b/playground/nuxt/tsconfig.json similarity index 100% rename from playground/tsconfig.json rename to playground/nuxt/tsconfig.json diff --git a/playground-vite/index.html b/playground/vite/index.html similarity index 100% rename from playground-vite/index.html rename to playground/vite/index.html diff --git a/playground-vite/outlook.html b/playground/vite/outlook.html similarity index 100% rename from playground-vite/outlook.html rename to playground/vite/outlook.html diff --git a/playground-vite/package.json b/playground/vite/package.json similarity index 100% rename from playground-vite/package.json rename to playground/vite/package.json diff --git a/playground-vite/tsconfig.json b/playground/vite/tsconfig.json similarity index 100% rename from playground-vite/tsconfig.json rename to playground/vite/tsconfig.json diff --git a/playground-vite/vite.config.ts b/playground/vite/vite.config.ts similarity index 93% rename from playground-vite/vite.config.ts rename to playground/vite/vite.config.ts index a79f154..2e9b61f 100644 --- a/playground-vite/vite.config.ts +++ b/playground/vite/vite.config.ts @@ -1,6 +1,6 @@ import { resolve } from 'node:path' import { defineConfig } from 'vite' -import MSOfficeAddin from '../src/vite' +import MSOfficeAddin from '../../src/vite' export default defineConfig({ envDir: resolve(__dirname, '..'), diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 119f081..736b9f1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -61,12 +61,21 @@ importers: specifier: ^1.4.0 version: 1.4.0(@types/node@20.12.2) - playground: + playground/nuxt: dependencies: nuxt: specifier: latest version: 3.11.1(@types/node@20.12.2)(@unocss/reset@0.58.8)(eslint@8.57.0)(floating-vue@5.2.2)(rollup@3.29.4)(typescript@5.4.3)(unocss@0.58.8)(vite@5.2.7) + playground/vite: + devDependencies: + typescript: + specifier: ^5.2.2 + version: 5.4.3 + vite: + specifier: ^5.2.0 + version: 5.2.7(@types/node@20.12.2) + packages: /@aashutoshrathi/word-wrap@1.2.6: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 54e149e..314388d 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,2 +1,2 @@ packages: - - playground + - playground/* diff --git a/test/basic.test.ts b/test/basic.test.ts index 4440ad8..2afb813 100644 --- a/test/basic.test.ts +++ b/test/basic.test.ts @@ -4,7 +4,7 @@ import { $fetch, setup } from '@nuxt/test-utils/e2e' describe('ssr', async () => { await setup({ - rootDir: fileURLToPath(new URL('../playground', import.meta.url)), + rootDir: fileURLToPath(new URL('../playground/nuxt', import.meta.url)), }) it('renders office manifest', () => {