2024-03-12 14:53:57 +00:00
|
|
|
import { join } from 'path'
|
|
|
|
import { REPO_ROOT, writeJsonFile } from './file'
|
|
|
|
|
2024-05-22 15:55:49 +00:00
|
|
|
interface Label {
|
2024-03-12 14:53:57 +00:00
|
|
|
// this is what the label is 'called' on github
|
|
|
|
name: string
|
|
|
|
// this is how we describe the label in our pull request template
|
|
|
|
description: string
|
|
|
|
// this is the section title for the label in our changelogs
|
|
|
|
changelogTitle: string
|
|
|
|
}
|
|
|
|
|
|
|
|
const TYPE_LABELS = [
|
2024-06-28 15:57:38 +00:00
|
|
|
{ name: `bugfix`, description: `Bug fix`, changelogTitle: '🐛 Bug Fixes' },
|
2024-03-12 14:53:57 +00:00
|
|
|
{
|
dx: PR labels re-revamp (#4016)
This is a followup to https://github.com/tldraw/tldraw/pull/3112 after a
discussion with Alex about how our release notes writing is really
manual now.
This changes the labels to be a more limited set.
It also adds a plugin to help massage the release notes into what we
want it to be:
- ignores bot commits
- use the release notes, if found, not the commit msg
- skip writing the "release notes" in general, just create the changelog
which is what we want anyway.
### Change Type
<!-- ❗ Please select a 'Scope' label ❗️ -->
- [ ] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff
<!-- ❗ Please select a 'Type' label ❗️ -->
- [ ] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know
2024-06-26 11:06:15 +00:00
|
|
|
name: `improvement`,
|
|
|
|
description: `Product improvement`,
|
|
|
|
changelogTitle: '💄 Product Improvements',
|
2024-03-12 14:53:57 +00:00
|
|
|
},
|
2024-06-28 15:57:38 +00:00
|
|
|
{
|
|
|
|
name: `feature`,
|
|
|
|
description: `New feature`,
|
|
|
|
changelogTitle: '🎉 New Features',
|
|
|
|
},
|
2024-03-12 14:53:57 +00:00
|
|
|
{
|
dx: PR labels re-revamp (#4016)
This is a followup to https://github.com/tldraw/tldraw/pull/3112 after a
discussion with Alex about how our release notes writing is really
manual now.
This changes the labels to be a more limited set.
It also adds a plugin to help massage the release notes into what we
want it to be:
- ignores bot commits
- use the release notes, if found, not the commit msg
- skip writing the "release notes" in general, just create the changelog
which is what we want anyway.
### Change Type
<!-- ❗ Please select a 'Scope' label ❗️ -->
- [ ] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff
<!-- ❗ Please select a 'Type' label ❗️ -->
- [ ] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know
2024-06-26 11:06:15 +00:00
|
|
|
name: `api`,
|
|
|
|
description: `API change`,
|
|
|
|
changelogTitle: '🛠️ API Changes',
|
2024-03-12 14:53:57 +00:00
|
|
|
},
|
|
|
|
{
|
dx: PR labels re-revamp (#4016)
This is a followup to https://github.com/tldraw/tldraw/pull/3112 after a
discussion with Alex about how our release notes writing is really
manual now.
This changes the labels to be a more limited set.
It also adds a plugin to help massage the release notes into what we
want it to be:
- ignores bot commits
- use the release notes, if found, not the commit msg
- skip writing the "release notes" in general, just create the changelog
which is what we want anyway.
### Change Type
<!-- ❗ Please select a 'Scope' label ❗️ -->
- [ ] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff
<!-- ❗ Please select a 'Type' label ❗️ -->
- [ ] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know
2024-06-26 11:06:15 +00:00
|
|
|
name: `other`,
|
|
|
|
description: `Changes that don't affect SDK users, e.g. internal or .com changes`,
|
|
|
|
changelogTitle: '🤷 Other',
|
2024-03-12 14:53:57 +00:00
|
|
|
},
|
|
|
|
] as const satisfies Label[]
|
|
|
|
|
|
|
|
export function getLabelNames() {
|
dx: PR labels re-revamp (#4016)
This is a followup to https://github.com/tldraw/tldraw/pull/3112 after a
discussion with Alex about how our release notes writing is really
manual now.
This changes the labels to be a more limited set.
It also adds a plugin to help massage the release notes into what we
want it to be:
- ignores bot commits
- use the release notes, if found, not the commit msg
- skip writing the "release notes" in general, just create the changelog
which is what we want anyway.
### Change Type
<!-- ❗ Please select a 'Scope' label ❗️ -->
- [ ] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff
<!-- ❗ Please select a 'Type' label ❗️ -->
- [ ] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know
2024-06-26 11:06:15 +00:00
|
|
|
return [...TYPE_LABELS].map((label) => label.name)
|
2024-03-12 14:53:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function formatTemplateOption(label: Label) {
|
2024-06-28 15:57:38 +00:00
|
|
|
return `- [ ] \`${label.name}\``
|
2024-03-12 14:53:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export function formatLabelOptionsForPRTemplate() {
|
2024-06-28 15:57:38 +00:00
|
|
|
return TYPE_LABELS.map(formatTemplateOption).join('\n')
|
2024-03-12 14:53:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export async function generateAutoRcFile() {
|
|
|
|
const autoRcPath = join(REPO_ROOT, '.autorc')
|
|
|
|
await writeJsonFile(autoRcPath, {
|
dx: PR labels re-revamp (#4016)
This is a followup to https://github.com/tldraw/tldraw/pull/3112 after a
discussion with Alex about how our release notes writing is really
manual now.
This changes the labels to be a more limited set.
It also adds a plugin to help massage the release notes into what we
want it to be:
- ignores bot commits
- use the release notes, if found, not the commit msg
- skip writing the "release notes" in general, just create the changelog
which is what we want anyway.
### Change Type
<!-- ❗ Please select a 'Scope' label ❗️ -->
- [ ] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff
<!-- ❗ Please select a 'Type' label ❗️ -->
- [ ] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know
2024-06-26 11:06:15 +00:00
|
|
|
plugins: ['npm', '../scripts/lib/auto-plugin.js'],
|
|
|
|
labels: [...TYPE_LABELS.filter((l) => l.name !== 'other')].map(({ name, changelogTitle }) => ({
|
2024-03-12 14:53:57 +00:00
|
|
|
name,
|
|
|
|
changelogTitle,
|
|
|
|
releaseType: 'none',
|
|
|
|
})),
|
|
|
|
})
|
|
|
|
}
|