@hybridly/vite 0.5.7 → 0.6.1
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.cjs +338 -28
- package/dist/index.d.cts +4 -5
- package/dist/index.d.mts +4 -5
- package/dist/index.d.ts +4 -5
- package/dist/index.mjs +335 -26
- package/package.json +19 -18
package/dist/index.cjs
CHANGED
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const laravel = require('laravel-vite-plugin');
|
|
6
|
-
const path = require('node:path');
|
|
7
5
|
const fs = require('node:fs');
|
|
6
|
+
const path = require('node:path');
|
|
7
|
+
const colors = require('picocolors');
|
|
8
|
+
const vite = require('vite');
|
|
9
|
+
require('node:url');
|
|
10
|
+
const os = require('node:os');
|
|
8
11
|
const makeDebugger = require('debug');
|
|
9
12
|
const localPkg = require('local-pkg');
|
|
10
13
|
const node_child_process = require('node:child_process');
|
|
@@ -21,9 +24,10 @@ const vue = require('@vitejs/plugin-vue');
|
|
|
21
24
|
|
|
22
25
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
23
26
|
|
|
24
|
-
const laravel__default = /*#__PURE__*/_interopDefaultCompat(laravel);
|
|
25
|
-
const path__default = /*#__PURE__*/_interopDefaultCompat(path);
|
|
26
27
|
const fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
28
|
+
const path__default = /*#__PURE__*/_interopDefaultCompat(path);
|
|
29
|
+
const colors__default = /*#__PURE__*/_interopDefaultCompat(colors);
|
|
30
|
+
const os__default = /*#__PURE__*/_interopDefaultCompat(os);
|
|
27
31
|
const makeDebugger__default = /*#__PURE__*/_interopDefaultCompat(makeDebugger);
|
|
28
32
|
const MagicString__default = /*#__PURE__*/_interopDefaultCompat(MagicString);
|
|
29
33
|
const run__default = /*#__PURE__*/_interopDefaultCompat(run);
|
|
@@ -33,6 +37,218 @@ const iconsResolver__default = /*#__PURE__*/_interopDefaultCompat(iconsResolver)
|
|
|
33
37
|
const icons__default = /*#__PURE__*/_interopDefaultCompat(icons);
|
|
34
38
|
const vue__default = /*#__PURE__*/_interopDefaultCompat(vue);
|
|
35
39
|
|
|
40
|
+
function isIpv6(address) {
|
|
41
|
+
return address.family === "IPv6" || address.family === 6;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function determineDevelopmentEnvironmentConfigPath() {
|
|
45
|
+
const herdConfigPath = path__default.resolve(os__default.homedir(), "Library", "Application Support", "Herd", "config", "valet");
|
|
46
|
+
if (fs__default.existsSync(herdConfigPath)) {
|
|
47
|
+
return herdConfigPath;
|
|
48
|
+
}
|
|
49
|
+
return path__default.resolve(os__default.homedir(), ".config", "valet");
|
|
50
|
+
}
|
|
51
|
+
function resolveDevelopmentEnvironmentHost(configPath) {
|
|
52
|
+
const configFile = path__default.resolve(configPath, "config.json");
|
|
53
|
+
if (!fs__default.existsSync(configFile)) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const config = JSON.parse(fs__default.readFileSync(configFile, "utf-8"));
|
|
57
|
+
return `${path__default.basename(process.cwd())}.${config.tld}`;
|
|
58
|
+
}
|
|
59
|
+
function resolveDevelopmentEnvironmentServerConfig() {
|
|
60
|
+
const configPath = determineDevelopmentEnvironmentConfigPath();
|
|
61
|
+
const host = resolveDevelopmentEnvironmentHost(configPath);
|
|
62
|
+
if (!host) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const keyPath = path__default.resolve(configPath, "Certificates", `${host}.key`);
|
|
66
|
+
const certPath = path__default.resolve(configPath, "Certificates", `${host}.crt`);
|
|
67
|
+
if (!fs__default.existsSync(keyPath) || !fs__default.existsSync(certPath)) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
hmr: { host },
|
|
72
|
+
host,
|
|
73
|
+
https: {
|
|
74
|
+
key: fs__default.readFileSync(keyPath),
|
|
75
|
+
cert: fs__default.readFileSync(certPath)
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function resolveEnvironmentServerConfig(env) {
|
|
80
|
+
if (!env.VITE_DEV_SERVER_KEY && !env.VITE_DEV_SERVER_CERT) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (!fs__default.existsSync(env.VITE_DEV_SERVER_KEY) || !fs__default.existsSync(env.VITE_DEV_SERVER_CERT)) {
|
|
84
|
+
throw new Error(`Unable to find the certificate files specified in your environment. Ensure you have correctly configured VITE_DEV_SERVER_KEY: [${env.VITE_DEV_SERVER_KEY}] and VITE_DEV_SERVER_CERT: [${env.VITE_DEV_SERVER_CERT}].`);
|
|
85
|
+
}
|
|
86
|
+
const host = resolveHostFromEnv(env);
|
|
87
|
+
return {
|
|
88
|
+
hmr: { host },
|
|
89
|
+
host,
|
|
90
|
+
https: {
|
|
91
|
+
key: fs__default.readFileSync(env.VITE_DEV_SERVER_KEY),
|
|
92
|
+
cert: fs__default.readFileSync(env.VITE_DEV_SERVER_CERT)
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function resolveHostFromEnv(env) {
|
|
97
|
+
if (env.VITE_DEV_SERVER_KEY) {
|
|
98
|
+
return env.VITE_DEV_SERVER_KEY;
|
|
99
|
+
}
|
|
100
|
+
try {
|
|
101
|
+
return new URL(env.APP_URL).host;
|
|
102
|
+
} catch {
|
|
103
|
+
throw new Error(`Unable to determine the host from the environment's APP_URL: [${env.APP_URL}].`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
let exitHandlersBound = false;
|
|
108
|
+
function laravel(options, hybridlyConfig) {
|
|
109
|
+
let viteDevServerUrl;
|
|
110
|
+
let resolvedConfig;
|
|
111
|
+
let userConfig;
|
|
112
|
+
const publicDirectory = "public";
|
|
113
|
+
const buildDirectory = "build";
|
|
114
|
+
const hotFile = path__default.join(publicDirectory, "hot");
|
|
115
|
+
return {
|
|
116
|
+
name: "hybridly:laravel",
|
|
117
|
+
enforce: "post",
|
|
118
|
+
config: (config, { command, mode }) => {
|
|
119
|
+
userConfig = config;
|
|
120
|
+
const ssr = !!userConfig.build?.ssr;
|
|
121
|
+
const env = vite.loadEnv(mode, userConfig.envDir || process.cwd(), "");
|
|
122
|
+
const assetUrl = env.ASSET_URL ?? "";
|
|
123
|
+
const base = `${assetUrl + (!assetUrl.endsWith("/") ? "/" : "") + buildDirectory}/`;
|
|
124
|
+
const serverConfig = command === "serve" ? resolveEnvironmentServerConfig(env) ?? resolveDevelopmentEnvironmentServerConfig() : void 0;
|
|
125
|
+
ensureCommandShouldRunInEnvironment(command, env);
|
|
126
|
+
return {
|
|
127
|
+
base: userConfig.base ?? (command === "build" ? base : ""),
|
|
128
|
+
publicDir: userConfig.publicDir ?? false,
|
|
129
|
+
build: {
|
|
130
|
+
manifest: ssr === true ? false : userConfig.build?.manifest ?? "manifest.json",
|
|
131
|
+
outDir: userConfig.build?.outDir ?? path__default.join(publicDirectory, buildDirectory),
|
|
132
|
+
rollupOptions: {
|
|
133
|
+
input: resolveInput(config, hybridlyConfig)
|
|
134
|
+
},
|
|
135
|
+
assetsInlineLimit: userConfig.build?.assetsInlineLimit ?? 0
|
|
136
|
+
},
|
|
137
|
+
server: {
|
|
138
|
+
origin: userConfig.server?.origin ?? "__laravel_vite_placeholder__",
|
|
139
|
+
...process.env.LARAVEL_SAIL ? {
|
|
140
|
+
host: userConfig.server?.host ?? "0.0.0.0",
|
|
141
|
+
port: userConfig.server?.port ?? (env.VITE_PORT ? parseInt(env.VITE_PORT) : 5173),
|
|
142
|
+
strictPort: userConfig.server?.strictPort ?? true
|
|
143
|
+
} : void 0,
|
|
144
|
+
...serverConfig ? {
|
|
145
|
+
host: userConfig.server?.host ?? serverConfig.host,
|
|
146
|
+
hmr: userConfig.server?.hmr === false ? false : {
|
|
147
|
+
...serverConfig.hmr,
|
|
148
|
+
...userConfig.server?.hmr === true ? {} : userConfig.server?.hmr
|
|
149
|
+
},
|
|
150
|
+
https: userConfig.server?.https ?? serverConfig.https
|
|
151
|
+
} : void 0
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
},
|
|
155
|
+
configResolved(config) {
|
|
156
|
+
resolvedConfig = config;
|
|
157
|
+
},
|
|
158
|
+
transform(code) {
|
|
159
|
+
if (resolvedConfig.command === "serve") {
|
|
160
|
+
return code.replace(/__laravel_vite_placeholder__/g, viteDevServerUrl);
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
configureServer(server) {
|
|
164
|
+
const envDir = resolvedConfig.envDir || process.cwd();
|
|
165
|
+
const appUrl = vite.loadEnv(resolvedConfig.mode, envDir, "APP_URL").APP_URL ?? "undefined";
|
|
166
|
+
server.httpServer?.once("listening", () => {
|
|
167
|
+
const address = server.httpServer?.address();
|
|
168
|
+
const isAddressInfo = (x) => typeof x === "object";
|
|
169
|
+
if (isAddressInfo(address)) {
|
|
170
|
+
viteDevServerUrl = resolveDevServerUrl(address, server.config, userConfig);
|
|
171
|
+
fs__default.writeFileSync(hotFile, viteDevServerUrl);
|
|
172
|
+
if (!hybridlyConfig.versions) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
let registered = `${colors__default.bold(hybridlyConfig.components.views.length)} ${colors__default.dim("views")}, `;
|
|
176
|
+
registered += `${colors__default.bold(hybridlyConfig.components.components.length)} ${colors__default.dim("components")}, `;
|
|
177
|
+
registered += `${colors__default.bold(hybridlyConfig.components.layouts.length)} ${colors__default.dim("layouts")}, `;
|
|
178
|
+
registered += `${colors__default.bold(hybridlyConfig.components.directories.length)} ${colors__default.dim("directories")}`;
|
|
179
|
+
const latest = hybridlyConfig.versions.is_latest ? "" : colors__default.dim(`(${colors__default.yellow(`${hybridlyConfig.versions.latest} is available`)})`);
|
|
180
|
+
let version = `${colors__default.yellow(`v${hybridlyConfig.versions.composer}`)} ${colors__default.dim("(composer)")}, `;
|
|
181
|
+
version += `${colors__default.yellow(`v${hybridlyConfig.versions.npm}`)} ${colors__default.dim("(npm)")}`;
|
|
182
|
+
version += ` \u2014 ${colors__default.yellow("this may lead to undefined behavior")}`;
|
|
183
|
+
setTimeout(() => {
|
|
184
|
+
server.config.logger.info(`
|
|
185
|
+
${colors__default.magenta(`${colors__default.bold("HYBRIDLY")} v${hybridlyConfig.versions.composer}`)} ${latest}`);
|
|
186
|
+
server.config.logger.info("");
|
|
187
|
+
server.config.logger.info(` ${colors__default.green("\u279C")} ${colors__default.bold("URL")}: ${colors__default.cyan(hybridlyConfig.routing.url)}`);
|
|
188
|
+
server.config.logger.info(` ${colors__default.green("\u279C")} ${colors__default.bold("Registered")}: ${registered}`);
|
|
189
|
+
if (hybridlyConfig.versions.composer !== hybridlyConfig.versions.npm) {
|
|
190
|
+
server.config.logger.info(` ${colors__default.yellow("\u279C")} ${colors__default.bold("Version mismatch")}: ${version}`);
|
|
191
|
+
}
|
|
192
|
+
}, 100);
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
if (!exitHandlersBound) {
|
|
196
|
+
let clean = function() {
|
|
197
|
+
if (fs__default.existsSync(hotFile)) {
|
|
198
|
+
fs__default.rmSync(hotFile);
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
process.on("exit", clean);
|
|
202
|
+
process.on("SIGINT", () => process.exit());
|
|
203
|
+
process.on("SIGTERM", () => process.exit());
|
|
204
|
+
process.on("SIGHUP", () => process.exit());
|
|
205
|
+
exitHandlersBound = true;
|
|
206
|
+
}
|
|
207
|
+
return () => server.middlewares.use((req, res, next) => {
|
|
208
|
+
if (req.url === "/index.html") {
|
|
209
|
+
res.writeHead(302, { Location: appUrl });
|
|
210
|
+
res.end();
|
|
211
|
+
}
|
|
212
|
+
next();
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
function ensureCommandShouldRunInEnvironment(command, env) {
|
|
218
|
+
if (command === "build" || env.LARAVEL_BYPASS_ENV_CHECK === "1") {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
if (typeof env.LARAVEL_VAPOR !== "undefined") {
|
|
222
|
+
throw new TypeError("You should not run the Vite HMR server on Vapor. You should build your assets for production instead. To disable this ENV check you may set LARAVEL_BYPASS_ENV_CHECK=1");
|
|
223
|
+
}
|
|
224
|
+
if (typeof env.LARAVEL_FORGE !== "undefined") {
|
|
225
|
+
throw new TypeError("You should not run the Vite HMR server in your Forge deployment script. You should build your assets for production instead. To disable this ENV check you may set LARAVEL_BYPASS_ENV_CHECK=1");
|
|
226
|
+
}
|
|
227
|
+
if (typeof env.LARAVEL_ENVOYER !== "undefined") {
|
|
228
|
+
throw new TypeError("You should not run the Vite HMR server in your Envoyer hook. You should build your assets for production instead. To disable this ENV check you may set LARAVEL_BYPASS_ENV_CHECK=1");
|
|
229
|
+
}
|
|
230
|
+
if (typeof env.CI !== "undefined") {
|
|
231
|
+
throw new TypeError("You should not run the Vite HMR server in CI environments. You should build your assets for production instead. To disable this ENV check you may set LARAVEL_BYPASS_ENV_CHECK=1");
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
function resolveInput(userConfig, hybridlyConfig, ssr) {
|
|
235
|
+
return userConfig.build?.rollupOptions?.input ?? hybridlyConfig.architecture.application_main_path;
|
|
236
|
+
}
|
|
237
|
+
function resolveDevServerUrl(address, config, userConfig) {
|
|
238
|
+
const configHmrProtocol = typeof config.server.hmr === "object" ? config.server.hmr.protocol : null;
|
|
239
|
+
const clientProtocol = configHmrProtocol ? configHmrProtocol === "wss" ? "https" : "http" : null;
|
|
240
|
+
const serverProtocol = config.server.https ? "https" : "http";
|
|
241
|
+
const protocol = clientProtocol ?? serverProtocol;
|
|
242
|
+
const configHmrHost = typeof config.server.hmr === "object" ? config.server.hmr.host : null;
|
|
243
|
+
const configHost = typeof config.server.host === "string" ? config.server.host : null;
|
|
244
|
+
const sailHost = process.env.LARAVEL_SAIL && !userConfig.server?.host ? "localhost" : null;
|
|
245
|
+
const serverAddress = isIpv6(address) ? `[${address.address}]` : address.address;
|
|
246
|
+
const host = configHmrHost ?? sailHost ?? configHost ?? serverAddress;
|
|
247
|
+
const configHmrClientPort = typeof config.server.hmr === "object" ? config.server.hmr.clientPort : null;
|
|
248
|
+
const port = configHmrClientPort ?? address.port;
|
|
249
|
+
return `${protocol}://${host}:${port}`;
|
|
250
|
+
}
|
|
251
|
+
|
|
36
252
|
const LAYOUT_PLUGIN_NAME = "vite:hybridly:layout";
|
|
37
253
|
const CONFIG_PLUGIN_NAME = "vite:hybridly:config";
|
|
38
254
|
const CONFIG_VIRTUAL_MODULE_ID = "virtual:hybridly/config";
|
|
@@ -63,7 +279,7 @@ function generateTsConfig(options, config) {
|
|
|
63
279
|
compilerOptions: {
|
|
64
280
|
target: "esnext",
|
|
65
281
|
module: "esnext",
|
|
66
|
-
moduleResolution: "
|
|
282
|
+
moduleResolution: "bundler",
|
|
67
283
|
strict: true,
|
|
68
284
|
jsx: "preserve",
|
|
69
285
|
sourceMap: true,
|
|
@@ -89,7 +305,7 @@ function generateTsConfig(options, config) {
|
|
|
89
305
|
"./*"
|
|
90
306
|
],
|
|
91
307
|
"@/*": [
|
|
92
|
-
`./${config.architecture.
|
|
308
|
+
`./${config.architecture.root_directory}/*`
|
|
93
309
|
]
|
|
94
310
|
}
|
|
95
311
|
},
|
|
@@ -97,7 +313,7 @@ function generateTsConfig(options, config) {
|
|
|
97
313
|
...config.components.views.map(({ path: path2 }) => `../${path2}`),
|
|
98
314
|
...config.components.layouts.map(({ path: path2 }) => `../${path2}`),
|
|
99
315
|
...config.components.components.map(({ path: path2 }) => `../${path2}`),
|
|
100
|
-
`../${config.architecture.
|
|
316
|
+
`../${config.architecture.root_directory}/**/*`,
|
|
101
317
|
"../app/**/*",
|
|
102
318
|
"../src/**/*",
|
|
103
319
|
"./php-types.d.ts",
|
|
@@ -109,8 +325,6 @@ function generateTsConfig(options, config) {
|
|
|
109
325
|
],
|
|
110
326
|
exclude: [
|
|
111
327
|
"../public/**/*",
|
|
112
|
-
"../node_modules",
|
|
113
|
-
"../vendor",
|
|
114
328
|
...options.tsconfig?.exclude ?? []
|
|
115
329
|
]
|
|
116
330
|
};
|
|
@@ -189,7 +403,7 @@ async function loadConfiguration(options) {
|
|
|
189
403
|
}
|
|
190
404
|
}
|
|
191
405
|
|
|
192
|
-
function getClientCode(config) {
|
|
406
|
+
function getClientCode$1(config) {
|
|
193
407
|
const paths = config.components.views.map(({ path }) => `"~/${path}"`).join(",");
|
|
194
408
|
return `
|
|
195
409
|
import { initializeHybridly as init } from 'hybridly/vue'
|
|
@@ -215,7 +429,7 @@ const initialize = (options, config) => {
|
|
|
215
429
|
return {
|
|
216
430
|
resolve: {
|
|
217
431
|
alias: {
|
|
218
|
-
"@": path__default.join(process.cwd(), config.architecture.
|
|
432
|
+
"@": path__default.join(process.cwd(), config.architecture.root_directory),
|
|
219
433
|
"#": path__default.join(process.cwd(), ".hybridly"),
|
|
220
434
|
"~": path__default.join(process.cwd())
|
|
221
435
|
}
|
|
@@ -261,7 +475,7 @@ const initialize = (options, config) => {
|
|
|
261
475
|
},
|
|
262
476
|
async load(id) {
|
|
263
477
|
if (id === RESOLVED_CONFIG_VIRTUAL_MODULE_ID) {
|
|
264
|
-
return getClientCode(config);
|
|
478
|
+
return getClientCode$1(config);
|
|
265
479
|
}
|
|
266
480
|
},
|
|
267
481
|
// Denies HMR for `.hybridly` content, it causes unwanted reloads
|
|
@@ -280,7 +494,7 @@ function didViewsOrLayoutsChange(updatedConfig, previousConfig) {
|
|
|
280
494
|
}
|
|
281
495
|
|
|
282
496
|
const TEMPLATE_LAYOUT_REGEX = /<template +layout(?: *= *['"]((?:[\w\/\-_,:](?:,\ )?)+)['"] *)?>/;
|
|
283
|
-
const
|
|
497
|
+
const LANG_REGEX = /lang=['"](\w+)['"]/;
|
|
284
498
|
const layout = (options, config) => {
|
|
285
499
|
const defaultLayoutName = options?.layout?.defaultLayoutName?.replace(".vue", "") ?? "default";
|
|
286
500
|
const templateRegExp = options?.layout?.templateRegExp ?? TEMPLATE_LAYOUT_REGEX;
|
|
@@ -296,7 +510,7 @@ const layout = (options, config) => {
|
|
|
296
510
|
}
|
|
297
511
|
const source = new MagicString__default(code);
|
|
298
512
|
const updatedCode = source.replace(templateRegExp, (_, layoutName) => {
|
|
299
|
-
const
|
|
513
|
+
const [hasLang, lang] = code.match(LANG_REGEX) ?? [];
|
|
300
514
|
const layouts = layoutName?.toString()?.replaceAll(" ", "").split(",") ?? [defaultLayoutName];
|
|
301
515
|
const importName = (i) => `__hybridly_layout_${i}`;
|
|
302
516
|
const exports = layouts.map((_2, i) => importName(i));
|
|
@@ -310,7 +524,7 @@ const layout = (options, config) => {
|
|
|
310
524
|
imports
|
|
311
525
|
});
|
|
312
526
|
return `
|
|
313
|
-
<script${
|
|
527
|
+
<script${hasLang ? ` lang="${lang}"` : ""}>
|
|
314
528
|
${imports}
|
|
315
529
|
export default { layout: [${exports.join(", ")}] }
|
|
316
530
|
<\/script>
|
|
@@ -355,13 +569,6 @@ function getRunOptions(options) {
|
|
|
355
569
|
];
|
|
356
570
|
}
|
|
357
571
|
|
|
358
|
-
function getLaravelOptions(options, config) {
|
|
359
|
-
return {
|
|
360
|
-
input: `${config.architecture.root}/application/main.ts`,
|
|
361
|
-
...options.laravel ?? {}
|
|
362
|
-
};
|
|
363
|
-
}
|
|
364
|
-
|
|
365
572
|
const HybridlyImports = {
|
|
366
573
|
"hybridly/vue": [
|
|
367
574
|
"useProperty",
|
|
@@ -410,8 +617,8 @@ function getAutoImportsOptions(options, config) {
|
|
|
410
617
|
vueTemplate: true,
|
|
411
618
|
dts: ".hybridly/auto-imports.d.ts",
|
|
412
619
|
dirs: [
|
|
413
|
-
`${config.architecture.
|
|
414
|
-
`${config.architecture.
|
|
620
|
+
`${config.architecture.root_directory}/utils`,
|
|
621
|
+
`${config.architecture.root_directory}/composables`,
|
|
415
622
|
...config.components.directories.map((directory) => `${directory}/**/*.ts`)
|
|
416
623
|
],
|
|
417
624
|
imports: [
|
|
@@ -439,7 +646,7 @@ async function getVueComponentsOptions(options, config) {
|
|
|
439
646
|
return utils.merge(
|
|
440
647
|
{
|
|
441
648
|
dirs: [
|
|
442
|
-
`./${config.architecture.
|
|
649
|
+
`./${config.architecture.root_directory}/${config.architecture.components_directory}`
|
|
443
650
|
],
|
|
444
651
|
directoryAsNamespace: true,
|
|
445
652
|
dts: ".hybridly/components.d.ts",
|
|
@@ -499,7 +706,7 @@ function getIconsOptions(options, config) {
|
|
|
499
706
|
const customIconDirectoryName = resolved?.icons ?? "icons";
|
|
500
707
|
const customCollections = Object.fromEntries(resolved?.collections?.map((collection) => [
|
|
501
708
|
collection,
|
|
502
|
-
loaders.FileSystemIconLoader(`./${config.architecture.
|
|
709
|
+
loaders.FileSystemIconLoader(`./${config.architecture.root_directory}/${customIconDirectoryName}/${collection}`)
|
|
503
710
|
]) ?? []);
|
|
504
711
|
return {
|
|
505
712
|
autoInstall: true,
|
|
@@ -562,18 +769,121 @@ function killSwitch() {
|
|
|
562
769
|
};
|
|
563
770
|
}
|
|
564
771
|
|
|
772
|
+
function getClientCode() {
|
|
773
|
+
const style = `
|
|
774
|
+
.local-build {
|
|
775
|
+
position: fixed;
|
|
776
|
+
bottom: 1rem;
|
|
777
|
+
left: 1rem;
|
|
778
|
+
z-index: 50;
|
|
779
|
+
display: inline-flex;
|
|
780
|
+
max-width: 26rem;
|
|
781
|
+
align-items: center;
|
|
782
|
+
background-color: rgba(0, 0, 0, 0.9);
|
|
783
|
+
padding: 0.75rem;
|
|
784
|
+
font-size: 0.75rem;
|
|
785
|
+
color: #8C8C8C;
|
|
786
|
+
transition: opacity 0.3s;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
.local-build:hover {
|
|
790
|
+
opacity: 0.1;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
.local-build .icon {
|
|
794
|
+
margin-right: 0.5rem;
|
|
795
|
+
height: 1.25rem;
|
|
796
|
+
width: 1.25rem;
|
|
797
|
+
fill: currentColor;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
.local-build .content {
|
|
801
|
+
display: inline-flex;
|
|
802
|
+
flex-direction: column;
|
|
803
|
+
gap: 0.5rem;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
.local-build .title {
|
|
807
|
+
font-weight: 500;
|
|
808
|
+
}
|
|
809
|
+
`;
|
|
810
|
+
const html = `
|
|
811
|
+
<div class="local-build">
|
|
812
|
+
<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" class="icon"><path fill="currentColor" d="M11 15h2v2h-2zm0-8h2v6h-2zm1-5C6.47 2 2 6.5 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2m0 18a8 8 0 0 1-8-8a8 8 0 0 1 8-8a8 8 0 0 1 8 8a8 8 0 0 1-8 8"></path></svg>
|
|
813
|
+
<span class="content">
|
|
814
|
+
<span class="title">This is a local production build. Changes will not be reflected.</span>
|
|
815
|
+
</span>
|
|
816
|
+
</div>
|
|
817
|
+
`;
|
|
818
|
+
return `
|
|
819
|
+
;(function() {
|
|
820
|
+
const style = document.createElement('style')
|
|
821
|
+
style.innerHTML = \`${style}\`
|
|
822
|
+
document.head.appendChild(style)
|
|
823
|
+
|
|
824
|
+
const html = document.createElement('div')
|
|
825
|
+
html.innerHTML = \`${html}\`
|
|
826
|
+
document.body.appendChild(html)
|
|
827
|
+
html.addEventListener('click', () => html.remove())
|
|
828
|
+
})()
|
|
829
|
+
`;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
const LOCAL_BUILD_VIRTUAL_ID = "virtual:hybridly/local-build";
|
|
833
|
+
const RESOLVED_LOCAL_BUILD_VIRTUAL_ID = `\0${LOCAL_BUILD_VIRTUAL_ID}`;
|
|
834
|
+
function warnOnLocalBuilds() {
|
|
835
|
+
let shouldDisplayWarning = false;
|
|
836
|
+
return {
|
|
837
|
+
name: "vite:hybridly:local-build",
|
|
838
|
+
enforce: "pre",
|
|
839
|
+
apply: "build",
|
|
840
|
+
config(config, { mode }) {
|
|
841
|
+
const env = vite.loadEnv(mode, config.envDir ?? process.cwd(), "");
|
|
842
|
+
shouldDisplayWarning = env.APP_ENV === "local";
|
|
843
|
+
},
|
|
844
|
+
async resolveId(id) {
|
|
845
|
+
if (!shouldDisplayWarning) {
|
|
846
|
+
return;
|
|
847
|
+
}
|
|
848
|
+
if (id === LOCAL_BUILD_VIRTUAL_ID) {
|
|
849
|
+
return RESOLVED_LOCAL_BUILD_VIRTUAL_ID;
|
|
850
|
+
}
|
|
851
|
+
},
|
|
852
|
+
async load(id) {
|
|
853
|
+
if (!shouldDisplayWarning) {
|
|
854
|
+
return;
|
|
855
|
+
}
|
|
856
|
+
if (id === RESOLVED_LOCAL_BUILD_VIRTUAL_ID) {
|
|
857
|
+
return getClientCode();
|
|
858
|
+
}
|
|
859
|
+
},
|
|
860
|
+
transform(code, id) {
|
|
861
|
+
if (!shouldDisplayWarning) {
|
|
862
|
+
return;
|
|
863
|
+
}
|
|
864
|
+
if (!id.endsWith(CONFIG_VIRTUAL_MODULE_ID)) {
|
|
865
|
+
return;
|
|
866
|
+
}
|
|
867
|
+
code = `${code}
|
|
868
|
+
import '${LOCAL_BUILD_VIRTUAL_ID}'`;
|
|
869
|
+
return code;
|
|
870
|
+
}
|
|
871
|
+
};
|
|
872
|
+
}
|
|
873
|
+
|
|
565
874
|
async function plugin(options = {}) {
|
|
566
875
|
const config = await loadConfiguration(options);
|
|
567
876
|
return [
|
|
568
877
|
initialize(options, config),
|
|
569
878
|
layout(options, config),
|
|
570
|
-
options.laravel !== false &&
|
|
879
|
+
options.laravel !== false && laravel(options, config),
|
|
571
880
|
options.run !== false && run__default(getRunOptions(options)),
|
|
572
881
|
options.vueComponents !== false && vueComponents__default(await getVueComponentsOptions(options, config)),
|
|
573
882
|
options.autoImports !== false && autoimport__default(getAutoImportsOptions(options, config)),
|
|
574
883
|
options.icons !== false && icons__default(getIconsOptions(options, config)),
|
|
575
884
|
options.vue !== false && vue__default(getVueOptions(options)),
|
|
576
|
-
options.killSwitch !== false && killSwitch()
|
|
885
|
+
options.killSwitch !== false && killSwitch(),
|
|
886
|
+
options.warnOnLocalBuilds !== false && warnOnLocalBuilds()
|
|
577
887
|
];
|
|
578
888
|
}
|
|
579
889
|
|
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,6 @@ import { Plugin } from 'vite';
|
|
|
2
2
|
import { DynamicConfiguration } from '@hybridly/core';
|
|
3
3
|
import autoimport from 'unplugin-auto-import/vite';
|
|
4
4
|
import icons from 'unplugin-icons/vite';
|
|
5
|
-
import laravel from 'laravel-vite-plugin';
|
|
6
5
|
import { Runner } from 'vite-plugin-run';
|
|
7
6
|
import vue from '@vitejs/plugin-vue';
|
|
8
7
|
import vueComponents from 'unplugin-vue-components/vite';
|
|
@@ -22,8 +21,6 @@ type CustomIconOptions = string[] | {
|
|
|
22
21
|
collections?: string[];
|
|
23
22
|
};
|
|
24
23
|
|
|
25
|
-
type LaravelOptions = Exclude<Parameters<typeof laravel>[0], string | string[]>;
|
|
26
|
-
|
|
27
24
|
type VueOptions = Parameters<typeof vue>[0];
|
|
28
25
|
|
|
29
26
|
type VueComponentsOptions = Parameters<typeof vueComponents>[0] & {
|
|
@@ -48,12 +45,12 @@ declare function HybridlyResolver(linkName?: string): {
|
|
|
48
45
|
interface ViteOptions {
|
|
49
46
|
/** Path to the PHP executable. */
|
|
50
47
|
php?: string;
|
|
48
|
+
/** Disables the Laravel integration. Useful if you prefer to use the official one. */
|
|
49
|
+
laravel?: false;
|
|
51
50
|
/** Options for the layout plugin. */
|
|
52
51
|
layout?: LayoutOptions;
|
|
53
52
|
/** Options for `@vitejs/plugin-vue`. */
|
|
54
53
|
vue?: false | VueOptions;
|
|
55
|
-
/** Options for `laravel-vite-plugin`. Set to `false` to disable. */
|
|
56
|
-
laravel?: false | Partial<LaravelOptions>;
|
|
57
54
|
/** Options for `vite-plugin-run`. Set to `false` to disable. */
|
|
58
55
|
run?: false | Runner[];
|
|
59
56
|
/** Options for `unplugin-auto-import`. Set to `false` to disable. */
|
|
@@ -72,6 +69,8 @@ interface ViteOptions {
|
|
|
72
69
|
killSwitch?: boolean;
|
|
73
70
|
/** Extra `tsconfig.json` options. */
|
|
74
71
|
tsconfig?: TsConfigOptions;
|
|
72
|
+
/** Warns when displaying local builds. */
|
|
73
|
+
warnOnLocalBuilds?: boolean;
|
|
75
74
|
}
|
|
76
75
|
interface LayoutOptions {
|
|
77
76
|
/** Custom RegExp for parsing the template string. */
|
package/dist/index.d.mts
CHANGED
|
@@ -2,7 +2,6 @@ import { Plugin } from 'vite';
|
|
|
2
2
|
import { DynamicConfiguration } from '@hybridly/core';
|
|
3
3
|
import autoimport from 'unplugin-auto-import/vite';
|
|
4
4
|
import icons from 'unplugin-icons/vite';
|
|
5
|
-
import laravel from 'laravel-vite-plugin';
|
|
6
5
|
import { Runner } from 'vite-plugin-run';
|
|
7
6
|
import vue from '@vitejs/plugin-vue';
|
|
8
7
|
import vueComponents from 'unplugin-vue-components/vite';
|
|
@@ -22,8 +21,6 @@ type CustomIconOptions = string[] | {
|
|
|
22
21
|
collections?: string[];
|
|
23
22
|
};
|
|
24
23
|
|
|
25
|
-
type LaravelOptions = Exclude<Parameters<typeof laravel>[0], string | string[]>;
|
|
26
|
-
|
|
27
24
|
type VueOptions = Parameters<typeof vue>[0];
|
|
28
25
|
|
|
29
26
|
type VueComponentsOptions = Parameters<typeof vueComponents>[0] & {
|
|
@@ -48,12 +45,12 @@ declare function HybridlyResolver(linkName?: string): {
|
|
|
48
45
|
interface ViteOptions {
|
|
49
46
|
/** Path to the PHP executable. */
|
|
50
47
|
php?: string;
|
|
48
|
+
/** Disables the Laravel integration. Useful if you prefer to use the official one. */
|
|
49
|
+
laravel?: false;
|
|
51
50
|
/** Options for the layout plugin. */
|
|
52
51
|
layout?: LayoutOptions;
|
|
53
52
|
/** Options for `@vitejs/plugin-vue`. */
|
|
54
53
|
vue?: false | VueOptions;
|
|
55
|
-
/** Options for `laravel-vite-plugin`. Set to `false` to disable. */
|
|
56
|
-
laravel?: false | Partial<LaravelOptions>;
|
|
57
54
|
/** Options for `vite-plugin-run`. Set to `false` to disable. */
|
|
58
55
|
run?: false | Runner[];
|
|
59
56
|
/** Options for `unplugin-auto-import`. Set to `false` to disable. */
|
|
@@ -72,6 +69,8 @@ interface ViteOptions {
|
|
|
72
69
|
killSwitch?: boolean;
|
|
73
70
|
/** Extra `tsconfig.json` options. */
|
|
74
71
|
tsconfig?: TsConfigOptions;
|
|
72
|
+
/** Warns when displaying local builds. */
|
|
73
|
+
warnOnLocalBuilds?: boolean;
|
|
75
74
|
}
|
|
76
75
|
interface LayoutOptions {
|
|
77
76
|
/** Custom RegExp for parsing the template string. */
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { Plugin } from 'vite';
|
|
|
2
2
|
import { DynamicConfiguration } from '@hybridly/core';
|
|
3
3
|
import autoimport from 'unplugin-auto-import/vite';
|
|
4
4
|
import icons from 'unplugin-icons/vite';
|
|
5
|
-
import laravel from 'laravel-vite-plugin';
|
|
6
5
|
import { Runner } from 'vite-plugin-run';
|
|
7
6
|
import vue from '@vitejs/plugin-vue';
|
|
8
7
|
import vueComponents from 'unplugin-vue-components/vite';
|
|
@@ -22,8 +21,6 @@ type CustomIconOptions = string[] | {
|
|
|
22
21
|
collections?: string[];
|
|
23
22
|
};
|
|
24
23
|
|
|
25
|
-
type LaravelOptions = Exclude<Parameters<typeof laravel>[0], string | string[]>;
|
|
26
|
-
|
|
27
24
|
type VueOptions = Parameters<typeof vue>[0];
|
|
28
25
|
|
|
29
26
|
type VueComponentsOptions = Parameters<typeof vueComponents>[0] & {
|
|
@@ -48,12 +45,12 @@ declare function HybridlyResolver(linkName?: string): {
|
|
|
48
45
|
interface ViteOptions {
|
|
49
46
|
/** Path to the PHP executable. */
|
|
50
47
|
php?: string;
|
|
48
|
+
/** Disables the Laravel integration. Useful if you prefer to use the official one. */
|
|
49
|
+
laravel?: false;
|
|
51
50
|
/** Options for the layout plugin. */
|
|
52
51
|
layout?: LayoutOptions;
|
|
53
52
|
/** Options for `@vitejs/plugin-vue`. */
|
|
54
53
|
vue?: false | VueOptions;
|
|
55
|
-
/** Options for `laravel-vite-plugin`. Set to `false` to disable. */
|
|
56
|
-
laravel?: false | Partial<LaravelOptions>;
|
|
57
54
|
/** Options for `vite-plugin-run`. Set to `false` to disable. */
|
|
58
55
|
run?: false | Runner[];
|
|
59
56
|
/** Options for `unplugin-auto-import`. Set to `false` to disable. */
|
|
@@ -72,6 +69,8 @@ interface ViteOptions {
|
|
|
72
69
|
killSwitch?: boolean;
|
|
73
70
|
/** Extra `tsconfig.json` options. */
|
|
74
71
|
tsconfig?: TsConfigOptions;
|
|
72
|
+
/** Warns when displaying local builds. */
|
|
73
|
+
warnOnLocalBuilds?: boolean;
|
|
75
74
|
}
|
|
76
75
|
interface LayoutOptions {
|
|
77
76
|
/** Custom RegExp for parsing the template string. */
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import laravel from 'laravel-vite-plugin';
|
|
2
|
-
import path from 'node:path';
|
|
3
1
|
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import colors from 'picocolors';
|
|
4
|
+
import { loadEnv } from 'vite';
|
|
5
|
+
import 'node:url';
|
|
6
|
+
import os from 'node:os';
|
|
4
7
|
import makeDebugger from 'debug';
|
|
5
8
|
import { isPackageExists, resolveModule, importModule } from 'local-pkg';
|
|
6
9
|
import { execSync } from 'node:child_process';
|
|
@@ -15,6 +18,218 @@ import icons from 'unplugin-icons/vite';
|
|
|
15
18
|
import { FileSystemIconLoader } from 'unplugin-icons/loaders';
|
|
16
19
|
import vue from '@vitejs/plugin-vue';
|
|
17
20
|
|
|
21
|
+
function isIpv6(address) {
|
|
22
|
+
return address.family === "IPv6" || address.family === 6;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function determineDevelopmentEnvironmentConfigPath() {
|
|
26
|
+
const herdConfigPath = path.resolve(os.homedir(), "Library", "Application Support", "Herd", "config", "valet");
|
|
27
|
+
if (fs.existsSync(herdConfigPath)) {
|
|
28
|
+
return herdConfigPath;
|
|
29
|
+
}
|
|
30
|
+
return path.resolve(os.homedir(), ".config", "valet");
|
|
31
|
+
}
|
|
32
|
+
function resolveDevelopmentEnvironmentHost(configPath) {
|
|
33
|
+
const configFile = path.resolve(configPath, "config.json");
|
|
34
|
+
if (!fs.existsSync(configFile)) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const config = JSON.parse(fs.readFileSync(configFile, "utf-8"));
|
|
38
|
+
return `${path.basename(process.cwd())}.${config.tld}`;
|
|
39
|
+
}
|
|
40
|
+
function resolveDevelopmentEnvironmentServerConfig() {
|
|
41
|
+
const configPath = determineDevelopmentEnvironmentConfigPath();
|
|
42
|
+
const host = resolveDevelopmentEnvironmentHost(configPath);
|
|
43
|
+
if (!host) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const keyPath = path.resolve(configPath, "Certificates", `${host}.key`);
|
|
47
|
+
const certPath = path.resolve(configPath, "Certificates", `${host}.crt`);
|
|
48
|
+
if (!fs.existsSync(keyPath) || !fs.existsSync(certPath)) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
hmr: { host },
|
|
53
|
+
host,
|
|
54
|
+
https: {
|
|
55
|
+
key: fs.readFileSync(keyPath),
|
|
56
|
+
cert: fs.readFileSync(certPath)
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function resolveEnvironmentServerConfig(env) {
|
|
61
|
+
if (!env.VITE_DEV_SERVER_KEY && !env.VITE_DEV_SERVER_CERT) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (!fs.existsSync(env.VITE_DEV_SERVER_KEY) || !fs.existsSync(env.VITE_DEV_SERVER_CERT)) {
|
|
65
|
+
throw new Error(`Unable to find the certificate files specified in your environment. Ensure you have correctly configured VITE_DEV_SERVER_KEY: [${env.VITE_DEV_SERVER_KEY}] and VITE_DEV_SERVER_CERT: [${env.VITE_DEV_SERVER_CERT}].`);
|
|
66
|
+
}
|
|
67
|
+
const host = resolveHostFromEnv(env);
|
|
68
|
+
return {
|
|
69
|
+
hmr: { host },
|
|
70
|
+
host,
|
|
71
|
+
https: {
|
|
72
|
+
key: fs.readFileSync(env.VITE_DEV_SERVER_KEY),
|
|
73
|
+
cert: fs.readFileSync(env.VITE_DEV_SERVER_CERT)
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function resolveHostFromEnv(env) {
|
|
78
|
+
if (env.VITE_DEV_SERVER_KEY) {
|
|
79
|
+
return env.VITE_DEV_SERVER_KEY;
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
return new URL(env.APP_URL).host;
|
|
83
|
+
} catch {
|
|
84
|
+
throw new Error(`Unable to determine the host from the environment's APP_URL: [${env.APP_URL}].`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
let exitHandlersBound = false;
|
|
89
|
+
function laravel(options, hybridlyConfig) {
|
|
90
|
+
let viteDevServerUrl;
|
|
91
|
+
let resolvedConfig;
|
|
92
|
+
let userConfig;
|
|
93
|
+
const publicDirectory = "public";
|
|
94
|
+
const buildDirectory = "build";
|
|
95
|
+
const hotFile = path.join(publicDirectory, "hot");
|
|
96
|
+
return {
|
|
97
|
+
name: "hybridly:laravel",
|
|
98
|
+
enforce: "post",
|
|
99
|
+
config: (config, { command, mode }) => {
|
|
100
|
+
userConfig = config;
|
|
101
|
+
const ssr = !!userConfig.build?.ssr;
|
|
102
|
+
const env = loadEnv(mode, userConfig.envDir || process.cwd(), "");
|
|
103
|
+
const assetUrl = env.ASSET_URL ?? "";
|
|
104
|
+
const base = `${assetUrl + (!assetUrl.endsWith("/") ? "/" : "") + buildDirectory}/`;
|
|
105
|
+
const serverConfig = command === "serve" ? resolveEnvironmentServerConfig(env) ?? resolveDevelopmentEnvironmentServerConfig() : void 0;
|
|
106
|
+
ensureCommandShouldRunInEnvironment(command, env);
|
|
107
|
+
return {
|
|
108
|
+
base: userConfig.base ?? (command === "build" ? base : ""),
|
|
109
|
+
publicDir: userConfig.publicDir ?? false,
|
|
110
|
+
build: {
|
|
111
|
+
manifest: ssr === true ? false : userConfig.build?.manifest ?? "manifest.json",
|
|
112
|
+
outDir: userConfig.build?.outDir ?? path.join(publicDirectory, buildDirectory),
|
|
113
|
+
rollupOptions: {
|
|
114
|
+
input: resolveInput(config, hybridlyConfig)
|
|
115
|
+
},
|
|
116
|
+
assetsInlineLimit: userConfig.build?.assetsInlineLimit ?? 0
|
|
117
|
+
},
|
|
118
|
+
server: {
|
|
119
|
+
origin: userConfig.server?.origin ?? "__laravel_vite_placeholder__",
|
|
120
|
+
...process.env.LARAVEL_SAIL ? {
|
|
121
|
+
host: userConfig.server?.host ?? "0.0.0.0",
|
|
122
|
+
port: userConfig.server?.port ?? (env.VITE_PORT ? parseInt(env.VITE_PORT) : 5173),
|
|
123
|
+
strictPort: userConfig.server?.strictPort ?? true
|
|
124
|
+
} : void 0,
|
|
125
|
+
...serverConfig ? {
|
|
126
|
+
host: userConfig.server?.host ?? serverConfig.host,
|
|
127
|
+
hmr: userConfig.server?.hmr === false ? false : {
|
|
128
|
+
...serverConfig.hmr,
|
|
129
|
+
...userConfig.server?.hmr === true ? {} : userConfig.server?.hmr
|
|
130
|
+
},
|
|
131
|
+
https: userConfig.server?.https ?? serverConfig.https
|
|
132
|
+
} : void 0
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
},
|
|
136
|
+
configResolved(config) {
|
|
137
|
+
resolvedConfig = config;
|
|
138
|
+
},
|
|
139
|
+
transform(code) {
|
|
140
|
+
if (resolvedConfig.command === "serve") {
|
|
141
|
+
return code.replace(/__laravel_vite_placeholder__/g, viteDevServerUrl);
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
configureServer(server) {
|
|
145
|
+
const envDir = resolvedConfig.envDir || process.cwd();
|
|
146
|
+
const appUrl = loadEnv(resolvedConfig.mode, envDir, "APP_URL").APP_URL ?? "undefined";
|
|
147
|
+
server.httpServer?.once("listening", () => {
|
|
148
|
+
const address = server.httpServer?.address();
|
|
149
|
+
const isAddressInfo = (x) => typeof x === "object";
|
|
150
|
+
if (isAddressInfo(address)) {
|
|
151
|
+
viteDevServerUrl = resolveDevServerUrl(address, server.config, userConfig);
|
|
152
|
+
fs.writeFileSync(hotFile, viteDevServerUrl);
|
|
153
|
+
if (!hybridlyConfig.versions) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
let registered = `${colors.bold(hybridlyConfig.components.views.length)} ${colors.dim("views")}, `;
|
|
157
|
+
registered += `${colors.bold(hybridlyConfig.components.components.length)} ${colors.dim("components")}, `;
|
|
158
|
+
registered += `${colors.bold(hybridlyConfig.components.layouts.length)} ${colors.dim("layouts")}, `;
|
|
159
|
+
registered += `${colors.bold(hybridlyConfig.components.directories.length)} ${colors.dim("directories")}`;
|
|
160
|
+
const latest = hybridlyConfig.versions.is_latest ? "" : colors.dim(`(${colors.yellow(`${hybridlyConfig.versions.latest} is available`)})`);
|
|
161
|
+
let version = `${colors.yellow(`v${hybridlyConfig.versions.composer}`)} ${colors.dim("(composer)")}, `;
|
|
162
|
+
version += `${colors.yellow(`v${hybridlyConfig.versions.npm}`)} ${colors.dim("(npm)")}`;
|
|
163
|
+
version += ` \u2014 ${colors.yellow("this may lead to undefined behavior")}`;
|
|
164
|
+
setTimeout(() => {
|
|
165
|
+
server.config.logger.info(`
|
|
166
|
+
${colors.magenta(`${colors.bold("HYBRIDLY")} v${hybridlyConfig.versions.composer}`)} ${latest}`);
|
|
167
|
+
server.config.logger.info("");
|
|
168
|
+
server.config.logger.info(` ${colors.green("\u279C")} ${colors.bold("URL")}: ${colors.cyan(hybridlyConfig.routing.url)}`);
|
|
169
|
+
server.config.logger.info(` ${colors.green("\u279C")} ${colors.bold("Registered")}: ${registered}`);
|
|
170
|
+
if (hybridlyConfig.versions.composer !== hybridlyConfig.versions.npm) {
|
|
171
|
+
server.config.logger.info(` ${colors.yellow("\u279C")} ${colors.bold("Version mismatch")}: ${version}`);
|
|
172
|
+
}
|
|
173
|
+
}, 100);
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
if (!exitHandlersBound) {
|
|
177
|
+
let clean = function() {
|
|
178
|
+
if (fs.existsSync(hotFile)) {
|
|
179
|
+
fs.rmSync(hotFile);
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
process.on("exit", clean);
|
|
183
|
+
process.on("SIGINT", () => process.exit());
|
|
184
|
+
process.on("SIGTERM", () => process.exit());
|
|
185
|
+
process.on("SIGHUP", () => process.exit());
|
|
186
|
+
exitHandlersBound = true;
|
|
187
|
+
}
|
|
188
|
+
return () => server.middlewares.use((req, res, next) => {
|
|
189
|
+
if (req.url === "/index.html") {
|
|
190
|
+
res.writeHead(302, { Location: appUrl });
|
|
191
|
+
res.end();
|
|
192
|
+
}
|
|
193
|
+
next();
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
function ensureCommandShouldRunInEnvironment(command, env) {
|
|
199
|
+
if (command === "build" || env.LARAVEL_BYPASS_ENV_CHECK === "1") {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
if (typeof env.LARAVEL_VAPOR !== "undefined") {
|
|
203
|
+
throw new TypeError("You should not run the Vite HMR server on Vapor. You should build your assets for production instead. To disable this ENV check you may set LARAVEL_BYPASS_ENV_CHECK=1");
|
|
204
|
+
}
|
|
205
|
+
if (typeof env.LARAVEL_FORGE !== "undefined") {
|
|
206
|
+
throw new TypeError("You should not run the Vite HMR server in your Forge deployment script. You should build your assets for production instead. To disable this ENV check you may set LARAVEL_BYPASS_ENV_CHECK=1");
|
|
207
|
+
}
|
|
208
|
+
if (typeof env.LARAVEL_ENVOYER !== "undefined") {
|
|
209
|
+
throw new TypeError("You should not run the Vite HMR server in your Envoyer hook. You should build your assets for production instead. To disable this ENV check you may set LARAVEL_BYPASS_ENV_CHECK=1");
|
|
210
|
+
}
|
|
211
|
+
if (typeof env.CI !== "undefined") {
|
|
212
|
+
throw new TypeError("You should not run the Vite HMR server in CI environments. You should build your assets for production instead. To disable this ENV check you may set LARAVEL_BYPASS_ENV_CHECK=1");
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
function resolveInput(userConfig, hybridlyConfig, ssr) {
|
|
216
|
+
return userConfig.build?.rollupOptions?.input ?? hybridlyConfig.architecture.application_main_path;
|
|
217
|
+
}
|
|
218
|
+
function resolveDevServerUrl(address, config, userConfig) {
|
|
219
|
+
const configHmrProtocol = typeof config.server.hmr === "object" ? config.server.hmr.protocol : null;
|
|
220
|
+
const clientProtocol = configHmrProtocol ? configHmrProtocol === "wss" ? "https" : "http" : null;
|
|
221
|
+
const serverProtocol = config.server.https ? "https" : "http";
|
|
222
|
+
const protocol = clientProtocol ?? serverProtocol;
|
|
223
|
+
const configHmrHost = typeof config.server.hmr === "object" ? config.server.hmr.host : null;
|
|
224
|
+
const configHost = typeof config.server.host === "string" ? config.server.host : null;
|
|
225
|
+
const sailHost = process.env.LARAVEL_SAIL && !userConfig.server?.host ? "localhost" : null;
|
|
226
|
+
const serverAddress = isIpv6(address) ? `[${address.address}]` : address.address;
|
|
227
|
+
const host = configHmrHost ?? sailHost ?? configHost ?? serverAddress;
|
|
228
|
+
const configHmrClientPort = typeof config.server.hmr === "object" ? config.server.hmr.clientPort : null;
|
|
229
|
+
const port = configHmrClientPort ?? address.port;
|
|
230
|
+
return `${protocol}://${host}:${port}`;
|
|
231
|
+
}
|
|
232
|
+
|
|
18
233
|
const LAYOUT_PLUGIN_NAME = "vite:hybridly:layout";
|
|
19
234
|
const CONFIG_PLUGIN_NAME = "vite:hybridly:config";
|
|
20
235
|
const CONFIG_VIRTUAL_MODULE_ID = "virtual:hybridly/config";
|
|
@@ -45,7 +260,7 @@ function generateTsConfig(options, config) {
|
|
|
45
260
|
compilerOptions: {
|
|
46
261
|
target: "esnext",
|
|
47
262
|
module: "esnext",
|
|
48
|
-
moduleResolution: "
|
|
263
|
+
moduleResolution: "bundler",
|
|
49
264
|
strict: true,
|
|
50
265
|
jsx: "preserve",
|
|
51
266
|
sourceMap: true,
|
|
@@ -71,7 +286,7 @@ function generateTsConfig(options, config) {
|
|
|
71
286
|
"./*"
|
|
72
287
|
],
|
|
73
288
|
"@/*": [
|
|
74
|
-
`./${config.architecture.
|
|
289
|
+
`./${config.architecture.root_directory}/*`
|
|
75
290
|
]
|
|
76
291
|
}
|
|
77
292
|
},
|
|
@@ -79,7 +294,7 @@ function generateTsConfig(options, config) {
|
|
|
79
294
|
...config.components.views.map(({ path: path2 }) => `../${path2}`),
|
|
80
295
|
...config.components.layouts.map(({ path: path2 }) => `../${path2}`),
|
|
81
296
|
...config.components.components.map(({ path: path2 }) => `../${path2}`),
|
|
82
|
-
`../${config.architecture.
|
|
297
|
+
`../${config.architecture.root_directory}/**/*`,
|
|
83
298
|
"../app/**/*",
|
|
84
299
|
"../src/**/*",
|
|
85
300
|
"./php-types.d.ts",
|
|
@@ -91,8 +306,6 @@ function generateTsConfig(options, config) {
|
|
|
91
306
|
],
|
|
92
307
|
exclude: [
|
|
93
308
|
"../public/**/*",
|
|
94
|
-
"../node_modules",
|
|
95
|
-
"../vendor",
|
|
96
309
|
...options.tsconfig?.exclude ?? []
|
|
97
310
|
]
|
|
98
311
|
};
|
|
@@ -171,7 +384,7 @@ async function loadConfiguration(options) {
|
|
|
171
384
|
}
|
|
172
385
|
}
|
|
173
386
|
|
|
174
|
-
function getClientCode(config) {
|
|
387
|
+
function getClientCode$1(config) {
|
|
175
388
|
const paths = config.components.views.map(({ path }) => `"~/${path}"`).join(",");
|
|
176
389
|
return `
|
|
177
390
|
import { initializeHybridly as init } from 'hybridly/vue'
|
|
@@ -197,7 +410,7 @@ const initialize = (options, config) => {
|
|
|
197
410
|
return {
|
|
198
411
|
resolve: {
|
|
199
412
|
alias: {
|
|
200
|
-
"@": path.join(process.cwd(), config.architecture.
|
|
413
|
+
"@": path.join(process.cwd(), config.architecture.root_directory),
|
|
201
414
|
"#": path.join(process.cwd(), ".hybridly"),
|
|
202
415
|
"~": path.join(process.cwd())
|
|
203
416
|
}
|
|
@@ -243,7 +456,7 @@ const initialize = (options, config) => {
|
|
|
243
456
|
},
|
|
244
457
|
async load(id) {
|
|
245
458
|
if (id === RESOLVED_CONFIG_VIRTUAL_MODULE_ID) {
|
|
246
|
-
return getClientCode(config);
|
|
459
|
+
return getClientCode$1(config);
|
|
247
460
|
}
|
|
248
461
|
},
|
|
249
462
|
// Denies HMR for `.hybridly` content, it causes unwanted reloads
|
|
@@ -262,7 +475,7 @@ function didViewsOrLayoutsChange(updatedConfig, previousConfig) {
|
|
|
262
475
|
}
|
|
263
476
|
|
|
264
477
|
const TEMPLATE_LAYOUT_REGEX = /<template +layout(?: *= *['"]((?:[\w\/\-_,:](?:,\ )?)+)['"] *)?>/;
|
|
265
|
-
const
|
|
478
|
+
const LANG_REGEX = /lang=['"](\w+)['"]/;
|
|
266
479
|
const layout = (options, config) => {
|
|
267
480
|
const defaultLayoutName = options?.layout?.defaultLayoutName?.replace(".vue", "") ?? "default";
|
|
268
481
|
const templateRegExp = options?.layout?.templateRegExp ?? TEMPLATE_LAYOUT_REGEX;
|
|
@@ -278,7 +491,7 @@ const layout = (options, config) => {
|
|
|
278
491
|
}
|
|
279
492
|
const source = new MagicString(code);
|
|
280
493
|
const updatedCode = source.replace(templateRegExp, (_, layoutName) => {
|
|
281
|
-
const
|
|
494
|
+
const [hasLang, lang] = code.match(LANG_REGEX) ?? [];
|
|
282
495
|
const layouts = layoutName?.toString()?.replaceAll(" ", "").split(",") ?? [defaultLayoutName];
|
|
283
496
|
const importName = (i) => `__hybridly_layout_${i}`;
|
|
284
497
|
const exports = layouts.map((_2, i) => importName(i));
|
|
@@ -292,7 +505,7 @@ const layout = (options, config) => {
|
|
|
292
505
|
imports
|
|
293
506
|
});
|
|
294
507
|
return `
|
|
295
|
-
<script${
|
|
508
|
+
<script${hasLang ? ` lang="${lang}"` : ""}>
|
|
296
509
|
${imports}
|
|
297
510
|
export default { layout: [${exports.join(", ")}] }
|
|
298
511
|
<\/script>
|
|
@@ -337,13 +550,6 @@ function getRunOptions(options) {
|
|
|
337
550
|
];
|
|
338
551
|
}
|
|
339
552
|
|
|
340
|
-
function getLaravelOptions(options, config) {
|
|
341
|
-
return {
|
|
342
|
-
input: `${config.architecture.root}/application/main.ts`,
|
|
343
|
-
...options.laravel ?? {}
|
|
344
|
-
};
|
|
345
|
-
}
|
|
346
|
-
|
|
347
553
|
const HybridlyImports = {
|
|
348
554
|
"hybridly/vue": [
|
|
349
555
|
"useProperty",
|
|
@@ -392,8 +598,8 @@ function getAutoImportsOptions(options, config) {
|
|
|
392
598
|
vueTemplate: true,
|
|
393
599
|
dts: ".hybridly/auto-imports.d.ts",
|
|
394
600
|
dirs: [
|
|
395
|
-
`${config.architecture.
|
|
396
|
-
`${config.architecture.
|
|
601
|
+
`${config.architecture.root_directory}/utils`,
|
|
602
|
+
`${config.architecture.root_directory}/composables`,
|
|
397
603
|
...config.components.directories.map((directory) => `${directory}/**/*.ts`)
|
|
398
604
|
],
|
|
399
605
|
imports: [
|
|
@@ -421,7 +627,7 @@ async function getVueComponentsOptions(options, config) {
|
|
|
421
627
|
return merge(
|
|
422
628
|
{
|
|
423
629
|
dirs: [
|
|
424
|
-
`./${config.architecture.
|
|
630
|
+
`./${config.architecture.root_directory}/${config.architecture.components_directory}`
|
|
425
631
|
],
|
|
426
632
|
directoryAsNamespace: true,
|
|
427
633
|
dts: ".hybridly/components.d.ts",
|
|
@@ -481,7 +687,7 @@ function getIconsOptions(options, config) {
|
|
|
481
687
|
const customIconDirectoryName = resolved?.icons ?? "icons";
|
|
482
688
|
const customCollections = Object.fromEntries(resolved?.collections?.map((collection) => [
|
|
483
689
|
collection,
|
|
484
|
-
FileSystemIconLoader(`./${config.architecture.
|
|
690
|
+
FileSystemIconLoader(`./${config.architecture.root_directory}/${customIconDirectoryName}/${collection}`)
|
|
485
691
|
]) ?? []);
|
|
486
692
|
return {
|
|
487
693
|
autoInstall: true,
|
|
@@ -544,18 +750,121 @@ function killSwitch() {
|
|
|
544
750
|
};
|
|
545
751
|
}
|
|
546
752
|
|
|
753
|
+
function getClientCode() {
|
|
754
|
+
const style = `
|
|
755
|
+
.local-build {
|
|
756
|
+
position: fixed;
|
|
757
|
+
bottom: 1rem;
|
|
758
|
+
left: 1rem;
|
|
759
|
+
z-index: 50;
|
|
760
|
+
display: inline-flex;
|
|
761
|
+
max-width: 26rem;
|
|
762
|
+
align-items: center;
|
|
763
|
+
background-color: rgba(0, 0, 0, 0.9);
|
|
764
|
+
padding: 0.75rem;
|
|
765
|
+
font-size: 0.75rem;
|
|
766
|
+
color: #8C8C8C;
|
|
767
|
+
transition: opacity 0.3s;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
.local-build:hover {
|
|
771
|
+
opacity: 0.1;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
.local-build .icon {
|
|
775
|
+
margin-right: 0.5rem;
|
|
776
|
+
height: 1.25rem;
|
|
777
|
+
width: 1.25rem;
|
|
778
|
+
fill: currentColor;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
.local-build .content {
|
|
782
|
+
display: inline-flex;
|
|
783
|
+
flex-direction: column;
|
|
784
|
+
gap: 0.5rem;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
.local-build .title {
|
|
788
|
+
font-weight: 500;
|
|
789
|
+
}
|
|
790
|
+
`;
|
|
791
|
+
const html = `
|
|
792
|
+
<div class="local-build">
|
|
793
|
+
<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" class="icon"><path fill="currentColor" d="M11 15h2v2h-2zm0-8h2v6h-2zm1-5C6.47 2 2 6.5 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2m0 18a8 8 0 0 1-8-8a8 8 0 0 1 8-8a8 8 0 0 1 8 8a8 8 0 0 1-8 8"></path></svg>
|
|
794
|
+
<span class="content">
|
|
795
|
+
<span class="title">This is a local production build. Changes will not be reflected.</span>
|
|
796
|
+
</span>
|
|
797
|
+
</div>
|
|
798
|
+
`;
|
|
799
|
+
return `
|
|
800
|
+
;(function() {
|
|
801
|
+
const style = document.createElement('style')
|
|
802
|
+
style.innerHTML = \`${style}\`
|
|
803
|
+
document.head.appendChild(style)
|
|
804
|
+
|
|
805
|
+
const html = document.createElement('div')
|
|
806
|
+
html.innerHTML = \`${html}\`
|
|
807
|
+
document.body.appendChild(html)
|
|
808
|
+
html.addEventListener('click', () => html.remove())
|
|
809
|
+
})()
|
|
810
|
+
`;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
const LOCAL_BUILD_VIRTUAL_ID = "virtual:hybridly/local-build";
|
|
814
|
+
const RESOLVED_LOCAL_BUILD_VIRTUAL_ID = `\0${LOCAL_BUILD_VIRTUAL_ID}`;
|
|
815
|
+
function warnOnLocalBuilds() {
|
|
816
|
+
let shouldDisplayWarning = false;
|
|
817
|
+
return {
|
|
818
|
+
name: "vite:hybridly:local-build",
|
|
819
|
+
enforce: "pre",
|
|
820
|
+
apply: "build",
|
|
821
|
+
config(config, { mode }) {
|
|
822
|
+
const env = loadEnv(mode, config.envDir ?? process.cwd(), "");
|
|
823
|
+
shouldDisplayWarning = env.APP_ENV === "local";
|
|
824
|
+
},
|
|
825
|
+
async resolveId(id) {
|
|
826
|
+
if (!shouldDisplayWarning) {
|
|
827
|
+
return;
|
|
828
|
+
}
|
|
829
|
+
if (id === LOCAL_BUILD_VIRTUAL_ID) {
|
|
830
|
+
return RESOLVED_LOCAL_BUILD_VIRTUAL_ID;
|
|
831
|
+
}
|
|
832
|
+
},
|
|
833
|
+
async load(id) {
|
|
834
|
+
if (!shouldDisplayWarning) {
|
|
835
|
+
return;
|
|
836
|
+
}
|
|
837
|
+
if (id === RESOLVED_LOCAL_BUILD_VIRTUAL_ID) {
|
|
838
|
+
return getClientCode();
|
|
839
|
+
}
|
|
840
|
+
},
|
|
841
|
+
transform(code, id) {
|
|
842
|
+
if (!shouldDisplayWarning) {
|
|
843
|
+
return;
|
|
844
|
+
}
|
|
845
|
+
if (!id.endsWith(CONFIG_VIRTUAL_MODULE_ID)) {
|
|
846
|
+
return;
|
|
847
|
+
}
|
|
848
|
+
code = `${code}
|
|
849
|
+
import '${LOCAL_BUILD_VIRTUAL_ID}'`;
|
|
850
|
+
return code;
|
|
851
|
+
}
|
|
852
|
+
};
|
|
853
|
+
}
|
|
854
|
+
|
|
547
855
|
async function plugin(options = {}) {
|
|
548
856
|
const config = await loadConfiguration(options);
|
|
549
857
|
return [
|
|
550
858
|
initialize(options, config),
|
|
551
859
|
layout(options, config),
|
|
552
|
-
options.laravel !== false && laravel(
|
|
860
|
+
options.laravel !== false && laravel(options, config),
|
|
553
861
|
options.run !== false && run(getRunOptions(options)),
|
|
554
862
|
options.vueComponents !== false && vueComponents(await getVueComponentsOptions(options, config)),
|
|
555
863
|
options.autoImports !== false && autoimport(getAutoImportsOptions(options, config)),
|
|
556
864
|
options.icons !== false && icons(getIconsOptions(options, config)),
|
|
557
865
|
options.vue !== false && vue(getVueOptions(options)),
|
|
558
|
-
options.killSwitch !== false && killSwitch()
|
|
866
|
+
options.killSwitch !== false && killSwitch(),
|
|
867
|
+
options.warnOnLocalBuilds !== false && warnOnLocalBuilds()
|
|
559
868
|
];
|
|
560
869
|
}
|
|
561
870
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hybridly/vite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Vite plugin for Hybridly",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hybridly",
|
|
@@ -8,10 +8,6 @@
|
|
|
8
8
|
"vite",
|
|
9
9
|
"vite-plugin"
|
|
10
10
|
],
|
|
11
|
-
"homepage": "https://github.com/hybridly/hybridly/tree/main/packages/vite#readme",
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/hybridly/hybridly/issues"
|
|
14
|
-
},
|
|
15
11
|
"license": "MIT",
|
|
16
12
|
"repository": {
|
|
17
13
|
"type": "git",
|
|
@@ -20,6 +16,11 @@
|
|
|
20
16
|
},
|
|
21
17
|
"funding": "https://github.com/sponsors/innocenzi",
|
|
22
18
|
"author": "Enzo Innocenzi <enzo@innocenzi.dev>",
|
|
19
|
+
"type": "module",
|
|
20
|
+
"homepage": "https://github.com/hybridly/hybridly/tree/main/packages/vite#readme",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/hybridly/hybridly/issues"
|
|
23
|
+
},
|
|
23
24
|
"sideEffects": false,
|
|
24
25
|
"files": [
|
|
25
26
|
"dist",
|
|
@@ -36,27 +37,27 @@
|
|
|
36
37
|
"module": "dist/index.mjs",
|
|
37
38
|
"types": "dist/index.d.ts",
|
|
38
39
|
"peerDependencies": {
|
|
39
|
-
"vite": "^
|
|
40
|
+
"vite": "^5.0.8",
|
|
40
41
|
"vue": "^3.2.45"
|
|
41
42
|
},
|
|
42
43
|
"dependencies": {
|
|
43
|
-
"@vitejs/plugin-vue": "^4.
|
|
44
|
-
"fast-glob": "^3.3.
|
|
45
|
-
"
|
|
46
|
-
"local-pkg": "^0.4.3",
|
|
44
|
+
"@vitejs/plugin-vue": "^4.6.2",
|
|
45
|
+
"fast-glob": "^3.3.2",
|
|
46
|
+
"local-pkg": "^0.5.0",
|
|
47
47
|
"magic-string": "^0.30.5",
|
|
48
|
+
"picocolors": "^1.0.0",
|
|
48
49
|
"throttle-debounce": "^5.0.0",
|
|
49
|
-
"unplugin-auto-import": "^0.
|
|
50
|
-
"unplugin-icons": "^0.
|
|
51
|
-
"unplugin-vue-components": "^0.
|
|
50
|
+
"unplugin-auto-import": "^0.17.3",
|
|
51
|
+
"unplugin-icons": "^0.18.1",
|
|
52
|
+
"unplugin-vue-components": "^0.26.0",
|
|
52
53
|
"vite-plugin-run": "^0.5.1",
|
|
53
|
-
"@hybridly/core": "0.
|
|
54
|
+
"@hybridly/core": "0.6.1"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
|
-
"@iconify/json": "^2.2.
|
|
57
|
-
"rollup": "^
|
|
58
|
-
"vite": "^
|
|
59
|
-
"vue": "^3.3
|
|
57
|
+
"@iconify/json": "^2.2.163",
|
|
58
|
+
"rollup": "^4.9.2",
|
|
59
|
+
"vite": "^5.0.10",
|
|
60
|
+
"vue": "^3.4.3"
|
|
60
61
|
},
|
|
61
62
|
"scripts": {
|
|
62
63
|
"build": "unbuild",
|