buildhive-agent 1.0.0-beta.1

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.
Files changed (170) hide show
  1. package/README.md +166 -0
  2. package/dist/__tests__/fakes/FakeDockerManager.d.ts +115 -0
  3. package/dist/__tests__/fakes/FakeDockerManager.d.ts.map +1 -0
  4. package/dist/__tests__/fakes/FakeDockerManager.js +203 -0
  5. package/dist/__tests__/fakes/FakeDockerManager.js.map +1 -0
  6. package/dist/acceptanceChecker.d.ts +26 -0
  7. package/dist/acceptanceChecker.d.ts.map +1 -0
  8. package/dist/acceptanceChecker.js +64 -0
  9. package/dist/acceptanceChecker.js.map +1 -0
  10. package/dist/advancedAgent.d.ts +161 -0
  11. package/dist/advancedAgent.d.ts.map +1 -0
  12. package/dist/advancedAgent.js +604 -0
  13. package/dist/advancedAgent.js.map +1 -0
  14. package/dist/agent.d.ts +101 -0
  15. package/dist/agent.d.ts.map +1 -0
  16. package/dist/agent.js +490 -0
  17. package/dist/agent.js.map +1 -0
  18. package/dist/api/jobStatusApi.d.ts +88 -0
  19. package/dist/api/jobStatusApi.d.ts.map +1 -0
  20. package/dist/api/jobStatusApi.js +240 -0
  21. package/dist/api/jobStatusApi.js.map +1 -0
  22. package/dist/autoUpdater.d.ts +135 -0
  23. package/dist/autoUpdater.d.ts.map +1 -0
  24. package/dist/autoUpdater.js +494 -0
  25. package/dist/autoUpdater.js.map +1 -0
  26. package/dist/cacheManager.d.ts +108 -0
  27. package/dist/cacheManager.d.ts.map +1 -0
  28. package/dist/cacheManager.js +300 -0
  29. package/dist/cacheManager.js.map +1 -0
  30. package/dist/cli.d.ts +11 -0
  31. package/dist/cli.d.ts.map +1 -0
  32. package/dist/cli.js +749 -0
  33. package/dist/cli.js.map +1 -0
  34. package/dist/config/index.d.ts +30 -0
  35. package/dist/config/index.d.ts.map +1 -0
  36. package/dist/config/index.js +35 -0
  37. package/dist/config/index.js.map +1 -0
  38. package/dist/config/loader.d.ts +45 -0
  39. package/dist/config/loader.d.ts.map +1 -0
  40. package/dist/config/loader.js +269 -0
  41. package/dist/config/loader.js.map +1 -0
  42. package/dist/config/types.d.ts +193 -0
  43. package/dist/config/types.d.ts.map +1 -0
  44. package/dist/config/types.js +90 -0
  45. package/dist/config/types.js.map +1 -0
  46. package/dist/config/validation.d.ts +28 -0
  47. package/dist/config/validation.d.ts.map +1 -0
  48. package/dist/config/validation.js +397 -0
  49. package/dist/config/validation.js.map +1 -0
  50. package/dist/docker.d.ts +96 -0
  51. package/dist/docker.d.ts.map +1 -0
  52. package/dist/docker.js +411 -0
  53. package/dist/docker.js.map +1 -0
  54. package/dist/enhancedJobExecutor.d.ts +81 -0
  55. package/dist/enhancedJobExecutor.d.ts.map +1 -0
  56. package/dist/enhancedJobExecutor.js +223 -0
  57. package/dist/enhancedJobExecutor.js.map +1 -0
  58. package/dist/executors/executorFactory.d.ts +46 -0
  59. package/dist/executors/executorFactory.d.ts.map +1 -0
  60. package/dist/executors/executorFactory.js +80 -0
  61. package/dist/executors/executorFactory.js.map +1 -0
  62. package/dist/executors/index.d.ts +7 -0
  63. package/dist/executors/index.d.ts.map +1 -0
  64. package/dist/executors/index.js +6 -0
  65. package/dist/executors/index.js.map +1 -0
  66. package/dist/executors/nativeExecutor.d.ts +60 -0
  67. package/dist/executors/nativeExecutor.d.ts.map +1 -0
  68. package/dist/executors/nativeExecutor.js +311 -0
  69. package/dist/executors/nativeExecutor.js.map +1 -0
  70. package/dist/executors/types.d.ts +38 -0
  71. package/dist/executors/types.d.ts.map +1 -0
  72. package/dist/executors/types.js +9 -0
  73. package/dist/executors/types.js.map +1 -0
  74. package/dist/healthMonitor.d.ts +213 -0
  75. package/dist/healthMonitor.d.ts.map +1 -0
  76. package/dist/healthMonitor.js +547 -0
  77. package/dist/healthMonitor.js.map +1 -0
  78. package/dist/index.d.ts +16 -0
  79. package/dist/index.d.ts.map +1 -0
  80. package/dist/index.js +16 -0
  81. package/dist/index.js.map +1 -0
  82. package/dist/jobExecutor.d.ts +117 -0
  83. package/dist/jobExecutor.d.ts.map +1 -0
  84. package/dist/jobExecutor.js +458 -0
  85. package/dist/jobExecutor.js.map +1 -0
  86. package/dist/lifecycleExecutor.d.ts +54 -0
  87. package/dist/lifecycleExecutor.d.ts.map +1 -0
  88. package/dist/lifecycleExecutor.js +230 -0
  89. package/dist/lifecycleExecutor.js.map +1 -0
  90. package/dist/main.d.ts +15 -0
  91. package/dist/main.d.ts.map +1 -0
  92. package/dist/main.js +77 -0
  93. package/dist/main.js.map +1 -0
  94. package/dist/metrics.d.ts +103 -0
  95. package/dist/metrics.d.ts.map +1 -0
  96. package/dist/metrics.js +360 -0
  97. package/dist/metrics.js.map +1 -0
  98. package/dist/recipes/builtinRecipes.d.ts +11 -0
  99. package/dist/recipes/builtinRecipes.d.ts.map +1 -0
  100. package/dist/recipes/builtinRecipes.js +688 -0
  101. package/dist/recipes/builtinRecipes.js.map +1 -0
  102. package/dist/recipes/index.d.ts +18 -0
  103. package/dist/recipes/index.d.ts.map +1 -0
  104. package/dist/recipes/index.js +17 -0
  105. package/dist/recipes/index.js.map +1 -0
  106. package/dist/recipes/recipeRegistry.d.ts +49 -0
  107. package/dist/recipes/recipeRegistry.d.ts.map +1 -0
  108. package/dist/recipes/recipeRegistry.js +264 -0
  109. package/dist/recipes/recipeRegistry.js.map +1 -0
  110. package/dist/recipes/types.d.ts +116 -0
  111. package/dist/recipes/types.d.ts.map +1 -0
  112. package/dist/recipes/types.js +10 -0
  113. package/dist/recipes/types.js.map +1 -0
  114. package/dist/recovery.d.ts +133 -0
  115. package/dist/recovery.d.ts.map +1 -0
  116. package/dist/recovery.js +299 -0
  117. package/dist/recovery.js.map +1 -0
  118. package/dist/registration/apiClient.d.ts +44 -0
  119. package/dist/registration/apiClient.d.ts.map +1 -0
  120. package/dist/registration/apiClient.js +149 -0
  121. package/dist/registration/apiClient.js.map +1 -0
  122. package/dist/registration/index.d.ts +41 -0
  123. package/dist/registration/index.d.ts.map +1 -0
  124. package/dist/registration/index.js +141 -0
  125. package/dist/registration/index.js.map +1 -0
  126. package/dist/registration/machineId.d.ts +30 -0
  127. package/dist/registration/machineId.d.ts.map +1 -0
  128. package/dist/registration/machineId.js +89 -0
  129. package/dist/registration/machineId.js.map +1 -0
  130. package/dist/registration/types.d.ts +32 -0
  131. package/dist/registration/types.d.ts.map +1 -0
  132. package/dist/registration/types.js +9 -0
  133. package/dist/registration/types.js.map +1 -0
  134. package/dist/resourceGovernor.d.ts +57 -0
  135. package/dist/resourceGovernor.d.ts.map +1 -0
  136. package/dist/resourceGovernor.js +125 -0
  137. package/dist/resourceGovernor.js.map +1 -0
  138. package/dist/security/secretManager.d.ts +107 -0
  139. package/dist/security/secretManager.d.ts.map +1 -0
  140. package/dist/security/secretManager.js +361 -0
  141. package/dist/security/secretManager.js.map +1 -0
  142. package/dist/security.d.ts +134 -0
  143. package/dist/security.d.ts.map +1 -0
  144. package/dist/security.js +470 -0
  145. package/dist/security.js.map +1 -0
  146. package/dist/storage/artifactUploader.d.ts +155 -0
  147. package/dist/storage/artifactUploader.d.ts.map +1 -0
  148. package/dist/storage/artifactUploader.js +554 -0
  149. package/dist/storage/artifactUploader.js.map +1 -0
  150. package/dist/types.d.ts +49 -0
  151. package/dist/types.d.ts.map +1 -0
  152. package/dist/types.js +7 -0
  153. package/dist/types.js.map +1 -0
  154. package/dist/utils/capabilities.d.ts +23 -0
  155. package/dist/utils/capabilities.d.ts.map +1 -0
  156. package/dist/utils/capabilities.js +200 -0
  157. package/dist/utils/capabilities.js.map +1 -0
  158. package/dist/utils/logger.d.ts +20 -0
  159. package/dist/utils/logger.d.ts.map +1 -0
  160. package/dist/utils/logger.js +188 -0
  161. package/dist/utils/logger.js.map +1 -0
  162. package/dist/utils/sdkScanner.d.ts +105 -0
  163. package/dist/utils/sdkScanner.d.ts.map +1 -0
  164. package/dist/utils/sdkScanner.js +459 -0
  165. package/dist/utils/sdkScanner.js.map +1 -0
  166. package/dist/websocketClient.d.ts +154 -0
  167. package/dist/websocketClient.d.ts.map +1 -0
  168. package/dist/websocketClient.js +422 -0
  169. package/dist/websocketClient.js.map +1 -0
  170. package/package.json +64 -0
@@ -0,0 +1,688 @@
1
+ /**
2
+ * Built-in Recipe Definitions
3
+ *
4
+ * 15 production-ready recipes covering the most common CI ecosystems.
5
+ * Each recipe provides sensible defaults for detection, execution,
6
+ * caching, artifacts, and lifecycle hooks.
7
+ */
8
+ // ---------------------------------------------------------------------------
9
+ // 1. Android (Gradle)
10
+ // ---------------------------------------------------------------------------
11
+ const androidGradle = {
12
+ name: 'android-gradle',
13
+ description: 'Android project built with Gradle (APK / AAB)',
14
+ version: '1.0.0',
15
+ detection: {
16
+ files: ['build.gradle', 'build.gradle.kts', 'settings.gradle', 'settings.gradle.kts'],
17
+ contentPatterns: [
18
+ { file: 'build.gradle', pattern: 'com.android.application' },
19
+ { file: 'build.gradle.kts', pattern: 'com.android.application' },
20
+ { file: 'settings.gradle', pattern: 'android' },
21
+ { file: 'settings.gradle.kts', pattern: 'android' },
22
+ ],
23
+ priority: 50,
24
+ },
25
+ executionMode: 'docker',
26
+ dockerImage: 'cimg/android:2024.04.1',
27
+ requiredMemoryGB: 8,
28
+ timeoutMinutes: 30,
29
+ defaultBuildCommand: './gradlew assembleRelease --no-daemon --stacktrace',
30
+ setup: [
31
+ { name: 'Accept SDK licenses', command: 'yes | sdkmanager --licenses || true', timeout: 60, continueOnError: true },
32
+ { name: 'Download dependencies', command: './gradlew dependencies --no-daemon', timeout: 300 },
33
+ ],
34
+ teardown: [
35
+ { name: 'Cleanup Gradle daemons', command: './gradlew --stop || true', continueOnError: true },
36
+ ],
37
+ cache: {
38
+ key: "gradle-${hashFiles('**/*.gradle*', '**/gradle-wrapper.properties')}",
39
+ paths: [
40
+ '~/.gradle/caches',
41
+ '~/.gradle/wrapper',
42
+ '~/.android/build-cache',
43
+ ],
44
+ restoreKeys: ['gradle-'],
45
+ maxSizeMB: 2048,
46
+ },
47
+ artifacts: {
48
+ paths: [
49
+ '**/build/outputs/apk/**/*.apk',
50
+ '**/build/outputs/bundle/**/*.aab',
51
+ '**/build/reports/**',
52
+ ],
53
+ expireAfterDays: 14,
54
+ },
55
+ environment: {
56
+ GRADLE_OPTS: '-Dorg.gradle.daemon=false -Xmx4g -XX:+HeapDumpOnOutOfMemoryError',
57
+ ANDROID_HOME: '/opt/android/sdk',
58
+ },
59
+ variables: {
60
+ buildVariant: { default: 'Release', description: 'Android build variant (Debug, Release, etc.)' },
61
+ gradleTask: { default: 'assembleRelease', description: 'Gradle task to execute' },
62
+ },
63
+ };
64
+ // ---------------------------------------------------------------------------
65
+ // 2. iOS (Xcode)
66
+ // ---------------------------------------------------------------------------
67
+ const iosXcode = {
68
+ name: 'ios-xcode',
69
+ description: 'iOS / macOS project built with Xcode (IPA / app bundle)',
70
+ version: '1.0.0',
71
+ detection: {
72
+ files: ['*.xcodeproj', '*.xcworkspace', 'Podfile', 'Package.swift'],
73
+ contentPatterns: [],
74
+ priority: 60,
75
+ },
76
+ executionMode: 'native',
77
+ requiredOS: 'darwin',
78
+ requiredMemoryGB: 8,
79
+ timeoutMinutes: 45,
80
+ defaultBuildCommand: 'xcodebuild -workspace *.xcworkspace -scheme ${SCHEME:-App} -configuration Release -archivePath build/App.xcarchive archive CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO',
81
+ setup: [
82
+ { name: 'Install CocoaPods', command: 'bundle install && bundle exec pod install || pod install', timeout: 300, continueOnError: true },
83
+ { name: 'Select Xcode version', command: 'sudo xcode-select -s /Applications/Xcode.app/Contents/Developer || true', timeout: 30, continueOnError: true },
84
+ ],
85
+ teardown: [
86
+ { name: 'Cleanup DerivedData', command: 'rm -rf ~/Library/Developer/Xcode/DerivedData || true', continueOnError: true },
87
+ ],
88
+ cache: {
89
+ key: "pods-${hashFiles('**/Podfile.lock')}",
90
+ paths: [
91
+ 'Pods',
92
+ '~/.cocoapods',
93
+ '~/Library/Developer/Xcode/DerivedData',
94
+ ],
95
+ restoreKeys: ['pods-'],
96
+ maxSizeMB: 4096,
97
+ },
98
+ artifacts: {
99
+ paths: [
100
+ 'build/**/*.xcarchive',
101
+ 'build/**/*.ipa',
102
+ 'build/**/*.app',
103
+ ],
104
+ expireAfterDays: 14,
105
+ },
106
+ environment: {
107
+ DEVELOPER_DIR: '/Applications/Xcode.app/Contents/Developer',
108
+ },
109
+ variables: {
110
+ scheme: { default: 'App', description: 'Xcode scheme name' },
111
+ configuration: { default: 'Release', description: 'Build configuration (Debug / Release)' },
112
+ },
113
+ };
114
+ // ---------------------------------------------------------------------------
115
+ // 3. Node.js (npm)
116
+ // ---------------------------------------------------------------------------
117
+ const nodejsNpm = {
118
+ name: 'nodejs-npm',
119
+ description: 'Node.js project using npm',
120
+ version: '1.0.0',
121
+ detection: {
122
+ files: ['package-lock.json'],
123
+ priority: 40,
124
+ },
125
+ executionMode: 'docker',
126
+ dockerImage: 'node:20-alpine',
127
+ requiredMemoryGB: 4,
128
+ timeoutMinutes: 15,
129
+ defaultBuildCommand: 'npm ci && npm run build',
130
+ setup: [
131
+ { name: 'Verify Node version', command: 'node --version && npm --version', timeout: 10 },
132
+ ],
133
+ cache: {
134
+ key: "npm-${hashFiles('**/package-lock.json')}",
135
+ paths: ['~/.npm', 'node_modules'],
136
+ restoreKeys: ['npm-'],
137
+ maxSizeMB: 1024,
138
+ },
139
+ artifacts: {
140
+ paths: ['dist/**', 'build/**'],
141
+ expireAfterDays: 7,
142
+ },
143
+ environment: {
144
+ NODE_ENV: 'production',
145
+ CI: 'true',
146
+ },
147
+ variables: {
148
+ nodeVersion: { default: '20', description: 'Node.js major version' },
149
+ buildScript: { default: 'build', description: 'npm script name to run' },
150
+ },
151
+ };
152
+ // ---------------------------------------------------------------------------
153
+ // 4. Node.js (Yarn)
154
+ // ---------------------------------------------------------------------------
155
+ const nodejsYarn = {
156
+ name: 'nodejs-yarn',
157
+ description: 'Node.js project using Yarn',
158
+ version: '1.0.0',
159
+ detection: {
160
+ files: ['yarn.lock'],
161
+ priority: 45,
162
+ },
163
+ executionMode: 'docker',
164
+ dockerImage: 'node:20-alpine',
165
+ requiredMemoryGB: 4,
166
+ timeoutMinutes: 15,
167
+ defaultBuildCommand: 'yarn install --frozen-lockfile && yarn build',
168
+ setup: [
169
+ { name: 'Verify Yarn version', command: 'node --version && yarn --version', timeout: 10 },
170
+ ],
171
+ cache: {
172
+ key: "yarn-${hashFiles('**/yarn.lock')}",
173
+ paths: ['~/.yarn/cache', '.yarn/cache', 'node_modules'],
174
+ restoreKeys: ['yarn-'],
175
+ maxSizeMB: 1024,
176
+ },
177
+ artifacts: {
178
+ paths: ['dist/**', 'build/**'],
179
+ expireAfterDays: 7,
180
+ },
181
+ environment: {
182
+ NODE_ENV: 'production',
183
+ CI: 'true',
184
+ },
185
+ variables: {
186
+ nodeVersion: { default: '20', description: 'Node.js major version' },
187
+ buildScript: { default: 'build', description: 'Yarn script name to run' },
188
+ },
189
+ };
190
+ // ---------------------------------------------------------------------------
191
+ // 5. Python (pip)
192
+ // ---------------------------------------------------------------------------
193
+ const pythonPip = {
194
+ name: 'python-pip',
195
+ description: 'Python project using pip / setuptools',
196
+ version: '1.0.0',
197
+ detection: {
198
+ files: ['requirements.txt', 'setup.py', 'setup.cfg'],
199
+ priority: 30,
200
+ },
201
+ executionMode: 'docker',
202
+ dockerImage: 'python:3.12-slim',
203
+ requiredMemoryGB: 2,
204
+ timeoutMinutes: 15,
205
+ defaultBuildCommand: 'pip install -r requirements.txt && python -m pytest',
206
+ setup: [
207
+ { name: 'Upgrade pip', command: 'pip install --upgrade pip setuptools wheel', timeout: 60 },
208
+ ],
209
+ cache: {
210
+ key: "pip-${hashFiles('**/requirements*.txt')}",
211
+ paths: ['~/.cache/pip'],
212
+ restoreKeys: ['pip-'],
213
+ maxSizeMB: 512,
214
+ },
215
+ artifacts: {
216
+ paths: ['dist/**', '*.whl', '*.tar.gz'],
217
+ expireAfterDays: 7,
218
+ },
219
+ environment: {
220
+ PYTHONDONTWRITEBYTECODE: '1',
221
+ PIP_NO_CACHE_DIR: '0',
222
+ },
223
+ variables: {
224
+ pythonVersion: { default: '3.12', description: 'Python version' },
225
+ },
226
+ };
227
+ // ---------------------------------------------------------------------------
228
+ // 6. Python (Poetry)
229
+ // ---------------------------------------------------------------------------
230
+ const pythonPoetry = {
231
+ name: 'python-poetry',
232
+ description: 'Python project using Poetry',
233
+ version: '1.0.0',
234
+ detection: {
235
+ files: ['poetry.lock'],
236
+ contentPatterns: [
237
+ { file: 'pyproject.toml', pattern: 'tool.poetry' },
238
+ ],
239
+ priority: 35,
240
+ },
241
+ executionMode: 'docker',
242
+ dockerImage: 'python:3.12-slim',
243
+ requiredMemoryGB: 2,
244
+ timeoutMinutes: 15,
245
+ defaultBuildCommand: 'poetry install --no-interaction && poetry run pytest',
246
+ setup: [
247
+ { name: 'Install Poetry', command: 'pip install poetry', timeout: 60 },
248
+ { name: 'Configure Poetry', command: 'poetry config virtualenvs.in-project true', timeout: 10 },
249
+ ],
250
+ cache: {
251
+ key: "poetry-${hashFiles('**/poetry.lock')}",
252
+ paths: ['~/.cache/pypoetry', '.venv'],
253
+ restoreKeys: ['poetry-'],
254
+ maxSizeMB: 512,
255
+ },
256
+ artifacts: {
257
+ paths: ['dist/**'],
258
+ expireAfterDays: 7,
259
+ },
260
+ environment: {
261
+ PYTHONDONTWRITEBYTECODE: '1',
262
+ POETRY_VIRTUALENVS_IN_PROJECT: 'true',
263
+ },
264
+ variables: {
265
+ pythonVersion: { default: '3.12', description: 'Python version' },
266
+ },
267
+ };
268
+ // ---------------------------------------------------------------------------
269
+ // 7. Go (Module)
270
+ // ---------------------------------------------------------------------------
271
+ const goModule = {
272
+ name: 'go-module',
273
+ description: 'Go project using Go Modules',
274
+ version: '1.0.0',
275
+ detection: {
276
+ files: ['go.mod'],
277
+ priority: 40,
278
+ },
279
+ executionMode: 'docker',
280
+ dockerImage: 'golang:1.22-alpine',
281
+ requiredMemoryGB: 4,
282
+ timeoutMinutes: 15,
283
+ defaultBuildCommand: 'go build -v ./...',
284
+ setup: [
285
+ { name: 'Download dependencies', command: 'go mod download', timeout: 120 },
286
+ ],
287
+ cache: {
288
+ key: "go-${hashFiles('**/go.sum')}",
289
+ paths: ['~/go/pkg/mod', '~/.cache/go-build'],
290
+ restoreKeys: ['go-'],
291
+ maxSizeMB: 1024,
292
+ },
293
+ artifacts: {
294
+ paths: ['bin/**', 'dist/**'],
295
+ expireAfterDays: 7,
296
+ },
297
+ environment: {
298
+ CGO_ENABLED: '0',
299
+ GOPROXY: 'https://proxy.golang.org,direct',
300
+ },
301
+ variables: {
302
+ goVersion: { default: '1.22', description: 'Go version' },
303
+ buildTarget: { default: './...', description: 'Go build target(s)' },
304
+ },
305
+ };
306
+ // ---------------------------------------------------------------------------
307
+ // 8. Rust (Cargo)
308
+ // ---------------------------------------------------------------------------
309
+ const rustCargo = {
310
+ name: 'rust-cargo',
311
+ description: 'Rust project built with Cargo',
312
+ version: '1.0.0',
313
+ detection: {
314
+ files: ['Cargo.toml'],
315
+ priority: 40,
316
+ },
317
+ executionMode: 'docker',
318
+ dockerImage: 'rust:1.75-slim',
319
+ requiredMemoryGB: 4,
320
+ timeoutMinutes: 30,
321
+ defaultBuildCommand: 'cargo build --release',
322
+ setup: [
323
+ { name: 'Fetch dependencies', command: 'cargo fetch', timeout: 120 },
324
+ ],
325
+ teardown: [
326
+ { name: 'Cleanup target', command: 'cargo clean -p $(cargo metadata --no-deps --format-version 1 | grep -o \'"name":"[^"]*"\' | head -1 | cut -d\\" -f4) || true', continueOnError: true },
327
+ ],
328
+ cache: {
329
+ key: "cargo-${hashFiles('**/Cargo.lock')}",
330
+ paths: ['~/.cargo/registry', '~/.cargo/git', 'target'],
331
+ restoreKeys: ['cargo-'],
332
+ maxSizeMB: 2048,
333
+ },
334
+ artifacts: {
335
+ paths: ['target/release/*'],
336
+ expireAfterDays: 7,
337
+ },
338
+ environment: {
339
+ CARGO_INCREMENTAL: '0',
340
+ RUSTFLAGS: '-D warnings',
341
+ },
342
+ variables: {
343
+ toolchain: { default: 'stable', description: 'Rust toolchain (stable, nightly, etc.)' },
344
+ profile: { default: 'release', description: 'Cargo build profile' },
345
+ },
346
+ };
347
+ // ---------------------------------------------------------------------------
348
+ // 9. .NET
349
+ // ---------------------------------------------------------------------------
350
+ const dotnet = {
351
+ name: 'dotnet',
352
+ description: '.NET project built with dotnet SDK',
353
+ version: '1.0.0',
354
+ detection: {
355
+ files: ['*.csproj', '*.sln', '*.fsproj'],
356
+ priority: 40,
357
+ },
358
+ executionMode: 'docker',
359
+ dockerImage: 'mcr.microsoft.com/dotnet/sdk:8.0',
360
+ requiredMemoryGB: 4,
361
+ timeoutMinutes: 20,
362
+ defaultBuildCommand: 'dotnet build --configuration Release --no-restore && dotnet test --no-build --configuration Release',
363
+ setup: [
364
+ { name: 'Restore NuGet packages', command: 'dotnet restore', timeout: 120 },
365
+ ],
366
+ cache: {
367
+ key: "nuget-${hashFiles('**/*.csproj', '**/packages.lock.json')}",
368
+ paths: ['~/.nuget/packages'],
369
+ restoreKeys: ['nuget-'],
370
+ maxSizeMB: 1024,
371
+ },
372
+ artifacts: {
373
+ paths: ['**/bin/Release/**', '**/publish/**'],
374
+ expireAfterDays: 7,
375
+ },
376
+ environment: {
377
+ DOTNET_CLI_TELEMETRY_OPTOUT: '1',
378
+ DOTNET_NOLOGO: '1',
379
+ },
380
+ variables: {
381
+ configuration: { default: 'Release', description: 'Build configuration (Debug / Release)' },
382
+ framework: { default: 'net8.0', description: 'Target framework moniker' },
383
+ },
384
+ };
385
+ // ---------------------------------------------------------------------------
386
+ // 10. Flutter
387
+ // ---------------------------------------------------------------------------
388
+ const flutter = {
389
+ name: 'flutter',
390
+ description: 'Flutter project (mobile, web, desktop)',
391
+ version: '1.0.0',
392
+ detection: {
393
+ files: ['pubspec.yaml'],
394
+ contentPatterns: [
395
+ { file: 'pubspec.yaml', pattern: 'flutter' },
396
+ ],
397
+ priority: 55,
398
+ },
399
+ executionMode: 'auto',
400
+ dockerImage: 'ghcr.io/cirruslabs/flutter:stable',
401
+ requiredOS: 'darwin',
402
+ requiredMemoryGB: 8,
403
+ timeoutMinutes: 30,
404
+ defaultBuildCommand: 'flutter build apk --release',
405
+ setup: [
406
+ { name: 'Flutter doctor', command: 'flutter doctor -v', timeout: 60, continueOnError: true },
407
+ { name: 'Get dependencies', command: 'flutter pub get', timeout: 120 },
408
+ ],
409
+ teardown: [
410
+ { name: 'Clean Flutter build', command: 'flutter clean || true', continueOnError: true },
411
+ ],
412
+ cache: {
413
+ key: "flutter-${hashFiles('**/pubspec.lock')}",
414
+ paths: ['~/.pub-cache', '.dart_tool'],
415
+ restoreKeys: ['flutter-'],
416
+ maxSizeMB: 2048,
417
+ },
418
+ artifacts: {
419
+ paths: [
420
+ 'build/app/outputs/**/*.apk',
421
+ 'build/app/outputs/**/*.aab',
422
+ 'build/ios/**/*.ipa',
423
+ 'build/web/**',
424
+ ],
425
+ expireAfterDays: 14,
426
+ },
427
+ environment: {
428
+ PUB_CACHE: '~/.pub-cache',
429
+ CI: 'true',
430
+ },
431
+ variables: {
432
+ platform: { default: 'apk', description: 'Build target: apk, ios, web, linux, macos, windows' },
433
+ buildMode: { default: 'release', description: 'Build mode: debug, profile, release' },
434
+ },
435
+ };
436
+ // ---------------------------------------------------------------------------
437
+ // 11. React Native
438
+ // ---------------------------------------------------------------------------
439
+ const reactNative = {
440
+ name: 'react-native',
441
+ description: 'React Native project (Android & iOS)',
442
+ version: '1.0.0',
443
+ detection: {
444
+ files: ['package.json', 'metro.config.js', 'metro.config.ts', 'app.json'],
445
+ contentPatterns: [
446
+ { file: 'package.json', pattern: 'react-native' },
447
+ ],
448
+ priority: 55,
449
+ },
450
+ executionMode: 'auto',
451
+ dockerImage: 'cimg/android:2024.04.1-node',
452
+ requiredMemoryGB: 8,
453
+ timeoutMinutes: 30,
454
+ defaultBuildCommand: 'npx react-native build-android --mode=release',
455
+ setup: [
456
+ { name: 'Install JS dependencies', command: 'yarn install --frozen-lockfile || npm ci', timeout: 120 },
457
+ { name: 'Accept Android SDK licenses', command: 'yes | sdkmanager --licenses || true', timeout: 60, continueOnError: true },
458
+ ],
459
+ teardown: [
460
+ { name: 'Kill Metro bundler', command: 'pkill -f "react-native.*start" || true', continueOnError: true },
461
+ ],
462
+ cache: {
463
+ key: "rn-${hashFiles('**/yarn.lock', '**/package-lock.json')}",
464
+ paths: ['node_modules', '~/.gradle/caches', '~/.gradle/wrapper', 'Pods'],
465
+ restoreKeys: ['rn-'],
466
+ maxSizeMB: 3072,
467
+ },
468
+ artifacts: {
469
+ paths: [
470
+ 'android/app/build/outputs/**/*.apk',
471
+ 'android/app/build/outputs/**/*.aab',
472
+ 'ios/build/**/*.ipa',
473
+ ],
474
+ expireAfterDays: 14,
475
+ },
476
+ environment: {
477
+ NODE_ENV: 'production',
478
+ CI: 'true',
479
+ ANDROID_HOME: '/opt/android/sdk',
480
+ },
481
+ variables: {
482
+ platform: { default: 'android', description: 'Target platform: android, ios, both' },
483
+ buildMode: { default: 'release', description: 'Build mode: debug, release' },
484
+ },
485
+ };
486
+ // ---------------------------------------------------------------------------
487
+ // 12. Docker Build
488
+ // ---------------------------------------------------------------------------
489
+ const dockerBuild = {
490
+ name: 'docker-build',
491
+ description: 'Build and optionally push a Docker image',
492
+ version: '1.0.0',
493
+ detection: {
494
+ files: ['Dockerfile', 'Containerfile', 'docker-compose.yml', 'docker-compose.yaml'],
495
+ priority: 20,
496
+ },
497
+ executionMode: 'docker',
498
+ dockerImage: 'docker:27-dind',
499
+ requiredMemoryGB: 4,
500
+ requiredTags: ['docker'],
501
+ timeoutMinutes: 30,
502
+ defaultBuildCommand: 'docker build -t ${IMAGE_NAME:-app}:${IMAGE_TAG:-latest} .',
503
+ setup: [
504
+ { name: 'Wait for Docker daemon', command: 'until docker info >/dev/null 2>&1; do sleep 1; done', timeout: 30 },
505
+ { name: 'Login to registry', command: 'echo "${REGISTRY_PASSWORD}" | docker login ${REGISTRY:-docker.io} -u "${REGISTRY_USER}" --password-stdin || true', timeout: 15, continueOnError: true },
506
+ ],
507
+ cache: {
508
+ key: "docker-${hashFiles('Dockerfile', '.dockerignore')}",
509
+ paths: ['/var/lib/docker'],
510
+ restoreKeys: ['docker-'],
511
+ maxSizeMB: 4096,
512
+ },
513
+ artifacts: {
514
+ paths: ['*.tar', 'docker-image-*.tar'],
515
+ expireAfterDays: 7,
516
+ },
517
+ environment: {
518
+ DOCKER_BUILDKIT: '1',
519
+ },
520
+ variables: {
521
+ imageName: { default: 'app', description: 'Docker image name' },
522
+ imageTag: { default: 'latest', description: 'Docker image tag' },
523
+ registry: { default: 'docker.io', description: 'Container registry URL' },
524
+ },
525
+ };
526
+ // ---------------------------------------------------------------------------
527
+ // 13. Terraform
528
+ // ---------------------------------------------------------------------------
529
+ const terraform = {
530
+ name: 'terraform',
531
+ description: 'Terraform infrastructure plan & apply',
532
+ version: '1.0.0',
533
+ detection: {
534
+ files: ['main.tf', '*.tf', 'terraform.tfvars'],
535
+ priority: 35,
536
+ },
537
+ executionMode: 'docker',
538
+ dockerImage: 'hashicorp/terraform:1.7',
539
+ requiredMemoryGB: 2,
540
+ timeoutMinutes: 20,
541
+ defaultBuildCommand: 'terraform init && terraform plan -out=tfplan',
542
+ setup: [
543
+ { name: 'Validate configuration', command: 'terraform validate', timeout: 30 },
544
+ { name: 'Format check', command: 'terraform fmt -check -recursive', timeout: 30, continueOnError: true },
545
+ ],
546
+ cache: {
547
+ key: "terraform-${hashFiles('**/.terraform.lock.hcl')}",
548
+ paths: ['.terraform/providers'],
549
+ restoreKeys: ['terraform-'],
550
+ maxSizeMB: 512,
551
+ },
552
+ artifacts: {
553
+ paths: ['tfplan', '*.tfstate', 'terraform-plan-*.txt'],
554
+ expireAfterDays: 30,
555
+ },
556
+ environment: {
557
+ TF_IN_AUTOMATION: 'true',
558
+ TF_INPUT: 'false',
559
+ },
560
+ variables: {
561
+ workspace: { default: 'default', description: 'Terraform workspace' },
562
+ backendConfig: { default: '', description: 'Extra backend config flags' },
563
+ },
564
+ };
565
+ // ---------------------------------------------------------------------------
566
+ // 14. Kotlin Multiplatform (KMP)
567
+ // ---------------------------------------------------------------------------
568
+ const kmp = {
569
+ name: 'kmp',
570
+ description: 'Kotlin Multiplatform project (JVM, JS, Native, Android, iOS)',
571
+ version: '1.0.0',
572
+ detection: {
573
+ files: ['build.gradle.kts', 'build.gradle', 'settings.gradle.kts', 'settings.gradle'],
574
+ contentPatterns: [
575
+ { file: 'build.gradle.kts', pattern: 'multiplatform' },
576
+ { file: 'build.gradle', pattern: 'multiplatform' },
577
+ { file: 'settings.gradle.kts', pattern: 'multiplatform' },
578
+ ],
579
+ priority: 60,
580
+ },
581
+ executionMode: 'docker',
582
+ dockerImage: 'cimg/android:2024.04.1',
583
+ requiredMemoryGB: 8,
584
+ timeoutMinutes: 40,
585
+ defaultBuildCommand: './gradlew build --no-daemon --stacktrace',
586
+ setup: [
587
+ { name: 'Accept SDK licenses', command: 'yes | sdkmanager --licenses || true', timeout: 60, continueOnError: true },
588
+ { name: 'Download dependencies', command: './gradlew dependencies --no-daemon', timeout: 300 },
589
+ ],
590
+ teardown: [
591
+ { name: 'Stop Gradle daemons', command: './gradlew --stop || true', continueOnError: true },
592
+ ],
593
+ cache: {
594
+ key: "kmp-${hashFiles('**/*.gradle*', '**/gradle-wrapper.properties')}",
595
+ paths: [
596
+ '~/.gradle/caches',
597
+ '~/.gradle/wrapper',
598
+ '~/.konan',
599
+ '~/.android/build-cache',
600
+ ],
601
+ restoreKeys: ['kmp-'],
602
+ maxSizeMB: 3072,
603
+ },
604
+ artifacts: {
605
+ paths: [
606
+ '**/build/outputs/apk/**/*.apk',
607
+ '**/build/libs/*.jar',
608
+ '**/build/distributions/**',
609
+ '**/build/reports/**',
610
+ ],
611
+ expireAfterDays: 14,
612
+ },
613
+ environment: {
614
+ GRADLE_OPTS: '-Dorg.gradle.daemon=false -Xmx6g -XX:+HeapDumpOnOutOfMemoryError',
615
+ ANDROID_HOME: '/opt/android/sdk',
616
+ },
617
+ variables: {
618
+ gradleTask: { default: 'build', description: 'Gradle task to execute' },
619
+ },
620
+ };
621
+ // ---------------------------------------------------------------------------
622
+ // 15. Ruby on Rails
623
+ // ---------------------------------------------------------------------------
624
+ const rubyRails = {
625
+ name: 'ruby-rails',
626
+ description: 'Ruby on Rails application',
627
+ version: '1.0.0',
628
+ detection: {
629
+ files: ['Gemfile'],
630
+ contentPatterns: [
631
+ { file: 'Gemfile', pattern: 'rails' },
632
+ { file: 'config/routes.rb', pattern: '' },
633
+ ],
634
+ priority: 40,
635
+ },
636
+ executionMode: 'docker',
637
+ dockerImage: 'ruby:3.3-slim',
638
+ requiredMemoryGB: 4,
639
+ timeoutMinutes: 20,
640
+ defaultBuildCommand: 'bundle exec rails test',
641
+ setup: [
642
+ { name: 'Install dependencies', command: 'bundle install --jobs 4 --retry 3', timeout: 180 },
643
+ { name: 'Setup database', command: 'bundle exec rails db:prepare || true', timeout: 60, continueOnError: true },
644
+ { name: 'Precompile assets', command: 'bundle exec rails assets:precompile || true', timeout: 120, continueOnError: true },
645
+ ],
646
+ cache: {
647
+ key: "bundle-${hashFiles('**/Gemfile.lock')}",
648
+ paths: ['vendor/bundle', '~/.bundle/cache'],
649
+ restoreKeys: ['bundle-'],
650
+ maxSizeMB: 1024,
651
+ },
652
+ artifacts: {
653
+ paths: ['log/**', 'tmp/screenshots/**', 'coverage/**'],
654
+ expireAfterDays: 7,
655
+ },
656
+ environment: {
657
+ RAILS_ENV: 'test',
658
+ BUNDLE_PATH: 'vendor/bundle',
659
+ BUNDLE_JOBS: '4',
660
+ BUNDLE_RETRY: '3',
661
+ },
662
+ variables: {
663
+ rubyVersion: { default: '3.3', description: 'Ruby version' },
664
+ railsEnv: { default: 'test', description: 'RAILS_ENV value' },
665
+ },
666
+ };
667
+ // ---------------------------------------------------------------------------
668
+ // Export
669
+ // ---------------------------------------------------------------------------
670
+ /** All built-in recipes, keyed by name. */
671
+ export const BUILTIN_RECIPES = [
672
+ androidGradle,
673
+ iosXcode,
674
+ nodejsNpm,
675
+ nodejsYarn,
676
+ pythonPip,
677
+ pythonPoetry,
678
+ goModule,
679
+ rustCargo,
680
+ dotnet,
681
+ flutter,
682
+ reactNative,
683
+ dockerBuild,
684
+ terraform,
685
+ kmp,
686
+ rubyRails,
687
+ ];
688
+ //# sourceMappingURL=builtinRecipes.js.map