@quadnix/octo-build 0.0.16 → 0.1.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/LICENSE +661 -0
- package/README.md +25 -3
- package/dist/commands/apply/apply.command.d.ts +25 -0
- package/dist/commands/apply/apply.command.js +136 -0
- package/dist/commands/apply/apply.command.js.map +1 -0
- package/dist/commands/apply/index.d.ts +1 -0
- package/dist/commands/apply/index.js +2 -0
- package/dist/commands/apply/index.js.map +1 -0
- package/dist/commands/build/build.command.d.ts +1 -1
- package/dist/commands/build/build.command.js +4 -4
- package/dist/commands/build/build.command.js.map +1 -1
- package/dist/commands/build/main.d.ts +22 -0
- package/dist/commands/build/main.js +22 -0
- package/dist/commands/build/main.js.map +1 -1
- package/dist/commands/build/parsers/build-file.parser.d.ts +6 -0
- package/dist/commands/build/parsers/build-file.parser.js +6 -0
- package/dist/commands/build/parsers/build-file.parser.js.map +1 -1
- package/dist/commands/build/streams/stream-manager.d.ts +6 -0
- package/dist/commands/build/streams/stream-manager.js +7 -1
- package/dist/commands/build/streams/stream-manager.js.map +1 -1
- package/dist/commands/commit/commit.command.d.ts +22 -0
- package/dist/commands/commit/commit.command.js +94 -0
- package/dist/commands/commit/commit.command.js.map +1 -0
- package/dist/commands/commit/index.d.ts +1 -0
- package/dist/commands/commit/index.js +2 -0
- package/dist/commands/commit/index.js.map +1 -0
- package/dist/commands/create-anchor/create-anchor.command.js +1 -1
- package/dist/commands/create-anchor/create-anchor.command.js.map +1 -1
- package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/index.d.ts +18 -3
- package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/index.js +29 -11
- package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/index.js.map +1 -1
- package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/templates/anchors/anchor/anchor.schema.ts.ejs +9 -1
- package/dist/commands/create-app/create-app.command.d.ts +1 -1
- package/dist/commands/create-app/create-app.command.js +7 -3
- package/dist/commands/create-app/create-app.command.js.map +1 -1
- package/dist/commands/create-app/generator-octo-app-template/generators/app/index.d.ts +17 -1
- package/dist/commands/create-app/generator-octo-app-template/generators/app/index.js +60 -18
- package/dist/commands/create-app/generator-octo-app-template/generators/app/index.js.map +1 -1
- package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/README.md.ejs +60 -10
- package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/gitignore.ejs +13 -0
- package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/index.ts.ejs +19 -0
- package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/package.json.ejs +9 -1
- package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/src/aws-dynamodb-service/octo.yaml.ejs +111 -0
- package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/octo.yaml.ejs +198 -0
- package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/src/aws-s3-website/octo.yaml.ejs +14 -0
- package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/tsconfig.json.ejs +0 -3
- package/dist/commands/{create-resource/create-resource.command.d.ts → create-external-resource/create-external-resource.command.d.ts} +1 -1
- package/dist/commands/create-external-resource/create-external-resource.command.js +64 -0
- package/dist/commands/create-external-resource/create-external-resource.command.js.map +1 -0
- package/dist/commands/{create-resource/generator-octo-resource-template → create-external-resource/generator-octo-external-resource-template}/generators/app/index.d.ts +17 -2
- package/dist/commands/{create-resource/generator-octo-resource-template → create-external-resource/generator-octo-external-resource-template}/generators/app/index.js +36 -35
- package/dist/commands/create-external-resource/generator-octo-external-resource-template/generators/app/index.js.map +1 -0
- package/dist/commands/{create-resource/generator-octo-resource-template → create-external-resource/generator-octo-external-resource-template}/generators/app/templates/resources/resource/actions/add.resource.action.ts.ejs +7 -16
- package/dist/commands/{create-resource/generator-octo-resource-template → create-external-resource/generator-octo-external-resource-template}/generators/app/templates/resources/resource/actions/delete.resource.action.ts.ejs +21 -3
- package/dist/commands/create-external-resource/generator-octo-external-resource-template/generators/app/templates/resources/resource/actions/update.resource.action.ts.ejs +63 -0
- package/dist/commands/{create-resource/generator-octo-resource-template → create-external-resource/generator-octo-external-resource-template}/generators/app/templates/resources/resource/index.ts.ejs +1 -2
- package/dist/commands/create-external-resource/generator-octo-external-resource-template/generators/app/templates/resources/resource/resource.ts.ejs +28 -0
- package/dist/commands/create-external-resource/index.d.ts +1 -0
- package/dist/commands/create-external-resource/index.js +2 -0
- package/dist/commands/create-external-resource/index.js.map +1 -0
- package/dist/commands/create-model/create-model.command.js +1 -1
- package/dist/commands/create-model/create-model.command.js.map +1 -1
- package/dist/commands/create-model/generator-octo-model-template/generators/app/index.d.ts +17 -2
- package/dist/commands/create-model/generator-octo-model-template/generators/app/index.js +26 -9
- package/dist/commands/create-model/generator-octo-model-template/generators/app/index.js.map +1 -1
- package/dist/commands/create-model/generator-octo-model-template/generators/app/templates/models/model/model.ts.ejs +3 -1
- package/dist/commands/create-model/generator-octo-model-template/generators/app/templates/models/model/schema.ts.ejs +6 -1
- package/dist/commands/create-module/create-module.command.js +1 -1
- package/dist/commands/create-module/create-module.command.js.map +1 -1
- package/dist/commands/create-module/generator-octo-module-template/generators/app/index.d.ts +17 -2
- package/dist/commands/create-module/generator-octo-module-template/generators/app/index.js +27 -10
- package/dist/commands/create-module/generator-octo-module-template/generators/app/index.js.map +1 -1
- package/dist/commands/create-overlay/create-overlay.command.js +4 -3
- package/dist/commands/create-overlay/create-overlay.command.js.map +1 -1
- package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/index.d.ts +17 -2
- package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/index.js +26 -9
- package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/index.js.map +1 -1
- package/dist/commands/{create-cdk/create-cdk.command.d.ts → create-terraform-resource/create-terraform-resource.command.d.ts} +3 -3
- package/dist/commands/{create-resource/create-resource.command.js → create-terraform-resource/create-terraform-resource.command.js} +17 -11
- package/dist/commands/create-terraform-resource/create-terraform-resource.command.js.map +1 -0
- package/dist/commands/create-terraform-resource/generator-octo-terraform-resource-template/generators/app/index.d.ts +25 -0
- package/dist/commands/create-terraform-resource/generator-octo-terraform-resource-template/generators/app/index.js +71 -0
- package/dist/commands/create-terraform-resource/generator-octo-terraform-resource-template/generators/app/index.js.map +1 -0
- package/dist/commands/create-terraform-resource/generator-octo-terraform-resource-template/generators/app/templates/resources/resource/index.schema.ts.ejs +43 -0
- package/dist/commands/create-terraform-resource/generator-octo-terraform-resource-template/generators/app/templates/resources/resource/index.ts.ejs +1 -0
- package/dist/commands/create-terraform-resource/generator-octo-terraform-resource-template/generators/app/templates/resources/resource/resource.ts.ejs +83 -0
- package/dist/commands/create-terraform-resource/index.d.ts +1 -0
- package/dist/commands/create-terraform-resource/index.js +2 -0
- package/dist/commands/create-terraform-resource/index.js.map +1 -0
- package/dist/commands/generate/generate.command.d.ts +14 -0
- package/dist/commands/generate/generate.command.js +35 -0
- package/dist/commands/generate/generate.command.js.map +1 -0
- package/dist/commands/generate/index.d.ts +1 -0
- package/dist/commands/generate/index.js +2 -0
- package/dist/commands/generate/index.js.map +1 -0
- package/dist/commands/get-response/get-response.command.d.ts +18 -0
- package/dist/commands/get-response/get-response.command.js +39 -0
- package/dist/commands/get-response/get-response.command.js.map +1 -0
- package/dist/commands/get-response/index.d.ts +1 -0
- package/dist/commands/get-response/index.js +2 -0
- package/dist/commands/get-response/index.js.map +1 -0
- package/dist/commands/lock/index.d.ts +1 -0
- package/dist/commands/lock/index.js +2 -0
- package/dist/commands/lock/index.js.map +1 -0
- package/dist/commands/lock/lock.command.d.ts +13 -0
- package/dist/commands/lock/lock.command.js +28 -0
- package/dist/commands/lock/lock.command.js.map +1 -0
- package/dist/commands/run-action/index.d.ts +1 -0
- package/dist/commands/run-action/index.js +2 -0
- package/dist/commands/run-action/index.js.map +1 -0
- package/dist/commands/run-action/run-action.command.d.ts +12 -0
- package/dist/commands/run-action/run-action.command.js +46 -0
- package/dist/commands/run-action/run-action.command.js.map +1 -0
- package/dist/commands/unlock/index.d.ts +1 -0
- package/dist/commands/unlock/index.js +2 -0
- package/dist/commands/unlock/index.js.map +1 -0
- package/dist/commands/unlock/unlock.command.d.ts +18 -0
- package/dist/commands/unlock/unlock.command.js +51 -0
- package/dist/commands/unlock/unlock.command.js.map +1 -0
- package/dist/commands/validate/index.d.ts +1 -0
- package/dist/commands/validate/index.js +2 -0
- package/dist/commands/validate/index.js.map +1 -0
- package/dist/commands/validate/validate.command.d.ts +17 -0
- package/dist/commands/validate/validate.command.js +68 -0
- package/dist/commands/validate/validate.command.js.map +1 -0
- package/dist/index.js +20 -8
- package/dist/index.js.map +1 -1
- package/dist/resources/octo-v1.schema.json +86 -19
- package/dist/utilities/definition/yaml/yaml-definition.utility.d.ts +98 -10
- package/dist/utilities/definition/yaml/yaml-definition.utility.js +197 -66
- package/dist/utilities/definition/yaml/yaml-definition.utility.js.map +1 -1
- package/dist/utilities/octo/octo.utility.d.ts +48 -0
- package/dist/utilities/octo/octo.utility.js +144 -0
- package/dist/utilities/octo/octo.utility.js.map +1 -0
- package/dist/utilities/process/process.utility.d.ts +8 -0
- package/dist/utilities/process/process.utility.js +8 -0
- package/dist/utilities/process/process.utility.js.map +1 -1
- package/dist/utilities/project-index/project-index.utility.d.ts +27 -0
- package/dist/utilities/project-index/project-index.utility.js +71 -0
- package/dist/utilities/project-index/project-index.utility.js.map +1 -0
- package/dist/utilities/string/string.utility.d.ts +22 -0
- package/dist/utilities/string/string.utility.js +27 -0
- package/dist/utilities/string/string.utility.js.map +1 -1
- package/package.json +9 -8
- package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/app.config.ts.ejs +0 -23
- package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/env.ejs +0 -2
- package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/main.ts.ejs +0 -24
- package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/module-definitions.ts.ejs +0 -201
- package/dist/commands/create-cdk/create-cdk.command.js +0 -70
- package/dist/commands/create-cdk/create-cdk.command.js.map +0 -1
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/index.d.ts +0 -10
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/index.js +0 -107
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/index.js.map +0 -1
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/README.md.ejs +0 -23
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/eslint.config.js.ejs +0 -337
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/gitignore.ejs +0 -82
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/gitkeep.ejs +0 -0
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/package.json.ejs +0 -57
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/prettierrc.ejs +0 -5
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/anchors/app/app.anchor.schema.ts.ejs +0 -19
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/anchors/app/app.anchor.ts.ejs +0 -17
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/factories/dummy-credentials.factory.ts.ejs +0 -28
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/dummy-app.module.spec.ts.ejs +0 -90
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/dummy-app.module.ts.ejs +0 -16
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/index.schema.ts.ejs +0 -10
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/index.ts.ejs +0 -3
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/models/app/actions/add-dummy-app.model.action.ts.ejs +0 -59
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/models/app/index.ts.ejs +0 -1
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/resources/http-fetch/actions/add-http-fetch.resource.action.ts.ejs +0 -55
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/resources/http-fetch/http-fetch.resource.ts.ejs +0 -12
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/resources/http-fetch/index.schema.ts.ejs +0 -35
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/resources/http-fetch/index.ts.ejs +0 -3
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/utilities/dummy/dummy.utility.ts.ejs +0 -11
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/tsconfig.build.json.ejs +0 -11
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/tsconfig.json.ejs +0 -39
- package/dist/commands/create-cdk/index.d.ts +0 -1
- package/dist/commands/create-cdk/index.js +0 -2
- package/dist/commands/create-cdk/index.js.map +0 -1
- package/dist/commands/create-resource/create-resource.command.js.map +0 -1
- package/dist/commands/create-resource/generator-octo-resource-template/generators/app/index.js.map +0 -1
- package/dist/commands/create-resource/generator-octo-resource-template/generators/app/templates/resources/resource/actions/update-tags.resource.action.ts.ejs +0 -86
- package/dist/commands/create-resource/generator-octo-resource-template/generators/app/templates/resources/resource/actions/validate.resource.action.ts.ejs +0 -40
- package/dist/commands/create-resource/generator-octo-resource-template/generators/app/templates/resources/resource/resource.ts.ejs +0 -12
- package/dist/commands/create-resource/index.d.ts +0 -1
- package/dist/commands/create-resource/index.js +0 -2
- package/dist/commands/create-resource/index.js.map +0 -1
- package/dist/commands/run/index.d.ts +0 -1
- package/dist/commands/run/index.js +0 -2
- package/dist/commands/run/index.js.map +0 -1
- package/dist/commands/run/run.command.d.ts +0 -11
- package/dist/commands/run/run.command.js +0 -83
- package/dist/commands/run/run.command.js.map +0 -1
- package/dist/commands/state/index.d.ts +0 -1
- package/dist/commands/state/index.js +0 -2
- package/dist/commands/state/index.js.map +0 -1
- package/dist/commands/state/state.command.d.ts +0 -14
- package/dist/commands/state/state.command.js +0 -79
- package/dist/commands/state/state.command.js.map +0 -1
- /package/dist/commands/{create-resource/generator-octo-resource-template → create-external-resource/generator-octo-external-resource-template}/generators/app/templates/resources/resource/index.schema.ts.ejs +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-anchor.command.js","sourceRoot":"","sources":["../../../src/commands/create-anchor/create-anchor.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAEzE,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,OAAO,EAAE,CAAC,KAAW,EAAQ,EAAE;QAC7B,OAAO,KAAK;aACT,MAAM,CAAC,MAAM,EAAE;YACd,KAAK,EAAE,GAAG;YACV,YAAY,EAAE,IAAI;YAClB,WAAW,EAAE,iFAAiF;YAC9F,IAAI,EAAE,QAAQ;SACf,CAAC;aACD,MAAM,CAAC,QAAQ,EAAE;YAChB,YAAY,EAAE,IAAI;YAClB,WAAW,EAAE,6EAA6E;YAC1F,IAAI,EAAE,QAAQ;SACf,CAAC;aACD,MAAM,CAAC,MAAM,EAAE;YACd,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,CAAC,GAAG,aAAa,CAAC,qBAAqB,EAAE,SAAS,CAAC;YAC5D,YAAY,EAAE,IAAI;YAClB,WAAW,EAAE,mCAAmC;YAChD,IAAI,EAAE,QAAQ;SACf,CAAC;aACD,MAAM,CAAC,SAAS,EAAE;YACjB,YAAY,EAAE,IAAI;YAClB,WAAW,EAAE,8BAA8B;YAC3C,IAAI,EAAE,QAAQ;SACf,CAAC;aACD,MAAM,CAAC,MAAM,EAAE;YACd,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,GAAG;YACZ,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"create-anchor.command.js","sourceRoot":"","sources":["../../../src/commands/create-anchor/create-anchor.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAEzE,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,OAAO,EAAE,CAAC,KAAW,EAAQ,EAAE;QAC7B,OAAO,KAAK;aACT,MAAM,CAAC,MAAM,EAAE;YACd,KAAK,EAAE,GAAG;YACV,YAAY,EAAE,IAAI;YAClB,WAAW,EAAE,iFAAiF;YAC9F,IAAI,EAAE,QAAQ;SACf,CAAC;aACD,MAAM,CAAC,QAAQ,EAAE;YAChB,YAAY,EAAE,IAAI;YAClB,WAAW,EAAE,6EAA6E;YAC1F,IAAI,EAAE,QAAQ;SACf,CAAC;aACD,MAAM,CAAC,MAAM,EAAE;YACd,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,CAAC,GAAG,aAAa,CAAC,qBAAqB,EAAE,SAAS,CAAC;YAC5D,YAAY,EAAE,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AClB,CAAC,CAAC;YAEH,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC,CAAC;QAC3D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,4BAA4B,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;YACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CACF,CAAC"}
|
package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/index.d.ts
CHANGED
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
import Generator, { type BaseOptions } from 'yeoman-generator';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
2
5
|
export default class extends Generator {
|
|
3
6
|
private readonly anchorFamily;
|
|
4
7
|
private readonly anchorName;
|
|
5
|
-
private readonly
|
|
8
|
+
private readonly isModelAnchor;
|
|
6
9
|
private readonly modelType;
|
|
7
10
|
private readonly packageName;
|
|
8
|
-
private readonly
|
|
11
|
+
private readonly projectRootDir;
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
9
15
|
constructor(args: string[], opts: BaseOptions);
|
|
16
|
+
/**
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
end(): void;
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
10
23
|
initializing(): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
11
27
|
writing(): Promise<void>;
|
|
12
|
-
end(): void;
|
|
13
28
|
}
|
|
@@ -1,22 +1,44 @@
|
|
|
1
1
|
import { readdir } from 'fs/promises';
|
|
2
2
|
import { join, resolve } from 'path';
|
|
3
3
|
import Generator, {} from 'yeoman-generator';
|
|
4
|
+
import { ProjectIndexUtility } from '../../../../../utilities/project-index/project-index.utility.js';
|
|
4
5
|
import { StringUtility } from '../../../../../utilities/string/string.utility.js';
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
5
9
|
export default class extends Generator {
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
6
13
|
constructor(args, opts) {
|
|
7
14
|
super(args, opts);
|
|
8
15
|
this.anchorName = args[0];
|
|
9
16
|
this.anchorFamily = args[1];
|
|
10
17
|
this.modelType = args[2];
|
|
11
18
|
this.packageName = args[3];
|
|
12
|
-
this.
|
|
19
|
+
this.projectRootDir = args[4];
|
|
13
20
|
// Determine if this is a model anchor or overlay anchor.
|
|
14
21
|
this.isModelAnchor = StringUtility.AVAILABLE_MODEL_TYPES.includes(this.modelType);
|
|
15
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
end() {
|
|
27
|
+
const targetPath = resolve(join(this.projectRootDir, 'src', 'anchors', this.anchorFamily));
|
|
28
|
+
this.log('✅ Your anchor has been generated successfully!');
|
|
29
|
+
this.log(`📁 Anchor created at: ${targetPath}`);
|
|
30
|
+
ProjectIndexUtility.addImport(this.projectRootDir, `./anchors/${this.anchorFamily}/${this.anchorName}.anchor.js`);
|
|
31
|
+
this.log('📦 Next steps:');
|
|
32
|
+
this.log(` Address all "Fix me" in generated files`);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
16
37
|
async initializing() {
|
|
17
|
-
const targetPath = resolve(join(this.
|
|
18
|
-
// Check if anchors already exists.
|
|
19
|
-
|
|
38
|
+
const targetPath = resolve(join(this.projectRootDir, 'src', 'anchors', this.anchorFamily));
|
|
39
|
+
// Check if anchors already exists. A missing directory is the normal case - it is every first
|
|
40
|
+
// anchor in a family - so it reads as "nothing to collide with", not as an error.
|
|
41
|
+
let targetPathContents = [];
|
|
20
42
|
try {
|
|
21
43
|
targetPathContents = await readdir(targetPath, { withFileTypes: true });
|
|
22
44
|
}
|
|
@@ -34,6 +56,9 @@ export default class extends Generator {
|
|
|
34
56
|
// Set the destination root to the anchor directory.
|
|
35
57
|
this.destinationRoot(targetPath);
|
|
36
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
37
62
|
async writing() {
|
|
38
63
|
// Create the anchor file.
|
|
39
64
|
this.fs.copyTpl(this.templatePath('anchors/anchor/anchor.ts.ejs'), this.destinationPath(`${this.anchorName}.anchor.ts`), {
|
|
@@ -48,12 +73,5 @@ export default class extends Generator {
|
|
|
48
73
|
modelTypePascal: StringUtility.toPascalCase(this.modelType),
|
|
49
74
|
});
|
|
50
75
|
}
|
|
51
|
-
end() {
|
|
52
|
-
const targetPath = resolve(join(this.cdkRootDir, 'src', 'anchors', this.anchorFamily));
|
|
53
|
-
this.log('✅ Your anchor has been generated successfully!');
|
|
54
|
-
this.log(`📁 Anchor created at: ${targetPath}`);
|
|
55
|
-
this.log('📦 Next steps:');
|
|
56
|
-
this.log(` Address all "Fix me" in generated files`);
|
|
57
|
-
}
|
|
58
76
|
}
|
|
59
77
|
//# sourceMappingURL=index.js.map
|
package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/commands/create-anchor/generator-octo-anchor-template/generators/app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,SAAS,EAAE,EAAoB,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,mDAAmD,CAAC;AAElF,MAAM,CAAC,OAAO,MAAO,SAAQ,SAAS;IASpC,YAAY,IAAc,EAAE,IAAiB;QAC3C,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAElB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/commands/create-anchor/generator-octo-anchor-template/generators/app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,SAAS,EAAE,EAAoB,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iEAAiE,CAAC;AACtG,OAAO,EAAE,aAAa,EAAE,MAAM,mDAAmD,CAAC;AAElF;;GAEG;AACH,MAAM,CAAC,OAAO,MAAO,SAAQ,SAAS;IASpC;;OAEG;IACH,YAAY,IAAc,EAAE,IAAiB;QAC3C,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAElB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAE9B,yDAAyD;QACzD,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAgB,CAAC,CAAC;IAC3F,CAAC;IAED;;OAEG;IACH,GA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AAK,CAAC,WAAW,IAAI,CAAC,UAAU,mBAAmB,CAAC,CAAC;YACjE,CAAC;QACH,CAAC;QAED,oDAAoD;QACpD,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO;QACX,0BAA0B;QAC1B,IAAI,CAAC,EAAE,CAAC,OAAO,CACb,IAAI,CAAC,YAAY,CAAC,8BAA8B,CAAC,EACjD,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,UAAU,YAAY,CAAC,EACpD;YACE,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,gBAAgB,EAAE,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC;YAC7D,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CACF,CAAC;QAEF,sBAAsB;QACtB,IAAI,CAAC,EAAE,CAAC,OAAO,CACb,IAAI,CAAC,YAAY,CAAC,qCAAqC,CAAC,EACxD,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,UAAU,mBAAmB,CAAC,EAC3D;YACE,gBAAgB,EAAE,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC;YAC7D,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,eAAe,EAAE,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC;SAC5D,CACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
<% if (isModelAnchor) { -%>
|
|
2
|
-
|
|
2
|
+
<%# Sorted here rather than written in a fixed order: the model type is the only variable member,
|
|
3
|
+
and where it falls among the others depends on its name - `Region` sorts before `Schema`,
|
|
4
|
+
`Service` after it. A fixed order fails the generated app's own import/order and sort-imports
|
|
5
|
+
rules for half the model types. -%>
|
|
6
|
+
<% const anchorSchemaImports = ['BaseAnchorSchema', 'Schema', 'Validate', modelTypePascal]
|
|
7
|
+
.sort()
|
|
8
|
+
.map((member) => (member === modelTypePascal ? `type ${member}` : member))
|
|
9
|
+
.join(', '); -%>
|
|
10
|
+
import { <%= anchorSchemaImports %> } from '@quadnix/octo';
|
|
3
11
|
<% } else { -%>
|
|
4
12
|
import { type AOverlay, BaseAnchorSchema, type BaseOverlaySchema, Schema, Validate } from '@quadnix/octo';
|
|
5
13
|
<% } -%>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dirname, resolve } from 'path';
|
|
1
|
+
import { dirname, join, resolve } from 'path';
|
|
2
2
|
import { fileURLToPath } from 'url';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import { createEnv } from 'yeoman-environment';
|
|
@@ -8,7 +8,7 @@ export const createAppCommand = {
|
|
|
8
8
|
return yargs
|
|
9
9
|
.option('template', {
|
|
10
10
|
alias: 't',
|
|
11
|
-
choices: ['aws-ecs-server', 'aws-s3-website'],
|
|
11
|
+
choices: ['aws-dynamodb-service', 'aws-ecs-server', 'aws-s3-website'],
|
|
12
12
|
demandOption: true,
|
|
13
13
|
description: 'Template to use for creation.',
|
|
14
14
|
type: 'string',
|
|
@@ -31,7 +31,11 @@ export const createAppCommand = {
|
|
|
31
31
|
handler: async (argv) => {
|
|
32
32
|
const { name, path, template } = argv;
|
|
33
33
|
console.log(chalk.blue(`Creating app with template "${template}"...`));
|
|
34
|
-
|
|
34
|
+
// The environment's cwd is both what yeoman watches for a package.json change and where it runs
|
|
35
|
+
// the package manager install. It defaults to `process.cwd()` - the directory the user invoked
|
|
36
|
+
// from - so with the app written to a subdirectory the watch never fired, and the install was
|
|
37
|
+
// skipped with "No change to package.json was detected". It also anchors the paths yeoman logs.
|
|
38
|
+
const env = createEnv({ cwd: resolve(join(path, name)) });
|
|
35
39
|
env.register(resolve(__dirname, 'generator-octo-app-template/generators/app/index.js'), {
|
|
36
40
|
namespace: 'generator-octo-app-template:app',
|
|
37
41
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-app.command.js","sourceRoot":"","sources":["../../../src/commands/create-app/create-app.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"create-app.command.js","sourceRoot":"","sources":["../../../src/commands/create-app/create-app.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,OAAO,EAAE,CAAC,KAAW,EAAQ,EAAE;QAC7B,OAAO,KAAK;aACT,MAAM,CAAC,UAAU,EAAE;YAClB,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,CAAC,sBAAsB,EAAE,gBAAgB,EAAE,gBAAgB,CAAC;YACrE,YAAY,EAAE,IAAI;YAClB,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,QAAQ;SACf,CAAC;aACD,MAAM,CAAC,MAAM,EAAE;YACd,KAAK,EAAE,GAAG;YACV,YAAY,EAAE,IAAI;YAClB,WAAW,EAAE,gFAAgF;YAC7F,IAAI,EAAE,QAAQ;SACf,CAAC;aACD,MAAM,CAAC,MAAM,EAAE;YACd,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,GAAG;YACZ,WAAW,EAAE,yBAAyB;YACtC,IAAI,EAAE,QAAQ;SACf,CAAC,CAAC;IACP,CAAC;IACD,OAAO,EAAE,YAAY;IACrB,QAAQ,EAAE,wCAAwC;IAClD,OAAO,EAAE,KAAK,EAAE,IAA0E,EAAiB,EAAE;QAC3G,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAEtC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,+BAA+B,QAAQ,MAAM,CAAC,CAAC,CAAC;QAEvE,gGAAgG;QAChG,+FAA+F;QAC/F,8FAA8F;QAC9F,gGAAgG;QAChG,MAAM,GAAG,GAAG,SAAS,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;QAC1D,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,EAAE,qDAAqD,CAAC,EAAE;YACtF,SAAS,EAAE,iCAAiC;SAC7C,CAAC,CAAC;QAEH,IAAI,CAAC;YACH,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,iCAAiC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE;gBACvE,SAAS,EAAE,IAAI;gBACf,WAAW,EAAE,KAAK;aACnB,CAAC,CAAC;YAEH,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACxD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,yBAAyB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;YACnE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
import Generator, { type BaseOptions } from 'yeoman-generator';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
2
5
|
export default class extends Generator {
|
|
3
6
|
private readonly appName;
|
|
4
7
|
private readonly appPath;
|
|
5
8
|
private readonly appTemplate;
|
|
9
|
+
private installCommand;
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
6
13
|
constructor(args: string[], opts: BaseOptions);
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
end(): void;
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
7
21
|
initializing(): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
8
25
|
writing(): Promise<void>;
|
|
9
|
-
end(): void;
|
|
10
26
|
}
|
|
@@ -1,13 +1,64 @@
|
|
|
1
1
|
import { readdir, stat } from 'fs/promises';
|
|
2
2
|
import { join, resolve } from 'path';
|
|
3
3
|
import Generator, {} from 'yeoman-generator';
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
4
7
|
export default class extends Generator {
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
5
11
|
constructor(args, opts) {
|
|
6
|
-
super(args, opts
|
|
12
|
+
super(args, opts, {
|
|
13
|
+
// The install runs after every file is written, so a failure here is a fully generated app
|
|
14
|
+
// whose dependencies did not install - not a failed generation. Left to yeoman the rejection
|
|
15
|
+
// would surface as "Failed to create app!", which is wrong, and the half-finished directory
|
|
16
|
+
// then blocks a retry. Report it and let the run finish; `end()` tells the user what to run.
|
|
17
|
+
customInstallTask: async (packageManagerName, defaultInstall) => {
|
|
18
|
+
// Undefined when yeoman cannot detect a package manager, which it then resolves to npm
|
|
19
|
+
// inside `defaultInstall` - too late for the name to reach this callback.
|
|
20
|
+
this.installCommand = `${packageManagerName ?? 'npm'} install`;
|
|
21
|
+
try {
|
|
22
|
+
await defaultInstall();
|
|
23
|
+
this.installCommand = undefined;
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
this.log(`⚠️ Could not install dependencies: ${error.message}`);
|
|
27
|
+
this.log(` The app is complete - run "${this.installCommand}" in it once the cause is fixed.`);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
});
|
|
7
31
|
this.appName = args[0];
|
|
8
32
|
this.appPath = args[1];
|
|
9
33
|
this.appTemplate = args[2];
|
|
10
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
end() {
|
|
39
|
+
const targetPath = resolve(join(this.appPath, this.appName));
|
|
40
|
+
this.log('✅ Your TypeScript app has been generated successfully!');
|
|
41
|
+
this.log(`📁 App created at: ${targetPath}`);
|
|
42
|
+
this.log('📦 Next steps:');
|
|
43
|
+
this.log(` cd ${targetPath}`);
|
|
44
|
+
// Only when the install did not happen - it runs as part of this command otherwise.
|
|
45
|
+
if (this.installCommand) {
|
|
46
|
+
this.log(` ${this.installCommand}`);
|
|
47
|
+
}
|
|
48
|
+
this.log(' Set the "env" values in octo.yaml.');
|
|
49
|
+
this.log(' npm run build');
|
|
50
|
+
// Scripts rather than bare commands: each one sets OCTO_DEFINITION_FILE_PATH and names the
|
|
51
|
+
// output directory, so the four steps cannot drift apart, and `npm run` puts node_modules/.bin
|
|
52
|
+
// on PATH - which is what the `octo run-action` callback terraform makes mid-apply needs.
|
|
53
|
+
this.log(' npm run octo:generate');
|
|
54
|
+
this.log(' npm run octo:validate # optional');
|
|
55
|
+
this.log(' npm run octo:apply');
|
|
56
|
+
this.log(' npm run octo:commit');
|
|
57
|
+
this.log(' See README.md for the full flow.');
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
11
62
|
async initializing() {
|
|
12
63
|
const targetPath = resolve(join(this.appPath, this.appName));
|
|
13
64
|
// Check if directory already exists and is not empty.
|
|
@@ -29,6 +80,9 @@ export default class extends Generator {
|
|
|
29
80
|
// Set the destination root to the app directory.
|
|
30
81
|
this.destinationRoot(targetPath);
|
|
31
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* @internal
|
|
85
|
+
*/
|
|
32
86
|
async writing() {
|
|
33
87
|
// Create eslint.config.js (ESLint v9 flat config)
|
|
34
88
|
this.fs.copyTpl(this.templatePath('eslint.config.js.ejs'), this.destinationPath('eslint.config.js'));
|
|
@@ -81,15 +135,13 @@ export default class extends Generator {
|
|
|
81
135
|
this.fs.copyTpl(this.templatePath('tsconfig.build.json.ejs'), this.destinationPath('tsconfig.build.json'));
|
|
82
136
|
// Create .octo directory
|
|
83
137
|
this.fs.copyTpl(this.templatePath(`gitkeep.ejs`), this.destinationPath('.octo/.gitkeep'));
|
|
138
|
+
// Create src/index.ts. Without at least one TypeScript file, `npm run build` - the step the
|
|
139
|
+
// README and the next-steps banner both send users to - fails with "No inputs were found".
|
|
140
|
+
this.fs.copyTpl(this.templatePath('index.ts.ejs'), this.destinationPath('src/index.ts'));
|
|
84
141
|
// Create src directory and main files
|
|
85
|
-
if (this.appTemplate === 'aws-ecs-server') {
|
|
142
|
+
if (this.appTemplate === 'aws-dynamodb-service' || this.appTemplate === 'aws-ecs-server') {
|
|
86
143
|
const templatePath = `src/${this.appTemplate}`;
|
|
87
|
-
this.fs.copyTpl(this.templatePath(`${templatePath}/
|
|
88
|
-
this.fs.copyTpl(this.templatePath(`${templatePath}/env.ejs`), this.destinationPath('.env'));
|
|
89
|
-
this.fs.copyTpl(this.templatePath(`${templatePath}/main.ts.ejs`), this.destinationPath('src/main.ts'), {
|
|
90
|
-
name: this.appName,
|
|
91
|
-
});
|
|
92
|
-
this.fs.copyTpl(this.templatePath(`${templatePath}/module-definitions.ts.ejs`), this.destinationPath('src/module-definitions.ts'));
|
|
144
|
+
this.fs.copyTpl(this.templatePath(`${templatePath}/octo.yaml.ejs`), this.destinationPath('octo.yaml'));
|
|
93
145
|
}
|
|
94
146
|
else if (this.appTemplate === 'aws-s3-website') {
|
|
95
147
|
const templatePath = `src/${this.appTemplate}`;
|
|
@@ -105,15 +157,5 @@ export default class extends Generator {
|
|
|
105
157
|
throw new Error(`Unsupported app template: ${this.appTemplate}`);
|
|
106
158
|
}
|
|
107
159
|
}
|
|
108
|
-
end() {
|
|
109
|
-
const targetPath = resolve(join(this.appPath, this.appName));
|
|
110
|
-
this.log('✅ Your TypeScript app has been generated successfully!');
|
|
111
|
-
this.log(`📁 App created at: ${targetPath}`);
|
|
112
|
-
this.log('📦 Next steps:');
|
|
113
|
-
this.log(` cd ${targetPath}`);
|
|
114
|
-
this.log(' npm install');
|
|
115
|
-
this.log(' npm run build');
|
|
116
|
-
this.log(' npm start');
|
|
117
|
-
}
|
|
118
160
|
}
|
|
119
161
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/commands/create-app/generator-octo-app-template/generators/app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,SAAS,EAAE,EAAoB,MAAM,kBAAkB,CAAC;AAE/D,MAAM,CAAC,OAAO,MAAO,SAAQ,SAAS;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/commands/create-app/generator-octo-app-template/generators/app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,SAAS,EAAE,EAAoB,MAAM,kBAAkB,CAAC;AAE/D;;GAEG;AACH,MAAM,CAAC,OAAO,MAAO,SAAQ,SAAS;IAOpC;;OAEG;IACH,YAAY,IAAc,EAAE,IAAiB;QAC3C,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE;YAChB,2FAA2F;YAC3F,6FAA6F;YAC7F,4FAA4F;YAC5F,6FAA6F;YAC7F,iBAAiB,EAAE,KAAK,EAAE,kBAAsC,EAAE,cAAsC,EAAE,EAAE;gBAC1G,uFAAuF;gBACvF,0EAA0E;gBAC1E,IAAI,CAAC,cAAc,GAAG,G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,EAAE,CAAC;YACjD,MAAM,YAAY,GAAG,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;YAC/C,IAAI,CAAC,EAAE,CAAC,OAAO,CACb,IAAI,CAAC,YAAY,CAAC,GAAG,YAAY,yBAAyB,CAAC,EAC3D,IAAI,CAAC,eAAe,CAAC,oBAAoB,CAAC,EAC1C;gBACE,IAAI,EAAE,IAAI,CAAC,OAAO;aACnB,CACF,CAAC;YACF,IAAI,CAAC,EAAE,CAAC,OAAO,CACb,IAAI,CAAC,YAAY,CAAC,GAAG,YAAY,yBAAyB,CAAC,EAC3D,IAAI,CAAC,eAAe,CAAC,oBAAoB,CAAC,EAC1C;gBACE,IAAI,EAAE,IAAI,CAAC,OAAO;aACnB,CACF,CAAC;YACF,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,YAAY,gBAAgB,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC;QACzG,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;CACF"}
|
package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/README.md.ejs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<%= description %>
|
|
3
3
|
|
|
4
4
|
## Octo Documentation
|
|
5
|
-
[Official Docs](
|
|
5
|
+
[Official Docs](https://octo.quadnix.com/)
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
```bash
|
|
@@ -18,18 +18,50 @@ The `octo.yaml` is your Octo definition file.
|
|
|
18
18
|
It contains all the modules you want to run,
|
|
19
19
|
which will create your infrastructure resources as per the module's instructions.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Octo generates Terragrunt module folders from your definition; Terraform/Tofu (via Terragrunt) is the
|
|
22
|
+
executor. The flow has three steps — generate, apply, then commit the results back into Octo. An
|
|
23
|
+
optional validate step compares the Terraform plan against Octo's own diff.
|
|
24
|
+
|
|
25
|
+
Each step is a script, so there is nothing to set up first:
|
|
26
|
+
|
|
22
27
|
```bash
|
|
23
|
-
#
|
|
24
|
-
|
|
28
|
+
# 1. Generate the Terragrunt module folders into ./.octo-tf (folders are overwritten in place; state and unrelated folders survive).
|
|
29
|
+
npm run octo:generate
|
|
30
|
+
|
|
31
|
+
# 2. (optional) Plan every module folder and validate the plans against Octo's resource diff.
|
|
32
|
+
# `validate` runs the plan itself; there is nothing to run beforehand.
|
|
33
|
+
npm run octo:validate
|
|
25
34
|
|
|
26
|
-
#
|
|
27
|
-
|
|
35
|
+
# 3. Take the app lock. Apply and commit both require it, so that only one run writes state at a time.
|
|
36
|
+
LOCK_ID=$(npm run --silent octo:lock)
|
|
28
37
|
|
|
29
|
-
#
|
|
30
|
-
|
|
38
|
+
# 4. Apply, then record the applied outputs into Octo. The commit releases the lock.
|
|
39
|
+
npm run octo:apply -- --lockId $LOCK_ID
|
|
40
|
+
npm run octo:commit -- --lockId $LOCK_ID
|
|
31
41
|
```
|
|
32
42
|
|
|
43
|
+
Generate and validate need no lock — neither writes shared state. Apply and commit do, and refuse to
|
|
44
|
+
run without one. The commit releases it however it ends, so a normal run leaves nothing behind. If a
|
|
45
|
+
run dies between the lock and the commit, `npm run octo:unlock -- --force` releases it.
|
|
46
|
+
|
|
47
|
+
If the apply fails partway, `npm run octo:commit -- --lockId $LOCK_ID --partial` records what did
|
|
48
|
+
apply instead of rejecting the whole commit, leaving the resources it could not confirm out of Octo's
|
|
49
|
+
state so the next run creates them again.
|
|
50
|
+
|
|
51
|
+
`octo apply` plans first and refuses to proceed if the apply would destroy anything, printing what
|
|
52
|
+
would be destroyed. Run `npm run octo:validate` to see why each one is being destroyed, then re-run
|
|
53
|
+
the apply with `--auto-approve` to go ahead — `npm run octo:apply -- --auto-approve`. That flag is
|
|
54
|
+
required for every destroy, including the teardown flow below.
|
|
55
|
+
|
|
56
|
+
Each script sets `OCTO_DEFINITION_FILE_PATH=octo.yaml` and points at `.octo-tf` for you. Edit the
|
|
57
|
+
scripts in `package.json` if your definition file or output directory is named differently. Running
|
|
58
|
+
the commands by hand works too — `node_modules/.bin/octo generate -o .octo-tf` with that variable
|
|
59
|
+
set — but the scripts are what keep the steps agreeing with each other.
|
|
60
|
+
|
|
61
|
+
> `octo run-action` is invoked automatically by Terraform mid-apply for resources whose lifecycle runs
|
|
62
|
+
> outside Terraform; you do not call it directly. `octo apply` hands it the definition file and the
|
|
63
|
+
> `octo` binary it needs, so it works the same whether you use the scripts or not.
|
|
64
|
+
|
|
33
65
|
## Development
|
|
34
66
|
The rest of the setup is a TypeScript project for you to get started with developing new modules in Octo quickly.
|
|
35
67
|
You can follow the official documentation to learn more.
|
|
@@ -42,7 +74,12 @@ npm run build
|
|
|
42
74
|
|
|
43
75
|
## Destroy
|
|
44
76
|
Once you have your infrastructure created, and you wish all of them destroyed,
|
|
45
|
-
its as simple as commenting out the necessary modules and re-running the
|
|
77
|
+
its as simple as commenting out the necessary modules and re-running the generate → apply → commit flow.
|
|
78
|
+
Octo rewrites a removed module's folder as an **empty** module — no resources, but the Terraform
|
|
79
|
+
configuration and providers intact — so Terragrunt still discovers it and destroys its resources on
|
|
80
|
+
the next apply. (The folder is never deleted: an emptied folder is what makes the destroy happen.)
|
|
81
|
+
After the destroy is committed, the leftover empty folder is benign — Octo warns about it and you can
|
|
82
|
+
delete it by hand.
|
|
46
83
|
|
|
47
84
|
### Step 1
|
|
48
85
|
In `octo.yaml`, comment out all modules except the `app` and `account` modules.
|
|
@@ -74,4 +111,17 @@ modules:
|
|
|
74
111
|
```
|
|
75
112
|
|
|
76
113
|
### Step 2
|
|
77
|
-
Then,
|
|
114
|
+
Then, re-build (if necessary) and re-run the generate → apply → commit flow from "Running the Definition file",
|
|
115
|
+
passing `--auto-approve` to the apply step - a teardown destroys resources, and `octo apply` refuses to
|
|
116
|
+
destroy anything without it.
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
npm run octo:generate
|
|
120
|
+
LOCK_ID=$(npm run --silent octo:lock)
|
|
121
|
+
npm run octo:apply -- --lockId $LOCK_ID --auto-approve
|
|
122
|
+
npm run octo:commit -- --lockId $LOCK_ID
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
The commit is not optional here. A resource whose lifecycle runs outside Terraform is deleted by its
|
|
126
|
+
own delete action, and `octo commit` is what runs it — Terraform cannot, because the resource's
|
|
127
|
+
configuration is gone by the time it would.
|
package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/gitignore.ejs
CHANGED
|
@@ -10,6 +10,19 @@ dist/
|
|
|
10
10
|
build/
|
|
11
11
|
*.tsbuildinfo
|
|
12
12
|
|
|
13
|
+
# Octo generated Terraform / Terragrunt artifacts.
|
|
14
|
+
# `.octo/` and `.octo-tf/` are NOT ignored - model state, resource state, terraform state, and the
|
|
15
|
+
# generated Terraform belong in the repo, so a change to them shows up in review. What apply leaves
|
|
16
|
+
# behind does not. The `terraform.tfstate` in a module folder is one of those leftovers: octo checks
|
|
17
|
+
# it out of `.octo/` before every terraform command and back in after, so the copy under `.octo/` is
|
|
18
|
+
# the one that is kept.
|
|
19
|
+
.terragrunt-cache/
|
|
20
|
+
*.tfstate*
|
|
21
|
+
!.octo/*.tfstate
|
|
22
|
+
!.octo/*.tfstate.enc
|
|
23
|
+
.octo/local-state.lock
|
|
24
|
+
.octo/reports/
|
|
25
|
+
|
|
13
26
|
# Environment variables
|
|
14
27
|
.env
|
|
15
28
|
.env.local
|
package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/index.ts.ejs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom Octo constructs for this app.
|
|
3
|
+
*
|
|
4
|
+
* The `create-*` commands maintain this file. Modules are exported because the definition file
|
|
5
|
+
* names them; everything else is imported for the registration side effect its decorator performs,
|
|
6
|
+
* which is what makes a construct known to Octo at boot.
|
|
7
|
+
*
|
|
8
|
+
* To use a module, `npm run build` and reference the built file from `octo.yaml`:
|
|
9
|
+
*
|
|
10
|
+
* ```yaml
|
|
11
|
+
* imports:
|
|
12
|
+
* - className: MyModule
|
|
13
|
+
* importPath: "./dist/index.js"
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* An app that only composes the modules shipped by `@quadnix/octo-aws-cdk` needs nothing here.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
export {};
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"moduleNameMapper": {
|
|
19
19
|
"(.+)\\.js": "$1"
|
|
20
20
|
},
|
|
21
|
+
"passWithNoTests": true,
|
|
21
22
|
"preset": "ts-jest/presets/default-esm",
|
|
22
23
|
"rootDir": ".",
|
|
23
24
|
"testEnvironment": "node",
|
|
@@ -32,9 +33,10 @@
|
|
|
32
33
|
}
|
|
33
34
|
},
|
|
34
35
|
"keywords": [
|
|
35
|
-
"cdk",
|
|
36
36
|
"infrastructure",
|
|
37
37
|
"octo",
|
|
38
|
+
"terraform",
|
|
39
|
+
"terragrunt",
|
|
38
40
|
"typescript"
|
|
39
41
|
],
|
|
40
42
|
"name": "<%= name %>",
|
|
@@ -43,6 +45,12 @@
|
|
|
43
45
|
"build": "rimraf dist && tsc -p tsconfig.build.json",
|
|
44
46
|
"format": "prettier --write \"src/**/*.ts\"",
|
|
45
47
|
"lint": "eslint .",
|
|
48
|
+
"octo:apply": "OCTO_DEFINITION_FILE_PATH=octo.yaml octo apply --terragruntDir .octo-tf",
|
|
49
|
+
"octo:commit": "OCTO_DEFINITION_FILE_PATH=octo.yaml octo commit --terragruntDir .octo-tf",
|
|
50
|
+
"octo:generate": "OCTO_DEFINITION_FILE_PATH=octo.yaml octo generate -o .octo-tf",
|
|
51
|
+
"octo:lock": "OCTO_DEFINITION_FILE_PATH=octo.yaml octo lock",
|
|
52
|
+
"octo:unlock": "OCTO_DEFINITION_FILE_PATH=octo.yaml octo unlock",
|
|
53
|
+
"octo:validate": "OCTO_DEFINITION_FILE_PATH=octo.yaml octo validate --terragruntDir .octo-tf",
|
|
46
54
|
"test": "NODE_OPTIONS=--experimental-vm-modules jest --testRegex=\"\\.spec.ts$\"",
|
|
47
55
|
"test:e2e": "NODE_OPTIONS=--experimental-vm-modules jest --testRegex=\"\\.e2e-spec.ts$\""
|
|
48
56
|
},
|