@nuxt/module-builder 1.0.0 → 1.0.2
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
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
- Unified build with [unjs/unbuild](https://github.com/unjs/unbuild)
|
|
14
14
|
- Automated build config using last module spec
|
|
15
15
|
- Typescript and ESM support
|
|
16
|
-
- Auto generated CommonJS stubs
|
|
17
16
|
- Auto generated types and shims for `@nuxt/schema`
|
|
18
17
|
|
|
19
18
|
We recommend to checkout the [Nuxt modules author guide](https://nuxt.com/docs/guide/going-further/modules) before starting with the module-builder.
|
|
@@ -21,15 +20,15 @@ We recommend to checkout the [Nuxt modules author guide](https://nuxt.com/docs/g
|
|
|
21
20
|
## Requirements
|
|
22
21
|
|
|
23
22
|
For a user to use a module generated from module-builder, it's recommended they have:
|
|
24
|
-
- Node.js >=
|
|
25
|
-
- Nuxt 3
|
|
23
|
+
- Node.js >= 18.x. _Latest Node LTS preferred_
|
|
24
|
+
- Nuxt 3+.
|
|
26
25
|
|
|
27
26
|
## Quick start
|
|
28
27
|
|
|
29
28
|
Get started with our [module starter](https://github.com/nuxt/starter/tree/module):
|
|
30
29
|
|
|
31
30
|
```bash
|
|
32
|
-
|
|
31
|
+
npm create nuxt -- -t module my-module
|
|
33
32
|
```
|
|
34
33
|
|
|
35
34
|
## Project structure
|
|
@@ -100,13 +99,18 @@ A minimum `package.json` should look like this:
|
|
|
100
99
|
"version": "1.0.0",
|
|
101
100
|
"exports": {
|
|
102
101
|
".": {
|
|
103
|
-
"types": "./dist/types.d.
|
|
104
|
-
"import": "./dist/module.mjs"
|
|
105
|
-
|
|
102
|
+
"types": "./dist/types.d.mts",
|
|
103
|
+
"import": "./dist/module.mjs"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"main": "./dist/module.mjs",
|
|
107
|
+
"typesVersions": {
|
|
108
|
+
"*": {
|
|
109
|
+
".": [
|
|
110
|
+
"./dist/types.d.mts"
|
|
111
|
+
]
|
|
106
112
|
}
|
|
107
113
|
},
|
|
108
|
-
"main": "./dist/module.cjs",
|
|
109
|
-
"types": "./dist/types.d.ts",
|
|
110
114
|
"files": [
|
|
111
115
|
"dist"
|
|
112
116
|
],
|
|
@@ -114,7 +118,7 @@ A minimum `package.json` should look like this:
|
|
|
114
118
|
"prepack": "nuxt-module-build build"
|
|
115
119
|
},
|
|
116
120
|
"dependencies": {
|
|
117
|
-
"@nuxt/kit": "
|
|
121
|
+
"@nuxt/kit": "latest"
|
|
118
122
|
},
|
|
119
123
|
"devDependencies": {
|
|
120
124
|
"@nuxt/module-builder": "latest"
|
|
@@ -142,8 +146,7 @@ Module builder generates dist files in `dist/` directory:
|
|
|
142
146
|
|
|
143
147
|
- `module.mjs`: Module entrypoint build from `src/module`
|
|
144
148
|
- `module.json`: Module meta extracted from `module.mjs` + `package.json`
|
|
145
|
-
- `
|
|
146
|
-
- `types.d.ts`: Exported types in addition to shims for `nuxt.config` auto completion.
|
|
149
|
+
- `types.d.mts`: Exported types in addition to shims for `nuxt.config` auto completion.
|
|
147
150
|
- `runtime/*`: Individually transformed files using [unjs/mkdist](https://github.com/unjs/mkdist)
|
|
148
151
|
- Javascript and `.ts` files will be transformed to `.js` with extracted types on `.d.ts` file with same name
|
|
149
152
|
- `.vue` files will be transformed with extracted `.d.ts` file
|
package/dist/chunks/build.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import { consola } from 'consola';
|
|
|
11
11
|
import { resolvePath, findExports, findTypeExports } from 'mlly';
|
|
12
12
|
import { defineCommand } from 'citty';
|
|
13
13
|
import { convertCompilerOptionsFromJson } from 'typescript';
|
|
14
|
-
import { v as version, n as name } from '../shared/module-builder.
|
|
14
|
+
import { v as version, n as name } from '../shared/module-builder.WIar1ojq.mjs';
|
|
15
15
|
|
|
16
16
|
const build = defineCommand({
|
|
17
17
|
meta: {
|
|
@@ -47,6 +47,7 @@ const build = defineCommand({
|
|
|
47
47
|
declaration: "node16",
|
|
48
48
|
sourcemap: context.args.sourcemap,
|
|
49
49
|
stub: context.args.stub,
|
|
50
|
+
stubOptions: { absoluteJitiPath: true },
|
|
50
51
|
outDir,
|
|
51
52
|
entries: [
|
|
52
53
|
"src/module",
|
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { defineCommand, runMain } from 'citty';
|
|
3
3
|
import { consola } from 'consola';
|
|
4
|
-
import { v as version, d as description, n as name } from './shared/module-builder.
|
|
4
|
+
import { v as version, d as description, n as name } from './shared/module-builder.WIar1ojq.mjs';
|
|
5
5
|
|
|
6
6
|
const _rDefault = (r) => r && typeof r === "object" && "default" in r ? r.default : r;
|
|
7
7
|
const main = defineCommand({
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/module-builder",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"repository": "nuxt/module-builder",
|
|
5
5
|
"description": "Complete solution for building Nuxt modules",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,47 +30,50 @@
|
|
|
30
30
|
"citty": "^0.1.6",
|
|
31
31
|
"consola": "^3.4.2",
|
|
32
32
|
"defu": "^6.1.4",
|
|
33
|
-
"jiti": "^2.
|
|
34
|
-
"magic-regexp": "^0.
|
|
33
|
+
"jiti": "^2.5.1",
|
|
34
|
+
"magic-regexp": "^0.10.0",
|
|
35
35
|
"mkdist": "^2.3.0",
|
|
36
36
|
"mlly": "^1.7.4",
|
|
37
37
|
"pathe": "^2.0.3",
|
|
38
|
-
"pkg-types": "^2.
|
|
39
|
-
"tsconfck": "^3.1.
|
|
40
|
-
"unbuild": "^3.
|
|
41
|
-
"vue-sfc-transformer": "^0.1.
|
|
38
|
+
"pkg-types": "^2.2.0",
|
|
39
|
+
"tsconfck": "^3.1.6",
|
|
40
|
+
"unbuild": "^3.6.0",
|
|
41
|
+
"vue-sfc-transformer": "^0.1.16"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@nuxt/cli": "^3.
|
|
45
|
-
"typescript": "^5.8.
|
|
44
|
+
"@nuxt/cli": "^3.26.4",
|
|
45
|
+
"typescript": "^5.8.3"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@arethetypeswrong/cli": "^0.
|
|
49
|
-
"@nuxt/cli": "^3.
|
|
50
|
-
"@nuxt/eslint-config": "^1.
|
|
51
|
-
"@nuxt/schema": "^
|
|
52
|
-
"@types/node": "^22.
|
|
53
|
-
"@
|
|
54
|
-
"
|
|
55
|
-
"
|
|
48
|
+
"@arethetypeswrong/cli": "^0.18.2",
|
|
49
|
+
"@nuxt/cli": "^3.26.4",
|
|
50
|
+
"@nuxt/eslint-config": "^1.7.1",
|
|
51
|
+
"@nuxt/schema": "^4.0.1",
|
|
52
|
+
"@types/node": "^22.16.5",
|
|
53
|
+
"@types/semver": "^7.7.0",
|
|
54
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
55
|
+
"changelogen": "^0.6.2",
|
|
56
|
+
"eslint": "^9.31.0",
|
|
56
57
|
"installed-check": "^9.3.0",
|
|
57
|
-
"knip": "^5.
|
|
58
|
-
"nuxt": "^
|
|
59
|
-
"
|
|
60
|
-
"
|
|
58
|
+
"knip": "^5.62.0",
|
|
59
|
+
"nuxt": "^4.0.1",
|
|
60
|
+
"ofetch": "^1.4.1",
|
|
61
|
+
"pkg-pr-new": "^0.0.54",
|
|
62
|
+
"publint": "^0.3.12",
|
|
63
|
+
"semver": "^7.7.2",
|
|
61
64
|
"tinyexec": "^1.0.1",
|
|
62
|
-
"typescript": "~5.8.
|
|
63
|
-
"vitest": "^3.
|
|
64
|
-
"vue": "^3.5.
|
|
65
|
-
"vue-tsc": "^
|
|
65
|
+
"typescript": "~5.8.3",
|
|
66
|
+
"vitest": "^3.2.4",
|
|
67
|
+
"vue": "^3.5.18",
|
|
68
|
+
"vue-tsc": "^3.0.4"
|
|
66
69
|
},
|
|
67
70
|
"resolutions": {
|
|
68
|
-
"@nuxt/kit": "^
|
|
71
|
+
"@nuxt/kit": "^4.0.1",
|
|
69
72
|
"@nuxt/module-builder": "workspace:*",
|
|
70
|
-
"@nuxt/schema": "^
|
|
71
|
-
"typescript": "~5.8.
|
|
72
|
-
"vue": "^3.5.
|
|
73
|
-
"vue-tsc": "^
|
|
73
|
+
"@nuxt/schema": "^4.0.1",
|
|
74
|
+
"typescript": "~5.8.3",
|
|
75
|
+
"vue": "^3.5.18",
|
|
76
|
+
"vue-tsc": "^3.0.4"
|
|
74
77
|
},
|
|
75
78
|
"engines": {
|
|
76
79
|
"node": "^18.0.0 || >=20.0.0"
|
|
@@ -79,6 +82,7 @@
|
|
|
79
82
|
"build": "unbuild",
|
|
80
83
|
"dev:prepare": "unbuild --stub && pnpm -r dev:prepare",
|
|
81
84
|
"example:build": "pnpm nuxt-module-build build ./example",
|
|
85
|
+
"example:stub": "pnpm nuxt-module-build build --stub ./example",
|
|
82
86
|
"lint": "eslint .",
|
|
83
87
|
"nuxt-module-build": "JITI_ESM_RESOLVE=1 jiti ./src/cli.ts",
|
|
84
88
|
"release": "pnpm vitest run && pnpm build && changelogen --release && pnpm publish && git push --follow-tags",
|