@hybridly/vite 0.10.0-beta.1 → 0.10.0-beta.3
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/_chunks/libs/lodash.clonedeep.mjs +4 -4
- package/dist/index.mjs +22 -33
- package/package.json +2 -2
|
@@ -660,12 +660,12 @@ var require_lodash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
660
660
|
if (stacked) return stacked;
|
|
661
661
|
stack.set(value, result);
|
|
662
662
|
if (!isArr) var props = isFull ? getAllKeys(value) : keys(value);
|
|
663
|
-
arrayEach(props || value, function(subValue, key
|
|
663
|
+
arrayEach(props || value, function(subValue, key) {
|
|
664
664
|
if (props) {
|
|
665
|
-
key
|
|
666
|
-
subValue = value[key
|
|
665
|
+
key = subValue;
|
|
666
|
+
subValue = value[key];
|
|
667
667
|
}
|
|
668
|
-
assignValue(result, key
|
|
668
|
+
assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
|
|
669
669
|
});
|
|
670
670
|
return result;
|
|
671
671
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -33,9 +33,9 @@ async function getPhpExecutable() {
|
|
|
33
33
|
const env = getEnv();
|
|
34
34
|
const php = (env.PHP_EXECUTABLE_PATH ?? "php").split(" ");
|
|
35
35
|
if (!env.PHP_EXECUTABLE_PATH) {
|
|
36
|
-
const devEnvironment
|
|
37
|
-
if (devEnvironment
|
|
38
|
-
else if (devEnvironment
|
|
36
|
+
const devEnvironment = await determineDevEnvironment();
|
|
37
|
+
if (devEnvironment === "ddev") php.unshift("ddev");
|
|
38
|
+
else if (devEnvironment === "lando") php.unshift("lando");
|
|
39
39
|
}
|
|
40
40
|
return phpExecutable = php;
|
|
41
41
|
}
|
|
@@ -194,13 +194,13 @@ function laravel(options, hybridlyConfig) {
|
|
|
194
194
|
let version = `${colors.yellow(`v${hybridlyConfig.versions.composer}`)} ${colors.dim("(composer)")}, `;
|
|
195
195
|
version += `${colors.yellow(`v${hybridlyConfig.versions.npm}`)} ${colors.dim("(npm)")}`;
|
|
196
196
|
version += ` — ${colors.yellow("this may lead to undefined behavior")}`;
|
|
197
|
-
const devEnvironment
|
|
197
|
+
const devEnvironment = await determineDevEnvironment();
|
|
198
198
|
setTimeout(() => {
|
|
199
199
|
server.config.logger.info(`\n ${colors.magenta(`${colors.bold("HYBRIDLY")} v${hybridlyConfig.versions.composer}`)} ${latest}`);
|
|
200
200
|
server.config.logger.info("");
|
|
201
201
|
server.config.logger.info(` ${colors.green("➜")} ${colors.bold("URL")}: ${colors.cyan(hybridlyConfig.routing.url)}`);
|
|
202
202
|
server.config.logger.info(` ${colors.green("➜")} ${colors.bold("Registered")}: ${registered}`);
|
|
203
|
-
if (devEnvironment
|
|
203
|
+
if (devEnvironment !== "native") server.config.logger.info(` ${colors.green("➜")} ${colors.bold("Development environment")}: ${colors.cyan(devEnvironment)}`);
|
|
204
204
|
if (hybridlyConfig.versions.composer !== hybridlyConfig.versions.npm) server.config.logger.info(` ${colors.yellow("➜")} ${colors.bold("Version mismatch")}: ${version}`);
|
|
205
205
|
}, 100);
|
|
206
206
|
}
|
|
@@ -267,7 +267,7 @@ const RESOLVED_CONFIG_VIRTUAL_MODULE_ID = `\0${CONFIG_VIRTUAL_MODULE_ID}`;
|
|
|
267
267
|
//#region src/utils.ts
|
|
268
268
|
var import_src = /* @__PURE__ */ __toESM(require_src(), 1);
|
|
269
269
|
const execSync = promisify(exec);
|
|
270
|
-
const debug
|
|
270
|
+
const debug = {
|
|
271
271
|
config: (0, import_src.default)(CONFIG_PLUGIN_NAME),
|
|
272
272
|
layout: (0, import_src.default)(LAYOUT_PLUGIN_NAME)
|
|
273
273
|
};
|
|
@@ -301,8 +301,8 @@ function generateTsConfig(options, config) {
|
|
|
301
301
|
}
|
|
302
302
|
},
|
|
303
303
|
include: [
|
|
304
|
-
...config.components.views.map(({ path
|
|
305
|
-
...config.components.layouts.map(({ path
|
|
304
|
+
...config.components.views.map(({ path }) => `../${path}`),
|
|
305
|
+
...config.components.layouts.map(({ path }) => `../${path}`),
|
|
306
306
|
`../${config.architecture.root_directory}/**/*`,
|
|
307
307
|
"./**/*.d.ts",
|
|
308
308
|
...options.tsconfig?.include ?? []
|
|
@@ -353,9 +353,9 @@ declare module 'vue' {
|
|
|
353
353
|
async function generateRouteDefinitionFile(options, config) {
|
|
354
354
|
const routing = config?.routing;
|
|
355
355
|
if (!routing) return;
|
|
356
|
-
debug
|
|
356
|
+
debug.config("Writing types for routing:", routing);
|
|
357
357
|
const routes = Object.fromEntries(Object.entries(routing.routes).map(([key, route]) => {
|
|
358
|
-
const bindings = route.bindings ? Object.fromEntries(Object.entries(route.bindings).map(([key
|
|
358
|
+
const bindings = route.bindings ? Object.fromEntries(Object.entries(route.bindings).map(([key]) => [key, "__key_placeholder__"])) : void 0;
|
|
359
359
|
return [key, {
|
|
360
360
|
...route.uri ? { uri: route.uri } : {},
|
|
361
361
|
...route.domain ? { domain: route.domain } : {},
|
|
@@ -403,7 +403,7 @@ async function loadConfiguration() {
|
|
|
403
403
|
//#endregion
|
|
404
404
|
//#region src/config/client.ts
|
|
405
405
|
function getClientCode$1(config) {
|
|
406
|
-
const paths = config.components.views.map(({ path
|
|
406
|
+
const paths = config.components.views.map(({ path }) => `"~/${path}"`).join(",");
|
|
407
407
|
return `
|
|
408
408
|
import { initializeHybridly as init } from 'hybridly/vue'
|
|
409
409
|
|
|
@@ -479,7 +479,7 @@ const LANG_REGEX = /lang=['"](\w+)['"]/;
|
|
|
479
479
|
var layout_default = (options, config) => {
|
|
480
480
|
const defaultLayoutName = options?.layout?.defaultLayoutName?.replace(".vue", "") ?? "default";
|
|
481
481
|
const templateRegExp = options?.layout?.templateRegExp ?? TEMPLATE_LAYOUT_REGEX;
|
|
482
|
-
debug
|
|
482
|
+
debug.layout("Resolved options:", { defaultLayoutName });
|
|
483
483
|
return {
|
|
484
484
|
name: LAYOUT_PLUGIN_NAME,
|
|
485
485
|
enforce: "pre",
|
|
@@ -489,12 +489,12 @@ var layout_default = (options, config) => {
|
|
|
489
489
|
const [hasLang, lang] = code.match(LANG_REGEX) ?? [];
|
|
490
490
|
const layouts = layoutName?.toString()?.replaceAll(" ", "").split(",") ?? [defaultLayoutName];
|
|
491
491
|
const importName = (i) => `__hybridly_layout_${i}`;
|
|
492
|
-
const exports = layouts.map((_
|
|
493
|
-
const imports = layouts.reduce((imports
|
|
494
|
-
${imports
|
|
495
|
-
import ${importName(i)} from '${resolveLayoutImportPath(layoutName
|
|
492
|
+
const exports = layouts.map((_, i) => importName(i));
|
|
493
|
+
const imports = layouts.reduce((imports, layoutName, i) => `
|
|
494
|
+
${imports}
|
|
495
|
+
import ${importName(i)} from '${resolveLayoutImportPath(layoutName, config)}';
|
|
496
496
|
`, "").trim();
|
|
497
|
-
debug
|
|
497
|
+
debug.layout(`Resolved layouts "${layouts.join(", ")}":`, {
|
|
498
498
|
sourceFile: id,
|
|
499
499
|
layouts,
|
|
500
500
|
imports
|
|
@@ -518,9 +518,9 @@ var layout_default = (options, config) => {
|
|
|
518
518
|
* Resolves a layout by its name.
|
|
519
519
|
*/
|
|
520
520
|
function resolveLayoutImportPath(name, config) {
|
|
521
|
-
const { path
|
|
522
|
-
if (!path
|
|
523
|
-
return `~/${path
|
|
521
|
+
const { path } = config.components.layouts.find((layout) => layout.identifier === name) ?? {};
|
|
522
|
+
if (!path) throw new Error(`Layout [${name}] could not be found.`);
|
|
523
|
+
return `~/${path}`;
|
|
524
524
|
}
|
|
525
525
|
|
|
526
526
|
//#endregion
|
|
@@ -557,7 +557,7 @@ async function getRunOptions(options) {
|
|
|
557
557
|
}
|
|
558
558
|
|
|
559
559
|
//#endregion
|
|
560
|
-
//#region ../utils/
|
|
560
|
+
//#region ../utils/src/utils.ts
|
|
561
561
|
var import_cjs = /* @__PURE__ */ __toESM(require_cjs(), 1);
|
|
562
562
|
var import_lodash = /* @__PURE__ */ __toESM(require_lodash(), 1);
|
|
563
563
|
function merge(x, y, options = {}) {
|
|
@@ -566,17 +566,6 @@ function merge(x, y, options = {}) {
|
|
|
566
566
|
isMergeableObject: options?.mergePlainObjects ? isPlainObject : void 0
|
|
567
567
|
});
|
|
568
568
|
}
|
|
569
|
-
const debug = {
|
|
570
|
-
router: (0, import_src.default)("hybridly:core:router"),
|
|
571
|
-
history: (0, import_src.default)("hybridly:core:history"),
|
|
572
|
-
url: (0, import_src.default)("hybridly:core:url"),
|
|
573
|
-
context: (0, import_src.default)("hybridly:core:context"),
|
|
574
|
-
external: (0, import_src.default)("hybridly:core:external"),
|
|
575
|
-
scroll: (0, import_src.default)("hybridly:core:scroll"),
|
|
576
|
-
hook: (0, import_src.default)("hybridly:core:hook"),
|
|
577
|
-
plugin: (name, ...args) => (0, import_src.default)("hybridly:plugin").extend(name.replace("hybridly:", ""))(args.shift(), ...args),
|
|
578
|
-
adapter: (name, ...args) => (0, import_src.default)("hybridly:adapter").extend(name)(args.shift(), ...args)
|
|
579
|
-
};
|
|
580
569
|
|
|
581
570
|
//#endregion
|
|
582
571
|
//#region src/integrations/vue.ts
|
|
@@ -730,7 +719,7 @@ const hybridlyImports = {
|
|
|
730
719
|
"useForm",
|
|
731
720
|
"useDialog",
|
|
732
721
|
"useHistoryState",
|
|
733
|
-
"
|
|
722
|
+
"createPaginator",
|
|
734
723
|
"registerHook",
|
|
735
724
|
"useRoute",
|
|
736
725
|
"useQueryParameter",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hybridly/vite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.10.0-beta.
|
|
4
|
+
"version": "0.10.0-beta.3",
|
|
5
5
|
"description": "Vite plugin for Hybridly",
|
|
6
6
|
"author": "Enzo Innocenzi <enzo@innocenzi.dev>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"vue": "^3.5.0"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@hybridly/core": "0.10.0-beta.
|
|
50
|
+
"@hybridly/core": "0.10.0-beta.3",
|
|
51
51
|
"@vitejs/plugin-vue": "^5.2.4",
|
|
52
52
|
"fast-glob": "^3.3.3",
|
|
53
53
|
"local-pkg": "^1.1.1",
|