@dword-design/base-config-nuxt-module 1.0.4 → 2.0.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 +43 -43
- package/dist/index.d.ts +1 -0
- package/dist/index.js +46 -14
- package/package.json +21 -6
package/README.md
CHANGED
|
@@ -3,49 +3,49 @@
|
|
|
3
3
|
<!-- /TITLE -->
|
|
4
4
|
|
|
5
5
|
<!-- BADGES/ -->
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
6
|
+
<p>
|
|
7
|
+
<a href="https://npmjs.org/package/@dword-design/base-config-nuxt-module">
|
|
8
|
+
<img
|
|
9
|
+
src="https://img.shields.io/npm/v/@dword-design/base-config-nuxt-module.svg"
|
|
10
|
+
alt="npm version"
|
|
11
|
+
>
|
|
12
|
+
</a><img src="https://img.shields.io/badge/os-linux%20%7C%C2%A0macos%20%7C%C2%A0windows-blue" alt="Linux macOS Windows compatible"><a href="https://github.com/dword-design/base-config-nuxt-module/actions">
|
|
13
|
+
<img
|
|
14
|
+
src="https://github.com/dword-design/base-config-nuxt-module/workflows/build/badge.svg"
|
|
15
|
+
alt="Build status"
|
|
16
|
+
>
|
|
17
|
+
</a><a href="https://codecov.io/gh/dword-design/base-config-nuxt-module">
|
|
18
|
+
<img
|
|
19
|
+
src="https://codecov.io/gh/dword-design/base-config-nuxt-module/branch/master/graph/badge.svg"
|
|
20
|
+
alt="Coverage status"
|
|
21
|
+
>
|
|
22
|
+
</a><a href="https://david-dm.org/dword-design/base-config-nuxt-module">
|
|
23
|
+
<img src="https://img.shields.io/david/dword-design/base-config-nuxt-module" alt="Dependency status">
|
|
24
|
+
</a><img src="https://img.shields.io/badge/renovate-enabled-brightgreen" alt="Renovate enabled"><br/><a href="https://gitpod.io/#https://github.com/dword-design/base-config-nuxt-module">
|
|
25
|
+
<img
|
|
26
|
+
src="https://gitpod.io/button/open-in-gitpod.svg"
|
|
27
|
+
alt="Open in Gitpod"
|
|
28
|
+
width="114"
|
|
29
|
+
>
|
|
30
|
+
</a><a href="https://www.buymeacoffee.com/dword">
|
|
31
|
+
<img
|
|
32
|
+
src="https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg"
|
|
33
|
+
alt="Buy Me a Coffee"
|
|
34
|
+
width="114"
|
|
35
|
+
>
|
|
36
|
+
</a><a href="https://paypal.me/SebastianLandwehr">
|
|
37
|
+
<img
|
|
38
|
+
src="https://sebastianlandwehr.com/images/paypal.svg"
|
|
39
|
+
alt="PayPal"
|
|
40
|
+
width="163"
|
|
41
|
+
>
|
|
42
|
+
</a><a href="https://www.patreon.com/dworddesign">
|
|
43
|
+
<img
|
|
44
|
+
src="https://sebastianlandwehr.com/images/patreon.svg"
|
|
45
|
+
alt="Patreon"
|
|
46
|
+
width="163"
|
|
47
|
+
>
|
|
48
|
+
</a>
|
|
49
49
|
</p>
|
|
50
50
|
<!-- /BADGES -->
|
|
51
51
|
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (config: any): any;
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import packageName from
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import pathLib from "node:path";
|
|
2
|
+
import getNodeConfig, { getPackageConfig } from "@dword-design/base-config-node";
|
|
3
|
+
import packageName from "depcheck-package-name";
|
|
4
|
+
import endent from "endent";
|
|
5
|
+
import { execaCommand } from "execa";
|
|
6
|
+
import fs from "fs-extra";
|
|
7
|
+
import loadPkg from "load-pkg";
|
|
8
|
+
import { omit } from "lodash-es";
|
|
9
|
+
export default function (config) {
|
|
10
|
+
const packageConfig = loadPkg.sync(this.cwd);
|
|
11
|
+
const virtualImports = ["#imports", ...(config.virtualImports ?? [])];
|
|
12
|
+
const nodeConfig = getNodeConfig.call(this, config);
|
|
8
13
|
return {
|
|
9
|
-
...nodeConfig
|
|
10
|
-
|
|
14
|
+
...nodeConfig,
|
|
15
|
+
editorIgnore: [...nodeConfig.editorIgnore, ".nuxt"],
|
|
16
|
+
eslintConfig: endent`
|
|
11
17
|
import { createConfigForNuxt } from '${packageName`@nuxt/eslint-config`}/flat';
|
|
12
18
|
import config from '@dword-design/eslint-config';
|
|
13
19
|
import { globalIgnores } from "eslint/config";
|
|
@@ -17,13 +23,36 @@ export default config => {
|
|
|
17
23
|
config,
|
|
18
24
|
{
|
|
19
25
|
rules: {
|
|
20
|
-
'import/no-unresolved': ["error", { ignore: [${virtualImports.map(_import => `'${_import}'`).join(
|
|
26
|
+
'import-x/no-unresolved': ["error", { ignore: [${virtualImports.map(_import => `'${_import}'`).join(", ")}] }],
|
|
21
27
|
},
|
|
22
28
|
},
|
|
23
|
-
globalIgnores(['eslint.config.
|
|
29
|
+
globalIgnores(['eslint.config.ts']),
|
|
24
30
|
);\n
|
|
25
31
|
`,
|
|
26
|
-
|
|
32
|
+
gitignore: [...nodeConfig.gitignore, "/.nuxt"],
|
|
33
|
+
hasTypescriptConfigRootAlias: false,
|
|
34
|
+
lint: async options => {
|
|
35
|
+
options = {
|
|
36
|
+
log: process.env.NODE_ENV !== "test",
|
|
37
|
+
stderr: "inherit",
|
|
38
|
+
...options
|
|
39
|
+
};
|
|
40
|
+
await execaCommand("nuxt-build-module prepare", {
|
|
41
|
+
...(options.log && {
|
|
42
|
+
stdout: "inherit"
|
|
43
|
+
}),
|
|
44
|
+
cwd: this.cwd,
|
|
45
|
+
stderr: options.stderr
|
|
46
|
+
});
|
|
47
|
+
let tsconfig = await fs.readJson(pathLib.join(this.cwd, ".nuxt", "tsconfig.json"));
|
|
48
|
+
tsconfig = omit(tsconfig, ["compilerOptions.noEmit"]);
|
|
49
|
+
await fs.outputFile(pathLib.join(this.cwd, ".nuxt", "tsconfig.json"), JSON.stringify(tsconfig, void 0, 2));
|
|
50
|
+
},
|
|
51
|
+
packageConfig: getPackageConfig({
|
|
52
|
+
cwd: this.cwd,
|
|
53
|
+
mainFilename: "module.ts"
|
|
54
|
+
}),
|
|
55
|
+
readmeInstallString: endent`
|
|
27
56
|
## Install
|
|
28
57
|
|
|
29
58
|
\`\`\`bash
|
|
@@ -33,6 +62,9 @@ export default config => {
|
|
|
33
62
|
# Yarn
|
|
34
63
|
$ yarn nuxi module add ${packageConfig.name}
|
|
35
64
|
\`\`\`
|
|
36
|
-
|
|
65
|
+
`,
|
|
66
|
+
typescriptConfig: {
|
|
67
|
+
extends: "./.nuxt/tsconfig.json"
|
|
68
|
+
}
|
|
37
69
|
};
|
|
38
|
-
}
|
|
70
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dword-design/base-config-nuxt-module",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"repository": "dword-design/base-config-nuxt-module",
|
|
5
5
|
"funding": "https://github.com/sponsors/dword-design",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Sebastian Landwehr <info@sebastianlandwehr.com>",
|
|
8
8
|
"type": "module",
|
|
9
|
-
"exports":
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": {
|
|
12
|
+
"default": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
10
17
|
"main": "dist/index.js",
|
|
11
18
|
"files": [
|
|
12
19
|
"dist"
|
|
@@ -22,14 +29,22 @@
|
|
|
22
29
|
"test": "base test"
|
|
23
30
|
},
|
|
24
31
|
"dependencies": {
|
|
25
|
-
"@dword-design/base-config-node": "^3.0.
|
|
32
|
+
"@dword-design/base-config-node": "^3.0.15",
|
|
26
33
|
"@nuxt/eslint-config": "^1.4.1",
|
|
27
|
-
"
|
|
34
|
+
"@nuxt/module-builder": "^1.0.1",
|
|
28
35
|
"depcheck-package-name": "^3.0.1",
|
|
29
|
-
"
|
|
36
|
+
"endent": "npm:@dword-design/endent@^1.4.1",
|
|
37
|
+
"execa": "^9.6.0",
|
|
38
|
+
"fs-extra": "^11.3.0",
|
|
39
|
+
"load-pkg": "npm:@dword-design/load-pkg@^4.0.0",
|
|
40
|
+
"lodash-es": "^4.17.21"
|
|
30
41
|
},
|
|
31
42
|
"devDependencies": {
|
|
32
|
-
"@dword-design/base": "^
|
|
43
|
+
"@dword-design/base": "^13.0.6",
|
|
44
|
+
"@playwright/test": "^1.53.0",
|
|
45
|
+
"nuxt": "^3.17.5",
|
|
46
|
+
"output-files": "^2.0.32",
|
|
47
|
+
"playwright": "^1.53.0"
|
|
33
48
|
},
|
|
34
49
|
"packageManager": "pnpm@10.11.0+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977",
|
|
35
50
|
"engines": {
|