@kirschbaum-development/sst-laravel 0.3.7 → 0.3.8

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 ADDED
@@ -0,0 +1,43 @@
1
+ # Changelog
2
+
3
+ All notable changes to this package are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.3.8]
9
+
10
+ ### Fixed
11
+
12
+ - Forward the `cpu`, `memory`, `storage`, `architecture`, `logging`, `health`, and `executionRole` service arguments to the underlying `sst.aws.Service`. These were declared on `web`, `workers[]`, and `reverb` but never relayed, so setting them (e.g. `cpu`/`memory`) was silently a no-op and services ran on SST's defaults (0.25 vCPU / 0.5 GB) regardless of config.
13
+
14
+ ## [0.3.7]
15
+
16
+ ### Changed
17
+
18
+ - Enable additional PHP extensions on the worker Docker image.
19
+
20
+ ## [0.3.6]
21
+
22
+ ### Added
23
+
24
+ - `web.accessLogs` option to silence the web container's nginx access logs (including ALB health-check pings) by pointing `NGINX_ACCESS_LOG` at `/dev/null`, while leaving error and application logs intact.
25
+
26
+ ## [0.3.5]
27
+
28
+ ### Changed
29
+
30
+ - Redirect HTTP (port 80) traffic to HTTPS by default when a `web.domain` is configured. Set `web.httpsRedirect: false` to keep forwarding HTTP straight to the app.
31
+
32
+ ## [0.3.4]
33
+
34
+ ### Added
35
+
36
+ - `web.healthCheck` shortcut for configuring the load balancer health check on the default forward port without specifying the per-port key.
37
+
38
+ ## [0.3.3]
39
+
40
+ ### Added
41
+
42
+ - Laravel Reverb service support.
43
+ - Command runner.
package/laravel-sst.ts CHANGED
@@ -29,6 +29,7 @@ import { buildReverbEnvironmentVariables } from './src/reverb';
29
29
  import { getSecretsFingerprint } from './src/secrets-manager';
30
30
  import { buildDefaultPublicPorts, Port } from './src/load-balancer';
31
31
  import { buildWebServerEnvironment } from './src/web-server';
32
+ import { buildServiceArgs } from './src/service-args';
32
33
 
33
34
  // Re-export RemoteEnvVault for external use
34
35
  export { RemoteEnvVault, RemoteEnvVaultArgs };
@@ -503,6 +504,7 @@ export class LaravelService extends Component {
503
504
  cluster,
504
505
  link: getLinks(),
505
506
  permissions: args.permissions,
507
+ ...buildServiceArgs(args.web),
506
508
 
507
509
  /**
508
510
  * Image passed or use our default provided image.
@@ -642,6 +644,7 @@ export class LaravelService extends Component {
642
644
  cluster,
643
645
  link: getLinks(),
644
646
  permissions: args.permissions,
647
+ ...buildServiceArgs(workerConfig),
645
648
 
646
649
  image: getImage(ImageType.Worker, imgBuildArgs),
647
650
  scaling: workerConfig.scaling,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kirschbaum-development/sst-laravel",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "type": "module",
5
5
  "description": "An unofficial extension of SST to deploy containerized Laravel applications to AWS Fargate.",
6
6
  "main": "laravel-sst.ts",
@@ -21,6 +21,7 @@
21
21
  "images",
22
22
  "docs",
23
23
  "README.md",
24
+ "CHANGELOG.md",
24
25
  "Dockerfile.web",
25
26
  "Dockerfile.worker",
26
27
  ".dockerignore",
@@ -0,0 +1,41 @@
1
+ /**
2
+ * The subset of `sst.aws.Service` arguments that the Laravel component forwards
3
+ * verbatim from a `web`, `workers[]`, or `reverb` config block. These are pure
4
+ * passthroughs — the component does not transform them, it only relays them to
5
+ * the underlying service so options like `cpu`/`memory` actually take effect.
6
+ */
7
+ export const FORWARDED_SERVICE_ARG_KEYS = [
8
+ 'architecture',
9
+ 'cpu',
10
+ 'memory',
11
+ 'storage',
12
+ 'logging',
13
+ 'health',
14
+ 'executionRole',
15
+ ] as const;
16
+
17
+ export type ForwardedServiceArgKey = (typeof FORWARDED_SERVICE_ARG_KEYS)[number];
18
+
19
+ /**
20
+ * Picks the passthrough service arguments from a service config block so they
21
+ * can be spread into the `sst.aws.Service` args. Only keys that are actually
22
+ * set are returned, so spreading the result never overrides a service default
23
+ * with an explicit `undefined`.
24
+ */
25
+ export function buildServiceArgs<
26
+ T extends Partial<Record<ForwardedServiceArgKey, unknown>>,
27
+ >(config?: T): Pick<T, ForwardedServiceArgKey> {
28
+ const result = {} as Pick<T, ForwardedServiceArgKey>;
29
+
30
+ if (!config) {
31
+ return result;
32
+ }
33
+
34
+ for (const key of FORWARDED_SERVICE_ARG_KEYS) {
35
+ if (config[key] !== undefined) {
36
+ result[key] = config[key] as T[ForwardedServiceArgKey];
37
+ }
38
+ }
39
+
40
+ return result;
41
+ }