Skip to content

Commit e9a9f49

Browse files
committed
wip remove publish-npm
1 parent ef39f58 commit e9a9f49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+137
-294
lines changed

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"packages": [
33
"packages/*"
44
],
5-
"version": "0.6.1"
5+
"version": "0.0.0-dev.0"
66
}

packages/async-rewriter/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/async-rewriter/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mongosh/async-rewriter",
3-
"version": "0.6.1",
3+
"version": "0.0.0-dev.0",
44
"description": "MongoDB Shell Async Rewriter Package",
55
"main": "./lib/index.js",
66
"scripts": {
@@ -32,7 +32,7 @@
3232
"@babel/template": "^7.8.6",
3333
"@babel/traverse": "^7.9.0",
3434
"@babel/types": "^7.9.0",
35-
"@mongosh/errors": "^0.6.1",
35+
"@mongosh/errors": "0.0.0-dev.0",
3636
"@types/babel__core": "^7.1.6",
3737
"@types/babel__traverse": "^7.0.9",
3838
"acorn": "^7.2.0",

packages/autocomplete/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/autocomplete/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mongosh/autocomplete",
3-
"version": "0.6.1",
3+
"version": "0.0.0-dev.0",
44
"description": "MongoDB Shell Autocomplete Package",
55
"homepage": "https://github.com/mongodb-js/mongosh",
66
"license": "Apache-2.0",
@@ -28,7 +28,7 @@
2828
"mocha": "^7.1.2"
2929
},
3030
"dependencies": {
31-
"@mongosh/shell-api": "^0.6.1",
31+
"@mongosh/shell-api": "0.0.0-dev.0",
3232
"mongodb-ace-autocompleter": "^0.4.14",
3333
"semver": "^7.3.2"
3434
}

packages/browser-repl/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/browser-repl/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mongosh/browser-repl",
3-
"version": "0.6.1",
3+
"version": "0.0.0-dev.0",
44
"description": "Browser presentation component for Mongo Shell",
55
"engines": {
66
"node": ">=12.4.0"
@@ -39,11 +39,11 @@
3939
"@leafygreen-ui/icon": "^4.0.0",
4040
"@leafygreen-ui/palette": "^2.0.0",
4141
"@leafygreen-ui/syntax": "^2.2.0",
42-
"@mongosh/browser-runtime-core": "^0.6.1",
43-
"@mongosh/history": "^0.6.1",
44-
"@mongosh/i18n": "^0.6.1",
45-
"@mongosh/service-provider-core": "^0.6.1",
46-
"@mongosh/shell-evaluator": "^0.6.1",
42+
"@mongosh/browser-runtime-core": "0.0.0-dev.0",
43+
"@mongosh/history": "0.0.0-dev.0",
44+
"@mongosh/i18n": "0.0.0-dev.0",
45+
"@mongosh/service-provider-core": "0.0.0-dev.0",
46+
"@mongosh/shell-evaluator": "0.0.0-dev.0",
4747
"pretty-bytes": "^5.3.0",
4848
"text-table": "^0.2.0"
4949
},

packages/browser-runtime-core/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/browser-runtime-core/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mongosh/browser-runtime-core",
3-
"version": "0.6.1",
3+
"version": "0.0.0-dev.0",
44
"description": "Mongosh browser runtime core",
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",
@@ -29,17 +29,17 @@
2929
"access": "public"
3030
},
3131
"devDependencies": {
32-
"@mongosh/types": "^0.6.1",
32+
"@mongosh/types": "0.0.0-dev.0",
3333
"@types/babel__generator": "^7.6.2",
3434
"@types/babel__template": "^7.0.3",
3535
"rimraf": "^3.0.2"
3636
},
3737
"dependencies": {
3838
"@babel/generator": "^7.9.4",
3939
"@babel/parser": "^7.9.4",
40-
"@mongosh/autocomplete": "^0.6.1",
41-
"@mongosh/service-provider-core": "^0.6.1",
42-
"@mongosh/shell-api": "^0.6.1",
43-
"@mongosh/shell-evaluator": "^0.6.1"
40+
"@mongosh/autocomplete": "0.0.0-dev.0",
41+
"@mongosh/service-provider-core": "0.0.0-dev.0",
42+
"@mongosh/shell-api": "0.0.0-dev.0",
43+
"@mongosh/shell-evaluator": "0.0.0-dev.0"
4444
}
4545
}

packages/browser-runtime-electron/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/browser-runtime-electron/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mongosh/browser-runtime-electron",
3-
"version": "0.6.1",
3+
"version": "0.0.0-dev.0",
44
"description": "Mongosh browser runtime electron",
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",
@@ -29,13 +29,13 @@
2929
"access": "public"
3030
},
3131
"dependencies": {
32-
"@mongosh/types": "^0.6.1",
33-
"@mongosh/browser-runtime-core": "^0.6.1",
34-
"@mongosh/service-provider-core": "^0.6.1",
35-
"@mongosh/shell-evaluator": "^0.6.1"
32+
"@mongosh/browser-runtime-core": "0.0.0-dev.0",
33+
"@mongosh/service-provider-core": "0.0.0-dev.0",
34+
"@mongosh/shell-evaluator": "0.0.0-dev.0",
35+
"@mongosh/types": "0.0.0-dev.0"
3636
},
3737
"devDependencies": {
38-
"@mongosh/service-provider-server": "^0.6.1",
38+
"@mongosh/service-provider-server": "0.0.0-dev.0",
3939
"@types/sinon": "^7.5.1",
4040
"@types/sinon-chai": "^3.2.3",
4141
"rimraf": "^3.0.2"

packages/build/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/build/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mongosh/build",
3-
"version": "0.6.1",
3+
"version": "0.0.0-dev.0",
44
"private": true,
55
"description": "MongoDB Shell Build Tools",
66
"main": "lib/index.js",

packages/build/src/npm-packages.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import { spawnSync } from 'child_process';
1+
import { execFileSync } from 'child_process';
22
import path from 'path';
3+
import writeAnalyticsConfig from './analytics';
4+
import Config from './config';
35

46
const PLACEHOLDER_VERSION = '0.0.0-dev.0';
57
const PROJECT_ROOT = path.resolve(__dirname, '..', '..', '..');
@@ -10,7 +12,7 @@ export function bumpNpmPackages(version: string): void {
1012
return;
1113
}
1214

13-
spawnSync(LERNA_BIN, [
15+
execFileSync(LERNA_BIN, [
1416
'version',
1517
version,
1618
'--no-changelog',
@@ -25,7 +27,13 @@ export function bumpNpmPackages(version: string): void {
2527
});
2628
}
2729

28-
export function publishNpmPackages(): void {
30+
export async function publishNpmPackages(config: Config): Promise<void> {
31+
// ensures the segment api key to be present in the published packages
32+
await writeAnalyticsConfig(
33+
config.analyticsConfigFilePath,
34+
config.segmentKey
35+
);
36+
2937
const packages = listNpmPackages();
3038

3139
const versions = Array.from(new Set(packages.map(({ version }) => version)));
@@ -38,7 +46,7 @@ export function publishNpmPackages(): void {
3846
throw new Error('Refusing to publish packages with placeholder version');
3947
}
4048

41-
spawnSync(LERNA_BIN, [
49+
execFileSync(LERNA_BIN, [
4250
'publish',
4351
'from-package',
4452
'--no-changelog',
@@ -54,11 +62,11 @@ export function publishNpmPackages(): void {
5462
}
5563

5664
function listNpmPackages(): {version: string}[] {
57-
const lernaListOutput = spawnSync(
65+
const lernaListOutput = execFileSync(
5866
LERNA_BIN, [
5967
'--json',
6068
], { cwd: PROJECT_ROOT }
61-
).stdout.toString();
69+
).toString();
6270

6371
const packages = JSON.parse(lernaListOutput);
6472
return packages;

packages/build/src/publish.spec.ts

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ function createStubRepo(overrides?: any): GithubRepo {
1414
describe('publish', () => {
1515
let config: Config;
1616
let uploadDownloadCenterConfig: (version: string, awsKey: string, awsSecret: string) => Promise<any>;
17+
let publishNpmPackages: (config: Config) => Promise<void>;
1718
let githubRepo: GithubRepo;
1819

1920
beforeEach(() => {
@@ -23,7 +24,7 @@ describe('publish', () => {
2324
input: 'input',
2425
execInput: 'execInput',
2526
outputDir: 'outputDir',
26-
analyticsConfig: 'analyticsConfig',
27+
analyticsConfigFilePath: 'analyticsConfigFilePath',
2728
project: 'project',
2829
revision: 'revision',
2930
branch: 'branch',
@@ -48,6 +49,7 @@ describe('publish', () => {
4849
};
4950

5051
uploadDownloadCenterConfig = sinon.spy();
52+
publishNpmPackages = sinon.spy();
5153
githubRepo = createStubRepo();
5254
});
5355

@@ -62,7 +64,8 @@ describe('publish', () => {
6264
await publish(
6365
config,
6466
githubRepo,
65-
uploadDownloadCenterConfig
67+
uploadDownloadCenterConfig,
68+
publishNpmPackages
6669
);
6770

6871
expect(uploadDownloadCenterConfig).to.have.been.calledWith(
@@ -76,11 +79,23 @@ describe('publish', () => {
7679
await publish(
7780
config,
7881
githubRepo,
79-
uploadDownloadCenterConfig
82+
uploadDownloadCenterConfig,
83+
publishNpmPackages
8084
);
8185

8286
expect(githubRepo.promoteRelease).to.have.been.calledWith(config);
8387
});
88+
89+
it('publishes NPM packages', async() => {
90+
await publish(
91+
config,
92+
githubRepo,
93+
uploadDownloadCenterConfig,
94+
publishNpmPackages
95+
);
96+
97+
expect(publishNpmPackages).to.have.been.calledWith();
98+
});
8499
});
85100

86101
context('if is not a public release', () => {
@@ -94,7 +109,8 @@ describe('publish', () => {
94109
await publish(
95110
config,
96111
githubRepo,
97-
uploadDownloadCenterConfig
112+
uploadDownloadCenterConfig,
113+
publishNpmPackages
98114
);
99115

100116
expect(uploadDownloadCenterConfig).not.to.have.been.called;
@@ -104,10 +120,22 @@ describe('publish', () => {
104120
await publish(
105121
config,
106122
githubRepo,
107-
uploadDownloadCenterConfig
123+
uploadDownloadCenterConfig,
124+
publishNpmPackages
108125
);
109126

110127
expect(githubRepo.promoteRelease).not.to.have.been.called;
111128
});
129+
130+
it('does not publish npm packages', async() => {
131+
await publish(
132+
config,
133+
githubRepo,
134+
uploadDownloadCenterConfig,
135+
publishNpmPackages
136+
);
137+
138+
expect(publishNpmPackages).not.to.have.been.called;
139+
});
112140
});
113141
});

packages/build/src/publish.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { GithubRepo } from './github-repo';
22
import Config from './config';
33
import { redactConfig } from './redact-config';
4-
// import { publishNpmPackages } from './npm-packages';
54

65
export default async function publish(
76
config: Config,
87
githubRepo: GithubRepo,
9-
uploadDownloadCenterConfig: (version: string, awsKey: string, awsSecret: string) => Promise<any>
8+
uploadDownloadCenterConfig: (version: string, awsKey: string, awsSecret: string) => Promise<any>,
9+
publishNpmPackages: (config: Config) => Promise<void>,
1010
): Promise<void> {
1111
console.info(
1212
'mongosh: beginning publish release with config:',
@@ -23,8 +23,6 @@ export default async function publish(
2323

2424
await githubRepo.promoteRelease(config);
2525

26-
// publishNpmPackages();
26+
await publishNpmPackages(config);
2727
console.info('mongosh: finished release process.');
2828
}
29-
30-

packages/build/src/release.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import publish from './publish';
1616
import { redactConfig } from './redact-config';
1717
import Config from './config';
1818
import getReleaseVersionFromTag from './get-release-version-from-tag';
19-
import { bumpNpmPackages } from './npm-packages';
19+
import { bumpNpmPackages, publishNpmPackages } from './npm-packages';
2020

2121
/**
2222
* Run the release process.
@@ -92,7 +92,8 @@ export default async function release(
9292
await publish(
9393
config,
9494
githubRepo,
95-
uploadDownloadCenterConfig
95+
uploadDownloadCenterConfig,
96+
publishNpmPackages
9697
);
9798
} else {
9899
throw new Error(`Unknown command: ${command}`);

packages/cli-repl/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)