@nuxt/module-builder 0.2.1 → 0.3.1
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 +25 -11
- package/dist/cli.d.ts +1 -0
- package/dist/cli.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/shared/{module-builder.4bb3ed8c.mjs → module-builder.0966342c.mjs} +4 -0
- package/package.json +16 -14
package/README.md
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
# 📦 Nuxt Module Builder
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[![npm version][npm-version-src]][npm-version-href]
|
|
4
|
+
[![License][license-src]][license-href]
|
|
5
|
+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
6
|
+
<a href="https://volta.net/nuxt/module-builder?utm_source=nuxt_module_builder_readme"><img src="https://user-images.githubusercontent.com/904724/209143798-32345f6c-3cf8-4e06-9659-f4ace4a6acde.svg" alt="Volta board"></a>
|
|
7
|
+
|
|
8
|
+
> The complete solution to build and ship [Nuxt modules](https://nuxt.com/modules).
|
|
4
9
|
|
|
5
10
|
## Features
|
|
6
11
|
|
|
7
|
-
- Unified build with [unjs/unbuild](https://github.com/unjs/unbuild)
|
|
8
12
|
- Compatible with Nuxt 3 and Nuxt Kit
|
|
13
|
+
- Unified build with [unjs/unbuild](https://github.com/unjs/unbuild)
|
|
9
14
|
- Automated build config using last module spec
|
|
10
15
|
- Typescript and ESM support
|
|
11
16
|
- Auto generated CommonJS stubs
|
|
12
17
|
- Auto generated types and shims for `@nuxt/schema`
|
|
13
18
|
|
|
19
|
+
We recommend to checkout the [Nuxt modules author guide](https://nuxt.com/docs/guide/going-further/modules) before starting with the module-builder.
|
|
14
20
|
|
|
15
|
-
##
|
|
16
|
-
|
|
17
|
-
Check the new [Guide for Nuxt Modules](https://v3.nuxtjs.org/docs/advanced/modules/) before starting with module-builder.
|
|
18
|
-
|
|
19
|
-
### Requirements
|
|
21
|
+
## Requirements
|
|
20
22
|
|
|
21
23
|
For a user to use a module generated from module-builder, it's recommended they have:
|
|
22
24
|
- Node.js >= 14.x. _Latest Node LTS preferred_
|
|
@@ -24,19 +26,19 @@ For a user to use a module generated from module-builder, it's recommended they
|
|
|
24
26
|
|
|
25
27
|
## Quick start
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
Get started with our [module starter](https://github.com/nuxt/starter/tree/module):
|
|
28
30
|
|
|
29
31
|
```bash
|
|
30
|
-
|
|
32
|
+
npx nuxi init -t module my-module
|
|
31
33
|
```
|
|
32
34
|
|
|
33
35
|
## Project structure
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
The module builder requires a special project structur. You can checkout the [module template](https://github.com/nuxt/starter/tree/module).
|
|
36
38
|
|
|
37
39
|
### `src/module.ts`
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
The entrypoint for module definition.
|
|
40
42
|
|
|
41
43
|
A default export using `defineNuxtModule` and `ModuleOptions` type export is expected.
|
|
42
44
|
|
|
@@ -138,3 +140,15 @@ Module builder generates dist files in `dist/` directory:
|
|
|
138
140
|
## License
|
|
139
141
|
|
|
140
142
|
[MIT](./LICENSE) - Made with 💚
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
<!-- Badges -->
|
|
146
|
+
[npm-version-src]: https://img.shields.io/npm/v/@nuxt/module-builder/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
147
|
+
[npm-version-href]: https://npmjs.com/package/@nuxt/module-builder
|
|
148
|
+
|
|
149
|
+
[npm-downloads-src]: https://img.shields.io/npm/dt/@nuxt/module-builder.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
150
|
+
[npm-downloads-href]: https://npmjs.com/package/@nuxt/module-builder
|
|
151
|
+
|
|
152
|
+
[license-src]: https://img.shields.io/github/license/nuxt/module-builder.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
153
|
+
[license-href]: https://github.com/nuxt/module-builder/blob/main/LICENSE
|
|
154
|
+
|
package/dist/cli.d.ts
CHANGED
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import mri from 'mri';
|
|
3
3
|
import { resolve } from 'pathe';
|
|
4
|
-
import { b as buildModule } from './shared/module-builder.
|
|
4
|
+
import { b as buildModule } from './shared/module-builder.0966342c.mjs';
|
|
5
5
|
import 'fs';
|
|
6
6
|
import 'url';
|
|
7
7
|
import 'consola';
|
package/dist/index.mjs
CHANGED
|
@@ -94,6 +94,10 @@ ${schemaShims.length ? `declare module '@nuxt/schema' {
|
|
|
94
94
|
${schemaShims.join("\n")}
|
|
95
95
|
}
|
|
96
96
|
` : ""}
|
|
97
|
+
${schemaShims.length ? `declare module 'nuxt/schema' {
|
|
98
|
+
${schemaShims.join("\n")}
|
|
99
|
+
}
|
|
100
|
+
` : ""}
|
|
97
101
|
|
|
98
102
|
export { ${typeExports[0].names.join(", ")} } from './module'
|
|
99
103
|
`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/module-builder",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Complete solution to build Nuxt Modules",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -25,24 +25,26 @@
|
|
|
25
25
|
"nuxt-module-build": "jiti ./src/cli.ts",
|
|
26
26
|
"prepack": "pnpm build",
|
|
27
27
|
"release": "pnpm test && standard-version && git push --follow-tags && npm publish",
|
|
28
|
-
"test": "pnpm
|
|
28
|
+
"test": "pnpm vitest"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"consola": "^
|
|
32
|
-
"mlly": "^1.
|
|
31
|
+
"consola": "^3.1.0",
|
|
32
|
+
"mlly": "^1.2.0",
|
|
33
33
|
"mri": "^1.2.0",
|
|
34
|
-
"pathe": "^1.
|
|
35
|
-
"unbuild": "^1.
|
|
34
|
+
"pathe": "^1.1.0",
|
|
35
|
+
"unbuild": "^1.2.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@nuxt/kit": "^3.
|
|
39
|
-
"@nuxt/schema": "^3.
|
|
40
|
-
"@nuxtjs/eslint-config-typescript": "^
|
|
38
|
+
"@nuxt/kit": "^3.4.3",
|
|
39
|
+
"@nuxt/schema": "^3.4.3",
|
|
40
|
+
"@nuxtjs/eslint-config-typescript": "^12.0.0",
|
|
41
41
|
"@types/mri": "^1.1.1",
|
|
42
|
-
"@types/node": "^18.
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
42
|
+
"@types/node": "^18.16.3",
|
|
43
|
+
"@vitest/coverage-c8": "^0.30.1",
|
|
44
|
+
"eslint": "^8.39.0",
|
|
45
|
+
"jiti": "^1.18.2",
|
|
46
|
+
"nuxt": "^3.4.3",
|
|
47
|
+
"standard-version": "^9.5.0",
|
|
48
|
+
"vitest": "^0.30.1"
|
|
47
49
|
}
|
|
48
50
|
}
|