Skip to content

Commit

Permalink
Add release tooling (redwoodjs#4274)
Browse files Browse the repository at this point in the history
* add release tooling

* correct package json script

* remove notes

* remove comments

* improve comments, disable some functionality

* flesh out release patch

* fix constraints

* mv release-notes

* rename release notes files

* update yarn lock, many changes

* updates

* dedupe

* update, add tests

* tests

* add msw, make more interactive

* test updates

* restore choices array

* handle release notes

* add confirm

* improve prompts

* prompts

* copy

* fix bug in prompt

* prompts

* updates

* fix

* updates

Co-authored-by: David Price <thedavid@thedavidprice.com>
  • Loading branch information
jtoar and thedavidprice authored Jan 27, 2022
1 parent 2dbfd45 commit 8b95fc7
Show file tree
Hide file tree
Showing 15 changed files with 1,425 additions and 207 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ yarn-error.log
**/*.tsbuildinfo
tasks/.verdaccio
tasks/e2e/cypress/fixtures/example.json
tasks/release-notes/*.md
tasks/release/*.md
tmp/
blog-test-project/*
.yarn/*
Expand Down
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@
"@types/jest": "27.4.0",
"@types/jscodeshift": "0.11.2",
"@types/lodash.template": "4.5.0",
"@types/prompts": "2.4.0",
"all-contributors-cli": "6.20.0",
"ansi-colors": "4.1.1",
"babel-jest": "27.4.6",
"babel-plugin-auto-import": "1.1.0",
"babel-plugin-remove-code": "0.0.6",
"boxen": "5.1.2",
"core-js": "3.20.3",
"cypress": "9.3.1",
"cypress-wait-until": "1.7.2",
Expand All @@ -36,14 +38,17 @@
"jscodeshift": "0.13.0",
"lerna": "4.0.0",
"lodash.template": "4.5.0",
"msw": "0.36.7",
"nodemon": "2.0.15",
"npm-packlist": "3.0.0",
"octokit": "1.7.1",
"ora": "5.4.1",
"prompts": "2.4.2",
"rimraf": "3.0.2",
"terminal-link": "2.1.1",
"typescript": "4.5.5",
"typescript-transform-paths": "3.3.1"
"typescript-transform-paths": "3.3.1",
"zx": "4.3.0"
},
"resolutions": {
"@types/react": "17.0.38",
Expand All @@ -63,13 +68,14 @@
"build:clean": "yarn clean:prisma && rimraf packages/**/dist",
"build:watch": "lerna run build:watch --parallel; tsc --build",
"test": "lerna run test --stream -- --colors --maxWorkers=4",
"test-release": "NODE_OPTIONS=--experimental-vm-modules ./node_modules/.bin/jest --config ./tasks/release/jest.config.mjs",
"e2e": "node ./tasks/run-e2e",
"clean:prisma": "rimraf node_modules/.prisma/client && node node_modules/@prisma/client/scripts/postinstall.js",
"lint": "RWJS_CWD=packages/create-redwood-app/template eslint --config .eslintrc.js packages",
"lint:fix": "yarn lint --fix",
"build:link": "node ./tasks/build-and-copy",
"build:test-project": "node ./tasks/test-project/test-project",
"release-notes": "node ./tasks/release-notes/release-notes.mjs",
"release": "node ./tasks/release/cli.mjs",
"publish:canary": "lerna publish --force-publish --canary --include-merged-tags --preid canary --dist-tag canary --yes --loglevel verbose",
"project:deps": "node ./tasks/framework-tools/frameworkDepsToProject.mjs",
"project:copy": "node ./tasks/framework-tools/frameworkFilesToProject.mjs",
Expand Down
11 changes: 0 additions & 11 deletions tasks/release-notes/README.md

This file was deleted.

30 changes: 0 additions & 30 deletions tasks/release-notes/release-notes.md.template

This file was deleted.

35 changes: 35 additions & 0 deletions tasks/release/__snapshots__/generateReleaseNotes.test.mjs.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`generateReleaseNotes works 1`] = `
"# Changelog
Unique contributors: 3
PRs merged: 3
## Features
- Added Decimal field type to Scaffold #4169 by @BBurnworth
## Fixed
- Type fix for \`mockGraphQL\` data argument #4164 by @callingmedic911
## Chore
- Add storybook ci option to test that Storybook starts \\"ok\\" #3515 by @virtuoushub
### Package Dependencies
<details>
<summary>View all Dependency Version Upgrades</summary>
<ul>
</ul>
</details>
## Manual
"
`;
37 changes: 37 additions & 0 deletions tasks/release/cli.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env node
/* eslint-env node, es2021 */

import yargs from 'yargs'
import { hideBin } from 'yargs/helpers'

import generateReleaseNotes from './generateReleaseNotes.mjs'
import release from './release.mjs'
import updateNextReleasePullRequestsMilestone from './updateNextReleasePullRequestsMilestone.mjs'

yargs(hideBin(process.argv))
.scriptName('release')
.command('$0', 'Release RedwoodJS', {}, release)
.command(
'generate-release-notes [milestone]',
'Generates release notes for a given milestone',
(yargs) => {
yargs.positional('milestone', {
describe: 'The milestone to generate release notes for',
type: 'string',
})
},
(argv) => generateReleaseNotes(argv.milestone)
)
.command(
'update-next-release-prs-milestone <milestone>',
"Update next-release PRs' milestone. Note that this creates the milestone if it doesn't exist",
(yargs) => {
yargs.positional('milestone', {
describe: 'The milestone to update next-release PRs to',
type: 'string',
})
},
(argv) => updateNextReleasePullRequestsMilestone(argv.milestone)
)
.help()
.parse()
Loading

0 comments on commit 8b95fc7

Please sign in to comment.