@codedazur/cdk-docker-cluster 1.1.0 → 1.1.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @codedazur/cdk-docker-cluster
2
2
 
3
+ ## 1.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b24894a`](https://github.com/codedazur/toolkit/commit/b24894a2de01e596669c2b5aca51bc0b28533106) Thanks [@thijsdaniels](https://github.com/thijsdaniels)! - Mark the package as side-effect-free for tree shaking.
8
+
9
+ - Updated dependencies [[`b24894a`](https://github.com/codedazur/toolkit/commit/b24894a2de01e596669c2b5aca51bc0b28533106)]:
10
+ - @codedazur/cdk-site-distribution@1.0.1
11
+
3
12
  ## 1.1.0
4
13
 
5
14
  ### Minor Changes
package/dist/index.js CHANGED
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
20
  // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
23
  DockerCluster: () => DockerCluster
24
24
  });
25
- module.exports = __toCommonJS(src_exports);
25
+ module.exports = __toCommonJS(index_exports);
26
26
 
27
27
  // src/constructs/DockerCluster.ts
28
28
  var import_cdk_site_distribution = require("@codedazur/cdk-site-distribution");
@@ -60,18 +60,17 @@ var DockerCluster = class extends import_constructs.Construct {
60
60
  });
61
61
  }
62
62
  createService() {
63
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
64
- const desiredTasks = typeof ((_a = this.props.service) == null ? void 0 : _a.tasks) === "number" ? (_b = this.props.service) == null ? void 0 : _b.tasks : (_d = (_c = this.props.service) == null ? void 0 : _c.tasks) == null ? void 0 : _d.minimum;
63
+ const desiredTasks = typeof this.props.service?.tasks === "number" ? this.props.service?.tasks : this.props.service?.tasks?.minimum;
65
64
  const service = new import_aws_ecs_patterns.ApplicationLoadBalancedFargateService(this, "Service", {
66
65
  cluster: new import_aws_ecs.Cluster(this, "Cluster"),
67
- cpu: (_e = this.props.service) == null ? void 0 : _e.cpu,
68
- memoryLimitMiB: (_f = this.props.service) == null ? void 0 : _f.memory,
66
+ cpu: this.props.service?.cpu,
67
+ memoryLimitMiB: this.props.service?.memory,
69
68
  desiredCount: desiredTasks,
70
69
  taskImageOptions: {
71
70
  image: this.image,
72
- containerPort: (_g = this.props.service) == null ? void 0 : _g.port,
73
- environment: (_h = this.props.service) == null ? void 0 : _h.environment,
74
- secrets: (_i = this.props.service) == null ? void 0 : _i.secrets
71
+ containerPort: this.props.service?.port,
72
+ environment: this.props.service?.environment,
73
+ secrets: this.props.service?.secrets
75
74
  },
76
75
  circuitBreaker: {
77
76
  enable: true,
@@ -81,23 +80,22 @@ var DockerCluster = class extends import_constructs.Construct {
81
80
  return service;
82
81
  }
83
82
  createAutoScaling(service) {
84
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
85
- if (typeof ((_a = this.props.service) == null ? void 0 : _a.tasks) !== "object") {
83
+ if (typeof this.props.service?.tasks !== "object") {
86
84
  return;
87
85
  }
88
86
  const autoScaling = service.service.autoScaleTaskCount({
89
- minCapacity: (_b = this.props.service) == null ? void 0 : _b.tasks.minimum,
90
- maxCapacity: (_c = this.props.service) == null ? void 0 : _c.tasks.maximum
87
+ minCapacity: this.props.service?.tasks.minimum,
88
+ maxCapacity: this.props.service?.tasks.maximum
91
89
  });
92
90
  autoScaling.scaleOnMemoryUtilization("MemoryScaling", {
93
- targetUtilizationPercent: (_f = (_e = (_d = this.props.service) == null ? void 0 : _d.tasks.threshold) == null ? void 0 : _e.memory) != null ? _f : 75,
94
- scaleInCooldown: (_h = (_g = this.props.service) == null ? void 0 : _g.tasks.cooldown) == null ? void 0 : _h.in,
95
- scaleOutCooldown: (_j = (_i = this.props.service) == null ? void 0 : _i.tasks.cooldown) == null ? void 0 : _j.out
91
+ targetUtilizationPercent: this.props.service?.tasks.threshold?.memory ?? 75,
92
+ scaleInCooldown: this.props.service?.tasks.cooldown?.in,
93
+ scaleOutCooldown: this.props.service?.tasks.cooldown?.out
96
94
  });
97
95
  autoScaling.scaleOnCpuUtilization("CpuScaling", {
98
- targetUtilizationPercent: (_m = (_l = (_k = this.props.service) == null ? void 0 : _k.tasks.threshold) == null ? void 0 : _l.cpu) != null ? _m : 75,
99
- scaleInCooldown: (_o = (_n = this.props.service) == null ? void 0 : _n.tasks.cooldown) == null ? void 0 : _o.in,
100
- scaleOutCooldown: (_q = (_p = this.props.service) == null ? void 0 : _p.tasks.cooldown) == null ? void 0 : _q.out
96
+ targetUtilizationPercent: this.props.service?.tasks.threshold?.cpu ?? 75,
97
+ scaleInCooldown: this.props.service?.tasks.cooldown?.in,
98
+ scaleOutCooldown: this.props.service?.tasks.cooldown?.out
101
99
  });
102
100
  return autoScaling;
103
101
  }
@@ -132,8 +130,7 @@ var DockerCluster = class extends import_constructs.Construct {
132
130
  });
133
131
  }
134
132
  getOutputDirectory() {
135
- var _a, _b;
136
- return (_b = (_a = import_aws_cdk_lib.App.of(this)) == null ? void 0 : _a.outdir) != null ? _b : "cdk.out";
133
+ return import_aws_cdk_lib.App.of(this)?.outdir ?? "cdk.out";
137
134
  }
138
135
  };
139
136
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.mjs CHANGED
@@ -44,18 +44,17 @@ var DockerCluster = class extends Construct {
44
44
  });
45
45
  }
46
46
  createService() {
47
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
48
- const desiredTasks = typeof ((_a = this.props.service) == null ? void 0 : _a.tasks) === "number" ? (_b = this.props.service) == null ? void 0 : _b.tasks : (_d = (_c = this.props.service) == null ? void 0 : _c.tasks) == null ? void 0 : _d.minimum;
47
+ const desiredTasks = typeof this.props.service?.tasks === "number" ? this.props.service?.tasks : this.props.service?.tasks?.minimum;
49
48
  const service = new ApplicationLoadBalancedFargateService(this, "Service", {
50
49
  cluster: new Cluster(this, "Cluster"),
51
- cpu: (_e = this.props.service) == null ? void 0 : _e.cpu,
52
- memoryLimitMiB: (_f = this.props.service) == null ? void 0 : _f.memory,
50
+ cpu: this.props.service?.cpu,
51
+ memoryLimitMiB: this.props.service?.memory,
53
52
  desiredCount: desiredTasks,
54
53
  taskImageOptions: {
55
54
  image: this.image,
56
- containerPort: (_g = this.props.service) == null ? void 0 : _g.port,
57
- environment: (_h = this.props.service) == null ? void 0 : _h.environment,
58
- secrets: (_i = this.props.service) == null ? void 0 : _i.secrets
55
+ containerPort: this.props.service?.port,
56
+ environment: this.props.service?.environment,
57
+ secrets: this.props.service?.secrets
59
58
  },
60
59
  circuitBreaker: {
61
60
  enable: true,
@@ -65,23 +64,22 @@ var DockerCluster = class extends Construct {
65
64
  return service;
66
65
  }
67
66
  createAutoScaling(service) {
68
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
69
- if (typeof ((_a = this.props.service) == null ? void 0 : _a.tasks) !== "object") {
67
+ if (typeof this.props.service?.tasks !== "object") {
70
68
  return;
71
69
  }
72
70
  const autoScaling = service.service.autoScaleTaskCount({
73
- minCapacity: (_b = this.props.service) == null ? void 0 : _b.tasks.minimum,
74
- maxCapacity: (_c = this.props.service) == null ? void 0 : _c.tasks.maximum
71
+ minCapacity: this.props.service?.tasks.minimum,
72
+ maxCapacity: this.props.service?.tasks.maximum
75
73
  });
76
74
  autoScaling.scaleOnMemoryUtilization("MemoryScaling", {
77
- targetUtilizationPercent: (_f = (_e = (_d = this.props.service) == null ? void 0 : _d.tasks.threshold) == null ? void 0 : _e.memory) != null ? _f : 75,
78
- scaleInCooldown: (_h = (_g = this.props.service) == null ? void 0 : _g.tasks.cooldown) == null ? void 0 : _h.in,
79
- scaleOutCooldown: (_j = (_i = this.props.service) == null ? void 0 : _i.tasks.cooldown) == null ? void 0 : _j.out
75
+ targetUtilizationPercent: this.props.service?.tasks.threshold?.memory ?? 75,
76
+ scaleInCooldown: this.props.service?.tasks.cooldown?.in,
77
+ scaleOutCooldown: this.props.service?.tasks.cooldown?.out
80
78
  });
81
79
  autoScaling.scaleOnCpuUtilization("CpuScaling", {
82
- targetUtilizationPercent: (_m = (_l = (_k = this.props.service) == null ? void 0 : _k.tasks.threshold) == null ? void 0 : _l.cpu) != null ? _m : 75,
83
- scaleInCooldown: (_o = (_n = this.props.service) == null ? void 0 : _n.tasks.cooldown) == null ? void 0 : _o.in,
84
- scaleOutCooldown: (_q = (_p = this.props.service) == null ? void 0 : _p.tasks.cooldown) == null ? void 0 : _q.out
80
+ targetUtilizationPercent: this.props.service?.tasks.threshold?.cpu ?? 75,
81
+ scaleInCooldown: this.props.service?.tasks.cooldown?.in,
82
+ scaleOutCooldown: this.props.service?.tasks.cooldown?.out
85
83
  });
86
84
  return autoScaling;
87
85
  }
@@ -116,8 +114,7 @@ var DockerCluster = class extends Construct {
116
114
  });
117
115
  }
118
116
  getOutputDirectory() {
119
- var _a, _b;
120
- return (_b = (_a = App.of(this)) == null ? void 0 : _a.outdir) != null ? _b : "cdk.out";
117
+ return App.of(this)?.outdir ?? "cdk.out";
121
118
  }
122
119
  };
123
120
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codedazur/cdk-docker-cluster",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "main": ".dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -14,6 +14,7 @@
14
14
  "access": "public"
15
15
  },
16
16
  "license": "MIT",
17
+ "sideEffects": false,
17
18
  "scripts": {
18
19
  "develop": "tsup src/index.ts --format esm,cjs --dts --watch",
19
20
  "build": "tsup src/index.ts --format esm,cjs --dts",
@@ -27,12 +28,12 @@
27
28
  "constructs": ">=10"
28
29
  },
29
30
  "dependencies": {
30
- "@codedazur/cdk-site-distribution": "^1.0.0"
31
+ "@codedazur/cdk-site-distribution": "^1.0.1"
31
32
  },
32
33
  "devDependencies": {
33
- "@types/node": "^20.14.10",
34
- "aws-cdk-lib": "^2.149.0",
35
- "constructs": "^10.3.0",
36
- "esbuild": "^0.23.0"
34
+ "@types/node": "^24.0.3",
35
+ "aws-cdk-lib": "^2.201.0",
36
+ "constructs": "^10.4.2",
37
+ "esbuild": "^0.25.5"
37
38
  }
38
39
  }