Releases: seek-oss/skuba
v7.0.1
Patch Changes
-
test: Fix Prettier snapshot formatting (#1220)
Jest is not yet compatible with Prettier 3, causing snapshot updates to fail with the following error:
TypeError: prettier.resolveConfig.sync is not a function at runPrettier (node_modules/jest-snapshot/build/InlineSnapshots.js:308:30)
Our Jest preset now implements custom formatting as a workaround until jestjs/jest#14305 is resolved.
If you do not use our preset, you can temporarily disable formatting in your
jest.config.ts
then manually runskuba format
after updating snapshots:export default { + prettierPath: null, }
v7.0.0
Major Changes
-
deps: tsconfig-seek 2 (#1175)
This change sets the
noUncheckedIndexedAccess
compiler option totrue
by default.This will flag possible issues with indexed access of arrays and records.
Before:
const a: string[] = []; const b = a[0]; // ^? const b: string
After:
const a: string[] = []; const b = a[0]; // ^? const b: string | undefined
Unfortunately, this change is a double edged sword as your previous code which may look like this may now be invalid.
if (list.length === 3) { const b = list[1]; // ^? const b: string | undefined }
To address this you will need to also explicitly check the index you are accessing.
if (list.length === 3 && list[1]) { const b = list[1]; // ^? const b: string }
This may seem like overkill, however, when you consider that Javascript will also allow this it may make sense
const a: string[] = []; a[1000] = 'foo'; console.log(a.length); // 1001
Similarly with accessing records:
const foo: Record<string, string> = {foo: 'bar'}; const func = (a: string) => { if (foo[a]) { const bar = foo[a] // ^? const bar: string | undefined } }
To address this you will need to pull
foo[a]
out into a variable as Typescript does not support type narrowing for indexed access one[k]
wherek
is not a literal.const foo: Record<string, string> = {foo: 'bar'}; const func = (a: string) => { const b = foo[a]; if (b) { const bar = b; // ^? const bar: string } }
You can override this setting in your project's
tsconfig.json
by setting it to false.{ "compilerOptions": { "noUncheckedIndexedAccess": false } }
-
deps: Require Node.js 18.12+ (#1206)
Node.js 16 will reach end of life by September 2023. We have aligned our version support with sku 12.
Consider upgrading the Node.js version for your project across:
.nvmrc
package.json#/engines/node
@types/node
package version- CI/CD configuration (
.buildkite/pipeline.yml
,Dockerfile
, etc.)
Minor Changes
-
deps: esbuild 0.18 (#1190)
skuba build
will continue to infertarget
fromtsconfig.json
at this time. See the esbuild release notes for other details. -
format, lint: Have Prettier respect
.gitignore
(#1217)This aligns with the behaviour of the Prettier 3.0 CLI.
-
deps: TypeScript 5.1 (#1183)
This major release includes breaking changes. See the TypeScript 5.1 announcement for more information.
-
deps: Prettier 3.0 (#1202)
See the release notes for more information.
Patch Changes
-
template: Require Node.js 18.12+ (#1206)
-
template/oss-npm-package: Set
publishConfig.provenance
totrue
(#1182)See https://github.blog/2023-04-19-introducing-npm-package-provenance/ for more information.
-
template/lambda-sqs-worker: Change some info logs to debug (#1178)
The "Function succeeded" log message was changed from
info
todebug
to reduce the amount of unnecessary logs in production. The message will still be logged in dev environments but at adebug
level. -
tsconfig: Turn off
noUnusedLocals
andnoUnusedParameters
(#1181)SEEK's ESLint config has a rule which works for both function and types. We do not need both tools to do the same thing and ESLint has better support for ignoring files if needed.
-
lint: Resolve Git root before attempting to autofix (#1215)
-
configure: Resolve Git root before attempting to patch Renovate config (#1215)
-
template/lambda-sqs-worker: Bump aws-sdk-client-mock to 3.0.0 (#1197)
AWS SDK v3.363.0 shipped with breaking type changes.
v6.2.0
Minor Changes
-
build, build-package: Add a skuba config key named
assets
to copy assets to the output directory. (#1163)In your
package.json
:{ "skuba": { + "assets": [ + "**/*.vocab/*translations.json" + ], "entryPoint": "src/index.ts", "type": "package", } }
This will instruct skuba to copy the files matching the list of globs to the output directory/ies, preserving the directory structure from the source:
- for
skuba build-package
it will copy them tolib-commonjs
andlib-es2015
- for
skuba build
it will copy them totsconfig.json#/compilerOptions.outDir
(lib
by default)
- for
Patch Changes
-
template: Include manifest files in CODEOWNERS (#1162)
Our templates previously excluded
package.json
andyarn.lock
from CODEOWNERS. This was intended to support advanced workflows such as auto-merging PRs and augmenting GitHub push notifications with custom tooling. However, we are reverting this configuration as it is more common for SEEKers to prefer a simpler CODEOWNERS-based workflow.This will not affect existing projects. If you create a new project and wish to restore the previous behaviour, you can manually extend
.github/CODEOWNERS
:* @<%- ownerName %> + # Configured by Renovate + package.json + yarn.lock
-
deps: Bump @octokit dependencies (#1174)
This should resolve the following compiler error:
error TS2339: Property 'annotations' does not exist on type '{}'.
-
deps: ts-jest ^29.1.0 (#1166)
This resolves the following
skuba test
warning:Version 5.0.2 of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=4.3.0 <5.0.0-0). Please do not report issues in ts-jest if you are using unsupported versions.
-
template/*-rest-api: Remove Gantry
ignoreAlarms
override (#1160)This issue has been resolved in Gantry v2.2.0; see its release notes for more information.
deployment: - # SEEK-Jobs/gantry#488 - ignoreAlarms: true
v6.1.0
Minor Changes
-
deps: eslint-config-skuba 2 (#1155)
This major upgrade removes eslint-plugin-react due to configuration issues experienced on non-React projects.
Raise a GitHub issue or send us a Slack message if this negatively affects your project.
-
start: Add
http.Server
support (#1159)skuba start
can now be used to create a live-reloading server forhttp.Server
instances. See theskuba start
documentation for more information. -
deps: eslint-config-seek 11 (#1155)
This major upgrade enforces consistent type imports and exports.
- import { Context } from 'aws-lambda'; + import type { Context } from 'aws-lambda';
skuba format
will modify your imports and exports to be consistent with linting rules. These changes are automatically committed if you have GitHub autofixes enabled on your project.
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