@dword-design/base-config-nuxt 8.0.4 → 8.1.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/analyze.d.ts CHANGED
@@ -1,2 +1,6 @@
1
- declare const _default: () => import("execa").ResultPromise<{}>;
2
- export default _default;
1
+ import type { Base, PartialCommandOptions } from '@dword-design/base';
2
+ export default function (this: Base, options?: PartialCommandOptions): import("execa").ResultPromise<{
3
+ cwd: string;
4
+ stderr: any;
5
+ stdout?: "inherit" | undefined;
6
+ }>;
package/dist/analyze.js CHANGED
@@ -1,2 +1,16 @@
1
1
  import { execaCommand } from "execa";
2
- export default () => execaCommand("nuxt build --analyze");
2
+ export default function (options = {}) {
3
+ options = {
4
+ env: {},
5
+ log: process.env.NODE_ENV !== "test",
6
+ stderr: "inherit",
7
+ ...options
8
+ };
9
+ return execaCommand("nuxt build --analyze", {
10
+ ...(options.log && {
11
+ stdout: "inherit"
12
+ }),
13
+ cwd: this.cwd,
14
+ stderr: options.stderr
15
+ });
16
+ }
@@ -8,8 +8,8 @@ export default ({
8
8
 
9
9
  import withNuxt from './.nuxt/eslint.config.mjs';
10
10
 
11
- export default withNuxt(
12
- globalIgnores([${["eslint.config.ts", ...ignore].map(pattern => `'${pattern}'`).join(", ")}]),
11
+ export default await withNuxt(
12
+ globalIgnores([${["eslint.config.ts", "eslint.lint-staged.config.ts", ...ignore].map(pattern => `'${pattern}'`).join(", ")}]),
13
13
  config,${virtualImports.length > 0 ? endent`
14
14
  \n{
15
15
  rules: {
@@ -23,5 +23,5 @@ export default ({
23
23
  'unicorn/filename-case': 'off',
24
24
  },
25
25
  },
26
- );
26
+ ).toConfigs();\n
27
27
  `;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { Base, Config } from '@dword-design/base';
2
+ import analyze from './analyze';
2
3
  import build from './build';
3
4
  import dev from './dev';
4
5
  import lint from './lint';
@@ -11,7 +12,7 @@ type ConfigNuxt = Config & {
11
12
  declare const _default: (this: Base, config: ConfigNuxt) => {
12
13
  allowedMatches: string[];
13
14
  commands: {
14
- analyze: () => import("execa").ResultPromise<{}>;
15
+ analyze: typeof analyze;
15
16
  build: typeof build;
16
17
  dev: typeof dev;
17
18
  prepublishOnly: typeof prepublishOnly;
@@ -29,6 +30,9 @@ declare const _default: (this: Base, config: ConfigNuxt) => {
29
30
  gitignore: string[];
30
31
  hasTypescriptConfigRootAlias: boolean;
31
32
  lint: typeof lint;
33
+ lintStagedConfig: {
34
+ '.{css,scss,vue}': string;
35
+ };
32
36
  npmPublish: boolean;
33
37
  packageConfig: {
34
38
  main: string;
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ import { fileURLToPath } from "node:url";
4
4
  import { defineBaseConfig } from "@dword-design/base";
5
5
  import depcheckParserSass from "@dword-design/depcheck-parser-sass";
6
6
  import depcheck from "depcheck";
7
+ import binName from "depcheck-bin-name";
7
8
  import packageName from "depcheck-package-name";
8
9
  import javascript from "endent";
9
10
  import { pick } from "lodash-es";
@@ -44,6 +45,9 @@ export default defineBaseConfig(function (config) {
44
45
  gitignore: ["/.eslintcache", "/.nuxt", "/.output", "/.stylelintcache", "/dist", "/nuxt.config.ts"],
45
46
  hasTypescriptConfigRootAlias: false,
46
47
  lint,
48
+ lintStagedConfig: {
49
+ ".{css,scss,vue}": `${binName`stylelint`} --fix`
50
+ },
47
51
  npmPublish: true,
48
52
  packageConfig: {
49
53
  main: "dist/index.js"
@@ -1,3 +1,4 @@
1
+ declare const basicAuthUser: string;
1
2
  declare const _default: {
2
3
  app: {
3
4
  head: {
@@ -31,7 +32,9 @@ declare const _default: {
31
32
  };
32
33
  runtimeConfig: {
33
34
  basicAuth?: {
34
- pairs: {};
35
+ pairs: {
36
+ [basicAuthUser]: string | undefined;
37
+ };
35
38
  } | undefined;
36
39
  };
37
40
  typescript: {
@@ -3,7 +3,8 @@ import packageName from "depcheck-package-name";
3
3
  import ts from "typescript";
4
4
  import viteSvgLoader from "vite-svg-loader";
5
5
  import config from "./config.js";
6
- const isBasicAuthEnabled = process.env.BASIC_AUTH_USER && process.env.BASIC_AUTH_PASSWORD;
6
+ const basicAuthUser = process.env.BASIC_AUTH_USER;
7
+ const isBasicAuthEnabled = basicAuthUser && process.env.BASIC_AUTH_PASSWORD;
7
8
  const {
8
9
  config: typescriptConfig
9
10
  } = ts.readConfigFile("tsconfig.json", ts.sys.readFile);
@@ -38,8 +39,10 @@ export default {
38
39
  modules: [defineNuxtModule({
39
40
  setup: (options, nuxt) => {
40
41
  if (!config.userScalable) {
41
- const viewportMeta = nuxt.options.app.head.meta.find(meta => meta.name === "viewport");
42
- viewportMeta.content += ", user-scalable=0";
42
+ const viewportMeta = nuxt.options.app.head.meta?.find?.(meta => meta.name === "viewport");
43
+ if (viewportMeta) {
44
+ viewportMeta.content += ", user-scalable=0";
45
+ }
43
46
  }
44
47
  }
45
48
  }), [packageName`nuxt-basic-authentication-module`, {
@@ -66,7 +69,7 @@ export default {
66
69
  ...(isBasicAuthEnabled && {
67
70
  basicAuth: {
68
71
  pairs: {
69
- [process.env.BASIC_AUTH_USER]: process.env.BASIC_AUTH_PASSWORD
72
+ [basicAuthUser]: process.env.BASIC_AUTH_PASSWORD
70
73
  }
71
74
  }
72
75
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dword-design/base-config-nuxt",
3
- "version": "8.0.4",
3
+ "version": "8.1.1",
4
4
  "repository": "dword-design/base-config-nuxt",
5
5
  "funding": "https://github.com/sponsors/dword-design",
6
6
  "license": "MIT",
@@ -8,10 +8,8 @@
8
8
  "type": "module",
9
9
  "exports": {
10
10
  ".": {
11
- "import": {
12
- "default": "./dist/index.js",
13
- "types": "./dist/index.d.ts"
14
- }
11
+ "default": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
15
13
  },
16
14
  "./config": "./dist/config.js",
17
15
  "./nuxt.config": "./dist/nuxt.config.js"
@@ -34,31 +32,33 @@
34
32
  },
35
33
  "dependencies": {
36
34
  "@babel/core": "^7.28.0",
37
- "@dword-design/base": "^15.1.0",
35
+ "@dword-design/base": "^15.3.5",
38
36
  "@dword-design/depcheck-parser-sass": "^5.0.0",
39
37
  "@dword-design/dotenv-json-extended": "^4.0.1",
40
38
  "@dword-design/nuxt-i18n": "^1.0.1",
41
39
  "@dword-design/nuxt-page-title": "^1.0.0",
42
40
  "@dword-design/stylelint-config": "^4.1.0",
43
- "@nuxt/eslint": "^1.6.0",
44
- "@nuxt/kit": "^4.0.0",
41
+ "@nuxt/eslint": "^1.8.0",
42
+ "@nuxt/kit": "^4.0.3",
45
43
  "@nuxtjs/stylelint-module": "^5.2.1",
46
44
  "babel-plugin-add-import-extension": "^1.6.0",
47
45
  "babel-plugin-module-resolver": "^5.0.2",
48
46
  "depcheck": "^1.4.7",
49
- "depcheck-package-name": "^4.0.0",
47
+ "depcheck-bin-name": "^2.0.0",
48
+ "depcheck-package-name": "^4.0.1",
50
49
  "endent": "npm:@dword-design/endent@^1.4.7",
51
50
  "execa": "^9.6.0",
52
- "fs-extra": "^11.3.0",
51
+ "fs-extra": "^11.3.1",
53
52
  "globby": "^14.1.0",
54
- "jiti": "^2.4.2",
53
+ "jiti": "^2.5.1",
55
54
  "lodash-es": "^4.17.21",
56
- "nuxt": "^3.17.7",
55
+ "nuxt": "^3.18.1",
57
56
  "nuxt-basic-authentication-module": "^0.2.1",
58
57
  "output-files": "^3.0.0",
59
58
  "require-package-name": "^2.0.1",
60
- "stylelint": "^16.22.0",
61
- "typescript": "^5.8.3",
59
+ "sass": "^1.90.0",
60
+ "stylelint": "^16.23.0",
61
+ "typescript": "^5.9.2",
62
62
  "vite-plugin-eslint2": "^5.0.4",
63
63
  "vite-svg-loader": "^5.1.0"
64
64
  },
@@ -66,16 +66,15 @@
66
66
  "@dword-design/defu": "^1.0.3",
67
67
  "@nuxtjs/sitemap": "^7.4.3",
68
68
  "@nuxtjs/tailwindcss": "7.0.0-beta.0",
69
- "@playwright/test": "^1.54.1",
69
+ "@playwright/browser-chromium": "^1.54.2",
70
+ "@playwright/test": "^1.54.2",
70
71
  "@types/babel__core": "^7.20.5",
71
72
  "@types/fs-extra": "^11.0.4",
72
73
  "@types/lodash-es": "^4.17.12",
73
- "axios": "^1.10.0",
74
+ "axios": "^1.11.0",
74
75
  "delay": "^6.0.0",
75
76
  "get-port": "^7.1.0",
76
- "nuxt-dev-ready": "^5.0.0",
77
- "playwright": "^1.54.1",
78
- "playwright-chromium": "^1.54.1",
77
+ "nuxt-dev-ready": "^5.0.1",
79
78
  "port-ready": "^0.1.0",
80
79
  "tree-kill-promise": "^4.0.0",
81
80
  "xml-formatter": "^3.6.6"