@vixt/vue 0.1.28 → 0.1.30
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.mjs +10 -12
- package/package.json +11 -11
package/dist/index.mjs
CHANGED
|
@@ -12,9 +12,8 @@ import VueDevTools from 'vite-plugin-vue-devtools';
|
|
|
12
12
|
import Layouts from 'vite-plugin-vue-layouts';
|
|
13
13
|
|
|
14
14
|
function getAppComponentPath(vixt) {
|
|
15
|
-
const { srcDirName } = vixt.options;
|
|
16
15
|
for (const layer of vixt._layers) {
|
|
17
|
-
const appComponentPath = path.resolve(layer.
|
|
16
|
+
const appComponentPath = path.resolve(layer.config.srcDir, "App.vue");
|
|
18
17
|
if (fs.existsSync(appComponentPath))
|
|
19
18
|
return appComponentPath;
|
|
20
19
|
}
|
|
@@ -26,12 +25,12 @@ function genarateAppComponent(vixt) {
|
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
function generateAppConfig(vixt) {
|
|
29
|
-
const { buildImportsDir
|
|
28
|
+
const { buildImportsDir } = vixt.options;
|
|
30
29
|
let appConfigsImportTemplate = "";
|
|
31
30
|
let appConfigsMergeTemplate = "";
|
|
32
31
|
let i = 0;
|
|
33
32
|
for (const layer of vixt._layers) {
|
|
34
|
-
const appConfigPath = path.resolve(layer.
|
|
33
|
+
const appConfigPath = path.resolve(layer.config.srcDir, "app.config.ts");
|
|
35
34
|
if (fs.existsSync(appConfigPath)) {
|
|
36
35
|
const appConfigName = `__app_config_${i}`;
|
|
37
36
|
appConfigsImportTemplate += `import ${appConfigName} from '${appConfigPath}'
|
|
@@ -66,11 +65,11 @@ function resolveHeadTag(tag, attrs) {
|
|
|
66
65
|
return attrs?.children ? `<${tag} ${attrsStr}>${attrs.children}</${tag}>` : `<${tag} ${attrsStr} />`;
|
|
67
66
|
}
|
|
68
67
|
function generateIndexHtml(options, vixt) {
|
|
69
|
-
const { buildDir,
|
|
68
|
+
const { buildDir, rootDir, srcDir } = vixt.options;
|
|
70
69
|
const indexHtmlPath = path.resolve(rootDir, "index.html");
|
|
71
70
|
if (!fs.existsSync(indexHtmlPath))
|
|
72
71
|
fs.outputFileSync(indexHtmlPath, `<!-- Generated by Vixt -->
|
|
73
|
-
<!-- This file transform from '${
|
|
72
|
+
<!-- This file transform from '${path.basename(buildDir)}/index.html' -->
|
|
74
73
|
`);
|
|
75
74
|
const { head = {}, rootTag, rootId } = options;
|
|
76
75
|
const headTemplate = Object.entries(head).filter(([k]) => k !== "noscript").map(([tag, attrs]) => attrs.map((e) => resolveHeadTag(tag, e))).flat().join("\n");
|
|
@@ -94,7 +93,7 @@ ${headTemplate}
|
|
|
94
93
|
<${rootTag} id="${rootId}">
|
|
95
94
|
${loadingTemplate}
|
|
96
95
|
</${rootTag}>
|
|
97
|
-
<script type="module" src="
|
|
96
|
+
<script type="module" src="${srcDir.replace(rootDir, "")}/main.ts"><\/script>
|
|
98
97
|
${noscriptTemplate}
|
|
99
98
|
</body>
|
|
100
99
|
</html>
|
|
@@ -104,12 +103,11 @@ ${noscriptTemplate}
|
|
|
104
103
|
}
|
|
105
104
|
|
|
106
105
|
function generatePlugins(vixt) {
|
|
107
|
-
const { srcDirName } = vixt.options;
|
|
108
106
|
let pluginsImportTemplate = "";
|
|
109
107
|
let pluginsMergeTemplate = "";
|
|
110
108
|
let i = 0;
|
|
111
109
|
for (const layer of [...vixt._layers].reverse()) {
|
|
112
|
-
const pluginsDir = path.resolve(layer.
|
|
110
|
+
const pluginsDir = path.resolve(layer.config.srcDir, "plugins");
|
|
113
111
|
const files = fs.existsSync(pluginsDir) ? fs.readdirSync(pluginsDir) : [];
|
|
114
112
|
for (const f of files) {
|
|
115
113
|
const p = path.resolve(pluginsDir, f);
|
|
@@ -133,11 +131,11 @@ function usePlugins(options) {
|
|
|
133
131
|
}
|
|
134
132
|
|
|
135
133
|
function generateMainTs(options, vixt) {
|
|
136
|
-
const { buildDir,
|
|
134
|
+
const { buildDir, srcDir } = vixt.options;
|
|
137
135
|
const mainTsPath = path.resolve(srcDir, "main.ts");
|
|
138
136
|
if (!fs.existsSync(mainTsPath))
|
|
139
137
|
fs.outputFileSync(mainTsPath, `// Generated by Vixt
|
|
140
|
-
// This file transform from '${
|
|
138
|
+
// This file transform from '${path.basename(buildDir)}/main.ts'
|
|
141
139
|
`);
|
|
142
140
|
const appComponentTemplate = genarateAppComponent(vixt);
|
|
143
141
|
const cssTemplate = generateCss(options);
|
|
@@ -224,7 +222,7 @@ const appVue = defineVixtModule({
|
|
|
224
222
|
|
|
225
223
|
const presetVue = defineVixtModule({
|
|
226
224
|
async setup(_, vixt) {
|
|
227
|
-
const { components, composables = [], constants = [], utils = [], stores = [], pages, layouts } = resolveLayersDirs(vixt._layers
|
|
225
|
+
const { components, composables = [], constants = [], utils = [], stores = [], pages, layouts } = resolveLayersDirs(vixt._layers);
|
|
228
226
|
const { buildTypesDir, buildImportsDir } = vixt.options;
|
|
229
227
|
const defaultOptions = {
|
|
230
228
|
vue: {},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vixt/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.30",
|
|
5
5
|
"author": "SoulLyoko<https://github.com/SoulLyoko>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/SoulLyoko/vixt#readme",
|
|
@@ -20,18 +20,18 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@vitejs/plugin-vue": "^5.2.0",
|
|
22
22
|
"@vitejs/plugin-vue-jsx": "^4.1.0",
|
|
23
|
-
"@vueuse/core": "^
|
|
24
|
-
"pinia": "^2.
|
|
25
|
-
"pinia-plugin-persistedstate": "^4.
|
|
26
|
-
"unocss": "^0.
|
|
27
|
-
"unplugin-auto-import": "^0.
|
|
28
|
-
"unplugin-vue-components": "^0.
|
|
29
|
-
"unplugin-vue-router": "^0.10.
|
|
30
|
-
"vite-plugin-vue-devtools": "^7.
|
|
23
|
+
"@vueuse/core": "^12.4.0",
|
|
24
|
+
"pinia": "^2.3.0",
|
|
25
|
+
"pinia-plugin-persistedstate": "^4.2.0",
|
|
26
|
+
"unocss": "^0.65.4",
|
|
27
|
+
"unplugin-auto-import": "^0.19.0",
|
|
28
|
+
"unplugin-vue-components": "^0.28.0",
|
|
29
|
+
"unplugin-vue-router": "^0.10.9",
|
|
30
|
+
"vite-plugin-vue-devtools": "^7.7.0",
|
|
31
31
|
"vite-plugin-vue-layouts": "^0.11.0",
|
|
32
32
|
"vue": "^3.5.13",
|
|
33
|
-
"vue-router": "^4.
|
|
34
|
-
"@vixt/core": "0.1.
|
|
33
|
+
"vue-router": "^4.5.0",
|
|
34
|
+
"@vixt/core": "0.1.30"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "unbuild"
|