cabloy 5.1.21 → 5.1.27

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.
Files changed (139) hide show
  1. package/lerna.json +24 -0
  2. package/package.json +3 -2
  3. package/scripts/init.ts +4 -2
  4. package/scripts/upgrade.ts +0 -1
  5. package/vona/package.original.json +0 -2
  6. package/vona/packages-cli/cabloy-cli/src/lib/local.template.ts +2 -2
  7. package/vona/packages-cli/cabloy-cli/src/types/argv.ts +0 -1
  8. package/vona/packages-cli/cli-set-api/cli/templates/tools/crudBasic/snippets/2-meta.index.ts +1 -1
  9. package/vona/packages-cli/cli-set-api/cli/templates/tools/crudBasic/snippets/2-meta.version.ts +0 -1
  10. package/vona/packages-cli/cli-set-api/cli/templates/tools/crudBasic/snippets/3-en-us.ts +1 -1
  11. package/vona/packages-cli/cli-set-api/cli/templates/tools/crudStart/snippets/2-meta.index.ts +1 -1
  12. package/vona/packages-cli/cli-set-api/cli/templates/tools/crudStart/snippets/2-meta.version.ts +0 -1
  13. package/vona/packages-cli/cli-set-api/cli/templates/tools/crudStart/snippets/3-en-us.ts +1 -1
  14. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.create.bean.ts +0 -2
  15. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.create.module.ts +0 -2
  16. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.create.suite.ts +0 -2
  17. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.create.test.ts +0 -2
  18. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.appMonkey.ts +0 -2
  19. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.asset.ts +0 -2
  20. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.config.ts +0 -2
  21. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.constant.ts +0 -2
  22. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.error.ts +0 -2
  23. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.lib.ts +0 -2
  24. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.locale.ts +0 -2
  25. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.main.ts +0 -2
  26. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.monkey.ts +0 -2
  27. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.static.ts +0 -2
  28. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.types.ts +0 -2
  29. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.tools.crud.ts +0 -2
  30. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.tools.crudBasic.ts +0 -2
  31. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.tools.crudStart.ts +0 -2
  32. package/{zova/packages-utils/quasar-app-extension-zova → vona/packages-utils/lint}/LICENSE +1 -1
  33. package/vona/packages-utils/lint/package.json +2 -3
  34. package/vona/packages-utils/lint/src/oxc/lint.ts +0 -22
  35. package/vona/packages-utils/lint/src/oxc/lintVue.ts +0 -22
  36. package/vona/pnpm-lock.yaml +12 -12
  37. package/zova/env/{.env.ssr.cabloyBasicAdmin.production → .env.cabloyBasicAdmin} +11 -1
  38. package/zova/env/.env.cabloyBasicWeb +18 -0
  39. package/zova/env/.env.ssr.admin +0 -1
  40. package/zova/package.original.json +1 -4
  41. package/zova/packages-cli/cli/package.json +2 -2
  42. package/zova/packages-cli/cli-set-front/package.json +1 -1
  43. package/zova/packages-cli/cli-set-front/src/lib/bean/cli.create.module.ts +0 -2
  44. package/zova/packages-cli/cli-set-front/src/lib/bean/cli.create.suite.ts +0 -2
  45. package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.asset.ts +0 -2
  46. package/zova/packages-cli/cli-set-front/src/lib/bean/cli.tools.metadata.ts +0 -2
  47. package/zova/packages-utils/logger/package.json +2 -2
  48. package/zova/packages-utils/zova-jsx/package.json +3 -3
  49. package/zova/packages-zova/zova/package.json +4 -4
  50. package/zova/packages-zova/zova-core/package.json +3 -3
  51. package/zova/pnpm-lock.yaml +1 -1
  52. package/zova/src/suite-vendor/a-zova/modules/a-logger/package.json +3 -3
  53. package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +3 -3
  54. package/zova/src/suite-vendor/a-zova/package.json +4 -4
  55. package/vona/src/suite/.gitkeep +0 -0
  56. package/vona/src/suite-vendor/.gitkeep +0 -0
  57. package/zova/env/.env.production.githubpages +0 -8
  58. package/zova/env/.env.ssr.cabloyBasicAdmin +0 -5
  59. package/zova/packages-utils/quasar-app-extension-zova/dist/index.d.ts +0 -3
  60. package/zova/packages-utils/quasar-app-extension-zova/dist/index.d.ts.map +0 -1
  61. package/zova/packages-utils/quasar-app-extension-zova/dist/index.js +0 -3
  62. package/zova/packages-utils/quasar-app-extension-zova/dist/index.js.map +0 -1
  63. package/zova/packages-utils/quasar-app-extension-zova/dist/install.d.ts +0 -7
  64. package/zova/packages-utils/quasar-app-extension-zova/dist/install.d.ts.map +0 -1
  65. package/zova/packages-utils/quasar-app-extension-zova/dist/install.js +0 -9
  66. package/zova/packages-utils/quasar-app-extension-zova/dist/install.js.map +0 -1
  67. package/zova/packages-utils/quasar-app-extension-zova/dist/prompts.d.ts +0 -42
  68. package/zova/packages-utils/quasar-app-extension-zova/dist/prompts.d.ts.map +0 -1
  69. package/zova/packages-utils/quasar-app-extension-zova/dist/prompts.js +0 -44
  70. package/zova/packages-utils/quasar-app-extension-zova/dist/prompts.js.map +0 -1
  71. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/extendAfterBuild.d.ts +0 -4
  72. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/extendAfterBuild.d.ts.map +0 -1
  73. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/extendAfterBuild.js +0 -32
  74. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/extendAfterBuild.js.map +0 -1
  75. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/extendFiles.d.ts +0 -6
  76. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/extendFiles.d.ts.map +0 -1
  77. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/extendFiles.js +0 -161
  78. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/extendFiles.js.map +0 -1
  79. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/extendQuasarConf.d.ts +0 -5
  80. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/extendQuasarConf.d.ts.map +0 -1
  81. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/extendQuasarConf.js +0 -71
  82. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/extendQuasarConf.js.map +0 -1
  83. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/extendSSRWebserverConf.d.ts +0 -5
  84. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/extendSSRWebserverConf.d.ts.map +0 -1
  85. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/extendSSRWebserverConf.js +0 -41
  86. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/extendSSRWebserverConf.js.map +0 -1
  87. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/extendViteConf.d.ts +0 -3
  88. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/extendViteConf.d.ts.map +0 -1
  89. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/extendViteConf.js +0 -133
  90. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/extendViteConf.js.map +0 -1
  91. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/index.d.ts +0 -9
  92. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/index.d.ts.map +0 -1
  93. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/index.js +0 -44
  94. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/index.js.map +0 -1
  95. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/printBanner.d.ts +0 -4
  96. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/printBanner.d.ts.map +0 -1
  97. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/printBanner.js +0 -29
  98. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/printBanner.js.map +0 -1
  99. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/types.d.ts +0 -10
  100. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/types.d.ts.map +0 -1
  101. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/types.js +0 -2
  102. package/zova/packages-utils/quasar-app-extension-zova/dist/quasar/types.js.map +0 -1
  103. package/zova/packages-utils/quasar-app-extension-zova/dist/uninstall.d.ts +0 -7
  104. package/zova/packages-utils/quasar-app-extension-zova/dist/uninstall.d.ts.map +0 -1
  105. package/zova/packages-utils/quasar-app-extension-zova/dist/uninstall.js +0 -9
  106. package/zova/packages-utils/quasar-app-extension-zova/dist/uninstall.js.map +0 -1
  107. package/zova/packages-utils/quasar-app-extension-zova/dist/utils.d.ts +0 -4
  108. package/zova/packages-utils/quasar-app-extension-zova/dist/utils.d.ts.map +0 -1
  109. package/zova/packages-utils/quasar-app-extension-zova/dist/utils.js +0 -13
  110. package/zova/packages-utils/quasar-app-extension-zova/dist/utils.js.map +0 -1
  111. package/zova/packages-utils/quasar-app-extension-zova/package.json +0 -55
  112. package/zova/packages-utils/quasar-app-extension-zova/src/index.ts +0 -3
  113. package/zova/packages-utils/quasar-app-extension-zova/src/install.ts +0 -9
  114. package/zova/packages-utils/quasar-app-extension-zova/src/prompts.ts +0 -44
  115. package/zova/packages-utils/quasar-app-extension-zova/src/quasar/extendAfterBuild.ts +0 -41
  116. package/zova/packages-utils/quasar-app-extension-zova/src/quasar/extendFiles.ts +0 -190
  117. package/zova/packages-utils/quasar-app-extension-zova/src/quasar/extendQuasarConf.ts +0 -79
  118. package/zova/packages-utils/quasar-app-extension-zova/src/quasar/extendSSRWebserverConf.ts +0 -45
  119. package/zova/packages-utils/quasar-app-extension-zova/src/quasar/extendViteConf.ts +0 -143
  120. package/zova/packages-utils/quasar-app-extension-zova/src/quasar/index.ts +0 -50
  121. package/zova/packages-utils/quasar-app-extension-zova/src/quasar/printBanner.ts +0 -33
  122. package/zova/packages-utils/quasar-app-extension-zova/src/quasar/types.ts +0 -11
  123. package/zova/packages-utils/quasar-app-extension-zova/src/uninstall.ts +0 -9
  124. package/zova/packages-utils/quasar-app-extension-zova/src/utils.ts +0 -15
  125. package/zova/packages-utils/quasar-app-extension-zova/templates/entry/-app.js_ +0 -81
  126. package/zova/packages-utils/quasar-app-extension-zova/templates/entry/-client-entry.js_ +0 -215
  127. package/zova/packages-utils/quasar-app-extension-zova/templates/entry/-server-entry.js_ +0 -84
  128. package/zova/packages-utils/quasar-app-extension-zova/templates/entry/-ssr-devserver.js_ +0 -456
  129. package/zova/packages-utils/quasar-app-extension-zova/templates/entry/ssr-prod-handler.js_ +0 -5
  130. package/zova/packages-utils/quasar-app-extension-zova/templates/entry/ssr-prod-webserver.js_ +0 -123
  131. package/zova/packages-utils/quasar-app-extension-zova/templates/env/.env.ssr.admin +0 -4
  132. package/zova/packages-utils/quasar-app-extension-zova/templates/env/.env.ssr.production +0 -1
  133. package/zova/packages-utils/quasar-app-extension-zova/templates/env/.env.ssr.web +0 -6
  134. package/zova/packages-utils/quasar-app-extension-zova/templates/modes/ssr/middlewares/.gitkeep +0 -0
  135. package/zova/packages-utils/quasar-app-extension-zova/templates/vuetify/composables/hydration.js +0 -26
  136. package/zova/packages-utils/quasar-app-extension-zova/templates/vuetify/composables/ssrBoot.js +0 -36
  137. package/zova/packages-utils/quasar-app-extension-zova/tsconfig.json +0 -10
  138. package/zova/src/front/config/config/config.admin.ts +0 -10
  139. package/zova/src/front/config/config/config.web.ts +0 -10
@@ -1,190 +0,0 @@
1
- import type { IndexAPI } from '@quasar/app-vite';
2
-
3
- import fse from 'fs-extra';
4
- import path from 'node:path';
5
- import { copyTemplateFile, getAbsolutePathOfModule, getOutDir } from 'zova-vite';
6
-
7
- import type { QuasarConf } from './types.js';
8
-
9
- import { resolveTemplatePath } from '../utils.js';
10
-
11
- export function extendFilesOne(api: IndexAPI, flavor: string) {
12
- return async function extendFiles() {
13
- // prepare templates
14
- await prepareTemplates();
15
- };
16
-
17
- async function prepareTemplates() {
18
- // ssr
19
- if ((<any>api.ctx.mode).ssr) {
20
- // prod
21
- if (api.ctx.prod) {
22
- copyTemplateIfNeed(
23
- resolveTemplatePath('env/.env.ssr.production'),
24
- api.resolve.app('env/.env.ssr.production'),
25
- );
26
- }
27
- // admin/web
28
- if (flavor === 'admin') {
29
- copyTemplateIfNeed(
30
- resolveTemplatePath('env/.env.ssr.admin'),
31
- api.resolve.app('env/.env.ssr.admin'),
32
- );
33
- } else if (flavor === 'web') {
34
- copyTemplateIfNeed(
35
- resolveTemplatePath('env/.env.ssr.web'),
36
- api.resolve.app('env/.env.ssr.web'),
37
- );
38
- }
39
- }
40
- }
41
- }
42
-
43
- export function extendFilesTwo(_api: IndexAPI, _flavor: string) {
44
- return async function extendFiles() {
45
- // patch templates
46
- // await patchTemplates();
47
- // prepare vuetify
48
- await prepareVuetify();
49
- };
50
-
51
- // async function patchTemplates() {
52
- // app.js
53
- // fse.copyFileSync(resolveTemplatePath('entry/app.js_'), api.resolve.cli('templates/entry/app.js'));
54
- // client-entry.js
55
- // fse.copyFileSync(resolveTemplatePath('entry/client-entry.js_'), api.resolve.cli('templates/entry/client-entry.js'));
56
- // server-entry.js
57
- // fse.copyFileSync(
58
- // resolveTemplatePath('entry/server-entry.js_'),
59
- // api.resolve.cli('templates/entry/server-entry.js'),
60
- // );
61
- // ssr: html-template.js
62
- // await _handleSSRHtmlTemplate();
63
- // ssr: ssr-devserver.js
64
- // await _handleSSRDevServer();
65
- // ssr: ssr-builder.js
66
- // await _handleSSRBuilder();
67
- // }
68
-
69
- // // html-template
70
- // async function _handleSSRHtmlTemplate() {
71
- // const fileSrc = api.resolve.cli('lib/utils/html-template.js');
72
- // const fileSrcBak = api.resolve.cli('lib/utils/html-template-origin.js');
73
- // copyTemplateIfNeed(fileSrc, fileSrcBak);
74
- // const content = fse.readFileSync(fileSrcBak).toString();
75
- // const contentNew = content
76
- // .replace(
77
- // 'const bodyStartTagRE = /(<body[^>]*)(>)/i',
78
- // 'const bodyStartTagRE = /(<body[^>]*)(>)/i\nconst bodyEndRE = /(<\\/body>)/i',
79
- // )
80
- // .replace(
81
- // /\.replace\(\s+bodyStartTagRE,/,
82
- // `.replace(
83
- // bodyEndRE,
84
- // (_, tag) => \`{{ ssrContext._meta.endingBodyTags || '' }}\${ tag }\`
85
- // )
86
- // .replace(
87
- // bodyStartTagRE,`,
88
- // );
89
- // fse.writeFileSync(fileSrc, contentNew);
90
- // }
91
-
92
- // // ssr-devserver.js
93
- // async function _handleSSRDevServer() {
94
- // const fileSrc = resolveTemplatePath('entry/ssr-devserver.js_');
95
- // const fileDest = api.resolve.cli('lib/modes/ssr/ssr-devserver.js');
96
- // fse.copyFileSync(fileSrc, fileDest);
97
- // }
98
-
99
- // // ssr-builder.js
100
- // async function _handleSSRBuilder() {
101
- // const fileSrc = api.resolve.cli('lib/modes/ssr/ssr-builder.js');
102
- // const fileSrcBak = api.resolve.cli('lib/modes/ssr/ssr-builder-origin.js');
103
- // copyTemplateIfNeed(fileSrc, fileSrcBak);
104
- // const content = fse.readFileSync(fileSrcBak).toString();
105
- // const contentNew = content
106
- // .replace(
107
- // 'await this.#buildWebserver()',
108
- // '',
109
- // )
110
- // .replace(
111
- // 'await this.#copyWebserverFiles()',
112
- // '',
113
- // )
114
- // .replace(
115
- // 'await this.#writePackageJson()',
116
- // '',
117
- // )
118
- // .replace(
119
- // "await this.buildWithVite('SSR Server', viteServerConfig)",
120
- // "await this.buildWithVite('SSR Server', viteServerConfig)\nawait this.#buildWebserver()",
121
- // )
122
- // .replace(
123
- // "'render-template.js',",
124
- // "this.ctx.appPaths.resolve.entry('render-template.js'),",
125
- // )
126
- // .replace('async #writeRenderTemplate (clientDir) {', `_patchIndexHtml(html){
127
- // return html
128
- // .replace(/<title>.*?<\\/title>/,'')
129
- // .replace(/<meta name="description"[^>]*?>/,'')
130
- // .replace(/<link([^>]*?)href="(\\/[^>]*?)>/g,
131
- // (_,a,b)=>{return \`<link\${a}href="{{ ssrContext._meta.baseUrl }}\${b}>\`})
132
- // .replace(/<script([^>]*?)src="(\\/[^>]*?)><\\/script>/g,
133
- // (_,a,b)=>{return \`<script\${a}src="{{ ssrContext._meta.baseUrl }}\${b}></script>\`}) ;
134
- // }
135
- // async #writeRenderTemplate (clientDir) {`)
136
- // .replace('const html = this.readFile(htmlFile);', 'const html = this._patchIndexHtml(this.readFile(htmlFile));');
137
- // fse.writeFileSync(fileSrc, contentNew);
138
- // }
139
-
140
- async function prepareVuetify() {
141
- let modulePath;
142
- try {
143
- modulePath = getAbsolutePathOfModule('vuetify', 'lib/framework.js');
144
- } catch (_) {}
145
- if (!modulePath) return;
146
- // copy
147
- fse.copyFileSync(
148
- resolveTemplatePath('vuetify/composables/hydration.js'),
149
- path.join(modulePath, 'lib/composables/hydration.js'),
150
- );
151
- fse.copyFileSync(
152
- resolveTemplatePath('vuetify/composables/ssrBoot.js'),
153
- path.join(modulePath, 'lib/composables/ssrBoot.js'),
154
- );
155
- }
156
- }
157
-
158
- export function extendFilesThree(conf: QuasarConf, api: IndexAPI, _flavor: string) {
159
- return async function extendFiles() {
160
- // patch templates
161
- await patchTemplates();
162
- };
163
-
164
- async function patchTemplates() {
165
- // ssr: ssr-prod-webserver.js
166
- await _handleSSRProdWebserver();
167
- // ssr: ssr-prod-handler.js
168
- await _handleSSRProdHandler();
169
- }
170
-
171
- // ssr-prod-webserver.js
172
- async function _handleSSRProdWebserver() {
173
- const fileSrc = resolveTemplatePath('entry/ssr-prod-webserver.js_');
174
- const fileDest = (api.resolve as any).entry('ssr-prod-webserver.js');
175
- await copyTemplateFile(fileSrc, fileDest, Object.assign({}, conf, { __outDir__: getOutDir() }));
176
- }
177
-
178
- // ssr-prod-handler.js
179
- async function _handleSSRProdHandler() {
180
- const fileSrc = resolveTemplatePath('entry/ssr-prod-handler.js_');
181
- const fileDest = (api.resolve as any).entry('ssr-prod-handler.js');
182
- await copyTemplateFile(fileSrc, fileDest, { __outDir__: getOutDir() });
183
- }
184
- }
185
-
186
- function copyTemplateIfNeed(fileSrc, fileDest) {
187
- if (!fse.existsSync(fileDest)) {
188
- fse.copyFileSync(fileSrc, fileDest);
189
- }
190
- }
@@ -1,79 +0,0 @@
1
- import type { ZovaConfigMeta, ZovaMetaFlavor } from '@cabloy/module-info';
2
- import type { IndexAPI } from '@quasar/app-vite';
3
-
4
- import { mergeConfig } from 'vite';
5
- import { generateZovaViteMeta } from 'zova-vite';
6
-
7
- import type { ConfigContext, QuasarConf } from './types.js';
8
-
9
- export function extendQuasarConf(context: ConfigContext, flavor: ZovaMetaFlavor) {
10
- return async function extendQuasarConf(conf: QuasarConf, api: IndexAPI) {
11
- const appPaths = api.ctx.appPaths;
12
- const mode = api.ctx.prod ? 'production' : 'development';
13
- const appMode = api.ctx.modeName;
14
- const configMeta: ZovaConfigMeta = {
15
- flavor,
16
- mode,
17
- appMode,
18
- };
19
- const configOptions = {
20
- appDir: appPaths.appDir,
21
- runtimeDir: '.zova',
22
- zovaManualChunk: (<any>conf).zovaManualChunk,
23
- };
24
- // zovaViteMeta
25
- context.configMeta = configMeta;
26
- context.configOptions = configOptions;
27
- const zovaViteMeta = (context.zovaViteMeta = await generateZovaViteMeta(
28
- configMeta,
29
- configOptions,
30
- ));
31
-
32
- // boot
33
- if (!conf.boot) conf.boot = [];
34
- conf.boot.unshift('zova');
35
- // build: alias
36
- conf.build = mergeConfig(conf.build || {}, {
37
- alias: zovaViteMeta.viteConfig.resolve.alias,
38
- // not set env here
39
- // env: zovaViteMeta.env,
40
- });
41
- // build: publicPath
42
- conf.build.publicPath = process.env.APP_PUBLIC_PATH;
43
- // build: vueRouterMode/vueRouterBase
44
- conf.build.vueRouterMode = process.env.ROUTER_MODE as any;
45
- conf.build.vueRouterBase = process.env.APP_PUBLIC_PATH;
46
- // build: vitePlugins
47
- const vitePlugins = zovaViteMeta.vitePlugins.map(item => {
48
- return [item[1], item[2], item[3]];
49
- });
50
- conf.build.vitePlugins = (conf.build.vitePlugins || []).concat(vitePlugins as any);
51
- // build: distDir
52
- conf.build.distDir = zovaViteMeta.viteConfig.build.outDir;
53
- // build: analyze
54
- conf.build.analyze = conf.build.analyze ?? process.env.BUILD_ANALYZE === 'true';
55
- // build: target
56
- conf.build.target = {
57
- browser: conf.build.target?.browser ?? process.env.BUILD_TARGET_BROWSER?.split(','),
58
- node: conf.build.target?.node ?? process.env.BUILD_TARGET_NODE,
59
- };
60
- // devServer
61
- conf.devServer = mergeConfig(conf.devServer || {}, zovaViteMeta.viteConfig.server);
62
- // ssr: middlewares
63
- const ssrMiddlewares = (conf.ssr?.middlewares || []).concat('render');
64
- // ssr
65
- conf.ssr = mergeConfig(conf.ssr || {}, {
66
- middlewares: ssrMiddlewares,
67
- prodPort: Number(process.env.SSR_PROD_PORT),
68
- manualStoreSerialization: true,
69
- manualStoreSsrContextInjection: true,
70
- manualStoreHydration: true,
71
- manualPostHydrationTrigger: true,
72
- });
73
- // sourceFiles
74
- conf.sourceFiles = mergeConfig(conf.sourceFiles || {}, {
75
- rootComponent: 'src/boot/app/index.js',
76
- router: 'src/boot/router',
77
- });
78
- };
79
- }
@@ -1,45 +0,0 @@
1
- import type { IndexAPI } from '@quasar/app-vite';
2
- import type { BuildOptions } from 'esbuild';
3
-
4
- import { getOutDir } from 'zova-vite';
5
-
6
- import type { ConfigContext } from './types.js';
7
-
8
- export function extendSSRWebserverConf(context: ConfigContext) {
9
- return function extendSSRWebserverConf(conf: BuildOptions, api: IndexAPI) {
10
- if (context.configMeta?.mode !== 'production') return;
11
- conf.minify = process.env.BUILD_MINIFY === 'true';
12
- conf.sourcemap = _normalizeSourcemap(process.env.BUILD_SOURCEMAP);
13
- conf.keepNames = true;
14
- conf.bundle = true;
15
- conf.external = [];
16
- // conf.banner = { js: "import { createRequire } from 'module';const require = createRequire(import.meta.url);" };
17
- // conf.entryPoints = [
18
- // { in: (api.resolve as any).entry('ssr-prod-webserver.js'), out: 'index' },
19
- // { in: (api.resolve as any).entry('ssr-prod-handler.js'), out: 'handler' },
20
- // ];
21
- conf.outdir = getOutDir();
22
- delete conf.outfile;
23
- // buildsPatch
24
- (conf as any).buildsPatch = [
25
- {
26
- banner: {
27
- js: "import { createRequire } from 'module';const require = createRequire(import.meta.url);",
28
- },
29
- entryPoints: [{ in: (api.resolve as any).entry('ssr-prod-webserver.js'), out: 'index' }],
30
- },
31
- {
32
- entryPoints: [{ in: (api.resolve as any).entry('ssr-prod-handler.js'), out: 'handler' }],
33
- },
34
- ];
35
- };
36
- }
37
-
38
- function _normalizeSourcemap(
39
- sourcemap?: boolean | 'linked' | 'inline' | 'external' | 'both' | 'true' | 'false' | '' | string,
40
- ): any {
41
- if (sourcemap === undefined || sourcemap === '') return false;
42
- if (sourcemap === 'true') return true;
43
- if (sourcemap === 'false') return false;
44
- return sourcemap;
45
- }
@@ -1,143 +0,0 @@
1
- import type { IndexAPI } from '@quasar/app-vite';
2
- import type { UserConfig as ViteUserConfig } from 'vite';
3
- import type { ZovaViteConfigResult } from 'zova-vite';
4
-
5
- import { createLogger, mergeConfig } from 'vite';
6
- import { generateConfigDefine } from 'zova-vite';
7
-
8
- import type { ConfigContext } from './types.js';
9
-
10
- const __SvgIconPattern = /\.metadata\/icons\/groups\/.*?\.svg/;
11
-
12
- export function extendViteConf(context: ConfigContext) {
13
- return function extendViteConf(conf: ViteUserConfig, opts, _api: IndexAPI) {
14
- const zovaViteMeta = context.zovaViteMeta as ZovaViteConfigResult;
15
- // conf.build override zovaViteMeta.viteConfig.build
16
- const minify = conf.build?.minify;
17
- // have two outDir for ssr
18
- const outDir = conf.build?.outDir;
19
- conf.build = mergeConfig(conf.build || {}, zovaViteMeta.viteConfig.build);
20
- if (minify === false) {
21
- conf.build.minify = minify;
22
- }
23
- if (outDir) {
24
- conf.build.outDir = outDir;
25
- }
26
- // css
27
- conf.css = mergeConfig(conf.css || {}, {
28
- preprocessorOptions: {
29
- scss: {
30
- api: 'modern',
31
- },
32
- },
33
- });
34
- // hmr
35
- if (opts.isClient) {
36
- conf.server = mergeConfig(conf.server || {}, {
37
- hmr: {
38
- port: 24679,
39
- },
40
- });
41
- } else {
42
- conf.server = mergeConfig(conf.server || {}, {
43
- hmr: true,
44
- });
45
- }
46
- // assetsInlineLimit
47
- if (opts.isServer) {
48
- conf.build.assetsInlineLimit = (filePath: string) => {
49
- if (__SvgIconPattern.test(filePath)) {
50
- return false;
51
- }
52
- };
53
- }
54
- // env
55
- let env;
56
- if (opts.isClient) {
57
- env = zovaViteMeta.env;
58
- } else {
59
- env = Object.assign({}, zovaViteMeta.env, {
60
- SERVER: true,
61
- CLIENT: false,
62
- });
63
- // special for dist files
64
- process.env.SERVER = env.SERVER;
65
- process.env.NODE_ENV = 'production'; // patch for vue warn, such as withDirectives: currentRenderingInstance === null
66
- // process.env.CLIENT = env.CLIENT; // should not set if false
67
- }
68
- // define
69
- const define = generateConfigDefine(env, [
70
- 'NODE_ENV',
71
- 'META_FLAVOR',
72
- 'META_MODE',
73
- 'META_APP_MODE',
74
- 'SERVER',
75
- 'CLIENT',
76
- 'DEV',
77
- 'PROD',
78
- 'SSR',
79
- ]);
80
- conf.define = mergeConfig(conf.define || {}, define);
81
- // ssr
82
- if (opts.isServer && context.configMeta?.mode === 'development') {
83
- conf.ssr = mergeConfig(conf.ssr || {}, {
84
- external: [
85
- 'vue',
86
- 'pinia',
87
- '@vue/runtime-core',
88
- '@vue/reactivity',
89
- '@vue/runtime-dom',
90
- '@vue/server-renderer',
91
- '@cabloy/vue-reactivity',
92
- '@cabloy/vue-runtime-core',
93
- '@cabloy/vue-runtime-dom',
94
- '@cabloy/vue-server-renderer',
95
- ],
96
- optimizeDeps: {
97
- noDiscovery: false,
98
- exclude: [
99
- 'vue',
100
- 'pinia',
101
- '@vue/runtime-core',
102
- '@vue/reactivity',
103
- '@vue/runtime-dom',
104
- '@vue/server-renderer',
105
- '@cabloy/vue-reactivity',
106
- '@cabloy/vue-runtime-core',
107
- '@cabloy/vue-runtime-dom',
108
- '@cabloy/vue-server-renderer',
109
- ],
110
- },
111
- });
112
- }
113
- // ssr
114
- if (opts.isServer && context.configMeta?.mode === 'production') {
115
- conf.ssr = mergeConfig(conf.ssr || {}, {
116
- target: 'node',
117
- });
118
- conf.ssr.noExternal = true;
119
- }
120
- // general: logger
121
- const logger = createLogger();
122
- const loggerWarn = logger.warn;
123
- logger.warn = (msg, options) => {
124
- // ssr: logger
125
- if (opts.isServer && context.configMeta?.mode === 'development') {
126
- if (msg.includes('Failed to load source map')) return;
127
- }
128
- if (
129
- msg.includes(
130
- 'Arbitrary module namespace identifier names are not available in the configured target environment',
131
- )
132
- ) {
133
- return;
134
- }
135
- if (
136
- msg.includes('Big integer literals are not available in the configured target environment')
137
- )
138
- return;
139
- loggerWarn(msg, options);
140
- };
141
- conf.customLogger = logger;
142
- } as any;
143
- }
@@ -1,50 +0,0 @@
1
- /**
2
- * Quasar App Extension index/runner script
3
- * (runs on each dev/build)
4
- *
5
- * Docs: https://quasar.dev/app-extensions/development-guide/index-api
6
- */
7
-
8
- import type { IndexAPI } from '@quasar/app-vite';
9
-
10
- import { getFlavor } from 'zova-vite';
11
-
12
- import type { ConfigContext } from './types.js';
13
-
14
- import { extendAfterBuild } from './extendAfterBuild.js';
15
- import { extendFilesOne, extendFilesThree, extendFilesTwo } from './extendFiles.js';
16
- import { extendQuasarConf } from './extendQuasarConf.js';
17
- import { extendSSRWebserverConf } from './extendSSRWebserverConf.js';
18
- import { extendViteConf } from './extendViteConf.js';
19
- import { printBanner } from './printBanner.js';
20
-
21
- export async function quasar(api: IndexAPI) {
22
- // flavor
23
- const flavor = getFlavor();
24
- // files
25
- await extendFilesOne(api, flavor)();
26
- await extendFilesTwo(api, flavor)();
27
- // context
28
- const context = {
29
- configMeta: undefined,
30
- configOptions: undefined,
31
- zovaViteMeta: undefined,
32
- } as ConfigContext;
33
- // config
34
- api.extendQuasarConf(extendQuasarConf(context, flavor));
35
- api.extendViteConf(extendViteConf(context));
36
- api.extendSSRWebserverConf(extendSSRWebserverConf(context));
37
- // before dev
38
- api.beforeDev(async (api, { quasarConf }) => {
39
- printBanner(context, flavor, true)(quasarConf, api);
40
- });
41
- // before build
42
- api.beforeBuild(async (api, { quasarConf }) => {
43
- await extendFilesThree(quasarConf, api, flavor)();
44
- });
45
- // after build
46
- api.afterBuild(async (api, { quasarConf }) => {
47
- printBanner(context, flavor, false)(quasarConf, api);
48
- extendAfterBuild(context, flavor)(quasarConf, api);
49
- });
50
- }
@@ -1,33 +0,0 @@
1
- import type { IndexAPI } from '@quasar/app-vite';
2
-
3
- import chalk from 'chalk';
4
-
5
- import type { ConfigContext, QuasarConf } from './types.js';
6
-
7
- export function printBanner(_context: ConfigContext, flavor: string, delay: boolean) {
8
- return async function printBanner(_conf: QuasarConf, api: IndexAPI) {
9
- const mode = api.ctx.prod ? 'production' : 'development';
10
- const appMode = api.ctx.modeName;
11
- // log
12
- if (delay) {
13
- setTimeout(() => {
14
- _print(mode, appMode);
15
- }, 3000);
16
- } else {
17
- _print(mode, appMode);
18
- }
19
- };
20
-
21
- function _print(mode: string, appMode: string) {
22
- // eslint-disable-next-line
23
- console.log(chalk.yellow('\n============ Zova Meta ============'));
24
- // eslint-disable-next-line
25
- console.log(`vite mode ......... ${chalk.cyan(mode)}`);
26
- // eslint-disable-next-line
27
- console.log(`app mode .......... ${chalk.cyan(appMode)}`);
28
- // eslint-disable-next-line
29
- console.log(`flavor ............ ${chalk.cyan(flavor)}`);
30
- // eslint-disable-next-line
31
- console.log('\n');
32
- }
33
- }
@@ -1,11 +0,0 @@
1
- import type { ZovaConfigMeta } from '@cabloy/module-info';
2
- import type { defineConfig } from '@quasar/app-vite/wrappers';
3
- import type { ZovaViteConfigOptions, ZovaViteConfigResult } from 'zova-vite';
4
-
5
- export interface ConfigContext {
6
- configMeta?: ZovaConfigMeta;
7
- configOptions?: ZovaViteConfigOptions;
8
- zovaViteMeta?: ZovaViteConfigResult;
9
- }
10
-
11
- export type QuasarConf = Awaited<ReturnType<ReturnType<typeof defineConfig>>>;
@@ -1,9 +0,0 @@
1
- /**
2
- * Quasar App Extension uninstall script
3
- *
4
- * Docs: https://quasar.dev/app-extensions/development-guide/uninstall-api
5
- */
6
-
7
- export default function (_api) {
8
- //
9
- }
@@ -1,15 +0,0 @@
1
- import fse from 'fs-extra';
2
- import path from 'node:path';
3
-
4
- export function resolveTemplatePath(file: string) {
5
- return new URL(path.join('../templates', file), import.meta.url);
6
- }
7
-
8
- export async function loadJSONFile(fileName: string) {
9
- const pkgContent = (await fse.readFile(fileName)).toString();
10
- return JSON.parse(pkgContent);
11
- }
12
-
13
- export async function saveJSONFile(fileName: string, json: object) {
14
- await fse.writeFile(fileName, `${JSON.stringify(json, null, 2)}\n`);
15
- }
@@ -1,81 +0,0 @@
1
- /* eslint-disable */
2
- /**
3
- * THIS FILE IS GENERATED AUTOMATICALLY.
4
- * DO NOT EDIT.
5
- *
6
- * You are probably looking on adding startup/initialization code.
7
- * Use "quasar new boot <name>" and add it there.
8
- * One boot file per concern. Then reference the file(s) in quasar.config file > boot:
9
- * boot: ['file', ...] // do not add ".js" extension to it.
10
- *
11
- * Boot files are your "main.js"
12
- **/
13
-
14
- <% if (ctx.mode.capacitor) { %>
15
- <% if (metaConf.versions.capacitor <= 2) { %>
16
- import { Plugins } from '@capacitor/core'
17
- const { SplashScreen } = Plugins
18
- <% } else /* Capacitor v3+ */ { %>
19
- import '@capacitor/core'
20
- <% if (metaConf.versions.capacitorPluginApp) { %>
21
- // importing it so it can install itself (used by Quasar UI)
22
- import { App as CapApp } from '@capacitor/app'
23
- <% } %>
24
- <% if (metaConf.versions.capacitorPluginSplashscreen && capacitor.hideSplashscreen !== false) { %>
25
- import { SplashScreen } from '@capacitor/splash-screen'
26
- <% } %>
27
- <% } %>
28
- <% } %>
29
-
30
- import mainFn from 'boot/main'
31
- import { markRaw } from 'vue'
32
- import <%= metaConf.needsAppMountHook === true ? 'AppComponent' : 'RootComponent' %> from 'app/<%= sourceFiles.rootComponent %>'
33
-
34
- <% if (metaConf.needsAppMountHook === true) { %>
35
- import { defineComponent, h, onMounted<%= ctx.mode.ssr && ssr.manualPostHydrationTrigger !== true ? ', getCurrentInstance' : '' %> } from 'vue'
36
- const RootComponent = defineComponent({
37
- name: 'AppWrapper',
38
- setup (props) {
39
- onMounted(() => {
40
- <% if (ctx.mode.capacitor && metaConf.versions.capacitorPluginSplashscreen && capacitor.hideSplashscreen !== false) { %>
41
- SplashScreen.hide()
42
- <% } %>
43
-
44
- <% if (ctx.mode.ssr && ssr.manualPostHydrationTrigger !== true) { %>
45
- const { proxy: { $q } } = getCurrentInstance()
46
- $q.onSSRHydrated !== void 0 && $q.onSSRHydrated()
47
- <% } %>
48
- })
49
-
50
- return () => h(AppComponent, props)
51
- }
52
- })
53
- <% } %>
54
-
55
- <% if (ctx.mode.ssr && ctx.mode.pwa) { %>
56
- export const ssrIsRunningOnClientPWA = typeof window !== 'undefined' &&
57
- document.body.getAttribute('data-server-rendered') === null
58
- <% } %>
59
-
60
- export default async function (createAppFn<%= ctx.mode.ssr ? ', ssrContext' : '' %>) {
61
- // Create the app instance.
62
- // Here we inject into it the Quasar UI, the router & possibly the store.
63
- const app = createAppFn(RootComponent)
64
-
65
- <% if (metaConf.debugging) { %>
66
- app.config.performance = true
67
- <% } %>
68
-
69
- mainFn({app<%= ctx.mode.ssr ? ', ssrContext' : '' %>})
70
-
71
- <% if (ctx.mode.capacitor) { %>
72
- app.config.globalProperties.$q.capacitor = window.Capacitor
73
- <% } %>
74
-
75
- // Expose the app, the router and the store.
76
- // Note that we are not mounting the app here, since bootstrapping will be
77
- // different depending on whether we are in a browser or on the server.
78
- return {
79
- app,
80
- }
81
- }