@dword-design/base-config-nuxt 5.0.6 → 5.0.8

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/dev.js CHANGED
@@ -8,9 +8,6 @@ export default ((options = {}) => {
8
8
  ...options
9
9
  };
10
10
  return execa(nuxtWrapper, ['dev'], {
11
- [options.log ? 'stdio' : 'stderr']: 'inherit',
12
- env: {
13
- NODE_OPTIONS: '--require=suppress-experimental-warnings --require=@dword-design/suppress-babel-register-esm-warning --experimental-loader=babel-register-esm'
14
- }
11
+ [options.log ? 'stdio' : 'stderr']: 'inherit'
15
12
  });
16
13
  });
@@ -1,13 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import dotenv from '@dword-design/dotenv-json-extended';
3
3
  import { execa } from 'execa';
4
- const args = process.argv.slice(2);
5
4
  dotenv.config();
6
- execa('nuxt', args, {
7
- ...(args[0] === 'dev' ? {
8
- env: {
9
- NODE_ENV: 'development'
10
- }
11
- } : {}),
5
+ execa('nuxt-babel', process.argv.slice(2), {
6
+ env: {
7
+ NODE_ENV: ''
8
+ },
12
9
  stdio: 'inherit'
13
10
  });
@@ -1,15 +1,7 @@
1
- import { transform } from '@babel/core';
2
- import { babel as rollupPluginBabel } from '@rollup/plugin-babel';
3
- import { parseVueRequest } from '@vitejs/plugin-vue';
4
- import { parse } from '@vue/compiler-sfc';
5
1
  import packageName from 'depcheck-package-name';
6
- import vitePluginBabel from 'vite-plugin-babel';
7
- import vueSfcDescriptorToString from 'vue-sfc-descriptor-to-string';
2
+ import { createRequire } from 'module';
8
3
  import config from "./config.js";
9
- // import expressModule from './modules/express/index.js'
10
- import i18nModule from "./modules/i18n.js";
11
- import localeLinkModule from "./modules/locale-link/index.js";
12
- import svgModule from "./modules/svg.js";
4
+ const resolver = createRequire(import.meta.url);
13
5
  const isBasicAuthEnabled = process.env.BASIC_AUTH_USER && process.env.BASIC_AUTH_PASSWORD;
14
6
  export default {
15
7
  app: {
@@ -45,16 +37,7 @@ export default {
45
37
  failOnWarning: true,
46
38
  fix: true,
47
39
  lintOnStart: false
48
- }], i18nModule,
49
- // expressModule,
50
- svgModule, localeLinkModule],
51
- nitro: {
52
- rollupConfig: {
53
- plugins: [rollupPluginBabel({
54
- babelHelpers: 'bundled'
55
- })]
56
- }
57
- },
40
+ }], resolver.resolve('./modules/i18n.js'), resolver.resolve('./modules/locale-link/index.js'), resolver.resolve('./modules/svg.js')],
58
41
  router: {
59
42
  options: {
60
43
  linkActiveClass: 'active'
@@ -74,26 +57,6 @@ export default {
74
57
  })
75
58
  },
76
59
  vite: {
77
- plugins: [{
78
- enforce: 'pre',
79
- transform: async (code, id) => {
80
- const query = parseVueRequest(id);
81
- if (query.filename.endsWith('.vue') && !query.filename.split('/').includes('node_modules')) {
82
- const sfc = parse(code);
83
- for (const section of ['scriptSetup', 'script']) {
84
- if (sfc.descriptor[section] && sfc.descriptor[section].lang === undefined) {
85
- sfc.descriptor[section].content = await transform(sfc.descriptor[section].content, {
86
- plugins: [['@babel/plugin-proposal-pipeline-operator', {
87
- proposal: 'fsharp'
88
- }]]
89
- }).code;
90
- }
91
- }
92
- return vueSfcDescriptorToString(sfc.descriptor);
93
- }
94
- return code;
95
- }
96
- }, vitePluginBabel()],
97
60
  vue: {
98
61
  template: {
99
62
  transformAssetUrls: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dword-design/base-config-nuxt",
3
- "version": "5.0.6",
3
+ "version": "5.0.8",
4
4
  "repository": "dword-design/base-config-nuxt",
5
5
  "funding": "https://github.com/sponsors/dword-design",
6
6
  "license": "MIT",
@@ -26,7 +26,6 @@
26
26
  "test": "base test"
27
27
  },
28
28
  "dependencies": {
29
- "@babel/core": "^7.22.5",
30
29
  "@dword-design/depcheck-parser-sass": "^4.0.0",
31
30
  "@dword-design/dotenv-json-extended": "^2.0.0",
32
31
  "@dword-design/functions": "^4.0.0",
@@ -36,27 +35,20 @@
36
35
  "@nuxtjs/eslint-module": "^4.1.0",
37
36
  "@nuxtjs/i18n": "npm:@dword-design/nuxt-i18n",
38
37
  "@nuxtjs/stylelint-module": "^5.0.1",
39
- "@rollup/plugin-babel": "^6.0.3",
40
- "@vitejs/plugin-vue": "^4.2.3",
41
- "@vue/compiler-sfc": "^3.3.4",
42
38
  "deepmerge": "^4.3.1",
43
39
  "depcheck-package-name": "^3.0.0",
44
40
  "depcheck-parser-vue": "^4.0.7",
45
41
  "execa": "^7.1.1",
46
- "express": "^4.17.1",
47
- "express-mount-files": "npm:@dword-design/express-mount-files",
48
42
  "fs-extra": "^11.1.0",
49
43
  "globby": "^13.1.3",
50
44
  "jiti": "^1.18.2",
51
45
  "nuxt": "^3.2.3",
52
- "nuxt-alias-path": "^1.0.0",
46
+ "nuxt-babel-runtime": "^4.0.0",
53
47
  "nuxt-basic-authentication-module": "^0.2.1",
54
48
  "output-files": "^2.0.0",
55
49
  "require-package-name": "^2.0.1",
56
50
  "stylelint": "^15.0.0",
57
- "vite-plugin-babel": "^1.1.3",
58
- "vite-svg-loader": "^4.0.0",
59
- "vue-sfc-descriptor-to-string": "npm:@dword-design/vue-sfc-descriptor-to-string"
51
+ "vite-svg-loader": "^4.0.0"
60
52
  },
61
53
  "devDependencies": {
62
54
  "@dword-design/base": "^10.0.0",
@@ -1,29 +0,0 @@
1
- import jitiBabelTransform from '@dword-design/jiti-babel-transform';
2
- import express from 'express';
3
- import mountFiles from 'express-mount-files';
4
- import { fromNodeMiddleware } from 'h3';
5
- import jiti from 'jiti';
6
- import P from 'path';
7
- import options from '#express/options.js';
8
- const jitiOptions = {
9
- esmResolve: true,
10
- interopDefault: true,
11
- transform: jitiBabelTransform
12
- };
13
- const jitiInstance = jiti(options.srcDir, jitiOptions);
14
- let app = express().use(express.json()).use(express.urlencoded({
15
- extended: false
16
- }));
17
- try {
18
- const setupExpress = jitiInstance('./setup-express');
19
- app = setupExpress(app);
20
- } catch (error) {
21
- if (!error.message.startsWith("Cannot find module './setup-express'")) {
22
- throw error;
23
- }
24
- }
25
- app.use('/api', mountFiles(P.resolve(options.srcDir, 'api'), {
26
- jitiOptions,
27
- paramChar: '_'
28
- }));
29
- export default fromNodeMiddleware(app);
@@ -1,18 +0,0 @@
1
- import { addServerHandler, addTemplate, createResolver } from '@nuxt/kit';
2
- import nuxtAliasPath from 'nuxt-alias-path';
3
- import P from 'path';
4
- const resolver = createResolver(import.meta.url);
5
- const moduleName = 'express';
6
- export default ((options, nuxt) => {
7
- addTemplate({
8
- filename: P.join(moduleName, 'options.js'),
9
- getContents: () => `export default ${JSON.stringify({
10
- srcDir: nuxt.options.srcDir
11
- }, undefined, 2)}`,
12
- write: true
13
- });
14
- nuxt.options.alias[`#${moduleName}`] = nuxtAliasPath(moduleName, nuxt);
15
- addServerHandler({
16
- handler: resolver.resolve('./handler')
17
- });
18
- });