@wix/himalaya-cli 0.930.0 → 0.931.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 +51 -19
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -765,13 +765,17 @@ import { sep } from "node:path";
|
|
|
765
765
|
function isDeniedSourcePath(relPath) {
|
|
766
766
|
const segments = relPath.split(/[\\/]/).filter(Boolean);
|
|
767
767
|
if (segments.length === 0) return false;
|
|
768
|
-
|
|
768
|
+
const dirs = segments.slice(0, -1);
|
|
769
|
+
if (dirs.some((seg) => DENY_DIRS.has(seg))) return true;
|
|
770
|
+
if (dirs.length > 0 && DENY_ROOT_DIRS.has(dirs[0])) return true;
|
|
769
771
|
return DENY_FILES.some((re) => re.test(segments[segments.length - 1]));
|
|
770
772
|
}
|
|
771
|
-
function isDeniedSourceDir(name) {
|
|
772
|
-
|
|
773
|
+
function isDeniedSourceDir(name, parentRel) {
|
|
774
|
+
const base = name.split(sep).pop() ?? name;
|
|
775
|
+
if (DENY_DIRS.has(base)) return true;
|
|
776
|
+
return parentRel === "" && DENY_ROOT_DIRS.has(base);
|
|
773
777
|
}
|
|
774
|
-
var DENY_DIRS, DENY_FILES, PACKAGE_DIR_MARKER;
|
|
778
|
+
var DENY_DIRS, DENY_ROOT_DIRS, DENY_FILES, PACKAGE_DIR_MARKER;
|
|
775
779
|
var init_source_deny = __esm({
|
|
776
780
|
"src/source-deny.ts"() {
|
|
777
781
|
DENY_DIRS = /* @__PURE__ */ new Set([
|
|
@@ -802,6 +806,7 @@ var init_source_deny = __esm({
|
|
|
802
806
|
"build",
|
|
803
807
|
"__Snapshots__"
|
|
804
808
|
]);
|
|
809
|
+
DENY_ROOT_DIRS = /* @__PURE__ */ new Set(["shots", "evidence"]);
|
|
805
810
|
DENY_FILES = [
|
|
806
811
|
/^\.env$/,
|
|
807
812
|
/^\.env\./,
|
|
@@ -1349,7 +1354,7 @@ function readTemplateFiles(srcRoot) {
|
|
|
1349
1354
|
const st = lstatSync(src);
|
|
1350
1355
|
if (st.isSymbolicLink()) continue;
|
|
1351
1356
|
if (st.isDirectory()) {
|
|
1352
|
-
if (!isDeniedSourceDir(entry)) walk2(rel);
|
|
1357
|
+
if (!isDeniedSourceDir(entry, relDir)) walk2(rel);
|
|
1353
1358
|
continue;
|
|
1354
1359
|
}
|
|
1355
1360
|
if (isDeniedSourcePath(rel)) continue;
|
|
@@ -18526,6 +18531,7 @@ function shouldRevealError(args) {
|
|
|
18526
18531
|
var EMAIL_RE, URL_HOST_RE, INTEGER_RE, NUMBER_RE;
|
|
18527
18532
|
var init_validation = __esm({
|
|
18528
18533
|
"../../core/ts/src/validation.ts"() {
|
|
18534
|
+
"use strict";
|
|
18529
18535
|
EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
|
|
18530
18536
|
URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
|
|
18531
18537
|
INTEGER_RE = /^[+-]?[0-9]+$/;
|
|
@@ -21949,6 +21955,7 @@ function validateWorkerSubtree(raw, slotId, policy, actionCatalog) {
|
|
|
21949
21955
|
var WORKER_SUBTREE_CEILINGS, ID_PART, ACTION_ID;
|
|
21950
21956
|
var init_worker_subtree = __esm({
|
|
21951
21957
|
"../../core/ts/src/worker-subtree.ts"() {
|
|
21958
|
+
"use strict";
|
|
21952
21959
|
init_worker_subtree_safe_types_generated();
|
|
21953
21960
|
WORKER_SUBTREE_CEILINGS = Object.freeze({
|
|
21954
21961
|
maxEncodedBytes: 65536,
|
|
@@ -38076,6 +38083,7 @@ __export(app_source_exports, {
|
|
|
38076
38083
|
collectAppSource: () => collectAppSource,
|
|
38077
38084
|
deniedArchivePaths: () => deniedArchivePaths,
|
|
38078
38085
|
isDeniedSourcePath: () => isDeniedSourcePath,
|
|
38086
|
+
largestEntries: () => largestEntries,
|
|
38079
38087
|
readAppSource: () => readAppSource,
|
|
38080
38088
|
removeStaleSource: () => removeStaleSource,
|
|
38081
38089
|
secretFindings: () => secretFindings,
|
|
@@ -38086,6 +38094,7 @@ __export(app_source_exports, {
|
|
|
38086
38094
|
});
|
|
38087
38095
|
import { readdirSync as readdirSync21, lstatSync as lstatSync5, readFileSync as readFileSync44, mkdirSync as mkdirSync18, writeFileSync as writeFileSync14, existsSync as existsSync38, rmSync as rmSync6, rmdirSync, unlinkSync as unlinkSync3 } from "node:fs";
|
|
38088
38096
|
import { join as join37, resolve as resolve34, sep as sep7 } from "node:path";
|
|
38097
|
+
import { deflateRawSync as deflateRawSync2 } from "node:zlib";
|
|
38089
38098
|
function walkSourceTree(dir, file, skip) {
|
|
38090
38099
|
const walk2 = (relDir) => {
|
|
38091
38100
|
for (const name of readdirSync21(join37(dir, relDir))) {
|
|
@@ -38096,7 +38105,7 @@ function walkSourceTree(dir, file, skip) {
|
|
|
38096
38105
|
continue;
|
|
38097
38106
|
}
|
|
38098
38107
|
if (st.isDirectory()) {
|
|
38099
|
-
if (isDeniedSourceDir(name) || existsSync38(join37(dir, rel, PACKAGE_DIR_MARKER))) skip(rel);
|
|
38108
|
+
if (isDeniedSourceDir(name, relDir) || existsSync38(join37(dir, rel, PACKAGE_DIR_MARKER))) skip(rel);
|
|
38100
38109
|
else walk2(rel);
|
|
38101
38110
|
continue;
|
|
38102
38111
|
}
|
|
@@ -38121,6 +38130,17 @@ function collectAppSource(dir) {
|
|
|
38121
38130
|
skipped.sort();
|
|
38122
38131
|
return { entries, skipped };
|
|
38123
38132
|
}
|
|
38133
|
+
function largestEntries(entries, limit = 5) {
|
|
38134
|
+
return entries.map((e) => ({
|
|
38135
|
+
path: e.path,
|
|
38136
|
+
bytes: e.bytes.length,
|
|
38137
|
+
// MIRRORS THE WRITER EXACTLY, because an estimate that disagrees can reorder this list and
|
|
38138
|
+
// name the wrong file. `writeZip` (release-build/pack.ts) deflates at LEVEL 9 and STORES
|
|
38139
|
+
// the raw bytes whenever deflate did not actually help — tiny and incompressible entries
|
|
38140
|
+
// routinely come out bigger. Default-level deflate over-reports both cases.
|
|
38141
|
+
compressed: Math.min(deflateRawSync2(e.bytes, { level: 9 }).length, e.bytes.length)
|
|
38142
|
+
})).sort((a, b) => b.compressed - a.compressed).slice(0, limit);
|
|
38143
|
+
}
|
|
38124
38144
|
function secretFindings(entries) {
|
|
38125
38145
|
const out = [];
|
|
38126
38146
|
for (const entry of entries) {
|
|
@@ -38236,7 +38256,7 @@ function pruneEmptyDirs(root, rel, needed, removed) {
|
|
|
38236
38256
|
const childRel = rel ? join37(rel, name) : name;
|
|
38237
38257
|
const posix3 = childRel.split(sep7).join("/");
|
|
38238
38258
|
const kind = lstatSync5(join37(root, childRel));
|
|
38239
|
-
if (kind.isSymbolicLink() || !kind.isDirectory() || isDeniedSourceDir(name)) {
|
|
38259
|
+
if (kind.isSymbolicLink() || !kind.isDirectory() || isDeniedSourceDir(name, rel)) {
|
|
38240
38260
|
empty = false;
|
|
38241
38261
|
continue;
|
|
38242
38262
|
}
|
|
@@ -54356,16 +54376,20 @@ var USAGE = `himi \u2014 the Himalaya authoring CLI (remote dev loop)
|
|
|
54356
54376
|
without it a multi-account caller is told to name one.
|
|
54357
54377
|
--no-source: do NOT archive the content package with the release.
|
|
54358
54378
|
On by default, so himi pull can restore an editable copy.
|
|
54359
|
-
Never archives .himi/, .env*, node_modules/, dist
|
|
54360
|
-
|
|
54361
|
-
|
|
54379
|
+
Never archives .himi/, .env*, node_modules/, dist/, the
|
|
54380
|
+
native shells (ios/, android/, macos/, \u2026) or key material,
|
|
54381
|
+
and REFUSES the push if a file it would archive looks like it
|
|
54382
|
+
holds a credential. Tooling output at the PACKAGE ROOT \u2014
|
|
54383
|
+
shots/ and evidence/ \u2014 is excluded too; the same names NESTED
|
|
54384
|
+
(assets/shots/) are app content and ARE archived.
|
|
54362
54385
|
EVERYTHING ELSE under the content directory IS archived,
|
|
54363
|
-
at any depth \u2014
|
|
54386
|
+
at any depth \u2014 notes, fixtures, tests, l10n.
|
|
54364
54387
|
The archive is capped at ${MAX_APP_SOURCE_BYTES_HELP}, measured
|
|
54365
54388
|
base64-encoded (~1.33x the zip's own size); over it the
|
|
54366
|
-
push refuses, naming archivedBytes/encodedBytes/files
|
|
54367
|
-
|
|
54368
|
-
|
|
54389
|
+
push refuses, naming archivedBytes/encodedBytes/files and
|
|
54390
|
+
the LARGEST entries by name \u2014 move those out, or push with
|
|
54391
|
+
--no-source (which costs you himi pull for that release).
|
|
54392
|
+
Not the same limit as the whole publish body.
|
|
54369
54393
|
himi push --only <selector>[,<selector>\u2026] (--draft|--live) [--from-release <id>]
|
|
54370
54394
|
[--accept-regressions] [--accept-partial] [--app <slug>]
|
|
54371
54395
|
publish ONLY the named items, derived from the app's live
|
|
@@ -56174,7 +56198,7 @@ himi v${cliVersion()} \u2014 run \`himi --version\`. If authoring commands fail
|
|
|
56174
56198
|
return 1;
|
|
56175
56199
|
}
|
|
56176
56200
|
payload.source = { files, meta };
|
|
56177
|
-
const { collectAppSource: collectAppSource2, secretFindings: secretFindings2, zipAppSource: zipAppSource2, MAX_APP_SOURCE_BYTES: MAX_APP_SOURCE_BYTES2 } = await Promise.resolve().then(() => (init_app_source(), app_source_exports));
|
|
56201
|
+
const { collectAppSource: collectAppSource2, secretFindings: secretFindings2, zipAppSource: zipAppSource2, largestEntries: largestEntries2, MAX_APP_SOURCE_BYTES: MAX_APP_SOURCE_BYTES2 } = await Promise.resolve().then(() => (init_app_source(), app_source_exports));
|
|
56178
56202
|
const templateArchive = collectAppSource2(sourceDir);
|
|
56179
56203
|
const templateSecrets = secretFindings2(templateArchive.entries);
|
|
56180
56204
|
if (templateSecrets.length > 0) {
|
|
@@ -56188,6 +56212,7 @@ himi v${cliVersion()} \u2014 run \`himi --version\`. If authoring commands fail
|
|
|
56188
56212
|
const templateZip = zipAppSource2(templateArchive.entries);
|
|
56189
56213
|
const templateSourceB64 = templateZip.toString("base64");
|
|
56190
56214
|
if (templateSourceB64.length > MAX_APP_SOURCE_BYTES2) {
|
|
56215
|
+
const templateLargest = largestEntries2(templateArchive.entries);
|
|
56191
56216
|
io.error(JSON.stringify({
|
|
56192
56217
|
ok: false,
|
|
56193
56218
|
template: name,
|
|
@@ -56198,10 +56223,11 @@ himi v${cliVersion()} \u2014 run \`himi --version\`. If authoring commands fail
|
|
|
56198
56223
|
encodedBytes: templateSourceB64.length,
|
|
56199
56224
|
limit: MAX_APP_SOURCE_BYTES2,
|
|
56200
56225
|
files: templateArchive.entries.length,
|
|
56226
|
+
largest: templateLargest,
|
|
56201
56227
|
// No `--no-source` here, deliberately: a template's archive is not optional the way
|
|
56202
56228
|
// a push's is. `himi pull` restores templates through it, so a flag that dropped it
|
|
56203
56229
|
// would publish a template nobody can restore — the failure #2423 exists to prevent.
|
|
56204
|
-
hint:
|
|
56230
|
+
hint: `trim the template's source tree \u2014 the largest entries are ${templateLargest.map((e) => `${e.path} (${Math.round(e.compressed / 1024)} KB compressed)`).join(", ")}. Build output and dependencies are already excluded, and a template's archive is not optional, so there is no flag that publishes without it`
|
|
56205
56231
|
}));
|
|
56206
56232
|
return 1;
|
|
56207
56233
|
}
|
|
@@ -57630,7 +57656,7 @@ default (no --glyph): ${DEFAULT_GLYPH2} \u2014 a mark that claims nothing, so th
|
|
|
57630
57656
|
let sourceSummary;
|
|
57631
57657
|
let appSourceB64;
|
|
57632
57658
|
if (flags["no-source"] !== true) {
|
|
57633
|
-
const { collectAppSource: collectAppSource2, secretFindings: secretFindings2, zipAppSource: zipAppSource2, MAX_APP_SOURCE_BYTES: MAX_APP_SOURCE_BYTES2 } = await Promise.resolve().then(() => (init_app_source(), app_source_exports));
|
|
57659
|
+
const { collectAppSource: collectAppSource2, secretFindings: secretFindings2, zipAppSource: zipAppSource2, largestEntries: largestEntries2, MAX_APP_SOURCE_BYTES: MAX_APP_SOURCE_BYTES2 } = await Promise.resolve().then(() => (init_app_source(), app_source_exports));
|
|
57634
57660
|
const collected = collectAppSource2(dir);
|
|
57635
57661
|
const findings = secretFindings2(collected.entries);
|
|
57636
57662
|
if (findings.length > 0) {
|
|
@@ -57647,6 +57673,7 @@ default (no --glyph): ${DEFAULT_GLYPH2} \u2014 a mark that claims nothing, so th
|
|
|
57647
57673
|
const zip = zipAppSource2(collected.entries);
|
|
57648
57674
|
const encoded = zip.toString("base64");
|
|
57649
57675
|
if (encoded.length > MAX_APP_SOURCE_BYTES2) {
|
|
57676
|
+
const largest = largestEntries2(collected.entries);
|
|
57650
57677
|
io.error(JSON.stringify({
|
|
57651
57678
|
ok: false,
|
|
57652
57679
|
pushed: false,
|
|
@@ -57655,12 +57682,17 @@ default (no --glyph): ${DEFAULT_GLYPH2} \u2014 a mark that claims nothing, so th
|
|
|
57655
57682
|
encodedBytes: encoded.length,
|
|
57656
57683
|
limit: MAX_APP_SOURCE_BYTES2,
|
|
57657
57684
|
files: collected.entries.length,
|
|
57658
|
-
|
|
57685
|
+
largest,
|
|
57686
|
+
hint: `trim the content package \u2014 the largest entries are ${largest.map((e) => `${e.path} (${Math.round(e.compressed / 1024)} KB compressed)`).join(", ")}. Sizes are COMPRESSED, because the cap is measured on the deflated archive \u2014 a big but compressible source file is rarely what costs you it. Build output, dependencies, native shells and tooling output (.himi/, and shots/ + evidence/ at the package root) are already excluded. \`--no-source\` publishes without the archive, but then \`himi pull\` cannot restore this release.`
|
|
57659
57687
|
}));
|
|
57660
57688
|
return 1;
|
|
57661
57689
|
}
|
|
57662
57690
|
appSourceB64 = encoded;
|
|
57663
|
-
sourceSummary = {
|
|
57691
|
+
sourceSummary = {
|
|
57692
|
+
files: collected.entries.length,
|
|
57693
|
+
compressed: zip.length,
|
|
57694
|
+
...collected.skipped.length ? { skipped: collected.skipped } : {}
|
|
57695
|
+
};
|
|
57664
57696
|
}
|
|
57665
57697
|
const evidence = pushEvidence(dir, manifest.releaseId, (candidate) => verifyAttestation(candidate, dir, payload.screens, declared, payload, { requireLatest: false }).ok);
|
|
57666
57698
|
const staleEvidence = evidence.staleRuns > 0 ? `${evidence.staleRuns} retained attestation(s) carry this release id, but none describes the content being published` : null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.931.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": [
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"artifactId": "himalaya-cli"
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
|
-
"falconPackageHash": "
|
|
67
|
+
"falconPackageHash": "f298d0d8711b0afa65d1a4408c19b4d9733bed36e21eac217c908684"
|
|
68
68
|
}
|