From e261f6557e22c4285f32b097ecd0a9d0d8207d70 Mon Sep 17 00:00:00 2001 From: Ryota Watanabe <43837308+wattanx@users.noreply.github.com> Date: Sat, 11 May 2024 17:23:04 +0900 Subject: [PATCH] chore: migrate to vitest workspace (#57) --- packages/converter-utils/vite.config.ts | 8 ------- packages/insert-emits-option/vite.config.ts | 5 ---- .../define-nuxt-plugin.spec.ts | 1 + .../vite.config.ts | 7 ------ .../vitest.config.ts | 7 ++++++ .../vue-composition-converter/vite.config.ts | 9 -------- packages/vue-mixins-converter/vite.config.ts | 23 ------------------- .../vue-script-setup-converter/vite.config.ts | 23 ------------------- vitest.workspace.ts | 10 ++++++++ 9 files changed, 18 insertions(+), 75 deletions(-) delete mode 100644 packages/converter-utils/vite.config.ts delete mode 100644 packages/insert-emits-option/vite.config.ts delete mode 100644 packages/nuxt-bridge-migration-tools/vite.config.ts create mode 100644 packages/nuxt-bridge-migration-tools/vitest.config.ts delete mode 100644 packages/vue-composition-converter/vite.config.ts delete mode 100644 packages/vue-mixins-converter/vite.config.ts delete mode 100644 packages/vue-script-setup-converter/vite.config.ts create mode 100644 vitest.workspace.ts diff --git a/packages/converter-utils/vite.config.ts b/packages/converter-utils/vite.config.ts deleted file mode 100644 index 4ddee7f..0000000 --- a/packages/converter-utils/vite.config.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { defineConfig } from 'vitest/config'; - -// https://vitejs.dev/config/ -export default defineConfig({ - test: { - environment: 'node', - }, -}); diff --git a/packages/insert-emits-option/vite.config.ts b/packages/insert-emits-option/vite.config.ts deleted file mode 100644 index 77a73cf..0000000 --- a/packages/insert-emits-option/vite.config.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { defineConfig } from "vitest/config"; - -export default defineConfig({ - test: {}, -}); diff --git a/packages/nuxt-bridge-migration-tools/src/transformations/define-nuxt-plugin.spec.ts b/packages/nuxt-bridge-migration-tools/src/transformations/define-nuxt-plugin.spec.ts index d63f549..54c2119 100644 --- a/packages/nuxt-bridge-migration-tools/src/transformations/define-nuxt-plugin.spec.ts +++ b/packages/nuxt-bridge-migration-tools/src/transformations/define-nuxt-plugin.spec.ts @@ -1,5 +1,6 @@ import { applyTransform } from "jscodeshift/src/testUtils"; import transform from "./define-nuxt-plugin"; +import { test, expect } from "vitest"; test("js plugin", () => { const source = `import { defineNuxtPlugin } from '@nuxtjs/composition-api'; diff --git a/packages/nuxt-bridge-migration-tools/vite.config.ts b/packages/nuxt-bridge-migration-tools/vite.config.ts deleted file mode 100644 index e2ec332..0000000 --- a/packages/nuxt-bridge-migration-tools/vite.config.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { defineConfig } from "vitest/config"; - -export default defineConfig({ - test: { - globals: true, - }, -}); diff --git a/packages/nuxt-bridge-migration-tools/vitest.config.ts b/packages/nuxt-bridge-migration-tools/vitest.config.ts new file mode 100644 index 0000000..8e84bc5 --- /dev/null +++ b/packages/nuxt-bridge-migration-tools/vitest.config.ts @@ -0,0 +1,7 @@ +import { defineProject } from "vitest/config"; + +export default defineProject({ + test: { + globals: true, + }, +}); diff --git a/packages/vue-composition-converter/vite.config.ts b/packages/vue-composition-converter/vite.config.ts deleted file mode 100644 index e97997b..0000000 --- a/packages/vue-composition-converter/vite.config.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { defineConfig } from 'vitest/config'; -import path from 'path'; - -// https://vitejs.dev/config/ -export default defineConfig({ - test: { - environment: 'node', - }, -}); diff --git a/packages/vue-mixins-converter/vite.config.ts b/packages/vue-mixins-converter/vite.config.ts deleted file mode 100644 index b892f37..0000000 --- a/packages/vue-mixins-converter/vite.config.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { defineConfig } from 'vitest/config'; -import path from 'path'; - -// https://vitejs.dev/config/ -export default defineConfig({ - build: { - lib: { - entry: path.resolve(__dirname, 'src/index.ts'), - fileName: 'index', - formats: ['es', 'cjs'], - }, - rollupOptions: { - external: ['typescript', 'ts-morph'], - }, - emptyOutDir: false, - }, - esbuild: { - minifyIdentifiers: false, - }, - test: { - environment: 'node', - }, -}); diff --git a/packages/vue-script-setup-converter/vite.config.ts b/packages/vue-script-setup-converter/vite.config.ts deleted file mode 100644 index 7cc0f2a..0000000 --- a/packages/vue-script-setup-converter/vite.config.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { defineConfig } from "vitest/config"; -import path from "path"; - -// https://vitejs.dev/config/ -export default defineConfig({ - build: { - lib: { - entry: path.resolve(__dirname, "src/index.ts"), - fileName: "index", - formats: ["es", "cjs"], - }, - rollupOptions: { - external: ["typescript", "ts-morph"], - }, - emptyOutDir: false, - }, - esbuild: { - minifyIdentifiers: false, - }, - test: { - environment: "node", - }, -}); diff --git a/vitest.workspace.ts b/vitest.workspace.ts new file mode 100644 index 0000000..53e64f3 --- /dev/null +++ b/vitest.workspace.ts @@ -0,0 +1,10 @@ +import { defineWorkspace } from "vitest/config"; + +export default defineWorkspace([ + "packages/*", + { + test: { + environment: "node", + }, + }, +]);