From ff9573838c0d38d349312bcaa01ec7e283bba4fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20S=C3=A1nchez?= Date: Wed, 13 Nov 2024 13:22:10 +0100 Subject: [PATCH] fix(types): add missing shared types (#3212) --- .github/workflows/ci.yml | 4 ++-- build.config.ts | 5 +++++ package.json | 4 ++-- specs/fixtures/issues/2590/app.vue | 4 ++-- specs/fixtures/restructure/pages/index.vue | 4 ++-- src/runtime/composables/index.ts | 1 - 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d36450ef..d2e813da9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,8 +38,8 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - - name: Setup development - run: pnpm dev:prepare + - name: Building + run: pnpm build - name: Linting run: pnpm lint diff --git a/build.config.ts b/build.config.ts index 68ff1ed23..693ff6969 100644 --- a/build.config.ts +++ b/build.config.ts @@ -1,5 +1,10 @@ import { defineBuildConfig } from 'unbuild' export default defineBuildConfig({ + entries: [ + 'src/module', + // Chunking + 'src/types' + ], externals: ['node:fs', 'node:url', 'webpack', '@babel/parser', 'unplugin-vue-router', 'unplugin-vue-router/options'] }) diff --git a/package.json b/package.json index 854422226..892f3f9f1 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "exports": { ".": { "types": "./dist/types.d.mts", - "import": "./dist/module.mjs" + "default": "./dist/module.mjs" }, "./package.json": "./package.json" }, @@ -72,7 +72,7 @@ "lint": "run-p \"lint:* {@}\" --", "lint:prettier": "prettier . --check", "lint:eslint": "eslint .", - "test": "pnpm dev:prepare && run-s test:types test:unit test:spec", + "test": "pnpm build && run-s test:types test:unit test:spec", "test:types": "tsc --noEmit", "test:unit": "vitest run test", "test:spec": "vitest run specs" diff --git a/specs/fixtures/issues/2590/app.vue b/specs/fixtures/issues/2590/app.vue index 6906edd43..14db24202 100644 --- a/specs/fixtures/issues/2590/app.vue +++ b/specs/fixtures/issues/2590/app.vue @@ -9,9 +9,9 @@ const { locale, locales, setLocale } = useI18n() const head = useLocaleHead() -useHead(() => { +useHead(() => ({ htmlAttrs: head.value.htmlAttrs -}) +})) console.log(head.value.htmlAttrs) diff --git a/specs/fixtures/restructure/pages/index.vue b/specs/fixtures/restructure/pages/index.vue index 525c84de9..87dedf647 100644 --- a/specs/fixtures/restructure/pages/index.vue +++ b/specs/fixtures/restructure/pages/index.vue @@ -18,14 +18,14 @@ watchEffect(() => { refresh() }) -useHead(() => { +useHead(() => ({ title: t('home'), htmlAttrs: { lang: i18nHead.value.htmlAttrs!.lang }, link: [...(i18nHead.value.link || [])], meta: [...(i18nHead.value.meta || [])] -}) +}))