Releases: seek-oss/skuba
v6.0.2
v6.0.1
Patch Changes
-
lint: Avoid committing
.npmrc
changes (#1129)skuba lint
can automatically commit codegen changes if you have GitHub autofixes enabled on your project. Previously we made sure to exclude a new.npmrc
file from the commit, but we now exclude changes to an existing.npmrc
too.
v6.0.0
Major Changes
-
deps: Require Node.js 16.11+ (#1124)
Node.js 14 will reach end of life by April 2023.
Consider upgrading the Node.js version for your project across:
.nvmrc
package.json#/engines/node
- CI/CD configuration (
.buildkite/pipeline.yml
,Dockerfile
, etc.)
Minor Changes
-
format, lint: Prepend baseline SEEK
renovate-config
preset (#1117)skuba format
andskuba lint
will now automatically prepend an appropriate baseline preset if your project is configured with aSEEK-Jobs
orseekasia
remote:// SEEK-Jobs { - extends: ['seek'], + extends: ['local>seek-jobs/renovate-config', 'seek'], } // seekasia { - extends: ['seek'], + extends: ['local>seekasia/renovate-config', 'seek'], }
Renovate requires this new configuration to reliably access private SEEK packages. Adding the preset should fix recent issues where Renovate would open then autoclose pull requests, and report ⚠ Dependency Lookup Warnings ⚠.
See SEEK-Jobs/renovate-config and seekasia/renovate-config for more information.
-
format, lint, template/*-rest-api: Set
keepAliveTimeout
to 31 seconds to prevent HTTP 502s (#1111)The default Node.js server keep-alive timeout is set to 5 seconds. However, the Gantry default ALB idle timeout is 30 seconds. This would lead to the occasional issues where the sidecar would throw
proxyStatus=502
errors. AWS recommends setting an application timeout larger than the ALB idle timeout.skuba format
andskuba lint
will now automatically append a keep-alive timeout to a typicalsrc/listen.ts
:// With a listener callback const listener = app.listen(config.port, () => { const address = listener.address(); }) + + listener.keepAliveTimeout = 31000; // Without a listener callback - app.listen(config.port); + const listener = app.listen(config.port); + + listener.keepAliveTimeout = 31000;
A more detailed explanation can be found in the below links:
-
format, lint: Bundle
eslint-plugin-yml
(#1107)eslint-plugin-yml is now supported on
skuba format
andskuba lint
. While the default configuration should be unobtrusive, you can opt in to stricter rules in your.eslintrc.js
:module.exports = { extends: ['skuba'], + overrides: [ + { + files: ['my/strict/config.yaml'], + rules: { + 'yml/sort-keys': 'error', + }, + }, + ], };
YAML files with non-standard syntax may fail ESLint parsing with this change. Gantry resource files should be excluded by default due to their custom templating syntax, and you can list additional exclusions in your
.eslintignore
. -
start: Add Fastify support (#1101)
skuba start
can now be used to create a live-reloading server for Fastify based projects. See theskuba start
documentation for more information. -
format, lint: Configure ESLint for
{cjs,cts,mjs,mts}
files (#1126) -
lint: Commit codegen updates (#1078)
skuba lint
can locally codegen updates to ignore files, module exports and Renovate configuration. These changes are now automatically committed if you have GitHub autofixes enabled on your project. -
deps: TypeScript 5.0 (#1118)
This major release includes breaking changes. See the TypeScript 5.0 announcement for more information.
Patch Changes
-
init: Include baseline SEEK
renovate-config
preset (#1117) -
template/*-package: Require Node.js 16.11+ (#1124)
-
lint: Delete
Dockerfile-incunabulum
(#1078)skuba lint
may have accidentally committed this internal file to source control in prior versions. It is now automatically removed if you have GitHub autofixes enabled on your project.
v5.2.0-beta.1
Minor Changes
-
format, lint: Prepend baseline SEEK
renovate-config
preset (dbd4853)skuba format
andskuba lint
will now automatically prepend an appropriate baseline preset if your project is configured with aSEEK-Jobs
orseekasia
remote:// SEEK-Jobs { - extends: ['seek'], + extends: ['local>seek-jobs/renovate-config', 'seek'], } // seekasia { - extends: ['seek'], + extends: ['local>seekasia/renovate-config', 'seek'], }
Renovate requires this new configuration to reliably access private SEEK packages. Adding the preset should fix recent issues where Renovate would open then autoclose pull requests, and report ⚠ Dependency Lookup Warnings ⚠.
See SEEK-Jobs/renovate-config and seekasia/renovate-config for more information.
-
format, lint: Bundle
eslint-plugin-yml
(2cb3bf4)eslint-plugin-yml is now supported on
skuba format
andskuba lint
. While the default configuration should be unobtrusive, you can opt in to stricter rules in your.eslintrc.js
:module.exports = { extends: ['skuba'], + overrides: [ + { + files: ['my/strict/config.yaml'], + rules: { + 'yml/sort-keys': 'error', + }, + }, + ], };
YAML files with non-standard syntax may fail ESLint parsing with this change. Gantry resource files should be excluded by default due to their custom templating syntax, and you can list additional exclusions in your
.eslintignore
. -
run: Add Fastify support (b62e585)
skuba start
can now be used to create a live-reloading server for Fastify based projects. See https://seek-oss.github.io/skuba/docs/cli/run.html#skuba-start for more information.
Patch Changes
-
init: Include baseline SEEK
renovate-config
preset (dbd4853) -
template/*-rest-api: Set
keepAliveTimeout
to 31 seconds to prevent HTTP 502s (cab3636)The default Node.js server keep-alive timeout is set to 5 seconds. However, the Gantry default ALB idle timeout is 30 seconds. This would lead to the occasional issues where the sidecar would throw
proxyStatus=502
errors. AWS recommends setting an application timeout larger than the ALB idle timeout.A more detailed explanation can be found in the below links:
-
lint: Commit codegen updates (5eca770)
skuba lint
can locally codegen updates to ignore files and module exports. These changes are now automatically committed if you have GitHub autofixes enabled on your project. -
lint: Delete
Dockerfile-incunabulum
(5eca770)skuba lint
may have accidentally committed this internal file to source control in prior versions. It is now automatically removed if you have GitHub autofixes enabled on your project.
v5.2.0-beta.0
Minor Changes
-
format, lint: Bundle
eslint-plugin-yml
(2cb3bf4)eslint-plugin-yml is now supported on
skuba format
andskuba lint
. While the default configuration should be unobtrusive, you can opt in to stricter rules in your.eslintrc.js
:module.exports = { extends: ['skuba'], + overrides: [ + { + files: ['my/strict/config.yaml'], + rules: { + 'yml/sort-keys': 'error', + }, + }, + ], };
YAML files with non-standard syntax may fail ESLint parsing with this change. Gantry resource files should be excluded by default due to their custom templating syntax, and you can list additional exclusions in your
.eslintignore
. -
run: Add Fastify support (b62e585)
skuba start
can now be used to create a live-reloading server for Fastify based projects. See https://seek-oss.github.io/skuba/docs/cli/run.html#skuba-start for more information.
Patch Changes
-
lint: Commit codegen updates (5eca770)
skuba lint
can locally codegen updates to ignore files and module exports. These changes are now automatically committed if you have GitHub autofixes enabled on your project. -
lint: Delete
Dockerfile-incunabulum
(5eca770)skuba lint
may have accidentally committed this internal file to source control in prior versions. It is now automatically removed if you have GitHub autofixes enabled on your project.
v5.1.1
Patch Changes
-
lint: Exclude internal files from autofix commits (#1074)
skuba lint
now avoids committing the following internal files in a GitHub autofix:.npmrc
Dockerfile-incunabulum
v5.1.0
Minor Changes
-
deps: Prettier 2.8 (#1056)
See the release notes for more information.
-
deps: TypeScript 4.9 (#1046)
This major release includes breaking changes. See the TypeScript 4.9 announcement for more information.
Patch Changes
-
template/lambda-sqs-worker: Declare
dd-trace
dependency (#1051)This resolves a
Runtime.ImportModuleError
that occurs if this transitive dependency is not installed:Runtime.ImportModuleError Error: Cannot find module 'dd-trace'
Alternatively, you can configure the Datadog Serverless plugin to bundle these dependencies via Lambda layers:
serverless.yml custom: datadog: - addLayers: false + addLayers: true
package.json { "dependencies": { - "datadog-lambda-js: "x.y.z", - "dd-trace: "x.y.z" }, "devDependencies": { + "datadog-lambda-js: "x.y.z", + "dd-trace: "x.y.z" } }
-
template/lambda-sqs-worker*: Bump Node.js version to 18 (#1049)
This release contains some breaking changes to the Lambda runtime such as the removal of AWS SDK V2 in favour of AWS SDK V3. See the AWS Lambda Node.js 18.x runtime announcement for more information.
-
template: Prompt for target platform (
amd64
orarm64
) (#1041) -
template/lambda-sqs-worker*: Use single hyphen in
renovate-
branch name prefix (#1050) -
deps: esbuild ~0.16.0 (#1062)
-
template/*-rest-api: Replace
'{{.Environment}}'
with a customenvironment
Gantry value. (#1065) -
lint: Require package.json to be sorted (#1048)
v5.0.1
v5.0.0
Major Changes
-
test: Remove default
src
module alias (#987)Our Jest preset automatically registers your
tsconfig.json
paths as module aliases, but would previously fall back to thesrc
alias if the option was omitted or failed to load. This default has now been removed.This is not expected to affect most projects. If yours makes use of the
src
alias and its tests are now failing on imports like the following:import { app } from 'src/app.ts';
Ensure that you declare this path in a
tsconfig.json
located in your project root:{ "compilerOptions": { + "paths": { + "src": ["src"] + } }, "extends": "skuba/config/tsconfig.json" }
-
build, test: Default to isolated modules (#987)
Our Jest and TypeScript presets now enable
isolatedModules
by default. Your Jest tests should start quicker, consume less resources, and no longer get stuck on pesky type errors. This should not compromise the type safety of your project asskuba lint
is intended to type check all production and testing code.If your project contains files without imports and exports like
jest.setup.ts
, you can add an empty export statement to them to placate the TypeScript compiler:jest.setup.ts(1,1): error TS1208: 'jest.setup.ts' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module.
process.env.ENVIRONMENT = 'test'; + export {};
If you previously enabled
isolatedModules
via theglobals
option in your Jest config, this is no longer functional due to syntax changes in ts-jest 29. You should be able to rely on our default going forward.skuba configure
can attempt to clean up the stale option, or you can remove it from yourjest.config.ts
manually:export default Jest.mergePreset({ - globals: { - 'ts-jest': { - // seek-oss/skuba#626 - isolatedModules: true, - }, - }, // Rest of config });
Isolated modules are incompatible with certain language features like
const enum
s. We recommend migrating away from such features as they are not supported by the broader ecosystem, including transpilers like Babel and esbuild. If your project is not yet ready for isolated modules, you can override the default in yourtsconfig.json
:{ "compilerOptions": { + "isolatedModules": false }, "extends": "skuba/config/tsconfig.json" }
Minor Changes
-
format: Sort package.json (#1016)
-
build: Add experimental esbuild support (#681)
You can now build your project with esbuild. Note that this integration is still experimental, only includes the bare minimum to supplant a basic
tsc
-based build, and is not guaranteed to matchtsc
output. See the esbuild deep dive for more information.To opt in, modify your
package.json
:{ "skuba": { + "build": "esbuild", "template": null } }
Patch Changes
-
configure: Fix
tsconfig.json#/compilerOptions/lib
clobbering (#1031) -
template: Bump greeter and API templates to Node.js 18 (#1011)
Node.js 18 is now in active LTS. The Lambda templates are stuck on Node.js 16 until the new AWS Lambda runtime is released.
-
template/lambda-sqs-worker-cdk: Replace Runtypes with Zod as default schema validator (#984)
-
template/lambda-sqs-worker: Replace Runtypes with Zod as default schema validator (#984)
-
configure: Fix package version lookups (#974)
This resolves the following error:
Error: Package "xyz" does not have a valid package.json manifest
-
configure: Fix
jest.setup.js
clobbering (#1031) -
template/lambda-sqs-worker*: Adjust Buildkite pipelines for new
renovate--
branch name prefix (#1022)See the pull request that aligns our Renovate presets for more information.
-
template: Support AMD64 Docker builds via
BUILDPLATFORM
(#1021)See the Docker documentation for more information. Note that this does not allow you to build on AMD64 hardware then deploy to ARM64 hardware and vice versa. It is provided for convenience if you need to revert to an AMD64 workflow and/or build and run an image on local AMD64 hardware.
-
template/koa-rest-api: Replace Runtypes with Zod as default schema validator (#984)
v5.0.0-beta.0
Major Changes
-
test: Remove default
src
module alias (350ea31)Our Jest preset automatically registers your
tsconfig.json
paths as module aliases, but would previously fall back to thesrc
alias if the option was omitted or failed to load. This default has now been removed.This is not expected to affect most projects. If yours makes use of the
src
alias and its tests are now failing on imports like the following:import { app } from 'src/app.ts';
Ensure that you declare this path in a
tsconfig.json
located in your project root:{ "compilerOptions": { + "paths": { + "src": ["src"] + } }, "extends": "skuba/config/tsconfig.json" }
-
build, test: Default to isolated modules (350ea31)
Our Jest and TypeScript presets now enable
isolatedModules
by default. Your Jest tests should start quicker, consume less resources, and no longer get stuck on pesky type errors. This should not compromise the type safety of your project asskuba lint
is intended to type check all production and testing code.If your project contains files without imports and exports like
jest.setup.ts
, you can add an empty export statement to them to placate the TypeScript compiler:jest.setup.ts(1,1): error TS1208: 'jest.setup.ts' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module.
process.env.ENVIRONMENT = 'test'; + export {};
If you previously enabled
isolatedModules
via theglobals
option in your Jest config, this is no longer functional due to syntax changes in ts-jest 29. You should be able to rely on our default going forward.skuba configure
can attempt to clean up the stale option, or you can remove it from yourjest.config.ts
manually:export default Jest.mergePreset({ - globals: { - 'ts-jest': { - // seek-oss/skuba#626 - isolatedModules: true, - }, - }, // Rest of config });
Isolated modules are incompatible with certain language features like
const enum
s. We recommend migrating away from such features as they are not supported by the broader ecosystem, including transpilers like Babel and esbuild. If your project is not yet ready for isolated modules, you can override the default in yourtsconfig.json
:{ "compilerOptions": { + "isolatedModules": false }, "extends": "skuba/config/tsconfig.json" }
Minor Changes
-
build: Add experimental esbuild support (f693668)
You can now build your project with esbuild. Note that this integration is still experimental, only includes the bare minimum to supplant a basic
tsc
-based build, and is not guaranteed to matchtsc
output. See the esbuild deep dive for more information.To opt in, modify your
package.json
:{ "skuba": { + "build": "esbuild", "template": null } }
Patch Changes
-
template/lambda-sqs-worker-cdk: Replace Runtypes with Zod as default schema validator (1753391)
-
template/lambda-sqs-worker: Replace Runtypes with Zod as default schema validator (1753391)
-
configure: Fix package version lookups (680f6ec)
This resolves the following error:
Error: Package "xyz" does not have a valid package.json manifest
-
template/koa-rest-api: Replace Runtypes with Zod as default schema validator (1753391)