bfg-common 1.0.88 → 1.0.90

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.
@@ -8,109 +8,110 @@ import {
8
8
  updateImagesPath,
9
9
  } from './utils/methods'
10
10
 
11
- export default defineNuxtModule({
12
- meta: {
13
- name: 'fix-content-build',
14
- configKey: 'fixContentBuild'
15
- },
16
- setup () {
17
- if (
18
- process.env.NODE_ENV === 'development' ||
19
- process.env.npm_command !== 'exec'
20
- )
21
- return
22
-
23
- // Правим путь к файлу
24
- const filePath = path.join(
25
- __dirname.replace('/modules/fixContentBuild', ''),
26
- 'node_modules',
27
- '@nuxt',
28
- 'content',
29
- 'dist',
30
- 'runtime',
31
- 'legacy',
32
- 'composables',
33
- 'query.mjs'
34
- )
35
- const searchString = '/query/${hash(params)}'
36
- const replacementString = 'cache'
37
- replaceFileContent(filePath, searchString, replacementString)
38
- // End block
39
-
40
- // Переносим весь контент и удаляем все файлы кроме картинок
41
- const contentPath = path.join(
42
- __dirname.replace('/modules/fixContentBuild', ''),
43
- 'content',
44
- 'help'
45
- )
46
- if (!fs.existsSync(contentPath)) return;
47
-
48
- const publicPath = path.join(
49
- __dirname.replace('/modules/fixContentBuild', ''),
50
- 'public',
51
- 'help',
52
- 'images'
53
- )
54
- fs.cp(contentPath, publicPath, { recursive: true }, () => {
55
- // Удаляем все файлы кроме картинок
56
- removeNonImageFiles(publicPath)
57
-
58
- // Удаляем картинки из папки content
59
- removeImagesFromContent(contentPath)
60
- })
61
- // End block
62
-
63
- // Правим путь к картинкам
64
- updateImagesPath(contentPath)
65
- }
66
- })
67
- // export default defineNuxtModule(() => {
68
- // if (
69
- // process.env.NODE_ENV === 'development' ||
70
- // process.env.npm_command !== 'exec'
71
- // )
72
- // return
11
+ // export default defineNuxtModule({
12
+ // meta: {
13
+ // name: 'fix-content-build',
14
+ // configKey: 'fixContentBuild'
15
+ // },
16
+ // setup () {
17
+ // if (
18
+ // process.env.NODE_ENV === 'development' ||
19
+ // process.env.npm_command !== 'exec'
20
+ // )
21
+ // return
73
22
  //
74
- // // Правим путь к файлу
75
- // const filePath = path.join(
76
- // __dirname.replace('/modules/fixContentBuild', ''),
77
- // 'node_modules',
78
- // '@nuxt',
79
- // 'content',
80
- // 'dist',
81
- // 'runtime',
82
- // 'legacy',
83
- // 'composables',
84
- // 'query.mjs'
85
- // )
86
- // const searchString = '/query/${hash(params)}'
87
- // const replacementString = 'cache'
88
- // replaceFileContent(filePath, searchString, replacementString)
89
- // // End block
23
+ // // Правим путь к файлу
24
+ // const filePath = path.join(
25
+ // __dirname.replace('/modules/fixContentBuild', ''),
26
+ // 'node_modules',
27
+ // '@nuxt',
28
+ // 'content',
29
+ // 'dist',
30
+ // 'runtime',
31
+ // 'legacy',
32
+ // 'composables',
33
+ // 'query.mjs'
34
+ // )
35
+ // const searchString = '/query/${hash(params)}'
36
+ // const replacementString = 'cache'
37
+ // replaceFileContent(filePath, searchString, replacementString)
38
+ // // End block
90
39
  //
91
- // // Переносим весь контент и удаляем все файлы кроме картинок
92
- // const contentPath = path.join(
93
- // __dirname.replace('/modules/fixContentBuild', ''),
94
- // 'content',
95
- // 'help'
96
- // )
97
- // if (!fs.existsSync(contentPath)) return;
40
+ // // Переносим весь контент и удаляем все файлы кроме картинок
41
+ // const contentPath = path.join(
42
+ // __dirname.replace('/modules/fixContentBuild', ''),
43
+ // 'content',
44
+ // 'help'
45
+ // )
46
+ // if (!fs.existsSync(contentPath)) return;
98
47
  //
99
- // const publicPath = path.join(
100
- // __dirname.replace('/modules/fixContentBuild', ''),
101
- // 'public',
102
- // 'help',
103
- // 'images'
104
- // )
105
- // fs.cp(contentPath, publicPath, { recursive: true }, () => {
106
- // // Удаляем все файлы кроме картинок
107
- // removeNonImageFiles(publicPath)
48
+ // const publicPath = path.join(
49
+ // __dirname.replace('/modules/fixContentBuild', ''),
50
+ // 'public',
51
+ // 'help',
52
+ // 'images'
53
+ // )
54
+ // fs.cp(contentPath, publicPath, { recursive: true }, () => {
55
+ // // Удаляем все файлы кроме картинок
56
+ // removeNonImageFiles(publicPath)
108
57
  //
109
- // // Удаляем картинки из папки content
110
- // removeImagesFromContent(contentPath)
111
- // })
112
- // // End block
58
+ // // Удаляем картинки из папки content
59
+ // removeImagesFromContent(contentPath)
60
+ // })
61
+ // // End block
113
62
  //
114
- // // Правим путь к картинкам
115
- // updateImagesPath(contentPath)
63
+ // // Правим путь к картинкам
64
+ // updateImagesPath(contentPath)
65
+ // }
116
66
  // })
67
+ // @ts-ignore
68
+ export default defineNuxtModule(() => {
69
+ if (
70
+ process.env.NODE_ENV === 'development' ||
71
+ process.env.npm_command !== 'exec'
72
+ )
73
+ return
74
+
75
+ // Правим путь к файлу
76
+ const filePath = path.join(
77
+ __dirname.replace('/modules/fixContentBuild', ''),
78
+ 'node_modules',
79
+ '@nuxt',
80
+ 'content',
81
+ 'dist',
82
+ 'runtime',
83
+ 'legacy',
84
+ 'composables',
85
+ 'query.mjs'
86
+ )
87
+ const searchString = '/query/${hash(params)}'
88
+ const replacementString = 'cache'
89
+ replaceFileContent(filePath, searchString, replacementString)
90
+ // End block
91
+
92
+ // Переносим весь контент и удаляем все файлы кроме картинок
93
+ const contentPath = path.join(
94
+ __dirname.replace('/modules/fixContentBuild', ''),
95
+ 'content',
96
+ 'help'
97
+ )
98
+ if (!fs.existsSync(contentPath)) return;
99
+
100
+ const publicPath = path.join(
101
+ __dirname.replace('/modules/fixContentBuild', ''),
102
+ 'public',
103
+ 'help',
104
+ 'images'
105
+ )
106
+ fs.cp(contentPath, publicPath, { recursive: true }, () => {
107
+ // Удаляем все файлы кроме картинок
108
+ removeNonImageFiles(publicPath)
109
+
110
+ // Удаляем картинки из папки content
111
+ removeImagesFromContent(contentPath)
112
+ })
113
+ // End block
114
+
115
+ // Правим путь к картинкам
116
+ updateImagesPath(contentPath)
117
+ })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.0.88",
4
+ "version": "1.0.90",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",