@dword-design/base-config-nuxt 3.2.8 → 3.2.10

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.js CHANGED
@@ -1,4 +1,4 @@
1
- import execa from 'execa';
1
+ import { execa } from 'execa';
2
2
  export default (() => execa('nuxt-babel', ['build', '--analyze', '--config-file', require.resolve("./nuxt.config")], {
3
3
  stdio: 'inherit'
4
4
  }));
package/dist/dev.js CHANGED
@@ -3,6 +3,7 @@ import getNuxtConfig from "./get-nuxt-config.js";
3
3
  export default (async nuxtConfig => {
4
4
  const nuxt = new Nuxt({
5
5
  ...getNuxtConfig(),
6
+ _build: true,
6
7
  dev: true,
7
8
  ...nuxtConfig
8
9
  });
package/dist/index.js CHANGED
@@ -6,9 +6,11 @@ import analyze from "./analyze.js";
6
6
  import depcheckSpecial from "./depcheck-special.js";
7
7
  import dev from "./dev.js";
8
8
  import eslintConfig from "./eslint.config.js";
9
+ import getNuxtConfig from "./get-nuxt-config.js";
9
10
  import lint from "./lint.js";
10
11
  import prepublishOnly from "./prepublish-only.js";
11
12
  import start from "./start.js";
13
+ export { getNuxtConfig };
12
14
  export default {
13
15
  allowedMatches: ['.stylelintrc.json', 'api', 'assets', 'components', 'content', 'i18n', 'layouts', 'middleware', 'model', 'modules', 'nuxt.config.js', 'pages', 'plugins', 'static', 'store', 'types'],
14
16
  commands: {
package/dist/lint.js CHANGED
@@ -1,10 +1,10 @@
1
- import execa from 'execa';
1
+ import { execaCommand } from 'execa';
2
2
  export default (async () => {
3
3
  try {
4
- await execa.command('eslint --fix --ignore-path .gitignore --ext .js,.json,.vue .', {
4
+ await execaCommand('eslint --fix --ignore-path .gitignore --ext .js,.json,.vue .', {
5
5
  all: true
6
6
  });
7
- await execa.command('stylelint --fix --allow-empty-input --ignore-path .gitignore **/*.{css,scss,vue}', {
7
+ await execaCommand('stylelint --fix --allow-empty-input --ignore-path .gitignore **/*.{css,scss,vue}', {
8
8
  all: true
9
9
  });
10
10
  } catch (error) {
@@ -5,7 +5,7 @@ import some from "@dword-design/functions/dist/some.js";
5
5
  import uniq from "@dword-design/functions/dist/uniq.js";
6
6
  import packageName from 'depcheck-package-name';
7
7
  import fs from 'fs-extra';
8
- import globby from 'globby';
8
+ import { globby } from 'globby';
9
9
  import P from 'path';
10
10
  import vueTemplateCompiler from 'vue-template-compiler';
11
11
  import MissingNuxtI18nHeadError from "./missing-nuxt-i18n-head-error.js";
@@ -3,21 +3,27 @@ import express from 'express';
3
3
  import mountFiles from 'express-mount-files';
4
4
  import P from 'path';
5
5
  export default async function (options) {
6
- var _options$getExpress;
7
- const app = (await ((_options$getExpress = options.getExpress) === null || _options$getExpress === void 0 ? void 0 : _options$getExpress.call(options))) || express();
8
- app.use(mountFiles(P.join(this.options.srcDir, 'api'), {
9
- jitiOptions: {
10
- esmResolve: true,
11
- interopDefault: true,
12
- transformOptions: {
13
- babel: babelConfig
14
- }
15
- },
16
- paramChar: '_'
17
- }));
18
- this.addServerMiddleware({
19
- handler: app,
20
- path: '/api'
21
- });
22
- this.options.watch.push(P.join(this.options.srcDir, 'api'));
6
+ // Make sure that we do not register the server middleware
7
+ // on build because processes like express-mysql-session do
8
+ // not get closed
9
+ // https://github.com/nuxt/nuxt.js/blob/2ec62617ced873fef97c73a6d7aa1271911ccfd5/packages/core/src/nuxt.js#L56
10
+ if (this.options.server !== false) {
11
+ var _options$getExpress;
12
+ const app = (await ((_options$getExpress = options.getExpress) === null || _options$getExpress === void 0 ? void 0 : _options$getExpress.call(options))) || express();
13
+ app.use(mountFiles(P.join(this.options.srcDir, 'api'), {
14
+ jitiOptions: {
15
+ esmResolve: true,
16
+ interopDefault: true,
17
+ transformOptions: {
18
+ babel: babelConfig
19
+ }
20
+ },
21
+ paramChar: '_'
22
+ }));
23
+ this.addServerMiddleware({
24
+ handler: app,
25
+ path: '/api'
26
+ });
27
+ this.options.watch.push(P.join(this.options.srcDir, 'api'));
28
+ }
23
29
  }
@@ -1,4 +1,4 @@
1
- import execa from 'execa';
1
+ import { execa } from 'execa';
2
2
  import fs from 'fs-extra';
3
3
  import { Builder, Nuxt } from 'nuxt';
4
4
  import getNuxtConfig from "./get-nuxt-config.js";
@@ -7,8 +7,10 @@ export default (async (options = {}) => {
7
7
  await lint();
8
8
  const nuxt = new Nuxt({
9
9
  ...getNuxtConfig(),
10
+ _build: true,
10
11
  dev: false,
11
- rootDir: options.rootDir
12
+ rootDir: options.rootDir,
13
+ server: false
12
14
  });
13
15
  await new Builder(nuxt).build();
14
16
  if (await fs.exists('model')) {
package/dist/start.js CHANGED
@@ -5,6 +5,7 @@ export default (async (options = {
5
5
  }) => {
6
6
  const nuxt = new Nuxt({
7
7
  ...getNuxtConfig(),
8
+ _start: true,
8
9
  build: {
9
10
  quiet: !options.log
10
11
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dword-design/base-config-nuxt",
3
- "version": "3.2.8",
3
+ "version": "3.2.10",
4
4
  "repository": "dword-design/base-config-nuxt",
5
5
  "funding": "https://github.com/sponsors/dword-design",
6
6
  "license": "MIT",
@@ -36,11 +36,11 @@
36
36
  "@nuxtjs/stylelint-module": "^4.0.0",
37
37
  "depcheck-package-name": "^2.0.0",
38
38
  "depcheck-parser-vue": "^2.0.0",
39
- "execa": "^5.0.0",
39
+ "execa": "^6.1.0",
40
40
  "express": "^4.17.1",
41
41
  "express-mount-files": "npm:@dword-design/express-mount-files",
42
- "fs-extra": "^10.0.0",
43
- "globby": "^11.0.1",
42
+ "fs-extra": "^11.1.0",
43
+ "globby": "^13.1.3",
44
44
  "jiti": "npm:@dword-design/jiti",
45
45
  "nuxt": "~2.15.0",
46
46
  "nuxt-babel-runtime": "^3.0.0",
@@ -57,7 +57,7 @@
57
57
  },
58
58
  "devDependencies": {
59
59
  "@dword-design/base": "^9.0.0",
60
- "@dword-design/puppeteer": "^5.0.5",
60
+ "@dword-design/puppeteer": "^6.0.0",
61
61
  "@dword-design/tester": "^2.0.9",
62
62
  "@dword-design/tester-plugin-env": "^2.0.8",
63
63
  "@dword-design/tester-plugin-puppeteer": "^2.1.19",