@dword-design/base-config-nuxt 4.0.12 → 4.0.14

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/index.js CHANGED
@@ -80,6 +80,7 @@ export default {
80
80
  import { parse } from 'vue/compiler-sfc'
81
81
  import vueSfcDescriptorToString from '${packageName`vue-sfc-descriptor-to-string`}'
82
82
  import { parseVueRequest } from '@vitejs/plugin-vue'
83
+ import P from 'path'
83
84
 
84
85
  dotenv.config()
85
86
 
@@ -114,17 +115,14 @@ export default {
114
115
  enforce: 'pre',
115
116
  transform: async (code, id) => {
116
117
  const query = parseVueRequest(id)
117
- if (query.filename.endsWith('.vue')) {
118
+ if (query.filename.endsWith('.vue') && !query.filename.split('/').includes('node_modules')) {
118
119
  const sfc = parse(code)
119
- if (sfc.descriptor.scriptSetup) {
120
- sfc.descriptor.scriptSetup.content = await transform(sfc.descriptor.scriptSetup.content, {
121
- plugins: [['@babel/plugin-proposal-pipeline-operator', { proposal: 'fsharp' }]]
122
- }).code
123
- }
124
- if (sfc.descriptor.script) {
125
- sfc.descriptor.script.content = await transform(sfc.descriptor.script.content, {
126
- plugins: [['@babel/plugin-proposal-pipeline-operator', { proposal: 'fsharp' }]]
127
- }).code
120
+ for (const section of ['scriptSetup', 'script']) {
121
+ if (sfc.descriptor[section] && sfc.descriptor[section].lang === undefined) {
122
+ sfc.descriptor[section].content = await transform(sfc.descriptor[section].content, {
123
+ plugins: [['@babel/plugin-proposal-pipeline-operator', { proposal: 'fsharp' }]]
124
+ }).code
125
+ }
128
126
  }
129
127
  return vueSfcDescriptorToString(sfc.descriptor)
130
128
  }
package/dist/lint.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { execaCommand } from 'execa';
2
- export default (async () => {
3
- try {
4
- await execaCommand('eslint --fix --ignore-path .gitignore --ext .js,.json,.vue .', {
5
- all: true
6
- });
7
- await execaCommand('stylelint --fix --allow-empty-input --ignore-path .gitignore **/*.{css,scss,vue}', {
8
- all: true
9
- });
10
- } catch (error) {
11
- throw new Error(error.all);
12
- }
2
+ export default (async (options = {}) => {
3
+ options = {
4
+ log: process.env.NODE_ENV !== 'test',
5
+ ...options
6
+ };
7
+ await execaCommand('eslint --fix --ignore-path .gitignore --ext .js,.json,.vue .', ...(options.log ? [{
8
+ stdio: 'inherit'
9
+ }] : []));
10
+ await execaCommand('stylelint --fix --allow-empty-input --ignore-path .gitignore **/*.{css,scss,vue}', ...(options.log ? [{
11
+ stdio: 'inherit'
12
+ }] : []));
13
13
  });
@@ -9,8 +9,10 @@ export default (async (options = {}) => {
9
9
  log: process.env.NODE_ENV !== 'test',
10
10
  ...options
11
11
  };
12
- await lint();
13
- await execa(nuxtWrapper, ['build'], {
12
+ await lint({
13
+ log: options.log
14
+ });
15
+ const nuxt = await execa(nuxtWrapper, ['build'], {
14
16
  ...(options.log ? {
15
17
  stdio: 'inherit'
16
18
  } : {}),
@@ -26,4 +28,5 @@ export default (async (options = {}) => {
26
28
  stdio: 'inherit'
27
29
  }] : []));
28
30
  }
31
+ return nuxt;
29
32
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dword-design/base-config-nuxt",
3
- "version": "4.0.12",
3
+ "version": "4.0.14",
4
4
  "repository": "dword-design/base-config-nuxt",
5
5
  "funding": "https://github.com/sponsors/dword-design",
6
6
  "license": "MIT",
@@ -21,12 +21,15 @@
21
21
  "prepublishOnly": "base prepublishOnly",
22
22
  "test": "base test"
23
23
  },
24
+ "resolutions": {
25
+ "stylelint/cosmiconfig": "8.1.3"
26
+ },
24
27
  "dependencies": {
25
28
  "@dword-design/depcheck-parser-sass": "^4.0.0",
26
29
  "@dword-design/dotenv-json-extended": "^2.0.0",
27
30
  "@dword-design/functions": "^4.0.0",
28
31
  "@dword-design/jiti-babel-transform": "^1.0.11",
29
- "@dword-design/stylelint-config": "^2.0.0",
32
+ "@dword-design/stylelint-config": "^3.0.0",
30
33
  "@nuxt/kit": "^3.2.3",
31
34
  "@nuxtjs/eslint-module": "^4.1.0",
32
35
  "@nuxtjs/i18n": "npm:@dword-design/nuxt-i18n",
@@ -45,7 +48,7 @@
45
48
  "nuxt-basic-authentication-module": "^0.2.1",
46
49
  "output-files": "^2.0.0",
47
50
  "require-package-name": "^2.0.1",
48
- "stylelint": "^13.6.0",
51
+ "stylelint": "^15.0.0",
49
52
  "vite-svg-loader": "^4.0.0",
50
53
  "vue-sfc-descriptor-to-string": "npm:@dword-design/vue-sfc-descriptor-to-string"
51
54
  },