timonel 0.3.0 → 0.4.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.
- package/CHANGELOG.md +63 -1
- package/README.md +198 -11
- package/dist/lib/HelmChartWriter.d.ts +2 -0
- package/dist/lib/HelmChartWriter.d.ts.map +1 -1
- package/dist/lib/HelmChartWriter.js +17 -5
- package/dist/lib/HelmChartWriter.js.map +1 -1
- package/dist/lib/Rutter.d.ts +297 -11
- package/dist/lib/Rutter.d.ts.map +1 -1
- package/dist/lib/Rutter.js +444 -23
- package/dist/lib/Rutter.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,57 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.4.0] - 2025-09-06
|
|
11
|
+
|
|
12
|
+
### Added (0.4.0)
|
|
13
|
+
|
|
14
|
+
- **Custom Manifest Naming**: Complete implementation for customizable Kubernetes
|
|
15
|
+
manifest file names
|
|
16
|
+
- `manifestName` option in RutterProps to specify custom base names for manifest
|
|
17
|
+
files
|
|
18
|
+
- `singleManifestFile` option to combine all resources into a single manifest
|
|
19
|
+
file
|
|
20
|
+
- Enhanced file organization with descriptive names instead of generic numbered
|
|
21
|
+
files
|
|
22
|
+
- Support for both single file mode (`application.yaml`) and separate files mode
|
|
23
|
+
(`0000-my-app-deployment-web.yaml`)
|
|
24
|
+
- Backward compatibility maintained - default behavior unchanged when options not
|
|
25
|
+
specified
|
|
26
|
+
|
|
27
|
+
### Enhanced (0.4.0)
|
|
28
|
+
|
|
29
|
+
- **HelmChartWriter**: Added `singleFile` property to SynthAsset interface for
|
|
30
|
+
improved file handling
|
|
31
|
+
- **Documentation**: Comprehensive Custom Manifest Naming section added to README
|
|
32
|
+
with examples
|
|
33
|
+
- **Examples**: All examples updated with custom manifest naming demonstrations
|
|
34
|
+
- **AWS 2048 Game**: Enhanced with production-ready AWS features
|
|
35
|
+
- AWS ALB Ingress with health checks and SSL support
|
|
36
|
+
- HorizontalPodAutoscaler (HPA) for CPU-based auto-scaling
|
|
37
|
+
- PodDisruptionBudget (PDB) for high availability during updates
|
|
38
|
+
- Custom manifest naming with `manifestName: 'game-2048'`
|
|
39
|
+
- Multi-environment configuration (dev/staging/prod)
|
|
40
|
+
- **WordPress**: Updated to showcase `manifestName: 'wordpress-app'` and `singleManifestFile: true`
|
|
41
|
+
- Comprehensive AWS integration examples (EBS, EFS, IRSA, Secrets Manager)
|
|
42
|
+
- Auto-scaling with HPA and VPA configurations
|
|
43
|
+
- Production-ready deployment patterns
|
|
44
|
+
- **WordPress Umbrella**: Subcharts updated with custom manifest naming
|
|
45
|
+
- MySQL subchart: `manifestName: 'mysql-database'`, `singleManifestFile: true`
|
|
46
|
+
- WordPress subchart: `manifestName: 'wordpress-app'`, `singleManifestFile: false`
|
|
47
|
+
- **Example Documentation**: All example READMEs enhanced with custom manifest naming references
|
|
48
|
+
and comprehensive deployment instructions
|
|
49
|
+
- **Auto-scaling Features**: Properly documented existing production-ready capabilities
|
|
50
|
+
- HorizontalPodAutoscaler (HPA) with CPU/memory metrics and custom behavior policies
|
|
51
|
+
- VerticalPodAutoscaler (VPA) with resource policies and update modes
|
|
52
|
+
- PodDisruptionBudget (PDB) for high availability during updates
|
|
53
|
+
- **AWS Multi-Cloud Support**: Comprehensive documentation of EKS integration features
|
|
54
|
+
- AWS IRSA ServiceAccount for secure IAM role assumption with regional STS endpoints
|
|
55
|
+
- AWS EBS StorageClass with GP3, IO1, IO2 support, encryption, and IOPS configuration
|
|
56
|
+
- AWS EFS StorageClass for shared storage across pods with access points
|
|
57
|
+
- AWS ALB Ingress with health checks, SSL certificates, and advanced routing
|
|
58
|
+
- AWS Secrets Manager and Parameter Store integration via SecretProviderClass
|
|
59
|
+
- Multi-cloud ServiceAccount with workload identity (AWS IRSA, Azure, GCP)
|
|
60
|
+
|
|
10
61
|
## [0.3.0] - 2025-09-02
|
|
11
62
|
|
|
12
63
|
### Added (0.3.0)
|
|
@@ -184,5 +235,16 @@ const rutter = new Rutter({ meta: { name: 'my-app' } });
|
|
|
184
235
|
- Security audit in CI/CD pipeline
|
|
185
236
|
- Provenance-enabled npm publishing
|
|
186
237
|
|
|
187
|
-
[Unreleased]: https://github.com/KenkoGeek/timonel/compare/v0.
|
|
238
|
+
[Unreleased]: https://github.com/KenkoGeek/timonel/compare/v0.4.0...HEAD
|
|
239
|
+
[0.4.0]: https://github.com/KenkoGeek/timonel/releases/tag/v0.4.0
|
|
240
|
+
[0.3.0]: https://github.com/KenkoGeek/timonel/releases/tag/v0.3.0
|
|
241
|
+
[0.2.1]: https://github.com/KenkoGeek/timonel/releases/tag/v0.2.1
|
|
242
|
+
[0.2.0]: https://github.com/KenkoGeek/timonel/releases/tag/v0.2.0
|
|
243
|
+
[0.1.7]: https://github.com/KenkoGeek/timonel/releases/tag/v0.1.7
|
|
244
|
+
[0.1.6]: https://github.com/KenkoGeek/timonel/releases/tag/v0.1.6
|
|
245
|
+
[0.1.5]: https://github.com/KenkoGeek/timonel/releases/tag/v0.1.5
|
|
246
|
+
[0.1.4]: https://github.com/KenkoGeek/timonel/releases/tag/v0.1.4
|
|
247
|
+
[0.1.3]: https://github.com/KenkoGeek/timonel/releases/tag/v0.1.3
|
|
248
|
+
[0.1.2]: https://github.com/KenkoGeek/timonel/releases/tag/v0.1.2
|
|
249
|
+
[0.1.1]: https://github.com/KenkoGeek/timonel/releases/tag/v0.1.1
|
|
188
250
|
[0.1.0]: https://github.com/KenkoGeek/timonel/releases/tag/v0.1.0
|
package/README.md
CHANGED
|
@@ -139,6 +139,9 @@ const rutter = new Rutter({
|
|
|
139
139
|
body: `{{- printf "%s-%s" .Chart.Name .Release.Name | trunc 63 | trimSuffix "-" -}}`,
|
|
140
140
|
},
|
|
141
141
|
],
|
|
142
|
+
// Custom manifest naming options
|
|
143
|
+
manifestName: 'my-app-resources', // Custom name for manifest files
|
|
144
|
+
singleManifestFile: true, // Combine all resources into one file
|
|
142
145
|
});
|
|
143
146
|
|
|
144
147
|
rutter.addDeployment({
|
|
@@ -150,19 +153,82 @@ rutter.addDeployment({
|
|
|
150
153
|
|
|
151
154
|
rutter.addService({ name: 'my-app', port: 80 });
|
|
152
155
|
|
|
153
|
-
//
|
|
154
|
-
rutter.
|
|
155
|
-
name: '
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
156
|
+
// Add auto-scaling with HPA and VPA
|
|
157
|
+
rutter.addHorizontalPodAutoscaler({
|
|
158
|
+
name: 'my-app-hpa',
|
|
159
|
+
scaleTargetRef: { apiVersion: 'apps/v1', kind: 'Deployment', name: 'my-app' },
|
|
160
|
+
minReplicas: 1,
|
|
161
|
+
maxReplicas: 10,
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
rutter.addVerticalPodAutoscaler({
|
|
165
|
+
name: 'my-app-vpa',
|
|
166
|
+
targetRef: { apiVersion: 'apps/v1', kind: 'Deployment', name: 'my-app' },
|
|
167
|
+
updatePolicy: { updateMode: 'Auto' },
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
rutter.addPodDisruptionBudget({
|
|
171
|
+
name: 'my-app-pdb',
|
|
172
|
+
minAvailable: 1,
|
|
173
|
+
selector: { matchLabels: { app: 'my-app' } },
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
// Add IRSA ServiceAccount for AWS access
|
|
177
|
+
rutter.addAWSIRSAServiceAccount({
|
|
178
|
+
name: 'my-app-irsa',
|
|
179
|
+
roleArn: 'arn:aws:iam::123456789012:role/MyAppRole',
|
|
180
|
+
stsEndpointType: 'regional',
|
|
181
|
+
tokenExpiration: 3600,
|
|
161
182
|
});
|
|
162
183
|
|
|
163
184
|
rutter.write('dist/charts/my-app');
|
|
164
185
|
```
|
|
165
186
|
|
|
187
|
+
### Custom Manifest Naming
|
|
188
|
+
|
|
189
|
+
Timonel provides flexible options for naming your Kubernetes manifest files:
|
|
190
|
+
|
|
191
|
+
#### Single Manifest File
|
|
192
|
+
|
|
193
|
+
```typescript
|
|
194
|
+
const rutter = new Rutter({
|
|
195
|
+
meta: { name: 'my-app', version: '0.1.0' },
|
|
196
|
+
manifestName: 'application',
|
|
197
|
+
singleManifestFile: true, // All resources in one file
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
// Generates: templates/application.yaml
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
#### Separate Files with Custom Names
|
|
204
|
+
|
|
205
|
+
```typescript
|
|
206
|
+
const rutter = new Rutter({
|
|
207
|
+
meta: { name: 'my-app', version: '0.1.0' },
|
|
208
|
+
manifestName: 'my-app',
|
|
209
|
+
singleManifestFile: false, // Each resource in its own file (default)
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
// Generates:
|
|
213
|
+
// templates/0000-my-app-deployment-web.yaml
|
|
214
|
+
// templates/0001-my-app-service-web.yaml
|
|
215
|
+
// templates/0002-my-app-configmap-config.yaml
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
#### Default Behavior
|
|
219
|
+
|
|
220
|
+
```typescript
|
|
221
|
+
const rutter = new Rutter({
|
|
222
|
+
meta: { name: 'my-app', version: '0.1.0' },
|
|
223
|
+
// No manifestName specified
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
// Generates:
|
|
227
|
+
// templates/0000-deployment-web.yaml
|
|
228
|
+
// templates/0001-service-web.yaml
|
|
229
|
+
// templates/0002-configmap-config.yaml
|
|
230
|
+
```
|
|
231
|
+
|
|
166
232
|
## Umbrella Charts
|
|
167
233
|
|
|
168
234
|
Create umbrella charts that combine multiple subcharts into a single deployable unit:
|
|
@@ -224,7 +290,11 @@ tl umbrella synth ./dist
|
|
|
224
290
|
|
|
225
291
|
The `examples/` directory contains complete working examples:
|
|
226
292
|
|
|
227
|
-
- **aws-game-2048**: AWS 2048 game deployment
|
|
293
|
+
- **aws-game-2048**: Production-ready AWS 2048 game deployment showcasing AWS-specific features
|
|
294
|
+
- AWS ALB Ingress with health checks and SSL support
|
|
295
|
+
- HorizontalPodAutoscaler (HPA) for automatic scaling based on CPU utilization
|
|
296
|
+
- PodDisruptionBudget (PDB) for high availability during updates
|
|
297
|
+
- Multi-environment configuration (dev/staging/prod)
|
|
228
298
|
- **wordpress**: WordPress with MySQL database setup (single chart)
|
|
229
299
|
- **wordpress-umbrella**: WordPress stack using umbrella charts (MySQL + WordPress subcharts)
|
|
230
300
|
|
|
@@ -245,6 +315,120 @@ shared values, and multi-environment support.
|
|
|
245
315
|
(`toString`, `float64`).
|
|
246
316
|
- For numeric fields (ports, replicas), use literal values or template strings with proper casting.
|
|
247
317
|
|
|
318
|
+
## AWS Multi-Cloud Support
|
|
319
|
+
|
|
320
|
+
Timonel provides comprehensive AWS-specific helpers for EKS deployments:
|
|
321
|
+
|
|
322
|
+
### IRSA (IAM Roles for Service Accounts)
|
|
323
|
+
|
|
324
|
+
Securely access AWS services from Kubernetes pods using IAM roles:
|
|
325
|
+
|
|
326
|
+
```typescript
|
|
327
|
+
// Dedicated IRSA ServiceAccount
|
|
328
|
+
rutter.addAWSIRSAServiceAccount({
|
|
329
|
+
name: 'app-s3-access',
|
|
330
|
+
roleArn: 'arn:aws:iam::123456789012:role/AppS3Role',
|
|
331
|
+
audience: 'sts.amazonaws.com', // optional, defaults to sts.amazonaws.com
|
|
332
|
+
stsEndpointType: 'regional', // recommended for better performance
|
|
333
|
+
tokenExpiration: 3600, // optional, token lifetime in seconds
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
// General ServiceAccount with IRSA support
|
|
337
|
+
rutter.addServiceAccount({
|
|
338
|
+
name: 'my-app-sa',
|
|
339
|
+
awsRoleArn: 'arn:aws:iam::123456789012:role/MyAppRole',
|
|
340
|
+
awsStsEndpointType: 'regional',
|
|
341
|
+
awsTokenExpiration: 7200,
|
|
342
|
+
automountServiceAccountToken: true,
|
|
343
|
+
});
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### AWS Storage Classes
|
|
347
|
+
|
|
348
|
+
```typescript
|
|
349
|
+
// EBS GP3 StorageClass
|
|
350
|
+
rutter.addAWSEBSStorageClass({
|
|
351
|
+
name: 'fast-ssd',
|
|
352
|
+
volumeType: 'gp3',
|
|
353
|
+
encrypted: true,
|
|
354
|
+
iops: 3000,
|
|
355
|
+
throughput: 125,
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
// EFS StorageClass for shared storage
|
|
359
|
+
rutter.addAWSEFSStorageClass({
|
|
360
|
+
name: 'shared-storage',
|
|
361
|
+
reclaimPolicy: 'Retain',
|
|
362
|
+
});
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### AWS Load Balancer Controller
|
|
366
|
+
|
|
367
|
+
```typescript
|
|
368
|
+
// ALB Ingress with health checks
|
|
369
|
+
rutter.addAWSALBIngress({
|
|
370
|
+
name: 'app-ingress',
|
|
371
|
+
scheme: 'internet-facing',
|
|
372
|
+
targetType: 'ip',
|
|
373
|
+
healthCheckPath: '/health',
|
|
374
|
+
certificateArn:
|
|
375
|
+
'arn:aws:acm:us-west-2:123456789012:certificate/12345678-1234-1234-1234-123456789012',
|
|
376
|
+
rules: [
|
|
377
|
+
{
|
|
378
|
+
paths: [
|
|
379
|
+
{
|
|
380
|
+
path: '/',
|
|
381
|
+
pathType: 'Prefix',
|
|
382
|
+
backend: { service: { name: 'my-app', port: { number: 80 } } },
|
|
383
|
+
},
|
|
384
|
+
],
|
|
385
|
+
},
|
|
386
|
+
],
|
|
387
|
+
});
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
### AWS Secrets Manager and Parameter Store
|
|
391
|
+
|
|
392
|
+
Integrate with AWS Secrets Manager and Parameter Store using the Secrets Store CSI Driver:
|
|
393
|
+
|
|
394
|
+
```typescript
|
|
395
|
+
// Secrets Manager integration
|
|
396
|
+
rutter.addAWSSecretProviderClass({
|
|
397
|
+
name: 'app-secrets',
|
|
398
|
+
region: 'us-west-2',
|
|
399
|
+
objects: [
|
|
400
|
+
{
|
|
401
|
+
objectName: 'prod/myapp/database',
|
|
402
|
+
objectType: 'secretsmanager',
|
|
403
|
+
objectAlias: 'db-credentials',
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
objectName: 'prod/myapp/api-keys',
|
|
407
|
+
objectType: 'secretsmanager',
|
|
408
|
+
jmesPath: '["api_key", "secret_key"]', // Extract specific keys from JSON
|
|
409
|
+
},
|
|
410
|
+
],
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
// Parameter Store integration
|
|
414
|
+
rutter.addAWSSecretProviderClass({
|
|
415
|
+
name: 'app-config',
|
|
416
|
+
region: 'us-west-2',
|
|
417
|
+
objects: [
|
|
418
|
+
{
|
|
419
|
+
objectName: '/myapp/config/debug-mode',
|
|
420
|
+
objectType: 'ssmparameter',
|
|
421
|
+
objectAlias: 'debug-flag',
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
objectName: '/myapp/config/cache-ttl',
|
|
425
|
+
objectType: 'ssmparameter',
|
|
426
|
+
objectAlias: 'cache-timeout',
|
|
427
|
+
},
|
|
428
|
+
],
|
|
429
|
+
});
|
|
430
|
+
```
|
|
431
|
+
|
|
248
432
|
## Multi-environment values
|
|
249
433
|
|
|
250
434
|
Provide `envValues` in the `Rutter` constructor to automatically create
|
|
@@ -270,9 +454,12 @@ Provide `envValues` in the `Rutter` constructor to automatically create
|
|
|
270
454
|
|
|
271
455
|
## Roadmap
|
|
272
456
|
|
|
273
|
-
-
|
|
457
|
+
- ✅ Auto-scaling helpers (HPA, VPA, PodDisruptionBudget)
|
|
458
|
+
- ✅ AWS multi-cloud support (EBS, EFS, ALB, IRSA, Secrets Manager, Parameter Store)
|
|
459
|
+
- ✅ Custom manifest naming and file organization
|
|
460
|
+
- Azure multi-cloud support (AKS-specific helpers)
|
|
461
|
+
- GCP multi-cloud support (GKE-specific helpers)
|
|
274
462
|
- Richer CLI (resource generators, diff)
|
|
275
|
-
- Enhanced multi-cloud support
|
|
276
463
|
- Template validation and testing utilities
|
|
277
464
|
|
|
278
465
|
## Contributing
|
|
@@ -34,6 +34,8 @@ export interface SynthAsset {
|
|
|
34
34
|
yaml: string;
|
|
35
35
|
/** target directory inside chart: templates (default) or crds */
|
|
36
36
|
target?: 'templates' | 'crds';
|
|
37
|
+
/** if true, don't split this asset into multiple files even if it contains multiple docs */
|
|
38
|
+
singleFile?: boolean;
|
|
37
39
|
}
|
|
38
40
|
export interface HelmChartWriteOptions {
|
|
39
41
|
outDir: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HelmChartWriter.d.ts","sourceRoot":"","sources":["../../src/lib/HelmChartWriter.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,KAAK,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QAC9B,IAAI,CAAC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CAAC,EAAE,MAAM,EAAE,CAAC;QAChB,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,YAAY;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,UAAU;IACzB,6BAA6B;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IAC9B,4FAA4F;IAC5F,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,aAAa,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IACpD,SAAS,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACrC;;;OAGG;IACH,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAC;IACzC,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,eAAe;IAC1B,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,qBAAqB;CA4GzC"}
|
|
@@ -139,15 +139,27 @@ function splitDocs(yamlStr) {
|
|
|
139
139
|
function writeAssets(outDir, assets) {
|
|
140
140
|
let counter = 0;
|
|
141
141
|
for (const asset of assets) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const filename = `${
|
|
142
|
+
if (asset.singleFile) {
|
|
143
|
+
// Write as a single file without splitting documents
|
|
144
|
+
const filename = `${asset.id}.yaml`;
|
|
145
145
|
const dir = asset.target === 'crds' ? 'crds' : 'templates';
|
|
146
146
|
// eslint-disable-next-line security/detect-non-literal-fs-filename -- Chart writer needs dynamic paths
|
|
147
147
|
fs.mkdirSync(path.join(outDir, dir), { recursive: true });
|
|
148
148
|
// eslint-disable-next-line security/detect-non-literal-fs-filename -- Chart writer needs dynamic paths
|
|
149
|
-
fs.writeFileSync(path.join(outDir, dir, filename),
|
|
150
|
-
|
|
149
|
+
fs.writeFileSync(path.join(outDir, dir, filename), asset.yaml + '\n');
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
// Split documents and create numbered files (default behavior)
|
|
153
|
+
const parts = splitDocs(asset.yaml);
|
|
154
|
+
for (const doc of parts) {
|
|
155
|
+
const filename = `${String(counter).padStart(4, '0')}-${asset.id}.yaml`;
|
|
156
|
+
const dir = asset.target === 'crds' ? 'crds' : 'templates';
|
|
157
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- Chart writer needs dynamic paths
|
|
158
|
+
fs.mkdirSync(path.join(outDir, dir), { recursive: true });
|
|
159
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- Chart writer needs dynamic paths
|
|
160
|
+
fs.writeFileSync(path.join(outDir, dir, filename), doc + '\n');
|
|
161
|
+
counter++;
|
|
162
|
+
}
|
|
151
163
|
}
|
|
152
164
|
}
|
|
153
165
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HelmChartWriter.js","sourceRoot":"","sources":["../../src/lib/HelmChartWriter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,gDAAwB;
|
|
1
|
+
{"version":3,"file":"HelmChartWriter.js","sourceRoot":"","sources":["../../src/lib/HelmChartWriter.ts"],"names":[],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