Skip to content

Commit

Permalink
Merge pull request #520 from Financial-Times/next
Browse files Browse the repository at this point in the history
Major release of Tool Kit
  • Loading branch information
apaleslimghost authored Sep 5, 2024
2 parents d6dda95 + 00a7d4f commit b52f287
Show file tree
Hide file tree
Showing 420 changed files with 11,495 additions and 10,069 deletions.
38 changes: 19 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ references:
- image: cimg/node:<< parameters.node-version >>
parameters:
node-version:
default: '20.10'
default: '20.12'
type: string

workspace_root: &workspace_root ~/project
Expand Down Expand Up @@ -184,21 +184,21 @@ workflows:
name: build-v<< matrix.node-version >>
matrix:
parameters:
node-version: [ '16.14', '18.16', '20.10' ]
node-version: [ '18.20', '20.12' ]
- test:
requires:
- build-v<< matrix.node-version >>
name: test-v<< matrix.node-version >>
matrix:
parameters:
node-version: [ '16.14', '18.16', '20.10' ]
node-version: [ '18.20', '20.12' ]
- lint:
requires:
- build-v<< matrix.node-version >>
name: lint-v<< matrix.node-version >>
matrix:
parameters:
node-version: [ '16.14', '18.16', '20.10' ]
node-version: [ '18.20', '20.12' ]

release-please:
when:
Expand Down Expand Up @@ -228,21 +228,21 @@ workflows:
name: build-v<< matrix.node-version >>
matrix:
parameters:
node-version: [ '16.14', '18.16', '20.10' ]
node-version: [ '18.20', '20.12' ]
- test:
requires:
- build-v<< matrix.node-version >>
name: test-v<< matrix.node-version >>
matrix:
parameters:
node-version: [ '16.14', '18.16', '20.10' ]
node-version: [ '18.20', '20.12' ]
- lint:
requires:
- build-v<< matrix.node-version >>
name: lint-v<< matrix.node-version >>
matrix:
parameters:
node-version: [ '16.14', '18.16', '20.10' ]
node-version: [ '18.20', '20.12' ]

build-test-publish:
when:
Expand All @@ -257,7 +257,7 @@ workflows:
name: build-v<< matrix.node-version >>
matrix:
parameters:
node-version: [ '16.14', '18.16', '20.10' ]
node-version: [ '18.20', '20.12' ]
- test:
filters:
<<: *filters_release_build
Expand All @@ -266,7 +266,7 @@ workflows:
name: test-v<< matrix.node-version >>
matrix:
parameters:
node-version: [ '16.14', '18.16', '20.10' ]
node-version: [ '18.20', '20.12' ]
- lint:
filters:
<<: *filters_release_build
Expand All @@ -275,14 +275,14 @@ workflows:
name: lint-v<< matrix.node-version >>
matrix:
parameters:
node-version: [ '16.14', '18.16', '20.10' ]
node-version: [ '18.20', '20.12' ]
- publish:
context: npm-publish-token
filters:
<<: *filters_release_build
requires:
- lint-v20.10
- test-v20.10
- lint-v20.12
- test-v20.12

build-test-prepublish:
when:
Expand All @@ -297,7 +297,7 @@ workflows:
name: build-v<< matrix.node-version >>
matrix:
parameters:
node-version: [ '16.14', '18.16', '20.10' ]
node-version: [ '18.20', '20.12' ]
- test:
filters:
<<: *filters_prerelease_build
Expand All @@ -306,7 +306,7 @@ workflows:
name: test-v<< matrix.node-version >>
matrix:
parameters:
node-version: [ '16.14', '18.16', '20.10' ]
node-version: [ '18.20', '20.12' ]
- lint:
filters:
<<: *filters_prerelease_build
Expand All @@ -315,14 +315,14 @@ workflows:
name: lint-v<< matrix.node-version >>
matrix:
parameters:
node-version: [ '16.14', '18.16', '20.10' ]
node-version: [ '18.20', '20.12' ]
- prepublish:
context: npm-publish-token
filters:
<<: *filters_prerelease_build
requires:
- lint-v20.10
- test-v20.10
- lint-v20.12
- test-v20.12

nightly:
when:
Expand All @@ -339,15 +339,15 @@ workflows:
name: build-v<< matrix.node-version >>
matrix:
parameters:
node-version: [ '16.14', '18.16', '20.10' ]
node-version: [ '18.20', '20.12' ]
- test:
requires:
- build-v<< matrix.node-version >>
context: next-nightly-build
name: test-v<< matrix.node-version >>
matrix:
parameters:
node-version: [ '16.14', '18.16', '20.10' ]
node-version: [ '18.20', '20.12' ]

# Prior to producing a development orb (which requires credentials) basic validation, linting, and even unit testing can be performed.
# This workflow will run on every commit
Expand Down
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ module.exports = {
rules: {
// We use winston's logging instead
'no-console': 'error',
// conflicts with @typescript-eslint/no-unused-vars
'no-unused-vars': 'off',
// Necessary to allow us to define arguments in a method that only subclasses use
// https://github.com/typescript-eslint/typescript-eslint/issues/586#issuecomment-510099609
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }]
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
// Prettier sometimes like inserting semis
'@typescript-eslint/no-extra-semi': 'off'
},
overrides: [
{
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"lib/error": "3.2.0",
"lib/logger": "3.4.1",
"lib/options": "3.2.1",
"lib/package-json-hook": "4.2.0",
"plugins/package-json-hook": "4.2.0",
"lib/state": "3.3.0",
"lib/types": "3.6.1",
"lib/vault": "3.2.1",
Expand Down
15 changes: 15 additions & 0 deletions contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Contributing

Tool Kit is organised as a monorepo with all the different plugins and libraries stored in a single repository. This allows us to quickly investigate and make changes across the whole codebase, as well as making installation easier by sharing dependencies. See the [developer documentation](./docs/developing-tool-kit.md) for a full explanation of the internal architecture of Tool Kit.

Release versions are not kept in sync between the packages, as we do not want to have to a major version bump for every package whenever we release a breaking change for a single package.

We use [release-please](https://github.com/googleapis/release-please) to manage releases and versioning. Every time we make a merge to main, release-please checks which packages have been changed, and creates a PR to make new releases for them. It uses the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard to determine whether updates require a patch, minor, or major version bump, and we use [commitlint](https://commitlint.js.org) to enforce the standard in all of our commits.

This means you should make an effort to think carefully about whether the changes you're making are a new feature or bug fix, and whether they contain any breaking changes. This might seem burdensome at first but it's good practice to make sure you can predict whether other teams' builds are going to break because of your code changes! If your commit will only affect a single package then please also include the name of the package (without the `@dotcom-tool-kit` namespace) in the scope of your commit message, as this makes it easier to see where changes are being made just by a quick glance at the git log. For example, a commit message for a new feature for the `circleci` plugin might look like:

```
feat(circleci): add support for nightly workflows
```

Note that new plugins should be created with a version number of `0.1.0`. This indicates that the package is still in the early stages of development and could be subject to many breaking changes before it's stabilised. Committing breaking changes whilst your package is `<1.0.0` are treated as minor bumps (`0.2.0`) and both new features and bug fixes as patch bumps (`0.1.1`.) When you're ready, you can release a 1.0 of your plugin by including `Release-As: 1.0.0` in the body of the release commit.
12 changes: 11 additions & 1 deletion core/cli/bin/run
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
#!/usr/bin/env node

/* eslint-disable @typescript-eslint/no-var-requires --
* this is raw CJS so the lint doesn't apply
*/

const argv = require('minimist')(process.argv.slice(2), {
boolean: ['help', 'install', 'listPlugins'],
'--': true
})

const { runTasks, showHelp, installHooks, listPlugins } = require('../lib')
const { rootLogger, styles } = require('@dotcom-tool-kit/logger')

async function main() {
try {
if (argv.install) {
const installHooks = require('../lib/install').default
await installHooks(rootLogger)
} else if (argv.listPlugins) {
const { listPlugins } = require('../lib')
await listPlugins(rootLogger)
} else if (argv.printConfig) {
const { printConfig } = require('../lib')
await printConfig(rootLogger)
} else if (argv.help || argv._.length === 0) {
const showHelp = require('../lib/help').default
await showHelp(rootLogger, argv._)
} else {
const { runTasks } = require('../lib')
if (argv['--'].length > 0) {
// The `--` in a command such as `dotcom-tool-kit test:staged --`
// delineates between hooks and file patterns. For example, when the
Expand Down
13 changes: 11 additions & 2 deletions core/cli/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
const base = require('../../jest.config.base')
const path = require('path')

module.exports = {
...base,
globals: { 'ts-jest': { tsconfig: { resolveJsonModule: true } } }
...base.config,
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
...base.tsJestConfig,
tsconfig: path.resolve(__dirname, './tsconfig.test.json')
}
]
}
}
29 changes: 11 additions & 18 deletions core/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,41 +20,34 @@
"test": "cd ../../ ; npx jest --silent --projects core/cli"
},
"devDependencies": {
"@dotcom-tool-kit/babel": "^3.2.1",
"@dotcom-tool-kit/backend-heroku-app": "^3.1.6",
"@dotcom-tool-kit/circleci": "^6.0.3",
"@dotcom-tool-kit/circleci-deploy": "^3.4.5",
"@dotcom-tool-kit/eslint": "^3.2.2",
"@dotcom-tool-kit/frontend-app": "^3.2.6",
"@dotcom-tool-kit/heroku": "^3.4.2",
"@dotcom-tool-kit/mocha": "^3.2.1",
"@dotcom-tool-kit/n-test": "^3.3.2",
"@dotcom-tool-kit/npm": "^3.3.2",
"@dotcom-tool-kit/webpack": "^3.2.1",
"@jest/globals": "^27.4.6",
"@types/lodash": "^4.14.185",
"@types/node": "^16.18.23",
"chai": "^4.3.4",
"globby": "^10.0.2",
"ts-node": "^8.10.2",
"winston": "^3.5.1"
"winston": "^3.5.1",
"zod": "^3.22.4"
},
"dependencies": {
"@dotcom-tool-kit/base": "^3.4.1",
"@dotcom-tool-kit/config": "^1.0.0",
"@dotcom-tool-kit/conflict": "^1.0.0",
"@dotcom-tool-kit/error": "^3.2.0",
"@dotcom-tool-kit/logger": "^3.4.1",
"@dotcom-tool-kit/options": "^3.2.1",
"@dotcom-tool-kit/types": "^3.6.1",
"@dotcom-tool-kit/plugin": "^1.0.0",
"@dotcom-tool-kit/validated": "^1.0.0",
"@dotcom-tool-kit/wait-for-ok": "^3.2.0",
"cosmiconfig": "^7.0.0",
"endent": "^2.1.0",
"lodash": "^4.17.21",
"minimist": "^1.2.5",
"resolve-from": "^5.0.0",
"tslib": "^2.3.1",
"yaml": "^1.10.2",
"zod-validation-error": "^0.3.0"
"yaml": "^2.4.1",
"zod-validation-error": "^2.1.0"
},
"engines": {
"node": "16.x || 18.x || 20.x",
"node": "18.x || 20.x",
"npm": "7.x || 8.x || 9.x || 10.x"
},
"files": [
Expand Down
Loading

0 comments on commit b52f287

Please sign in to comment.