Skip to content

Commit

Permalink
Merge branch 'main' into koa-bodyparser
Browse files Browse the repository at this point in the history
  • Loading branch information
72636c committed Sep 29, 2024
2 parents 163bb4c + 3ee31b9 commit 522a7bb
Show file tree
Hide file tree
Showing 159 changed files with 7,235 additions and 6,558 deletions.
18 changes: 18 additions & 0 deletions .changeset/big-weeks-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'skuba': major
---

lint: Migrate to ESLint 9 and `@typescript-eslint` 8.

These changes may affect your project setup if customising your ESLint configuration. See the individual migration guides:

- https://eslint.org/docs/latest/use/migrate-to-9.0.0
- https://typescript-eslint.io/blog/announcing-typescript-eslint-v8

In addition, through these major upgrades, some lint rules have changed or have been renamed. You will likely need adjust your code after running ESLint.

Furthermore, `eslint-plugin-import` has been replaced with `eslint-plugin-import-x`. To migrate, any references to `eslint-plugin-import` should be replaced with `eslint-plugin-import-x`, and `import/` rules with `import-x/`.

As part of this migration, skuba has migrated to using Flat ESLint configuration. Read the migration: https://eslint.org/docs/latest/use/configure/migration-guide.

`skuba format` will attempt to migrate to flat configuration for you, where `.eslintignore` and `.eslintrc` are replaced by `eslint.config.js`.
14 changes: 9 additions & 5 deletions .changeset/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,17 @@ const gitHubChangelogFunctions = {

const replacedChangelog = changeset.summary
.replace(/^\s*(?:pr|pull|pull\s+request):\s*#?(\d+)/im, (_, pr) => {
let num = Number(pr);
if (!isNaN(num)) prFromSummary = num;
const num = Number(pr);
if (!isNaN(num)) {
prFromSummary = num;
}
return '';
})
.replace(/^\s*commit:\s*([^\s]+)/im, (_, commit) => {
commitFromSummary = commit;
return '';
})
.replace(/^\s*(?:author|user):\s*@?([^\s]+)/gim, (_, user) => {
usersFromSummary.push(user);
.replace(/^\s*(?:author|user):\s*@?([^\s]+)/gim, () => {
return '';
})
.trim();
Expand All @@ -87,6 +88,7 @@ const gitHubChangelogFunctions = {

const links = await (async () => {
if (prFromSummary !== undefined) {
// eslint-disable-next-line no-shadow
let { links } = await getInfoFromPullRequest({
repo: options.repo,
pull: prFromSummary,
Expand All @@ -101,7 +103,8 @@ const gitHubChangelogFunctions = {
}
const commitToFetchFrom = commitFromSummary || changeset.commit;
if (commitToFetchFrom) {
let { links } = await getInfo({
// eslint-disable-next-line no-shadow
const { links } = await getInfo({
repo: options.repo,
commit: commitToFetchFrom,
});
Expand All @@ -128,6 +131,7 @@ const gitHubChangelogFunctions = {
if (process.env.GITHUB_TOKEN) {
module.exports = gitHubChangelogFunctions;
} else {
// eslint-disable-next-line no-console
console.warn(
`Defaulting to Git-based versioning.
Enable GitHub-based versioning by setting the GITHUB_TOKEN environment variable.
Expand Down
17 changes: 17 additions & 0 deletions .changeset/dull-flowers-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
'skuba': minor
---

lint: Update Docker base images to point to AWS ECR Public and remove redundant `--platform` usage

This updates references to `node:` or `python:` Docker images in your `Dockerfile` and `docker-compose.yml` files to point to AWS ECR Public to avoid Docker Hub rate limiting, along with removing redundant `--platform` [usage](https://docs.docker.com/reference/build-checks/from-platform-flag-const-disallowed/).

eg.

```Dockerfile
## Before
FROM --platform=arm64 node:20-alpine AS dev-deps

## After
FROM public.ecr.aws/docker/library/node:20-alpine AS dev-deps
```
14 changes: 14 additions & 0 deletions .changeset/empty-cherries-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'skuba': major
---

node, start: Replace `ts-node` with `tsx`

`skuba start` and `skuba node` now use `tsx` instead of `ts-node` for running TypeScript files. `tsx` has better ESM interoperability, like support for dynamic imports (`await import()`), than `ts-node`.

There are some downsides for the REPL (which is what `skuba node` without any file is):

- `import` statements in the REPL are not supported; `require` and `await import()` are still supported.
- Pasting code into the REPL may not work as well as `ts-node`. If encountering issues, a workaround could be to use [`.editor`](https://nodejs.org/en/learn/command-line/how-to-use-the-nodejs-repl#dot-commands)

Otherwise, `skuba start` and `skuba node <file>` _should_ work as expected. However, it is difficult to comprehensively test every scenario, so this has been released as a major version. It is recommended to test your use-cases of `skuba start` and `skuba node` after upgrading.
5 changes: 0 additions & 5 deletions .changeset/funny-sloths-hang.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/heavy-scissors-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'skuba': patch
---

template/koa-rest-api: Enable secure headers middleware by default
5 changes: 5 additions & 0 deletions .changeset/hot-crews-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'skuba': minor
---

lint: Removes obsolete version field from docker-compose.yml files
5 changes: 5 additions & 0 deletions .changeset/hungry-keys-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'skuba': patch
---

template: Add required tags to `lambda-sqs-worker-cdk` template
1 change: 1 addition & 0 deletions .changeset/inject.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Hack to add a preamble from .changeset/.PREAMBLE.md to the CHANGELOG.md for a given release
/* eslint-disable no-sync */

const fs = require('fs');

Expand Down
5 changes: 5 additions & 0 deletions .changeset/quick-icons-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'skuba': patch
---

api: Truncate Buildkite annotations over 1 MiB to resolve `buildkite-agent` crash
5 changes: 5 additions & 0 deletions .changeset/renovate-0a25f92.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'skuba': patch
---

deps: validate-npm-package-name ^6.0.0
5 changes: 5 additions & 0 deletions .changeset/renovate-0e2e683.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'skuba': patch
---

deps: normalize-package-data ^7.0.0
7 changes: 7 additions & 0 deletions .changeset/renovate-457fabb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'skuba': minor
---

deps: TypeScript 5.6

This major release includes breaking changes. See the [TypeScript 5.6](https://devblogs.microsoft.com/typescript/announcing-typescript-5-6/) announcement for more information.
5 changes: 5 additions & 0 deletions .changeset/renovate-82aed23.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'skuba': patch
---

deps: esbuild ~0.24.0
5 changes: 5 additions & 0 deletions .changeset/renovate-f65cedc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'skuba': patch
---

deps: concurrently ^9.0.0
20 changes: 20 additions & 0 deletions .changeset/rich-chairs-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
'skuba': minor
---

lint: Replace `.buildkite/` files with duplicated YAML merge keys, for example:

```yaml
# Before
- <<: *deploy
<<: *docker
label: stuff

# After
- <<: [*deploy, *docker]
label: stuff
```
This should have no functional change, and is to support standardised YAML parsing across different tools, including the latest ESLint upgrades.
This migration will not be capture all cases of this (e.g. if there are keys between the merge keys). If you have other cases, update them following the example above.
5 changes: 5 additions & 0 deletions .changeset/shiny-parents-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'skuba': minor
---

template/lambda-sqs-worker-cdk: Replace custom hooks with `@seek/aws-codedeploy-infra`
5 changes: 5 additions & 0 deletions .changeset/small-meals-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'eslint-config-skuba': minor
---

Disable `@typescript-eslint/only-throw-error` in test files
9 changes: 9 additions & 0 deletions .changeset/strange-bats-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'skuba': minor
---

lint, format: Remove [logic](https://github.com/seek-oss/skuba/pull/1226/) which skips autofixing Renovate branches when there is no open pull request.

Previously, this was put in place to prevent an issue where a Renovate branch can get stuck in the `Edited/Blocked` state without a pull request being raised.

Skuba's default autofix commits are [now ignored by skuba's recommended renovate configuration](https://github.com/seek-oss/rynovate/pull/121).
16 changes: 16 additions & 0 deletions .changeset/thick-taxis-vanish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
'eslint-config-skuba': major
---

Migrate to ESLint 9, `@typescript-eslint` 8, `eslint-config-seek` 14.

These changes may affect your project setup if customising your ESLint configuration. See the individual migration guides:

- https://eslint.org/docs/latest/use/migrate-to-9.0.0
- https://typescript-eslint.io/blog/announcing-typescript-eslint-v8

Through these major upgrades, some lint rules have changed or have been renamed. You will likely need to adjust your code after running ESLint.

As part of this migration, this project has migrated to Flat ESLint configuration. Read the migration: https://eslint.org/docs/latest/use/configure/migration-guide.

Furthermore, `eslint-plugin-import` has been replaced with `eslint-plugin-import-x`. To migrate, any references to `eslint-plugin-import` should be replaced with `eslint-plugin-import-x`, and `import/` rules with `import-x/`.
5 changes: 5 additions & 0 deletions .changeset/twelve-bobcats-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'skuba': patch
---

template/\*: Update Docker base images to point to AWS ECR Public and remove redundant `--platform` usage
20 changes: 0 additions & 20 deletions .eslintignore

This file was deleted.

37 changes: 0 additions & 37 deletions .eslintrc.js

This file was deleted.

13 changes: 12 additions & 1 deletion .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@
prPriority: 99,
schedule: 'before 3:00 am every weekday',
},
{
matchDepTypes: ['devDependencies'],
matchManagers: ['npm'],
semanticCommitType: 'devDeps',
},
{
matchDepTypes: ['dependencies', 'peerDependencies'],
matchManagers: ['npm'],
semanticCommitType: 'deps',
},
{
matchPaths: ['template/**'],

Expand All @@ -102,13 +112,14 @@
],
branchPrefix: 'renovate-',
commitMessageAction: '',
gitIgnoredAuthors: ['[email protected]'],
postUpdateOptions: [],
prConcurrentLimit: 3,
prNotPendingHours: 1,
rangeStrategy: 'replace',
schedule: 'after 3:00 am and before 6:00 am every weekday',
semanticCommitScope: '',
semanticCommitType: 'deps',
semanticCommitType: 'update',
customManagers: [
{
customType: 'regex',
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
version: pnpm stage
env:
GITHUB_TOKEN: ${{ secrets.SEEK_OSS_CI_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.SEEK_OSS_CI_NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Deploy to GitHub Pages
run: pnpm run deploy
Expand Down
Loading

0 comments on commit 522a7bb

Please sign in to comment.