@anweb/nuxt-ancore 1.3.3 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.d.mts +2 -0
- package/dist/module.d.ts +2 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +3 -1
- package/dist/runtime/composables/useData.js +1 -1
- package/dist/runtime/composables/useList.js +1 -1
- package/dist/runtime/types/ancore.d.ts +17 -0
- package/dist/runtime/types/api.d.ts +7 -0
- package/dist/runtime/types/index.d.ts +2 -1
- package/dist/runtime/types/index.js +4 -3
- package/dist/runtime/types/responseList.d.ts +4 -4
- package/dist/runtime/types/ws.d.ts +4 -4
- package/dist/runtime/utils/userApi.js +5 -5
- package/package.json +4 -4
- package/dist/runtime/types/nuxt.d.ts +0 -8
- package/dist/runtime/types/responseList.js +0 -0
- package/dist/runtime/types/ws.js +0 -0
package/dist/module.d.mts
CHANGED
package/dist/module.d.ts
CHANGED
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -8,7 +8,9 @@ const module = defineNuxtModule({
|
|
|
8
8
|
defaults: {},
|
|
9
9
|
async setup(_options, _nuxt) {
|
|
10
10
|
const { resolve } = createResolver(import.meta.url);
|
|
11
|
-
_nuxt.options.runtimeConfig.public.ancore = {
|
|
11
|
+
_nuxt.options.runtimeConfig.public.ancore = {
|
|
12
|
+
api: _options.api
|
|
13
|
+
};
|
|
12
14
|
_nuxt.options.alias["#ancore/types"] = resolve("./runtime/types");
|
|
13
15
|
addImportsDir(resolve("./runtime/composables"));
|
|
14
16
|
addImportsDir(resolve("./runtime/utils"));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, ref } from "vue";
|
|
2
2
|
import { useAsyncData } from "#app";
|
|
3
|
-
import { userApi } from "
|
|
3
|
+
import { userApi } from "../utils/index.js";
|
|
4
4
|
export const useData = (config) => {
|
|
5
5
|
const request = ref(config.request);
|
|
6
6
|
const loading = computed(() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEventBus } from "@vueuse/core";
|
|
2
2
|
import { computed, ref, reactive, watch } from "vue";
|
|
3
3
|
import { useAsyncData } from "#app";
|
|
4
|
-
import { userApi, toQuery } from "
|
|
4
|
+
import { userApi, toQuery } from "../utils/index.js";
|
|
5
5
|
export default (config) => {
|
|
6
6
|
const busWS = useEventBus("ws");
|
|
7
7
|
const inited = ref(false);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ModuleOptions } from '../../module'
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
declare module 'nuxt/schema' {
|
|
5
|
+
interface NuxtConfig {
|
|
6
|
+
ancore?: ModuleOptions
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface RuntimeConfig {
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface PublicRuntimeConfig {
|
|
13
|
+
ancore?: Partial<ModuleOptions>
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export {}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
1
|
+
export * from "./ancore";
|
|
2
|
+
export * from "./api";
|
|
3
|
+
export * from "./ws";
|
|
4
|
+
export * from "./responseList";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface TResponseList<TData> {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
1
|
+
export interface TResponseList<TData> {
|
|
2
|
+
items: TData[]
|
|
3
|
+
count: number
|
|
4
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface TWS {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
1
|
+
export interface TWS {
|
|
2
|
+
type: string
|
|
3
|
+
data: unknown
|
|
4
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { coreApi } from "
|
|
1
|
+
import { useRuntimeConfig } from "#app";
|
|
2
|
+
import { coreApi } from "./index.js";
|
|
3
3
|
export const userApi = (request, opts) => {
|
|
4
|
-
const
|
|
5
|
-
if (
|
|
6
|
-
return
|
|
4
|
+
const runtimeConfig = useRuntimeConfig().public.ancore;
|
|
5
|
+
if (runtimeConfig.api) {
|
|
6
|
+
return runtimeConfig.api(request, opts);
|
|
7
7
|
} else {
|
|
8
8
|
return coreApi(request, opts);
|
|
9
9
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anweb/nuxt-ancore",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.5",
|
|
4
4
|
"description": "AnCore Nuxt module",
|
|
5
5
|
"repository": "https://github.com/ANLTD/ancore",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"release:major": "npm run prepack && changelogen --bump major --release && npm publish --access public && git push --follow-tags"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@nuxt/kit": "^4.0.
|
|
35
|
+
"@nuxt/kit": "^4.0.1",
|
|
36
36
|
"@vueuse/core": "^13.5.0",
|
|
37
37
|
"@vueuse/integrations": "^13.5.0",
|
|
38
38
|
"async-validator": "^4.2.5"
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@nuxt/devtools": "^2.6.2",
|
|
42
42
|
"@nuxt/module-builder": "^1.0.1",
|
|
43
|
-
"@nuxt/schema": "^
|
|
43
|
+
"@nuxt/schema": "^4.0.1",
|
|
44
44
|
"@types/node": "latest",
|
|
45
45
|
"changelogen": "^0.6.2",
|
|
46
|
-
"nuxt": "^4.0.
|
|
46
|
+
"nuxt": "^4.0.1",
|
|
47
47
|
"typescript": "~5.8.3"
|
|
48
48
|
}
|
|
49
49
|
}
|
|
File without changes
|
package/dist/runtime/types/ws.js
DELETED
|
File without changes
|