Skip to content

Commit 2dd5f72

Browse files
committed
fix: use nuxt imports
1 parent aab9029 commit 2dd5f72

File tree

10 files changed

+1034
-197
lines changed

10 files changed

+1034
-197
lines changed

packages/components-vue/package.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,18 @@
7272
"@types/node": "^18.17.17",
7373
"@vitejs/plugin-vue": "^4.2.1",
7474
"vite": "^5.0.10",
75-
"vue": "^3.3.12",
76-
"vue-router": "^4",
77-
"vue-tsc": "^1.6.4"
75+
"vue": "^3.4.18",
76+
"vue-router": "^4.2.5",
77+
"vue-tsc": "^1.8.27"
7878
},
7979
"peerDependencies": {
80-
"vue": "^3.3.12",
81-
"vue-router": "^4"
80+
"vue": "^3.4.18",
81+
"vue-router": "^4.2.5"
82+
},
83+
"peerDependenciesMeta": {
84+
"vue-router": {
85+
"optional": true
86+
}
8287
},
8388
"engines": {
8489
"node": ">=18",

packages/nuxt/.nuxtrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
imports.autoImport=false
22
typescript.includeWorkspace=true
3+
4+
# enable TypeScript bundler module resolution - https://www.typescriptlang.org/docs/handbook/modules/reference.html#bundler
5+
experimental.typescriptBundlerResolution=true

packages/nuxt/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@
4343
},
4444
"dependencies": {
4545
"@nuxt/image": "^1.1.0",
46-
"@nuxt/kit": "^3.8.2",
46+
"@nuxt/kit": "^3.10.1",
4747
"@open-xamu-co/ui-common-enums": "link:../common-enums",
4848
"@open-xamu-co/ui-common-helpers": "link:../common-helpers",
49-
"@open-xamu-co/ui-components-vue": "link:../components-vue",
5049
"@open-xamu-co/ui-common-types": "link:../common-types",
50+
"@open-xamu-co/ui-components-vue": "link:../components-vue",
5151
"@types/lodash": "^4.14.192",
5252
"lodash": "^4.17.21",
5353
"sweetalert2": "^11.7.5"
@@ -59,7 +59,7 @@
5959
"@nuxt/test-utils": "^3.8.1",
6060
"@open-xamu-co/ui-styles": "link:../styles",
6161
"@types/node": "^18.17.17",
62-
"nuxt": "^3.8.2",
62+
"nuxt": "^3.10.1",
6363
"vitest": "^0.33.0"
6464
},
6565
"engines": {

packages/nuxt/src/module.ts

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* eslint-disable @typescript-eslint/ban-ts-comment */
2-
import type { DefineComponent, FunctionalComponent, Component as VueComponent } from "vue";
32
import {
43
defineNuxtModule,
54
addPlugin,
@@ -10,35 +9,13 @@ import {
109
addImportsDir,
1110
} from "@nuxt/kit";
1211
import _ from "lodash";
13-
import type { ModuleOptions as NuxtImageOptions } from "@nuxt/image";
1412

15-
import type { iPluginOptions } from "@open-xamu-co/ui-common-types";
1613
import locale from "@open-xamu-co/ui-common-helpers/en";
1714
import { componentNames } from "@open-xamu-co/ui-common-enums";
1815

19-
/**
20-
* Nuxt specific configuration
21-
*/
22-
interface ModuleOptions
23-
extends iPluginOptions<VueComponent | FunctionalComponent | DefineComponent> {
24-
/**
25-
* Nuxt image plugin options
26-
*/
27-
image?: Partial<NuxtImageOptions>;
28-
}
16+
import type { XamuModuleOptions } from "./types.js";
2917

30-
declare module "nuxt/schema" {
31-
interface AppConfigInput {
32-
xamu?: ModuleOptions;
33-
}
34-
}
35-
declare module "@nuxt/schema" {
36-
interface AppConfigInput {
37-
xamu?: ModuleOptions;
38-
}
39-
}
40-
41-
export default defineNuxtModule<ModuleOptions>({
18+
export default defineNuxtModule<XamuModuleOptions>({
4219
meta: {
4320
name: "@open-xamu-co/ui-nuxt",
4421
configKey: "xamu",

packages/nuxt/src/runtime/composables/useFormInput.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
/* eslint-disable import/no-unresolved */
2+
13
import { useForm } from "@open-xamu-co/ui-common-helpers";
24

5+
import { useAppConfig } from "#imports";
6+
37
/**
48
* xamu form composable
59
*/

packages/nuxt/src/runtime/composables/useSwal.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
/* eslint-disable import/no-unresolved */
2+
13
import type { SweetAlertOptions } from "sweetalert2/dist/sweetalert2";
24

35
import { useSwal as originalUseSwal } from "@open-xamu-co/ui-common-helpers";
46
import type { tSwal } from "@open-xamu-co/ui-common-types";
57

8+
import { useAppConfig } from "#imports";
9+
610
/**
711
* Extended SweetAlert2 composable
812
*/

packages/nuxt/src/runtime/composables/useTimeAgo.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
/* eslint-disable import/no-unresolved */
2+
13
import { timeAgo } from "@open-xamu-co/ui-common-helpers";
24

5+
import { useAppConfig } from "#imports";
6+
37
/**
48
* Time ago composable
59
*/

packages/nuxt/src/runtime/plugins/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable import/no-unresolved */
2+
23
import type { Component as VueComponent } from "vue";
34

45
import type { iPluginOptions } from "@open-xamu-co/ui-common-types";

packages/nuxt/src/types.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import type { DefineComponent, FunctionalComponent, Component as VueComponent } from "vue";
2+
import type { ModuleOptions as NuxtImageOptions } from "@nuxt/image";
3+
4+
import type { iPluginOptions } from "@open-xamu-co/ui-common-types";
5+
6+
/**
7+
* Nuxt specific configuration
8+
*/
9+
export interface XamuModuleOptions
10+
extends iPluginOptions<VueComponent | FunctionalComponent | DefineComponent> {
11+
/**
12+
* Nuxt image plugin options
13+
*/
14+
image?: Partial<NuxtImageOptions>;
15+
}
16+
17+
declare module "nuxt/schema" {
18+
interface AppConfigInput {
19+
xamu?: XamuModuleOptions;
20+
}
21+
}
22+
declare module "@nuxt/schema" {
23+
interface AppConfigInput {
24+
xamu?: XamuModuleOptions;
25+
}
26+
}

0 commit comments

Comments
 (0)