@wix/himalaya-cli 0.1336.0 → 0.1337.0
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/cli.mjs +143 -66
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -7535,7 +7535,6 @@ function buttonVariant(style) {
|
|
|
7535
7535
|
var SYSTEM_FONT_FAMILY, TONAL_ELEVATION_ALPHA, BUTTON_MIN_HIT_TARGET, nonNegative, nonEmpty, own, COLOR_TOKEN_PROPS, TYPOGRAPHY_TOKEN_PROPS, BUTTON_VARIANTS;
|
|
7536
7536
|
var init_tokens = __esm({
|
|
7537
7537
|
"../../core/ts/src/tokens.ts"() {
|
|
7538
|
-
"use strict";
|
|
7539
7538
|
SYSTEM_FONT_FAMILY = "$system";
|
|
7540
7539
|
TONAL_ELEVATION_ALPHA = [0, 0.05, 0.08, 0.11, 0.12, 0.14];
|
|
7541
7540
|
BUTTON_MIN_HIT_TARGET = 44;
|
|
@@ -16629,7 +16628,6 @@ function resolveIdiom(tokens2, ctx = {}) {
|
|
|
16629
16628
|
var IDIOM_CONTEXTS, UNSAFE_KEYS;
|
|
16630
16629
|
var init_idiom = __esm({
|
|
16631
16630
|
"../../core/ts/src/idiom.ts"() {
|
|
16632
|
-
"use strict";
|
|
16633
16631
|
IDIOM_CONTEXTS = {
|
|
16634
16632
|
ios: { native: ["ios"] },
|
|
16635
16633
|
android: { native: ["material"] },
|
|
@@ -22690,8 +22688,13 @@ __export(gen_native_config_exports, {
|
|
|
22690
22688
|
androidSettingsGradle: () => androidSettingsGradle,
|
|
22691
22689
|
androidTvLeanbackPlan: () => androidTvLeanbackPlan,
|
|
22692
22690
|
applyToFile: () => applyToFile,
|
|
22691
|
+
assertSingleMarkerPair: () => assertSingleMarkerPair,
|
|
22692
|
+
assertSingleModuleInstall: () => assertSingleModuleInstall,
|
|
22693
22693
|
automotiveAppDescPath: () => automotiveAppDescPath,
|
|
22694
22694
|
buildSet: () => buildSet,
|
|
22695
|
+
countBeginMarkers: () => countBeginMarkers,
|
|
22696
|
+
countEndMarkers: () => countEndMarkers,
|
|
22697
|
+
duplicateModuleInstalls: () => duplicateModuleInstalls,
|
|
22695
22698
|
genCoreModuleInstallers: () => genCoreModuleInstallers,
|
|
22696
22699
|
genNativeConfig: () => genNativeConfig,
|
|
22697
22700
|
hasMarkers: () => hasMarkers,
|
|
@@ -22699,6 +22702,8 @@ __export(gen_native_config_exports, {
|
|
|
22699
22702
|
iapBindingInfo: () => iapBindingInfo,
|
|
22700
22703
|
injectBlock: () => injectBlock,
|
|
22701
22704
|
iosPlanFor: () => iosPlanFor,
|
|
22705
|
+
kotlinBootSourcesUnder: () => kotlinBootSourcesUnder,
|
|
22706
|
+
kotlinFilesWithModuleInstall: () => kotlinFilesWithModuleInstall,
|
|
22702
22707
|
loadOverrides: () => loadOverrides,
|
|
22703
22708
|
macosPlanFor: () => macosPlanFor,
|
|
22704
22709
|
orientationPlistPlan: () => orientationPlistPlan,
|
|
@@ -22728,7 +22733,7 @@ __export(gen_native_config_exports, {
|
|
|
22728
22733
|
xmlAttr: () => xmlAttr,
|
|
22729
22734
|
yamlScalar: () => yamlScalar
|
|
22730
22735
|
});
|
|
22731
|
-
import { existsSync as existsSync33, mkdirSync as mkdirSync15, readFileSync as readFileSync32, readdirSync as readdirSync19, rmSync as rmSync7, writeFileSync as writeFileSync13 } from "node:fs";
|
|
22736
|
+
import { existsSync as existsSync33, mkdirSync as mkdirSync15, readFileSync as readFileSync32, readdirSync as readdirSync19, rmSync as rmSync7, statSync as statSync6, writeFileSync as writeFileSync13 } from "node:fs";
|
|
22732
22737
|
import { dirname as dirname20, join as join33 } from "node:path";
|
|
22733
22738
|
import { fileURLToPath as fileURLToPath13 } from "node:url";
|
|
22734
22739
|
function parseStringArray(configTs, field) {
|
|
@@ -22924,7 +22929,7 @@ function swiftFilesWithModuleMarkers(app) {
|
|
|
22924
22929
|
const path2 = join33(dir, entry.name);
|
|
22925
22930
|
if (entry.isDirectory()) {
|
|
22926
22931
|
if (!entry.name.endsWith(".xcodeproj")) stack.push(path2);
|
|
22927
|
-
} else if (entry.name.endsWith(".swift")) {
|
|
22932
|
+
} else if (entry.isFile() && entry.name.endsWith(".swift")) {
|
|
22928
22933
|
const text9 = readFileSync32(path2, "utf8");
|
|
22929
22934
|
if (hasMarkers(text9, "slash", LABEL_MODULES_SWIFT_IMPORT) || hasMarkers(text9, "slash", LABEL_MODULES_SWIFT_INSTALL)) out2.push(path2);
|
|
22930
22935
|
}
|
|
@@ -22932,11 +22937,61 @@ function swiftFilesWithModuleMarkers(app) {
|
|
|
22932
22937
|
}
|
|
22933
22938
|
return out2.sort();
|
|
22934
22939
|
}
|
|
22940
|
+
function kotlinFilesWithModuleInstall(app) {
|
|
22941
|
+
return kotlinBootSourcesUnder(join33(appDir(app), "android"));
|
|
22942
|
+
}
|
|
22943
|
+
function kotlinBootSourcesUnder(root) {
|
|
22944
|
+
if (!existsSync33(root)) return [];
|
|
22945
|
+
const out2 = [];
|
|
22946
|
+
const stack = [[root, 0, "project"]];
|
|
22947
|
+
while (stack.length) {
|
|
22948
|
+
const [dir, depth, where] = stack.pop();
|
|
22949
|
+
for (const entry of readdirSync19(dir, { withFileTypes: true })) {
|
|
22950
|
+
if (entry.name.startsWith(".")) continue;
|
|
22951
|
+
const path2 = join33(dir, entry.name);
|
|
22952
|
+
if (entry.isDirectory()) {
|
|
22953
|
+
if (depth >= ANDROID_MAX_DEPTH) continue;
|
|
22954
|
+
if (where === "project") {
|
|
22955
|
+
if (entry.name === "build") continue;
|
|
22956
|
+
stack.push([path2, depth + 1, entry.name === "src" ? "sources" : "project"]);
|
|
22957
|
+
} else if (where === "sources") {
|
|
22958
|
+
if (entry.name === "main") stack.push([path2, depth + 1, "main"]);
|
|
22959
|
+
} else {
|
|
22960
|
+
stack.push([path2, depth + 1, "main"]);
|
|
22961
|
+
}
|
|
22962
|
+
} else if (where === "main" && entry.isFile() && entry.name.endsWith("Application.kt") && statSync6(path2).size <= BOOT_SOURCE_MAX_BYTES && readFileSync32(path2, "utf8").includes("installLinkedModules")) {
|
|
22963
|
+
out2.push(path2);
|
|
22964
|
+
}
|
|
22965
|
+
}
|
|
22966
|
+
}
|
|
22967
|
+
return out2.sort();
|
|
22968
|
+
}
|
|
22969
|
+
function stripComments2(text9) {
|
|
22970
|
+
return text9.replace(/\/\*[\s\S]*?\*\//g, (c2) => c2.replace(/[^\n]/g, " ")).replace(/\/\/[^\n]*/g, "");
|
|
22971
|
+
}
|
|
22972
|
+
function duplicateModuleInstalls(...texts) {
|
|
22973
|
+
const calls = ["installLinkedModules", ...NATIVE_MODULES.flatMap((m2) => m2.ios ? [`${m2.ios.product}.install`] : [])];
|
|
22974
|
+
const code = texts.map(stripComments2).join("\n");
|
|
22975
|
+
return calls.filter((call) => {
|
|
22976
|
+
const re2 = new RegExp(`(^|[^\\w])${call.replace(".", "\\.")}\\s*\\(`, "gm");
|
|
22977
|
+
return (code.match(re2) ?? []).length > 1;
|
|
22978
|
+
});
|
|
22979
|
+
}
|
|
22980
|
+
function assertSingleModuleInstall(app, paths) {
|
|
22981
|
+
const dup = duplicateModuleInstalls(...paths.map((p2) => readFileSync32(p2, "utf8")));
|
|
22982
|
+
if (dup.length) {
|
|
22983
|
+
throw new Error(
|
|
22984
|
+
`native-config: ${app}: ${dup.join(", ")} is called more than once across ${paths.join(", ")} \u2014 a merge duplicated the module install; keep one call`
|
|
22985
|
+
);
|
|
22986
|
+
}
|
|
22987
|
+
}
|
|
22935
22988
|
function isBegin(line, kind, label2) {
|
|
22936
22989
|
const s2 = line.trim();
|
|
22937
|
-
|
|
22938
|
-
|
|
22939
|
-
|
|
22990
|
+
const open = kind === "yaml" ? `# >>> ${label2}` : kind === "xml" ? `<!-- >>> ${label2}` : `// >>> ${label2}`;
|
|
22991
|
+
const close = kind === "xml" ? "-->" : ">>>";
|
|
22992
|
+
if (!s2.startsWith(open) || !s2.endsWith(close)) return false;
|
|
22993
|
+
const rest = s2.slice(open.length);
|
|
22994
|
+
return /^\s/.test(rest) || rest.startsWith(close) || kind === "xml" && rest.startsWith(">>>");
|
|
22940
22995
|
}
|
|
22941
22996
|
function isEnd(line, kind, label2) {
|
|
22942
22997
|
const s2 = line.trim();
|
|
@@ -22974,11 +23029,28 @@ function hostAppliesDeferredWidgetActions(app) {
|
|
|
22974
23029
|
}
|
|
22975
23030
|
return false;
|
|
22976
23031
|
}
|
|
23032
|
+
function countBeginMarkers(text9, kind, label2) {
|
|
23033
|
+
return text9.split("\n").filter((l2) => isBegin(l2, kind, label2)).length;
|
|
23034
|
+
}
|
|
23035
|
+
function countEndMarkers(text9, kind, label2) {
|
|
23036
|
+
return text9.split("\n").filter((l2) => isEnd(l2, kind, label2)).length;
|
|
23037
|
+
}
|
|
22977
23038
|
function hasMarkers(text9, kind, label2) {
|
|
22978
23039
|
const lines = text9.split("\n");
|
|
22979
23040
|
return lines.some((l2) => isBegin(l2, kind, label2)) && lines.some((l2) => isEnd(l2, kind, label2));
|
|
22980
23041
|
}
|
|
22981
|
-
function
|
|
23042
|
+
function assertSingleMarkerPair(text9, kind, label2, where = "the file") {
|
|
23043
|
+
const opens = countBeginMarkers(text9, kind, label2);
|
|
23044
|
+
const closes = countEndMarkers(text9, kind, label2);
|
|
23045
|
+
if (opens > 1 || closes > 1) {
|
|
23046
|
+
const which = opens > 1 ? `">>> ${label2}" opens ${opens} times` : `"<<< ${label2}" closes ${closes} times`;
|
|
23047
|
+
throw new Error(
|
|
23048
|
+
`native-config: managed marker ${which} in ${where} \u2014 a merge duplicated the generated block; delete every copy but one, then run \`npm run native-config -- --all\``
|
|
23049
|
+
);
|
|
23050
|
+
}
|
|
23051
|
+
}
|
|
23052
|
+
function injectBlock(text9, kind, label2, render, where = "the file") {
|
|
23053
|
+
assertSingleMarkerPair(text9, kind, label2, where);
|
|
22982
23054
|
const lines = text9.split("\n");
|
|
22983
23055
|
const beginIdx = lines.findIndex((l2) => isBegin(l2, kind, label2));
|
|
22984
23056
|
const endIdx = lines.findIndex((l2) => isEnd(l2, kind, label2));
|
|
@@ -23008,8 +23080,9 @@ function automotiveAppDescPath(app) {
|
|
|
23008
23080
|
function applyToFile(path2, kind, label2, render, check) {
|
|
23009
23081
|
if (!existsSync33(path2)) return { path: path2, outcome: "skipped" };
|
|
23010
23082
|
const before = readFileSync32(path2, "utf8");
|
|
23083
|
+
assertSingleMarkerPair(before, kind, label2, path2);
|
|
23011
23084
|
if (!hasMarkers(before, kind, label2)) return { path: path2, outcome: "skipped" };
|
|
23012
|
-
const after = injectBlock(before, kind, label2, render);
|
|
23085
|
+
const after = injectBlock(before, kind, label2, render, path2);
|
|
23013
23086
|
if (after === before) return { path: path2, outcome: "unchanged" };
|
|
23014
23087
|
if (check) return { path: path2, outcome: "drift" };
|
|
23015
23088
|
writeFileSync13(path2, after);
|
|
@@ -23053,6 +23126,8 @@ function resolveDistBake(app, own4, extra) {
|
|
|
23053
23126
|
}
|
|
23054
23127
|
function genNativeConfig(app, opts = {}) {
|
|
23055
23128
|
const check = opts.check ?? false;
|
|
23129
|
+
assertSingleModuleInstall(app, swiftFilesWithModuleMarkers(app));
|
|
23130
|
+
assertSingleModuleInstall(app, kotlinFilesWithModuleInstall(app));
|
|
23056
23131
|
const configPath = appConfigTs(app);
|
|
23057
23132
|
const configTs = existsSync33(configPath) ? readFileSync32(configPath, "utf8") : "";
|
|
23058
23133
|
const capabilities = parseStringArray(configTs, "capabilities");
|
|
@@ -23240,7 +23315,7 @@ function genNativeConfig(app, opts = {}) {
|
|
|
23240
23315
|
);
|
|
23241
23316
|
return { app, buildSet: ids, files, drift: files.some((f2) => f2.outcome === "drift") };
|
|
23242
23317
|
}
|
|
23243
|
-
var LABEL_IOS_INFO, LABEL_IOS_ENTITLEMENTS, LABEL_ANDROID, LABEL_ANDROID_SERVICES, LABEL_MODULES_IOS_PACKAGE, LABEL_MODULES_IOS_LINK, LABEL_MODULES_ANDROID_INCLUDE, LABEL_MODULES_ANDROID_LINK, LABEL_MODULES_SWIFT_IMPORT, LABEL_MODULES_SWIFT_INSTALL, LABEL_MODULES_ANDROID_INSTALLERS, LABEL_WATCH, LABEL_TV, LABEL_ANDROID_TV, LABEL_ORIENTATION, LABEL_CAR, IOS_ORIENTATION, ALL_ORIENTATIONS, HEALTH_PERMISSION_COPY_META, FROM_APP_PLATFORM_DIR, CORE_ANDROID_CAPABILITY_MODULES, IOS_BUILD_CAPABILITIES_KEY, IOS_DIST_CAPABILITIES_KEY, ANDROID_BUILD_CAPABILITIES_META, ANDROID_DIST_CAPABILITIES_META;
|
|
23318
|
+
var LABEL_IOS_INFO, LABEL_IOS_ENTITLEMENTS, LABEL_ANDROID, LABEL_ANDROID_SERVICES, LABEL_MODULES_IOS_PACKAGE, LABEL_MODULES_IOS_LINK, LABEL_MODULES_ANDROID_INCLUDE, LABEL_MODULES_ANDROID_LINK, LABEL_MODULES_SWIFT_IMPORT, LABEL_MODULES_SWIFT_INSTALL, LABEL_MODULES_ANDROID_INSTALLERS, LABEL_WATCH, LABEL_TV, LABEL_ANDROID_TV, LABEL_ORIENTATION, LABEL_CAR, IOS_ORIENTATION, ALL_ORIENTATIONS, HEALTH_PERMISSION_COPY_META, FROM_APP_PLATFORM_DIR, CORE_ANDROID_CAPABILITY_MODULES, ANDROID_MAX_DEPTH, BOOT_SOURCE_MAX_BYTES, IOS_BUILD_CAPABILITIES_KEY, IOS_DIST_CAPABILITIES_KEY, ANDROID_BUILD_CAPABILITIES_META, ANDROID_DIST_CAPABILITIES_META;
|
|
23244
23319
|
var init_gen_native_config = __esm({
|
|
23245
23320
|
"../native-config/gen-native-config.ts"() {
|
|
23246
23321
|
init_src2();
|
|
@@ -23283,6 +23358,8 @@ var init_gen_native_config = __esm({
|
|
|
23283
23358
|
dirname20(fileURLToPath13(import.meta.url)),
|
|
23284
23359
|
"../../core/runtime/android/io/himalaya/core/src/main/kotlin/io/himalaya/core/CapabilityModules.kt"
|
|
23285
23360
|
);
|
|
23361
|
+
ANDROID_MAX_DEPTH = 16;
|
|
23362
|
+
BOOT_SOURCE_MAX_BYTES = 1 << 20;
|
|
23286
23363
|
IOS_BUILD_CAPABILITIES_KEY = "HimalayaBuildCapabilities";
|
|
23287
23364
|
IOS_DIST_CAPABILITIES_KEY = "HimalayaDistCapabilities";
|
|
23288
23365
|
ANDROID_BUILD_CAPABILITIES_META = "io.himalaya.buildCapabilities";
|
|
@@ -23592,7 +23669,7 @@ __export(progress_exports, {
|
|
|
23592
23669
|
import { spawn as spawn3 } from "node:child_process";
|
|
23593
23670
|
import { createHash as createHash12 } from "node:crypto";
|
|
23594
23671
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
23595
|
-
import { appendFileSync, closeSync, existsSync as existsSync34, lstatSync as lstatSync8, mkdirSync as mkdirSync16, openSync, readdirSync as readdirSync20, readFileSync as readFileSync33, readSync, renameSync as renameSync5, rmSync as rmSync8, statSync as
|
|
23672
|
+
import { appendFileSync, closeSync, existsSync as existsSync34, lstatSync as lstatSync8, mkdirSync as mkdirSync16, openSync, readdirSync as readdirSync20, readFileSync as readFileSync33, readSync, renameSync as renameSync5, rmSync as rmSync8, statSync as statSync7, writeFileSync as writeFileSync14 } from "node:fs";
|
|
23596
23673
|
import { isAbsolute as isAbsolute3, join as join34, relative as relative6, resolve as resolve27, sep as sep8 } from "node:path";
|
|
23597
23674
|
function agentCovers(agent, cli) {
|
|
23598
23675
|
if (isCliEntry(agent)) return false;
|
|
@@ -23621,14 +23698,14 @@ function imageExtension(buf) {
|
|
|
23621
23698
|
}
|
|
23622
23699
|
function locateImage(dir, src) {
|
|
23623
23700
|
for (const candidate of [resolve27(src), resolve27(dir, src)]) {
|
|
23624
|
-
if (existsSync34(candidate) &&
|
|
23701
|
+
if (existsSync34(candidate) && statSync7(candidate).isFile()) return candidate;
|
|
23625
23702
|
}
|
|
23626
23703
|
return null;
|
|
23627
23704
|
}
|
|
23628
23705
|
function archiveImage(dir, src) {
|
|
23629
23706
|
const abs = locateImage(dir, src);
|
|
23630
23707
|
if (!abs) throw new ProgressError("image_not_found", `no image at ${src} (looked relative to the current directory and to ${dir})`);
|
|
23631
|
-
const size =
|
|
23708
|
+
const size = statSync7(abs).size;
|
|
23632
23709
|
if (size > MAX_IMAGE_BYTES) {
|
|
23633
23710
|
throw new ProgressError("image_too_large", `${src} is ${size} bytes; a progress image is capped at ${MAX_IMAGE_BYTES} \u2014 render at phone width (--device iphone)`);
|
|
23634
23711
|
}
|
|
@@ -23715,7 +23792,7 @@ function packageRelative(dir, p2) {
|
|
|
23715
23792
|
}
|
|
23716
23793
|
function endsWithNewline(file2) {
|
|
23717
23794
|
if (!existsSync34(file2)) return true;
|
|
23718
|
-
const size =
|
|
23795
|
+
const size = statSync7(file2).size;
|
|
23719
23796
|
if (size === 0) return true;
|
|
23720
23797
|
const fd = openSync(file2, "r");
|
|
23721
23798
|
try {
|
|
@@ -25904,7 +25981,7 @@ __export(template_trim_exports, {
|
|
|
25904
25981
|
routeMatcher: () => routeMatcher,
|
|
25905
25982
|
runTemplateTrim: () => runTemplateTrim
|
|
25906
25983
|
});
|
|
25907
|
-
import { cpSync, existsSync as existsSync37, mkdirSync as mkdirSync19, readdirSync as readdirSync21, readFileSync as readFileSync37, renameSync as renameSync7, rmSync as rmSync10, statSync as
|
|
25984
|
+
import { cpSync, existsSync as existsSync37, mkdirSync as mkdirSync19, readdirSync as readdirSync21, readFileSync as readFileSync37, renameSync as renameSync7, rmSync as rmSync10, statSync as statSync8, writeFileSync as writeFileSync17 } from "node:fs";
|
|
25908
25985
|
import { dirname as dirname23, join as join38 } from "node:path";
|
|
25909
25986
|
function routeMatcher(pattern) {
|
|
25910
25987
|
const detail = /^\^([A-Za-z0-9_]+)\(\?:\[_\/\]\(\.\+\)\)\?\$$/.exec(pattern);
|
|
@@ -26601,14 +26678,14 @@ function homeModulesPass(app, kept, edited) {
|
|
|
26601
26678
|
function listWorkers(dir) {
|
|
26602
26679
|
const root = join38(dir, "tier5-src");
|
|
26603
26680
|
if (!existsSync37(root)) return { dirs: [], files: {} };
|
|
26604
|
-
const dirs = readdirSync21(root).filter((n2) =>
|
|
26681
|
+
const dirs = readdirSync21(root).filter((n2) => statSync8(join38(root, n2)).isDirectory()).sort();
|
|
26605
26682
|
const files = {};
|
|
26606
26683
|
const walk2 = (abs, rel) => {
|
|
26607
26684
|
for (const name of readdirSync21(abs)) {
|
|
26608
26685
|
if (name === "node_modules") continue;
|
|
26609
26686
|
const p2 = join38(abs, name);
|
|
26610
26687
|
const r2 = `${rel}/${name}`;
|
|
26611
|
-
if (
|
|
26688
|
+
if (statSync8(p2).isDirectory()) walk2(p2, r2);
|
|
26612
26689
|
else if (/\.(?:[cm]?[jt]sx?|json)$/.test(name)) files[r2] = readFileSync37(p2, "utf8");
|
|
26613
26690
|
}
|
|
26614
26691
|
};
|
|
@@ -26924,7 +27001,7 @@ __export(template_adopt_exports, {
|
|
|
26924
27001
|
workerReach: () => workerReach,
|
|
26925
27002
|
writeInventory: () => writeInventory
|
|
26926
27003
|
});
|
|
26927
|
-
import { existsSync as existsSync38, lstatSync as lstatSync12, mkdirSync as mkdirSync20, readdirSync as readdirSync22, readFileSync as readFileSync38, renameSync as renameSync8, statSync as
|
|
27004
|
+
import { existsSync as existsSync38, lstatSync as lstatSync12, mkdirSync as mkdirSync20, readdirSync as readdirSync22, readFileSync as readFileSync38, renameSync as renameSync8, statSync as statSync9, writeFileSync as writeFileSync18 } from "node:fs";
|
|
26928
27005
|
import { dirname as dirname24, join as join39, posix as posix2 } from "node:path";
|
|
26929
27006
|
function readAppSources(dir) {
|
|
26930
27007
|
const devPath = join39(dir, "dev", "index.ts");
|
|
@@ -26937,14 +27014,14 @@ function readAppSources(dir) {
|
|
|
26937
27014
|
if (existsSync38(root)) {
|
|
26938
27015
|
for (const name of readdirSync22(root).sort()) {
|
|
26939
27016
|
const abs = join39(root, name);
|
|
26940
|
-
if (!
|
|
27017
|
+
if (!statSync9(abs).isDirectory()) continue;
|
|
26941
27018
|
const files = {};
|
|
26942
27019
|
const walk2 = (a2, rel) => {
|
|
26943
27020
|
for (const n2 of readdirSync22(a2).sort()) {
|
|
26944
27021
|
if (n2 === "node_modules") continue;
|
|
26945
27022
|
const p2 = join39(a2, n2);
|
|
26946
27023
|
const r2 = `${rel}/${n2}`;
|
|
26947
|
-
if (
|
|
27024
|
+
if (statSync9(p2).isDirectory()) walk2(p2, r2);
|
|
26948
27025
|
else if (/\.(?:[cm]?[jt]sx?)$/.test(n2)) files[r2] = readFileSync38(p2, "utf8");
|
|
26949
27026
|
}
|
|
26950
27027
|
};
|
|
@@ -27043,7 +27120,7 @@ function walkPackage(dir, rel = "") {
|
|
|
27043
27120
|
if (IGNORED.has(n2)) continue;
|
|
27044
27121
|
const r2 = rel ? `${rel}/${n2}` : n2;
|
|
27045
27122
|
const abs = join39(dir, r2);
|
|
27046
|
-
if (
|
|
27123
|
+
if (statSync9(abs).isDirectory()) out2.push(...walkPackage(dir, r2));
|
|
27047
27124
|
else if (/\.(?:tsx?|jsx?|json)$/.test(n2)) out2.push(r2);
|
|
27048
27125
|
}
|
|
27049
27126
|
return out2;
|
|
@@ -33767,7 +33844,7 @@ var init_stable_ids = __esm({
|
|
|
33767
33844
|
// ../../core/dev-server/src/preview.ts
|
|
33768
33845
|
import { spawn as spawn4 } from "node:child_process";
|
|
33769
33846
|
import { createHash as createHash17 } from "node:crypto";
|
|
33770
|
-
import { existsSync as existsSync42, createReadStream, statSync as
|
|
33847
|
+
import { existsSync as existsSync42, createReadStream, statSync as statSync10, readFileSync as readFileSync43, renameSync as renameSync9, unlinkSync as unlinkSync3 } from "node:fs";
|
|
33771
33848
|
import { homedir as homedir5, tmpdir as tmpdir2 } from "node:os";
|
|
33772
33849
|
import { resolve as resolvePath, dirname as dirname26 } from "node:path";
|
|
33773
33850
|
import { fileURLToPath as fileURLToPath17 } from "node:url";
|
|
@@ -34465,7 +34542,7 @@ function finalizeRecording(key2, rec) {
|
|
|
34465
34542
|
} catch {
|
|
34466
34543
|
}
|
|
34467
34544
|
}
|
|
34468
|
-
const sizeBytes = existsSync42(rec.localPath) ?
|
|
34545
|
+
const sizeBytes = existsSync42(rec.localPath) ? statSync10(rec.localPath).size : 0;
|
|
34469
34546
|
clips.set(rec.id, { path: rec.localPath, mime: rec.mime });
|
|
34470
34547
|
recordings.delete(key2);
|
|
34471
34548
|
return { sizeBytes };
|
|
@@ -34542,7 +34619,7 @@ async function handlePreviewClip(res, url) {
|
|
|
34542
34619
|
res.setHeader("content-type", "application/json");
|
|
34543
34620
|
return void res.end(JSON.stringify({ error: "clip_not_found", id }));
|
|
34544
34621
|
}
|
|
34545
|
-
const size =
|
|
34622
|
+
const size = statSync10(clip3.path).size;
|
|
34546
34623
|
res.statusCode = 200;
|
|
34547
34624
|
res.setHeader("content-type", clip3.mime);
|
|
34548
34625
|
res.setHeader("content-length", String(size));
|
|
@@ -137711,7 +137788,7 @@ __export(studio_exports, {
|
|
|
137711
137788
|
writeStudioRecord: () => writeStudioRecord
|
|
137712
137789
|
});
|
|
137713
137790
|
import { createHash as createHash25 } from "node:crypto";
|
|
137714
|
-
import { existsSync as existsSync49, readdirSync as readdirSync26, readFileSync as readFileSync54, realpathSync as realpathSync8, statSync as
|
|
137791
|
+
import { existsSync as existsSync49, readdirSync as readdirSync26, readFileSync as readFileSync54, realpathSync as realpathSync8, statSync as statSync11 } from "node:fs";
|
|
137715
137792
|
import { basename as basename11, extname as extname3, join as join49, relative as relative9, resolve as resolve39, sep as sep11 } from "node:path";
|
|
137716
137793
|
import { pathToFileURL as pathToFileURL7 } from "node:url";
|
|
137717
137794
|
function realInside(dir, abs) {
|
|
@@ -137730,7 +137807,7 @@ function archiveFile(dir, memory, abs) {
|
|
|
137730
137807
|
let mtimeMs;
|
|
137731
137808
|
let ino;
|
|
137732
137809
|
try {
|
|
137733
|
-
({ size, mtimeMs, ino } =
|
|
137810
|
+
({ size, mtimeMs, ino } = statSync11(real));
|
|
137734
137811
|
} catch {
|
|
137735
137812
|
return null;
|
|
137736
137813
|
}
|
|
@@ -137798,7 +137875,7 @@ function appIdentity(dir) {
|
|
|
137798
137875
|
const icon = text(manifest?.icon)?.trim();
|
|
137799
137876
|
const iconPath = icon ? resolve39(dir, icon) : null;
|
|
137800
137877
|
const real = iconPath ? realInside(dir, iconPath) : null;
|
|
137801
|
-
return { name, iconFile: real &&
|
|
137878
|
+
return { name, iconFile: real && statSync11(real).isFile() ? iconPath : null };
|
|
137802
137879
|
}
|
|
137803
137880
|
function testRuns(dir) {
|
|
137804
137881
|
const att = join49(dir, ".himi", "attestations");
|
|
@@ -145497,7 +145574,7 @@ var init_customer_signing_inspect = __esm({
|
|
|
145497
145574
|
});
|
|
145498
145575
|
|
|
145499
145576
|
// src/push-onboarding.ts
|
|
145500
|
-
import { existsSync as existsSync51, mkdirSync as mkdirSync24, readFileSync as readFileSync57, statSync as
|
|
145577
|
+
import { existsSync as existsSync51, mkdirSync as mkdirSync24, readFileSync as readFileSync57, statSync as statSync12, writeFileSync as writeFileSync20, chmodSync as chmodSync2 } from "node:fs";
|
|
145501
145578
|
import { basename as basename12, dirname as dirname31, join as join50, resolve as resolve42 } from "node:path";
|
|
145502
145579
|
function readJson5(path2) {
|
|
145503
145580
|
try {
|
|
@@ -145577,7 +145654,7 @@ function localIdentityRefusal(i2) {
|
|
|
145577
145654
|
function readKeyFile(path2) {
|
|
145578
145655
|
let size;
|
|
145579
145656
|
try {
|
|
145580
|
-
size =
|
|
145657
|
+
size = statSync12(path2).size;
|
|
145581
145658
|
} catch {
|
|
145582
145659
|
return { ok: false, code: "key_file_unreadable", reason: "cannot read the selected key file; check its path and file permissions" };
|
|
145583
145660
|
}
|
|
@@ -145744,7 +145821,7 @@ var signing_inspect_exports = {};
|
|
|
145744
145821
|
__export(signing_inspect_exports, {
|
|
145745
145822
|
runSigningInspect: () => runSigningInspect
|
|
145746
145823
|
});
|
|
145747
|
-
import { existsSync as existsSync52, readFileSync as readFileSync58, statSync as
|
|
145824
|
+
import { existsSync as existsSync52, readFileSync as readFileSync58, statSync as statSync13 } from "node:fs";
|
|
145748
145825
|
import { isAbsolute as isAbsolute5, resolve as resolve43 } from "node:path";
|
|
145749
145826
|
function fail3(io2, code, fields = {}) {
|
|
145750
145827
|
io2.error(JSON.stringify({ ok: false, code, ...fields }));
|
|
@@ -145837,7 +145914,7 @@ async function runSigningInspect(pos, flags, io2, deps = {}) {
|
|
|
145837
145914
|
if (!existsSync52(certPath) || !existsSync52(profilePath2)) {
|
|
145838
145915
|
return fail3(io2, "signing_inspect_local_assets_unreadable", { error: "cannot read --cert-file or --profile-file" });
|
|
145839
145916
|
}
|
|
145840
|
-
if (
|
|
145917
|
+
if (statSync13(certPath).size > 1048576 || statSync13(profilePath2).size > 1048576) {
|
|
145841
145918
|
return fail3(io2, "signing_inspect_local_assets_unreadable", { error: "cert or profile file is unexpectedly large" });
|
|
145842
145919
|
}
|
|
145843
145920
|
assets = {
|
|
@@ -146577,7 +146654,7 @@ __export(pack_exports, {
|
|
|
146577
146654
|
});
|
|
146578
146655
|
import { createHash as createHash28 } from "node:crypto";
|
|
146579
146656
|
import { deflateRawSync, inflateRawSync } from "node:zlib";
|
|
146580
|
-
import { existsSync as existsSync53, mkdirSync as mkdirSync25, readFileSync as readFileSync60, readdirSync as readdirSync27, rmSync as rmSync12, statSync as
|
|
146657
|
+
import { existsSync as existsSync53, mkdirSync as mkdirSync25, readFileSync as readFileSync60, readdirSync as readdirSync27, rmSync as rmSync12, statSync as statSync14, writeFileSync as writeFileSync21 } from "node:fs";
|
|
146581
146658
|
import { dirname as dirname32, join as join52, resolve as resolve45 } from "node:path";
|
|
146582
146659
|
function writeZip(entries) {
|
|
146583
146660
|
const sorted2 = entries.slice().sort((a2, b2) => a2.path < b2.path ? -1 : a2.path > b2.path ? 1 : 0);
|
|
@@ -146672,10 +146749,10 @@ function inflateEntry(buf, entry) {
|
|
|
146672
146749
|
return bytes2;
|
|
146673
146750
|
}
|
|
146674
146751
|
function readIf(path2) {
|
|
146675
|
-
return existsSync53(path2) &&
|
|
146752
|
+
return existsSync53(path2) && statSync14(path2).isFile() ? readFileSync60(path2) : null;
|
|
146676
146753
|
}
|
|
146677
146754
|
function listDir(dir) {
|
|
146678
|
-
return existsSync53(dir) ? readdirSync27(dir).filter((f2) =>
|
|
146755
|
+
return existsSync53(dir) ? readdirSync27(dir).filter((f2) => statSync14(join52(dir, f2)).isFile()) : [];
|
|
146679
146756
|
}
|
|
146680
146757
|
function gatherReleaseEntries(appDir3) {
|
|
146681
146758
|
const manifestPath = join52(appDir3, HIMI_PACKAGE_MANIFEST_PATH);
|
|
@@ -146754,7 +146831,7 @@ function packRelease(releaseRoot, app, out2, opts = {}) {
|
|
|
146754
146831
|
const appDir3 = join52(resolve45(releaseRoot), app);
|
|
146755
146832
|
const { all, header, skipped } = buildEntries(appDir3, app, opts);
|
|
146756
146833
|
const buf = writeZip(all);
|
|
146757
|
-
const isDir2 = existsSync53(out2) &&
|
|
146834
|
+
const isDir2 = existsSync53(out2) && statSync14(out2).isDirectory();
|
|
146758
146835
|
const outFile = isDir2 ? join52(resolve45(out2), packageFileName(app, header.releaseId)) : resolve45(out2);
|
|
146759
146836
|
mkdirSync25(dirname32(outFile), { recursive: true });
|
|
146760
146837
|
writeFileSync21(outFile, buf);
|
|
@@ -146772,10 +146849,10 @@ function resolvePackageDirDest(outDir, app, releaseId) {
|
|
|
146772
146849
|
};
|
|
146773
146850
|
const replaceable = (dir) => {
|
|
146774
146851
|
if (!existsSync53(dir)) return true;
|
|
146775
|
-
if (!
|
|
146852
|
+
if (!statSync14(dir).isDirectory()) return false;
|
|
146776
146853
|
return readdirSync27(dir).length === 0 || packagedApp(dir) === app;
|
|
146777
146854
|
};
|
|
146778
|
-
if (existsSync53(outDir) && !
|
|
146855
|
+
if (existsSync53(outDir) && !statSync14(outDir).isDirectory()) {
|
|
146779
146856
|
throw new Error(`refusing to write a package tree over ${outDir} \u2014 it is a file, not a directory`);
|
|
146780
146857
|
}
|
|
146781
146858
|
if (replaceable(outDir)) return outDir;
|
|
@@ -146832,7 +146909,7 @@ function openPackageDir(dir) {
|
|
|
146832
146909
|
for (const name of readdirSync27(abs)) {
|
|
146833
146910
|
const childRel = rel ? `${rel}/${name}` : name;
|
|
146834
146911
|
const childAbs = join52(abs, name);
|
|
146835
|
-
if (
|
|
146912
|
+
if (statSync14(childAbs).isDirectory()) walk2(childRel);
|
|
146836
146913
|
else if (isSafeEntryName(childRel)) entries.set(childRel, readFileSync60(childAbs));
|
|
146837
146914
|
}
|
|
146838
146915
|
};
|
|
@@ -147249,7 +147326,7 @@ __export(run_watch_exports, {
|
|
|
147249
147326
|
watchedContentDir: () => watchedContentDir,
|
|
147250
147327
|
writeRunRecord: () => writeRunRecord
|
|
147251
147328
|
});
|
|
147252
|
-
import { closeSync as closeSync4, constants as constants2, existsSync as existsSync55, fstatSync, lstatSync as lstatSync16, statSync as
|
|
147329
|
+
import { closeSync as closeSync4, constants as constants2, existsSync as existsSync55, fstatSync, lstatSync as lstatSync16, statSync as statSync15, readdirSync as readdirSync29, mkdirSync as mkdirSync27, openSync as openSync4, readFileSync as readFileSync62, realpathSync as realpathSync9, renameSync as renameSync10, rmSync as rmSync14, writeFileSync as writeFileSync23, watch as fsWatch } from "node:fs";
|
|
147253
147330
|
import { randomUUID as randomUUID6 } from "node:crypto";
|
|
147254
147331
|
import { extname as extname4, join as join54, resolve as resolve47, sep as sep14 } from "node:path";
|
|
147255
147332
|
function diffReleases(prev, next) {
|
|
@@ -147356,7 +147433,7 @@ function watchedContentDir(source) {
|
|
|
147356
147433
|
if (!source || /^https?:\/\//i.test(source)) return null;
|
|
147357
147434
|
const dir = resolve47(source);
|
|
147358
147435
|
try {
|
|
147359
|
-
return
|
|
147436
|
+
return statSync15(dir).isDirectory() && existsSync55(join54(dir, "himalaya.content.json")) ? dir : null;
|
|
147360
147437
|
} catch {
|
|
147361
147438
|
return null;
|
|
147362
147439
|
}
|
|
@@ -147536,7 +147613,7 @@ var init_run_watch = __esm({
|
|
|
147536
147613
|
};
|
|
147537
147614
|
isDir = (path2) => {
|
|
147538
147615
|
try {
|
|
147539
|
-
return
|
|
147616
|
+
return statSync15(path2).isDirectory();
|
|
147540
147617
|
} catch {
|
|
147541
147618
|
return false;
|
|
147542
147619
|
}
|
|
@@ -148011,7 +148088,7 @@ __export(milestones_exports, {
|
|
|
148011
148088
|
});
|
|
148012
148089
|
import { createHash as createHash32, randomUUID as randomUUID7 } from "node:crypto";
|
|
148013
148090
|
import { spawn as spawn5 } from "node:child_process";
|
|
148014
|
-
import { closeSync as closeSync5, existsSync as existsSync56, lstatSync as lstatSync19, readFileSync as readFileSync66, statSync as
|
|
148091
|
+
import { closeSync as closeSync5, existsSync as existsSync56, lstatSync as lstatSync19, readFileSync as readFileSync66, statSync as statSync16 } from "node:fs";
|
|
148015
148092
|
import { createServer as createServer4 } from "node:net";
|
|
148016
148093
|
import { basename as basename15, dirname as dirname33, isAbsolute as isAbsolute6, join as join58, relative as relative11, resolve as resolve48, sep as sep15 } from "node:path";
|
|
148017
148094
|
function homeShotPath(dir, home) {
|
|
@@ -148090,7 +148167,7 @@ async function renderHomeInChild(dir, home, opts) {
|
|
|
148090
148167
|
}
|
|
148091
148168
|
let fresh = false;
|
|
148092
148169
|
try {
|
|
148093
|
-
fresh =
|
|
148170
|
+
fresh = statSync16(shot).mtimeMs >= started - 1e3;
|
|
148094
148171
|
} catch {
|
|
148095
148172
|
}
|
|
148096
148173
|
if (code === 0 && fresh) {
|
|
@@ -148299,7 +148376,7 @@ function afterBrowserTestRun(dir, input) {
|
|
|
148299
148376
|
function shotIsCurrent(shot, sourceChangedAtMs) {
|
|
148300
148377
|
if (sourceChangedAtMs === void 0) return false;
|
|
148301
148378
|
try {
|
|
148302
|
-
return
|
|
148379
|
+
return statSync16(shot).mtimeMs >= sourceChangedAtMs;
|
|
148303
148380
|
} catch {
|
|
148304
148381
|
return false;
|
|
148305
148382
|
}
|
|
@@ -148663,7 +148740,7 @@ function afterHandoverPostcard(dir, opts = {}) {
|
|
|
148663
148740
|
let fresh = false;
|
|
148664
148741
|
try {
|
|
148665
148742
|
const st2 = lstatSync19(file2);
|
|
148666
|
-
fresh = st2.isFile() && !st2.isSymbolicLink() && st2.mtimeMs >=
|
|
148743
|
+
fresh = st2.isFile() && !st2.isSymbolicLink() && st2.mtimeMs >= statSync16(join58(dir, ".himi", "progress.jsonl")).mtimeMs;
|
|
148667
148744
|
} catch {
|
|
148668
148745
|
fresh = false;
|
|
148669
148746
|
}
|
|
@@ -152544,7 +152621,7 @@ var init_cli_bridge = __esm({
|
|
|
152544
152621
|
});
|
|
152545
152622
|
|
|
152546
152623
|
// src/mcp/file-tools.ts
|
|
152547
|
-
import { closeSync as closeSync6, constants as constants3, lstatSync as lstatSync20, mkdirSync as mkdirSync30, openSync as openSync5, readdirSync as readdirSync30, readFileSync as readFileSync74, realpathSync as realpathSync10, renameSync as renameSync11, rmSync as rmSync15, statSync as
|
|
152624
|
+
import { closeSync as closeSync6, constants as constants3, lstatSync as lstatSync20, mkdirSync as mkdirSync30, openSync as openSync5, readdirSync as readdirSync30, readFileSync as readFileSync74, realpathSync as realpathSync10, renameSync as renameSync11, rmSync as rmSync15, statSync as statSync17, writeSync, existsSync as existsSync63 } from "node:fs";
|
|
152548
152625
|
import { randomBytes as randomBytes4 } from "node:crypto";
|
|
152549
152626
|
import { dirname as dirname35, isAbsolute as isAbsolute7, join as join66, relative as relative13, resolve as resolve52, sep as sep17 } from "node:path";
|
|
152550
152627
|
import * as z2 from "zod";
|
|
@@ -152663,7 +152740,7 @@ function listFiles(appDir3) {
|
|
|
152663
152740
|
const rel = relative13(appDir3, p2);
|
|
152664
152741
|
if (isDeniedSourcePath(rel) || isDeniedSourcePath(rel.toLowerCase())) continue;
|
|
152665
152742
|
if (files.length >= MAX_LISTED) return false;
|
|
152666
|
-
files.push({ path: rel.split(sep17).join("/"), bytes:
|
|
152743
|
+
files.push({ path: rel.split(sep17).join("/"), bytes: statSync17(p2).size });
|
|
152667
152744
|
}
|
|
152668
152745
|
}
|
|
152669
152746
|
return true;
|
|
@@ -152699,7 +152776,7 @@ function fileTools() {
|
|
|
152699
152776
|
handler: async (a2, d2) => {
|
|
152700
152777
|
const app = await confinedAppDir(a2, d2);
|
|
152701
152778
|
if (typeof app !== "string") return app;
|
|
152702
|
-
if (!existsSync63(app) || !
|
|
152779
|
+
if (!existsSync63(app) || !statSync17(app).isDirectory()) return refuse5("no_app", `no folder at ${app}`);
|
|
152703
152780
|
return ok({ ok: true, dir: app, ...listFiles(app) });
|
|
152704
152781
|
}
|
|
152705
152782
|
},
|
|
@@ -152715,7 +152792,7 @@ function fileTools() {
|
|
|
152715
152792
|
const p2 = confinedPath(app, a2.path);
|
|
152716
152793
|
if (typeof p2 !== "string") return refuse5("bad_path", p2.error);
|
|
152717
152794
|
if (!existsSync63(p2) || !lstatSync20(p2).isFile()) return refuse5("not_found", `no file "${String(a2.path)}"`);
|
|
152718
|
-
const size =
|
|
152795
|
+
const size = statSync17(p2).size;
|
|
152719
152796
|
if (size > MAX_FILE_BYTES) return refuse5("too_large", `"${String(a2.path)}" is ${size} bytes \u2014 over the ${MAX_FILE_BYTES}-byte read limit`);
|
|
152720
152797
|
return ok({ ok: true, path: a2.path, bytes: size, content: readFileSync74(p2, "utf8") });
|
|
152721
152798
|
}
|
|
@@ -153690,7 +153767,7 @@ __export(browser_authoring_exports, {
|
|
|
153690
153767
|
});
|
|
153691
153768
|
import { createServer as createServer5 } from "node:http";
|
|
153692
153769
|
import { createHash as createHash35, randomBytes as randomBytes5 } from "node:crypto";
|
|
153693
|
-
import { existsSync as existsSync65, readdirSync as readdirSync31, readFileSync as readFileSync77, realpathSync as realpathSync11, statSync as
|
|
153770
|
+
import { existsSync as existsSync65, readdirSync as readdirSync31, readFileSync as readFileSync77, realpathSync as realpathSync11, statSync as statSync18 } from "node:fs";
|
|
153694
153771
|
import { join as join68, posix as posix3, relative as relative14, sep as sep18 } from "node:path";
|
|
153695
153772
|
function humanMs(ms2) {
|
|
153696
153773
|
return ms2 < 1e3 ? `${ms2}ms` : `${Math.round(ms2 / 1e3)}s`;
|
|
@@ -153706,7 +153783,7 @@ function collectWorkerSources(tier5SrcDir, bundleName) {
|
|
|
153706
153783
|
for (const name of readdirSync31(abs).sort()) {
|
|
153707
153784
|
const childAbs = join68(abs, name);
|
|
153708
153785
|
const childRel = posix3.join(rel, name);
|
|
153709
|
-
if (
|
|
153786
|
+
if (statSync18(childAbs).isDirectory()) {
|
|
153710
153787
|
walk2(childAbs, childRel);
|
|
153711
153788
|
} else if (/\.(ts|tsx|js|mjs|json)$/.test(name)) {
|
|
153712
153789
|
files[childRel] = readFileSync77(childAbs, "utf8");
|
|
@@ -153740,7 +153817,7 @@ function collectRelativeSiblings(files, tier5SrcDir) {
|
|
|
153740
153817
|
join68(onDisk, "index.js")
|
|
153741
153818
|
];
|
|
153742
153819
|
for (const abs of candidates) {
|
|
153743
|
-
if (!existsSync65(abs) ||
|
|
153820
|
+
if (!existsSync65(abs) || statSync18(abs).isDirectory()) continue;
|
|
153744
153821
|
const key2 = `/tier5-src/${relative14(tier5SrcDir, abs).split(sep18).join(posix3.sep)}`;
|
|
153745
153822
|
if (key2 in files) break;
|
|
153746
153823
|
files[key2] = readFileSync77(abs, "utf8");
|
|
@@ -156179,7 +156256,7 @@ __export(run_exports, {
|
|
|
156179
156256
|
runPackage: () => runPackage,
|
|
156180
156257
|
withoutProdServe: () => withoutProdServe
|
|
156181
156258
|
});
|
|
156182
|
-
import { cpSync as cpSync2, existsSync as existsSync68, mkdirSync as mkdirSync33, mkdtempSync as mkdtempSync3, readFileSync as readFileSync81, rmSync as rmSync17, statSync as
|
|
156259
|
+
import { cpSync as cpSync2, existsSync as existsSync68, mkdirSync as mkdirSync33, mkdtempSync as mkdtempSync3, readFileSync as readFileSync81, rmSync as rmSync17, statSync as statSync19 } from "node:fs";
|
|
156183
156260
|
import { networkInterfaces as osNetworkInterfaces, tmpdir as tmpdir4 } from "node:os";
|
|
156184
156261
|
import { dirname as dirname37, join as join71 } from "node:path";
|
|
156185
156262
|
import { fileURLToPath as fileURLToPath26 } from "node:url";
|
|
@@ -156209,7 +156286,7 @@ async function fetchBytes(url) {
|
|
|
156209
156286
|
}
|
|
156210
156287
|
async function resolvePackage(source, workDir) {
|
|
156211
156288
|
const isUrl2 = /^https?:\/\//i.test(source);
|
|
156212
|
-
if (!isUrl2 && existsSync68(source) &&
|
|
156289
|
+
if (!isUrl2 && existsSync68(source) && statSync19(source).isDirectory()) {
|
|
156213
156290
|
const appDirManifest = join71(source, "release-manifest.json");
|
|
156214
156291
|
if (existsSync68(appDirManifest)) {
|
|
156215
156292
|
const opened2 = openPackageDir(source);
|
|
@@ -160380,7 +160457,7 @@ __export(preflight_app_exports, {
|
|
|
160380
160457
|
preflightApp: () => preflightApp,
|
|
160381
160458
|
profileAccount: () => profileAccount
|
|
160382
160459
|
});
|
|
160383
|
-
import { readFileSync as readFileSync90, existsSync as existsSync74, readdirSync as readdirSync33, statSync as
|
|
160460
|
+
import { readFileSync as readFileSync90, existsSync as existsSync74, readdirSync as readdirSync33, statSync as statSync20 } from "node:fs";
|
|
160384
160461
|
import { createHash as createHash39 } from "node:crypto";
|
|
160385
160462
|
import { join as join76 } from "node:path";
|
|
160386
160463
|
function analyze(projectYml, storeConfig, icon, account) {
|
|
@@ -160606,7 +160683,7 @@ function playListingAssets(app, locale = "en-US") {
|
|
|
160606
160683
|
for (const name of names) {
|
|
160607
160684
|
const p2 = join76(dir, name);
|
|
160608
160685
|
try {
|
|
160609
|
-
if (
|
|
160686
|
+
if (statSync20(p2).isFile()) return { name, bytes: readFileSync90(p2) };
|
|
160610
160687
|
} catch {
|
|
160611
160688
|
}
|
|
160612
160689
|
}
|
|
@@ -160654,7 +160731,7 @@ function listScreenshots(app, locale = "en-US") {
|
|
|
160654
160731
|
if (existsSync74(legacy)) {
|
|
160655
160732
|
for (const deviceDir of readdirSync33(legacy)) {
|
|
160656
160733
|
const d2 = join76(legacy, deviceDir);
|
|
160657
|
-
if (!
|
|
160734
|
+
if (!statSync20(d2).isDirectory()) continue;
|
|
160658
160735
|
for (const png of readdirSync33(d2).filter((n2) => n2.endsWith(".png"))) {
|
|
160659
160736
|
const sz = pngSize(readFileSync90(join76(d2, png)));
|
|
160660
160737
|
if (sz) out2.push({ name: `${deviceDir}/${png}`, w: sz.w, h: sz.h });
|
|
@@ -160669,7 +160746,7 @@ function placeholderHashes2() {
|
|
|
160669
160746
|
for (const target of readdirSync33(templateIos)) {
|
|
160670
160747
|
const p2 = join76(templateIos, target, "Assets.xcassets", "AppIcon.appiconset", "icon_1024.png");
|
|
160671
160748
|
try {
|
|
160672
|
-
if (!
|
|
160749
|
+
if (!statSync20(p2).isFile()) continue;
|
|
160673
160750
|
return [LEGACY_PLACEHOLDER_SHA2562, createHash39("sha256").update(readFileSync90(p2)).digest("hex")];
|
|
160674
160751
|
} catch {
|
|
160675
160752
|
}
|
|
@@ -160705,7 +160782,7 @@ async function appIconState(iosDir) {
|
|
|
160705
160782
|
for (const target of readdirSync33(iosDir)) {
|
|
160706
160783
|
const p2 = join76(iosDir, target, "Assets.xcassets", "AppIcon.appiconset", "icon_1024.png");
|
|
160707
160784
|
try {
|
|
160708
|
-
if (!
|
|
160785
|
+
if (!statSync20(p2).isFile()) continue;
|
|
160709
160786
|
const bytes2 = readFileSync90(p2);
|
|
160710
160787
|
const hash2 = createHash39("sha256").update(bytes2).digest("hex");
|
|
160711
160788
|
const pixels = await pixelIssues(bytes2);
|
|
@@ -170286,7 +170363,7 @@ var init_customer_build = __esm({
|
|
|
170286
170363
|
});
|
|
170287
170364
|
|
|
170288
170365
|
// src/site-analyze/apply.ts
|
|
170289
|
-
import { existsSync as existsSync77, readFileSync as readFileSync96, writeFileSync as writeFileSync36, copyFileSync as copyFileSync2, mkdirSync as mkdirSync40, realpathSync as realpathSync14, statSync as
|
|
170366
|
+
import { existsSync as existsSync77, readFileSync as readFileSync96, writeFileSync as writeFileSync36, copyFileSync as copyFileSync2, mkdirSync as mkdirSync40, realpathSync as realpathSync14, statSync as statSync21 } from "node:fs";
|
|
170290
170367
|
import { dirname as dirname43, isAbsolute as isAbsolute8, join as join82, resolve as resolve58, sep as sep20 } from "node:path";
|
|
170291
170368
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
170292
170369
|
function unpairedRedirectNote(overlay) {
|
|
@@ -170433,7 +170510,7 @@ function buildMergedContract(options) {
|
|
|
170433
170510
|
}
|
|
170434
170511
|
if (!real.startsWith(realRoot + sep20)) return void 0;
|
|
170435
170512
|
try {
|
|
170436
|
-
if (!
|
|
170513
|
+
if (!statSync21(real).isFile()) return void 0;
|
|
170437
170514
|
mkdirSync40(dirname43(to2), { recursive: true });
|
|
170438
170515
|
copyFileSync2(real, to2);
|
|
170439
170516
|
} catch {
|
|
@@ -172911,7 +172988,7 @@ var init_context = __esm({
|
|
|
172911
172988
|
});
|
|
172912
172989
|
|
|
172913
172990
|
// src/cli.ts
|
|
172914
|
-
import { mkdtempSync as mkdtempSync5, readFileSync as readFileSync99, mkdirSync as mkdirSync41, writeFileSync as writeFileSync38, existsSync as existsSync80, rmSync as rmSync22, readdirSync as readdirSync34, statSync as
|
|
172991
|
+
import { mkdtempSync as mkdtempSync5, readFileSync as readFileSync99, mkdirSync as mkdirSync41, writeFileSync as writeFileSync38, existsSync as existsSync80, rmSync as rmSync22, readdirSync as readdirSync34, statSync as statSync22, lstatSync as lstatSync21, accessSync, constants as constants4, renameSync as renameSync12, cpSync as cpSync3 } from "node:fs";
|
|
172915
172992
|
import { execFile as execFile2, execFileSync as execFileSync7, spawnSync as spawnSync5, spawn as spawn7 } from "node:child_process";
|
|
172916
172993
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
|
|
172917
172994
|
import { createHash as createHash41, randomUUID as randomUUID11 } from "node:crypto";
|
|
@@ -176270,7 +176347,7 @@ function staleUpdateLockFile(cachePath, now) {
|
|
|
176270
176347
|
let since = stamped;
|
|
176271
176348
|
if (!Number.isFinite(since)) {
|
|
176272
176349
|
try {
|
|
176273
|
-
since =
|
|
176350
|
+
since = statSync22(path2).mtimeMs;
|
|
176274
176351
|
} catch {
|
|
176275
176352
|
continue;
|
|
176276
176353
|
}
|
|
@@ -176879,7 +176956,7 @@ function executableOnPath(name, env = process.env) {
|
|
|
176879
176956
|
for (const suffix of suffixes) {
|
|
176880
176957
|
const candidate = join83(dir, `${name}${suffix}`);
|
|
176881
176958
|
try {
|
|
176882
|
-
if (!
|
|
176959
|
+
if (!statSync22(candidate).isFile()) continue;
|
|
176883
176960
|
if (process.platform !== "win32") accessSync(candidate, constants4.X_OK);
|
|
176884
176961
|
return true;
|
|
176885
176962
|
} catch {
|
|
@@ -177101,7 +177178,7 @@ function restoreDestinationIssue(dest, force) {
|
|
|
177101
177178
|
const link = symlinkDestinationIssue(dest);
|
|
177102
177179
|
if (link) return link;
|
|
177103
177180
|
if (!existsSync80(dest)) return null;
|
|
177104
|
-
if (!
|
|
177181
|
+
if (!statSync22(dest).isDirectory()) {
|
|
177105
177182
|
return { error: `${dest} exists and is not a directory`, hint: "pass --out/--name to land somewhere else, or remove the file" };
|
|
177106
177183
|
}
|
|
177107
177184
|
if (readdirSync34(dest).length > 0 && !force) {
|
|
@@ -180139,7 +180216,7 @@ default (no --glyph): ${DEFAULT_GLYPH2} \u2014 a mark that claims nothing, so th
|
|
|
180139
180216
|
return 1;
|
|
180140
180217
|
}
|
|
180141
180218
|
if (existsSync80(dest)) {
|
|
180142
|
-
if (!
|
|
180219
|
+
if (!statSync22(dest).isDirectory()) {
|
|
180143
180220
|
io2.error(JSON.stringify({
|
|
180144
180221
|
error: `${dest} exists and is not a directory`,
|
|
180145
180222
|
hint: "pass --out/--name to land somewhere else, or remove the file"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1337.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
|
|
6
6
|
"keywords": [
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"artifactId": "himalaya-cli"
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
|
-
"falconPackageHash": "
|
|
74
|
+
"falconPackageHash": "c9f0a07698a276263bd2032ecf98c76cc1720a482529c20a0f71d586"
|
|
75
75
|
}
|