Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPP-2161 proof of concept parallel tasks #679

Draft
wants to merge 363 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
363 commits
Select commit Hold shift + click to select a range
27b5783
fix: remove conflicts from task options in valid config type
apaleslimghost Apr 8, 2024
2b0ccad
fix: throw if there are task option conflicts
apaleslimghost Apr 9, 2024
2f0c2b6
feat!: load hook installations from options.hooks
apaleslimghost Apr 10, 2024
75ed6f4
feat: load hooks in toolkitrc as commands and warn about it
apaleslimghost Apr 10, 2024
8ae4f6a
docs: add todo comment to remove legacy handling in future major
apaleslimghost Apr 10, 2024
986bbf7
Merge pull request #615 from Financial-Times/slightly-more-backwards-…
apaleslimghost Apr 10, 2024
d34e2ad
Merge pull request #569 from Financial-Times/CPP-1852-task-vs-plugin-…
apaleslimghost Apr 10, 2024
34d28e6
feat: allow loading old-style options fields with a warning
apaleslimghost Apr 10, 2024
6015856
docs: add todo comment to remove legacy handling in future major
apaleslimghost Apr 10, 2024
adb5b66
Merge pull request #617 from Financial-Times/backwards-compatible-opt…
apaleslimghost Apr 10, 2024
3c98760
feat!: only load plugins if their toolkitrc version matches the curre…
apaleslimghost Apr 10, 2024
a49c1aa
chore: add versions to all plugin toolkitrcs
apaleslimghost Apr 10, 2024
b5b45b0
Merge pull request #616 from Financial-Times/even-more-backwards-comp…
apaleslimghost Apr 10, 2024
2017d0c
fix: remove check for undefined commands
apaleslimghost Apr 4, 2024
cf06843
chore: remove unused undefined command message
apaleslimghost Apr 4, 2024
5aa0abb
Merge pull request #612 from Financial-Times/apaleslimghost-patch-1
apaleslimghost Apr 10, 2024
cd92745
chore: remove duplicate runInit call in runTasks
apaleslimghost Apr 12, 2024
8100309
Merge pull request #620 from Financial-Times/apaleslimghost-patch-1
apaleslimghost Apr 12, 2024
edb6279
chore: drop use of Node 16 and update LTS versions to latest
joelcarr Apr 12, 2024
6b5d149
chore!: drop support for Node 16
joelcarr Apr 12, 2024
bad89e1
build: update create script to define latest node LTS versions
joelcarr Apr 12, 2024
b1f17a7
Merge pull request #621 from Financial-Times/CPP-1862-drop-node-16
joelcarr Apr 12, 2024
641e242
feat(circleci)!: define CircleCI configs in .toolkitrc.yml
ivomurrell Jan 19, 2024
37507f1
feat(circleci): allow projects to rewrite whole CircleCI config
ivomurrell Apr 12, 2024
c7bf887
build(circleci): make all the plugin's Tool Kit deps explicit
ivomurrell Apr 12, 2024
f25a00a
refactor(circleci): try to make new code more readable
ivomurrell Apr 15, 2024
3070459
Merge pull request #619 from Financial-Times/next-circleci
ivomurrell Apr 15, 2024
ce7d9c2
feat(circleci): don't generate matrices if only one Node version used
ivomurrell Apr 15, 2024
a1082b6
Merge pull request #623 from Financial-Times/blue-pill
ivomurrell Apr 16, 2024
f707366
feat!: move babel options to task options and allow configuring env
apaleslimghost Jan 15, 2024
d9a0d62
feat!: move eslint plugin options to task options
apaleslimghost Jan 15, 2024
29ed0f2
feat!: move jest options to task options and allow configuring env
apaleslimghost Apr 8, 2024
08b092b
feat!: move mocha options to task options
apaleslimghost Apr 8, 2024
224543f
chore: remove impossible-to-trigger node task entry option error
apaleslimghost Apr 8, 2024
38b3146
feat!: move node options to task options
apaleslimghost Apr 8, 2024
3cfa085
feat!: rename node useVault option to useDoppler
apaleslimghost Apr 8, 2024
3cc635c
feat!: move nodemon options to task options
apaleslimghost Apr 8, 2024
53a051f
feat!: rename nodemon useVault option to useDoppler
apaleslimghost Apr 8, 2024
d6ac04c
feat!: move pa11y options to task options
apaleslimghost Apr 8, 2024
945aa82
feat!: move prettier options to task options
apaleslimghost Apr 8, 2024
06f358e
feat!: remove prettier configOptions option
apaleslimghost Apr 8, 2024
55f8c4c
feat!: consolidate typescript tasks and move options to task options
apaleslimghost Apr 8, 2024
426d82f
feat!: remove typescript extraArgs option
apaleslimghost Apr 8, 2024
d733325
feat!: move upload-assets-to-s3 options to task options
Apr 8, 2024
9f85554
feat!: move webpack options to task options and allow configuring env
Apr 8, 2024
c74af9b
feat!: move n-test options to task options
Apr 8, 2024
8d65afd
refactor: remove redundant url key check for n-test appState.url
apaleslimghost Apr 8, 2024
8be42de
feat!: consolidate cypress tasks using similar logic to n-test for urls
apaleslimghost Apr 8, 2024
8324d5f
feat: add watch, noEmit and build options to typescript task
apaleslimghost Apr 8, 2024
e9d11ef
feat!: move cypress localUrl plugin option to a url task option and c…
apaleslimghost Apr 8, 2024
9653311
feat!: split heroku options into plugin-wide and heroku production ta…
apaleslimghost Apr 8, 2024
5d39489
feat!: rename serverless useVault option to useDoppler
apaleslimghost Apr 9, 2024
bf9fa13
feat!: remove serverless buildNumVariable in favour of populating it …
apaleslimghost Apr 9, 2024
ad60eee
chore!: remove unused legacy vault/doppler support from serverless de…
apaleslimghost Apr 9, 2024
61fbaae
feat!: move serverless run ports and useDoppler options to task options
apaleslimghost Apr 9, 2024
e9ce311
style: sort task schemas alphabetically
apaleslimghost Apr 9, 2024
9d532fa
feat: add configPath option for eslint task
apaleslimghost Apr 9, 2024
d9d6423
test(eslint): use a temp dir for eslint test files and get tests passing
apaleslimghost Apr 9, 2024
5594dca
test(babel): fix tests for new task constructor arg signature
apaleslimghost Apr 9, 2024
0716af2
test(eslint): use a temp dir for eslint test files and get tests passing
apaleslimghost Apr 9, 2024
dba63f7
test(webpack): fix tests for new task constructor arg signature and o…
apaleslimghost Apr 9, 2024
2a4cc6e
refactor: more appropriate type for typescript options
apaleslimghost Apr 9, 2024
47a5c97
test(typescript): update tests for new options
apaleslimghost Apr 9, 2024
f067721
feat!: change jest "mode" option to a boolean "ci" option
apaleslimghost Apr 9, 2024
039f81b
test(jest): update tests for new options
apaleslimghost Apr 9, 2024
a3ed567
test(upload-assets-to-s3): fix tests for new task arg sig
apaleslimghost Apr 9, 2024
c2e682b
test(mocha): new arg signature
apaleslimghost Apr 9, 2024
e6cb8b1
test(heroku): update tests for new options
apaleslimghost Apr 9, 2024
299a29a
test(prettier): update tests for new options
apaleslimghost Apr 9, 2024
508460f
test(cli): update tests for new task names
apaleslimghost Apr 9, 2024
59a9eb5
test(n-test): update for new options
apaleslimghost Apr 9, 2024
7644161
test(pa11y): update for new options
apaleslimghost Apr 9, 2024
9a147c3
test(upload-assets-to-s3): fix path to schema import
apaleslimghost Apr 10, 2024
afc8d54
feat: explicitly handle legacy plugin options
apaleslimghost Apr 10, 2024
5dd9ae4
refactor: correct name and description for Webpack task
apaleslimghost Apr 16, 2024
655df3b
refactor: use nullish coalescing instead of ternary for CYPRESS_BASE_URL
apaleslimghost Apr 16, 2024
3b01211
refactor: rename to ServerlessRunOptions for consistency
apaleslimghost Apr 16, 2024
c63d92a
chore: remove old TODO
apaleslimghost Apr 16, 2024
85cce73
build: move dependency only used by eslint tests to eslint package
apaleslimghost Apr 16, 2024
3063f3e
Merge pull request #570 from Financial-Times/CPP-1852-add-task-options
apaleslimghost Apr 16, 2024
bb091c8
feat: allow specifying command task options in a toolkitrc
apaleslimghost Apr 10, 2024
5a24e14
feat: merge in options from the command task when parsing task options
apaleslimghost Apr 11, 2024
37da4d5
refactor: use the existing OptionsForTask type for command tasks
apaleslimghost Apr 11, 2024
ce91645
test: fix tests looking for specific commandTasks structure
apaleslimghost Apr 11, 2024
5a8a6e2
Merge pull request #618 from Financial-Times/CPP-1834-command-task-op…
apaleslimghost Apr 16, 2024
c5b63af
feat: make ports optional in node and nodemon tasks
apaleslimghost Apr 12, 2024
c107b55
Merge pull request #622 from Financial-Times/optional-ports
apaleslimghost Apr 16, 2024
e0e9b05
feat: add support for a managesFiles entry in hook installs fields
apaleslimghost Apr 16, 2024
731e55d
feat: collect and store the hook-managed files in config
apaleslimghost Apr 16, 2024
1159be1
feat: read list of files to hash from config
apaleslimghost Apr 16, 2024
acf2e08
feat: add list of files that CircleCI and package.json hooks manage
apaleslimghost Apr 16, 2024
3ba179a
Merge pull request #625 from Financial-Times/hook-file-list
apaleslimghost Apr 16, 2024
e513389
feat: overhaul help output for new abstractions & config structure
apaleslimghost Apr 18, 2024
72f0d2e
feat: better group --help output
apaleslimghost Apr 18, 2024
5073668
feat: various help formatting and working tweaks idk
apaleslimghost Apr 22, 2024
3d70ae1
feat: better formatting for missing commands
apaleslimghost Apr 22, 2024
033af0b
fix: undefined commands logging
apaleslimghost Apr 22, 2024
7812f57
fix: remove stray unicode variant selector in error mark
apaleslimghost Apr 22, 2024
8217a73
refactor: use filter & map for formatCommandTasks
apaleslimghost Apr 22, 2024
9f03f9a
fix: explicitly set error etc mark forgrounds to black for better con…
apaleslimghost Apr 22, 2024
7ab1bb1
refactor: switch from fork to (an old version of) upstream boxen
apaleslimghost Apr 22, 2024
d08730a
fix: switch from upstream boxen to my fork
apaleslimghost Apr 22, 2024
08ec248
Merge pull request #627 from Financial-Times/you-know-i-need-someone
apaleslimghost Apr 23, 2024
2f658c4
feat(typescript): add support for typescript@5 as peer dependency
meel-io Apr 23, 2024
211c0b3
Merge pull request #628 from Financial-Times/typescript-five-support
meel-io Apr 23, 2024
058b0ee
feat(cli)!: drop cosmiconfig and load .toolkitrc.yml at plugin's root
ivomurrell Apr 19, 2024
e120891
fix(create): no longer need to clean cosmiconfig as we've dropped it
ivomurrell Apr 19, 2024
e8cd1b8
feat(cli): add support for tags in config that resolve based on options
ivomurrell Apr 19, 2024
b0585c3
feat(circleci-deploy): define Cypress and Serverless options with tags
ivomurrell Apr 18, 2024
78eed8e
feat(cli): gather all YAML tag errors into Validated before throwing
ivomurrell Apr 23, 2024
81224f4
Merge pull request #626 from Financial-Times/circleci-options-tags
ivomurrell Apr 25, 2024
4ad1221
fix(typescript): point config to correct module path for task
ivomurrell Apr 23, 2024
0fa0bd7
fix: bump TypeScript to fix import transpilation
ivomurrell Apr 24, 2024
458798f
test: bump jest and ts-jest to versions compatible with TypeScript 5
ivomurrell Apr 24, 2024
e722631
fix(cli): only override child options for hooks of the same class
ivomurrell Apr 25, 2024
f24ab9c
Merge pull request #631 from Financial-Times/next-bugs
ivomurrell Apr 26, 2024
4065b9a
build: proof of concept script to generate some markdown from zod schema
apaleslimghost Apr 23, 2024
d19bfe7
build: load a plugin's toolkitrc for list of hooks & tasks
apaleslimghost Apr 23, 2024
419f973
build: replace content between predefined comments in readmes
apaleslimghost Apr 23, 2024
5b3c379
build: improve generated markdown formatting
apaleslimghost Apr 23, 2024
cf675b6
docs(serverless): add descriptions for serverless schemas
apaleslimghost Apr 23, 2024
396d79f
build: use the autogenerated output for toplevel hooks and tasks headers
apaleslimghost Apr 23, 2024
49c69d8
build: run generate-docs on all plugins
apaleslimghost Apr 23, 2024
ebb71e3
docs(babel): add documentation for babel plugin
apaleslimghost Apr 23, 2024
77731ac
docs(circleci): add descriptions for circleci options
apaleslimghost Apr 23, 2024
75181c5
docs(cypress): add descriptions for cypress options
apaleslimghost Apr 23, 2024
eb2bc78
docs(eslint): add descriptions for eslint options
apaleslimghost Apr 23, 2024
9b17eb1
docs(jest): move option descriptions to schema
apaleslimghost Apr 23, 2024
588fcb6
docs(mocha): move option descriptions to schema
apaleslimghost Apr 23, 2024
6ce88fc
docs(n-test): move option descriptions to schema
apaleslimghost Apr 23, 2024
c2cb872
docs(next-router): autogenerated readme
apaleslimghost Apr 23, 2024
cff4ee3
docs(node): move node options description to schema
apaleslimghost Apr 23, 2024
76317c0
docs(nodemon): move options description to schema
apaleslimghost Apr 23, 2024
e4cf9f1
docs(pa11y): move docs to schema descriptinos
apaleslimghost Apr 23, 2024
261fc65
docs(package-json-hook): add readme
apaleslimghost Apr 23, 2024
1b61913
docs(prettier): autogenerate options docs
apaleslimghost Apr 24, 2024
60d8b74
docs(typescript): autogenerate options docs
apaleslimghost Apr 24, 2024
1eb0d6b
feat(upload-assets-to-s3)!: remove legacy environment variable handling
apaleslimghost Apr 24, 2024
39d3e43
docs(upload-assets-to-s3): autogenerate options documentation
apaleslimghost Apr 24, 2024
bebfed8
docs(webpack): autogenerate option docs
apaleslimghost Apr 24, 2024
2dbb88a
build: don't print an empty options schema
apaleslimghost Apr 25, 2024
1f2d5c5
docs(npm): autogenerate task docs
apaleslimghost Apr 25, 2024
8d0099a
docs(lint-staged): autogenerate task docs
apaleslimghost Apr 25, 2024
594ada4
build: remove final log from generate-docs
apaleslimghost Apr 25, 2024
e46b198
build: explicit support for hiding autogenerated docs in script
apaleslimghost Apr 25, 2024
b21c266
docs(heroku): autogenerate options docs
apaleslimghost Apr 25, 2024
1d112ed
build: regenerate package-lock.json based on next
apaleslimghost Apr 25, 2024
f60a21c
build: add pre-push hook to regenerate docs
apaleslimghost Apr 25, 2024
f0d7452
docs: minor change to test prepush hook
apaleslimghost Apr 25, 2024
84f7d0b
build: pass the glob for readmes through to git
apaleslimghost Apr 25, 2024
35b4f75
docs: automatically regenerate schema docs
apaleslimghost Apr 25, 2024
91afc2e
build: better error messaging and stash handling for docs script
apaleslimghost Apr 25, 2024
3313b9d
docs: automatically regenerate schema docs
apaleslimghost Apr 25, 2024
8ac70c9
build: fix escape codes in mac bash
apaleslimghost Apr 25, 2024
073ac2e
docs: automatically regenerate schema docs
apaleslimghost Apr 25, 2024
f40c125
build: fix escaping exclamation marks
apaleslimghost Apr 25, 2024
550df05
test(upload-assets-to-s3): fix environment and test new error behaviour
apaleslimghost Apr 25, 2024
7526aae
chore: remove extraneous dependency on my zod2md fork
apaleslimghost Apr 26, 2024
d5ad150
build: slightly cursed, but more precise, auto schema docs hiding
apaleslimghost Apr 26, 2024
ad5d276
build: make sure compiled typescript is up to date when generating do…
apaleslimghost Apr 26, 2024
c216b34
docs(serverless): document remaining tasks
apaleslimghost Apr 26, 2024
81629cc
chore: remove now-unused description field from task and hook
apaleslimghost Apr 26, 2024
aa2a27f
chore: regenerated package-lock.json again
apaleslimghost Apr 26, 2024
22a83f9
Merge pull request #629 from Financial-Times/schema-docs
apaleslimghost Apr 26, 2024
6462d72
ci: release prereleases from next branch
apaleslimghost Apr 26, 2024
7d31305
ci: set release-please target branch to next
apaleslimghost Apr 26, 2024
733a197
Merge pull request #633 from Financial-Times/next-release
apaleslimghost Apr 26, 2024
741dada
ci: run correct release please job on next
apaleslimghost Apr 26, 2024
7ebae60
Merge pull request #634 from Financial-Times/oops
apaleslimghost Apr 26, 2024
135d26f
chore: remove FAQ doc
apaleslimghost Apr 25, 2024
61e05e0
chore: remove migrating-to-tool-kit doc
apaleslimghost Apr 25, 2024
d3b49a2
docs: rework custom plugins doc into "extending tool kit" explaining …
apaleslimghost Apr 26, 2024
4c6f157
docs: add section on plugin loading to "developing tool kit"
apaleslimghost Apr 26, 2024
298bdbc
chore: rename "resolving hook conflicts" to "resolving plugin conflicts"
apaleslimghost Apr 26, 2024
d76dc39
docs: update resolving plugin conflicts
apaleslimghost Apr 29, 2024
8b26b18
docs: update and simplify main readme, moving more detailed things to…
apaleslimghost Apr 29, 2024
0d5eec0
docs: update concepts doc and diagrams
apaleslimghost Apr 29, 2024
52a29d0
docs: explain deduping in plugin loading/resolution
apaleslimghost Apr 29, 2024
7c5456d
Merge pull request #632 from Financial-Times/next-docs
apaleslimghost Apr 29, 2024
7d48e14
test(cli): disable unnecessary TS lint for JS file
ivomurrell Apr 29, 2024
0fb1f4a
fix(cli): print something when hook installations are conflicting
ivomurrell Apr 29, 2024
9d9274a
fix(cli): avoid hook installation conflicts between niblings
ivomurrell Apr 29, 2024
66767ec
feat(cli): allow key fields in YAML to be substituted by options too
ivomurrell Apr 29, 2024
493994b
fix(cli): allow default option values to be read by YAML tags
ivomurrell Apr 29, 2024
b506f23
feat(package-json-hook): allow full stops to be escaped so they aren'…
ivomurrell Apr 29, 2024
13369a9
feat(npm): add PackageJson hook options
ivomurrell Apr 29, 2024
5f0082d
feat(prettier): add PackageJson hook options
ivomurrell Apr 29, 2024
f319cda
feat(heroku): add PackageJson hook options
ivomurrell Apr 29, 2024
554996e
feat(husky-npm): add PackageJson hook options
ivomurrell Apr 29, 2024
e6e8f39
feat(lint-staged-npm): add PackageJson hook options
ivomurrell Apr 29, 2024
7963eeb
Merge pull request #637 from Financial-Times/package-json-hook-options
ivomurrell Apr 30, 2024
c06e060
feat(cypress): add PackageJson hook options
ivomurrell Apr 30, 2024
0ba7204
fix(prettier): correct hook option field in config
ivomurrell Apr 30, 2024
add8820
Merge pull request #639 from Financial-Times/package-json-hook-options
ivomurrell Apr 30, 2024
49d9733
fix: require package-json-hook plugin in plugins that use PackageJson…
apaleslimghost Apr 30, 2024
49889aa
Merge pull request #640 from Financial-Times/plugin-dependencies
apaleslimghost Apr 30, 2024
2a9a69a
fix: allow tasks with schemas not to have options provided in the config
apaleslimghost Apr 24, 2024
8ff18ca
Merge pull request #641 from Financial-Times/undefined-task-options
apaleslimghost Apr 30, 2024
b46b539
revert attempt to add prerelease support to release-please
ivomurrell Apr 30, 2024
93a1eda
chore: manually bump all packages to new premajor version
ivomurrell Apr 30, 2024
8bb897d
Merge pull request #642 from Financial-Times/next-prerelease
ivomurrell Apr 30, 2024
51b5f79
fix(cli): don't throw when command not declared
ivomurrell Apr 30, 2024
e45a956
fix(package-json-hook): fix isInstalled check so it handles split paths
ivomurrell Apr 30, 2024
0a5fd3a
Merge pull request #643 from Financial-Times/next-experimentation-api…
ivomurrell May 1, 2024
470aae0
chore: manually bump updated prerelease packages
ivomurrell May 1, 2024
6a5e97e
Merge pull request #644 from Financial-Times/next-prerelease
ivomurrell May 1, 2024
c1616e6
fix(package-json-hook): handle other kinds of command options
ivomurrell May 1, 2024
4db1c3b
build(cli): don't include Tool Kit plugins in devDependencies
ivomurrell May 1, 2024
a712687
Merge pull request #645 from Financial-Times/more-next-experiment-api…
ivomurrell May 1, 2024
9407467
chore: manually bump updated prerelease packages
ivomurrell May 1, 2024
9492747
Merge pull request #646 from Financial-Times/next-prerelease
ivomurrell May 1, 2024
8c3e20e
fix(cli): properly format Zod errors when parsing task options
ivomurrell May 2, 2024
ae6453b
fix(heroku): use correct casing for Heroku API response field
ivomurrell May 3, 2024
9303365
Merge pull request #647 from Financial-Times/next-heroku-prod-fix
ivomurrell May 10, 2024
73dffd6
chore: manually bump updated prerelease packages
ivomurrell May 10, 2024
79891af
Merge pull request #649 from Financial-Times/next-prerelease
ivomurrell May 14, 2024
5077487
fix(cli): store parsed options for Tasks, not Zod's parsing result
ivomurrell May 15, 2024
dd95da0
Merge pull request #650 from Financial-Times/fix-task-options
ivomurrell May 15, 2024
c40ae6c
chore: manually bump updated prerelease packages
ivomurrell May 15, 2024
c502c58
Merge pull request #651 from Financial-Times/next-prerelease
ivomurrell May 15, 2024
6336937
fix(cli): resolve custom plugins successfully
ivomurrell May 16, 2024
7d542dd
fix(cli): pass through task options when no schema found
ivomurrell May 16, 2024
593f51a
Merge pull request #652 from Financial-Times/fix-custom-plugins
ivomurrell May 17, 2024
08519ec
chore: manually bump updated prerelease packages
ivomurrell May 17, 2024
30a792d
Merge pull request #653 from Financial-Times/next-prerelease
ivomurrell May 17, 2024
1ebd75a
fix(logger): stop stripping newlines from hooked subprocess logging
ivomurrell May 20, 2024
1ab26ea
docs(logger): improve documentation of whitespace handling
ivomurrell May 20, 2024
7ea9f8a
fix(logger): don't trim 's' from the beginning and end of a line
ivomurrell May 21, 2024
1482c8a
Merge pull request #654 from Financial-Times/fix-subprocess-logging
ivomurrell May 22, 2024
9c90f05
fix(circleci): use correct name for jobs in a matrix
ivomurrell Jul 5, 2024
da503e0
Merge pull request #662 from Financial-Times/prefix-matrix-names
ivomurrell Jul 8, 2024
3e42f99
chore: manually bump updated prerelease packages
ivomurrell Jul 8, 2024
1114163
Merge pull request #663 from Financial-Times/next-prerelease
ivomurrell Jul 9, 2024
7c3c988
build: update and simplify create-plugin script
apaleslimghost Apr 24, 2024
4854f79
Merge pull request #675 from Financial-Times/create-plugin-fixes
apaleslimghost Jul 25, 2024
22c8855
fix: allow multiple instances of task with different options
apaleslimghost Jul 29, 2024
813f66c
Merge pull request #678 from Financial-Times/multiple-task-instances
apaleslimghost Jul 29, 2024
a1cba75
refactor!: pass task files in as part of a run context object
apaleslimghost Apr 24, 2024
789e594
test: update args for task.run calls that have destructuring
apaleslimghost Apr 24, 2024
a9b88bd
refactor: split out task running and config loading
apaleslimghost Apr 24, 2024
ef9a7e8
chore: scaffold parallel plugin
apaleslimghost Jul 25, 2024
e822bfa
feat: sketch out the parallel task
apaleslimghost Jul 25, 2024
870b584
refactor: pass config into task run context
apaleslimghost Jul 25, 2024
a8c34cf
refactor: rename runTasks to runCommands for clarity
apaleslimghost Jul 29, 2024
035017d
refactor: further split command and task running
apaleslimghost Jul 29, 2024
a127440
refactor: add plugin property to task class
apaleslimghost Jul 29, 2024
f1ddc38
feat(node)!: wait for child process to exit
apaleslimghost Jul 29, 2024
603f06e
feat: run specified tasks in parallel
apaleslimghost Jul 29, 2024
80e974e
feat: add a Task.stop method and stop parallel tasks on error
apaleslimghost Jul 29, 2024
97dee85
docs: add readme for parallel plugin
apaleslimghost Jul 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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.0",
"lib/options": "3.2.0",
"lib/package-json-hook": "4.2.0",
"plugins/package-json-hook": "4.2.0",
"lib/state": "3.3.0",
"lib/types": "3.6.0",
"lib/vault": "3.2.0",
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.
16 changes: 13 additions & 3 deletions 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 { runCommands } = 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 All @@ -25,9 +35,9 @@ async function main() {
// the command becomes something like `dotcom-tool-kit test:staged --
// index.js`. When this command is executed it runs the configured task
// where the file path arguments would then be extracted.
await runTasks(rootLogger, argv._, argv['--'])
await runCommands(rootLogger, argv._, argv['--'])
} else {
await runTasks(rootLogger, argv._)
await runCommands(rootLogger, argv._)
}
}
} catch (error) {
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')
}
]
}
}
39 changes: 16 additions & 23 deletions core/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dotcom-tool-kit",
"version": "3.4.5",
"version": "4.0.0-beta.5",
"description": "modern, maintainable, modular developer tooling for FT.com projects",
"author": "FT.com Platforms Team <[email protected]>",
"license": "MIT",
Expand All @@ -20,41 +20,34 @@
"test": "cd ../../ ; npx jest --silent --projects core/cli"
},
"devDependencies": {
"@dotcom-tool-kit/babel": "^3.2.0",
"@dotcom-tool-kit/backend-heroku-app": "^3.1.4",
"@dotcom-tool-kit/circleci": "^6.0.1",
"@dotcom-tool-kit/circleci-deploy": "^3.4.3",
"@dotcom-tool-kit/eslint": "^3.2.0",
"@dotcom-tool-kit/frontend-app": "^3.2.4",
"@dotcom-tool-kit/heroku": "^3.4.1",
"@dotcom-tool-kit/mocha": "^3.2.0",
"@dotcom-tool-kit/n-test": "^3.3.1",
"@dotcom-tool-kit/npm": "^3.3.1",
"@dotcom-tool-kit/webpack": "^3.2.0",
"@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/error": "^3.2.0",
"@dotcom-tool-kit/logger": "^3.4.0",
"@dotcom-tool-kit/options": "^3.2.0",
"@dotcom-tool-kit/types": "^3.6.0",
"@dotcom-tool-kit/wait-for-ok": "^3.2.0",
"cosmiconfig": "^7.0.0",
"@dotcom-tool-kit/base": "4.0.0-beta.0",
"@dotcom-tool-kit/config": "2.0.0-beta.0",
"@dotcom-tool-kit/conflict": "2.0.0-beta.0",
"@dotcom-tool-kit/error": "4.0.0-beta.0",
"@dotcom-tool-kit/logger": "4.0.0-beta.0",
"@dotcom-tool-kit/options": "4.0.0-beta.0",
"@dotcom-tool-kit/plugin": "2.0.0-beta.0",
"@dotcom-tool-kit/validated": "2.0.0-beta.0",
"@dotcom-tool-kit/wait-for-ok": "4.0.0-beta.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