@dword-design/base-config-nuxt 6.2.14 → 7.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 CHANGED
@@ -3,49 +3,49 @@
3
3
  <!-- /TITLE -->
4
4
 
5
5
  <!-- BADGES/ -->
6
- <p>
7
- <a href="https://npmjs.org/package/@dword-design/base-config-nuxt">
8
- <img
9
- src="https://img.shields.io/npm/v/@dword-design/base-config-nuxt.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/actions">
13
- <img
14
- src="https://github.com/dword-design/base-config-nuxt/workflows/build/badge.svg"
15
- alt="Build status"
16
- >
17
- </a><a href="https://codecov.io/gh/dword-design/base-config-nuxt">
18
- <img
19
- src="https://codecov.io/gh/dword-design/base-config-nuxt/branch/master/graph/badge.svg"
20
- alt="Coverage status"
21
- >
22
- </a><a href="https://david-dm.org/dword-design/base-config-nuxt">
23
- <img src="https://img.shields.io/david/dword-design/base-config-nuxt" 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">
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>
6
+ <p>
7
+ <a href="https://npmjs.org/package/@dword-design/base-config-nuxt">
8
+ <img
9
+ src="https://img.shields.io/npm/v/@dword-design/base-config-nuxt.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/actions">
13
+ <img
14
+ src="https://github.com/dword-design/base-config-nuxt/workflows/build/badge.svg"
15
+ alt="Build status"
16
+ >
17
+ </a><a href="https://codecov.io/gh/dword-design/base-config-nuxt">
18
+ <img
19
+ src="https://codecov.io/gh/dword-design/base-config-nuxt/branch/master/graph/badge.svg"
20
+ alt="Coverage status"
21
+ >
22
+ </a><a href="https://david-dm.org/dword-design/base-config-nuxt">
23
+ <img src="https://img.shields.io/david/dword-design/base-config-nuxt" 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">
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
 
@@ -0,0 +1,2 @@
1
+ declare const _default: () => import("execa").ResultPromise<{}>;
2
+ export default _default;
package/dist/analyze.js CHANGED
@@ -1,2 +1,2 @@
1
- import { execaCommand } from 'execa';
2
- export default () => execaCommand('nuxt build --analyze');
1
+ import { execaCommand } from "execa";
2
+ export default () => execaCommand("nuxt build --analyze");
@@ -0,0 +1 @@
1
+ export default function (options: any): Promise<import("execa").Result<any>>;
package/dist/build.js CHANGED
@@ -1,20 +1,19 @@
1
- import pathLib from 'node:path';
2
- import dotenv from '@dword-design/dotenv-json-extended';
3
- import { execaCommand } from 'execa';
4
- import fs from 'fs-extra';
1
+ import dotenv from "@dword-design/dotenv-json-extended";
2
+ import { execaCommand } from "execa";
3
+ import resolveAliases from "./resolve-aliases.js";
5
4
  export default async function (options) {
6
5
  options = {
7
6
  env: {},
8
- log: process.env.NODE_ENV !== 'test',
9
- stderr: 'inherit',
7
+ log: process.env.NODE_ENV !== "test",
8
+ stderr: "inherit",
10
9
  ...options
11
10
  };
12
- const nuxt = await execaCommand('nuxt build', {
11
+ const nuxt = await execaCommand("nuxt build", {
13
12
  ...(options.log && {
14
- stdout: 'inherit'
13
+ stdout: "inherit"
15
14
  }),
16
15
  stderr: options.stderr,
17
- ...(process.env.NODE_ENV === 'test' ? {
16
+ ...(process.env.NODE_ENV === "test" ? {
18
17
  env: {
19
18
  NUXT_TELEMETRY_DISABLED: 1
20
19
  }
@@ -27,16 +26,15 @@ export default async function (options) {
27
26
  ...options.env
28
27
  }
29
28
  });
30
- if (await fs.exists(pathLib.join(this.cwd, 'model'))) {
31
- await fs.remove(pathLib.join(this.cwd, 'dist'));
32
- await execaCommand('babel --out-dir dist --copy-files --no-copy-ignored --ignore **/*.spec.js model', {
33
- ...(options.log && {
34
- stdout: 'inherit'
35
- }),
36
- cwd: this.cwd,
37
- env: options.env,
38
- stderr: options.stderr
39
- });
40
- }
29
+ await execaCommand("mkdist --src=model --declaration --ext=js --pattern=** --pattern=!**/*.spec.ts --pattern=!**/*-snapshots", {
30
+ ...(options.log && {
31
+ stdout: "inherit"
32
+ }),
33
+ cwd: this.cwd,
34
+ stderr: options.stderr
35
+ });
36
+ await resolveAliases({
37
+ cwd: this.cwd
38
+ });
41
39
  return nuxt;
42
40
  }
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
package/dist/config.js CHANGED
@@ -1,10 +1,11 @@
1
- import pathLib from 'node:path';
2
- import { pathToFileURL } from 'node:url';
3
- const moduleUrl = pathToFileURL(pathLib.join(process.cwd(), 'config.js')).href;
1
+ import pathLib from "node:path";
2
+ import { pathToFileURL } from "node:url";
3
+ const modulePath = pathLib.join(process.cwd(), "config.ts");
4
+ const moduleUrl = pathToFileURL(modulePath).href;
4
5
  const {
5
6
  default: config
6
7
  } = await import(moduleUrl).catch(error => {
7
- if (error.code === 'ERR_MODULE_NOT_FOUND' && error.url === moduleUrl) {
8
+ if (error.message.startsWith(`Cannot find module '${modulePath}'`)) {
8
9
  return {
9
10
  default: {}
10
11
  };
@@ -13,7 +14,7 @@ const {
13
14
  }
14
15
  });
15
16
  export default {
16
- name: 'Vue app',
17
+ name: "Vue app",
17
18
  userScalable: true,
18
19
  ...config
19
20
  };
package/dist/dev.d.ts ADDED
@@ -0,0 +1 @@
1
+ export default function (options: any): import("execa").ResultPromise<any>;
package/dist/dev.js CHANGED
@@ -1,15 +1,15 @@
1
- import dotenv from '@dword-design/dotenv-json-extended';
2
- import { execaCommand } from 'execa';
1
+ import dotenv from "@dword-design/dotenv-json-extended";
2
+ import { execaCommand } from "execa";
3
3
  export default function (options) {
4
4
  options = {
5
5
  env: {},
6
- log: process.env.NODE_ENV !== 'test',
7
- stderr: 'inherit',
6
+ log: process.env.NODE_ENV !== "test",
7
+ stderr: "inherit",
8
8
  ...options
9
9
  };
10
- return execaCommand('nuxt dev', {
10
+ return execaCommand("nuxt dev", {
11
11
  ...(options.log && {
12
- stdout: 'inherit'
12
+ stdout: "inherit"
13
13
  }),
14
14
  cwd: this.cwd,
15
15
  env: {
@@ -18,7 +18,7 @@ export default function (options) {
18
18
  }),
19
19
  ...options.env
20
20
  },
21
- reject: process.env.NODE_ENV !== 'test',
21
+ reject: process.env.NODE_ENV !== "test",
22
22
  stderr: options.stderr
23
23
  });
24
24
  }
@@ -0,0 +1,4 @@
1
+ declare const _default: ({ cwd }: {
2
+ cwd?: string | undefined;
3
+ }) => (path: any) => any[];
4
+ export default _default;
@@ -1,25 +1,16 @@
1
- import pathLib from 'node:path';
2
- import { filter, first, map } from '@dword-design/functions';
3
- import jitiBabelTransform from '@dword-design/jiti-babel-transform';
4
- import { createJiti } from 'jiti';
5
- import requirePackageName from 'require-package-name';
1
+ import pathLib from "node:path";
2
+ import { createJiti } from "jiti";
3
+ import requirePackageName from "require-package-name";
6
4
  export default ({
7
- cwd = '.'
5
+ cwd = "."
8
6
  }) => path => {
9
- if (pathLib.basename(path) === 'config.js') {
10
- var _ref, _ref2, _modules;
11
- // TODO: Check full path including cwd so that we check config.js at project root
7
+ if (pathLib.basename(path) === "config.ts") {
12
8
  const jitiInstance = createJiti(pathLib.resolve(cwd), {
13
- esmResolve: true,
14
- interopDefault: true,
15
- transform: jitiBabelTransform
9
+ interopDefault: true
16
10
  });
17
- const config = jitiInstance('./config.js');
11
+ const config = jitiInstance("./config.ts");
18
12
  const modules = [...(config.modules || []), ...(config.buildModules || [])];
19
- return _ref = (_ref2 = (_modules = modules, map(mod => {
20
- var _flat;
21
- return _flat = [mod].flat(), first(_flat);
22
- })(_modules)), filter(name => typeof name === 'string')(_ref2)), map(name => requirePackageName(name))(_ref);
13
+ return modules.map(mod => [mod].flat()[0]).filter(name => typeof name === "string").map(name => requirePackageName(name));
23
14
  }
24
15
  return [];
25
16
  };
@@ -0,0 +1,5 @@
1
+ declare const _default: ({ virtualImports, ignore }?: {
2
+ virtualImports?: never[] | undefined;
3
+ ignore?: never[] | undefined;
4
+ }) => any;
5
+ export default _default;
@@ -1,4 +1,4 @@
1
- import { endent } from '@dword-design/functions';
1
+ import endent from "endent";
2
2
  export default ({
3
3
  virtualImports = [],
4
4
  ignore = []
@@ -9,17 +9,16 @@ export default ({
9
9
  import withNuxt from './.nuxt/eslint.config.mjs';
10
10
 
11
11
  export default withNuxt(
12
- globalIgnores([${['eslint.config.js', ...ignore].map(pattern => `'${pattern}'`).join(', ')}]),
13
- config,
14
- ${virtualImports.length > 0 ? endent`
15
- {
12
+ globalIgnores([${["eslint.config.ts", ...ignore].map(pattern => `'${pattern}'`).join(", ")}]),
13
+ config,${virtualImports.length > 0 ? endent`
14
+ \n{
16
15
  rules: {
17
- 'import/no-unresolved': ['error', { ignore: [${virtualImports.map(_import => `'${_import}'`).join(', ')}] }],
16
+ 'import-x/no-unresolved': ['error', { ignore: [${virtualImports.map(_import => `'${_import}'`).join(", ")}] }],
18
17
  },
19
18
  },
20
- ` : ''}
19
+ ` : ""}
21
20
  {
22
- files: ['**/pages/**/*.{vue,js,ts}', 'server/api/**/*.{js,ts}'],
21
+ files: ['**/pages/**/*.{vue,ts}', 'server/api/**/*.ts'],
23
22
  rules: {
24
23
  'unicorn/filename-case': 'off',
25
24
  },
@@ -0,0 +1,33 @@
1
+ import build from './build';
2
+ import dev from './dev';
3
+ import lint from './lint';
4
+ import prepublishOnly from './prepublish-only';
5
+ import start from './start';
6
+ export default function (config: any): {
7
+ allowedMatches: string[];
8
+ commands: {
9
+ analyze: () => import("execa").ResultPromise<{}>;
10
+ build: typeof build;
11
+ dev: typeof dev;
12
+ prepublishOnly: typeof prepublishOnly;
13
+ start: typeof start;
14
+ };
15
+ depcheckConfig: {
16
+ parsers: {
17
+ '**/*.scss': any;
18
+ '**/*.vue': any;
19
+ };
20
+ specials: ((path: any) => any[])[];
21
+ };
22
+ editorIgnore: string[];
23
+ eslintConfig: any;
24
+ gitignore: string[];
25
+ lint: typeof lint;
26
+ npmPublish: boolean;
27
+ packageConfig: {
28
+ main: string;
29
+ };
30
+ prepare: () => Promise<void>;
31
+ useJobMatrix: boolean;
32
+ };
33
+ export { default as getEslintConfig } from './get-eslint-config';
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import { createRequire } from 'node:module';
2
- import P from 'node:path';
3
- import { fileURLToPath } from 'node:url';
4
- import depcheckParserSass from '@dword-design/depcheck-parser-sass';
5
- import { endent as javascript } from '@dword-design/functions';
6
- import packageName from 'depcheck-package-name';
7
- import depcheckParserVue from 'depcheck-parser-vue';
8
- import { pick } from 'lodash-es';
9
- import outputFiles from 'output-files';
1
+ import { createRequire } from "node:module";
2
+ import P from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import depcheckParserSass from "@dword-design/depcheck-parser-sass";
5
+ import packageName from "depcheck-package-name";
6
+ import depcheckParserVue from "depcheck-parser-vue";
7
+ import javascript from "endent";
8
+ import { pick } from "lodash-es";
9
+ import outputFiles from "output-files";
10
10
  import analyze from "./analyze.js";
11
11
  import build from "./build.js";
12
12
  import dev from "./dev.js";
@@ -17,10 +17,10 @@ import prepublishOnly from "./prepublish-only.js";
17
17
  import start from "./start.js";
18
18
  const __dirname = P.dirname(fileURLToPath(import.meta.url));
19
19
  const resolver = createRequire(import.meta.url);
20
- const isInNodeModules = __dirname.split(P.sep).includes('node_modules');
20
+ const isInNodeModules = __dirname.split(P.sep).includes("node_modules");
21
21
  export default function (config) {
22
22
  return {
23
- allowedMatches: ['.stylelintrc.json', 'server/api/**/*.js', 'server/plugins/**/*.js', 'server/routes/**/*.js', 'server/middleware/**/*.js', 'app.vue', 'assets', 'components', 'composables', 'content', 'i18n', 'layouts', 'middleware', 'model', 'modules', 'config.js', 'pages', 'plugins', 'public', 'store', 'types'],
23
+ allowedMatches: [".stylelintrc.json", "server/api/**/*.ts", "server/plugins/**/*.ts", "server/routes/**/*.ts", "server/middleware/**/*.ts", "app.vue", "assets", "components", "composables", "content", "i18n", "layouts", "middleware", "model", "modules", "config.ts", "pages", "plugins", "public", "store", "types"],
24
24
  commands: {
25
25
  analyze,
26
26
  build,
@@ -30,29 +30,30 @@ export default function (config) {
30
30
  },
31
31
  depcheckConfig: {
32
32
  parsers: {
33
- '**/*.scss': depcheckParserSass,
34
- '**/*.vue': depcheckParserVue
33
+ "**/*.scss": depcheckParserSass,
34
+ "**/*.vue": depcheckParserVue
35
35
  },
36
36
  specials: [getDepcheckSpecial({
37
37
  cwd: this.cwd
38
38
  })]
39
39
  },
40
- editorIgnore: ['.eslintcache', '.stylelintcache', '.stylelintrc.json', '.nuxt', '.output', 'dist', 'nuxt.config.js'],
41
- eslintConfig: getEslintConfig(pick(config, ['virtualImports'])),
42
- gitignore: ['/.eslintcache', '/.nuxt', '/.output', '/.stylelintcache', '/dist', '/nuxt.config.js'],
40
+ editorIgnore: [".eslintcache", ".stylelintcache", ".stylelintrc.json", ".nuxt", ".output", "dist", "nuxt.config.ts"],
41
+ eslintConfig: getEslintConfig(pick(config, ["virtualImports"])),
42
+ gitignore: ["/.eslintcache", "/.nuxt", "/.output", "/.stylelintcache", "/dist", "/nuxt.config.ts"],
43
43
  lint,
44
44
  npmPublish: true,
45
45
  packageConfig: {
46
- main: 'dist/index.js'
46
+ main: "dist/index.js"
47
47
  },
48
48
  prepare: async () => {
49
- const configPath = isInNodeModules ? '@dword-design/base-config-nuxt/config' : `./${P.relative(this.cwd, resolver.resolve('./config.js')).split(P.sep).join('/')}`;
50
- const parentConfigPath = isInNodeModules ? '@dword-design/base-config-nuxt/nuxt.config' : `./${P.relative(this.cwd, resolver.resolve('./nuxt.config.js')).split(P.sep).join('/')}`;
49
+ const configPath = isInNodeModules ? "@dword-design/base-config-nuxt/config" : `./${P.relative(this.cwd, resolver.resolve("./config")).split(P.sep).join("/")}`;
50
+ const parentConfigPath = isInNodeModules ? "@dword-design/base-config-nuxt/nuxt.config" : `./${P.relative(this.cwd, resolver.resolve("./nuxt.config")).split(P.sep).join("/")}`;
51
51
  await outputFiles(this.cwd, {
52
- '.stylelintrc.json': `${JSON.stringify({
52
+ ".stylelintrc.json": `${JSON.stringify({
53
53
  extends: packageName`@dword-design/stylelint-config`
54
- }, undefined, 2)}\n`,
55
- 'nuxt.config.js': javascript`
54
+ }, void 0, 2)}
55
+ `,
56
+ "nuxt.config.ts": javascript`
56
57
  import config from '${configPath}';
57
58
 
58
59
  export default {
package/dist/lint.d.ts ADDED
@@ -0,0 +1 @@
1
+ export default function (options: any): Promise<void>;
package/dist/lint.js CHANGED
@@ -1,20 +1,20 @@
1
- import { execaCommand } from 'execa';
1
+ import { execaCommand } from "execa";
2
2
  export default async function (options) {
3
3
  options = {
4
- log: process.env.NODE_ENV !== 'test',
5
- stderr: 'inherit',
4
+ log: process.env.NODE_ENV !== "test",
5
+ stderr: "inherit",
6
6
  ...options
7
7
  };
8
- await execaCommand('nuxi prepare', {
8
+ await execaCommand("nuxi prepare", {
9
9
  ...(options.log && {
10
- stdout: 'inherit'
10
+ stdout: "inherit"
11
11
  }),
12
12
  cwd: this.cwd,
13
13
  stderr: options.stderr
14
14
  });
15
- await execaCommand('stylelint --fix --allow-empty-input --ignore-path .gitignore **/*.{css,scss,vue}', {
15
+ await execaCommand("stylelint --fix --allow-empty-input --ignore-path .gitignore **/*.{css,scss,vue}", {
16
16
  ...(options.log && {
17
- stdout: 'inherit'
17
+ stdout: "inherit"
18
18
  }),
19
19
  cwd: this.cwd,
20
20
  stderr: options.stderr
@@ -0,0 +1,51 @@
1
+ declare const _default: {
2
+ app: {
3
+ head: {
4
+ meta: ({
5
+ content: any;
6
+ hid: string;
7
+ name: string;
8
+ } | {
9
+ content: string;
10
+ name: string;
11
+ hid?: undefined;
12
+ })[];
13
+ };
14
+ };
15
+ devtools: {
16
+ enabled: boolean;
17
+ };
18
+ eslint: {
19
+ checker: {
20
+ fix: boolean;
21
+ };
22
+ config: {
23
+ standalone: boolean;
24
+ };
25
+ };
26
+ modules: any[];
27
+ router: {
28
+ options: {
29
+ linkActiveClass: string;
30
+ };
31
+ };
32
+ runtimeConfig: {
33
+ basicAuth?: {
34
+ pairs: {};
35
+ } | undefined;
36
+ };
37
+ vite: {
38
+ css: {
39
+ modules: {
40
+ localsConvention: string;
41
+ };
42
+ };
43
+ plugins: import("vite").Plugin<any>[];
44
+ vue: {
45
+ template: {
46
+ transformAssetUrls: boolean;
47
+ };
48
+ };
49
+ };
50
+ };
51
+ export default _default;
@@ -1,23 +1,21 @@
1
- import { createRequire } from 'node:module';
2
- import packageName from 'depcheck-package-name';
3
- import viteSvgLoader from 'vite-svg-loader';
1
+ import packageName from "depcheck-package-name";
2
+ import viteSvgLoader from "vite-svg-loader";
4
3
  import config from "./config.js";
5
- const resolver = createRequire(import.meta.url);
6
4
  const isBasicAuthEnabled = process.env.BASIC_AUTH_USER && process.env.BASIC_AUTH_PASSWORD;
7
5
  export default {
8
6
  app: {
9
7
  head: {
10
8
  meta: [{
11
9
  content: config.name,
12
- hid: 'description',
13
- name: 'description'
10
+ hid: "description",
11
+ name: "description"
14
12
  }, ...(config.webApp ? [{
15
- content: 'yes',
16
- name: 'apple-mobile-web-app-capable'
13
+ content: "yes",
14
+ name: "apple-mobile-web-app-capable"
17
15
  }] : []), ...(config.ogImage ? [{
18
16
  content: config.ogImage,
19
- hid: 'og:image',
20
- name: 'og:image'
17
+ hid: "og:image",
18
+ name: "og:image"
21
19
  }] : [])]
22
20
  }
23
21
  },
@@ -32,16 +30,10 @@ export default {
32
30
  standalone: false
33
31
  }
34
32
  },
35
- i18n: {
36
- bundle: {
37
- optimizeTranslationDirective: false
38
- }
39
- },
40
- // @nuxtjs/i18n only checks global options, not inline options, so it needs to be declared here.
41
33
  modules: [(options, nuxt) => {
42
34
  if (!config.userScalable) {
43
- const viewportMeta = nuxt.options.app.head.meta.find(meta => meta.name === 'viewport');
44
- viewportMeta.content += ', user-scalable=0';
35
+ const viewportMeta = nuxt.options.app.head.meta.find(meta => meta.name === "viewport");
36
+ viewportMeta.content += ", user-scalable=0";
45
37
  }
46
38
  }, [packageName`nuxt-basic-authentication-module`, {
47
39
  enabled: !!isBasicAuthEnabled
@@ -50,18 +42,20 @@ export default {
50
42
  failOnWarning: true,
51
43
  fix: true,
52
44
  lintOnStart: false
53
- }], resolver.resolve('./manually-installed-modules/i18n/index.js')],
54
- plugins: [resolver.resolve('./plugins/title.js')],
45
+ }], [packageName`@dword-design/nuxt-page-title`, {
46
+ description: config.title,
47
+ name: config.name
48
+ }], [packageName`@dword-design/nuxt-i18n`, {
49
+ ...(process.env.BASE_URL && {
50
+ baseUrl: process.env.BASE_URL
51
+ })
52
+ }]],
55
53
  router: {
56
54
  options: {
57
- linkActiveClass: 'active'
55
+ linkActiveClass: "active"
58
56
  }
59
57
  },
60
58
  runtimeConfig: {
61
- public: {
62
- name: config.name,
63
- title: config.title
64
- },
65
59
  ...(isBasicAuthEnabled && {
66
60
  basicAuth: {
67
61
  pairs: {
@@ -73,7 +67,7 @@ export default {
73
67
  vite: {
74
68
  css: {
75
69
  modules: {
76
- localsConvention: 'camelCaseOnly'
70
+ localsConvention: "camelCaseOnly"
77
71
  }
78
72
  },
79
73
  plugins: [viteSvgLoader()],
@@ -82,6 +76,5 @@ export default {
82
76
  transformAssetUrls: false
83
77
  }
84
78
  }
85
- },
86
- watch: ['config.js']
79
+ }
87
80
  };
@@ -0,0 +1 @@
1
+ export default function (options: any): Promise<any>;
@@ -1,4 +1,4 @@
1
1
  export default async function (options) {
2
2
  await this.lint(options);
3
- return this.run('build', options);
3
+ return this.run("build", options);
4
4
  }
@@ -0,0 +1,4 @@
1
+ declare const _default: ({ cwd }?: {
2
+ cwd?: string | undefined;
3
+ }) => Promise<void>;
4
+ export default _default;
@@ -0,0 +1,32 @@
1
+ import pathLib from "node:path";
2
+ import * as babel from "@babel/core";
3
+ import packageName from "depcheck-package-name";
4
+ import fs from "fs-extra";
5
+ import { globby } from "globby";
6
+ export default async ({
7
+ cwd = "."
8
+ } = {}) => {
9
+ const babelConfig = {
10
+ plugins: [[packageName`babel-plugin-module-resolver`, {
11
+ alias: {
12
+ "@/src": "./dist"
13
+ },
14
+ cwd
15
+ }], packageName`babel-plugin-add-import-extension`]
16
+ };
17
+ const paths = await globby("**/*.js", {
18
+ absolute: true,
19
+ cwd: pathLib.join(cwd, "dist")
20
+ });
21
+ await Promise.all(paths.map(async path => {
22
+ const source = await fs.readFile(path, "utf8");
23
+ const result = await babel.transformAsync(source, {
24
+ ...babelConfig,
25
+ cwd,
26
+ filename: path
27
+ });
28
+ if (result?.code) {
29
+ await fs.outputFile(path, result.code);
30
+ }
31
+ }));
32
+ };
@@ -0,0 +1 @@
1
+ export default function (options: any): import("execa").ResultPromise<any>;
package/dist/start.js CHANGED
@@ -1,15 +1,15 @@
1
- import dotenv from '@dword-design/dotenv-json-extended';
2
- import { execaCommand } from 'execa';
1
+ import dotenv from "@dword-design/dotenv-json-extended";
2
+ import { execaCommand } from "execa";
3
3
  export default function (options) {
4
4
  options = {
5
5
  env: {},
6
- log: process.env.NODE_ENV !== 'test',
7
- stderr: 'inherit',
6
+ log: process.env.NODE_ENV !== "test",
7
+ stderr: "inherit",
8
8
  ...options
9
9
  };
10
- return execaCommand('nuxt start', {
10
+ return execaCommand("nuxt start", {
11
11
  ...(options.log && {
12
- stdout: 'inherit'
12
+ stdout: "inherit"
13
13
  }),
14
14
  cwd: this.cwd,
15
15
  env: {
@@ -18,7 +18,7 @@ export default function (options) {
18
18
  }),
19
19
  ...options.env
20
20
  },
21
- reject: process.env.NODE_ENV !== 'test',
21
+ reject: process.env.NODE_ENV !== "test",
22
22
  stderr: options.stderr
23
23
  });
24
24
  }
package/package.json CHANGED
@@ -1,13 +1,18 @@
1
1
  {
2
2
  "name": "@dword-design/base-config-nuxt",
3
- "version": "6.2.14",
3
+ "version": "7.0.0",
4
4
  "repository": "dword-design/base-config-nuxt",
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
9
  "exports": {
10
- ".": "./dist/index.js",
10
+ ".": {
11
+ "import": {
12
+ "default": "./dist/index.js",
13
+ "types": "./dist/index.d.ts"
14
+ }
15
+ },
11
16
  "./config": "./dist/config.js",
12
17
  "./nuxt.config": "./dist/nuxt.config.js"
13
18
  },
@@ -26,47 +31,47 @@
26
31
  "test": "base test"
27
32
  },
28
33
  "dependencies": {
34
+ "@babel/core": "^7.27.4",
29
35
  "@dword-design/depcheck-parser-sass": "^4.0.4",
30
- "@dword-design/dotenv-json-extended": "^3.0.1",
31
- "@dword-design/functions": "^6.0.2",
32
- "@dword-design/jiti-babel-transform": "^2.0.0",
36
+ "@dword-design/dotenv-json-extended": "^3.0.3",
37
+ "@dword-design/nuxt-i18n": "^1.0.1",
38
+ "@dword-design/nuxt-page-title": "^1.0.0",
33
39
  "@dword-design/stylelint-config": "^4.0.2",
34
40
  "@nuxt/eslint": "^1.4.1",
35
- "@nuxt/kit": "^3.17.4",
36
- "@nuxtjs/i18n": "^9.5.4",
37
41
  "@nuxtjs/stylelint-module": "^5.2.1",
42
+ "babel-plugin-add-import-extension": "^1.6.0",
43
+ "babel-plugin-module-resolver": "^5.0.2",
38
44
  "depcheck-package-name": "^3.0.1",
39
45
  "depcheck-parser-vue": "^5.0.0",
46
+ "endent": "npm:@dword-design/endent@^1.4.1",
40
47
  "execa": "^9.6.0",
41
48
  "fs-extra": "^11.3.0",
42
49
  "globby": "^14.1.0",
43
50
  "jiti": "^2.4.2",
44
51
  "lodash-es": "^4.17.21",
45
- "nuxt": "^3.17.4",
52
+ "nuxt": "^3.17.5",
46
53
  "nuxt-basic-authentication-module": "^0.2.1",
47
54
  "output-files": "^2.0.32",
48
55
  "require-package-name": "^2.0.1",
49
- "stylelint": "^16.19.1",
56
+ "stylelint": "^16.20.0",
50
57
  "vite-plugin-eslint2": "^5.0.3",
51
58
  "vite-svg-loader": "^5.1.0"
52
59
  },
53
60
  "devDependencies": {
54
- "@dword-design/base": "^12.0.18",
55
- "@nuxtjs/sitemap": "^7.3.0",
56
- "@playwright/test": "^1.52.0",
57
- "axios": "^1.9.0",
61
+ "@dword-design/base": "^13.0.7",
62
+ "@nuxtjs/sitemap": "^7.4.0",
63
+ "@playwright/test": "^1.53.0",
64
+ "axios": "^1.10.0",
65
+ "delay": "^6.0.0",
58
66
  "depcheck": "^1.4.7",
59
67
  "get-port": "^7.1.0",
60
- "nuxt-dev-ready": "^3.0.0",
61
- "playwright": "^1.52.0",
62
- "playwright-chromium": "^1.52.0",
68
+ "nuxt-dev-ready": "^4.0.0",
69
+ "playwright": "^1.53.0",
70
+ "playwright-chromium": "^1.53.0",
63
71
  "port-ready": "^0.1.0",
64
72
  "tree-kill-promise": "^3.0.14",
65
73
  "xml-formatter": "^3.6.6"
66
74
  },
67
- "peerDependencies": {
68
- "h3": "*"
69
- },
70
75
  "packageManager": "pnpm@10.8.1+sha512.c50088ba998c67b8ca8c99df8a5e02fd2ae2e2b29aaf238feaa9e124248d3f48f9fb6db2424949ff901cffbb5e0f0cc1ad6aedb602cd29450751d11c35023677",
71
76
  "engines": {
72
77
  "node": ">=18"
@@ -1,49 +0,0 @@
1
- import P from 'node:path';
2
- import { addPlugin, createResolver, defineNuxtModule, installModule } from '@nuxt/kit';
3
- import packageName from 'depcheck-package-name';
4
- import { globby } from 'globby';
5
- const resolver = createResolver(import.meta.url);
6
- export default defineNuxtModule({
7
- setup: async (options, nuxt) => {
8
- const filenames = await globby('*.json', {
9
- cwd: P.join(nuxt.options.srcDir, 'i18n')
10
- });
11
- const locales = filenames.map(filename => P.basename(filename, '.json'));
12
- const defaultLocale = locales.includes('en') ? 'en' : locales[0];
13
- if (locales.length === 0) {
14
- return;
15
- }
16
-
17
- /**
18
- * @nuxtjs/i18n won't be able to merge the locales because it will not be in the layer configs
19
- * since we install it via @nuxtjs/i18n (see applyLayerOptions calling getLayerI18n).
20
- * So we add the locales via the hook.
21
- */
22
- nuxt.hook('i18n:registerModule', register => register({
23
- langDir: P.join(nuxt.options.srcDir, 'i18n'),
24
- // Set to '.' when passed directly as inline module options
25
- locales: locales.map(locale => ({
26
- code: locale,
27
- file: `${locale}.json`,
28
- language: locale
29
- }))
30
- }));
31
- await installModule(packageName`@nuxtjs/i18n`, {
32
- defaultLocale,
33
- detectBrowserLanguage: locales.length === 1 ? false : {
34
- fallbackLocale: defaultLocale,
35
- redirectOn: 'no prefix',
36
- useCookie: false
37
- },
38
- lazy: true,
39
- strategy: `${locales.length === 1 ? 'no_' : ''}prefix`,
40
- ...(process.env.BASE_URL && {
41
- baseUrl: process.env.BASE_URL
42
- })
43
- });
44
- addPlugin(resolver.resolve('./plugin.js'), {
45
- append: true
46
- });
47
- await installModule(resolver.resolve('../locale-link/index.js'));
48
- }
49
- });
@@ -1,7 +0,0 @@
1
- import { defineNuxtPlugin, useHead, useLocaleHead } from '#imports';
2
- export default defineNuxtPlugin(() => {
3
- const i18nHead = useLocaleHead({
4
- addSeoAttributes: true
5
- });
6
- useHead(i18nHead);
7
- });
@@ -1,12 +0,0 @@
1
- <template>
2
- <nuxt-link v-bind="$attrs" :to="localePath(to)">
3
- <slot />
4
- </nuxt-link>
5
- </template>
6
-
7
- <script setup>
8
- import { useLocalePath } from '#imports';
9
-
10
- defineProps({ to: { required: true } });
11
- const localePath = useLocalePath();
12
- </script>
@@ -1,8 +0,0 @@
1
- import { addComponent, createResolver, defineNuxtModule } from '@nuxt/kit';
2
- const resolver = createResolver(import.meta.url);
3
- export default defineNuxtModule({
4
- setup: () => addComponent({
5
- filePath: resolver.resolve('./component.vue'),
6
- name: 'NuxtLocaleLink'
7
- })
8
- });
@@ -1,3 +0,0 @@
1
- import { defineNuxtPlugin } from '#imports';
2
- import Component from "./component.vue";
3
- export default defineNuxtPlugin(nuxtApp => nuxtApp.vueApp.component('NuxtLocaleLink', Component));
@@ -1,12 +0,0 @@
1
- import { defineNuxtPlugin, useHead, useRuntimeConfig } from '#imports';
2
- export default defineNuxtPlugin(() => {
3
- const {
4
- public: {
5
- name,
6
- title
7
- }
8
- } = useRuntimeConfig();
9
- useHead({
10
- titleTemplate: pageTitle => pageTitle ? `${pageTitle} | ${name}` : `${name}${title ? `: ${title}` : ''}`
11
- });
12
- });