@wix/himalaya-cli 0.929.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 +49 -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;
|
|
@@ -38078,6 +38083,7 @@ __export(app_source_exports, {
|
|
|
38078
38083
|
collectAppSource: () => collectAppSource,
|
|
38079
38084
|
deniedArchivePaths: () => deniedArchivePaths,
|
|
38080
38085
|
isDeniedSourcePath: () => isDeniedSourcePath,
|
|
38086
|
+
largestEntries: () => largestEntries,
|
|
38081
38087
|
readAppSource: () => readAppSource,
|
|
38082
38088
|
removeStaleSource: () => removeStaleSource,
|
|
38083
38089
|
secretFindings: () => secretFindings,
|
|
@@ -38088,6 +38094,7 @@ __export(app_source_exports, {
|
|
|
38088
38094
|
});
|
|
38089
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";
|
|
38090
38096
|
import { join as join37, resolve as resolve34, sep as sep7 } from "node:path";
|
|
38097
|
+
import { deflateRawSync as deflateRawSync2 } from "node:zlib";
|
|
38091
38098
|
function walkSourceTree(dir, file, skip) {
|
|
38092
38099
|
const walk2 = (relDir) => {
|
|
38093
38100
|
for (const name of readdirSync21(join37(dir, relDir))) {
|
|
@@ -38098,7 +38105,7 @@ function walkSourceTree(dir, file, skip) {
|
|
|
38098
38105
|
continue;
|
|
38099
38106
|
}
|
|
38100
38107
|
if (st.isDirectory()) {
|
|
38101
|
-
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);
|
|
38102
38109
|
else walk2(rel);
|
|
38103
38110
|
continue;
|
|
38104
38111
|
}
|
|
@@ -38123,6 +38130,17 @@ function collectAppSource(dir) {
|
|
|
38123
38130
|
skipped.sort();
|
|
38124
38131
|
return { entries, skipped };
|
|
38125
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
|
+
}
|
|
38126
38144
|
function secretFindings(entries) {
|
|
38127
38145
|
const out = [];
|
|
38128
38146
|
for (const entry of entries) {
|
|
@@ -38238,7 +38256,7 @@ function pruneEmptyDirs(root, rel, needed, removed) {
|
|
|
38238
38256
|
const childRel = rel ? join37(rel, name) : name;
|
|
38239
38257
|
const posix3 = childRel.split(sep7).join("/");
|
|
38240
38258
|
const kind = lstatSync5(join37(root, childRel));
|
|
38241
|
-
if (kind.isSymbolicLink() || !kind.isDirectory() || isDeniedSourceDir(name)) {
|
|
38259
|
+
if (kind.isSymbolicLink() || !kind.isDirectory() || isDeniedSourceDir(name, rel)) {
|
|
38242
38260
|
empty = false;
|
|
38243
38261
|
continue;
|
|
38244
38262
|
}
|
|
@@ -54358,16 +54376,20 @@ var USAGE = `himi \u2014 the Himalaya authoring CLI (remote dev loop)
|
|
|
54358
54376
|
without it a multi-account caller is told to name one.
|
|
54359
54377
|
--no-source: do NOT archive the content package with the release.
|
|
54360
54378
|
On by default, so himi pull can restore an editable copy.
|
|
54361
|
-
Never archives .himi/, .env*, node_modules/, dist
|
|
54362
|
-
|
|
54363
|
-
|
|
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.
|
|
54364
54385
|
EVERYTHING ELSE under the content directory IS archived,
|
|
54365
|
-
at any depth \u2014
|
|
54386
|
+
at any depth \u2014 notes, fixtures, tests, l10n.
|
|
54366
54387
|
The archive is capped at ${MAX_APP_SOURCE_BYTES_HELP}, measured
|
|
54367
54388
|
base64-encoded (~1.33x the zip's own size); over it the
|
|
54368
|
-
push refuses, naming archivedBytes/encodedBytes/files
|
|
54369
|
-
|
|
54370
|
-
|
|
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.
|
|
54371
54393
|
himi push --only <selector>[,<selector>\u2026] (--draft|--live) [--from-release <id>]
|
|
54372
54394
|
[--accept-regressions] [--accept-partial] [--app <slug>]
|
|
54373
54395
|
publish ONLY the named items, derived from the app's live
|
|
@@ -56176,7 +56198,7 @@ himi v${cliVersion()} \u2014 run \`himi --version\`. If authoring commands fail
|
|
|
56176
56198
|
return 1;
|
|
56177
56199
|
}
|
|
56178
56200
|
payload.source = { files, meta };
|
|
56179
|
-
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));
|
|
56180
56202
|
const templateArchive = collectAppSource2(sourceDir);
|
|
56181
56203
|
const templateSecrets = secretFindings2(templateArchive.entries);
|
|
56182
56204
|
if (templateSecrets.length > 0) {
|
|
@@ -56190,6 +56212,7 @@ himi v${cliVersion()} \u2014 run \`himi --version\`. If authoring commands fail
|
|
|
56190
56212
|
const templateZip = zipAppSource2(templateArchive.entries);
|
|
56191
56213
|
const templateSourceB64 = templateZip.toString("base64");
|
|
56192
56214
|
if (templateSourceB64.length > MAX_APP_SOURCE_BYTES2) {
|
|
56215
|
+
const templateLargest = largestEntries2(templateArchive.entries);
|
|
56193
56216
|
io.error(JSON.stringify({
|
|
56194
56217
|
ok: false,
|
|
56195
56218
|
template: name,
|
|
@@ -56200,10 +56223,11 @@ himi v${cliVersion()} \u2014 run \`himi --version\`. If authoring commands fail
|
|
|
56200
56223
|
encodedBytes: templateSourceB64.length,
|
|
56201
56224
|
limit: MAX_APP_SOURCE_BYTES2,
|
|
56202
56225
|
files: templateArchive.entries.length,
|
|
56226
|
+
largest: templateLargest,
|
|
56203
56227
|
// No `--no-source` here, deliberately: a template's archive is not optional the way
|
|
56204
56228
|
// a push's is. `himi pull` restores templates through it, so a flag that dropped it
|
|
56205
56229
|
// would publish a template nobody can restore — the failure #2423 exists to prevent.
|
|
56206
|
-
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`
|
|
56207
56231
|
}));
|
|
56208
56232
|
return 1;
|
|
56209
56233
|
}
|
|
@@ -57632,7 +57656,7 @@ default (no --glyph): ${DEFAULT_GLYPH2} \u2014 a mark that claims nothing, so th
|
|
|
57632
57656
|
let sourceSummary;
|
|
57633
57657
|
let appSourceB64;
|
|
57634
57658
|
if (flags["no-source"] !== true) {
|
|
57635
|
-
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));
|
|
57636
57660
|
const collected = collectAppSource2(dir);
|
|
57637
57661
|
const findings = secretFindings2(collected.entries);
|
|
57638
57662
|
if (findings.length > 0) {
|
|
@@ -57649,6 +57673,7 @@ default (no --glyph): ${DEFAULT_GLYPH2} \u2014 a mark that claims nothing, so th
|
|
|
57649
57673
|
const zip = zipAppSource2(collected.entries);
|
|
57650
57674
|
const encoded = zip.toString("base64");
|
|
57651
57675
|
if (encoded.length > MAX_APP_SOURCE_BYTES2) {
|
|
57676
|
+
const largest = largestEntries2(collected.entries);
|
|
57652
57677
|
io.error(JSON.stringify({
|
|
57653
57678
|
ok: false,
|
|
57654
57679
|
pushed: false,
|
|
@@ -57657,12 +57682,17 @@ default (no --glyph): ${DEFAULT_GLYPH2} \u2014 a mark that claims nothing, so th
|
|
|
57657
57682
|
encodedBytes: encoded.length,
|
|
57658
57683
|
limit: MAX_APP_SOURCE_BYTES2,
|
|
57659
57684
|
files: collected.entries.length,
|
|
57660
|
-
|
|
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.`
|
|
57661
57687
|
}));
|
|
57662
57688
|
return 1;
|
|
57663
57689
|
}
|
|
57664
57690
|
appSourceB64 = encoded;
|
|
57665
|
-
sourceSummary = {
|
|
57691
|
+
sourceSummary = {
|
|
57692
|
+
files: collected.entries.length,
|
|
57693
|
+
compressed: zip.length,
|
|
57694
|
+
...collected.skipped.length ? { skipped: collected.skipped } : {}
|
|
57695
|
+
};
|
|
57666
57696
|
}
|
|
57667
57697
|
const evidence = pushEvidence(dir, manifest.releaseId, (candidate) => verifyAttestation(candidate, dir, payload.screens, declared, payload, { requireLatest: false }).ok);
|
|
57668
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
|
}
|