@invarn/cibuild 1.3.16 → 1.3.17
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.cjs +1 -1
- package/dist/src/cli.d.ts +3 -0
- package/dist/src/cli.d.ts.map +1 -0
- package/dist/src/cli.js +987 -0
- package/dist/src/commands/android-scanner.d.ts +32 -0
- package/dist/src/commands/android-scanner.d.ts.map +1 -0
- package/dist/src/commands/android-scanner.js +667 -0
- package/dist/src/commands/build.d.ts +5 -0
- package/dist/src/commands/build.d.ts.map +1 -0
- package/dist/src/commands/build.js +1096 -0
- package/dist/src/commands/edit.d.ts +3 -0
- package/dist/src/commands/edit.d.ts.map +1 -0
- package/dist/src/commands/edit.js +651 -0
- package/dist/src/commands/file-secret-collector.d.ts +37 -0
- package/dist/src/commands/file-secret-collector.d.ts.map +1 -0
- package/dist/src/commands/file-secret-collector.js +199 -0
- package/dist/src/commands/github-workflow.d.ts +5 -0
- package/dist/src/commands/github-workflow.d.ts.map +1 -0
- package/dist/src/commands/github-workflow.js +45 -0
- package/dist/src/commands/ios-scanner.d.ts +27 -0
- package/dist/src/commands/ios-scanner.d.ts.map +1 -0
- package/dist/src/commands/ios-scanner.js +337 -0
- package/dist/src/commands/reset.d.ts +7 -0
- package/dist/src/commands/reset.d.ts.map +1 -0
- package/dist/src/commands/reset.js +81 -0
- package/dist/src/commands/secrets-sync-workflow.d.ts +15 -0
- package/dist/src/commands/secrets-sync-workflow.d.ts.map +1 -0
- package/dist/src/commands/secrets-sync-workflow.js +255 -0
- package/dist/src/commands/secrets-upload.d.ts +21 -0
- package/dist/src/commands/secrets-upload.d.ts.map +1 -0
- package/dist/src/commands/secrets-upload.js +177 -0
- package/dist/src/commands/secrets-upload.test.d.ts +5 -0
- package/dist/src/commands/secrets-upload.test.d.ts.map +1 -0
- package/dist/src/commands/secrets-upload.test.js +60 -0
- package/dist/src/config.d.ts +3 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +46 -0
- package/dist/src/envman/cli.d.ts +21 -0
- package/dist/src/envman/cli.d.ts.map +1 -0
- package/dist/src/envman/cli.js +240 -0
- package/dist/src/envman/envman.d.ts +83 -0
- package/dist/src/envman/envman.d.ts.map +1 -0
- package/dist/src/envman/envman.js +361 -0
- package/dist/src/envman/envman.test.d.ts +5 -0
- package/dist/src/envman/envman.test.d.ts.map +1 -0
- package/dist/src/envman/envman.test.js +236 -0
- package/dist/src/envman/index.d.ts +23 -0
- package/dist/src/envman/index.d.ts.map +1 -0
- package/dist/src/envman/index.js +23 -0
- package/dist/src/envman/types.d.ts +55 -0
- package/dist/src/envman/types.d.ts.map +1 -0
- package/dist/src/envman/types.js +12 -0
- package/dist/src/lib.d.ts +27 -0
- package/dist/src/lib.d.ts.map +1 -0
- package/dist/src/lib.js +32 -0
- package/dist/src/pipeline.d.ts +3 -0
- package/dist/src/pipeline.d.ts.map +1 -0
- package/dist/src/pipeline.js +57 -0
- package/dist/src/runner.d.ts +17 -0
- package/dist/src/runner.d.ts.map +1 -0
- package/dist/src/runner.js +234 -0
- package/dist/src/types.d.ts +57 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +2 -0
- package/dist/src/yaml/bitrise-compat.d.ts +65 -0
- package/dist/src/yaml/bitrise-compat.d.ts.map +1 -0
- package/dist/src/yaml/bitrise-compat.js +206 -0
- package/dist/src/yaml/bitrise-compat.test.d.ts +5 -0
- package/dist/src/yaml/bitrise-compat.test.d.ts.map +1 -0
- package/dist/src/yaml/bitrise-compat.test.js +347 -0
- package/dist/src/yaml/converter.d.ts +33 -0
- package/dist/src/yaml/converter.d.ts.map +1 -0
- package/dist/src/yaml/converter.js +222 -0
- package/dist/src/yaml/converter.test.d.ts +5 -0
- package/dist/src/yaml/converter.test.d.ts.map +1 -0
- package/dist/src/yaml/converter.test.js +348 -0
- package/dist/src/yaml/e2e.test.d.ts +6 -0
- package/dist/src/yaml/e2e.test.d.ts.map +1 -0
- package/dist/src/yaml/e2e.test.js +446 -0
- package/dist/src/yaml/env-resolver.d.ts +120 -0
- package/dist/src/yaml/env-resolver.d.ts.map +1 -0
- package/dist/src/yaml/env-resolver.js +405 -0
- package/dist/src/yaml/env-resolver.test.d.ts +5 -0
- package/dist/src/yaml/env-resolver.test.d.ts.map +1 -0
- package/dist/src/yaml/env-resolver.test.js +502 -0
- package/dist/src/yaml/interactive-prompts.d.ts +71 -0
- package/dist/src/yaml/interactive-prompts.d.ts.map +1 -0
- package/dist/src/yaml/interactive-prompts.js +258 -0
- package/dist/src/yaml/missing-env-handler.d.ts +45 -0
- package/dist/src/yaml/missing-env-handler.d.ts.map +1 -0
- package/dist/src/yaml/missing-env-handler.js +64 -0
- package/dist/src/yaml/parser.d.ts +33 -0
- package/dist/src/yaml/parser.d.ts.map +1 -0
- package/dist/src/yaml/parser.js +145 -0
- package/dist/src/yaml/pipeline-with-secrets.d.ts +25 -0
- package/dist/src/yaml/pipeline-with-secrets.d.ts.map +1 -0
- package/dist/src/yaml/pipeline-with-secrets.js +76 -0
- package/dist/src/yaml/platform-detector.d.ts +83 -0
- package/dist/src/yaml/platform-detector.d.ts.map +1 -0
- package/dist/src/yaml/platform-detector.js +188 -0
- package/dist/src/yaml/platform-detector.test.d.ts +5 -0
- package/dist/src/yaml/platform-detector.test.d.ts.map +1 -0
- package/dist/src/yaml/platform-detector.test.js +414 -0
- package/dist/src/yaml/preflight-validation.d.ts +40 -0
- package/dist/src/yaml/preflight-validation.d.ts.map +1 -0
- package/dist/src/yaml/preflight-validation.js +152 -0
- package/dist/src/yaml/secrets-manager.d.ts +77 -0
- package/dist/src/yaml/secrets-manager.d.ts.map +1 -0
- package/dist/src/yaml/secrets-manager.js +219 -0
- package/dist/src/yaml/step-validator.d.ts +54 -0
- package/dist/src/yaml/step-validator.d.ts.map +1 -0
- package/dist/src/yaml/step-validator.js +403 -0
- package/dist/src/yaml/steps/android-sign.d.ts +35 -0
- package/dist/src/yaml/steps/android-sign.d.ts.map +1 -0
- package/dist/src/yaml/steps/android-sign.js +147 -0
- package/dist/src/yaml/steps/android-version.d.ts +26 -0
- package/dist/src/yaml/steps/android-version.d.ts.map +1 -0
- package/dist/src/yaml/steps/android-version.js +128 -0
- package/dist/src/yaml/steps/android-version.test.d.ts +5 -0
- package/dist/src/yaml/steps/android-version.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/android-version.test.js +196 -0
- package/dist/src/yaml/steps/android.d.ts +95 -0
- package/dist/src/yaml/steps/android.d.ts.map +1 -0
- package/dist/src/yaml/steps/android.js +916 -0
- package/dist/src/yaml/steps/app-store-deploy.d.ts +48 -0
- package/dist/src/yaml/steps/app-store-deploy.d.ts.map +1 -0
- package/dist/src/yaml/steps/app-store-deploy.js +162 -0
- package/dist/src/yaml/steps/base.d.ts +238 -0
- package/dist/src/yaml/steps/base.d.ts.map +1 -0
- package/dist/src/yaml/steps/base.js +345 -0
- package/dist/src/yaml/steps/bitrise-android-tools.d.ts +26 -0
- package/dist/src/yaml/steps/bitrise-android-tools.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-android-tools.js +198 -0
- package/dist/src/yaml/steps/bitrise-android-tools.test.d.ts +5 -0
- package/dist/src/yaml/steps/bitrise-android-tools.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-android-tools.test.js +280 -0
- package/dist/src/yaml/steps/bitrise-apk-info.d.ts +22 -0
- package/dist/src/yaml/steps/bitrise-apk-info.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-apk-info.js +144 -0
- package/dist/src/yaml/steps/bitrise-apk-info.test.d.ts +5 -0
- package/dist/src/yaml/steps/bitrise-apk-info.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-apk-info.test.js +331 -0
- package/dist/src/yaml/steps/bitrise-slack.d.ts +49 -0
- package/dist/src/yaml/steps/bitrise-slack.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-slack.js +280 -0
- package/dist/src/yaml/steps/bitrise-slack.test.d.ts +5 -0
- package/dist/src/yaml/steps/bitrise-slack.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-slack.test.js +484 -0
- package/dist/src/yaml/steps/bitrise-ssh.d.ts +27 -0
- package/dist/src/yaml/steps/bitrise-ssh.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-ssh.js +134 -0
- package/dist/src/yaml/steps/bitrise-ssh.test.d.ts +5 -0
- package/dist/src/yaml/steps/bitrise-ssh.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-ssh.test.js +205 -0
- package/dist/src/yaml/steps/cache.d.ts +52 -0
- package/dist/src/yaml/steps/cache.d.ts.map +1 -0
- package/dist/src/yaml/steps/cache.js +351 -0
- package/dist/src/yaml/steps/fastlane.d.ts +27 -0
- package/dist/src/yaml/steps/fastlane.d.ts.map +1 -0
- package/dist/src/yaml/steps/fastlane.js +79 -0
- package/dist/src/yaml/steps/file.d.ts +27 -0
- package/dist/src/yaml/steps/file.d.ts.map +1 -0
- package/dist/src/yaml/steps/file.js +35 -0
- package/dist/src/yaml/steps/flutter.d.ts +63 -0
- package/dist/src/yaml/steps/flutter.d.ts.map +1 -0
- package/dist/src/yaml/steps/flutter.js +215 -0
- package/dist/src/yaml/steps/git-clone.d.ts +26 -0
- package/dist/src/yaml/steps/git-clone.d.ts.map +1 -0
- package/dist/src/yaml/steps/git-clone.js +111 -0
- package/dist/src/yaml/steps/google-play-deploy.d.ts +37 -0
- package/dist/src/yaml/steps/google-play-deploy.d.ts.map +1 -0
- package/dist/src/yaml/steps/google-play-deploy.js +193 -0
- package/dist/src/yaml/steps/google-play-deploy.test.d.ts +5 -0
- package/dist/src/yaml/steps/google-play-deploy.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/google-play-deploy.test.js +310 -0
- package/dist/src/yaml/steps/index.d.ts +10 -0
- package/dist/src/yaml/steps/index.d.ts.map +1 -0
- package/dist/src/yaml/steps/index.js +1361 -0
- package/dist/src/yaml/steps/ios-deps.d.ts +43 -0
- package/dist/src/yaml/steps/ios-deps.d.ts.map +1 -0
- package/dist/src/yaml/steps/ios-deps.js +141 -0
- package/dist/src/yaml/steps/ios-deps.test.d.ts +5 -0
- package/dist/src/yaml/steps/ios-deps.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/ios-deps.test.js +90 -0
- package/dist/src/yaml/steps/ios-signing.d.ts +31 -0
- package/dist/src/yaml/steps/ios-signing.d.ts.map +1 -0
- package/dist/src/yaml/steps/ios-signing.js +144 -0
- package/dist/src/yaml/steps/ios-version.d.ts +47 -0
- package/dist/src/yaml/steps/ios-version.d.ts.map +1 -0
- package/dist/src/yaml/steps/ios-version.js +151 -0
- package/dist/src/yaml/steps/linting.d.ts +47 -0
- package/dist/src/yaml/steps/linting.d.ts.map +1 -0
- package/dist/src/yaml/steps/linting.js +148 -0
- package/dist/src/yaml/steps/phase2.test.d.ts +6 -0
- package/dist/src/yaml/steps/phase2.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/phase2.test.js +197 -0
- package/dist/src/yaml/steps/phase3.test.d.ts +5 -0
- package/dist/src/yaml/steps/phase3.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/phase3.test.js +144 -0
- package/dist/src/yaml/steps/phase4.test.d.ts +5 -0
- package/dist/src/yaml/steps/phase4.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/phase4.test.js +166 -0
- package/dist/src/yaml/steps/phase5.test.d.ts +6 -0
- package/dist/src/yaml/steps/phase5.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/phase5.test.js +263 -0
- package/dist/src/yaml/steps/registry.d.ts +88 -0
- package/dist/src/yaml/steps/registry.d.ts.map +1 -0
- package/dist/src/yaml/steps/registry.js +125 -0
- package/dist/src/yaml/steps/registry.test.d.ts +5 -0
- package/dist/src/yaml/steps/registry.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/registry.test.js +235 -0
- package/dist/src/yaml/steps/release.d.ts +50 -0
- package/dist/src/yaml/steps/release.d.ts.map +1 -0
- package/dist/src/yaml/steps/release.js +154 -0
- package/dist/src/yaml/steps/script.d.ts +23 -0
- package/dist/src/yaml/steps/script.d.ts.map +1 -0
- package/dist/src/yaml/steps/script.js +63 -0
- package/dist/src/yaml/steps/spec-validation.test.d.ts +6 -0
- package/dist/src/yaml/steps/spec-validation.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/spec-validation.test.js +130 -0
- package/dist/src/yaml/steps/steps.test.d.ts +6 -0
- package/dist/src/yaml/steps/steps.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/steps.test.js +474 -0
- package/dist/src/yaml/steps/test-config.d.ts +3 -0
- package/dist/src/yaml/steps/test-config.d.ts.map +1 -0
- package/dist/src/yaml/steps/test-config.js +16 -0
- package/dist/src/yaml/steps/xcode-new.test.d.ts +5 -0
- package/dist/src/yaml/steps/xcode-new.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/xcode-new.test.js +211 -0
- package/dist/src/yaml/steps/xcode.d.ts +222 -0
- package/dist/src/yaml/steps/xcode.d.ts.map +1 -0
- package/dist/src/yaml/steps/xcode.js +999 -0
- package/dist/src/yaml/types.d.ts +68 -0
- package/dist/src/yaml/types.d.ts.map +1 -0
- package/dist/src/yaml/types.js +5 -0
- package/dist/src/yaml/validation-types.d.ts +96 -0
- package/dist/src/yaml/validation-types.d.ts.map +1 -0
- package/dist/src/yaml/validation-types.js +8 -0
- package/dist/src/yaml/yaml-updater.d.ts +24 -0
- package/dist/src/yaml/yaml-updater.d.ts.map +1 -0
- package/dist/src/yaml/yaml-updater.js +128 -0
- package/package.json +16 -4
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for the CI Build Environment Variable Manager (envman)
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* A single environment variable entry in the store
|
|
6
|
+
*/
|
|
7
|
+
export interface EnvEntry {
|
|
8
|
+
key: string;
|
|
9
|
+
value: string;
|
|
10
|
+
sensitive?: boolean;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The environment variable store structure
|
|
16
|
+
*/
|
|
17
|
+
export interface EnvStore {
|
|
18
|
+
version: string;
|
|
19
|
+
envs: EnvEntry[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Options for adding an environment variable
|
|
23
|
+
*/
|
|
24
|
+
export interface AddOptions {
|
|
25
|
+
key: string;
|
|
26
|
+
value?: string;
|
|
27
|
+
valueFile?: string;
|
|
28
|
+
sensitive?: boolean;
|
|
29
|
+
skipIfEmpty?: boolean;
|
|
30
|
+
append?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Options for running a command with environment variables
|
|
34
|
+
*/
|
|
35
|
+
export interface RunOptions {
|
|
36
|
+
command: string[];
|
|
37
|
+
expandEnvs?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Result of an envman operation
|
|
41
|
+
*/
|
|
42
|
+
export interface EnvmanResult {
|
|
43
|
+
success: boolean;
|
|
44
|
+
message?: string;
|
|
45
|
+
error?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Default store file name
|
|
49
|
+
*/
|
|
50
|
+
export declare const DEFAULT_STORE_FILE = ".envstore.json";
|
|
51
|
+
/**
|
|
52
|
+
* Current store version
|
|
53
|
+
*/
|
|
54
|
+
export declare const STORE_VERSION = "1.0.0";
|
|
55
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/envman/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,QAAQ,EAAE,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,mBAAmB,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,aAAa,UAAU,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for the CI Build Environment Variable Manager (envman)
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Default store file name
|
|
6
|
+
*/
|
|
7
|
+
export const DEFAULT_STORE_FILE = '.envstore.json';
|
|
8
|
+
/**
|
|
9
|
+
* Current store version
|
|
10
|
+
*/
|
|
11
|
+
export const STORE_VERSION = '1.0.0';
|
|
12
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @invarn/cibuild library API
|
|
3
|
+
*
|
|
4
|
+
* Programmatic access to cibuild pipeline parsing, conversion, and execution.
|
|
5
|
+
* This is the non-interactive library surface — no prompts, no TTY dependencies.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* import {
|
|
9
|
+
* loadYAMLPipeline,
|
|
10
|
+
* convertYAMLToPipelineDef,
|
|
11
|
+
* PipelineRunner,
|
|
12
|
+
* loadConfig,
|
|
13
|
+
* } from '@invarn/cibuild/lib';
|
|
14
|
+
*/
|
|
15
|
+
import './yaml/steps/index.js';
|
|
16
|
+
export { PipelineRunner, StepExecutionError } from './runner.js';
|
|
17
|
+
export { loadConfig } from './config.js';
|
|
18
|
+
export { loadYAMLPipeline, getWorkflowNames, hasWorkflow, YAMLParseError, YAMLValidationError, } from './yaml/parser.js';
|
|
19
|
+
export { convertYAMLToPipelineDef, getAvailableWorkflows, YAMLConversionError, } from './yaml/converter.js';
|
|
20
|
+
export type { ConversionResult } from './yaml/converter.js';
|
|
21
|
+
export { pipeline } from './pipeline.js';
|
|
22
|
+
export { getStepExecutor, hasStep, getAvailableSteps, registerStep, getStepMetadata, } from './yaml/steps/registry.js';
|
|
23
|
+
export type { StepDef, PipelineDef, CIConfig, PipelineFactory, PipelineContext, StepBuilders, } from './types.js';
|
|
24
|
+
export type { StepExecutor, StepMetadata, StepPlatform, StepExecutionContext, } from './yaml/steps/base.js';
|
|
25
|
+
export type { YAMLPipeline, YAMLWorkflow, YAMLStep, YAMLStepInputs, YAMLEnvVar, YAMLApp, YAMLMeta, ParsedStep, PlatformInfo, Platform, MachineType, } from './yaml/types.js';
|
|
26
|
+
export { MissingEnvironmentVariableError } from './yaml/env-resolver.js';
|
|
27
|
+
//# sourceMappingURL=lib.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,uBAAuB,CAAC;AAI/B,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAIjE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAI5D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAIzC,OAAO,EACL,eAAe,EACf,OAAO,EACP,iBAAiB,EACjB,YAAY,EACZ,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAIlC,YAAY,EACV,OAAO,EACP,WAAW,EACX,QAAQ,EACR,eAAe,EACf,eAAe,EACf,YAAY,GACb,MAAM,YAAY,CAAC;AAIpB,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAI9B,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,UAAU,EACV,OAAO,EACP,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,WAAW,GACZ,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/src/lib.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @invarn/cibuild library API
|
|
3
|
+
*
|
|
4
|
+
* Programmatic access to cibuild pipeline parsing, conversion, and execution.
|
|
5
|
+
* This is the non-interactive library surface — no prompts, no TTY dependencies.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* import {
|
|
9
|
+
* loadYAMLPipeline,
|
|
10
|
+
* convertYAMLToPipelineDef,
|
|
11
|
+
* PipelineRunner,
|
|
12
|
+
* loadConfig,
|
|
13
|
+
* } from '@invarn/cibuild/lib';
|
|
14
|
+
*/
|
|
15
|
+
// Side-effect: initialize the step registry (registers all step executors).
|
|
16
|
+
// Must run before any convertYAMLToPipelineDef call.
|
|
17
|
+
import './yaml/steps/index.js';
|
|
18
|
+
// ─── Runner ─────────────────────────────────────────────────────────────
|
|
19
|
+
export { PipelineRunner, StepExecutionError } from './runner.js';
|
|
20
|
+
// ─── Config ─────────────────────────────────────────────────────────────
|
|
21
|
+
export { loadConfig } from './config.js';
|
|
22
|
+
// ─── YAML parser ────────────────────────────────────────────────────────
|
|
23
|
+
export { loadYAMLPipeline, getWorkflowNames, hasWorkflow, YAMLParseError, YAMLValidationError, } from './yaml/parser.js';
|
|
24
|
+
// ─── YAML converter (non-interactive) ───────────────────────────────────
|
|
25
|
+
export { convertYAMLToPipelineDef, getAvailableWorkflows, YAMLConversionError, } from './yaml/converter.js';
|
|
26
|
+
// ─── Pipeline DSL factory ───────────────────────────────────────────────
|
|
27
|
+
export { pipeline } from './pipeline.js';
|
|
28
|
+
// ─── Step registry ──────────────────────────────────────────────────────
|
|
29
|
+
export { getStepExecutor, hasStep, getAvailableSteps, registerStep, getStepMetadata, } from './yaml/steps/registry.js';
|
|
30
|
+
// ─── Error types ────────────────────────────────────────────────────────
|
|
31
|
+
export { MissingEnvironmentVariableError } from './yaml/env-resolver.js';
|
|
32
|
+
//# sourceMappingURL=lib.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA8C,eAAe,EAAE,MAAM,YAAY,CAAC;AAE9F,eAAO,MAAM,QAAQ,EAAE,eAmEtB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export const pipeline = (name, builder) => {
|
|
2
|
+
const def = {
|
|
3
|
+
name,
|
|
4
|
+
artifacts: [],
|
|
5
|
+
steps: [],
|
|
6
|
+
stepsOrder: [],
|
|
7
|
+
};
|
|
8
|
+
const stepBuilders = {
|
|
9
|
+
script(name, options) {
|
|
10
|
+
def.steps.push({
|
|
11
|
+
id: options.id,
|
|
12
|
+
name,
|
|
13
|
+
kind: "script",
|
|
14
|
+
shell: options.shell,
|
|
15
|
+
script: options.script,
|
|
16
|
+
});
|
|
17
|
+
},
|
|
18
|
+
python(name, options) {
|
|
19
|
+
def.steps.push({
|
|
20
|
+
id: options.id,
|
|
21
|
+
name,
|
|
22
|
+
kind: "python",
|
|
23
|
+
script: options.script,
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
ruby(name, options) {
|
|
27
|
+
def.steps.push({
|
|
28
|
+
id: options.id,
|
|
29
|
+
name,
|
|
30
|
+
kind: "ruby",
|
|
31
|
+
script: options.script,
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
node(name, options) {
|
|
35
|
+
def.steps.push({
|
|
36
|
+
id: options.id,
|
|
37
|
+
name,
|
|
38
|
+
kind: "node",
|
|
39
|
+
script: options.script,
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
const pipelineContext = {
|
|
44
|
+
artifacts(paths) {
|
|
45
|
+
def.artifacts = paths;
|
|
46
|
+
},
|
|
47
|
+
steps(builder) {
|
|
48
|
+
builder(stepBuilders);
|
|
49
|
+
},
|
|
50
|
+
stepsOrder(ids) {
|
|
51
|
+
def.stepsOrder = ids;
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
builder(pipelineContext);
|
|
55
|
+
return def;
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=pipeline.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { StepDef, PipelineDef, CIConfig } from "./types.js";
|
|
2
|
+
export declare class StepExecutionError extends Error {
|
|
3
|
+
stepId: string;
|
|
4
|
+
stepName: string;
|
|
5
|
+
exitCode: number;
|
|
6
|
+
constructor(stepId: string, stepName: string, exitCode: number);
|
|
7
|
+
}
|
|
8
|
+
export declare class PipelineRunner {
|
|
9
|
+
private config;
|
|
10
|
+
constructor(config: CIConfig);
|
|
11
|
+
runStep(step: StepDef): Promise<void>;
|
|
12
|
+
private formatDuration;
|
|
13
|
+
validatePipeline(pipeline: PipelineDef): void;
|
|
14
|
+
displayWarnings(warnings: string[], skippedSteps: number): void;
|
|
15
|
+
runPipeline(pipeline: PipelineDef, warnings?: string[], skippedSteps?: number): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/runner.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKjE,qBAAa,kBAAmB,SAAQ,KAAK;IAElC,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,MAAM;gBAFhB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM;CAK1B;AAED,qBAAa,cAAc;IACb,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,QAAQ;IAE9B,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAsI3C,OAAO,CAAC,cAAc;IAYtB,gBAAgB,CAAC,QAAQ,EAAE,WAAW,GAAG,IAAI;IAwB7C,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI;IAczD,WAAW,CAAC,QAAQ,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CA0CpG"}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { dirname, join, resolve } from "node:path";
|
|
3
|
+
import { unlinkSync, existsSync, writeFileSync, chmodSync, mkdtempSync, rmSync, mkdirSync } from "node:fs";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
// Use absolute path for envstore so it works regardless of cd in scripts
|
|
6
|
+
const ENVMAN_ENVSTORE_PATH = resolve(process.cwd(), ".ci", ".envstore.json");
|
|
7
|
+
export class StepExecutionError extends Error {
|
|
8
|
+
stepId;
|
|
9
|
+
stepName;
|
|
10
|
+
exitCode;
|
|
11
|
+
constructor(stepId, stepName, exitCode) {
|
|
12
|
+
super(`Step "${stepName}" failed with exit code ${exitCode}`);
|
|
13
|
+
this.stepId = stepId;
|
|
14
|
+
this.stepName = stepName;
|
|
15
|
+
this.exitCode = exitCode;
|
|
16
|
+
this.name = "StepExecutionError";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export class PipelineRunner {
|
|
20
|
+
config;
|
|
21
|
+
constructor(config) {
|
|
22
|
+
this.config = config;
|
|
23
|
+
}
|
|
24
|
+
async runStep(step) {
|
|
25
|
+
console.log(`\n[${step.id}] Running: ${step.name}`);
|
|
26
|
+
console.log("─".repeat(60));
|
|
27
|
+
const startTime = Date.now();
|
|
28
|
+
return new Promise((resolve, reject) => {
|
|
29
|
+
let cmd;
|
|
30
|
+
let args;
|
|
31
|
+
let tmpScriptPath;
|
|
32
|
+
switch (step.kind) {
|
|
33
|
+
case "script":
|
|
34
|
+
// Write script to a temporary file to avoid issues with nested command substitutions
|
|
35
|
+
// when passing complex scripts via -c
|
|
36
|
+
cmd = step.shell ?? this.config.interpreters.bash;
|
|
37
|
+
try {
|
|
38
|
+
const tmpDir = mkdtempSync(join(tmpdir(), 'cibuild-script-'));
|
|
39
|
+
tmpScriptPath = join(tmpDir, `step-${step.id || 'script'}.sh`);
|
|
40
|
+
// Prepend envman shell function that writes directly to the envstore JSON file.
|
|
41
|
+
// This avoids calling the ci binary (pkg binaries have issues with subcommands).
|
|
42
|
+
const envmanShim = `envman() {
|
|
43
|
+
local cmd="\$1"; shift
|
|
44
|
+
local store="\${ENVMAN_ENVSTORE_PATH:-.ci/.envstore.json}"
|
|
45
|
+
case "\$cmd" in
|
|
46
|
+
add)
|
|
47
|
+
local key="" value="" valuefile="" sensitive=false skipifempty=false append=false
|
|
48
|
+
while [ \$# -gt 0 ]; do
|
|
49
|
+
case "\$1" in
|
|
50
|
+
--key|-k) key="\$2"; shift 2 ;;
|
|
51
|
+
--value|-v) value="\$2"; shift 2 ;;
|
|
52
|
+
--valuefile|-f) valuefile="\$2"; shift 2 ;;
|
|
53
|
+
--sensitive|-s) sensitive=true; shift ;;
|
|
54
|
+
--skip-if-empty) skipifempty=true; shift ;;
|
|
55
|
+
--append|-a) append=true; shift ;;
|
|
56
|
+
*) shift ;;
|
|
57
|
+
esac
|
|
58
|
+
done
|
|
59
|
+
[ -z "\$key" ] && { echo "envman add: --key required" >&2; return 1; }
|
|
60
|
+
if [ -n "\$valuefile" ]; then
|
|
61
|
+
value="\$(cat "\$valuefile")"
|
|
62
|
+
elif [ -z "\$value" ] && ! [ -t 0 ]; then
|
|
63
|
+
value="\$(cat)"
|
|
64
|
+
fi
|
|
65
|
+
[ "\$skipifempty" = true ] && [ -z "\$value" ] && return 0
|
|
66
|
+
node -e '
|
|
67
|
+
const fs=require("fs");
|
|
68
|
+
const f=process.argv[1], k=process.argv[2], v=process.argv[3];
|
|
69
|
+
const s=process.argv[4]==="true", a=process.argv[5]==="true";
|
|
70
|
+
let store={envs:[]};
|
|
71
|
+
try{store=JSON.parse(fs.readFileSync(f,"utf-8"))}catch{}
|
|
72
|
+
const idx=store.envs.findIndex(e=>e.key===k);
|
|
73
|
+
if(a && idx>=0){store.envs[idx].value+=v}
|
|
74
|
+
else if(idx>=0){store.envs[idx].value=v;store.envs[idx].sensitive=s}
|
|
75
|
+
else{store.envs.push({key:k,value:v,sensitive:s})}
|
|
76
|
+
fs.mkdirSync(require("path").dirname(f),{recursive:true});
|
|
77
|
+
fs.writeFileSync(f,JSON.stringify(store,null,2));
|
|
78
|
+
' "\$store" "\$key" "\$value" "\$sensitive" "\$append"
|
|
79
|
+
echo "envman: \$key set"
|
|
80
|
+
;;
|
|
81
|
+
init)
|
|
82
|
+
node -e 'const fs=require("fs");const f=process.argv[1];fs.mkdirSync(require("path").dirname(f),{recursive:true});fs.writeFileSync(f,JSON.stringify({envs:[]},null,2))' "\$store"
|
|
83
|
+
;;
|
|
84
|
+
*)
|
|
85
|
+
echo "envman: unknown command: \$cmd" >&2; return 1
|
|
86
|
+
;;
|
|
87
|
+
esac
|
|
88
|
+
}
|
|
89
|
+
export -f envman
|
|
90
|
+
`;
|
|
91
|
+
writeFileSync(tmpScriptPath, envmanShim + step.script, 'utf-8');
|
|
92
|
+
chmodSync(tmpScriptPath, 0o755);
|
|
93
|
+
args = ["-l", tmpScriptPath];
|
|
94
|
+
}
|
|
95
|
+
catch (err) {
|
|
96
|
+
reject(new Error(`Failed to create temporary script file: ${err}`));
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
break;
|
|
100
|
+
case "python":
|
|
101
|
+
cmd = this.config.interpreters.python;
|
|
102
|
+
args = ["-c", step.script];
|
|
103
|
+
break;
|
|
104
|
+
case "ruby":
|
|
105
|
+
cmd = this.config.interpreters.ruby;
|
|
106
|
+
args = ["-e", step.script];
|
|
107
|
+
break;
|
|
108
|
+
case "node":
|
|
109
|
+
cmd = this.config.interpreters.node;
|
|
110
|
+
args = ["-e", step.script];
|
|
111
|
+
break;
|
|
112
|
+
default:
|
|
113
|
+
reject(new Error(`Unknown step kind: ${step.kind}`));
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
// Set envstore path so envman works regardless of cd in scripts
|
|
117
|
+
const env = {
|
|
118
|
+
...process.env,
|
|
119
|
+
ENVMAN_ENVSTORE_PATH,
|
|
120
|
+
};
|
|
121
|
+
const child = spawn(cmd, args, {
|
|
122
|
+
stdio: "inherit",
|
|
123
|
+
shell: false,
|
|
124
|
+
env,
|
|
125
|
+
});
|
|
126
|
+
const cleanupTmp = () => {
|
|
127
|
+
if (tmpScriptPath) {
|
|
128
|
+
try {
|
|
129
|
+
rmSync(dirname(tmpScriptPath), { recursive: true, force: true });
|
|
130
|
+
}
|
|
131
|
+
catch { }
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
child.on("error", (err) => {
|
|
135
|
+
cleanupTmp();
|
|
136
|
+
reject(new Error(`Failed to spawn ${cmd}: ${err.message}`));
|
|
137
|
+
});
|
|
138
|
+
child.on("exit", (code) => {
|
|
139
|
+
const duration = Date.now() - startTime;
|
|
140
|
+
const durationStr = this.formatDuration(duration);
|
|
141
|
+
cleanupTmp();
|
|
142
|
+
if (code === 0) {
|
|
143
|
+
console.log(`[${step.id}] ✓ Success (${durationStr})\n`);
|
|
144
|
+
resolve();
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
reject(new StepExecutionError(step.id, step.name, code ?? 1));
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
formatDuration(ms) {
|
|
153
|
+
if (ms < 1000) {
|
|
154
|
+
return `${ms}ms`;
|
|
155
|
+
}
|
|
156
|
+
else if (ms < 60000) {
|
|
157
|
+
return `${(ms / 1000).toFixed(1)}s`;
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
const minutes = Math.floor(ms / 60000);
|
|
161
|
+
const seconds = Math.floor((ms % 60000) / 1000);
|
|
162
|
+
return `${minutes}m ${seconds}s`;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
validatePipeline(pipeline) {
|
|
166
|
+
const stepIds = new Set(pipeline.steps.map((s) => s.id));
|
|
167
|
+
const duplicates = pipeline.steps
|
|
168
|
+
.map((s) => s.id)
|
|
169
|
+
.filter((id, index, arr) => arr.indexOf(id) !== index);
|
|
170
|
+
if (duplicates.length > 0) {
|
|
171
|
+
throw new Error(`Duplicate step IDs found: ${duplicates.join(", ")}`);
|
|
172
|
+
}
|
|
173
|
+
for (const orderId of pipeline.stepsOrder) {
|
|
174
|
+
if (!stepIds.has(orderId)) {
|
|
175
|
+
throw new Error(`Step ID "${orderId}" in stepsOrder not found in steps`);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if (pipeline.stepsOrder.length !== pipeline.steps.length) {
|
|
179
|
+
const missingIds = pipeline.steps
|
|
180
|
+
.filter((s) => !pipeline.stepsOrder.includes(s.id))
|
|
181
|
+
.map((s) => s.id);
|
|
182
|
+
throw new Error(`Some steps are not in stepsOrder: ${missingIds.join(", ")}`);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
displayWarnings(warnings, skippedSteps) {
|
|
186
|
+
console.log("\n" + "═".repeat(60));
|
|
187
|
+
console.log("⚠️ UNSUPPORTED STEPS DETECTED");
|
|
188
|
+
console.log("═".repeat(60));
|
|
189
|
+
warnings.forEach((warning) => {
|
|
190
|
+
console.log(warning);
|
|
191
|
+
});
|
|
192
|
+
console.log("─".repeat(60));
|
|
193
|
+
console.log(`ℹ️ Skipped ${skippedSteps} unsupported step${skippedSteps !== 1 ? 's' : ''}. Build will continue.`);
|
|
194
|
+
console.log("═".repeat(60) + "\n");
|
|
195
|
+
}
|
|
196
|
+
async runPipeline(pipeline, warnings, skippedSteps) {
|
|
197
|
+
// Ensure .ci directory exists (envstore lives there)
|
|
198
|
+
mkdirSync(resolve(process.cwd(), ".ci"), { recursive: true });
|
|
199
|
+
// Clear envstore at the start of each build for a clean slate
|
|
200
|
+
if (existsSync(ENVMAN_ENVSTORE_PATH)) {
|
|
201
|
+
unlinkSync(ENVMAN_ENVSTORE_PATH);
|
|
202
|
+
}
|
|
203
|
+
console.log(`\n╔═════════════════════════════════════════════════════════╗`);
|
|
204
|
+
console.log(`║ Pipeline: ${pipeline.name.padEnd(42)} ║`);
|
|
205
|
+
console.log(`╚═════════════════════════════════════════════════════════╝\n`);
|
|
206
|
+
// Display warnings if provided
|
|
207
|
+
if (warnings && warnings.length > 0) {
|
|
208
|
+
this.displayWarnings(warnings, skippedSteps || 0);
|
|
209
|
+
}
|
|
210
|
+
this.validatePipeline(pipeline);
|
|
211
|
+
const stepsMap = new Map(pipeline.steps.map((s) => [s.id, s]));
|
|
212
|
+
for (const stepId of pipeline.stepsOrder) {
|
|
213
|
+
const step = stepsMap.get(stepId);
|
|
214
|
+
if (!step) {
|
|
215
|
+
throw new Error(`Step ${stepId} not found`);
|
|
216
|
+
}
|
|
217
|
+
try {
|
|
218
|
+
await this.runStep(step);
|
|
219
|
+
}
|
|
220
|
+
catch (err) {
|
|
221
|
+
if (step.isSkippable && err instanceof StepExecutionError) {
|
|
222
|
+
console.log(`\n⚠️ [${step.id}] Step "${step.name}" failed but is marked skippable — continuing.\n`);
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
throw err;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
console.log("\n" + "═".repeat(60));
|
|
230
|
+
console.log("✓ Pipeline completed successfully");
|
|
231
|
+
console.log("═".repeat(60) + "\n");
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
//# sourceMappingURL=runner.js.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export interface StepDef {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
kind: "script" | "python" | "ruby" | "node";
|
|
5
|
+
shell?: string;
|
|
6
|
+
script: string;
|
|
7
|
+
isSkippable?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface PipelineDef {
|
|
10
|
+
name: string;
|
|
11
|
+
artifacts: string[];
|
|
12
|
+
steps: StepDef[];
|
|
13
|
+
stepsOrder: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface CIConfig {
|
|
16
|
+
artifactsDir: string;
|
|
17
|
+
interpreters: {
|
|
18
|
+
python: string;
|
|
19
|
+
ruby: string;
|
|
20
|
+
node: string;
|
|
21
|
+
bash: string;
|
|
22
|
+
};
|
|
23
|
+
maxConcurrentJobs: number;
|
|
24
|
+
paths: {
|
|
25
|
+
buildsDir: string;
|
|
26
|
+
cacheDir: string;
|
|
27
|
+
derivedDataDir: string;
|
|
28
|
+
};
|
|
29
|
+
/** When true, steps that require remote infrastructure (S3, servers) skip gracefully */
|
|
30
|
+
local?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface StepBuilders {
|
|
33
|
+
script(name: string, options: {
|
|
34
|
+
id: string;
|
|
35
|
+
shell?: string;
|
|
36
|
+
script: string;
|
|
37
|
+
}): void;
|
|
38
|
+
python(name: string, options: {
|
|
39
|
+
id: string;
|
|
40
|
+
script: string;
|
|
41
|
+
}): void;
|
|
42
|
+
ruby(name: string, options: {
|
|
43
|
+
id: string;
|
|
44
|
+
script: string;
|
|
45
|
+
}): void;
|
|
46
|
+
node(name: string, options: {
|
|
47
|
+
id: string;
|
|
48
|
+
script: string;
|
|
49
|
+
}): void;
|
|
50
|
+
}
|
|
51
|
+
export interface PipelineContext {
|
|
52
|
+
artifacts(paths: string[]): void;
|
|
53
|
+
steps(builder: (s: StepBuilders) => void): void;
|
|
54
|
+
stepsOrder(ids: string[]): void;
|
|
55
|
+
}
|
|
56
|
+
export type PipelineFactory = (name: string, builder: (ctx: PipelineContext) => void) => PipelineDef;
|
|
57
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,QAAQ;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,KAAK,EAAE;QACL,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,wFAAwF;IACxF,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACpF,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACpE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAClE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CACnE;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACjC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,IAAI,GAAG,IAAI,CAAC;IAChD,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CACjC;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,IAAI,KAAK,WAAW,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bitrise YAML Compatibility Layer
|
|
3
|
+
*
|
|
4
|
+
* This module provides compatibility functions to convert Bitrise YAML pipelines
|
|
5
|
+
* to CI Build format, including metadata conversion and environment variable mapping.
|
|
6
|
+
*/
|
|
7
|
+
import type { YAMLPipeline } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Map of Bitrise environment variables to CI Build equivalents
|
|
10
|
+
* Used for automatic variable substitution (FR-9.2)
|
|
11
|
+
*/
|
|
12
|
+
export declare const BITRISE_ENV_MAP: Record<string, string>;
|
|
13
|
+
/**
|
|
14
|
+
* Bitrise environment variables that require user input
|
|
15
|
+
* These cannot be automatically mapped and must be provided by the user (FR-9.3)
|
|
16
|
+
*/
|
|
17
|
+
export declare const BITRISE_USER_REQUIRED_VARS: string[];
|
|
18
|
+
/**
|
|
19
|
+
* Error class for Bitrise-specific environment variable issues
|
|
20
|
+
* Provides detailed information about missing variables (FR-9.3, FR-9.4, FR-9.5)
|
|
21
|
+
*/
|
|
22
|
+
export declare class BitriseEnvironmentError extends Error {
|
|
23
|
+
readonly missingVariables: BitriseVariableInfo[];
|
|
24
|
+
constructor(missingVariables: BitriseVariableInfo[]);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Information about a missing Bitrise environment variable
|
|
28
|
+
*/
|
|
29
|
+
export interface BitriseVariableInfo {
|
|
30
|
+
/** Variable name (e.g., BITRISE_PUBLIC_INSTALL_PAGE_URL) */
|
|
31
|
+
name: string;
|
|
32
|
+
/** Step where the variable is used */
|
|
33
|
+
stepName: string;
|
|
34
|
+
/** Input field where the variable is used */
|
|
35
|
+
inputField: string;
|
|
36
|
+
/** CI Build equivalent variable name (if available) */
|
|
37
|
+
cibuildEquivalent?: string;
|
|
38
|
+
/** Suggested action for the user */
|
|
39
|
+
suggestedAction: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Converts Bitrise metadata to CI Build format
|
|
43
|
+
* Transforms meta.bitrise.io to meta.cibuild.io (FR-1.1, FR-1.2, FR-1.3)
|
|
44
|
+
*
|
|
45
|
+
* @param pipeline YAML pipeline object (mutated in place)
|
|
46
|
+
*/
|
|
47
|
+
export declare function convertBitriseMetadata(pipeline: YAMLPipeline): void;
|
|
48
|
+
/**
|
|
49
|
+
* Detects Bitrise-specific environment variables in step inputs
|
|
50
|
+
* Scans recursively through objects and arrays (FR-9.1)
|
|
51
|
+
*
|
|
52
|
+
* @param inputs Step inputs object
|
|
53
|
+
* @param stepName Name of the step (for error reporting)
|
|
54
|
+
* @returns Array of detected Bitrise variable information
|
|
55
|
+
*/
|
|
56
|
+
export declare function detectBitriseEnvironmentVariables(inputs: any, stepName: string): BitriseVariableInfo[];
|
|
57
|
+
/**
|
|
58
|
+
* Checks if a variable should trigger a warning vs error
|
|
59
|
+
* Mapped variables generate info logs, unmapped variables generate errors
|
|
60
|
+
*
|
|
61
|
+
* @param varName Bitrise variable name
|
|
62
|
+
* @returns True if variable needs user configuration (error), false if auto-mapped (info)
|
|
63
|
+
*/
|
|
64
|
+
export declare function requiresUserConfiguration(varName: string): boolean;
|
|
65
|
+
//# sourceMappingURL=bitrise-compat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitrise-compat.d.ts","sourceRoot":"","sources":["../../../src/yaml/bitrise-compat.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAmBlD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,UAKtC,CAAC;AAEF;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,SAAgB,gBAAgB,EAAE,mBAAmB,EAAE,CAAC;gBAE5C,gBAAgB,EAAE,mBAAmB,EAAE;CAMpD;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oCAAoC;IACpC,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAsBnE;AAED;;;;;;;GAOG;AACH,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,GAAG,EACX,QAAQ,EAAE,MAAM,GACf,mBAAmB,EAAE,CAOvB;AA2HD;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAElE"}
|