Skip to content

Commit f7a9cfd

Browse files
committed
fix: remove single-dash options from workflows
1 parent 415deb2 commit f7a9cfd

23 files changed

+62
-62
lines changed

.github/workflows/ci-release.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ jobs:
6060
- name: Install Dependencies
6161
run: npm i --ignore-scripts --no-audit --no-fund
6262
- name: Lint
63-
run: npm run lint --ignore-scripts -ws -iwr --if-present
63+
run: npm run lint --ignore-scripts --workspaces --include-workspace-root --if-present
6464
- name: Post Lint
65-
run: npm run postlint --ignore-scripts -ws -iwr --if-present
65+
run: npm run postlint --ignore-scripts --workspaces --include-workspace-root --if-present
6666
- name: Conclude Check
6767
uses: LouisBrunner/checks-action@v1.6.0
6868
if: steps.create-check.outputs.check-id && always()
@@ -140,7 +140,7 @@ jobs:
140140
- name: Add Problem Matcher
141141
run: echo "::add-matcher::.github/matchers/tap.json"
142142
- name: Test
143-
run: npm test --ignore-scripts -ws -iwr --if-present
143+
run: npm test --ignore-scripts --workspaces --include-workspace-root --if-present
144144
- name: Conclude Check
145145
uses: LouisBrunner/checks-action@v1.6.0
146146
if: steps.create-check.outputs.check-id && always()

.github/workflows/ci-test-workspace.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ jobs:
4747
- name: Install Dependencies
4848
run: npm i --ignore-scripts --no-audit --no-fund
4949
- name: Lint
50-
run: npm run lint --ignore-scripts -w test-workspace
50+
run: npm run lint --ignore-scripts --workspace test-workspace
5151
- name: Post Lint
52-
run: npm run postlint --ignore-scripts -w test-workspace
52+
run: npm run postlint --ignore-scripts --workspace test-workspace
5353

5454
test:
5555
name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }}
@@ -113,4 +113,4 @@ jobs:
113113
- name: Add Problem Matcher
114114
run: echo "::add-matcher::.github/matchers/tap.json"
115115
- name: Test
116-
run: npm test --ignore-scripts -w test-workspace
116+
run: npm test --ignore-scripts --workspace test-workspace

.github/workflows/post-dependabot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
else
5555
# strip leading slash from directory so it works as a
5656
# a path to the workspace flag
57-
echo "workspace=-w ${dependabot_dir#/}" >> $GITHUB_OUTPUT
57+
echo "workspace=--workspace ${dependabot_dir#/}" >> $GITHUB_OUTPUT
5858
fi
5959
6060
- name: Apply Changes

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ jobs:
141141
- name: Run Post Pull Request Actions
142142
env:
143143
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
144-
run: npm run rp-pull-request --ignore-scripts -ws -iwr --if-present -- --pr="${{ needs.release.outputs.pr-number }}" --commentId="${{ needs.release.outputs.comment-id }}"
144+
run: npm run rp-pull-request --ignore-scripts --workspaces --include-workspace-root --if-present -- --pr="${{ needs.release.outputs.pr-number }}" --commentId="${{ needs.release.outputs.comment-id }}"
145145
- name: Commit
146146
id: commit
147147
env:

lib/config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ const getFullConfig = async ({
160160
pkgPath,
161161
pkgDir: posixDir(pkgPath),
162162
pkgGlob: posixGlob(pkgPath),
163-
pkgFlags: isWorkspace ? `-w ${pkg.pkgJson.name}` : '',
164-
allFlags: isMono ? '-ws -iwr --if-present' : '',
163+
pkgFlags: isWorkspace ? `--workspace ${pkg.pkgJson.name}` : '',
164+
allFlags: isMono ? '--workspaces --include-workspace-root --if-present' : '',
165165
workspacePaths,
166166
workspaceGlobs: workspacePaths.map(posixGlob),
167167
// type

lib/content/post-dependabot-yml.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
else
3232
# strip leading slash from directory so it works as a
3333
# a path to the workspace flag
34-
echo "workspace=-w ${dependabot_dir#/}" >> $GITHUB_OUTPUT
34+
echo "workspace=--workspace ${dependabot_dir#/}" >> $GITHUB_OUTPUT
3535
fi
3636

3737
- name: Apply Changes

lib/release/release-manager.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class ReleaseManager {
6868
.replace(/<X\.Y\.Z>/g, release.version)
6969
.replace(/<GITHUB-RELEASE-LINK>/g, release.url)
7070
.replace(/<PUBLISH-FLAGS>/g, release.flags)
71-
.replace(/^(\s*\S.*)(-w <WS-PKG-N>)$/gm, workspaces.map(w => `$1${w.flags}`).join('\n'))
71+
.replace(/^(\s*\S.*)(--workspace <WS-PKG-N>)$/gm, workspaces.map(w => `$1${w.flags}`).join('\n'))
7272
.trim()
7373

7474
return `### Release Checklist for ${release.tag}\n\n${checklist}`
@@ -150,7 +150,7 @@ class ReleaseManager {
150150
version: rawVersion,
151151
major: version.major,
152152
url: `https://github.com/${pullRequest.base.repo.full_name}/releases/tag/${tag}`,
153-
flags: [workspaces[name] ? `-w ${workspaces[name]}` : null, `--tag=${publishTag}`].filter(Boolean).join(' '),
153+
flags: [workspaces[name] ? `--workspace ${workspaces[name]}` : null, `--tag=${publishTag}`].filter(Boolean).join(' '),
154154
}
155155
}
156156

@@ -221,7 +221,7 @@ class ReleaseManager {
221221
1. Publish workspaces
222222
223223
${block('sh')}
224-
npm publish -w <WS-PKG-N>
224+
npm publish --workspace <WS-PKG-N>
225225
${block()}
226226
227227
1. Publish
@@ -261,7 +261,7 @@ class ReleaseManager {
261261
Release Please will run on the just pushed release commit and create GitHub releases and tags for each package.
262262
263263
${block('sh')}
264-
gh run watch ${R} $(gh run list ${R} -w release -b <BASE-BRANCH> -L 1 --json databaseId -q ".[0].databaseId")
264+
gh run watch ${R} $(gh run list ${R} --workspace release -b <BASE-BRANCH> -L 1 --json databaseId -q ".[0].databaseId")
265265
${block()}
266266
`
267267
/* eslint-enable max-len */

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"postinstall": "template-oss-apply",
2121
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
2222
"prettier": "prettier \"**/*.{js,cjs,ts,mjs,jsx,tsx,json}\"",
23-
"test-all": "npm run test -ws -iwr --if-present",
24-
"lint-all": "npm run lint -ws -iwr --if-present"
23+
"test-all": "npm run test --workspaces --include-workspace-root --if-present",
24+
"lint-all": "npm run lint --workspaces --include-workspace-root --if-present"
2525
},
2626
"repository": {
2727
"type": "git",

tap-snapshots/test/apply/source-snapshots.js.test.cjs

+25-25
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ jobs:
744744
else
745745
# strip leading slash from directory so it works as a
746746
# a path to the workspace flag
747-
echo "workspace=-w \${dependabot_dir#/}" >> $GITHUB_OUTPUT
747+
echo "workspace=--workspace \${dependabot_dir#/}" >> $GITHUB_OUTPUT
748748
fi
749749
750750
- name: Apply Changes
@@ -1906,9 +1906,9 @@ jobs:
19061906
- name: Install Dependencies
19071907
run: npm i --ignore-scripts --no-audit --no-fund
19081908
- name: Lint
1909-
run: npm run lint --ignore-scripts -w a
1909+
run: npm run lint --ignore-scripts --workspace a
19101910
- name: Post Lint
1911-
run: npm run postlint --ignore-scripts -w a
1911+
run: npm run postlint --ignore-scripts --workspace a
19121912
19131913
test:
19141914
name: Test - \${{ matrix.platform.name }} - \${{ matrix.node-version }}
@@ -1960,7 +1960,7 @@ jobs:
19601960
- name: Add Problem Matcher
19611961
run: echo "::add-matcher::.github/matchers/tap.json"
19621962
- name: Test
1963-
run: npm test --ignore-scripts -w a
1963+
run: npm test --ignore-scripts --workspace a
19641964
19651965
.github/workflows/ci-b.yml
19661966
========================================
@@ -2015,9 +2015,9 @@ jobs:
20152015
- name: Install Dependencies
20162016
run: npm i --ignore-scripts --no-audit --no-fund
20172017
- name: Lint
2018-
run: npm run lint --ignore-scripts -w b
2018+
run: npm run lint --ignore-scripts --workspace b
20192019
- name: Post Lint
2020-
run: npm run postlint --ignore-scripts -w b
2020+
run: npm run postlint --ignore-scripts --workspace b
20212021
20222022
test:
20232023
name: Test - \${{ matrix.platform.name }} - \${{ matrix.node-version }}
@@ -2069,7 +2069,7 @@ jobs:
20692069
- name: Add Problem Matcher
20702070
run: echo "::add-matcher::.github/matchers/tap.json"
20712071
- name: Test
2072-
run: npm test --ignore-scripts -w b
2072+
run: npm test --ignore-scripts --workspace b
20732073
20742074
.github/workflows/ci-release.yml
20752075
========================================
@@ -2135,9 +2135,9 @@ jobs:
21352135
- name: Install Dependencies
21362136
run: npm i --ignore-scripts --no-audit --no-fund
21372137
- name: Lint
2138-
run: npm run lint --ignore-scripts -ws -iwr --if-present
2138+
run: npm run lint --ignore-scripts --workspaces --include-workspace-root --if-present
21392139
- name: Post Lint
2140-
run: npm run postlint --ignore-scripts -ws -iwr --if-present
2140+
run: npm run postlint --ignore-scripts --workspaces --include-workspace-root --if-present
21412141
- name: Conclude Check
21422142
uses: LouisBrunner/checks-action@v1.6.0
21432143
if: steps.create-check.outputs.check-id && always()
@@ -2206,7 +2206,7 @@ jobs:
22062206
- name: Add Problem Matcher
22072207
run: echo "::add-matcher::.github/matchers/tap.json"
22082208
- name: Test
2209-
run: npm test --ignore-scripts -ws -iwr --if-present
2209+
run: npm test --ignore-scripts --workspaces --include-workspace-root --if-present
22102210
- name: Conclude Check
22112211
uses: LouisBrunner/checks-action@v1.6.0
22122212
if: steps.create-check.outputs.check-id && always()
@@ -2430,7 +2430,7 @@ jobs:
24302430
else
24312431
# strip leading slash from directory so it works as a
24322432
# a path to the workspace flag
2433-
echo "workspace=-w \${dependabot_dir#/}" >> $GITHUB_OUTPUT
2433+
echo "workspace=--workspace \${dependabot_dir#/}" >> $GITHUB_OUTPUT
24342434
fi
24352435
24362436
- name: Apply Changes
@@ -2771,7 +2771,7 @@ jobs:
27712771
- name: Run Post Pull Request Actions
27722772
env:
27732773
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
2774-
run: npm run rp-pull-request --ignore-scripts -ws -iwr --if-present -- --pr="\${{ needs.release.outputs.pr-number }}" --commentId="\${{ needs.release.outputs.comment-id }}"
2774+
run: npm run rp-pull-request --ignore-scripts --workspaces --include-workspace-root --if-present -- --pr="\${{ needs.release.outputs.pr-number }}" --commentId="\${{ needs.release.outputs.comment-id }}"
27752775
- name: Commit
27762776
id: commit
27772777
env:
@@ -3068,8 +3068,8 @@ package.json
30683068
"snap": "tap",
30693069
"test": "tap",
30703070
"posttest": "npm run lint",
3071-
"test-all": "npm run test -ws -iwr --if-present",
3072-
"lint-all": "npm run lint -ws -iwr --if-present"
3071+
"test-all": "npm run test --workspaces --include-workspace-root --if-present",
3072+
"lint-all": "npm run lint --workspaces --include-workspace-root --if-present"
30733073
},
30743074
"author": "GitHub Inc.",
30753075
"files": [
@@ -3607,9 +3607,9 @@ jobs:
36073607
- name: Install Dependencies
36083608
run: npm i --ignore-scripts --no-audit --no-fund
36093609
- name: Lint
3610-
run: npm run lint --ignore-scripts -w a
3610+
run: npm run lint --ignore-scripts --workspace a
36113611
- name: Post Lint
3612-
run: npm run postlint --ignore-scripts -w a
3612+
run: npm run postlint --ignore-scripts --workspace a
36133613
36143614
test:
36153615
name: Test - \${{ matrix.platform.name }} - \${{ matrix.node-version }}
@@ -3661,7 +3661,7 @@ jobs:
36613661
- name: Add Problem Matcher
36623662
run: echo "::add-matcher::.github/matchers/tap.json"
36633663
- name: Test
3664-
run: npm test --ignore-scripts -w a
3664+
run: npm test --ignore-scripts --workspace a
36653665
36663666
.github/workflows/ci-b.yml
36673667
========================================
@@ -3716,9 +3716,9 @@ jobs:
37163716
- name: Install Dependencies
37173717
run: npm i --ignore-scripts --no-audit --no-fund
37183718
- name: Lint
3719-
run: npm run lint --ignore-scripts -w b
3719+
run: npm run lint --ignore-scripts --workspace b
37203720
- name: Post Lint
3721-
run: npm run postlint --ignore-scripts -w b
3721+
run: npm run postlint --ignore-scripts --workspace b
37223722
37233723
test:
37243724
name: Test - \${{ matrix.platform.name }} - \${{ matrix.node-version }}
@@ -3770,7 +3770,7 @@ jobs:
37703770
- name: Add Problem Matcher
37713771
run: echo "::add-matcher::.github/matchers/tap.json"
37723772
- name: Test
3773-
run: npm test --ignore-scripts -w b
3773+
run: npm test --ignore-scripts --workspace b
37743774
37753775
.github/workflows/ci-release.yml
37763776
========================================
@@ -3836,9 +3836,9 @@ jobs:
38363836
- name: Install Dependencies
38373837
run: npm i --ignore-scripts --no-audit --no-fund
38383838
- name: Lint
3839-
run: npm run lint --ignore-scripts -ws -iwr --if-present
3839+
run: npm run lint --ignore-scripts --workspaces --include-workspace-root --if-present
38403840
- name: Post Lint
3841-
run: npm run postlint --ignore-scripts -ws -iwr --if-present
3841+
run: npm run postlint --ignore-scripts --workspaces --include-workspace-root --if-present
38423842
- name: Conclude Check
38433843
uses: LouisBrunner/checks-action@v1.6.0
38443844
if: steps.create-check.outputs.check-id && always()
@@ -3907,7 +3907,7 @@ jobs:
39073907
- name: Add Problem Matcher
39083908
run: echo "::add-matcher::.github/matchers/tap.json"
39093909
- name: Test
3910-
run: npm test --ignore-scripts -ws -iwr --if-present
3910+
run: npm test --ignore-scripts --workspaces --include-workspace-root --if-present
39113911
- name: Conclude Check
39123912
uses: LouisBrunner/checks-action@v1.6.0
39133913
if: steps.create-check.outputs.check-id && always()
@@ -3974,7 +3974,7 @@ jobs:
39743974
else
39753975
# strip leading slash from directory so it works as a
39763976
# a path to the workspace flag
3977-
echo "workspace=-w \${dependabot_dir#/}" >> $GITHUB_OUTPUT
3977+
echo "workspace=--workspace \${dependabot_dir#/}" >> $GITHUB_OUTPUT
39783978
fi
39793979
39803980
- name: Apply Changes
@@ -4315,7 +4315,7 @@ jobs:
43154315
- name: Run Post Pull Request Actions
43164316
env:
43174317
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
4318-
run: npm run rp-pull-request --ignore-scripts -ws -iwr --if-present -- --pr="\${{ needs.release.outputs.pr-number }}" --commentId="\${{ needs.release.outputs.comment-id }}"
4318+
run: npm run rp-pull-request --ignore-scripts --workspaces --include-workspace-root --if-present -- --pr="\${{ needs.release.outputs.pr-number }}" --commentId="\${{ needs.release.outputs.comment-id }}"
43194319
- name: Commit
43204320
id: commit
43214321
env:

tap-snapshots/test/check/snapshots.js.test.cjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,8 @@ The module file package.json needs to be updated:
354354
"snap": "tap",
355355
"test": "tap",
356356
"posttest": "npm run lint",
357-
"test-all": "npm run test -ws -iwr --if-present",
358-
"lint-all": "npm run lint -ws -iwr --if-present"
357+
"test-all": "npm run test --workspaces --include-workspace-root --if-present",
358+
"lint-all": "npm run lint --workspaces --include-workspace-root --if-present"
359359
}
360360
"tap" is missing, expected {
361361
"test-ignore": "^(workspaces/a|workspaces/b)/",

tap-snapshots/test/release/release-manager-cwd.js.test.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ exports[`test/release/release-manager.js TAP cwd > expect resolving Promise 1`]
3737
Release Please will run on the just pushed release commit and create GitHub releases and tags for each package.
3838
3939
\`\`\`
40-
gh run watch -R npm/cli $(gh run list -R npm/cli -w release -b latest -L 1 --json databaseId -q ".[0].databaseId")
40+
gh run watch -R npm/cli $(gh run list -R npm/cli --workspace release -b latest -L 1 --json databaseId -q ".[0].databaseId")
4141
\`\`\`
4242
`

tap-snapshots/test/release/release-manager-mock-release-manager.js.test.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ exports[`test/release/release-manager.js > TAP > mock release manager > must mat
4545
Release Please will run on the just pushed release commit and create GitHub releases and tags for each package.
4646
4747
\`\`\`sh
48-
gh run watch -R npm/npm-cli-release-please $(gh run list -R npm/npm-cli-release-please -w release -b main -L 1 --json databaseId -q ".[0].databaseId")
48+
gh run watch -R npm/npm-cli-release-please $(gh run list -R npm/npm-cli-release-please --workspace release -b main -L 1 --json databaseId -q ".[0].databaseId")
4949
\`\`\`
5050
`

tap-snapshots/test/release/release-manager-npm-cli.js.test.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ exports[`test/release/release-manager.js > TAP > npm/cli > must match snapshot 1
109109
You can watch the release workflow in your terminal with the following command:
110110
111111
\`\`\`
112-
gh run watch \`gh run list -R npm/cli -w release -b latest -L 1 --json databaseId -q ".[0].databaseId"\`
112+
gh run watch \`gh run list -R npm/cli --workspace release -b latest -L 1 --json databaseId -q ".[0].databaseId"\`
113113
\`\`\`
114114
115115
- [ ] 9. Mark GitHub Release as \`latest\`

tap-snapshots/test/release/release-manager-prerelease.js.test.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ exports[`test/release/release-manager.js > TAP > prerelease > must match snapsho
100100
You can watch the release workflow in your terminal with the following command:
101101
102102
\`\`\`
103-
gh run watch \`gh run list -R npm/cli -w release -b latest -L 1 --json databaseId -q ".[0].databaseId"\`
103+
gh run watch \`gh run list -R npm/cli --workspace release -b latest -L 1 --json databaseId -q ".[0].databaseId"\`
104104
\`\`\`
105105
106106
- [ ] 8. Mark GitHub Release as \`latest\`

tap-snapshots/test/release/release-manager-publish-and-lockfile.js.test.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ exports[`test/release/release-manager.js > TAP > publish and lockfile > must mat
2525
Release Please will run on the just pushed release commit and create GitHub releases and tags for each package.
2626
2727
\`\`\`sh
28-
gh run watch -R npm/node-semver $(gh run list -R npm/node-semver -w release -b main -L 1 --json databaseId -q ".[0].databaseId")
28+
gh run watch -R npm/node-semver $(gh run list -R npm/node-semver --workspace release -b main -L 1 --json databaseId -q ".[0].databaseId")
2929
\`\`\`
3030
`

tap-snapshots/test/release/release-manager-single-release.js.test.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ exports[`test/release/release-manager.js > TAP > single release > must match sna
3737
Release Please will run on the just pushed release commit and create GitHub releases and tags for each package.
3838
3939
\`\`\`sh
40-
gh run watch -R npm/node-semver $(gh run list -R npm/node-semver -w release -b main -L 1 --json databaseId -q ".[0].databaseId")
40+
gh run watch -R npm/node-semver $(gh run list -R npm/node-semver --workspace release -b main -L 1 --json databaseId -q ".[0].databaseId")
4141
\`\`\`
4242
`

test/apply/release.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ t.test('no workspace flags in commands', async t => {
1515
const ciRelease = await s.readFile(join('.github', 'workflows', 'ci-release.yml'))
1616

1717
t.match(ciRelease, '--ignore-scripts\n')
18-
t.notMatch(ciRelease, '--ignore-scripts -ws -iwr --if-present\n')
18+
t.notMatch(ciRelease, '--ignore-scripts --workspaces --include-workspace-root --if-present\n')
1919

2020
const release = await s.readFile(join('.github', 'workflows', 'release.yml'))
2121
t.match(release, '--publish')
@@ -33,7 +33,7 @@ t.test('uses workspace flags in commands', async t => {
3333
const ciRelease = await s.readFile(join('.github', 'workflows', 'ci-release.yml'))
3434

3535
t.notMatch(ciRelease, '--ignore-scripts\n')
36-
t.match(ciRelease, '--ignore-scripts -ws -iwr --if-present\n')
36+
t.match(ciRelease, '--ignore-scripts --workspaces --include-workspace-root --if-present\n')
3737
})
3838

3939
t.test('backport', async t => {

test/fixtures/nocks/release-please-cases-chore-commit.json

+1-1
Large diffs are not rendered by default.

test/fixtures/nocks/release-please-cases-fix-all.json

+1-1
Large diffs are not rendered by default.

test/fixtures/nocks/release-please-cases-fix-one.json

+1-1
Large diffs are not rendered by default.

test/fixtures/nocks/release-please-cases-prerelease.json

+1-1
Large diffs are not rendered by default.

test/release/release-manager.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ t.test('repo doesnt exist', async t => {
5858
t.test('workspace names', async t => {
5959
const cwd = t.testdir()
6060
execSync('npm init -y', { cwd })
61-
execSync('npm init -y -w ws1', { cwd })
62-
execSync('npm pkg set name="@npmcli/arborist" -w ws1', { cwd })
63-
execSync('npm init -y -w libnpmdiff', { cwd })
61+
execSync('npm init -y --workspace ws1', { cwd })
62+
execSync('npm pkg set name="@npmcli/arborist" --workspace ws1', { cwd })
63+
execSync('npm init -y --workspace libnpmdiff', { cwd })
6464
t.resolveMatchSnapshot(releaseManager(t, { cwd, pr: 6923, repo: 'npm/cli' }))
6565
})

0 commit comments

Comments
 (0)