@mettlecast/domain-cdk-packer 0.2.77 → 0.2.79

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.
@@ -82,8 +82,12 @@ export class DomainStack extends cdk.Stack {
82
82
  })
83
83
  : undefined);
84
84
  const domainId = registry.domain.id;
85
- const projectId = props.projectId ?? this.stackName.split('-')[0] ?? 'tib';
86
- const envCode = props.envCode ?? this.stackName.split('-')[1] ?? 'dev';
85
+ const projectId = props.projectId ?? this.stackName.split('-')[0];
86
+ if (!projectId)
87
+ throw new Error('DomainStack requires projectId — pass it via packDomain options or ensure the stack name starts with the project prefix');
88
+ const envCode = props.envCode ?? this.stackName.split('-')[1];
89
+ if (!envCode)
90
+ throw new Error('DomainStack requires envCode — pass it via packDomain options or ensure the stack name includes the environment code');
87
91
  const resourceBaseName = domainResourceName(projectId, envCode, domainId);
88
92
  const allowedOrigins = corsAllowedOrigins ?? ['*'];
89
93
  this.httpApi = httpApi ?? new apigwv2.HttpApi(this, 'HttpApi', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mettlecast/domain-cdk-packer",
3
- "version": "0.2.77",
3
+ "version": "0.2.79",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org",