@anweb/nuxt-ancore 1.0.1 → 1.1.0

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/README.md CHANGED
@@ -1,73 +1,28 @@
1
- <!--
2
- Get your module up and running quickly.
3
-
4
- Find and replace all on all files (CMD+SHIFT+F):
5
- - Name: My Module
6
- - Package name: my-module
7
- - Description: My new Nuxt module
8
- -->
9
-
10
- # My Module
1
+ # AnCore module for Nuxt
11
2
 
12
3
  [![npm version][npm-version-src]][npm-version-href]
13
4
  [![npm downloads][npm-downloads-src]][npm-downloads-href]
14
- [![License][license-src]][license-href]
15
5
  [![Nuxt][nuxt-src]][nuxt-href]
16
6
 
17
7
  My new Nuxt module for doing amazing things.
18
8
 
19
9
  - [✨ &nbsp;Release Notes](/CHANGELOG.md)
20
- <!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/my-module?file=playground%2Fapp.vue) -->
21
- <!-- - [📖 &nbsp;Documentation](https://example.com) -->
22
-
23
- ## Features
24
10
 
25
- <!-- Highlight some of the features your module provide here -->
26
- - ⛰ &nbsp;Foo
27
- - 🚠 &nbsp;Bar
28
- - 🌲 &nbsp;Baz
29
11
 
30
12
  ## Quick Setup
31
13
 
32
14
  Install the module to your Nuxt application with one command:
33
15
 
34
16
  ```bash
35
- npx nuxi module add my-module
17
+ npm i @anweb/nuxt-ancore
36
18
  ```
37
19
 
38
- That's it! You can now use My Module in your Nuxt app ✨
39
-
40
-
41
- ## Contribution
42
-
43
- <details>
44
- <summary>Local development</summary>
45
-
46
- ```bash
47
- # Install dependencies
48
- npm install
49
-
50
- # Generate type stubs
51
- npm run dev:prepare
52
-
53
- # Develop with the playground
54
- npm run dev
55
-
56
- # Build the playground
57
- npm run dev:build
58
-
59
- # Run ESLint
60
- npm run lint
61
-
62
- # Run Vitest
63
- npm run test
64
- npm run test:watch
65
-
66
- # Release new version
67
- npm run release
68
- ```
69
-
70
- </details>
20
+ Then, add it to your nuxt.config.ts:
21
+ ```ts
22
+ export default defineNuxtConfig({
23
+ modules: ['@anweb/nuxt-ancore']
24
+ })
25
+ ```
71
26
 
72
27
 
73
28
  <!-- Badges -->
@@ -77,8 +32,5 @@ That's it! You can now use My Module in your Nuxt app ✨
77
32
  [npm-downloads-src]: https://img.shields.io/npm/dm/my-module.svg?style=flat&colorA=020420&colorB=00DC82
78
33
  [npm-downloads-href]: https://npm.chart.dev/my-module
79
34
 
80
- [license-src]: https://img.shields.io/npm/l/my-module.svg?style=flat&colorA=020420&colorB=00DC82
81
- [license-href]: https://npmjs.com/package/my-module
82
-
83
35
  [nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js
84
36
  [nuxt-href]: https://nuxt.com
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "AnCore",
3
3
  "configKey": "ancore",
4
- "version": "1.0.1",
4
+ "version": "1.1.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.1",
7
7
  "unbuild": "3.5.0"
package/dist/module.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { defineNuxtModule, createResolver, addPlugin } from '@nuxt/kit';
1
+ import { defineNuxtModule, createResolver, addImports } from '@nuxt/kit';
2
2
 
3
3
  const module = defineNuxtModule({
4
4
  meta: {
@@ -9,7 +9,10 @@ const module = defineNuxtModule({
9
9
  defaults: {},
10
10
  setup(_options, _nuxt) {
11
11
  const resolver = createResolver(import.meta.url);
12
- addPlugin(resolver.resolve("./runtime/plugin"));
12
+ addImports({
13
+ name: "api",
14
+ from: resolver.resolve("runtime/utils/api")
15
+ });
13
16
  }
14
17
  });
15
18
 
@@ -0,0 +1,3 @@
1
+ import type { NitroFetchOptions, NitroFetchRequest } from 'nitropack';
2
+ declare const _default: <TData = unknown, TError = unknown>(request: NitroFetchRequest, opts: NitroFetchOptions<string>) => Promise<import("nitropack").TypedInternalResponse<NitroFetchRequest, TData, "get">>;
3
+ export default _default;
@@ -0,0 +1,10 @@
1
+ export default async (request, opts) => {
2
+ try {
3
+ return await $fetch(
4
+ request,
5
+ { ...opts }
6
+ );
7
+ } catch (error) {
8
+ throw error;
9
+ }
10
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anweb/nuxt-ancore",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "AnCore Nuxt module",
5
5
  "repository": "https://github.com/ANLTD/ancore",
6
6
  "license": "MIT",
@@ -27,7 +27,9 @@
27
27
  "dev": "npm run dev:prepare && nuxi dev playground",
28
28
  "dev:build": "nuxi build playground",
29
29
  "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
30
- "release": "npm run prepack && changelogen --release && npm publish --access public && git push --follow-tags"
30
+ "release:patch": "npm run prepack && changelogen --bump patch --release && npm publish --access public && git push --follow-tags",
31
+ "release:minor": "npm run prepack && changelogen --bump minor --release && npm publish --access public && git push --follow-tags",
32
+ "release:major": "npm run prepack && changelogen --bump major --release && npm publish --access public && git push --follow-tags"
31
33
  },
32
34
  "dependencies": {
33
35
  "@nuxt/kit": "^4.0.0"
@@ -1,2 +0,0 @@
1
- declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
2
- export default _default;
@@ -1,4 +0,0 @@
1
- import { defineNuxtPlugin } from "#app";
2
- export default defineNuxtPlugin((_nuxtApp) => {
3
- console.log("Plugin injected by my-module!");
4
- });