@verentis/cli 0.2.11 → 0.2.13

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/README.md CHANGED
@@ -140,6 +140,7 @@ Applications that can open without a selected file opt in through their manifest
140
140
  ```yaml
141
141
  spec:
142
142
  entry: https://app.example.com
143
+ splash: /splash.svg
143
144
  launch:
144
145
  enabled: true
145
146
  entry-point: home
@@ -147,13 +148,16 @@ spec:
147
148
  entry-points:
148
149
  - id: home
149
150
  route: /workspace
151
+ splash: ./workspace-splash.svg
150
152
  ```
151
153
 
152
154
  `verentis init <name> --kind application` includes a commented launch template.
153
155
  `verentis validate` verifies that `launch` is an object, `pinnable` is used only
154
156
  with `enabled`, the selected entry-point id exists, and the launch resolves to
155
- an absolute HTTP(S) iframe URL. Omit `spec.launch` for contextual file handlers
156
- and headless apps.
157
+ an absolute HTTP(S) iframe URL. Splash values must be non-empty URL strings. An
158
+ entry-point splash overrides `spec.splash`; relative values resolve against the
159
+ selected iframe entry URL. Omit `spec.launch` for contextual file handlers and
160
+ headless apps.
157
161
 
158
162
  At runtime this is still an iframe launch: the SDK receives
159
163
  `context.surface === 'workspace'`, a resolved entry point, and no file context.
package/dist/index.js CHANGED
@@ -885,12 +885,36 @@ async function loadManifest(path) {
885
885
  const kind = normalizeKind(manifest.kind);
886
886
  const launchKindError = validateLaunchManifestKind(kind, manifest.spec);
887
887
  if (launchKindError) throw new Error(`Invalid manifest at ${path}: ${launchKindError}.`);
888
+ const splashErrors = validateApplicationSplashSection(kind, manifest.spec);
889
+ if (splashErrors.length > 0) {
890
+ throw new Error(`Invalid manifest at ${path}: ${splashErrors.join(" ")}`);
891
+ }
888
892
  const marketplaceErrors = validateMarketplaceSection(manifest.marketplace);
889
893
  if (marketplaceErrors.length > 0) {
890
894
  throw new Error(`Invalid marketplace section in ${path}: ${marketplaceErrors.join(" ")}`);
891
895
  }
892
896
  return manifest;
893
897
  }
898
+ function validateApplicationSplashSection(kind, spec) {
899
+ if (kind !== "Application" || !spec || typeof spec !== "object" || Array.isArray(spec)) return [];
900
+ const applicationSpec = spec;
901
+ const errors = [];
902
+ const splash = applicationSpec.splash;
903
+ if (splash !== void 0 && (typeof splash !== "string" || splash.trim().length === 0)) {
904
+ errors.push("spec.splash must be a non-empty URL string.");
905
+ }
906
+ const entryPoints = applicationSpec["entry-points"];
907
+ if (Array.isArray(entryPoints)) {
908
+ entryPoints.forEach((value, index) => {
909
+ if (!value || typeof value !== "object" || Array.isArray(value)) return;
910
+ const entryPointSplash = value.splash;
911
+ if (entryPointSplash !== void 0 && (typeof entryPointSplash !== "string" || entryPointSplash.trim().length === 0)) {
912
+ errors.push(`spec.entry-points[${index}].splash must be a non-empty URL string.`);
913
+ }
914
+ });
915
+ }
916
+ return errors;
917
+ }
894
918
  function validateMarketplaceSection(marketplace2) {
895
919
  if (marketplace2 === void 0) return [];
896
920
  if (!marketplace2 || typeof marketplace2 !== "object" || Array.isArray(marketplace2)) {
@@ -1035,6 +1059,7 @@ function validateManifest(manifest) {
1035
1059
  "an Application must declare at least one contribution: spec.entry / spec.entry-points[] (iframe UI), spec.install[] (installed files), or spec.scopes[] (identity)"
1036
1060
  );
1037
1061
  }
1062
+ for (const message of validateApplicationSplashSection(kind, spec)) error(message);
1038
1063
  validateApplicationLaunch(spec, issues);
1039
1064
  }
1040
1065
  validateInstallDirectives(spec.install, issues);
@@ -1126,7 +1151,7 @@ function validateInstallDirectives(install, issues) {
1126
1151
  }
1127
1152
  var SETTING_KEY_PATTERN = /^[a-z0-9]+([.-][a-z0-9]+)*$/;
1128
1153
  var ENV_VAR_PATTERN = /^[A-Z][A-Z0-9_]*$/;
1129
- var SETTING_TYPES = ["string", "number", "boolean", "select"];
1154
+ var SETTING_TYPES = ["string", "number", "boolean", "select", "file"];
1130
1155
  function validateSettingDeclarations(kind, spec, issues) {
1131
1156
  const settings2 = spec.settings;
1132
1157
  if (settings2 === void 0) return;