@quadnix/octo-build 0.0.8 → 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.
- package/dist/commands/create-anchor/create-anchor.command.d.ts +13 -0
- package/dist/commands/create-anchor/create-anchor.command.js +67 -0
- package/dist/commands/create-anchor/create-anchor.command.js.map +1 -0
- package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/index.d.ts +13 -0
- package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/index.js +59 -0
- package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/index.js.map +1 -0
- package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/templates/anchors/anchor/anchor.schema.ts.ejs +23 -0
- package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/templates/anchors/anchor/anchor.ts.ejs +15 -0
- package/dist/commands/create-anchor/index.d.ts +1 -0
- package/dist/commands/create-anchor/index.js +2 -0
- package/dist/commands/create-anchor/index.js.map +1 -0
- package/dist/commands/{create/create.command.d.ts → create-app/create-app.command.d.ts} +1 -1
- package/dist/commands/{create/create.command.js → create-app/create-app.command.js} +3 -3
- package/dist/commands/create-app/create-app.command.js.map +1 -0
- package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/index.d.ts +0 -1
- package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/index.js +18 -29
- package/dist/commands/create-app/generator-octo-app-template/generators/app/index.js.map +1 -0
- package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/README.md.ejs +58 -0
- package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/eslint.config.js.ejs +118 -0
- package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/package.json.ejs +1 -4
- 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
- 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
- package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/src/aws-s3-website/module-definitions.ts.ejs +1 -1
- package/dist/commands/create-app/index.d.ts +1 -0
- package/dist/commands/create-app/index.js +2 -0
- package/dist/commands/create-app/index.js.map +1 -0
- package/dist/commands/create-cdk/create-cdk.command.d.ts +11 -0
- package/dist/commands/create-cdk/create-cdk.command.js +70 -0
- package/dist/commands/create-cdk/create-cdk.command.js.map +1 -0
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/index.d.ts +10 -0
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/index.js +107 -0
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/index.js.map +1 -0
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/README.md.ejs +23 -0
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/eslint.config.js.ejs +337 -0
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/gitignore.ejs +82 -0
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/package.json.ejs +57 -0
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/prettierrc.ejs +5 -0
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/anchors/app/app.anchor.schema.ts.ejs +19 -0
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/anchors/app/app.anchor.ts.ejs +17 -0
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/factories/dummy-credentials.factory.ts.ejs +28 -0
- 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
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/dummy-app.module.ts.ejs +16 -0
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/index.schema.ts.ejs +10 -0
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/index.ts.ejs +3 -0
- 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
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/models/app/index.ts.ejs +1 -0
- 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
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/resources/http-fetch/http-fetch.resource.ts.ejs +12 -0
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/resources/http-fetch/index.schema.ts.ejs +35 -0
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/resources/http-fetch/index.ts.ejs +3 -0
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/utilities/dummy/dummy.utility.ts.ejs +11 -0
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/tsconfig.build.json.ejs +11 -0
- package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/tsconfig.json.ejs +39 -0
- package/dist/commands/create-cdk/index.d.ts +1 -0
- package/dist/commands/create-cdk/index.js +2 -0
- package/dist/commands/create-cdk/index.js.map +1 -0
- package/dist/commands/create-model/create-model.command.d.ts +12 -0
- package/dist/commands/create-model/create-model.command.js +62 -0
- package/dist/commands/create-model/create-model.command.js.map +1 -0
- package/dist/commands/create-model/generator-octo-model-template/generators/app/index.d.ts +11 -0
- package/dist/commands/create-model/generator-octo-model-template/generators/app/index.js +68 -0
- package/dist/commands/create-model/generator-octo-model-template/generators/app/index.js.map +1 -0
- package/dist/commands/create-model/generator-octo-model-template/generators/app/templates/models/model/actions/add.model.action.ts.ejs +50 -0
- package/dist/commands/create-model/generator-octo-model-template/generators/app/templates/models/model/index.ts.ejs +3 -0
- package/dist/commands/create-model/generator-octo-model-template/generators/app/templates/models/model/model.ts.ejs +29 -0
- package/dist/commands/create-model/generator-octo-model-template/generators/app/templates/models/model/schema.ts.ejs +8 -0
- package/dist/commands/create-model/index.d.ts +1 -0
- package/dist/commands/create-model/index.js +2 -0
- package/dist/commands/create-model/index.js.map +1 -0
- package/dist/commands/create-module/create-module.command.d.ts +12 -0
- package/dist/commands/create-module/create-module.command.js +62 -0
- package/dist/commands/create-module/create-module.command.js.map +1 -0
- package/dist/commands/create-module/generator-octo-module-template/generators/app/index.d.ts +11 -0
- package/dist/commands/create-module/generator-octo-module-template/generators/app/index.js +60 -0
- package/dist/commands/create-module/generator-octo-module-template/generators/app/index.js.map +1 -0
- package/dist/commands/create-module/generator-octo-module-template/generators/app/templates/index.schema.ts.ejs +3 -0
- package/dist/commands/create-module/generator-octo-module-template/generators/app/templates/index.ts.ejs +1 -0
- package/dist/commands/create-module/generator-octo-module-template/generators/app/templates/module.ts.ejs +9 -0
- package/dist/commands/create-module/index.d.ts +1 -0
- package/dist/commands/create-module/index.js +2 -0
- package/dist/commands/create-module/index.js.map +1 -0
- package/dist/commands/create-overlay/create-overlay.command.d.ts +13 -0
- package/dist/commands/create-overlay/create-overlay.command.js +67 -0
- package/dist/commands/create-overlay/create-overlay.command.js.map +1 -0
- package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/index.d.ts +12 -0
- package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/index.js +72 -0
- package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/index.js.map +1 -0
- package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/templates/overlays/overlay/actions/add.overlay.action.ts.ejs +50 -0
- package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/templates/overlays/overlay/index.ts.ejs +3 -0
- package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/templates/overlays/overlay/overlay.schema.ts.ejs +13 -0
- package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/templates/overlays/overlay/overlay.ts.ejs +22 -0
- package/dist/commands/create-overlay/index.d.ts +1 -0
- package/dist/commands/create-overlay/index.js +2 -0
- package/dist/commands/create-overlay/index.js.map +1 -0
- package/dist/commands/create-resource/create-resource.command.d.ts +11 -0
- package/dist/commands/create-resource/create-resource.command.js +55 -0
- package/dist/commands/create-resource/create-resource.command.js.map +1 -0
- package/dist/commands/create-resource/generator-octo-resource-template/generators/app/index.d.ts +10 -0
- package/dist/commands/create-resource/generator-octo-resource-template/generators/app/index.js +71 -0
- package/dist/commands/create-resource/generator-octo-resource-template/generators/app/index.js.map +1 -0
- package/dist/commands/create-resource/generator-octo-resource-template/generators/app/templates/resources/resource/actions/add.resource.action.ts.ejs +65 -0
- package/dist/commands/create-resource/generator-octo-resource-template/generators/app/templates/resources/resource/actions/delete.resource.action.ts.ejs +58 -0
- package/dist/commands/create-resource/generator-octo-resource-template/generators/app/templates/resources/resource/actions/update-tags.resource.action.ts.ejs +95 -0
- package/dist/commands/create-resource/generator-octo-resource-template/generators/app/templates/resources/resource/index.schema.ts.ejs +31 -0
- package/dist/commands/create-resource/generator-octo-resource-template/generators/app/templates/resources/resource/index.ts.ejs +5 -0
- package/dist/commands/create-resource/generator-octo-resource-template/generators/app/templates/resources/resource/resource.ts.ejs +12 -0
- package/dist/commands/create-resource/index.d.ts +1 -0
- package/dist/commands/create-resource/index.js +2 -0
- package/dist/commands/create-resource/index.js.map +1 -0
- package/dist/index.js +14 -2
- package/dist/index.js.map +1 -1
- package/dist/utilities/string/string.utility.d.ts +5 -0
- package/dist/utilities/string/string.utility.js +26 -0
- package/dist/utilities/string/string.utility.js.map +1 -0
- package/package.json +2 -2
- package/dist/commands/create/create.command.js.map +0 -1
- package/dist/commands/create/generator-octo-app-template/generators/app/index.js.map +0 -1
- package/dist/commands/create/generator-octo-app-template/generators/app/templates/README.md.ejs +0 -84
- package/dist/commands/create/generator-octo-app-template/generators/app/templates/eslint.config.js.ejs +0 -130
- package/dist/commands/create/index.d.ts +0 -1
- package/dist/commands/create/index.js +0 -2
- package/dist/commands/create/index.js.map +0 -1
- /package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/gitignore.ejs +0 -0
- /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
- /package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/prettierrc.ejs +0 -0
- /package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/app.config.ts.ejs +0 -0
- /package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/env.ejs +0 -0
- /package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/module-definitions.ts.ejs +0 -0
- /package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/src/aws-s3-website/app.config.ts.ejs +0 -0
- /package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/src/aws-s3-website/env.ejs +0 -0
- /package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/src/aws-s3-website/website/error.html.ejs +0 -0
- /package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/src/aws-s3-website/website/index.html.ejs +0 -0
- /package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/tsconfig.build.json.ejs +0 -0
- /package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/templates/tsconfig.json.ejs +0 -0
- /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,13 @@
|
|
|
1
|
+
import type { ArgumentsCamelCase, Argv } from 'yargs';
|
|
2
|
+
export declare const createAnchorCommand: {
|
|
3
|
+
builder: (yargs: Argv) => Argv;
|
|
4
|
+
command: string;
|
|
5
|
+
describe: string;
|
|
6
|
+
handler: (argv: ArgumentsCamelCase<{
|
|
7
|
+
family: string;
|
|
8
|
+
name: string;
|
|
9
|
+
package: string;
|
|
10
|
+
path: string;
|
|
11
|
+
type: string;
|
|
12
|
+
}>) => Promise<void>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { dirname, resolve } from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import { createEnv } from 'yeoman-environment';
|
|
5
|
+
import { StringUtility } from '../../utilities/string/string.utility.js';
|
|
6
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
export const createAnchorCommand = {
|
|
8
|
+
builder: (yargs) => {
|
|
9
|
+
return yargs
|
|
10
|
+
.option('name', {
|
|
11
|
+
alias: 'n',
|
|
12
|
+
demandOption: true,
|
|
13
|
+
description: 'Name of the anchor to create. Should be in kebab-case (e.g., my-awesome-thing).',
|
|
14
|
+
type: 'string',
|
|
15
|
+
})
|
|
16
|
+
.option('family', {
|
|
17
|
+
demandOption: true,
|
|
18
|
+
description: 'Name of the anchor family. The anchor will be created under this directory.',
|
|
19
|
+
type: 'string',
|
|
20
|
+
})
|
|
21
|
+
.option('type', {
|
|
22
|
+
alias: 't',
|
|
23
|
+
choices: [...StringUtility.AVAILABLE_MODEL_TYPES, 'overlay'],
|
|
24
|
+
demandOption: true,
|
|
25
|
+
description: 'Type of model this anchor is for.',
|
|
26
|
+
type: 'string',
|
|
27
|
+
})
|
|
28
|
+
.option('package', {
|
|
29
|
+
demandOption: true,
|
|
30
|
+
description: 'Package name for the anchor.',
|
|
31
|
+
type: 'string',
|
|
32
|
+
})
|
|
33
|
+
.option('path', {
|
|
34
|
+
alias: 'p',
|
|
35
|
+
default: '.',
|
|
36
|
+
description: 'Root directory path of the CDK.',
|
|
37
|
+
type: 'string',
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
command: 'create-anchor',
|
|
41
|
+
describe: 'Create a new Octo anchor.',
|
|
42
|
+
handler: async (argv) => {
|
|
43
|
+
const { family, name, package: packageName, path, type } = argv;
|
|
44
|
+
// Validate anchor name format (should be kebab-case)
|
|
45
|
+
if (!StringUtility.isKebabCase(name)) {
|
|
46
|
+
console.error(chalk.red('Anchor name must be in kebab-case format (e.g., my-awesome-thing)'));
|
|
47
|
+
process.exit(1);
|
|
48
|
+
}
|
|
49
|
+
console.log(chalk.blue(`Creating anchor "${name}" with parent "${type}"...`));
|
|
50
|
+
const env = createEnv();
|
|
51
|
+
env.register(resolve(__dirname, 'generator-octo-anchor-template/generators/app/index.js'), {
|
|
52
|
+
namespace: 'generator-octo-anchor-template:app',
|
|
53
|
+
});
|
|
54
|
+
try {
|
|
55
|
+
await env.run(['generator-octo-anchor-template:app', name, family, type, packageName, path], {
|
|
56
|
+
skipCache: true,
|
|
57
|
+
skipInstall: true,
|
|
58
|
+
});
|
|
59
|
+
console.log(chalk.green(`Successfully created anchor!`));
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
console.error(chalk.red(`Failed to create anchor! ${error.message}`));
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=create-anchor.command.js.map
|
|
@@ -0,0 +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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,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,oBAAoB,IAAI,kBAAkB,IAAI,MAAM,CAAC,CAAC,CAAC;QAE9E,MAAM,GAAG,GAAG,SAAS,EAAE,CAAC;QACxB,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,EAAE,wDAAwD,CAAC,EAAE;YACzF,SAAS,EAAE,oCAAoC;SAChD,CAAC,CAAC;QAEH,IAAI,CAAC;YACH,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,oCAAoC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE;gBAC3F,SAAS,EAAE,IAAI;gBACf,WAAW,EAAE,IAAI;aAClB,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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Generator, { type BaseOptions } from 'yeoman-generator';
|
|
2
|
+
export default class extends Generator {
|
|
3
|
+
private readonly anchorFamily;
|
|
4
|
+
private readonly anchorName;
|
|
5
|
+
private readonly cdkRootDir;
|
|
6
|
+
private readonly modelType;
|
|
7
|
+
private readonly packageName;
|
|
8
|
+
private readonly isModelAnchor;
|
|
9
|
+
constructor(args: string[], opts: BaseOptions);
|
|
10
|
+
initializing(): Promise<void>;
|
|
11
|
+
writing(): Promise<void>;
|
|
12
|
+
end(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { readdir } from 'fs/promises';
|
|
2
|
+
import { join, resolve } from 'path';
|
|
3
|
+
import Generator, {} from 'yeoman-generator';
|
|
4
|
+
import { StringUtility } from '../../../../../utilities/string/string.utility.js';
|
|
5
|
+
export default class extends Generator {
|
|
6
|
+
constructor(args, opts) {
|
|
7
|
+
super(args, opts);
|
|
8
|
+
this.anchorName = args[0];
|
|
9
|
+
this.anchorFamily = args[1];
|
|
10
|
+
this.modelType = args[2];
|
|
11
|
+
this.packageName = args[3];
|
|
12
|
+
this.cdkRootDir = args[4];
|
|
13
|
+
// Determine if this is a model anchor or overlay anchor.
|
|
14
|
+
this.isModelAnchor = StringUtility.AVAILABLE_MODEL_TYPES.includes(this.modelType);
|
|
15
|
+
}
|
|
16
|
+
async initializing() {
|
|
17
|
+
const targetPath = resolve(join(this.cdkRootDir, 'src', 'anchors', this.anchorFamily));
|
|
18
|
+
// Check if anchors already exists.
|
|
19
|
+
let targetPathContents;
|
|
20
|
+
try {
|
|
21
|
+
targetPathContents = await readdir(targetPath, { withFileTypes: true });
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
if (error.code !== 'ENOENT') {
|
|
25
|
+
throw error;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
for (const file of targetPathContents) {
|
|
29
|
+
if ((file.isFile() && file.name === `${this.anchorName}.anchor.ts`) ||
|
|
30
|
+
file.name === `${this.anchorName}.anchor.schema.ts`) {
|
|
31
|
+
throw new Error(`Anchor '${this.anchorName}' already exists!`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
// Set the destination root to the anchor directory.
|
|
35
|
+
this.destinationRoot(targetPath);
|
|
36
|
+
}
|
|
37
|
+
async writing() {
|
|
38
|
+
// Create the anchor file.
|
|
39
|
+
this.fs.copyTpl(this.templatePath('anchors/anchor/anchor.ts.ejs'), this.destinationPath(`${this.anchorName}.anchor.ts`), {
|
|
40
|
+
anchorName: this.anchorName,
|
|
41
|
+
anchorNamePascal: StringUtility.toPascalCase(this.anchorName),
|
|
42
|
+
packageName: this.packageName,
|
|
43
|
+
});
|
|
44
|
+
// Create schema file.
|
|
45
|
+
this.fs.copyTpl(this.templatePath('anchors/anchor/anchor.schema.ts.ejs'), this.destinationPath(`${this.anchorName}.anchor.schema.ts`), {
|
|
46
|
+
anchorNamePascal: StringUtility.toPascalCase(this.anchorName),
|
|
47
|
+
isModelAnchor: this.isModelAnchor,
|
|
48
|
+
modelTypePascal: StringUtility.toPascalCase(this.modelType),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
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
|
+
}
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/index.js.map
ADDED
|
@@ -0,0 +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,IAA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verlay, BaseAnchorSchema, type BaseOverlaySchema, Schema, Validate } from '@quadnix/octo';
|
|
5
|
+
<% } -%>
|
|
6
|
+
|
|
7
|
+
export class <%= anchorNamePascal %>AnchorSchema extends BaseAnchorSchema {
|
|
8
|
+
<% if (isModelAnchor) { -%>
|
|
9
|
+
parentInstance: <%- modelTypePascal %>;
|
|
10
|
+
<% } else { -%>
|
|
11
|
+
parentInstance: AOverlay<BaseOverlaySchema, any>;
|
|
12
|
+
<% } -%>
|
|
13
|
+
|
|
14
|
+
@Validate({
|
|
15
|
+
destruct: (value: <%= anchorNamePascal %>AnchorSchema['properties']): string[] => [
|
|
16
|
+
// Fix me: Add properties for validation.
|
|
17
|
+
],
|
|
18
|
+
options: { minLength: 1 },
|
|
19
|
+
})
|
|
20
|
+
override properties = Schema<{
|
|
21
|
+
// Fix me: Add anchor properties.
|
|
22
|
+
}>();
|
|
23
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AAnchor, Anchor } from '@quadnix/octo';
|
|
2
|
+
import type { <%= anchorNamePascal %>AnchorSchema } from './<%= anchorName %>.anchor.schema.js';
|
|
3
|
+
|
|
4
|
+
@Anchor('<%= packageName %>')
|
|
5
|
+
export class <%= anchorNamePascal %>Anchor extends AAnchor<<%= anchorNamePascal %>AnchorSchema, <%= anchorNamePascal %>AnchorSchema['parentInstance']> {
|
|
6
|
+
declare properties: <%= anchorNamePascal %>AnchorSchema['properties'];
|
|
7
|
+
|
|
8
|
+
constructor(
|
|
9
|
+
anchorId: string,
|
|
10
|
+
properties: <%= anchorNamePascal %>AnchorSchema['properties'],
|
|
11
|
+
parent: <%= anchorNamePascal %>AnchorSchema['parentInstance'],
|
|
12
|
+
) {
|
|
13
|
+
super(anchorId, properties, parent);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createAnchorCommand } from './create-anchor.command.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/create-anchor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { fileURLToPath } from 'url';
|
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import { createEnv } from 'yeoman-environment';
|
|
5
5
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
-
export const
|
|
6
|
+
export const createAppCommand = {
|
|
7
7
|
builder: (yargs) => {
|
|
8
8
|
return yargs
|
|
9
9
|
.option('template', {
|
|
@@ -26,7 +26,7 @@ export const createCommand = {
|
|
|
26
26
|
type: 'string',
|
|
27
27
|
});
|
|
28
28
|
},
|
|
29
|
-
command: 'create',
|
|
29
|
+
command: 'create-app',
|
|
30
30
|
describe: 'Create a new Octo app from a template.',
|
|
31
31
|
handler: async (argv) => {
|
|
32
32
|
const { name, path, template } = argv;
|
|
@@ -48,4 +48,4 @@ export const createCommand = {
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
};
|
|
51
|
-
//# sourceMappingURL=create.command.js.map
|
|
51
|
+
//# sourceMappingURL=create-app.command.js.map
|
|
@@ -0,0 +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;AACxC,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;QAC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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"}
|
package/dist/commands/{create → create-app}/generator-octo-app-template/generators/app/index.js
RENAMED
|
@@ -8,16 +8,6 @@ export default class extends Generator {
|
|
|
8
8
|
this.appPath = args[1];
|
|
9
9
|
this.appTemplate = args[2];
|
|
10
10
|
}
|
|
11
|
-
getCopyScriptGlobs() {
|
|
12
|
-
switch (this.appTemplate) {
|
|
13
|
-
case 'aws-ecs-server':
|
|
14
|
-
return ['src/.env', 'src/.octo/**/*'];
|
|
15
|
-
case 'aws-s3-website':
|
|
16
|
-
return ['src/.env', 'src/.octo/**/*', 'src/website/**/*'];
|
|
17
|
-
default:
|
|
18
|
-
throw new Error(`Unsupported app template: ${this.appTemplate}`);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
11
|
async initializing() {
|
|
22
12
|
const targetPath = resolve(join(this.appPath, this.appName));
|
|
23
13
|
// Check if directory already exists and is not empty.
|
|
@@ -30,7 +20,7 @@ export default class extends Generator {
|
|
|
30
20
|
throw error;
|
|
31
21
|
}
|
|
32
22
|
}
|
|
33
|
-
if (targetPathStat
|
|
23
|
+
if (targetPathStat?.isDirectory()) {
|
|
34
24
|
const files = await readdir(targetPath);
|
|
35
25
|
if (files.length > 0) {
|
|
36
26
|
throw new Error(`Directory '${targetPath}' already exists and is not empty! Please choose a different name or path.`);
|
|
@@ -46,9 +36,6 @@ export default class extends Generator {
|
|
|
46
36
|
this.fs.copyTpl(this.templatePath('gitignore.ejs'), this.destinationPath('.gitignore'));
|
|
47
37
|
// Create package.json
|
|
48
38
|
this.fs.copyTpl(this.templatePath('package.json.ejs'), this.destinationPath('package.json'), {
|
|
49
|
-
copyGlobs: this.getCopyScriptGlobs()
|
|
50
|
-
.map((g) => `\\"${g}\\"`)
|
|
51
|
-
.join(' '),
|
|
52
39
|
description: `Infrastructure definition using Octo for ${this.appName}`,
|
|
53
40
|
name: this.appName,
|
|
54
41
|
version: '0.0.1',
|
|
@@ -60,25 +47,27 @@ export default class extends Generator {
|
|
|
60
47
|
'env-smart': '^2.3.2',
|
|
61
48
|
});
|
|
62
49
|
await this.addDevDependencies({
|
|
50
|
+
'@eslint/js': '^9.33.0',
|
|
63
51
|
'@types/jest': '^30.0.0',
|
|
64
|
-
'@types/node': '^
|
|
65
|
-
|
|
66
|
-
eslint: '^
|
|
52
|
+
'@types/node': '^24.3.0',
|
|
53
|
+
'@typescript-eslint/eslint-plugin': '^8.39.1',
|
|
54
|
+
'@typescript-eslint/parser': '^8.39.1',
|
|
55
|
+
eslint: '^9.33.0',
|
|
67
56
|
'eslint-config-prettier': '^10.1.8',
|
|
68
57
|
'eslint-import-resolver-typescript': '^4.4.4',
|
|
69
58
|
'eslint-plugin-import': '^2.32.0',
|
|
70
59
|
'eslint-plugin-jsonc': '^2.20.1',
|
|
71
60
|
'eslint-plugin-prettier': '^5.5.4',
|
|
72
|
-
|
|
73
|
-
|
|
61
|
+
globals: '^16.3.0',
|
|
62
|
+
jest: '^30.0.5',
|
|
74
63
|
prettier: '^3.6.2',
|
|
75
|
-
rimraf: '^6.0.
|
|
64
|
+
rimraf: '^6.0.1',
|
|
76
65
|
'source-map-support': '^0.5.21',
|
|
77
|
-
'ts-jest': '^29.
|
|
66
|
+
'ts-jest': '^29.4.1',
|
|
67
|
+
'ts-loader': '^9.5.2',
|
|
78
68
|
'ts-node': '^10.9.2',
|
|
79
69
|
'tsconfig-paths': '^4.2.0',
|
|
80
|
-
typescript: '^5.
|
|
81
|
-
'typescript-eslint': '^8.0.0',
|
|
70
|
+
typescript: '^5.9.2',
|
|
82
71
|
});
|
|
83
72
|
// Create .prettierrc
|
|
84
73
|
this.fs.copyTpl(this.templatePath('prettierrc.ejs'), this.destinationPath('.prettierrc'));
|
|
@@ -90,26 +79,26 @@ export default class extends Generator {
|
|
|
90
79
|
// Create tsconfig.json and tsconfig.build.json
|
|
91
80
|
this.fs.copyTpl(this.templatePath('tsconfig.json.ejs'), this.destinationPath('tsconfig.json'));
|
|
92
81
|
this.fs.copyTpl(this.templatePath('tsconfig.build.json.ejs'), this.destinationPath('tsconfig.build.json'));
|
|
82
|
+
// Create .octo directory
|
|
83
|
+
this.fs.copyTpl(this.templatePath(`gitkeep.ejs`), this.destinationPath('.octo/.gitkeep'));
|
|
93
84
|
// Create src directory and main files
|
|
94
85
|
if (this.appTemplate === 'aws-ecs-server') {
|
|
95
86
|
const templatePath = `src/${this.appTemplate}`;
|
|
96
|
-
this.fs.copyTpl(this.templatePath(`${templatePath}/octo/gitkeep.ejs`), this.destinationPath('src/.octo/.gitkeep'));
|
|
97
87
|
this.fs.copyTpl(this.templatePath(`${templatePath}/app.config.ts.ejs`), this.destinationPath('src/app.config.ts'));
|
|
98
|
-
this.fs.copyTpl(this.templatePath(`${templatePath}/env.ejs`), this.destinationPath('
|
|
88
|
+
this.fs.copyTpl(this.templatePath(`${templatePath}/env.ejs`), this.destinationPath('.env'));
|
|
99
89
|
this.fs.copyTpl(this.templatePath(`${templatePath}/main.ts.ejs`), this.destinationPath('src/main.ts'));
|
|
100
90
|
this.fs.copyTpl(this.templatePath(`${templatePath}/module-definitions.ts.ejs`), this.destinationPath('src/module-definitions.ts'));
|
|
101
91
|
}
|
|
102
92
|
else if (this.appTemplate === 'aws-s3-website') {
|
|
103
93
|
const templatePath = `src/${this.appTemplate}`;
|
|
104
|
-
this.fs.copyTpl(this.templatePath(`${templatePath}/
|
|
105
|
-
this.fs.copyTpl(this.templatePath(`${templatePath}/website/error.html.ejs`), this.destinationPath('src/website/error.html'), {
|
|
94
|
+
this.fs.copyTpl(this.templatePath(`${templatePath}/website/error.html.ejs`), this.destinationPath('website/error.html'), {
|
|
106
95
|
name: this.appName,
|
|
107
96
|
});
|
|
108
|
-
this.fs.copyTpl(this.templatePath(`${templatePath}/website/index.html.ejs`), this.destinationPath('
|
|
97
|
+
this.fs.copyTpl(this.templatePath(`${templatePath}/website/index.html.ejs`), this.destinationPath('website/index.html'), {
|
|
109
98
|
name: this.appName,
|
|
110
99
|
});
|
|
111
100
|
this.fs.copyTpl(this.templatePath(`${templatePath}/app.config.ts.ejs`), this.destinationPath('src/app.config.ts'));
|
|
112
|
-
this.fs.copyTpl(this.templatePath(`${templatePath}/env.ejs`), this.destinationPath('
|
|
101
|
+
this.fs.copyTpl(this.templatePath(`${templatePath}/env.ejs`), this.destinationPath('.env'));
|
|
113
102
|
this.fs.copyTpl(this.templatePath(`${templatePath}/main.ts.ejs`), this.destinationPath('src/main.ts'));
|
|
114
103
|
this.fs.copyTpl(this.templatePath(`${templatePath}/module-definitions.ts.ejs`), this.destinationPath('src/module-definitions.ts'));
|
|
115
104
|
}
|
|
@@ -0,0 +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;IAKpC,YAAY,IAAc,EAAE,IAAiB;QAC3C,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAElB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,IAA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,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;QAC7B,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC3B,CAAC;CACF"}
|
package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/README.md.ejs
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
## Fix me
|
|
13
|
+
Before running the app, ensure,
|
|
14
|
+
- `.env` values are appropriately set.
|
|
15
|
+
|
|
16
|
+
## Development
|
|
17
|
+
```bash
|
|
18
|
+
# Build app. This will compile your TypeScript code.
|
|
19
|
+
npm run build
|
|
20
|
+
|
|
21
|
+
# Run app. This will create the infrastructure defined in your app.
|
|
22
|
+
npm start
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Destroy
|
|
26
|
+
### Step 1
|
|
27
|
+
In `module-definitions.ts`, comment out all modules except the `app` and `account` modules.
|
|
28
|
+
The app and account modules load AWS credentials to call AWS APIs, hence they remain uncommented.
|
|
29
|
+
|
|
30
|
+
By deleting the `s3-website-service-module` module below,
|
|
31
|
+
you are safely deleting the s3-website resources created by this module.
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
// Example for 'aws-s3-website' template.
|
|
35
|
+
private init(): void {
|
|
36
|
+
this.add(SimpleAppModule, 'app-module', { name: 'aws-s3-website' });
|
|
37
|
+
|
|
38
|
+
this.add(AwsIniAccountModule, 'account-module', {
|
|
39
|
+
accountId: config.AWS_ACCOUNT_ID,
|
|
40
|
+
app: stub<App>('${{app-module.model.app}}'),
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
// this.add(AwsS3StaticWebsiteServiceModule, 's3-website-service-module', {
|
|
44
|
+
// account: stub<Account>('${{account-module.model.account}}'),
|
|
45
|
+
// awsRegionId: 'us-east-1',
|
|
46
|
+
// bucketName: config.AWS_S3_WEBSITE_BUCKET_NAME,
|
|
47
|
+
// directoryPath: websiteSourcePath,
|
|
48
|
+
// });
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Step 2
|
|
53
|
+
Then, simply re-build and run your app again.
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm run build
|
|
57
|
+
npm start
|
|
58
|
+
```
|
|
@@ -0,0 +1,118 @@
|
|
|
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 importPlugin from 'eslint-plugin-import';
|
|
9
|
+
import jsonc from 'eslint-plugin-jsonc';
|
|
10
|
+
import prettier from 'eslint-plugin-prettier';
|
|
11
|
+
import globals from 'globals';
|
|
12
|
+
|
|
13
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
|
|
15
|
+
export default [
|
|
16
|
+
// Base JavaScript config
|
|
17
|
+
js.configs.recommended,
|
|
18
|
+
|
|
19
|
+
// All files.
|
|
20
|
+
{
|
|
21
|
+
files: ['**/*.{js,cjs,ts,tsx}'],
|
|
22
|
+
languageOptions: {
|
|
23
|
+
globals: {
|
|
24
|
+
...globals.node,
|
|
25
|
+
...globals.jest,
|
|
26
|
+
NodeJS: true,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
plugins: {
|
|
30
|
+
import: importPlugin,
|
|
31
|
+
},
|
|
32
|
+
rules: {
|
|
33
|
+
'import/no-duplicates': 'error',
|
|
34
|
+
'import/no-unresolved': 'error',
|
|
35
|
+
'import/order': [
|
|
36
|
+
'error',
|
|
37
|
+
{
|
|
38
|
+
alphabetize: { caseInsensitive: false, order: 'asc', orderImportKind: 'asc' },
|
|
39
|
+
named: { enabled: true, types: 'mixed' },
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
'max-len': ['error', { code: 120, ignoreStrings: true }],
|
|
43
|
+
'no-async-promise-executor': 'off',
|
|
44
|
+
'no-duplicate-imports': ['error', { includeExports: true }],
|
|
45
|
+
'no-unused-vars': 'off',
|
|
46
|
+
'sort-imports': [
|
|
47
|
+
'error',
|
|
48
|
+
{
|
|
49
|
+
allowSeparatedGroups: true,
|
|
50
|
+
ignoreCase: false,
|
|
51
|
+
ignoreDeclarationSort: true,
|
|
52
|
+
ignoreMemberSort: false,
|
|
53
|
+
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
'sort-keys': ['error', 'asc', { caseSensitive: false, minKeys: 2, natural: false }],
|
|
57
|
+
},
|
|
58
|
+
settings: {
|
|
59
|
+
'import/resolver': {
|
|
60
|
+
node: {
|
|
61
|
+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
62
|
+
},
|
|
63
|
+
typescript: {
|
|
64
|
+
alwaysTryTypes: true,
|
|
65
|
+
project: './tsconfig.json',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
// TypeScript files.
|
|
72
|
+
{
|
|
73
|
+
files: ['**/*.{ts,tsx}'],
|
|
74
|
+
languageOptions: {
|
|
75
|
+
parser: tsparser,
|
|
76
|
+
parserOptions: {
|
|
77
|
+
ecmaVersion: 2022,
|
|
78
|
+
project: './tsconfig.json',
|
|
79
|
+
sourceType: 'module',
|
|
80
|
+
tsconfigRootDir: __dirname,
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
plugins: {
|
|
84
|
+
'@typescript-eslint': tseslint,
|
|
85
|
+
import: importPlugin,
|
|
86
|
+
prettier,
|
|
87
|
+
},
|
|
88
|
+
rules: {
|
|
89
|
+
'@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'inline-type-imports' }],
|
|
90
|
+
'@typescript-eslint/explicit-function-return-type': 'error',
|
|
91
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
92
|
+
'@typescript-eslint/interface-name-prefix': 'off',
|
|
93
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
94
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
95
|
+
'@typescript-eslint/no-this-alias': 'error',
|
|
96
|
+
'@typescript-eslint/no-unused-vars': 'off',
|
|
97
|
+
'@typescript-eslint/prefer-nullish-coalescing': 'off',
|
|
98
|
+
'@typescript-eslint/prefer-optional-chain': 'error',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
// JSON files.
|
|
103
|
+
...jsonc.configs['flat/recommended-with-jsonc'],
|
|
104
|
+
{
|
|
105
|
+
files: ['**/*.json', '**/*.jsonc'],
|
|
106
|
+
rules: {
|
|
107
|
+
'jsonc/sort-keys': ['error', 'asc', { caseSensitive: false, minKeys: 2, natural: false }],
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
// Prettier integration.
|
|
112
|
+
prettierConfig,
|
|
113
|
+
|
|
114
|
+
// Global ignores.
|
|
115
|
+
{
|
|
116
|
+
ignores: ['package-lock.json', '.idea', 'coverage', 'dist', 'node_modules'],
|
|
117
|
+
},
|
|
118
|
+
];
|
|
@@ -41,13 +41,10 @@
|
|
|
41
41
|
"name": "<%= name %>",
|
|
42
42
|
"private": true,
|
|
43
43
|
"scripts": {
|
|
44
|
-
"build": "rimraf dist && tsc -p tsconfig.build.json
|
|
45
|
-
"copy-assets-dist": "copyfiles -u 1 -a <%- copyGlobs %> dist/",
|
|
46
|
-
"copy-assets-src": "copyfiles -u 1 -a \"dist/.octo/**/*\" src/",
|
|
44
|
+
"build": "rimraf dist && tsc -p tsconfig.build.json",
|
|
47
45
|
"format": "prettier --write \"src/**/*.ts\"",
|
|
48
46
|
"lint": "eslint .",
|
|
49
47
|
"start": "node dist/main.js",
|
|
50
|
-
"start:dev": "npm start && npm run copy-assets-src",
|
|
51
48
|
"test": "NODE_OPTIONS=--experimental-vm-modules jest --testRegex=\"\\.spec.ts$\"",
|
|
52
49
|
"test:e2e": "NODE_OPTIONS=--experimental-vm-modules jest --testRegex=\"\\.e2e-spec.ts$\""
|
|
53
50
|
},
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { dirname, join } from 'path';
|
|
2
2
|
import { fileURLToPath } from 'url';
|
|
3
3
|
import { type App, LocalStateProvider, Octo } from '@quadnix/octo';
|
|
4
|
-
import {
|
|
4
|
+
import { HtmlReportEventListener, LoggingEventListener } from '@quadnix/octo-event-listeners';
|
|
5
5
|
import { ModuleDefinitions } from './module-definitions.js';
|
|
6
6
|
|
|
7
7
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
-
const octoStatePath = join(__dirname, '.octo');
|
|
8
|
+
const octoStatePath = join(__dirname, '..', '.octo');
|
|
9
9
|
|
|
10
10
|
const octo = new Octo();
|
|
11
11
|
const stateProvider = new LocalStateProvider(octoStatePath);
|
|
12
|
-
await octo.initialize(stateProvider, [{ type:
|
|
12
|
+
await octo.initialize(stateProvider, [{ type: HtmlReportEventListener }, { type: LoggingEventListener }]);
|
|
13
13
|
|
|
14
14
|
const moduleDefinitions = new ModuleDefinitions();
|
|
15
15
|
for (const moduleDefinition of moduleDefinitions.getAll()) {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { dirname, join } from 'path';
|
|
2
2
|
import { fileURLToPath } from 'url';
|
|
3
3
|
import { type App, LocalStateProvider, Octo } from '@quadnix/octo';
|
|
4
|
-
import {
|
|
4
|
+
import { HtmlReportEventListener, LoggingEventListener } from '@quadnix/octo-event-listeners';
|
|
5
5
|
import { ModuleDefinitions } from './module-definitions.js';
|
|
6
6
|
|
|
7
7
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
-
const octoStatePath = join(__dirname, '.octo');
|
|
8
|
+
const octoStatePath = join(__dirname, '..', '.octo');
|
|
9
9
|
|
|
10
10
|
const octo = new Octo();
|
|
11
11
|
const stateProvider = new LocalStateProvider(octoStatePath);
|
|
12
|
-
await octo.initialize(stateProvider, [{ type:
|
|
12
|
+
await octo.initialize(stateProvider, [{ type: HtmlReportEventListener }, { type: LoggingEventListener }]);
|
|
13
13
|
|
|
14
14
|
const moduleDefinitions = new ModuleDefinitions();
|
|
15
15
|
for (const moduleDefinition of moduleDefinitions.getAll()) {
|
|
@@ -7,7 +7,7 @@ import { AwsS3StaticWebsiteServiceModule } from '@quadnix/octo-aws-cdk/modules/s
|
|
|
7
7
|
import { config } from './app.config.js';
|
|
8
8
|
|
|
9
9
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
|
-
const websiteSourcePath = join(__dirname, 'website');
|
|
10
|
+
const websiteSourcePath = join(__dirname, '..', website');
|
|
11
11
|
|
|
12
12
|
type ModuleDefinition<T extends AModule<unknown, any>> = {
|
|
13
13
|
module: Constructable<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createAppCommand } from './create-app.command.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/create-app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
|