Skip to content

chore: publish NPM packages from CI MONGOSH-246 #535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jan 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ functions:
export NODE_JS_VERSION=${node_js_version}
source .evergreen/.setup_env
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
echo "//registry.npmjs.org/:_authToken=${DEVTOOLSBOT_NPM_TOKEN}" > .npmrc
npm run evergreen-release publish

# Tasks will show up as the individual blocks in the Evergreen UI that can
Expand Down
16 changes: 8 additions & 8 deletions config/build.conf.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const child_process = require('child_process');

const path = require('path');
const os = require('os');

Expand All @@ -11,22 +11,22 @@ const ROOT = path.join(__dirname, '..');
/**
* The mongosh package.
*/
const MONGOSH = path.join(ROOT, 'packages', 'cli-repl');
const CLI_REPL_DIR = path.join(ROOT, 'packages', 'cli-repl');

/**
* The project config.
*/
const CONFIG = require(path.join(MONGOSH, 'package.json'));
const CLI_REPL_PACKAGE_JSON = require(path.join(CLI_REPL_DIR, 'package.json'));

/**
* The input for the build.
*/
const INPUT = path.join(MONGOSH, 'lib', 'run.js');
const INPUT = path.join(CLI_REPL_DIR, 'lib', 'run.js');

/**
* The input for the exec.
*/
const EXEC_INPUT = path.join(MONGOSH, 'dist', 'mongosh.js');
const EXEC_INPUT = path.join(CLI_REPL_DIR, 'dist', 'mongosh.js');

/**
* The output dir for the build.
Expand All @@ -36,7 +36,7 @@ const OUTPUT_DIR = path.join(ROOT, 'dist');
/**
* Analytics configuration file.
*/
const ANALYTICS_CONFIG = path.join(MONGOSH, 'lib', 'analytics-config.js');
const ANALYTICS_CONFIG_FILE_PATH = path.join(CLI_REPL_DIR, 'lib', 'analytics-config.js');

/**
* The bundle id for MacOs.
Expand All @@ -56,12 +56,12 @@ const BUILD_VARIANT = (process.env.BUILD_VARIANT || '').split('_')[0];
* Export the configuration for the build.
*/
module.exports = {
version: CONFIG.version,
version: CLI_REPL_PACKAGE_JSON.version,
rootDir: ROOT,
input: INPUT,
execInput: EXEC_INPUT,
outputDir: OUTPUT_DIR,
analyticsConfig: ANALYTICS_CONFIG,
analyticsConfigFilePath: ANALYTICS_CONFIG_FILE_PATH,
project: process.env.PROJECT,
revision: REVISION,
branch: process.env.BRANCH_NAME,
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"packages": [
"packages/*"
],
"version": "0.6.1"
"version": "0.0.0-dev.0"
}
28 changes: 18 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"compile-all": "npm run compile-compass && npm run compile-exec",
"preevergreen-release": "npm run compile-ts",
"evergreen-release": "node scripts/evergreen-release.js",
"publish-npm": "node scripts/publish-npm.js",
"report-missing-help": "lerna run --stream --scope @mongosh/shell-api report-missing-help",
"report-supported-api": "lerna run --stream --scope @mongosh/shell-api report-supported-api",
"generate-homebrew-formula": "node scripts/generate-homebrew-formula",
Expand Down Expand Up @@ -133,7 +132,7 @@
"nyc": "^15.1.0",
"parcel-bundler": "^1.12.4",
"pkg-deb": "^1.1.2",
"pkg-rpm": "^1.0.2",
"pkg-rpm": "^1.0.3",
"rimraf": "^3.0.2",
"semver": "^7.3.2",
"sinon": "^7.5.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/async-rewriter/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/async-rewriter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mongosh/async-rewriter",
"version": "0.6.1",
"version": "0.0.0-dev.0",
"description": "MongoDB Shell Async Rewriter Package",
"main": "./lib/index.js",
"scripts": {
Expand Down Expand Up @@ -32,7 +32,7 @@
"@babel/template": "^7.8.6",
"@babel/traverse": "^7.9.0",
"@babel/types": "^7.9.0",
"@mongosh/errors": "^0.6.1",
"@mongosh/errors": "0.0.0-dev.0",
"@types/babel__core": "^7.1.6",
"@types/babel__traverse": "^7.0.9",
"acorn": "^7.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/autocomplete/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/autocomplete/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mongosh/autocomplete",
"version": "0.6.1",
"version": "0.0.0-dev.0",
"description": "MongoDB Shell Autocomplete Package",
"homepage": "https://github.com/mongodb-js/mongosh",
"license": "Apache-2.0",
Expand Down Expand Up @@ -28,7 +28,7 @@
"mocha": "^7.1.2"
},
"dependencies": {
"@mongosh/shell-api": "^0.6.1",
"@mongosh/shell-api": "0.0.0-dev.0",
"mongodb-ace-autocompleter": "^0.4.14",
"semver": "^7.3.2"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-repl/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions packages/browser-repl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mongosh/browser-repl",
"version": "0.6.1",
"version": "0.0.0-dev.0",
"description": "Browser presentation component for Mongo Shell",
"engines": {
"node": ">=12.4.0"
Expand Down Expand Up @@ -39,11 +39,11 @@
"@leafygreen-ui/icon": "^4.0.0",
"@leafygreen-ui/palette": "^2.0.0",
"@leafygreen-ui/syntax": "^2.2.0",
"@mongosh/browser-runtime-core": "^0.6.1",
"@mongosh/history": "^0.6.1",
"@mongosh/i18n": "^0.6.1",
"@mongosh/service-provider-core": "^0.6.1",
"@mongosh/shell-evaluator": "^0.6.1",
"@mongosh/browser-runtime-core": "0.0.0-dev.0",
"@mongosh/history": "0.0.0-dev.0",
"@mongosh/i18n": "0.0.0-dev.0",
"@mongosh/service-provider-core": "0.0.0-dev.0",
"@mongosh/shell-evaluator": "0.0.0-dev.0",
"pretty-bytes": "^5.3.0",
"text-table": "^0.2.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-runtime-core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions packages/browser-runtime-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mongosh/browser-runtime-core",
"version": "0.6.1",
"version": "0.0.0-dev.0",
"description": "Mongosh browser runtime core",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -29,17 +29,17 @@
"access": "public"
},
"devDependencies": {
"@mongosh/types": "^0.6.1",
"@mongosh/types": "0.0.0-dev.0",
"@types/babel__generator": "^7.6.2",
"@types/babel__template": "^7.0.3",
"rimraf": "^3.0.2"
},
"dependencies": {
"@babel/generator": "^7.9.4",
"@babel/parser": "^7.9.4",
"@mongosh/autocomplete": "^0.6.1",
"@mongosh/service-provider-core": "^0.6.1",
"@mongosh/shell-api": "^0.6.1",
"@mongosh/shell-evaluator": "^0.6.1"
"@mongosh/autocomplete": "0.0.0-dev.0",
"@mongosh/service-provider-core": "0.0.0-dev.0",
"@mongosh/shell-api": "0.0.0-dev.0",
"@mongosh/shell-evaluator": "0.0.0-dev.0"
}
}
2 changes: 1 addition & 1 deletion packages/browser-runtime-electron/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions packages/browser-runtime-electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mongosh/browser-runtime-electron",
"version": "0.6.1",
"version": "0.0.0-dev.0",
"description": "Mongosh browser runtime electron",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -29,13 +29,13 @@
"access": "public"
},
"dependencies": {
"@mongosh/types": "^0.6.1",
"@mongosh/browser-runtime-core": "^0.6.1",
"@mongosh/service-provider-core": "^0.6.1",
"@mongosh/shell-evaluator": "^0.6.1"
"@mongosh/browser-runtime-core": "0.0.0-dev.0",
"@mongosh/service-provider-core": "0.0.0-dev.0",
"@mongosh/shell-evaluator": "0.0.0-dev.0",
"@mongosh/types": "0.0.0-dev.0"
},
"devDependencies": {
"@mongosh/service-provider-server": "^0.6.1",
"@mongosh/service-provider-server": "0.0.0-dev.0",
"@types/sinon": "^7.5.1",
"@types/sinon-chai": "^3.2.3",
"rimraf": "^3.0.2"
Expand Down
6 changes: 3 additions & 3 deletions packages/build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const config = {
input: 'input',
execInput: 'execInput',
outputDir: 'outputDir',
analyticsConfig: 'analyticsConfig',
analyticsConfigFilePath: 'analyticsConfigFilePath',
project: 'project',
revision: 'revision',
branch: 'branch',
Expand Down Expand Up @@ -123,15 +123,15 @@ const config = {
input: 'path/to/input',
execInput: 'path/to/exec/input',
outputDir: 'path/to/output/directory',
analyticsConfig: 'path/to/analytics/config',
analyticsConfigFilePath: 'path/to/analytics/config',
segmentKey: 'SEGMENT_API_KEY_23481k',
}
await compileExec(
config.input,
config.execInput,
config.outputDir,
os.platform(),
config.analyticsConfig,
config.analyticsConfigFilePath,
config.segmentKey
);
```
Expand Down
2 changes: 1 addition & 1 deletion packages/build/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/build/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mongosh/build",
"version": "0.6.1",
"version": "0.0.0-dev.0",
"private": true,
"description": "MongoDB Shell Build Tools",
"main": "lib/index.js",
Expand Down
19 changes: 15 additions & 4 deletions packages/build/src/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,25 @@ const createAnalyticsConfig = (segmentKey: string): string => {
/**
* Write the analytics config.
*
* @param {string} file - The filename.
* @param {string} analyticsConfigFilePath - The filename.
* @param {string} segmentKey - The segment key.
*/
const writeAnalyticsConfig = (file: string, segmentKey: string): Promise<void> => {
const writeAnalyticsConfig = (
analyticsConfigFilePath?: string,
segmentKey?: string
): Promise<void> => {
if (!analyticsConfigFilePath) {
throw new Error('Analytics config file path is required');
}

if (!segmentKey) {
throw new Error('Segment key is required');
}

const template = createAnalyticsConfig(segmentKey);
console.info('mongosh: writing analytics template:', file);
console.info('mongosh: writing analytics template:', analyticsConfigFilePath);
// Cannot use fs/promises on Cygwin.
return util.promisify(fs.writeFile)(file, template);
return util.promisify(fs.writeFile)(analyticsConfigFilePath, template);
};

export default writeAnalyticsConfig;
Expand Down
2 changes: 1 addition & 1 deletion packages/build/src/barque.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Barque', () => {
input: 'input',
execInput: 'execInput',
outputDir: 'outputDir',
analyticsConfig: 'analyticsConfig',
analyticsConfigFilePath: 'analyticsConfigFilePath',
project: 'project',
revision: 'revision',
branch: 'branch',
Expand Down
4 changes: 2 additions & 2 deletions packages/build/src/compile-exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ const compileExec = async(
execInput: string,
outputDir: string,
execNodeVersion: string,
analyticsConfig: string,
analyticsConfigFilePath: string,
segmentKey: string): Promise<string> => {
// We use Parcel to bundle up everything into a single JS under
// cli-repl/dist/mongosh.js that the executable generator can use as input.
// This JS also takes care of the analytics config file being written.
await generateInput(input, execInput, analyticsConfig, segmentKey);
await generateInput(input, execInput, analyticsConfigFilePath, segmentKey);

const executable = executablePath(outputDir, os.platform());
console.info('mongosh: creating binary:', executable);
Expand Down
Loading