@invarn/cibuild 2.0.1 → 2.0.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/yaml/steps/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAoCH;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAi3C7C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/yaml/steps/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqCH;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CA63C7C"}
@@ -24,7 +24,7 @@ import { BitriseSlackStepExecutor } from './bitrise-slack.js';
24
24
  import { BitriseApkInfoStepExecutor } from './bitrise-apk-info.js';
25
25
  import { GooglePlayDeployStepExecutor } from './google-play-deploy.js';
26
26
  import { AppStoreDeployStepExecutor } from './app-store-deploy.js';
27
- import { UiFidelityRenderStepExecutor, DEFAULT_RENDER_SIZE, DEFAULT_SCALE, } from './ui-fidelity-render.js';
27
+ import { UiFidelityRenderStepExecutor, DEFAULT_RENDER_SIZE, DEFAULT_SCALE, DEFAULT_PACKAGE_SOURCE, } from './ui-fidelity-render.js';
28
28
  /**
29
29
  * Initializes the step registry with all available steps
30
30
  * This function should be called once at application startup
@@ -764,14 +764,23 @@ export function initializeStepRegistry() {
764
764
  description: 'Render parameterless SwiftUI views from a SwiftPM package to PNGs with ImageRenderer (no app build, no simulator)',
765
765
  platform: 'ios',
766
766
  inputs: {
767
+ package_source: {
768
+ description: "Where the SwiftPM package comes from: 'repo' (package_path in the checkout) " +
769
+ "or 'inputs' (package.tar.gz shipped in the run-inputs directory)",
770
+ required: false,
771
+ default: DEFAULT_PACKAGE_SOURCE,
772
+ },
767
773
  package_path: {
768
- description: "Path to the user's SwiftPM package containing the screens",
769
- required: true,
774
+ description: "Path to the user's SwiftPM package containing the screens. " +
775
+ "Required when package_source is 'repo' (the default); ignored with 'inputs'",
776
+ required: false,
770
777
  inputType: 'path',
771
778
  },
772
779
  target: {
773
- description: 'SPM library product to import in the render harness',
774
- required: true,
780
+ description: 'SPM library product to import in the render harness. Required when ' +
781
+ "package_source is 'repo'; optional with 'inputs', where it is discovered " +
782
+ 'from the shipped manifest when exactly one library product exists',
783
+ required: false,
775
784
  inputType: 'text',
776
785
  },
777
786
  render_size: {
@@ -28,8 +28,25 @@
28
28
  *
29
29
  * protocol-result.json contains relative paths only: image paths are relative
30
30
  * to the artifacts dir, and error messages are sanitized so absolute runner
31
- * paths (resolved package_path, harness temp dir, compiler diagnostics) are
32
- * rewritten to relative paths or placeholders before they are stored.
31
+ * paths (resolved package_path, harness temp dir, extracted shipped package,
32
+ * compiler diagnostics) are rewritten to relative paths or placeholders
33
+ * before they are stored.
34
+ *
35
+ * The package_source input picks where the SwiftPM package comes from:
36
+ * - "repo" (default): the package lives in the checkout at package_path.
37
+ * Omitting the input generates a byte-identical script to the original
38
+ * step (locked by a snapshot test), and the result document keeps its
39
+ * original { renderer, screens } shape.
40
+ * - "inputs": the caller ships the package as .ci/inputs/package.tar.gz.
41
+ * The archive is extracted into a scratch directory and validated
42
+ * (single package root, Package.swift at its top, bounded extracted
43
+ * size); rendering then proceeds exactly as in repo mode. Validation
44
+ * failures are per-build structured errors (PACKAGE_ARCHIVE_MISSING,
45
+ * PACKAGE_ARCHIVE_INVALID, PACKAGE_MANIFEST_MISSING,
46
+ * PACKAGE_ARCHIVE_TOO_LARGE, PACKAGE_TARGET_UNRESOLVED) recorded as a
47
+ * top-level error object in the result document, distinct from
48
+ * per-screen render errors. With an explicit package_source the result
49
+ * document is { renderer, package_source, error, screens }.
33
50
  */
34
51
  import { BaseStepExecutor } from './base.js';
35
52
  import type { StepDef, CIConfig } from '../../types.js';
@@ -38,10 +55,26 @@ import type { ValidationRequirement } from '../validation-types.js';
38
55
  * Inputs for the ui-fidelity-render step
39
56
  */
40
57
  export interface UiFidelityRenderInputs {
41
- /** Path to the user's SwiftPM package (the package that defines the screens) */
42
- package_path: string;
43
- /** SPM library product/target to import in the render harness */
44
- target: string;
58
+ /**
59
+ * Where the SwiftPM package comes from (default "repo"):
60
+ * - "repo": the package lives in the checkout at package_path (v1
61
+ * behavior; omitting package_source generates a byte-identical script).
62
+ * - "inputs": the package ships as .ci/inputs/package.tar.gz and is
63
+ * extracted, validated, and built from a scratch directory at runtime.
64
+ */
65
+ package_source?: 'repo' | 'inputs';
66
+ /**
67
+ * Path to the user's SwiftPM package (the package that defines the
68
+ * screens). Required in repo mode; ignored with package_source "inputs".
69
+ */
70
+ package_path?: string;
71
+ /**
72
+ * SPM library product/target to import in the render harness. Required in
73
+ * repo mode; optional with package_source "inputs", where it is discovered
74
+ * from the shipped manifest when the package declares exactly one library
75
+ * product.
76
+ */
77
+ target?: string;
45
78
  /** Render size in device points, formatted "<width>x<height>" (default 393x852) */
46
79
  render_size?: string;
47
80
  /** Display scale factor applied to the render (default 2) */
@@ -56,6 +89,22 @@ export interface UiFidelityRenderInputs {
56
89
  export declare const DEFAULT_RENDER_SIZE = "393x852";
57
90
  /** Default display scale (@2x), matching how references are typically exported. */
58
91
  export declare const DEFAULT_SCALE = 2;
92
+ /** Valid values for the package_source input. */
93
+ export declare const PACKAGE_SOURCES: readonly ["repo", "inputs"];
94
+ export type PackageSource = (typeof PACKAGE_SOURCES)[number];
95
+ /** Default package source: the package lives in the repo checkout. */
96
+ export declare const DEFAULT_PACKAGE_SOURCE: PackageSource;
97
+ /** Basename of the shipped package archive inside the run-inputs directory. */
98
+ export declare const PACKAGE_ARCHIVE_BASENAME = "package.tar.gz";
99
+ /**
100
+ * Default cap on the extracted size of a shipped package archive (32 MiB),
101
+ * overridable at runtime via UI_FIDELITY_MAX_PACKAGE_BYTES. The archive
102
+ * arrives through a size-limited dispatch channel (256 KiB), and gzip tops
103
+ * out around a 1000:1 ratio, so this bound is a decompression-bomb guard
104
+ * with enormous headroom for legitimate source slices, which are typically
105
+ * well under 1 MiB extracted.
106
+ */
107
+ export declare const DEFAULT_MAX_EXTRACTED_BYTES: number;
59
108
  export interface RenderSize {
60
109
  width: number;
61
110
  height: number;
@@ -74,13 +123,23 @@ export declare function parseScale(value: number | string): number;
74
123
  * Configuration baked into the generated runtime script at YAML-conversion
75
124
  * time. Everything else (screens, references) is read at runtime from
76
125
  * .ci/inputs/params.json.
126
+ *
127
+ * packageSource is only present when the package_source input was explicitly
128
+ * configured. When absent, the generated script is byte-identical to the
129
+ * pre-package_source script (locked by a snapshot test) and the result
130
+ * document keeps its original `{ renderer, screens }` shape. When present,
131
+ * the result document additionally records `package_source` and a top-level
132
+ * `error` (null, or `{ code, message }` for per-build package failures).
77
133
  */
78
134
  export interface RenderScriptConfig {
79
- packagePath: string;
80
- target: string;
135
+ /** null only with packageSource "inputs", where the package is shipped. */
136
+ packagePath: string | null;
137
+ /** null only with packageSource "inputs", where it may be discovered. */
138
+ target: string | null;
81
139
  width: number;
82
140
  height: number;
83
141
  scale: number;
142
+ packageSource?: PackageSource;
84
143
  }
85
144
  /** Options consumed by the pure Swift-source generators. */
86
145
  export interface HarnessGeneratorOptions {
@@ -106,6 +165,10 @@ export declare function getRenderScriptInternals(): RenderScriptInternals;
106
165
  /**
107
166
  * Generates the self-contained runtime node script for the step.
108
167
  * Pure function of its config — exported so tests can execute the script.
168
+ *
169
+ * When config.packageSource is absent the output is byte-identical to the
170
+ * pre-package_source script (JSON.stringify drops undefined keys, and the
171
+ * unpatched v1 runtime is used).
109
172
  */
110
173
  export declare function generateRenderScript(config: RenderScriptConfig): string;
111
174
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ui-fidelity-render.d.ts","sourceRoot":"","sources":["../../../../src/yaml/steps/ui-fidelity-render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,OAAO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