@wix/himalaya-cli 0.1941.0 → 0.1943.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.
@@ -1926,7 +1926,6 @@ export interface ValidationResult {
1926
1926
  }[];
1927
1927
  }
1928
1928
  export declare class FixtureValidator {
1929
- private ajv;
1930
1929
  private validateFn;
1931
1930
  private tokenRegistry?;
1932
1931
  private allowedComponents?;
@@ -10076,15 +10076,21 @@ var screenDescriptorSchema = {
10076
10076
  }
10077
10077
  }
10078
10078
  };
10079
+ var screenValidateFn;
10080
+ function compileScreenSchema() {
10081
+ if (!screenValidateFn) {
10082
+ const ajv = new import_ajv.default({ allErrors: true, strict: false });
10083
+ (0, import_ajv_formats.default)(ajv);
10084
+ screenValidateFn = ajv.compile(screenDescriptorSchema);
10085
+ }
10086
+ return screenValidateFn;
10087
+ }
10079
10088
  var FixtureValidator = class {
10080
10089
  constructor(options = {}) {
10081
- __publicField(this, "ajv");
10082
10090
  __publicField(this, "validateFn");
10083
10091
  __publicField(this, "tokenRegistry");
10084
10092
  __publicField(this, "allowedComponents");
10085
- this.ajv = new import_ajv.default({ allErrors: true, strict: false });
10086
- (0, import_ajv_formats.default)(this.ajv);
10087
- this.validateFn = this.ajv.compile(screenDescriptorSchema);
10093
+ this.validateFn = compileScreenSchema();
10088
10094
  if (options.tokens) {
10089
10095
  this.tokenRegistry = buildTokenRegistry(options.tokens);
10090
10096
  }
package/dist/cli.mjs CHANGED
@@ -3964,7 +3964,6 @@ var init_himi_package = __esm({
3964
3964
  var ICON_VIEW_BOX, ICON_STROKE_WIDTH, ICON_FALLBACK, ICON_CATALOG, ICON_NORMALIZED_INDEX, ICON_NAMES;
3965
3965
  var init_icon_catalog_generated = __esm({
3966
3966
  "../../core/ts/src/icon-catalog.generated.ts"() {
3967
- "use strict";
3968
3967
  init_define_HHP_CATALOG();
3969
3968
  ICON_VIEW_BOX = 24;
3970
3969
  ICON_STROKE_WIDTH = 2;
@@ -8144,7 +8143,6 @@ function assertExternalUrl(site, value2, where) {
8144
8143
  var WIX_FREE_SITE_HOST_SUFFIXES, SITE_KINDS, SITE_LAYOUTS, SITE_PAGE_TITLES, SITE_TOP_BAR_MAX_ACTIONS, SITE_BUILTIN_NATIVE_SCREENS, SITE_PRIVATE_NATIVE_SCREENS, SITE_SHELL_MAX_TABS, SITE_SCREEN_PREFIX, SITE_PAGE_SCREEN_ID, BASE44_ORIGINS, PAGE_ID, SITE_PAGE_NODE_ID, SITE_SCREEN_FORMS, SITE_NODE_SCREEN_RENDERER, PLACEMENTS, ICONS, SITE_MEMBER_PAGE_SCREENS, SITE_MEMBER_CART_SCREENS, SITE_MEMBER_ONLY_SCREENS;
8145
8144
  var init_site_shell = __esm({
8146
8145
  "../../core/ts/src/site-shell.ts"() {
8147
- "use strict";
8148
8146
  init_define_HHP_CATALOG();
8149
8147
  init_himi_package();
8150
8148
  init_icon_catalog_generated();
@@ -19822,6 +19820,14 @@ var init_tokens = __esm({
19822
19820
  // ../../core/ts/src/validator.ts
19823
19821
  import Ajv2 from "ajv";
19824
19822
  import addFormats from "ajv-formats";
19823
+ function compileScreenSchema() {
19824
+ if (!screenValidateFn) {
19825
+ const ajv2 = new Ajv2({ allErrors: true, strict: false });
19826
+ addFormats(ajv2);
19827
+ screenValidateFn = ajv2.compile(screenDescriptorSchema);
19828
+ }
19829
+ return screenValidateFn;
19830
+ }
19825
19831
  function findUnknownComponents(node4, allowed2, path2 = "$", out2 = []) {
19826
19832
  if (node4 === null || typeof node4 !== "object") return out2;
19827
19833
  if (Array.isArray(node4)) {
@@ -20011,7 +20017,7 @@ function validateWidget(snapshot4) {
20011
20017
  intentViolations
20012
20018
  };
20013
20019
  }
20014
- var screenDescriptorSchema, FixtureValidator, CORE_COMPONENTS, widgetSnapshotSchema, WIDGET_BINDING, VALID_TIMEREF_STYLES, utf8ByteLength, WIDGET_ACTION_IDENTIFIER, MAX_WIDGET_ACTION_TTL_SECONDS, WIDGET_INTENT_RULES, widgetValidateFn;
20020
+ var screenDescriptorSchema, screenValidateFn, FixtureValidator, CORE_COMPONENTS, widgetSnapshotSchema, WIDGET_BINDING, VALID_TIMEREF_STYLES, utf8ByteLength, WIDGET_ACTION_IDENTIFIER, MAX_WIDGET_ACTION_TTL_SECONDS, WIDGET_INTENT_RULES, widgetValidateFn;
20015
20021
  var init_validator = __esm({
20016
20022
  "../../core/ts/src/validator.ts"() {
20017
20023
  init_define_HHP_CATALOG();
@@ -21093,14 +21099,11 @@ var init_validator = __esm({
21093
21099
  }
21094
21100
  };
21095
21101
  FixtureValidator = class {
21096
- ajv;
21097
21102
  validateFn;
21098
21103
  tokenRegistry;
21099
21104
  allowedComponents;
21100
21105
  constructor(options2 = {}) {
21101
- this.ajv = new Ajv2({ allErrors: true, strict: false });
21102
- addFormats(this.ajv);
21103
- this.validateFn = this.ajv.compile(screenDescriptorSchema);
21106
+ this.validateFn = compileScreenSchema();
21104
21107
  if (options2.tokens) {
21105
21108
  this.tokenRegistry = buildTokenRegistry(options2.tokens);
21106
21109
  }
@@ -46063,7 +46066,6 @@ function shouldRevealError(args) {
46063
46066
  var EMAIL_RE, URL_HOST_RE, INTEGER_RE, NUMBER_RE, AUTHORED_PATTERN_LIMIT, authoredPatterns;
46064
46067
  var init_validation = __esm({
46065
46068
  "../../core/ts/src/validation.ts"() {
46066
- "use strict";
46067
46069
  init_define_HHP_CATALOG();
46068
46070
  EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
46069
46071
  URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
@@ -178088,6 +178090,7 @@ __export(template_trim_exports, {
178088
178090
  routeMatcher: () => routeMatcher,
178089
178091
  runTemplateTrim: () => runTemplateTrim,
178090
178092
  trimCapabilities: () => trimCapabilities,
178093
+ trimLineScans: () => trimLineScans,
178091
178094
  workersInUse: () => workersInUse
178092
178095
  });
178093
178096
  import { cpSync, existsSync as existsSync54, mkdirSync as mkdirSync26, readdirSync as readdirSync30, readFileSync as readFileSync58, renameSync as renameSync10, rmSync as rmSync15, statSync as statSync17, writeFileSync as writeFileSync22 } from "node:fs";
@@ -178271,7 +178274,7 @@ function jsonString(literal4, what) {
178271
178274
  try {
178272
178275
  return JSON.parse(literal4);
178273
178276
  } catch (e2) {
178274
- throw new TrimRefusal(`${what} ${literal4} is not a valid JSON string (${e2.message}) \u2014 trim reads the shape \`himi init\` writes; fix the literal or trim by hand (\`himi docs trim-a-template\`)`);
178277
+ throw new TrimRefusal(`${typeof what === "function" ? what() : what} ${literal4} is not a valid JSON string (${e2.message}) \u2014 trim reads the shape \`himi init\` writes; fix the literal or trim by hand (\`himi docs trim-a-template\`)`);
178275
178278
  }
178276
178279
  }
178277
178280
  function bracketEnd(src, open6) {
@@ -178340,7 +178343,7 @@ function parseApp(dev, config) {
178340
178343
  `dev/index.ts line ${lineOf2(dev, pos)}: expected a \`"<screenId>": {\` entry of the SCREENS map \u2014 every screen must be a plain JSON entry inside the \`SCREENS\` literal (no spread, call, computed key or runtime merge such as Object.assign); write generated screens with \`himi template screens --upsert --from <screens.json>\``
178341
178344
  );
178342
178345
  }
178343
- const id = jsonString(m2[1], `dev/index.ts line ${lineOf2(dev, pos)}: the SCREENS key`);
178346
+ const id = jsonString(m2[1], () => `dev/index.ts line ${lineOf2(dev, pos)}: the SCREENS key`);
178344
178347
  const open6 = pos + m2[0].length - 1;
178345
178348
  const close = objectEnd(dev, open6);
178346
178349
  if (close < 0 || dev.slice(close, close + 2) !== ",\n") {
@@ -178371,8 +178374,8 @@ function parseApp(dev, config) {
178371
178374
  TENTRY.lastIndex = pos;
178372
178375
  const m2 = TENTRY.exec(dev);
178373
178376
  if (!m2) throw new TrimRefusal(`dev/index.ts line ${lineOf2(dev, pos)}: expected a \`{ pattern: \u2026, display: \u2026, template: {\u2026} },\` entry of TEMPLATED`);
178374
- const pattern = jsonString(m2[1], `dev/index.ts line ${lineOf2(dev, pos)}: the TEMPLATED pattern`);
178375
- const display = jsonString(m2[2], `dev/index.ts line ${lineOf2(dev, pos)}: the TEMPLATED display`);
178377
+ const pattern = jsonString(m2[1], () => `dev/index.ts line ${lineOf2(dev, pos)}: the TEMPLATED pattern`);
178378
+ const display = jsonString(m2[2], () => `dev/index.ts line ${lineOf2(dev, pos)}: the TEMPLATED display`);
178376
178379
  const lineEnd = dev.indexOf("\n", pos);
178377
178380
  const tk = dev.indexOf("template: {", pos);
178378
178381
  if (tk < 0 || tk > lineEnd) throw new TrimRefusal(`dev/index.ts: the templated route ${display} has no \`template: {\` on its first line`);
@@ -179258,7 +179261,7 @@ function summarize2(errors) {
179258
179261
  const shown3 = errors.slice(0, 5).map(one2).join("; ");
179259
179262
  return errors.length > 5 ? `${shown3}; and ${errors.length - 5} more` : shown3;
179260
179263
  }
179261
- var TrimRefusal, LIT, ATOM, QUANT, CAP, SAFE_ROUTE_PATTERN, lineOf2, isStatic, WORKER_OPEN, entryLabel, isNode6, asItems, NAV_SCREEN_KEYS, WORKER_SCREEN_PARAMS, sorted, refuse3, plural;
179264
+ var TrimRefusal, LIT, ATOM, QUANT, CAP, SAFE_ROUTE_PATTERN, lineScans, trimLineScans, lineOf2, isStatic, WORKER_OPEN, entryLabel, isNode6, asItems, NAV_SCREEN_KEYS, WORKER_SCREEN_PARAMS, sorted, refuse3, plural;
179262
179265
  var init_template_trim = __esm({
179263
179266
  "src/template-trim.ts"() {
179264
179267
  init_define_HHP_CATALOG();
@@ -179285,7 +179288,12 @@ var init_template_trim = __esm({
179285
179288
  SAFE_ROUTE_PATTERN = new RegExp(
179286
179289
  String.raw`^\^${LIT}(?:${CAP}${LIT}|\(\?:(?:${LIT}|\[(?:[^\]\\[]|\\.)+\])${CAP}\)\?)?\$$`
179287
179290
  );
179288
- lineOf2 = (src, at2) => src.slice(0, at2).split("\n").length;
179291
+ lineScans = 0;
179292
+ trimLineScans = () => lineScans;
179293
+ lineOf2 = (src, at2) => {
179294
+ lineScans += 1;
179295
+ return src.slice(0, at2).split("\n").length;
179296
+ };
179289
179297
  isStatic = (id) => typeof id === "string" && id !== "" && !id.startsWith("$");
179290
179298
  WORKER_OPEN = /^tier5\.[A-Za-z0-9_]+\.openMember$/;
179291
179299
  entryLabel = (entry) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1941.0",
3
+ "version": "0.1943.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": [
@@ -82,5 +82,5 @@
82
82
  "artifactId": "himalaya-cli"
83
83
  }
84
84
  },
85
- "falconPackageHash": "635b23931608d6f1d94a646f022e08fe75cd14d736d63431c2a50fbe"
85
+ "falconPackageHash": "11669eba46d47d326aad2fc291ac3db4d64a7469549b319ca54b58ae"
86
86
  }