@dword-design/base-config-nuxt-module 4.0.0 → 5.0.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/dist/index.js +21 -8
- package/package.json +4 -7
package/dist/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import pathLib from "node:path";
|
|
2
1
|
import { defineBaseConfig } from "@dword-design/base";
|
|
3
2
|
import getNodeConfig, { getPackageConfig } from "@dword-design/base-config-node";
|
|
3
|
+
import dotenv from "@dword-design/dotenv-json-extended";
|
|
4
4
|
import packageName from "depcheck-package-name";
|
|
5
5
|
import endent from "endent";
|
|
6
6
|
import { execaCommand } from "execa";
|
|
7
|
-
import fs from "fs-extra";
|
|
8
|
-
import { omit } from "lodash-es";
|
|
9
7
|
import { readPackageSync } from "read-pkg";
|
|
10
8
|
export default defineBaseConfig(function (config) {
|
|
11
9
|
const packageConfig = readPackageSync({
|
|
@@ -53,13 +51,11 @@ export default defineBaseConfig(function (config) {
|
|
|
53
51
|
stdout: "inherit"
|
|
54
52
|
}),
|
|
55
53
|
cwd: this.cwd,
|
|
54
|
+
env: dotenv.parse({
|
|
55
|
+
cwd: this.cwd
|
|
56
|
+
}),
|
|
56
57
|
stderr: options.stderr
|
|
57
58
|
});
|
|
58
|
-
const tsconfig = await fs.readJson(pathLib.join(this.cwd, "tsconfig.json"));
|
|
59
|
-
let nuxtTsconfig = await fs.readJson(pathLib.join(this.cwd, ".nuxt", "tsconfig.json"));
|
|
60
|
-
nuxtTsconfig = omit(nuxtTsconfig, ["compilerOptions.noEmit"]);
|
|
61
|
-
nuxtTsconfig.compilerOptions.strict = !!tsconfig.compilerOptions.strict;
|
|
62
|
-
await fs.outputFile(pathLib.join(this.cwd, ".nuxt", "tsconfig.json"), JSON.stringify(nuxtTsconfig, void 0, 2));
|
|
63
59
|
},
|
|
64
60
|
packageConfig: getPackageConfig({
|
|
65
61
|
cwd: this.cwd,
|
|
@@ -76,6 +72,23 @@ export default defineBaseConfig(function (config) {
|
|
|
76
72
|
$ yarn nuxi module add ${packageConfig.name}
|
|
77
73
|
\`\`\`
|
|
78
74
|
`,
|
|
75
|
+
typecheck: async (options = {}) => {
|
|
76
|
+
options = {
|
|
77
|
+
log: process.env.NODE_ENV !== "test",
|
|
78
|
+
stderr: "inherit",
|
|
79
|
+
...options
|
|
80
|
+
};
|
|
81
|
+
await execaCommand("nuxt-build-module prepare", {
|
|
82
|
+
...(options.log && {
|
|
83
|
+
stdout: "inherit"
|
|
84
|
+
}),
|
|
85
|
+
cwd: this.cwd,
|
|
86
|
+
env: dotenv.parse({
|
|
87
|
+
cwd: this.cwd
|
|
88
|
+
}),
|
|
89
|
+
stderr: options.stderr
|
|
90
|
+
});
|
|
91
|
+
},
|
|
79
92
|
typescriptConfig: {
|
|
80
93
|
extends: "./.nuxt/tsconfig.json"
|
|
81
94
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dword-design/base-config-nuxt-module",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"repository": "dword-design/base-config-nuxt-module",
|
|
5
5
|
"funding": "https://github.com/sponsors/dword-design",
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,24 +31,21 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@dword-design/base": "^16.1.0",
|
|
33
33
|
"@dword-design/base-config-node": "^5.0.1",
|
|
34
|
+
"@dword-design/dotenv-json-extended": "^4.0.1",
|
|
34
35
|
"@nuxt/eslint-config": "^1.11.0",
|
|
35
36
|
"@nuxt/module-builder": "^1.0.2",
|
|
36
37
|
"depcheck-package-name": "^4.0.1",
|
|
37
38
|
"endent": "npm:@dword-design/endent@^1.4.7",
|
|
38
39
|
"execa": "^9.6.1",
|
|
39
|
-
"
|
|
40
|
-
"lodash-es": "^4.17.21",
|
|
41
|
-
"nuxt": "^3.20.1",
|
|
40
|
+
"nuxt": "^4.0.0",
|
|
42
41
|
"read-pkg": "^10.0.0"
|
|
43
42
|
},
|
|
44
43
|
"devDependencies": {
|
|
45
44
|
"@playwright/test": "^1.57.0",
|
|
46
|
-
"@types/fs-extra": "^11.0.4",
|
|
47
|
-
"@types/lodash-es": "^4.17.12",
|
|
48
45
|
"output-files": "^3.0.0",
|
|
49
46
|
"playwright": "^1.57.0"
|
|
50
47
|
},
|
|
51
|
-
"packageManager": "pnpm@10.
|
|
48
|
+
"packageManager": "pnpm@10.24.0+sha512.01ff8ae71b4419903b65c60fb2dc9d34cf8bb6e06d03bde112ef38f7a34d6904c424ba66bea5cdcf12890230bf39f9580473140ed9c946fef328b6e5238a345a",
|
|
52
49
|
"engines": {
|
|
53
50
|
"node": ">=22"
|
|
54
51
|
},
|