@quadnix/octo-build 0.0.7 → 0.0.9

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 (135) hide show
  1. package/dist/commands/create-anchor/create-anchor.command.d.ts +13 -0
  2. package/dist/commands/create-anchor/create-anchor.command.js +67 -0
  3. package/dist/commands/create-anchor/create-anchor.command.js.map +1 -0
  4. package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/index.d.ts +13 -0
  5. package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/index.js +59 -0
  6. package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/index.js.map +1 -0
  7. package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/templates/anchors/anchor/anchor.schema.ts.ejs +23 -0
  8. package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/templates/anchors/anchor/anchor.ts.ejs +15 -0
  9. package/dist/commands/create-anchor/index.d.ts +1 -0
  10. package/dist/commands/create-anchor/index.js +2 -0
  11. package/dist/commands/create-anchor/index.js.map +1 -0
  12. package/dist/commands/{create/create.command.d.ts → create-app/create-app.command.d.ts} +1 -1
  13. package/dist/commands/{create/create.command.js → create-app/create-app.command.js} +3 -3
  14. package/dist/commands/create-app/create-app.command.js.map +1 -0
  15. package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/index.d.ts +0 -1
  16. package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/index.js +18 -29
  17. package/dist/commands/create-app/generator-octo-app-template/generators/app/index.js.map +1 -0
  18. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/README.md.ejs +58 -0
  19. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/eslint.config.js.ejs +118 -0
  20. package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/package.json.ejs +1 -2
  21. package/dist/commands/{create/generator-octo-app-template/generators/app/templates/src/aws-s3-website → create-app/generator-octo-app-template/generators/app/templates/src/aws-ecs-server}/main.ts.ejs +3 -3
  22. package/dist/commands/{create/generator-octo-app-template/generators/app/templates/src/aws-ecs-server → create-app/generator-octo-app-template/generators/app/templates/src/aws-s3-website}/main.ts.ejs +3 -3
  23. package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/src/aws-s3-website/module-definitions.ts.ejs +1 -1
  24. package/dist/commands/create-app/index.d.ts +1 -0
  25. package/dist/commands/create-app/index.js +2 -0
  26. package/dist/commands/create-app/index.js.map +1 -0
  27. package/dist/commands/create-cdk/create-cdk.command.d.ts +11 -0
  28. package/dist/commands/create-cdk/create-cdk.command.js +70 -0
  29. package/dist/commands/create-cdk/create-cdk.command.js.map +1 -0
  30. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/index.d.ts +10 -0
  31. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/index.js +107 -0
  32. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/index.js.map +1 -0
  33. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/README.md.ejs +23 -0
  34. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/eslint.config.js.ejs +337 -0
  35. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/gitignore.ejs +82 -0
  36. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/package.json.ejs +57 -0
  37. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/prettierrc.ejs +5 -0
  38. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/anchors/app/app.anchor.schema.ts.ejs +19 -0
  39. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/anchors/app/app.anchor.ts.ejs +17 -0
  40. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/factories/dummy-credentials.factory.ts.ejs +28 -0
  41. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/dummy-app.module.spec.ts.ejs +90 -0
  42. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/dummy-app.module.ts.ejs +16 -0
  43. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/index.schema.ts.ejs +10 -0
  44. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/index.ts.ejs +3 -0
  45. 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 +59 -0
  46. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/models/app/index.ts.ejs +1 -0
  47. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/resources/http-fetch/actions/add-http-fetch.resource.action.ts.ejs +55 -0
  48. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/resources/http-fetch/http-fetch.resource.ts.ejs +12 -0
  49. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/resources/http-fetch/index.schema.ts.ejs +35 -0
  50. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/resources/http-fetch/index.ts.ejs +3 -0
  51. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/utilities/dummy/dummy.utility.ts.ejs +11 -0
  52. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/tsconfig.build.json.ejs +11 -0
  53. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/tsconfig.json.ejs +39 -0
  54. package/dist/commands/create-cdk/index.d.ts +1 -0
  55. package/dist/commands/create-cdk/index.js +2 -0
  56. package/dist/commands/create-cdk/index.js.map +1 -0
  57. package/dist/commands/create-model/create-model.command.d.ts +12 -0
  58. package/dist/commands/create-model/create-model.command.js +62 -0
  59. package/dist/commands/create-model/create-model.command.js.map +1 -0
  60. package/dist/commands/create-model/generator-octo-model-template/generators/app/index.d.ts +11 -0
  61. package/dist/commands/create-model/generator-octo-model-template/generators/app/index.js +68 -0
  62. package/dist/commands/create-model/generator-octo-model-template/generators/app/index.js.map +1 -0
  63. package/dist/commands/create-model/generator-octo-model-template/generators/app/templates/models/model/actions/add.model.action.ts.ejs +50 -0
  64. package/dist/commands/create-model/generator-octo-model-template/generators/app/templates/models/model/index.ts.ejs +3 -0
  65. package/dist/commands/create-model/generator-octo-model-template/generators/app/templates/models/model/model.ts.ejs +29 -0
  66. package/dist/commands/create-model/generator-octo-model-template/generators/app/templates/models/model/schema.ts.ejs +8 -0
  67. package/dist/commands/create-model/index.d.ts +1 -0
  68. package/dist/commands/create-model/index.js +2 -0
  69. package/dist/commands/create-model/index.js.map +1 -0
  70. package/dist/commands/create-module/create-module.command.d.ts +12 -0
  71. package/dist/commands/create-module/create-module.command.js +62 -0
  72. package/dist/commands/create-module/create-module.command.js.map +1 -0
  73. package/dist/commands/create-module/generator-octo-module-template/generators/app/index.d.ts +11 -0
  74. package/dist/commands/create-module/generator-octo-module-template/generators/app/index.js +60 -0
  75. package/dist/commands/create-module/generator-octo-module-template/generators/app/index.js.map +1 -0
  76. package/dist/commands/create-module/generator-octo-module-template/generators/app/templates/index.schema.ts.ejs +3 -0
  77. package/dist/commands/create-module/generator-octo-module-template/generators/app/templates/index.ts.ejs +1 -0
  78. package/dist/commands/create-module/generator-octo-module-template/generators/app/templates/module.ts.ejs +9 -0
  79. package/dist/commands/create-module/index.d.ts +1 -0
  80. package/dist/commands/create-module/index.js +2 -0
  81. package/dist/commands/create-module/index.js.map +1 -0
  82. package/dist/commands/create-overlay/create-overlay.command.d.ts +13 -0
  83. package/dist/commands/create-overlay/create-overlay.command.js +67 -0
  84. package/dist/commands/create-overlay/create-overlay.command.js.map +1 -0
  85. package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/index.d.ts +12 -0
  86. package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/index.js +72 -0
  87. package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/index.js.map +1 -0
  88. package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/templates/overlays/overlay/actions/add.overlay.action.ts.ejs +50 -0
  89. package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/templates/overlays/overlay/index.ts.ejs +3 -0
  90. package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/templates/overlays/overlay/overlay.schema.ts.ejs +13 -0
  91. package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/templates/overlays/overlay/overlay.ts.ejs +22 -0
  92. package/dist/commands/create-overlay/index.d.ts +1 -0
  93. package/dist/commands/create-overlay/index.js +2 -0
  94. package/dist/commands/create-overlay/index.js.map +1 -0
  95. package/dist/commands/create-resource/create-resource.command.d.ts +11 -0
  96. package/dist/commands/create-resource/create-resource.command.js +55 -0
  97. package/dist/commands/create-resource/create-resource.command.js.map +1 -0
  98. package/dist/commands/create-resource/generator-octo-resource-template/generators/app/index.d.ts +10 -0
  99. package/dist/commands/create-resource/generator-octo-resource-template/generators/app/index.js +71 -0
  100. package/dist/commands/create-resource/generator-octo-resource-template/generators/app/index.js.map +1 -0
  101. package/dist/commands/create-resource/generator-octo-resource-template/generators/app/templates/resources/resource/actions/add.resource.action.ts.ejs +65 -0
  102. package/dist/commands/create-resource/generator-octo-resource-template/generators/app/templates/resources/resource/actions/delete.resource.action.ts.ejs +58 -0
  103. package/dist/commands/create-resource/generator-octo-resource-template/generators/app/templates/resources/resource/actions/update-tags.resource.action.ts.ejs +95 -0
  104. package/dist/commands/create-resource/generator-octo-resource-template/generators/app/templates/resources/resource/index.schema.ts.ejs +31 -0
  105. package/dist/commands/create-resource/generator-octo-resource-template/generators/app/templates/resources/resource/index.ts.ejs +5 -0
  106. package/dist/commands/create-resource/generator-octo-resource-template/generators/app/templates/resources/resource/resource.ts.ejs +12 -0
  107. package/dist/commands/create-resource/index.d.ts +1 -0
  108. package/dist/commands/create-resource/index.js +2 -0
  109. package/dist/commands/create-resource/index.js.map +1 -0
  110. package/dist/index.js +14 -2
  111. package/dist/index.js.map +1 -1
  112. package/dist/utilities/string/string.utility.d.ts +5 -0
  113. package/dist/utilities/string/string.utility.js +26 -0
  114. package/dist/utilities/string/string.utility.js.map +1 -0
  115. package/package.json +2 -2
  116. package/dist/commands/create/create.command.js.map +0 -1
  117. package/dist/commands/create/generator-octo-app-template/generators/app/index.js.map +0 -1
  118. package/dist/commands/create/generator-octo-app-template/generators/app/templates/README.md.ejs +0 -20
  119. package/dist/commands/create/generator-octo-app-template/generators/app/templates/eslint.config.js.ejs +0 -130
  120. package/dist/commands/create/index.d.ts +0 -1
  121. package/dist/commands/create/index.js +0 -2
  122. package/dist/commands/create/index.js.map +0 -1
  123. /package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/gitignore.ejs +0 -0
  124. /package/dist/commands/{create/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/octo → create-app/generator-octo-app-template/generators/app/templates}/gitkeep.ejs +0 -0
  125. /package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/prettierrc.ejs +0 -0
  126. /package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/app.config.ts.ejs +0 -0
  127. /package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/env.ejs +0 -0
  128. /package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/module-definitions.ts.ejs +0 -0
  129. /package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/src/aws-s3-website/app.config.ts.ejs +0 -0
  130. /package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/src/aws-s3-website/env.ejs +0 -0
  131. /package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/src/aws-s3-website/website/error.html.ejs +0 -0
  132. /package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/src/aws-s3-website/website/index.html.ejs +0 -0
  133. /package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/tsconfig.build.json.ejs +0 -0
  134. /package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/tsconfig.json.ejs +0 -0
  135. /package/dist/commands/{create/generator-octo-app-template/generators/app/templates/src/aws-s3-website/octo → create-cdk/generator-octo-cdk-template/generators/app/templates}/gitkeep.ejs +0 -0
@@ -0,0 +1,11 @@
1
+ import { type ArgumentsCamelCase, type Argv } from 'yargs';
2
+ export declare const createCdkCommand: {
3
+ builder: (yargs: Argv) => Argv;
4
+ command: string;
5
+ describe: string;
6
+ handler: (argv: ArgumentsCamelCase<{
7
+ name: string;
8
+ path: string;
9
+ options?: string[];
10
+ }>) => Promise<void>;
11
+ };
@@ -0,0 +1,70 @@
1
+ import { dirname, resolve } from 'path';
2
+ import { fileURLToPath } from 'url';
3
+ import chalk from 'chalk';
4
+ import {} from 'yargs';
5
+ import { createEnv } from 'yeoman-environment';
6
+ const __dirname = dirname(fileURLToPath(import.meta.url));
7
+ export const createCdkCommand = {
8
+ builder: (yargs) => {
9
+ return yargs
10
+ .option('name', {
11
+ alias: 'n',
12
+ demandOption: true,
13
+ description: 'Name of the CDK to create. A new directory will be created with the same name.',
14
+ type: 'string',
15
+ })
16
+ .option('path', {
17
+ alias: 'p',
18
+ default: '.',
19
+ description: 'Path to create the CDK.',
20
+ type: 'string',
21
+ })
22
+ .option('options', {
23
+ alias: 'o',
24
+ description: `Options to create the CDK.
25
+
26
+ Allowed options:
27
+
28
+ withExamples [boolean] Whether to include examples in the CDK. Default: false
29
+ `,
30
+ type: 'array',
31
+ });
32
+ },
33
+ command: 'create-cdk',
34
+ describe: 'Create a new Octo CDK.',
35
+ handler: async (argv) => {
36
+ const { name, path, options } = argv;
37
+ // Parse options.
38
+ const parsedOptions = { withExamples: false };
39
+ if (options && options.length > 0) {
40
+ for (let i = 0; i < options.length;) {
41
+ const optionValues = options[i].split('=');
42
+ if (optionValues.length !== 2) {
43
+ parsedOptions[options[i]] = options[i + 1];
44
+ i += 2;
45
+ }
46
+ else {
47
+ parsedOptions[optionValues[0]] = optionValues[1];
48
+ i += 1;
49
+ }
50
+ }
51
+ }
52
+ console.log(chalk.blue(`Creating CDK...`));
53
+ const env = createEnv();
54
+ env.register(resolve(__dirname, 'generator-octo-cdk-template/generators/app/index.js'), {
55
+ namespace: 'generator-octo-cdk-template:app',
56
+ });
57
+ try {
58
+ await env.run(['generator-octo-cdk-template:app', name, path, String(parsedOptions.withExamples || false)], {
59
+ skipCache: true,
60
+ skipInstall: false,
61
+ });
62
+ console.log(chalk.green(`Successfully created CDK!`));
63
+ }
64
+ catch (error) {
65
+ console.error(chalk.red(`Failed to create CDK! ${error.message}`));
66
+ process.exit(1);
67
+ }
68
+ },
69
+ };
70
+ //# sourceMappingURL=create-cdk.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-cdk.command.js","sourceRoot":"","sources":["../../../src/commands/create-cdk/create-cdk.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;AAC1B,OAAO,EAAsC,MAAM,OAAO,CAAC;AAC3D,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,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;aACD,MAA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C;YACH,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,iCAAiC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,aAAa,CAAC,YAAY,IAAI,KAAK,CAAC,CAAC,EAAE;gBAC1G,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"}
@@ -0,0 +1,10 @@
1
+ import Generator, { type BaseOptions } from 'yeoman-generator';
2
+ export default class extends Generator {
3
+ private readonly cdkName;
4
+ private readonly cdkOptions;
5
+ private readonly cdkPath;
6
+ constructor(args: string[], opts: BaseOptions);
7
+ initializing(): Promise<void>;
8
+ writing(): Promise<void>;
9
+ end(): void;
10
+ }
@@ -0,0 +1,107 @@
1
+ import { readdir, stat } from 'fs/promises';
2
+ import { join, resolve } from 'path';
3
+ import Generator, {} from 'yeoman-generator';
4
+ export default class extends Generator {
5
+ constructor(args, opts) {
6
+ super(args, opts);
7
+ this.cdkName = args[0];
8
+ this.cdkPath = args[1];
9
+ this.cdkOptions = {
10
+ withExamples: args[2] === 'true',
11
+ };
12
+ }
13
+ async initializing() {
14
+ const targetPath = resolve(join(this.cdkPath, this.cdkName));
15
+ // Check if directory already exists and is not empty.
16
+ let targetPathStat;
17
+ try {
18
+ targetPathStat = await stat(targetPath);
19
+ }
20
+ catch (error) {
21
+ if (error.code !== 'ENOENT') {
22
+ throw error;
23
+ }
24
+ }
25
+ if (targetPathStat?.isDirectory()) {
26
+ const files = await readdir(targetPath);
27
+ if (files.length > 0) {
28
+ throw new Error(`Directory '${targetPath}' already exists and is not empty! Please choose a different name or path.`);
29
+ }
30
+ }
31
+ // Set the destination root to the cdk directory.
32
+ this.destinationRoot(targetPath);
33
+ }
34
+ async writing() {
35
+ // Create eslint.config.js (ESLint v9 flat config)
36
+ this.fs.copyTpl(this.templatePath('eslint.config.js.ejs'), this.destinationPath('eslint.config.js'));
37
+ // Create .gitignore
38
+ this.fs.copyTpl(this.templatePath('gitignore.ejs'), this.destinationPath('.gitignore'));
39
+ // Create package.json
40
+ this.fs.copyTpl(this.templatePath('package.json.ejs'), this.destinationPath('package.json'), {
41
+ description: `Infrastructure CDK using Octo for ${this.cdkName}`,
42
+ name: this.cdkName,
43
+ version: '0.0.1',
44
+ });
45
+ await this.addDependencies({
46
+ '@quadnix/octo': '0.0.x',
47
+ });
48
+ await this.addDevDependencies({
49
+ '@eslint/js': '^9.33.0',
50
+ '@types/jest': '^30.0.0',
51
+ '@types/node': '^24.3.0',
52
+ '@typescript-eslint/eslint-plugin': '^8.39.1',
53
+ '@typescript-eslint/parser': '^8.39.1',
54
+ dpdm: '^3.14.0',
55
+ eslint: '^9.33.0',
56
+ 'eslint-config-prettier': '^10.1.8',
57
+ 'eslint-import-resolver-typescript': '^4.4.4',
58
+ 'eslint-plugin-boundaries': '^5.0.1',
59
+ 'eslint-plugin-import': '^2.32.0',
60
+ 'eslint-plugin-jsonc': '^2.20.1',
61
+ 'eslint-plugin-prettier': '^5.5.4',
62
+ globals: '^16.3.0',
63
+ jest: '^30.0.5',
64
+ prettier: '^3.6.2',
65
+ rimraf: '^6.0.1',
66
+ 'source-map-support': '^0.5.21',
67
+ 'ts-jest': '^29.4.1',
68
+ 'ts-loader': '^9.5.2',
69
+ 'ts-node': '^10.9.2',
70
+ 'tsconfig-paths': '^4.2.0',
71
+ typescript: '^5.9.2',
72
+ });
73
+ // Create .prettierrc
74
+ this.fs.copyTpl(this.templatePath('prettierrc.ejs'), this.destinationPath('.prettierrc'));
75
+ // Create README.md
76
+ this.fs.copyTpl(this.templatePath('README.md.ejs'), this.destinationPath('README.md'), {
77
+ description: `Infrastructure CDK using Octo for ${this.cdkName}`,
78
+ name: this.cdkName,
79
+ });
80
+ // Create tsconfig.json and tsconfig.build.json
81
+ this.fs.copyTpl(this.templatePath('tsconfig.json.ejs'), this.destinationPath('tsconfig.json'));
82
+ this.fs.copyTpl(this.templatePath('tsconfig.build.json.ejs'), this.destinationPath('tsconfig.build.json'));
83
+ // Create src directory and main files
84
+ if (this.cdkOptions.withExamples) {
85
+ this.fs.copyTpl(this.templatePath(`src/**/*`), this.destinationPath('src'), {
86
+ name: this.cdkName,
87
+ });
88
+ }
89
+ else {
90
+ this.fs.copyTpl(this.templatePath(`gitkeep.ejs`), this.destinationPath('src/anchors/.gitkeep'));
91
+ this.fs.copyTpl(this.templatePath(`gitkeep.ejs`), this.destinationPath('src/factories/.gitkeep'));
92
+ this.fs.copyTpl(this.templatePath(`gitkeep.ejs`), this.destinationPath('src/modules/.gitkeep'));
93
+ this.fs.copyTpl(this.templatePath(`gitkeep.ejs`), this.destinationPath('src/resources/.gitkeep'));
94
+ this.fs.copyTpl(this.templatePath(`gitkeep.ejs`), this.destinationPath('src/utilities/.gitkeep'));
95
+ }
96
+ }
97
+ end() {
98
+ const targetPath = resolve(join(this.cdkPath, this.cdkName));
99
+ this.log('✅ Your TypeScript CDK has been generated successfully!');
100
+ this.log(`📁 CDK created at: ${targetPath}`);
101
+ this.log('📦 Next steps:');
102
+ this.log(` cd ${targetPath}`);
103
+ this.log(' npm install');
104
+ this.log(' npm run build');
105
+ }
106
+ }
107
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/commands/create-cdk/generator-octo-cdk-template/generators/app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,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,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,sBAAsB,CAAC,CAAC,CAAC;YAChG,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,wBAAwB,CAAC,CAAC,CAAC;YAClG,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,wBAAwB,CAAC,CAAC,CAAC;QACpG,CAAC;IACH,CAAC;IAED,GAAG;QACD,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAE7D,IAAI,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;QACnE,IAAI,CAAC,GAAG,CAAC,sBAAsB,UAAU,EAAE,CAAC,CAAC;QAC7C,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC3B,IAAI,CAAC,GAAG,CAAC,SAAS,UAAU,EAAE,CAAC,CAAC;QAChC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC3B,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAC/B,CAAC;CACF"}
@@ -0,0 +1,23 @@
1
+ # <%= name %>
2
+ <%= description %>
3
+
4
+ ## Octo Documentation
5
+ [Official Docs](http://octo.quadnix.com/)
6
+
7
+ ## Installation
8
+ ```bash
9
+ npm install
10
+ ```
11
+
12
+ ## Development
13
+ We have provided a few dummy implementation examples in the `src` directory to help you get started with Octo.
14
+ Feel free to replace them with your own implementation.
15
+
16
+ Once you are happy with your implementation and tests,
17
+ ```bash
18
+ # Build app. This will compile your TypeScript code.
19
+ npm run build
20
+
21
+ # Test app.
22
+ npm run test
23
+ ```
@@ -0,0 +1,337 @@
1
+ import { dirname } from 'path';
2
+ import { fileURLToPath } from 'url';
3
+
4
+ import js from '@eslint/js';
5
+ import tseslint from '@typescript-eslint/eslint-plugin';
6
+ import tsparser from '@typescript-eslint/parser';
7
+ import prettierConfig from 'eslint-config-prettier';
8
+ import boundaries from 'eslint-plugin-boundaries';
9
+ import importPlugin from 'eslint-plugin-import';
10
+ import jsonc from 'eslint-plugin-jsonc';
11
+ import prettier from 'eslint-plugin-prettier';
12
+ import globals from 'globals';
13
+
14
+ const __dirname = dirname(fileURLToPath(import.meta.url));
15
+
16
+ export default [
17
+ // Base JavaScript config
18
+ js.configs.recommended,
19
+
20
+ // All files.
21
+ {
22
+ files: ['**/*.{js,cjs,ts,tsx}'],
23
+ languageOptions: {
24
+ globals: {
25
+ ...globals.node,
26
+ ...globals.jest,
27
+ NodeJS: true,
28
+ },
29
+ },
30
+ plugins: {
31
+ import: importPlugin,
32
+ },
33
+ rules: {
34
+ 'import/no-duplicates': 'error',
35
+ 'import/no-unresolved': 'error',
36
+ 'import/order': [
37
+ 'error',
38
+ {
39
+ alphabetize: { caseInsensitive: false, order: 'asc', orderImportKind: 'asc' },
40
+ named: { enabled: true, types: 'mixed' },
41
+ },
42
+ ],
43
+ 'max-len': ['error', { code: 120, ignoreStrings: true }],
44
+ 'no-async-promise-executor': 'off',
45
+ 'no-duplicate-imports': ['error', { includeExports: true }],
46
+ 'no-unused-vars': 'off',
47
+ 'sort-imports': [
48
+ 'error',
49
+ {
50
+ allowSeparatedGroups: true,
51
+ ignoreCase: false,
52
+ ignoreDeclarationSort: true,
53
+ ignoreMemberSort: false,
54
+ memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
55
+ },
56
+ ],
57
+ 'sort-keys': ['error', 'asc', { caseSensitive: false, minKeys: 2, natural: false }],
58
+ },
59
+ settings: {
60
+ 'import/resolver': {
61
+ node: {
62
+ extensions: ['.js', '.jsx', '.ts', '.tsx'],
63
+ },
64
+ typescript: {
65
+ alwaysTryTypes: true,
66
+ project: './tsconfig.json',
67
+ },
68
+ },
69
+ },
70
+ },
71
+
72
+ // TypeScript files.
73
+ {
74
+ files: ['**/*.{ts,tsx}'],
75
+ languageOptions: {
76
+ parser: tsparser,
77
+ parserOptions: {
78
+ ecmaVersion: 2022,
79
+ project: './tsconfig.json',
80
+ sourceType: 'module',
81
+ tsconfigRootDir: __dirname,
82
+ },
83
+ },
84
+ plugins: {
85
+ '@typescript-eslint': tseslint,
86
+ boundaries: boundaries,
87
+ import: importPlugin,
88
+ prettier,
89
+ },
90
+ rules: {
91
+ '@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'inline-type-imports' }],
92
+ '@typescript-eslint/explicit-function-return-type': 'error',
93
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
94
+ '@typescript-eslint/interface-name-prefix': 'off',
95
+ '@typescript-eslint/no-explicit-any': 'off',
96
+ '@typescript-eslint/no-non-null-assertion': 'off',
97
+ '@typescript-eslint/no-this-alias': 'error',
98
+ '@typescript-eslint/no-unused-vars': 'off',
99
+ '@typescript-eslint/prefer-nullish-coalescing': 'off',
100
+ '@typescript-eslint/prefer-optional-chain': 'error',
101
+ 'boundaries/element-types': [
102
+ 'error',
103
+ {
104
+ default: 'disallow',
105
+ rules: [
106
+ // Anchor rules.
107
+ {
108
+ allow: [['anchor-schema', { family: '${from.family}' }], 'utilities'],
109
+ from: ['anchor-anchor'],
110
+ },
111
+ {
112
+ allow: [],
113
+ from: ['anchor-schema'],
114
+ },
115
+
116
+ // Module rules.
117
+ {
118
+ allow: [
119
+ ['module-models', { family: '${from.family}' }],
120
+ ['module-module', { family: '${from.family}' }],
121
+ 'anchor-anchor',
122
+ 'anchor-schema',
123
+ 'resource-index',
124
+ 'resource-schema-index',
125
+ 'utilities',
126
+ ],
127
+ from: ['module-model-actions'],
128
+ },
129
+ {
130
+ allow: [
131
+ ['module-model-actions', { family: '${from.family}' }],
132
+ ['module-models', { family: '${from.family}' }],
133
+ ],
134
+ from: ['module-model-indexes'],
135
+ },
136
+ {
137
+ allow: ['resource-schema-index'],
138
+ from: ['module-model-schemas'],
139
+ },
140
+ {
141
+ allow: [
142
+ ['module-model-schemas', { family: '${from.family}' }],
143
+ 'anchor-anchor',
144
+ 'anchor-schema',
145
+ 'utilities',
146
+ ],
147
+ from: ['module-models'],
148
+ },
149
+ {
150
+ allow: [
151
+ ['module-model-actions', { family: '${from.family}' }],
152
+ ['module-model-indexes', { family: '${from.family}' }],
153
+ ['module-schema-index', { family: '${from.family}' }],
154
+ 'anchor-anchor',
155
+ 'anchor-schema',
156
+ 'utilities',
157
+ ],
158
+ from: ['module-module'],
159
+ },
160
+ {
161
+ allow: [
162
+ ['module-index', { family: '${from.family}' }],
163
+ ['module-schema-index', { family: '${from.family}' }],
164
+ 'anchor-schema',
165
+ 'resource-schema-index',
166
+ 'module-schema-index',
167
+ 'utilities',
168
+ ],
169
+ from: ['module-spec'],
170
+ },
171
+ {
172
+ allow: [
173
+ ['module-model-indexes', { family: '${from.family}' }],
174
+ ['module-module', { family: '${from.family}' }],
175
+ ],
176
+ from: ['module-index'],
177
+ },
178
+ {
179
+ allow: [
180
+ ['module-model-indexes', { family: '${from.family}' }],
181
+ ['module-model-schemas', { family: '${from.family}' }],
182
+ 'anchor-schema',
183
+ 'resource-schema-index',
184
+ ],
185
+ from: ['module-schema-index'],
186
+ },
187
+
188
+ // Resource rules.
189
+ {
190
+ allow: [
191
+ ['resource-resource', { family: '${from.family}' }],
192
+ ['resource-schema-index', { family: '${from.family}' }],
193
+ 'resource-schema-index',
194
+ 'utilities',
195
+ ],
196
+ from: ['resource-actions'],
197
+ },
198
+ {
199
+ allow: [['resource-schema-index', { family: '${from.family}' }], 'resource-schema-index', 'utilities'],
200
+ from: ['resource-resource'],
201
+ },
202
+ {
203
+ allow: [
204
+ ['resource-actions', { family: '${from.family}' }],
205
+ ['resource-resource', { family: '${from.family}' }],
206
+ ],
207
+ from: ['resource-index'],
208
+ },
209
+ {
210
+ allow: [],
211
+ from: ['resource-schema-index'],
212
+ },
213
+
214
+ // Utility rules.
215
+ {
216
+ allow: ['resource-schema-index'],
217
+ from: ['utilities'],
218
+ },
219
+ ],
220
+ },
221
+ ],
222
+ 'boundaries/external': ['off'],
223
+ },
224
+ settings: {
225
+ 'boundaries/dependency-nodes': ['export', 'import'],
226
+ 'boundaries/elements': [
227
+ // Anchor patterns.
228
+ {
229
+ capture: ['family'],
230
+ mode: 'file',
231
+ pattern: 'src/anchors/*/*.anchor.ts',
232
+ type: `anchor-anchor`,
233
+ },
234
+ {
235
+ capture: ['family'],
236
+ mode: 'file',
237
+ pattern: 'src/anchors/*/*.anchor.schema.ts',
238
+ type: `anchor-schema`,
239
+ },
240
+
241
+ // Module patterns.
242
+ {
243
+ capture: ['familyCategory', 'family'],
244
+ mode: 'file',
245
+ pattern: ['src/modules/*/*/**/*.action.ts'],
246
+ type: 'module-model-actions',
247
+ },
248
+ {
249
+ capture: ['familyCategory', 'family'],
250
+ mode: 'file',
251
+ pattern: ['src/modules/*/*/models/*/index.ts', 'src/modules/*/*/overlays/*/index.ts'],
252
+ type: 'module-model-indexes',
253
+ },
254
+ {
255
+ capture: ['familyCategory', 'family'],
256
+ mode: 'file',
257
+ pattern: ['src/modules/*/*/models/*/*.schema.ts', 'src/modules/*/*/overlays/*/*.schema.ts'],
258
+ type: 'module-model-schemas',
259
+ },
260
+ {
261
+ capture: ['familyCategory', 'family'],
262
+ mode: 'file',
263
+ pattern: ['src/modules/*/*/models/*/*.model.ts', 'src/modules/*/*/overlays/*/*.overlay.ts'],
264
+ type: 'module-models',
265
+ },
266
+ {
267
+ capture: ['familyCategory', 'family'],
268
+ mode: 'file',
269
+ pattern: 'src/modules/*/*/*.module.ts',
270
+ type: 'module-module',
271
+ },
272
+ {
273
+ capture: ['familyCategory', 'family'],
274
+ mode: 'file',
275
+ pattern: 'src/modules/*/*/*.module.spec.ts',
276
+ type: 'module-spec',
277
+ },
278
+ {
279
+ capture: ['familyCategory', 'family'],
280
+ mode: 'file',
281
+ pattern: 'src/modules/*/*/index.ts',
282
+ type: 'module-index',
283
+ },
284
+ {
285
+ capture: ['familyCategory', 'family'],
286
+ mode: 'file',
287
+ pattern: 'src/modules/*/*/index.schema.ts',
288
+ type: 'module-schema-index',
289
+ },
290
+
291
+ // Resource patterns.
292
+ {
293
+ capture: ['family'],
294
+ mode: 'folder',
295
+ pattern: 'src/resources/*/actions',
296
+ type: `resource-actions`,
297
+ },
298
+ {
299
+ capture: ['family'],
300
+ mode: 'file',
301
+ pattern: 'src/resources/*/*.resource.ts',
302
+ type: `resource-resource`,
303
+ },
304
+ { capture: ['family'], mode: 'file', pattern: 'src/resources/*/index.ts', type: `resource-index` },
305
+ {
306
+ capture: ['family'],
307
+ mode: 'file',
308
+ pattern: 'src/resources/*/index.schema.ts',
309
+ type: `resource-schema-index`,
310
+ },
311
+
312
+ // Utility patterns.
313
+ {
314
+ pattern: 'src/utilities',
315
+ type: 'utilities',
316
+ },
317
+ ],
318
+ },
319
+ },
320
+
321
+ // JSON files.
322
+ ...jsonc.configs['flat/recommended-with-jsonc'],
323
+ {
324
+ files: ['**/*.json', '**/*.jsonc'],
325
+ rules: {
326
+ 'jsonc/sort-keys': ['error', 'asc', { caseSensitive: false, minKeys: 2, natural: false }],
327
+ },
328
+ },
329
+
330
+ // Prettier integration.
331
+ prettierConfig,
332
+
333
+ // Global ignores.
334
+ {
335
+ ignores: ['package-lock.json', '.idea', 'coverage', 'dist', 'node_modules'],
336
+ },
337
+ ];
@@ -0,0 +1,82 @@
1
+ # Dependencies
2
+ node_modules/
3
+ npm-debug.log*
4
+ yarn-debug.log*
5
+ yarn-error.log*
6
+ pnpm-debug.log*
7
+
8
+ # Build outputs
9
+ dist/
10
+ build/
11
+ *.tsbuildinfo
12
+
13
+ # Environment variables
14
+ .env
15
+ .env.local
16
+ .env.development.local
17
+ .env.test.local
18
+ .env.production.local
19
+
20
+ # IDE
21
+ .vscode/
22
+ .idea/
23
+ *.swp
24
+ *.swo
25
+ *~
26
+
27
+ # OS
28
+ .DS_Store
29
+ Thumbs.db
30
+
31
+ # Logs
32
+ logs
33
+ *.log
34
+
35
+ # Coverage
36
+ coverage/
37
+ .nyc_output/
38
+
39
+ # Runtime data
40
+ pids
41
+ *.pid
42
+ *.seed
43
+ *.pid.lock
44
+
45
+ # Optional npm cache directory
46
+ .npm
47
+
48
+ # Optional eslint cache
49
+ .eslintcache
50
+
51
+ # Microbundle cache
52
+ .rpt2_cache/
53
+ .rts2_cache_cjs/
54
+ .rts2_cache_es/
55
+ .rts2_cache_umd/
56
+
57
+ # Optional REPL history
58
+ .node_repl_history
59
+
60
+ # Output of 'npm pack'
61
+ *.tgz
62
+
63
+ # Yarn Integrity file
64
+ .yarn-integrity
65
+
66
+ # parcel-bundler cache (https://parceljs.org/)
67
+ .cache
68
+ .parcel-cache
69
+
70
+ # Next.js build output
71
+ .next
72
+
73
+ # Nuxt.js build / generate output
74
+ .nuxt
75
+
76
+ # Storybook build outputs
77
+ .out
78
+ .storybook-out
79
+
80
+ # Temporary folders
81
+ tmp/
82
+ temp/