Skip to content

Commit 95bf176

Browse files
authored
Don't recommend initial use of intentionally-skip (#119)
Currently we say in the releas spec that if the user wants to skip a package, they can specify "intentionally-skip" in place of the version. We actually don't want first-time users to know about this directive up front, because it suppresses errors that would ordinarily be produced if you omit a package from the release that you shouldn't. Rather, we want to only suggest this in the error message. Hence, this commit removes the reference to "intentionally-skip" from the release spec. It also adds some more instructions for first-time users.
1 parent 151c286 commit 95bf176

File tree

2 files changed

+69
-23
lines changed

2 files changed

+69
-23
lines changed

src/release-specification.test.ts

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,38 @@ describe('release-specification', () => {
4545

4646
expect(template).toStrictEqual(
4747
`
48-
# The following is a list of packages in monorepo.
49-
# Please indicate the packages for which you want to create a new release
50-
# by updating "null" to one of the following:
48+
# This file (called the "release spec") allows you to specify which packages you
49+
# want to include in this release along with the new versions they should
50+
# receive.
51+
#
52+
# By default, all packages which have changed since their latest release are
53+
# listed here. You can choose not to publish a package by removing it from this
54+
# list.
55+
#
56+
# For each package you *do* want to release, you will need to specify how that
57+
# version should be changed depending on the impact of the changes that will go
58+
# into the release. To help you make this decision, all of the changes have been
59+
# automatically added to the changelog for the package. This has been done
60+
# in a new commit, so you can keep this file open, run \`git show\` in the
61+
# terminal, review the set of changes, then return to this file to specify the
62+
# version.
63+
#
64+
# A version specifier (the value that goes after each package in the list below)
65+
# can be one of the following:
5166
#
5267
# - "major" (if you want to bump the major part of the package's version)
5368
# - "minor" (if you want to bump the minor part of the package's version)
5469
# - "patch" (if you want to bump the patch part of the package's version)
5570
# - an exact version with major, minor, and patch parts (e.g. "1.2.3")
56-
# - intentionally-skip (to skip the package entirely)
5771
#
58-
# When you're finished making your selections, save this file and
59-
# create-release-branch will continue automatically.
72+
# When you're finished, save this file and close it. The tool will update the
73+
# versions of the packages you've listed and will move the changelog entries to
74+
# a new section.
6075
6176
packages:
6277
a: null
6378
c: null
64-
`.slice(1),
79+
`.trimStart(),
6580
);
6681
});
6782

@@ -108,23 +123,38 @@ packages:
108123

109124
expect(template).toStrictEqual(
110125
`
111-
# The following is a list of packages in monorepo.
112-
# Please indicate the packages for which you want to create a new release
113-
# by updating "null" to one of the following:
126+
# This file (called the "release spec") allows you to specify which packages you
127+
# want to include in this release along with the new versions they should
128+
# receive.
129+
#
130+
# By default, all packages which have changed since their latest release are
131+
# listed here. You can choose not to publish a package by removing it from this
132+
# list.
133+
#
134+
# For each package you *do* want to release, you will need to specify how that
135+
# version should be changed depending on the impact of the changes that will go
136+
# into the release. To help you make this decision, all of the changes have been
137+
# automatically added to the changelog for the package. This has been done
138+
# in a new commit, so you can keep this file open, run \`git show\` in the
139+
# terminal, review the set of changes, then return to this file to specify the
140+
# version.
141+
#
142+
# A version specifier (the value that goes after each package in the list below)
143+
# can be one of the following:
114144
#
115145
# - "major" (if you want to bump the major part of the package's version)
116146
# - "minor" (if you want to bump the minor part of the package's version)
117147
# - "patch" (if you want to bump the patch part of the package's version)
118148
# - an exact version with major, minor, and patch parts (e.g. "1.2.3")
119-
# - intentionally-skip (to skip the package entirely)
120149
#
121-
# When you're finished making your selections, save this file and then re-run
122-
# create-release-branch.
150+
# When you're finished, save this file and then run create-release-branch again.
151+
# The tool will update the versions of the packages you've listed and will move
152+
# the changelog entries to a new section.
123153
124154
packages:
125155
a: null
126156
b: null
127-
`.slice(1),
157+
`.trimStart(),
128158
);
129159
});
130160
});

src/release-specification.ts

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,30 +55,46 @@ const INTENTIONALLY_SKIP_PACKAGE_DIRECTIVE = 'intentionally-skip';
5555
* @returns The release specification template.
5656
*/
5757
export async function generateReleaseSpecificationTemplateForMonorepo({
58-
project: { rootPackage, workspacePackages },
58+
project: { workspacePackages },
5959
isEditorAvailable,
6060
}: {
6161
project: Project;
6262
isEditorAvailable: boolean;
6363
}) {
6464
const afterEditingInstructions = isEditorAvailable
6565
? `
66-
# When you're finished making your selections, save this file and
67-
# create-release-branch will continue automatically.`.trim()
66+
# When you're finished, save this file and close it. The tool will update the
67+
# versions of the packages you've listed and will move the changelog entries to
68+
# a new section.`.trim()
6869
: `
69-
# When you're finished making your selections, save this file and then re-run
70-
# create-release-branch.`.trim();
70+
# When you're finished, save this file and then run create-release-branch again.
71+
# The tool will update the versions of the packages you've listed and will move
72+
# the changelog entries to a new section.`.trim();
7173

7274
const instructions = `
73-
# The following is a list of packages in ${rootPackage.validatedManifest.name}.
74-
# Please indicate the packages for which you want to create a new release
75-
# by updating "null" to one of the following:
75+
# This file (called the "release spec") allows you to specify which packages you
76+
# want to include in this release along with the new versions they should
77+
# receive.
78+
#
79+
# By default, all packages which have changed since their latest release are
80+
# listed here. You can choose not to publish a package by removing it from this
81+
# list.
82+
#
83+
# For each package you *do* want to release, you will need to specify how that
84+
# version should be changed depending on the impact of the changes that will go
85+
# into the release. To help you make this decision, all of the changes have been
86+
# automatically added to the changelog for the package. This has been done
87+
# in a new commit, so you can keep this file open, run \`git show\` in the
88+
# terminal, review the set of changes, then return to this file to specify the
89+
# version.
90+
#
91+
# A version specifier (the value that goes after each package in the list below)
92+
# can be one of the following:
7693
#
7794
# - "major" (if you want to bump the major part of the package's version)
7895
# - "minor" (if you want to bump the minor part of the package's version)
7996
# - "patch" (if you want to bump the patch part of the package's version)
8097
# - an exact version with major, minor, and patch parts (e.g. "1.2.3")
81-
# - intentionally-skip (to skip the package entirely)
8298
#
8399
${afterEditingInstructions}
84100
`.trim();

0 commit comments

Comments
 (0)