@hybridly/vite 0.7.7 → 0.7.9
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 +62 -16
- package/dist/index.mjs +62 -16
- package/package.json +28 -29
package/dist/index.cjs
CHANGED
|
@@ -8,10 +8,10 @@ const colors = require('picocolors');
|
|
|
8
8
|
const vite = require('vite');
|
|
9
9
|
require('node:url');
|
|
10
10
|
const os = require('node:os');
|
|
11
|
-
const makeDebugger = require('debug');
|
|
12
|
-
const localPkg = require('local-pkg');
|
|
13
11
|
const node_child_process = require('node:child_process');
|
|
14
12
|
const node_util = require('node:util');
|
|
13
|
+
const makeDebugger = require('debug');
|
|
14
|
+
const localPkg = require('local-pkg');
|
|
15
15
|
const MagicString = require('magic-string');
|
|
16
16
|
const run = require('vite-plugin-run');
|
|
17
17
|
const utils = require('@hybridly/utils');
|
|
@@ -38,6 +38,41 @@ const iconsResolver__default = /*#__PURE__*/_interopDefaultCompat(iconsResolver)
|
|
|
38
38
|
const icons__default = /*#__PURE__*/_interopDefaultCompat(icons);
|
|
39
39
|
const vue__default = /*#__PURE__*/_interopDefaultCompat(vue);
|
|
40
40
|
|
|
41
|
+
let phpExecutable;
|
|
42
|
+
let devEnvironment;
|
|
43
|
+
function getEnv() {
|
|
44
|
+
return { ...process.env, ...vite.loadEnv("mock", process.cwd(), "") };
|
|
45
|
+
}
|
|
46
|
+
async function getPhpExecutable() {
|
|
47
|
+
if (phpExecutable) {
|
|
48
|
+
return phpExecutable;
|
|
49
|
+
}
|
|
50
|
+
const env = getEnv();
|
|
51
|
+
const php = (env.PHP_EXECUTABLE_PATH ?? "php").split(" ");
|
|
52
|
+
if (!env.PHP_EXECUTABLE_PATH) {
|
|
53
|
+
const devEnvironment2 = await determineDevEnvironment();
|
|
54
|
+
if (devEnvironment2 === "ddev") {
|
|
55
|
+
php.unshift("ddev");
|
|
56
|
+
} else if (devEnvironment2 === "lando") {
|
|
57
|
+
php.unshift("lando");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return phpExecutable = php;
|
|
61
|
+
}
|
|
62
|
+
async function determineDevEnvironment() {
|
|
63
|
+
if (devEnvironment) {
|
|
64
|
+
return devEnvironment;
|
|
65
|
+
}
|
|
66
|
+
if (fs__default.existsSync(`${process.cwd()}/.ddev`)) {
|
|
67
|
+
devEnvironment = "ddev";
|
|
68
|
+
} else if (fs__default.existsSync(`${process.cwd()}/.lando.yml`)) {
|
|
69
|
+
devEnvironment = "lando";
|
|
70
|
+
} else {
|
|
71
|
+
devEnvironment = "native";
|
|
72
|
+
}
|
|
73
|
+
return devEnvironment;
|
|
74
|
+
}
|
|
75
|
+
|
|
41
76
|
function isIpv6(address) {
|
|
42
77
|
return address.family === "IPv6" || address.family === 6;
|
|
43
78
|
}
|
|
@@ -139,7 +174,7 @@ function laravel(options, hybridlyConfig) {
|
|
|
139
174
|
origin: userConfig.server?.origin ?? "__laravel_vite_placeholder__",
|
|
140
175
|
...process.env.LARAVEL_SAIL ? {
|
|
141
176
|
host: userConfig.server?.host ?? "0.0.0.0",
|
|
142
|
-
port: userConfig.server?.port ?? (env.VITE_PORT ? parseInt(env.VITE_PORT) : 5173),
|
|
177
|
+
port: userConfig.server?.port ?? (env.VITE_PORT ? Number.parseInt(env.VITE_PORT) : 5173),
|
|
143
178
|
strictPort: userConfig.server?.strictPort ?? true
|
|
144
179
|
} : void 0,
|
|
145
180
|
...serverConfig ? {
|
|
@@ -164,12 +199,12 @@ function laravel(options, hybridlyConfig) {
|
|
|
164
199
|
configureServer(server) {
|
|
165
200
|
const envDir = resolvedConfig.envDir || process.cwd();
|
|
166
201
|
const appUrl = vite.loadEnv(resolvedConfig.mode, envDir, "APP_URL").APP_URL ?? "undefined";
|
|
167
|
-
server.httpServer?.once("listening", () => {
|
|
202
|
+
server.httpServer?.once("listening", async () => {
|
|
168
203
|
const address = server.httpServer?.address();
|
|
169
204
|
const isAddressInfo = (x) => typeof x === "object";
|
|
170
205
|
if (isAddressInfo(address)) {
|
|
171
206
|
viteDevServerUrl = resolveDevServerUrl(address, server.config, userConfig);
|
|
172
|
-
fs__default.writeFileSync(hotFile, viteDevServerUrl);
|
|
207
|
+
fs__default.writeFileSync(hotFile, `${viteDevServerUrl}${server.config.base.replace(/\/$/, "")}`);
|
|
173
208
|
if (!hybridlyConfig.versions) {
|
|
174
209
|
return;
|
|
175
210
|
}
|
|
@@ -181,12 +216,16 @@ function laravel(options, hybridlyConfig) {
|
|
|
181
216
|
let version = `${colors__default.yellow(`v${hybridlyConfig.versions.composer}`)} ${colors__default.dim("(composer)")}, `;
|
|
182
217
|
version += `${colors__default.yellow(`v${hybridlyConfig.versions.npm}`)} ${colors__default.dim("(npm)")}`;
|
|
183
218
|
version += ` \u2014 ${colors__default.yellow("this may lead to undefined behavior")}`;
|
|
219
|
+
const devEnvironment = await determineDevEnvironment();
|
|
184
220
|
setTimeout(() => {
|
|
185
221
|
server.config.logger.info(`
|
|
186
222
|
${colors__default.magenta(`${colors__default.bold("HYBRIDLY")} v${hybridlyConfig.versions.composer}`)} ${latest}`);
|
|
187
223
|
server.config.logger.info("");
|
|
188
224
|
server.config.logger.info(` ${colors__default.green("\u279C")} ${colors__default.bold("URL")}: ${colors__default.cyan(hybridlyConfig.routing.url)}`);
|
|
189
225
|
server.config.logger.info(` ${colors__default.green("\u279C")} ${colors__default.bold("Registered")}: ${registered}`);
|
|
226
|
+
if (devEnvironment !== "native") {
|
|
227
|
+
server.config.logger.info(` ${colors__default.green("\u279C")} ${colors__default.bold("Development environment")}: ${colors__default.cyan(devEnvironment)}`);
|
|
228
|
+
}
|
|
190
229
|
if (hybridlyConfig.versions.composer !== hybridlyConfig.versions.npm) {
|
|
191
230
|
server.config.logger.info(` ${colors__default.yellow("\u279C")} ${colors__default.bold("Version mismatch")}: ${version}`);
|
|
192
231
|
}
|
|
@@ -232,7 +271,7 @@ function ensureCommandShouldRunInEnvironment(command, env) {
|
|
|
232
271
|
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");
|
|
233
272
|
}
|
|
234
273
|
}
|
|
235
|
-
function resolveInput(userConfig, hybridlyConfig,
|
|
274
|
+
function resolveInput(userConfig, hybridlyConfig, _ssr) {
|
|
236
275
|
return userConfig.build?.rollupOptions?.input ?? hybridlyConfig.architecture.application_main_path;
|
|
237
276
|
}
|
|
238
277
|
function resolveDevServerUrl(address, config, userConfig) {
|
|
@@ -255,6 +294,7 @@ const CONFIG_PLUGIN_NAME = "vite:hybridly:config";
|
|
|
255
294
|
const CONFIG_VIRTUAL_MODULE_ID = "virtual:hybridly/config";
|
|
256
295
|
const RESOLVED_CONFIG_VIRTUAL_MODULE_ID = `\0${CONFIG_VIRTUAL_MODULE_ID}`;
|
|
257
296
|
|
|
297
|
+
const execSync = node_util.promisify(node_child_process.exec);
|
|
258
298
|
const debug = {
|
|
259
299
|
config: makeDebugger__default(CONFIG_PLUGIN_NAME),
|
|
260
300
|
layout: makeDebugger__default(LAYOUT_PLUGIN_NAME)
|
|
@@ -403,15 +443,21 @@ function write(data, filename) {
|
|
|
403
443
|
});
|
|
404
444
|
}
|
|
405
445
|
|
|
406
|
-
const execSync = node_util.promisify(node_child_process.exec);
|
|
407
446
|
async function loadConfiguration() {
|
|
408
447
|
try {
|
|
409
|
-
const
|
|
410
|
-
const php = env.PHP_EXECUTABLE_PATH ?? "php";
|
|
448
|
+
const php = (await getPhpExecutable()).join(" ");
|
|
411
449
|
const { stdout } = await execSync(`${php} artisan hybridly:config`);
|
|
412
450
|
return JSON.parse(stdout);
|
|
413
451
|
} catch (e) {
|
|
414
|
-
console.error("Could not load configuration from [php artisan].");
|
|
452
|
+
console.error("Could not load configuration from [php artisan hybridly:config].");
|
|
453
|
+
if (e.stdout) {
|
|
454
|
+
console.error(e.stdout);
|
|
455
|
+
}
|
|
456
|
+
if (await determineDevEnvironment() === "ddev") {
|
|
457
|
+
console.error("This is possibly caused by not starting ddev first.");
|
|
458
|
+
} else if (await determineDevEnvironment() === "lando") {
|
|
459
|
+
console.error("This is possibly caused by not starting lando first.");
|
|
460
|
+
}
|
|
415
461
|
throw e;
|
|
416
462
|
}
|
|
417
463
|
}
|
|
@@ -474,7 +520,7 @@ const initialize = (options, config) => {
|
|
|
474
520
|
if (didViewsOrLayoutsChange(updatedConfig, config)) {
|
|
475
521
|
forceRestart("View or layout changed");
|
|
476
522
|
}
|
|
477
|
-
});
|
|
523
|
+
}).catch();
|
|
478
524
|
}
|
|
479
525
|
}
|
|
480
526
|
server.watcher.on("add", handleFileChange);
|
|
@@ -559,15 +605,15 @@ function resolveLayoutImportPath(name, config) {
|
|
|
559
605
|
return `~/${path}`;
|
|
560
606
|
}
|
|
561
607
|
|
|
562
|
-
function getRunOptions(options) {
|
|
608
|
+
async function getRunOptions(options) {
|
|
563
609
|
if (options.run === false) {
|
|
564
610
|
return [];
|
|
565
611
|
}
|
|
566
|
-
const php =
|
|
612
|
+
const php = await getPhpExecutable();
|
|
567
613
|
return [
|
|
568
614
|
{
|
|
569
615
|
name: "Generate TypeScript types",
|
|
570
|
-
run: [php, "artisan", "hybridly:types", options.allowTypeGenerationFailures !== false ? "--allow-failures" : ""].filter(Boolean),
|
|
616
|
+
run: [...php, "artisan", "hybridly:types", options.allowTypeGenerationFailures !== false ? "--allow-failures" : ""].filter(Boolean),
|
|
571
617
|
pattern: [
|
|
572
618
|
"+(app|src)/**/*Data.php",
|
|
573
619
|
"+(app|src)/**/Enums/*.php",
|
|
@@ -576,7 +622,7 @@ function getRunOptions(options) {
|
|
|
576
622
|
},
|
|
577
623
|
{
|
|
578
624
|
name: "Generate i18n",
|
|
579
|
-
run: [php, "artisan", "hybridly:i18n"],
|
|
625
|
+
run: [...php, "artisan", "hybridly:i18n"],
|
|
580
626
|
pattern: "lang/**/*.php"
|
|
581
627
|
},
|
|
582
628
|
...options.run ?? []
|
|
@@ -900,7 +946,7 @@ async function plugin(options = {}) {
|
|
|
900
946
|
initialize(resolvedOptions, config),
|
|
901
947
|
layout(resolvedOptions, config),
|
|
902
948
|
resolvedOptions.laravel !== false && laravel(resolvedOptions, config),
|
|
903
|
-
resolvedOptions.run !== false && run__default(getRunOptions(resolvedOptions)),
|
|
949
|
+
resolvedOptions.run !== false && run__default(await getRunOptions(resolvedOptions)),
|
|
904
950
|
resolvedOptions.vueComponents !== false && vueComponents__default(await getVueComponentsOptions(resolvedOptions, config)),
|
|
905
951
|
resolvedOptions.autoImports !== false && autoimport__default(getAutoImportsOptions(resolvedOptions, config)),
|
|
906
952
|
resolvedOptions.icons !== false && icons__default(getIconsOptions(resolvedOptions, config)),
|
package/dist/index.mjs
CHANGED
|
@@ -4,10 +4,10 @@ import colors from 'picocolors';
|
|
|
4
4
|
import { loadEnv } from 'vite';
|
|
5
5
|
import 'node:url';
|
|
6
6
|
import os from 'node:os';
|
|
7
|
-
import makeDebugger from 'debug';
|
|
8
|
-
import { isPackageExists, resolveModule, importModule } from 'local-pkg';
|
|
9
7
|
import { exec } from 'node:child_process';
|
|
10
8
|
import { promisify } from 'node:util';
|
|
9
|
+
import makeDebugger from 'debug';
|
|
10
|
+
import { isPackageExists, resolveModule, importModule } from 'local-pkg';
|
|
11
11
|
import MagicString from 'magic-string';
|
|
12
12
|
import run from 'vite-plugin-run';
|
|
13
13
|
import { merge } from '@hybridly/utils';
|
|
@@ -19,6 +19,41 @@ import icons from 'unplugin-icons/vite';
|
|
|
19
19
|
import { FileSystemIconLoader } from 'unplugin-icons/loaders';
|
|
20
20
|
import vue from '@vitejs/plugin-vue';
|
|
21
21
|
|
|
22
|
+
let phpExecutable;
|
|
23
|
+
let devEnvironment;
|
|
24
|
+
function getEnv() {
|
|
25
|
+
return { ...process.env, ...loadEnv("mock", process.cwd(), "") };
|
|
26
|
+
}
|
|
27
|
+
async function getPhpExecutable() {
|
|
28
|
+
if (phpExecutable) {
|
|
29
|
+
return phpExecutable;
|
|
30
|
+
}
|
|
31
|
+
const env = getEnv();
|
|
32
|
+
const php = (env.PHP_EXECUTABLE_PATH ?? "php").split(" ");
|
|
33
|
+
if (!env.PHP_EXECUTABLE_PATH) {
|
|
34
|
+
const devEnvironment2 = await determineDevEnvironment();
|
|
35
|
+
if (devEnvironment2 === "ddev") {
|
|
36
|
+
php.unshift("ddev");
|
|
37
|
+
} else if (devEnvironment2 === "lando") {
|
|
38
|
+
php.unshift("lando");
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return phpExecutable = php;
|
|
42
|
+
}
|
|
43
|
+
async function determineDevEnvironment() {
|
|
44
|
+
if (devEnvironment) {
|
|
45
|
+
return devEnvironment;
|
|
46
|
+
}
|
|
47
|
+
if (fs.existsSync(`${process.cwd()}/.ddev`)) {
|
|
48
|
+
devEnvironment = "ddev";
|
|
49
|
+
} else if (fs.existsSync(`${process.cwd()}/.lando.yml`)) {
|
|
50
|
+
devEnvironment = "lando";
|
|
51
|
+
} else {
|
|
52
|
+
devEnvironment = "native";
|
|
53
|
+
}
|
|
54
|
+
return devEnvironment;
|
|
55
|
+
}
|
|
56
|
+
|
|
22
57
|
function isIpv6(address) {
|
|
23
58
|
return address.family === "IPv6" || address.family === 6;
|
|
24
59
|
}
|
|
@@ -120,7 +155,7 @@ function laravel(options, hybridlyConfig) {
|
|
|
120
155
|
origin: userConfig.server?.origin ?? "__laravel_vite_placeholder__",
|
|
121
156
|
...process.env.LARAVEL_SAIL ? {
|
|
122
157
|
host: userConfig.server?.host ?? "0.0.0.0",
|
|
123
|
-
port: userConfig.server?.port ?? (env.VITE_PORT ? parseInt(env.VITE_PORT) : 5173),
|
|
158
|
+
port: userConfig.server?.port ?? (env.VITE_PORT ? Number.parseInt(env.VITE_PORT) : 5173),
|
|
124
159
|
strictPort: userConfig.server?.strictPort ?? true
|
|
125
160
|
} : void 0,
|
|
126
161
|
...serverConfig ? {
|
|
@@ -145,12 +180,12 @@ function laravel(options, hybridlyConfig) {
|
|
|
145
180
|
configureServer(server) {
|
|
146
181
|
const envDir = resolvedConfig.envDir || process.cwd();
|
|
147
182
|
const appUrl = loadEnv(resolvedConfig.mode, envDir, "APP_URL").APP_URL ?? "undefined";
|
|
148
|
-
server.httpServer?.once("listening", () => {
|
|
183
|
+
server.httpServer?.once("listening", async () => {
|
|
149
184
|
const address = server.httpServer?.address();
|
|
150
185
|
const isAddressInfo = (x) => typeof x === "object";
|
|
151
186
|
if (isAddressInfo(address)) {
|
|
152
187
|
viteDevServerUrl = resolveDevServerUrl(address, server.config, userConfig);
|
|
153
|
-
fs.writeFileSync(hotFile, viteDevServerUrl);
|
|
188
|
+
fs.writeFileSync(hotFile, `${viteDevServerUrl}${server.config.base.replace(/\/$/, "")}`);
|
|
154
189
|
if (!hybridlyConfig.versions) {
|
|
155
190
|
return;
|
|
156
191
|
}
|
|
@@ -162,12 +197,16 @@ function laravel(options, hybridlyConfig) {
|
|
|
162
197
|
let version = `${colors.yellow(`v${hybridlyConfig.versions.composer}`)} ${colors.dim("(composer)")}, `;
|
|
163
198
|
version += `${colors.yellow(`v${hybridlyConfig.versions.npm}`)} ${colors.dim("(npm)")}`;
|
|
164
199
|
version += ` \u2014 ${colors.yellow("this may lead to undefined behavior")}`;
|
|
200
|
+
const devEnvironment = await determineDevEnvironment();
|
|
165
201
|
setTimeout(() => {
|
|
166
202
|
server.config.logger.info(`
|
|
167
203
|
${colors.magenta(`${colors.bold("HYBRIDLY")} v${hybridlyConfig.versions.composer}`)} ${latest}`);
|
|
168
204
|
server.config.logger.info("");
|
|
169
205
|
server.config.logger.info(` ${colors.green("\u279C")} ${colors.bold("URL")}: ${colors.cyan(hybridlyConfig.routing.url)}`);
|
|
170
206
|
server.config.logger.info(` ${colors.green("\u279C")} ${colors.bold("Registered")}: ${registered}`);
|
|
207
|
+
if (devEnvironment !== "native") {
|
|
208
|
+
server.config.logger.info(` ${colors.green("\u279C")} ${colors.bold("Development environment")}: ${colors.cyan(devEnvironment)}`);
|
|
209
|
+
}
|
|
171
210
|
if (hybridlyConfig.versions.composer !== hybridlyConfig.versions.npm) {
|
|
172
211
|
server.config.logger.info(` ${colors.yellow("\u279C")} ${colors.bold("Version mismatch")}: ${version}`);
|
|
173
212
|
}
|
|
@@ -213,7 +252,7 @@ function ensureCommandShouldRunInEnvironment(command, env) {
|
|
|
213
252
|
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");
|
|
214
253
|
}
|
|
215
254
|
}
|
|
216
|
-
function resolveInput(userConfig, hybridlyConfig,
|
|
255
|
+
function resolveInput(userConfig, hybridlyConfig, _ssr) {
|
|
217
256
|
return userConfig.build?.rollupOptions?.input ?? hybridlyConfig.architecture.application_main_path;
|
|
218
257
|
}
|
|
219
258
|
function resolveDevServerUrl(address, config, userConfig) {
|
|
@@ -236,6 +275,7 @@ const CONFIG_PLUGIN_NAME = "vite:hybridly:config";
|
|
|
236
275
|
const CONFIG_VIRTUAL_MODULE_ID = "virtual:hybridly/config";
|
|
237
276
|
const RESOLVED_CONFIG_VIRTUAL_MODULE_ID = `\0${CONFIG_VIRTUAL_MODULE_ID}`;
|
|
238
277
|
|
|
278
|
+
const execSync = promisify(exec);
|
|
239
279
|
const debug = {
|
|
240
280
|
config: makeDebugger(CONFIG_PLUGIN_NAME),
|
|
241
281
|
layout: makeDebugger(LAYOUT_PLUGIN_NAME)
|
|
@@ -384,15 +424,21 @@ function write(data, filename) {
|
|
|
384
424
|
});
|
|
385
425
|
}
|
|
386
426
|
|
|
387
|
-
const execSync = promisify(exec);
|
|
388
427
|
async function loadConfiguration() {
|
|
389
428
|
try {
|
|
390
|
-
const
|
|
391
|
-
const php = env.PHP_EXECUTABLE_PATH ?? "php";
|
|
429
|
+
const php = (await getPhpExecutable()).join(" ");
|
|
392
430
|
const { stdout } = await execSync(`${php} artisan hybridly:config`);
|
|
393
431
|
return JSON.parse(stdout);
|
|
394
432
|
} catch (e) {
|
|
395
|
-
console.error("Could not load configuration from [php artisan].");
|
|
433
|
+
console.error("Could not load configuration from [php artisan hybridly:config].");
|
|
434
|
+
if (e.stdout) {
|
|
435
|
+
console.error(e.stdout);
|
|
436
|
+
}
|
|
437
|
+
if (await determineDevEnvironment() === "ddev") {
|
|
438
|
+
console.error("This is possibly caused by not starting ddev first.");
|
|
439
|
+
} else if (await determineDevEnvironment() === "lando") {
|
|
440
|
+
console.error("This is possibly caused by not starting lando first.");
|
|
441
|
+
}
|
|
396
442
|
throw e;
|
|
397
443
|
}
|
|
398
444
|
}
|
|
@@ -455,7 +501,7 @@ const initialize = (options, config) => {
|
|
|
455
501
|
if (didViewsOrLayoutsChange(updatedConfig, config)) {
|
|
456
502
|
forceRestart("View or layout changed");
|
|
457
503
|
}
|
|
458
|
-
});
|
|
504
|
+
}).catch();
|
|
459
505
|
}
|
|
460
506
|
}
|
|
461
507
|
server.watcher.on("add", handleFileChange);
|
|
@@ -540,15 +586,15 @@ function resolveLayoutImportPath(name, config) {
|
|
|
540
586
|
return `~/${path}`;
|
|
541
587
|
}
|
|
542
588
|
|
|
543
|
-
function getRunOptions(options) {
|
|
589
|
+
async function getRunOptions(options) {
|
|
544
590
|
if (options.run === false) {
|
|
545
591
|
return [];
|
|
546
592
|
}
|
|
547
|
-
const php =
|
|
593
|
+
const php = await getPhpExecutable();
|
|
548
594
|
return [
|
|
549
595
|
{
|
|
550
596
|
name: "Generate TypeScript types",
|
|
551
|
-
run: [php, "artisan", "hybridly:types", options.allowTypeGenerationFailures !== false ? "--allow-failures" : ""].filter(Boolean),
|
|
597
|
+
run: [...php, "artisan", "hybridly:types", options.allowTypeGenerationFailures !== false ? "--allow-failures" : ""].filter(Boolean),
|
|
552
598
|
pattern: [
|
|
553
599
|
"+(app|src)/**/*Data.php",
|
|
554
600
|
"+(app|src)/**/Enums/*.php",
|
|
@@ -557,7 +603,7 @@ function getRunOptions(options) {
|
|
|
557
603
|
},
|
|
558
604
|
{
|
|
559
605
|
name: "Generate i18n",
|
|
560
|
-
run: [php, "artisan", "hybridly:i18n"],
|
|
606
|
+
run: [...php, "artisan", "hybridly:i18n"],
|
|
561
607
|
pattern: "lang/**/*.php"
|
|
562
608
|
},
|
|
563
609
|
...options.run ?? []
|
|
@@ -881,7 +927,7 @@ async function plugin(options = {}) {
|
|
|
881
927
|
initialize(resolvedOptions, config),
|
|
882
928
|
layout(resolvedOptions, config),
|
|
883
929
|
resolvedOptions.laravel !== false && laravel(resolvedOptions, config),
|
|
884
|
-
resolvedOptions.run !== false && run(getRunOptions(resolvedOptions)),
|
|
930
|
+
resolvedOptions.run !== false && run(await getRunOptions(resolvedOptions)),
|
|
885
931
|
resolvedOptions.vueComponents !== false && vueComponents(await getVueComponentsOptions(resolvedOptions, config)),
|
|
886
932
|
resolvedOptions.autoImports !== false && autoimport(getAutoImportsOptions(resolvedOptions, config)),
|
|
887
933
|
resolvedOptions.icons !== false && icons(getIconsOptions(resolvedOptions, config)),
|
package/package.json
CHANGED
|
@@ -1,67 +1,66 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hybridly/vite",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.7.9",
|
|
4
5
|
"description": "Vite plugin for Hybridly",
|
|
5
|
-
"
|
|
6
|
-
"hybridly",
|
|
7
|
-
"inertiajs",
|
|
8
|
-
"vite",
|
|
9
|
-
"vite-plugin"
|
|
10
|
-
],
|
|
6
|
+
"author": "Enzo Innocenzi <enzo@innocenzi.dev>",
|
|
11
7
|
"license": "MIT",
|
|
8
|
+
"funding": "https://github.com/sponsors/innocenzi",
|
|
9
|
+
"homepage": "https://github.com/hybridly/hybridly/tree/main/packages/vite#readme",
|
|
12
10
|
"repository": {
|
|
13
11
|
"type": "git",
|
|
14
12
|
"url": "git+https://github.com/hybridly/hybridly.git",
|
|
15
13
|
"directory": "packages/vite"
|
|
16
14
|
},
|
|
17
|
-
"funding": "https://github.com/sponsors/innocenzi",
|
|
18
|
-
"author": "Enzo Innocenzi <enzo@innocenzi.dev>",
|
|
19
|
-
"type": "module",
|
|
20
|
-
"homepage": "https://github.com/hybridly/hybridly/tree/main/packages/vite#readme",
|
|
21
15
|
"bugs": {
|
|
22
16
|
"url": "https://github.com/hybridly/hybridly/issues"
|
|
23
17
|
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"hybridly",
|
|
20
|
+
"inertiajs",
|
|
21
|
+
"vite",
|
|
22
|
+
"vite-plugin"
|
|
23
|
+
],
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"provenance": true,
|
|
26
26
|
"access": "public"
|
|
27
27
|
},
|
|
28
28
|
"sideEffects": false,
|
|
29
|
-
"files": [
|
|
30
|
-
"dist",
|
|
31
|
-
"*.d.ts"
|
|
32
|
-
],
|
|
33
29
|
"exports": {
|
|
34
30
|
".": {
|
|
35
|
-
"
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
36
32
|
"import": "./dist/index.mjs",
|
|
37
|
-
"
|
|
33
|
+
"require": "./dist/index.cjs"
|
|
38
34
|
}
|
|
39
35
|
},
|
|
40
36
|
"main": "dist/index.cjs",
|
|
41
37
|
"module": "dist/index.mjs",
|
|
42
38
|
"types": "dist/index.d.ts",
|
|
39
|
+
"files": [
|
|
40
|
+
"*.d.ts",
|
|
41
|
+
"dist"
|
|
42
|
+
],
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"vite": "^5.0.8",
|
|
45
45
|
"vue": "^3.2.45"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@vitejs/plugin-vue": "^5.0.
|
|
48
|
+
"@vitejs/plugin-vue": "^5.0.5",
|
|
49
49
|
"fast-glob": "^3.3.2",
|
|
50
50
|
"local-pkg": "^0.5.0",
|
|
51
51
|
"magic-string": "^0.30.10",
|
|
52
|
-
"picocolors": "^1.0.
|
|
53
|
-
"
|
|
54
|
-
"unplugin-
|
|
55
|
-
"unplugin-
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"@hybridly/core": "0.7.7"
|
|
52
|
+
"picocolors": "^1.0.1",
|
|
53
|
+
"unplugin-auto-import": "^0.17.6",
|
|
54
|
+
"unplugin-icons": "^0.19.0",
|
|
55
|
+
"unplugin-vue-components": "^0.27.2",
|
|
56
|
+
"vite-plugin-run": "^0.5.2",
|
|
57
|
+
"@hybridly/core": "0.7.9"
|
|
59
58
|
},
|
|
60
59
|
"devDependencies": {
|
|
61
|
-
"@iconify/json": "^2.2.
|
|
62
|
-
"rollup": "^4.
|
|
63
|
-
"vite": "^5.2
|
|
64
|
-
"vue": "^3.4.
|
|
60
|
+
"@iconify/json": "^2.2.223",
|
|
61
|
+
"rollup": "^4.18.0",
|
|
62
|
+
"vite": "^5.3.2",
|
|
63
|
+
"vue": "^3.4.31"
|
|
65
64
|
},
|
|
66
65
|
"scripts": {
|
|
67
66
|
"build": "unbuild",
|