@quadnix/octo-build 0.0.4 → 0.0.6
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/README.md +4 -2
- package/dist/commands/build/build.command.d.ts +14 -0
- package/dist/commands/build/build.command.js +104 -0
- package/dist/commands/build/build.command.js.map +1 -0
- package/dist/commands/build/index.d.ts +1 -0
- package/dist/commands/build/index.js +2 -0
- package/dist/commands/build/index.js.map +1 -0
- package/dist/{main.d.ts → commands/build/main.d.ts} +3 -4
- package/dist/{main.js → commands/build/main.js} +3 -4
- package/dist/commands/build/main.js.map +1 -0
- package/dist/commands/build/models/build-configuration.interface.js.map +1 -0
- package/dist/commands/build/models/run-arguments.interface.js.map +1 -0
- package/dist/{parsers → commands/build/parsers}/build-file.parser.d.ts +1 -1
- package/dist/commands/build/parsers/build-file.parser.js.map +1 -0
- package/dist/{streams → commands/build/streams}/stream-manager.d.ts +1 -2
- package/dist/{streams → commands/build/streams}/stream-manager.js +10 -8
- package/dist/commands/build/streams/stream-manager.js.map +1 -0
- package/dist/commands/create/create.command.d.ts +11 -0
- package/dist/commands/create/create.command.js +51 -0
- package/dist/commands/create/create.command.js.map +1 -0
- package/dist/commands/create/generator-octo-app-template/generators/app/index.d.ts +10 -0
- package/dist/commands/create/generator-octo-app-template/generators/app/index.js +117 -0
- package/dist/commands/create/generator-octo-app-template/generators/app/index.js.map +1 -0
- package/dist/commands/create/generator-octo-app-template/generators/app/templates/README.md.ejs +20 -0
- package/dist/commands/create/generator-octo-app-template/generators/app/templates/eslint.config.js.ejs +130 -0
- package/dist/commands/create/generator-octo-app-template/generators/app/templates/gitignore.ejs +82 -0
- package/dist/commands/create/generator-octo-app-template/generators/app/templates/package.json.ejs +54 -0
- package/dist/commands/create/generator-octo-app-template/generators/app/templates/prettierrc.ejs +5 -0
- package/dist/commands/create/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/app.config.ts.ejs +23 -0
- package/dist/commands/create/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/env.ejs +2 -0
- package/dist/commands/create/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/main.ts.ejs +22 -0
- package/dist/commands/create/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/module-definitions.ts.ejs +202 -0
- package/dist/commands/create/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/octo/gitkeep.ejs +0 -0
- package/dist/commands/create/generator-octo-app-template/generators/app/templates/src/aws-s3-website/app.config.ts.ejs +25 -0
- package/dist/commands/create/generator-octo-app-template/generators/app/templates/src/aws-s3-website/env.ejs +5 -0
- package/dist/commands/create/generator-octo-app-template/generators/app/templates/src/aws-s3-website/main.ts.ejs +22 -0
- package/dist/commands/create/generator-octo-app-template/generators/app/templates/src/aws-s3-website/module-definitions.ts.ejs +52 -0
- package/dist/commands/create/generator-octo-app-template/generators/app/templates/src/aws-s3-website/octo/gitkeep.ejs +0 -0
- package/dist/commands/create/generator-octo-app-template/generators/app/templates/src/aws-s3-website/website/error.html.ejs +8 -0
- package/dist/commands/create/generator-octo-app-template/generators/app/templates/src/aws-s3-website/website/index.html.ejs +8 -0
- package/dist/commands/create/generator-octo-app-template/generators/app/templates/tsconfig.build.json.ejs +11 -0
- package/dist/commands/create/generator-octo-app-template/generators/app/templates/tsconfig.json.ejs +39 -0
- package/dist/commands/create/index.d.ts +1 -0
- package/dist/commands/create/index.js +2 -0
- package/dist/commands/create/index.js.map +1 -0
- package/dist/index.js +13 -92
- package/dist/index.js.map +1 -1
- package/dist/utilities/process/process.utility.d.ts +1 -2
- package/dist/utilities/process/process.utility.js.map +1 -1
- package/package.json +15 -12
- package/dist/main.js.map +0 -1
- package/dist/models/build-configuration.interface.js.map +0 -1
- package/dist/models/run-arguments.interface.js.map +0 -1
- package/dist/parsers/build-file.parser.js.map +0 -1
- package/dist/streams/stream-manager.js.map +0 -1
- package/dist/{models → commands/build/models}/build-configuration.interface.d.ts +7 -7
- /package/dist/{models → commands/build/models}/build-configuration.interface.js +0 -0
- /package/dist/{models → commands/build/models}/run-arguments.interface.d.ts +0 -0
- /package/dist/{models → commands/build/models}/run-arguments.interface.js +0 -0
- /package/dist/{parsers → commands/build/parsers}/build-file.parser.js +0 -0
package/dist/commands/create/generator-octo-app-template/generators/app/templates/gitignore.ejs
ADDED
|
@@ -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/
|
package/dist/commands/create/generator-octo-app-template/generators/app/templates/package.json.ejs
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dependencies": {},
|
|
3
|
+
"description": "<%= description %>",
|
|
4
|
+
"devDependencies": {},
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=20.0.0"
|
|
7
|
+
},
|
|
8
|
+
"jest": {
|
|
9
|
+
"coverageDirectory": "./coverage",
|
|
10
|
+
"extensionsToTreatAsEsm": [
|
|
11
|
+
".ts"
|
|
12
|
+
],
|
|
13
|
+
"moduleFileExtensions": [
|
|
14
|
+
"js",
|
|
15
|
+
"json",
|
|
16
|
+
"ts"
|
|
17
|
+
],
|
|
18
|
+
"moduleNameMapper": {
|
|
19
|
+
"(.+)\\.js": "$1"
|
|
20
|
+
},
|
|
21
|
+
"preset": "ts-jest/presets/default-esm",
|
|
22
|
+
"rootDir": ".",
|
|
23
|
+
"testEnvironment": "node",
|
|
24
|
+
"testRegex": ".*spec\\.ts$",
|
|
25
|
+
"transform": {
|
|
26
|
+
"^.+\\.ts$": [
|
|
27
|
+
"ts-jest",
|
|
28
|
+
{
|
|
29
|
+
"useESM": true
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"keywords": [
|
|
35
|
+
"cdk",
|
|
36
|
+
"infrastructure",
|
|
37
|
+
"octo",
|
|
38
|
+
"typescript"
|
|
39
|
+
],
|
|
40
|
+
"main": "dist/main.js",
|
|
41
|
+
"name": "<%= name %>",
|
|
42
|
+
"private": true,
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "rimraf dist && tsc -p tsconfig.build.json",
|
|
45
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
46
|
+
"lint": "eslint .",
|
|
47
|
+
"start": "node dist/main.js",
|
|
48
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules jest --testRegex=\"\\.spec.ts$\"",
|
|
49
|
+
"test:e2e": "NODE_OPTIONS=--experimental-vm-modules jest --testRegex=\"\\.e2e-spec.ts$\""
|
|
50
|
+
},
|
|
51
|
+
"type": "module",
|
|
52
|
+
"types": "dist/main.d.ts",
|
|
53
|
+
"version": "<%= version %>"
|
|
54
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { dirname } from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
import env from 'env-smart';
|
|
4
|
+
|
|
5
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
|
|
7
|
+
env.load({
|
|
8
|
+
directory: __dirname,
|
|
9
|
+
envDefaultsFilename: '.env.defaults',
|
|
10
|
+
envFilename: '.env',
|
|
11
|
+
inlineTypes: false,
|
|
12
|
+
process: true,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
type Configuration = {
|
|
16
|
+
AWS_ACCOUNT_ID: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const config = env.config<Configuration>((env) => {
|
|
20
|
+
return {
|
|
21
|
+
AWS_ACCOUNT_ID: env.AWS_ACCOUNT_ID,
|
|
22
|
+
};
|
|
23
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { dirname, join } from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
import { type App, LocalStateProvider, Octo } from '@quadnix/octo';
|
|
4
|
+
import { EventLoggerListener } from '@quadnix/octo-event-listeners';
|
|
5
|
+
import { ModuleDefinitions } from './module-definitions.js';
|
|
6
|
+
|
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const octoStatePath = join(__dirname, '.octo');
|
|
9
|
+
|
|
10
|
+
const octo = new Octo();
|
|
11
|
+
const stateProvider = new LocalStateProvider(octoStatePath);
|
|
12
|
+
await octo.initialize(stateProvider, [{ type: EventLoggerListener }]);
|
|
13
|
+
|
|
14
|
+
const moduleDefinitions = new ModuleDefinitions();
|
|
15
|
+
for (const moduleDefinition of moduleDefinitions.getAll()) {
|
|
16
|
+
octo.loadModule(moduleDefinition.module, moduleDefinition.moduleId, moduleDefinition.moduleInputs);
|
|
17
|
+
}
|
|
18
|
+
octo.orderModules(moduleDefinitions.getAll().map((m) => m.module));
|
|
19
|
+
|
|
20
|
+
const { 'app-module.model.app': app } = (await octo.compose()) as { 'app-module.model.app': App };
|
|
21
|
+
const transaction = octo.beginTransaction(app);
|
|
22
|
+
await transaction.next();
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type AModule,
|
|
3
|
+
type Account,
|
|
4
|
+
type App,
|
|
5
|
+
type Constructable,
|
|
6
|
+
type Deployment,
|
|
7
|
+
type Environment,
|
|
8
|
+
Execution,
|
|
9
|
+
type ModuleSchemaInputs,
|
|
10
|
+
type Region,
|
|
11
|
+
type Server,
|
|
12
|
+
type Subnet,
|
|
13
|
+
SubnetType,
|
|
14
|
+
stub,
|
|
15
|
+
} from '@quadnix/octo';
|
|
16
|
+
import { AwsIniAccountModule } from '@quadnix/octo-aws-cdk/modules/account/aws-ini-account';
|
|
17
|
+
import { SimpleAppModule } from '@quadnix/octo-aws-cdk/modules/app/simple-app';
|
|
18
|
+
import { AwsEcsDeploymentModule } from '@quadnix/octo-aws-cdk/modules/deployment/aws-ecs-deployment';
|
|
19
|
+
import { AwsEcsEnvironmentModule } from '@quadnix/octo-aws-cdk/modules/environment/aws-ecs-environment';
|
|
20
|
+
import { AwsEcsExecutionModule } from '@quadnix/octo-aws-cdk/modules/execution/aws-ecs-execution';
|
|
21
|
+
import { AwsMultiAzRegionModule } from '@quadnix/octo-aws-cdk/modules/region/aws-multi-az-region';
|
|
22
|
+
import { AwsMultiAzRegionId } from '@quadnix/octo-aws-cdk/modules/region/aws-multi-az-region/schema';
|
|
23
|
+
import { AwsEcsServerModule } from '@quadnix/octo-aws-cdk/modules/server/aws-ecs-server';
|
|
24
|
+
import { AwsEcsAlbServiceModule } from '@quadnix/octo-aws-cdk/modules/service/aws-ecs-alb-service';
|
|
25
|
+
import { AwsSimpleSubnetModule } from '@quadnix/octo-aws-cdk/modules/subnet/aws-simple-subnet';
|
|
26
|
+
import { config } from './app.config.js';
|
|
27
|
+
|
|
28
|
+
type ModuleDefinition<T extends AModule<unknown, any>> = {
|
|
29
|
+
module: Constructable<T>;
|
|
30
|
+
moduleId: string;
|
|
31
|
+
moduleInputs: ModuleSchemaInputs<T>;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export class ModuleDefinitions {
|
|
35
|
+
private readonly moduleDefinitions: ModuleDefinition<AModule<unknown, any>>[] = [];
|
|
36
|
+
|
|
37
|
+
constructor() {
|
|
38
|
+
this.init();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
add<T extends AModule<unknown, any>>(
|
|
42
|
+
module: Constructable<T>,
|
|
43
|
+
moduleId: string,
|
|
44
|
+
moduleInputs: ModuleSchemaInputs<T>,
|
|
45
|
+
): void {
|
|
46
|
+
this.moduleDefinitions.push({ module, moduleId, moduleInputs });
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
getAll(): ModuleDefinitions['moduleDefinitions'] {
|
|
50
|
+
return this.moduleDefinitions;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
private init(): void {
|
|
54
|
+
this.add(SimpleAppModule, 'app-module', { name: 'aws-ecs-server' });
|
|
55
|
+
|
|
56
|
+
this.add(AwsIniAccountModule, 'account-module', {
|
|
57
|
+
accountId: config.AWS_ACCOUNT_ID,
|
|
58
|
+
app: stub<App>('${{app-module.model.app}}'),
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
this.add(AwsMultiAzRegionModule, 'region-module', {
|
|
62
|
+
account: stub<Account>('${{account-module.model.account}}'),
|
|
63
|
+
name: 'app-region-east',
|
|
64
|
+
regionIds: [AwsMultiAzRegionId.AWS_US_EAST_1A, AwsMultiAzRegionId.AWS_US_EAST_1B],
|
|
65
|
+
vpcCidrBlock: '10.0.0.0/16',
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
this.add(AwsEcsServerModule, 'backend-server-module', {
|
|
69
|
+
account: stub<Account>('${{account-module.model.account}}'),
|
|
70
|
+
serverKey: 'backend',
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
this.add(AwsEcsDeploymentModule, 'backend-deployment-v1-module', {
|
|
74
|
+
deploymentContainerProperties: {
|
|
75
|
+
cpu: 256,
|
|
76
|
+
image: {
|
|
77
|
+
command: 'node webserver',
|
|
78
|
+
ports: [{ containerPort: 80, protocol: 'tcp' }],
|
|
79
|
+
// eslint-disable-next-line spellcheck/spell-checker
|
|
80
|
+
uri: 'docker.io/ealen/echo-server:0.9.2',
|
|
81
|
+
},
|
|
82
|
+
memory: 512,
|
|
83
|
+
},
|
|
84
|
+
deploymentTag: 'v1',
|
|
85
|
+
server: stub<Server>('${{backend-server-module.model.server}}'),
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
this.add(AwsEcsEnvironmentModule, 'qa-environment-module', {
|
|
89
|
+
environmentName: 'qa',
|
|
90
|
+
environmentVariables: { NODE_ENV: 'qa' },
|
|
91
|
+
region: stub<Region>('${{region-module.model.region}}'),
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
this.add(AwsSimpleSubnetModule, 'public-subnet-module', {
|
|
95
|
+
region: stub<Region>('${{region-module.model.region}}'),
|
|
96
|
+
subnetAvailabilityZone: 'us-east-1a',
|
|
97
|
+
subnetCidrBlock: '10.0.0.0/24',
|
|
98
|
+
subnetName: 'public-subnet',
|
|
99
|
+
subnetOptions: {
|
|
100
|
+
createNatGateway: true,
|
|
101
|
+
disableSubnetIntraNetwork: false,
|
|
102
|
+
subnetType: SubnetType.PUBLIC,
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
this.add(AwsSimpleSubnetModule, 'public-backup-subnet-module', {
|
|
106
|
+
region: stub<Region>('${{region-module.model.region}}'),
|
|
107
|
+
subnetAvailabilityZone: 'us-east-1b',
|
|
108
|
+
subnetCidrBlock: '10.0.1.0/24',
|
|
109
|
+
subnetName: 'public-backup-subnet',
|
|
110
|
+
subnetOptions: {
|
|
111
|
+
createNatGateway: false,
|
|
112
|
+
disableSubnetIntraNetwork: false,
|
|
113
|
+
subnetType: SubnetType.PUBLIC,
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
this.add(AwsSimpleSubnetModule, 'private-subnet-module', {
|
|
117
|
+
region: stub<Region>('${{region-module.model.region}}'),
|
|
118
|
+
subnetAvailabilityZone: 'us-east-1a',
|
|
119
|
+
subnetCidrBlock: '10.0.2.0/24',
|
|
120
|
+
subnetName: 'private-subnet',
|
|
121
|
+
subnetOptions: {
|
|
122
|
+
createNatGateway: false,
|
|
123
|
+
disableSubnetIntraNetwork: true,
|
|
124
|
+
subnetType: SubnetType.PRIVATE,
|
|
125
|
+
},
|
|
126
|
+
subnetSiblings: [
|
|
127
|
+
{
|
|
128
|
+
attachToNatGateway: true,
|
|
129
|
+
subnet: stub<Subnet>('${{public-subnet-module.model.subnet}}'),
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
attachToNatGateway: false,
|
|
133
|
+
subnet: stub<Subnet>('${{public-backup-subnet-module.model.subnet}}'),
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
this.add(AwsEcsExecutionModule, 'backend-v1-qa-execution-module', {
|
|
139
|
+
deployments: {
|
|
140
|
+
main: {
|
|
141
|
+
containerProperties: {
|
|
142
|
+
image: {
|
|
143
|
+
essential: true,
|
|
144
|
+
name: 'backend-v1',
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
deployment: stub<Deployment>('${{backend-deployment-v1-module.model.deployment}}'),
|
|
148
|
+
},
|
|
149
|
+
sidecars: [],
|
|
150
|
+
},
|
|
151
|
+
desiredCount: 1,
|
|
152
|
+
environment: stub<Environment>('${{qa-environment-module.model.environment}}'),
|
|
153
|
+
executionId: 'backend-v1-qa-execution',
|
|
154
|
+
securityGroupRules: [
|
|
155
|
+
{
|
|
156
|
+
CidrBlock: '0.0.0.0/0',
|
|
157
|
+
Egress: false,
|
|
158
|
+
FromPort: 80,
|
|
159
|
+
IpProtocol: 'tcp',
|
|
160
|
+
ToPort: 80,
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
subnet: stub<Subnet>('${{private-subnet-module.model.subnet}}'),
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
this.add(AwsEcsAlbServiceModule, 'qa-api-alb-module', {
|
|
167
|
+
albName: 'qa-api-alb',
|
|
168
|
+
listeners: [
|
|
169
|
+
{
|
|
170
|
+
DefaultActions: [
|
|
171
|
+
{ action: { TargetGroups: [{ targetGroupName: 'backend-v1-80', Weight: 100 }] }, actionType: 'forward' },
|
|
172
|
+
],
|
|
173
|
+
Port: 80,
|
|
174
|
+
rules: [],
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
region: stub<Region>('${{region-module.model.region}}'),
|
|
178
|
+
subnets: [
|
|
179
|
+
stub<Subnet>('${{public-subnet-module.model.subnet}}'),
|
|
180
|
+
stub<Subnet>('${{public-backup-subnet-module.model.subnet}}'),
|
|
181
|
+
],
|
|
182
|
+
targets: [
|
|
183
|
+
{
|
|
184
|
+
containerName: 'backend-v1',
|
|
185
|
+
containerPort: 80,
|
|
186
|
+
execution: stub<Execution>('${{backend-v1-qa-execution-module.model.execution}}'),
|
|
187
|
+
healthCheck: {
|
|
188
|
+
HealthCheckIntervalSeconds: 30,
|
|
189
|
+
HealthCheckPath: '/',
|
|
190
|
+
HealthCheckPort: 80,
|
|
191
|
+
HealthCheckProtocol: 'HTTP',
|
|
192
|
+
HealthCheckTimeoutSeconds: 5,
|
|
193
|
+
HealthyThresholdCount: 2,
|
|
194
|
+
Matcher: { HttpCode: 200 },
|
|
195
|
+
UnhealthyThresholdCount: 2,
|
|
196
|
+
},
|
|
197
|
+
Name: 'backend-v1-80',
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { dirname } from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
import env from 'env-smart';
|
|
4
|
+
|
|
5
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
|
|
7
|
+
env.load({
|
|
8
|
+
directory: __dirname,
|
|
9
|
+
envDefaultsFilename: '.env.defaults',
|
|
10
|
+
envFilename: '.env',
|
|
11
|
+
inlineTypes: false,
|
|
12
|
+
process: true,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
type Configuration = {
|
|
16
|
+
AWS_ACCOUNT_ID: string;
|
|
17
|
+
AWS_S3_WEBSITE_BUCKET_NAME: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const config = env.config<Configuration>((env) => {
|
|
21
|
+
return {
|
|
22
|
+
AWS_ACCOUNT_ID: env.AWS_ACCOUNT_ID,
|
|
23
|
+
AWS_S3_WEBSITE_BUCKET_NAME: env.AWS_S3_WEBSITE_BUCKET_NAME,
|
|
24
|
+
};
|
|
25
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { dirname, join } from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
import { type App, LocalStateProvider, Octo } from '@quadnix/octo';
|
|
4
|
+
import { EventLoggerListener } from '@quadnix/octo-event-listeners';
|
|
5
|
+
import { ModuleDefinitions } from './module-definitions.js';
|
|
6
|
+
|
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const octoStatePath = join(__dirname, '.octo');
|
|
9
|
+
|
|
10
|
+
const octo = new Octo();
|
|
11
|
+
const stateProvider = new LocalStateProvider(octoStatePath);
|
|
12
|
+
await octo.initialize(stateProvider, [{ type: EventLoggerListener }]);
|
|
13
|
+
|
|
14
|
+
const moduleDefinitions = new ModuleDefinitions();
|
|
15
|
+
for (const moduleDefinition of moduleDefinitions.getAll()) {
|
|
16
|
+
octo.loadModule(moduleDefinition.module, moduleDefinition.moduleId, moduleDefinition.moduleInputs);
|
|
17
|
+
}
|
|
18
|
+
octo.orderModules(moduleDefinitions.getAll().map((m) => m.module));
|
|
19
|
+
|
|
20
|
+
const { 'app-module.model.app': app } = (await octo.compose()) as { 'app-module.model.app': App };
|
|
21
|
+
const transaction = octo.beginTransaction(app);
|
|
22
|
+
await transaction.next();
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { dirname, join } from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
import { type AModule, type Account, type App, type Constructable, type ModuleSchemaInputs, stub } from '@quadnix/octo';
|
|
4
|
+
import { AwsIniAccountModule } from '@quadnix/octo-aws-cdk/modules/account/aws-ini-account';
|
|
5
|
+
import { SimpleAppModule } from '@quadnix/octo-aws-cdk/modules/app/simple-app';
|
|
6
|
+
import { AwsS3StaticWebsiteServiceModule } from '@quadnix/octo-aws-cdk/modules/service/aws-s3-static-website-service';
|
|
7
|
+
import { config } from './app.config.js';
|
|
8
|
+
|
|
9
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const websiteSourcePath = join(__dirname, 'website');
|
|
11
|
+
|
|
12
|
+
type ModuleDefinition<T extends AModule<unknown, any>> = {
|
|
13
|
+
module: Constructable<T>;
|
|
14
|
+
moduleId: string;
|
|
15
|
+
moduleInputs: ModuleSchemaInputs<T>;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export class ModuleDefinitions {
|
|
19
|
+
private readonly moduleDefinitions: ModuleDefinition<AModule<unknown, any>>[] = [];
|
|
20
|
+
|
|
21
|
+
constructor() {
|
|
22
|
+
this.init();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
add<T extends AModule<unknown, any>>(
|
|
26
|
+
module: Constructable<T>,
|
|
27
|
+
moduleId: string,
|
|
28
|
+
moduleInputs: ModuleSchemaInputs<T>,
|
|
29
|
+
): void {
|
|
30
|
+
this.moduleDefinitions.push({ module, moduleId, moduleInputs });
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
getAll(): ModuleDefinitions['moduleDefinitions'] {
|
|
34
|
+
return this.moduleDefinitions;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
private init(): void {
|
|
38
|
+
this.add(SimpleAppModule, 'app-module', { name: 'aws-s3-website' });
|
|
39
|
+
|
|
40
|
+
this.add(AwsIniAccountModule, 'account-module', {
|
|
41
|
+
accountId: config.AWS_ACCOUNT_ID,
|
|
42
|
+
app: stub<App>('${{app-module.model.app}}'),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
this.add(AwsS3StaticWebsiteServiceModule, 's3-website-service-module', {
|
|
46
|
+
account: stub<Account>('${{account-module.model.account}}'),
|
|
47
|
+
awsRegionId: 'us-east-1',
|
|
48
|
+
bucketName: config.AWS_S3_WEBSITE_BUCKET_NAME,
|
|
49
|
+
directoryPath: websiteSourcePath,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
File without changes
|
package/dist/commands/create/generator-octo-app-template/generators/app/templates/tsconfig.json.ejs
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowSyntheticDefaultImports": true,
|
|
4
|
+
"baseUrl": "./",
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"emitDecoratorMetadata": true,
|
|
7
|
+
"experimentalDecorators": true,
|
|
8
|
+
"forceConsistentCasingInFileNames": true,
|
|
9
|
+
"incremental": true,
|
|
10
|
+
"isolatedModules": true,
|
|
11
|
+
"module": "Node16",
|
|
12
|
+
"moduleResolution": "Node16",
|
|
13
|
+
"noFallthroughCasesInSwitch": true,
|
|
14
|
+
"noImplicitAny": false,
|
|
15
|
+
"noImplicitOverride": true,
|
|
16
|
+
"outDir": "./dist",
|
|
17
|
+
"removeComments": false,
|
|
18
|
+
"skipLibCheck": true,
|
|
19
|
+
"sourceMap": true,
|
|
20
|
+
"strictBindCallApply": true,
|
|
21
|
+
"strictNullChecks": true,
|
|
22
|
+
"target": "ES2022",
|
|
23
|
+
"typeRoots": [
|
|
24
|
+
"node_modules/@types"
|
|
25
|
+
],
|
|
26
|
+
"useDefineForClassFields": false,
|
|
27
|
+
"verbatimModuleSyntax": true
|
|
28
|
+
},
|
|
29
|
+
"exclude": [
|
|
30
|
+
"coverage",
|
|
31
|
+
"dist",
|
|
32
|
+
"node_modules"
|
|
33
|
+
],
|
|
34
|
+
"include": [
|
|
35
|
+
"eslint.config.js",
|
|
36
|
+
"**/*.json",
|
|
37
|
+
"**/*.ts"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createCommand } from './create.command.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/create/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|