Skip to content

Commit 72f04bd

Browse files
committed
Apply most changes from review
1 parent fc9a406 commit 72f04bd

File tree

9 files changed

+23
-22
lines changed

9 files changed

+23
-22
lines changed

.evergreen/evergreen.yml.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -917,9 +917,9 @@ functions:
917917
{
918918
export NODE_JS_VERSION=${node_js_version}
919919
source .evergreen/setup-env.sh
920-
git add .
921-
git commit --no-allow-empty -m "chore(release): bump to prepare for mongosh release"
922920
npm run evergreen-release draft
921+
git add .
922+
git commit --no-allow-empty -m "chore(release): bump to prepare for mongosh release"
923923
}
924924

925925
release_publish_download_and_list_artifacts:

.github/workflows/publish-auxiliary-packages.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ jobs:
4747
env:
4848
NPM_TOKEN: ${{ secrets.DEVTOOLSBOT_NPM_TOKEN }}
4949
run: |
50-
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
50+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
5151
npm config list
5252
echo "Publishing packages as $(npm whoami)"
53-
git update-index --assume-unchanged .npmrc
5453
npm run publish-auxiliary
5554

packages/build/src/config/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ export interface Config {
4646
artifactUrlExtraTag?: string;
4747
manpage?: ManPageConfig;
4848
isDryRun?: boolean;
49-
isAuxiliaryOnly?: boolean;
49+
useAuxiliaryPackagesOnly?: boolean;
5050
}

packages/build/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ if (require.main === module) {
5959
}
6060

6161
config.isDryRun ||= process.argv.includes('--dry-run');
62-
config.isAuxiliaryOnly ||= process.argv.includes('--auxiliary');
62+
config.useAuxiliaryPackagesOnly ||= process.argv.includes('--auxiliary');
6363

6464
await release(command, config);
6565
}

packages/build/src/npm-packages/bump.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ export async function bumpMongoshReleasePackages(): Promise<void> {
5757
}
5858
}
5959

60-
/** Bumps independent packages without setting a new version of mongosh. */
61-
export function bumpIndependentPackages() {
60+
/** Bumps auxiliary packages without setting a new version of mongosh. */
61+
export function bumpAuxiliaryPackages() {
6262
spawnSync('bump-monorepo-packages', [], {
6363
stdio: 'inherit',
6464
cwd: PROJECT_ROOT,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export { bumpIndependentPackages } from './bump';
1+
export { bumpAuxiliaryPackages } from './bump';
22
export { publishNpmPackages } from './publish';

packages/build/src/npm-packages/publish.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import {
77
} from './constants';
88
import type { LernaPackageDescription } from './list';
99
import { listNpmPackages as listNpmPackagesFn } from './list';
10-
import { spawnSync } from '../helpers/spawn-sync';
10+
import { spawnSync as spawnSyncFn } from '../helpers/spawn-sync';
1111
import type { SpawnSyncOptionsWithStringEncoding } from 'child_process';
1212

1313
export function publishNpmPackages(
1414
isDryRun = false,
15-
isAuxiliaryOnly = false,
15+
useAuxiliaryPackagesOnly = false,
1616
listNpmPackages: typeof listNpmPackagesFn = listNpmPackagesFn,
1717
markBumpedFilesAsAssumeUnchangedFn: typeof markBumpedFilesAsAssumeUnchanged = markBumpedFilesAsAssumeUnchanged,
18-
spawnSyncFn: typeof spawnSync = spawnSync
18+
spawnSync: typeof spawnSyncFn = spawnSyncFn
1919
): void {
2020
const commandOptions: SpawnSyncOptionsWithStringEncoding = {
2121
stdio: 'inherit',
@@ -30,7 +30,7 @@ export function publishNpmPackages(
3030
(packageConfig) => !EXCLUDE_RELEASE_PACKAGES.includes(packageConfig.name)
3131
);
3232

33-
if (isAuxiliaryOnly) {
33+
if (useAuxiliaryPackagesOnly) {
3434
packages = packages.filter(
3535
(packageConfig) => !MONGOSH_RELEASE_PACKAGES.includes(packageConfig.name)
3636
);
@@ -39,7 +39,7 @@ export function publishNpmPackages(
3939
// we use git update-index --assume-unchanged on files we know have been bumped
4040
markBumpedFilesAsAssumeUnchangedFn(packages, true);
4141
try {
42-
spawnSyncFn(
42+
spawnSync(
4343
LERNA_BIN,
4444
[
4545
'publish',
@@ -48,7 +48,9 @@ export function publishNpmPackages(
4848
'--no-changelog',
4949
'--exact',
5050
// During mongosh releases we handle the tags manually
51-
...(!isAuxiliaryOnly ? ['--no-git-tag-version', '--no-push'] : []),
51+
...(!useAuxiliaryPackagesOnly
52+
? ['--no-git-tag-version', '--no-push']
53+
: []),
5254
'--force-publish',
5355
'--yes',
5456
'--no-verify-access',
@@ -59,7 +61,7 @@ export function publishNpmPackages(
5961
markBumpedFilesAsAssumeUnchangedFn(packages, false);
6062
}
6163

62-
if (!isAuxiliaryOnly) {
64+
if (!useAuxiliaryPackagesOnly) {
6365
const mongoshVersion = packages.find(
6466
(packageConfig) => packageConfig.name === 'mongosh'
6567
)?.version;
@@ -81,7 +83,7 @@ export function publishNpmPackages(
8183
export function markBumpedFilesAsAssumeUnchanged(
8284
packages: LernaPackageDescription[],
8385
assumeUnchanged: boolean,
84-
spawnSyncFn: typeof spawnSync = spawnSync
86+
spawnSync: typeof spawnSyncFn = spawnSyncFn
8587
): void {
8688
const filesToAssume = [
8789
path.resolve(PROJECT_ROOT, 'lerna.json'),
@@ -93,7 +95,7 @@ export function markBumpedFilesAsAssumeUnchanged(
9395
}
9496

9597
for (const f of filesToAssume) {
96-
spawnSyncFn(
98+
spawnSync(
9799
'git',
98100
[
99101
'update-index',

packages/build/src/release.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
} from './evergreen';
1515
import { GithubRepo } from '@mongodb-js/devtools-github-repo';
1616
import { publishToHomebrew } from './homebrew';
17-
import { bumpIndependentPackages, publishNpmPackages } from './npm-packages';
17+
import { bumpAuxiliaryPackages, publishNpmPackages } from './npm-packages';
1818
import { runPackage } from './packaging';
1919
import { runDraft } from './run-draft';
2020
import { runPublish } from './run-publish';
@@ -56,8 +56,8 @@ export async function release(
5656
);
5757

5858
if (command === 'bump') {
59-
bumpIndependentPackages();
60-
if (!config.isAuxiliaryOnly) {
59+
bumpAuxiliaryPackages();
60+
if (!config.useAuxiliaryPackagesOnly) {
6161
await bumpMongoshReleasePackages();
6262
}
6363
return;

packages/build/src/run-publish.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export async function runPublish(
8181
// ensures the segment api key to be present in the published packages
8282
await writeBuildInfo(config, 'packaged');
8383

84-
publishNpmPackages(config.isDryRun, config.isAuxiliaryOnly);
84+
publishNpmPackages(config.isDryRun, config.useAuxiliaryPackagesOnly);
8585

8686
await publishToHomebrew(
8787
homebrewCoreGithubRepo,

0 commit comments

Comments
 (0)