@firestartr/cli 1.54.0-snapshot-3 → 1.54.0-snapshot-4

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/build/index.js CHANGED
@@ -357283,8 +357283,10 @@ class TFWorkspaceNormalizer extends Normalizer {
357283
357283
  async function normalizeModuleContent(tfRootModulePath) {
357284
357284
  let content = '';
357285
357285
  const files = {};
357286
- await crawl(tfRootModulePath, (entry) => {
357287
- return entry.endsWith('.tf');
357286
+ await crawl(tfRootModulePath,
357287
+ // bring all files, not only tf
357288
+ (_) => {
357289
+ return true;
357288
357290
  }, (entry, data) => {
357289
357291
  files[entry] = data;
357290
357292
  });
@@ -358075,14 +358077,6 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
358075
358077
  secrets: {
358076
358078
  $ref: 'firestartr.dev://github/GithubComponentClaimSecrets',
358077
358079
  },
358078
- topics: {
358079
- type: 'array',
358080
- items: {
358081
- type: 'string',
358082
- maxLength: 50,
358083
- pattern: '^[a-z0-9][a-z0-9-]*$',
358084
- },
358085
- },
358086
358080
  },
358087
358081
  required: ['visibility', 'org'],
358088
358082
  },
@@ -362209,7 +362203,6 @@ function toJson_FirestartrGithubRepositorySpecRepo(obj) {
362209
362203
  'hasIssues': obj.hasIssues,
362210
362204
  'hasWiki': obj.hasWiki,
362211
362205
  'pages': obj.pages,
362212
- 'topics': obj.topics?.map(y => y),
362213
362206
  'visibility': obj.visibility,
362214
362207
  'defaultBranch': obj.defaultBranch,
362215
362208
  'additionalBranches': obj.additionalBranches?.map(y => toJson_FirestartrGithubRepositorySpecRepoAdditionalBranches(y)),
@@ -364335,7 +364328,6 @@ class GithubRepositoryChart extends BaseGithubChart {
364335
364328
  defaultBranch: claim.providers.github?.branchStrategy?.defaultBranch,
364336
364329
  codeowners: createCodeOwnersData(claim),
364337
364330
  additionalBranches: claim.providers.github.additionalBranches || [],
364338
- topics: claim.providers.github.topics || [],
364339
364331
  },
364340
364332
  actions,
364341
364333
  permissions: this.createPermissions(claim),
@@ -371931,25 +371923,36 @@ class WriterBackend extends writer {
371931
371923
  class WriterProvider extends writer {
371932
371924
  constructor(providers) {
371933
371925
  super();
371926
+ this.jsonOutput = {};
371934
371927
  this.providers = providers;
371935
371928
  }
371929
+ async render(renderType = 'tf') {
371930
+ await this._render();
371931
+ if (renderType === 'tf') {
371932
+ return this.output.trim();
371933
+ }
371934
+ else if (renderType === 'json') {
371935
+ return JSON.stringify(this.jsonOutput, null, 2);
371936
+ }
371937
+ else {
371938
+ throw new Error(`Unsupported render type: ${renderType}`);
371939
+ }
371940
+ }
371936
371941
  async _render() {
371937
371942
  for (const provider of this.providers) {
371938
- this.output += this.__renderProvider(provider);
371943
+ if (provider.inline) {
371944
+ this.output += provider.inline + '\n';
371945
+ }
371946
+ else {
371947
+ this.__populateJsonOutput(provider);
371948
+ }
371939
371949
  }
371940
371950
  }
371941
- __renderProvider(provider) {
371942
- let configString = '';
371943
- if (provider.inline)
371944
- return provider.inline;
371945
- for (const key in provider.config) {
371946
- configString += `${key} = "${provider.config[key]}"\n`;
371951
+ __populateJsonOutput(provider) {
371952
+ if (this.jsonOutput[provider.name] === undefined) {
371953
+ this.jsonOutput[provider.name] = [];
371947
371954
  }
371948
- return `
371949
- provider "${provider.name}" {
371950
-
371951
- ${configString}
371952
- }`;
371955
+ this.jsonOutput[provider.name].push(provider.config);
371953
371956
  }
371954
371957
  }
371955
371958
 
@@ -371985,6 +371988,26 @@ class WriterTerraform extends writer {
371985
371988
  this.tfStateKey = tfStateKey;
371986
371989
  this.writeRequiredProvidersBlock = writeRequiredProvidersBlock;
371987
371990
  }
371991
+ async render(renderType = 'tf') {
371992
+ if (renderType === 'tf') {
371993
+ return super.render();
371994
+ }
371995
+ else {
371996
+ await this._renderJson();
371997
+ return this.output.trim();
371998
+ }
371999
+ }
372000
+ async _renderJson() {
372001
+ const providersString = await new WriterProvider(this.requiredProviders).render('json');
372002
+ if (providersString.trim() !== '{}') {
372003
+ this.output = `{
372004
+ "provider": ${providersString}
372005
+ }`; // providersString is already a JSON object string
372006
+ }
372007
+ else {
372008
+ this.output = ''; // No providers to include
372009
+ }
372010
+ }
371988
372011
  async _render() {
371989
372012
  const providersString = await new WriterProvider(this.requiredProviders).render();
371990
372013
  let backend = '';
@@ -372193,17 +372216,44 @@ function fCheckString(keys, refs) {
372193
372216
  return true;
372194
372217
  }
372195
372218
 
372219
+ ;// CONCATENATED MODULE: ../terraform_provisioner/src/writer_provider_tf_json.ts
372220
+
372221
+
372222
+
372223
+ class WriterProviderJson extends writer {
372224
+ constructor(mainBlock, providers, backend, tfStateKey) {
372225
+ super();
372226
+ this.mainBlock = mainBlock;
372227
+ this.providers = providers;
372228
+ this.backend = backend;
372229
+ this.tfStateKey = tfStateKey;
372230
+ }
372231
+ async _render() {
372232
+ this.output = await new WriterTerraform(this.providers, this.backend, this.tfStateKey, false).render('json');
372233
+ }
372234
+ writeToTerraformProject(mainTfPath) {
372235
+ if (this.output.trim() === '') {
372236
+ terraform_provisioner_src_logger.info(`Skipping writing ${mainTfPath} as there is no provider to write.`);
372237
+ }
372238
+ else {
372239
+ super.writeToTerraformProject(mainTfPath);
372240
+ }
372241
+ }
372242
+ }
372243
+
372196
372244
  ;// CONCATENATED MODULE: ../terraform_provisioner/src/project_tf.ts
372197
372245
 
372198
372246
 
372199
372247
 
372200
372248
 
372201
372249
 
372250
+
372202
372251
  class project_tf_TFProjectManager {
372203
372252
  constructor(ctx) {
372204
372253
  this.tfOutput = '';
372205
372254
  this.projectPath = ctx.projectPath;
372206
372255
  this.mainTfWriter = new WriterMainTf(ctx.inline, ctx.requiredProviders, ctx.backend, ctx.tfStateKey);
372256
+ this.providerJsonWriter = new WriterProviderJson(ctx.inline, ctx.requiredProviders, ctx.backend, ctx.tfStateKey);
372207
372257
  this.tfVarsJsonWriter = new WriterTfVarsJson(ctx.values, ctx.references);
372208
372258
  this.secrets = ctx.secrets;
372209
372259
  }
@@ -372220,7 +372270,9 @@ class project_tf_TFProjectManager {
372220
372270
  }
372221
372271
  async build() {
372222
372272
  await this.mainTfWriter.render();
372223
- this.mainTfWriter.writeToTerraformProject(external_path_.join(this.projectPath, 'main.tf'));
372273
+ this.mainTfWriter.writeToTerraformProject(external_path_.join(this.projectPath, 'firestartr-main.tf'));
372274
+ await this.providerJsonWriter.render();
372275
+ this.providerJsonWriter.writeToTerraformProject(external_path_.join(this.projectPath, 'firestartr-providers.tf.json'));
372224
372276
  await this.tfVarsJsonWriter.render();
372225
372277
  this.tfVarsJsonWriter.writeToTerraformProject(external_path_.join(this.projectPath, 'terraform.tfvars.json'));
372226
372278
  }
@@ -372353,14 +372405,16 @@ var lib_ajv_default = /*#__PURE__*/__nccwpck_require__.n(lib_ajv);
372353
372405
 
372354
372406
 
372355
372407
 
372408
+
372356
372409
  class TFProjectManagerRemote {
372357
372410
  constructor(ctx) {
372358
372411
  this.tfOutput = '';
372359
372412
  this.ctx = ctx;
372360
372413
  this.projectPath = ctx.projectPath;
372414
+ this.secrets = ctx.secrets;
372361
372415
  this.writerTerraform = new WriterTerraform(ctx.requiredProviders, ctx.backend, ctx.tfStateKey, false);
372416
+ this.providerJsonWriter = new WriterProviderJson(ctx.inline, ctx.requiredProviders, ctx.backend, ctx.tfStateKey);
372362
372417
  this.tfVarsJsonWriter = new WriterTfVarsJson(ctx.values, ctx.references);
372363
- this.secrets = ctx.secrets;
372364
372418
  }
372365
372419
  getOutput() {
372366
372420
  return this.tfOutput;
@@ -372378,7 +372432,9 @@ class TFProjectManagerRemote {
372378
372432
  await this.__configGit();
372379
372433
  await this.__initFromModule();
372380
372434
  await this.writerTerraform.render();
372381
- this.writerTerraform.writeToTerraformProject(external_path_.join(this.projectPath, 'terraform.tf'));
372435
+ this.writerTerraform.writeToTerraformProject(external_path_.join(this.projectPath, 'firestartr-terraform.tf'));
372436
+ await this.providerJsonWriter.render();
372437
+ this.providerJsonWriter.writeToTerraformProject(external_path_.join(this.projectPath, 'firestartr-providers.tf.json'));
372382
372438
  await this.tfVarsJsonWriter.render();
372383
372439
  this.tfVarsJsonWriter.writeToTerraformProject(external_path_.join(this.projectPath, 'terraform.tfvars.json'));
372384
372440
  }
@@ -374281,7 +374337,7 @@ async function tfWorkspacePlan(opts) {
374281
374337
  fDebug('Context built');
374282
374338
  const command = getCommandByStatus(status);
374283
374339
  fDebug('Running terraform provisioner');
374284
- const tfOutput = await runTerraformProvisioner(ctx, command);
374340
+ const tfOutput = await runTerraformProvisioner(ctx, command, undefined);
374285
374341
  fDebug('Terraform provisioner finished');
374286
374342
  fDebug('Publishing plan');
374287
374343
  await publishPlan(cr, tfOutput, prNumber, repo, owner);
@@ -1014,10 +1014,6 @@ export interface FirestartrGithubRepositorySpecRepo {
1014
1014
  * @schema FirestartrGithubRepositorySpecRepo#pages
1015
1015
  */
1016
1016
  readonly pages?: any;
1017
- /**
1018
- * @schema FirestartrGithubRepositorySpecRepo#topics
1019
- */
1020
- readonly topics?: string[];
1021
1017
  /**
1022
1018
  * @schema FirestartrGithubRepositorySpecRepo#visibility
1023
1019
  */
@@ -505,14 +505,6 @@ declare const schemas: {
505
505
  secrets: {
506
506
  $ref: string;
507
507
  };
508
- topics: {
509
- type: string;
510
- items: {
511
- type: string;
512
- maxLength: number;
513
- pattern: string;
514
- };
515
- };
516
508
  };
517
509
  required: string[];
518
510
  $ref?: undefined;
@@ -35,14 +35,6 @@ declare const _default: {
35
35
  secrets: {
36
36
  $ref: string;
37
37
  };
38
- topics: {
39
- type: string;
40
- items: {
41
- type: string;
42
- maxLength: number;
43
- pattern: string;
44
- };
45
- };
46
38
  };
47
39
  required: string[];
48
40
  $ref?: undefined;
@@ -140,14 +140,6 @@ export declare const GithubSchemas: ({
140
140
  secrets: {
141
141
  $ref: string;
142
142
  };
143
- topics: {
144
- type: string;
145
- items: {
146
- type: string;
147
- maxLength: number;
148
- pattern: string;
149
- };
150
- };
151
143
  };
152
144
  required: string[];
153
145
  $ref?: undefined;
@@ -28,7 +28,6 @@ export interface IGithubRepositoryClaim extends IComponentClaim {
28
28
  name: string;
29
29
  orphan: boolean;
30
30
  }[];
31
- topics?: string[];
32
31
  };
33
32
  };
34
33
  }
@@ -1,9 +1,11 @@
1
1
  /// <reference types="node" />
2
2
  import { WriterMainTf } from './writer_main_tf';
3
3
  import { WriterTfVarsJson } from './writer_tfvars_json';
4
+ import { WriterProviderJson } from './writer_provider_tf_json';
4
5
  import { PassThrough } from 'stream';
5
6
  export declare class TFProjectManager {
6
7
  mainTfWriter: WriterMainTf;
8
+ providerJsonWriter: WriterProviderJson;
7
9
  tfVarsJsonWriter: WriterTfVarsJson;
8
10
  secrets: any[];
9
11
  projectPath: string;
@@ -1,9 +1,11 @@
1
1
  /// <reference types="node" />
2
2
  import { WriterTerraform } from './writer_terraform';
3
3
  import { WriterTfVarsJson } from './writer_tfvars_json';
4
+ import { WriterProviderJson } from './writer_provider_tf_json';
4
5
  import { PassThrough } from 'stream';
5
6
  export declare class TFProjectManagerRemote {
6
7
  writerTerraform: WriterTerraform;
8
+ providerJsonWriter: WriterProviderJson;
7
9
  tfVarsJsonWriter: WriterTfVarsJson;
8
10
  ctx: any;
9
11
  secrets: any[];
@@ -1,7 +1,9 @@
1
1
  import Writer from './writer';
2
2
  export declare class WriterProvider extends Writer {
3
3
  providers: any[];
4
+ jsonOutput: {};
4
5
  constructor(providers: any[]);
6
+ render(renderType?: string): Promise<string>;
5
7
  _render(): Promise<void>;
6
- __renderProvider(provider: any): any;
8
+ __populateJsonOutput(provider: any): void;
7
9
  }
@@ -0,0 +1,10 @@
1
+ import Writer from './writer';
2
+ export declare class WriterProviderJson extends Writer {
3
+ providers: Array<any>;
4
+ mainBlock: string;
5
+ tfStateKey: string;
6
+ backend: any;
7
+ constructor(mainBlock: string, providers: Array<any>, backend: any, tfStateKey: string);
8
+ _render(): Promise<void>;
9
+ writeToTerraformProject(mainTfPath: string): void;
10
+ }
@@ -5,5 +5,7 @@ export declare class WriterTerraform extends Writer {
5
5
  backend: any;
6
6
  tfStateKey: string;
7
7
  constructor(requiredProviders: Array<any>, backend: any, tfStateKey: string, writeRequiredProvidersBlock?: boolean);
8
+ render(renderType?: string): Promise<string>;
9
+ _renderJson(): Promise<void>;
8
10
  _render(): Promise<void>;
9
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "1.54.0-snapshot-3",
3
+ "version": "1.54.0-snapshot-4",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",