Skip to content

Commit

Permalink
chore(repo): switch publishing to use lerna (#10293)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz committed May 20, 2022
1 parent 5671b53 commit 04985be
Show file tree
Hide file tree
Showing 61 changed files with 1,899 additions and 1,383 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ jest.debug.config.js
dep-graph/client/src/assets/environment.js
/nx-dev/nx-dev/public/documentation
/nx-dev/nx-dev/public/images/open-graph
# Lerna creates this
CHANGELOG.md
10 changes: 10 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"packages": ["build/packages/*"],
"version": "14.1.7",
"granularPathspec": false,
"command": {
"publish": {
"graphType": "all"
}
}
}
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"name": "@nrwl/nx-source",
"version": "14.1.8-beta.1",
"description": "Smart, Fast and Extensible Build System",
"homepage": "https://nx.dev",
"private": true,
"scripts": {
"build": "./scripts/package.sh --local",
"build": "nx run-many --target build --all --parallel 8 --exclude nx-dev,typedoc-theme",
"commit": "git-cz",
"check-commit": "node ./scripts/commit-lint.js",
"check-format": "nx format:check --all",
Expand All @@ -17,7 +16,7 @@
"e2e-start-local-registry": "node ./scripts/e2e-start-local-registry.js",
"e2e-build-package-publish": "ts-node -P ./scripts/tsconfig.e2e.json ./scripts/e2e-build-package-publish.ts",
"format": "nx format",
"nx-release": "./scripts/nx-release.js",
"nx-release": "ts-node -P ./scripts/tsconfig.scripts.json ./scripts/nx-release",
"depcheck": "ts-node -P ./scripts/tsconfig.scripts.json ./scripts/depcheck",
"local-registry": "./scripts/local-registry.sh",
"documentation": "ts-node -P scripts/tsconfig.scripts.json ./scripts/documentation/documentation.ts && yarn check-documentation-map",
Expand Down Expand Up @@ -174,6 +173,7 @@
"karma-jasmine-html-reporter": "^0.2.2",
"karma-webpack": "4.0.2",
"kill-port": "^1.6.1",
"lerna": "^4.0.0",
"less": "3.12.2",
"less-loader": "^10.1.0",
"license-webpack-plugin": "^4.0.2",
Expand Down Expand Up @@ -206,7 +206,6 @@
"react-router-dom": "6.3.0",
"react-test-renderer": "18.1.0",
"regenerator-runtime": "0.13.7",
"release-it": "^14.11.3",
"rollup": "^2.56.2",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-peer-deps-external": "^2.2.4",
Expand Down
10 changes: 5 additions & 5 deletions packages/add-nx-to-monorepo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
},
"homepage": "https://nx.dev",
"dependencies": {
"strip-json-comments": "^3.1.1",
"ignore": "^5.0.4",
"@nrwl/workspace": "*",
"@nrwl/devkit": "*",
"nx": "*",
"@nrwl/devkit": "file:../devkit",
"@nrwl/workspace": "file:../workspace",
"enquirer": "~2.3.6",
"ignore": "^5.0.4",
"nx": "file:../nx",
"strip-json-comments": "^3.1.1",
"yargs-parser": "21.0.1"
}
}
5 changes: 2 additions & 3 deletions packages/add-nx-to-monorepo/src/add-nx-to-monorepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import * as stripJsonComments from 'strip-json-comments';
import * as path from 'path';
import * as fs from 'fs';
import * as cp from 'child_process';
import { execSync } from 'child_process';
// eslint-disable-next-line @typescript-eslint/no-var-requires
import * as enquirer from 'enquirer';
import * as yargsParser from 'yargs-parser';

import { execSync } from 'child_process';
import { output } from '@nrwl/devkit';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const ignore = require('ignore');
Expand Down Expand Up @@ -272,7 +271,7 @@ function deduceDefaultBase() {
function addDepsToPackageJson(repoRoot: string, useCloud: boolean) {
const json = readJsonFile(repoRoot, `package.json`);
if (!json.devDependencies) json.devDependencies = {};
json.devDependencies['nx'] = 'NX_VERSION';
json.devDependencies['nx'] = require('../package.json').version;
if (useCloud) {
json.devDependencies['@nrwl/nx-cloud'] = 'latest';
}
Expand Down
20 changes: 10 additions & 10 deletions packages/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,24 @@
},
"dependencies": {
"@angular-devkit/schematics": "~13.3.0",
"@nrwl/cypress": "*",
"@nrwl/devkit": "*",
"@nrwl/jest": "*",
"@nrwl/linter": "*",
"@nrwl/storybook": "*",
"@nrwl/workspace": "*",
"@schematics/angular": "~13.3.0",
"@nrwl/cypress": "file:../cypress",
"@nrwl/devkit": "file:../devkit",
"@nrwl/jest": "file:../jest",
"@nrwl/linter": "file:../linter",
"@nrwl/storybook": "file:../storybook",
"@nrwl/workspace": "file:../workspace",
"@phenomnomnominal/tsquery": "4.1.1",
"@schematics/angular": "~13.3.0",
"chalk": "4.1.0",
"chokidar": "^3.5.1",
"http-server": "^14.1.0",
"ignore": "^5.0.4",
"jasmine-marbles": "~0.8.4",
"rxjs-for-await": "0.0.2",
"webpack-merge": "5.7.3",
"semver": "7.3.4",
"ts-node": "~9.1.1",
"tsconfig-paths": "^3.9.0",
"semver": "7.3.4",
"webpack": "^5.58.1",
"http-server": "^14.1.0"
"webpack-merge": "5.7.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,8 @@ Object {
"@angular-eslint/eslint-plugin": "~13.1.0",
"@angular-eslint/eslint-plugin-template": "~13.1.0",
"@angular-eslint/template-parser": "~13.1.0",
"@nrwl/eslint-plugin-nx": "*",
"@nrwl/linter": "*",
"@nrwl/eslint-plugin-nx": "0.0.1",
"@nrwl/linter": "0.0.1",
"@typescript-eslint/eslint-plugin": "~5.18.0",
"@typescript-eslint/parser": "~5.18.0",
"eslint": "~8.12.0",
Expand Down Expand Up @@ -934,8 +934,8 @@ Object {
"@angular-eslint/eslint-plugin": "~13.1.0",
"@angular-eslint/eslint-plugin-template": "~13.1.0",
"@angular-eslint/template-parser": "~13.1.0",
"@nrwl/eslint-plugin-nx": "*",
"@nrwl/linter": "*",
"@nrwl/eslint-plugin-nx": "0.0.1",
"@nrwl/linter": "0.0.1",
"@typescript-eslint/eslint-plugin": "~5.18.0",
"@typescript-eslint/parser": "~5.18.0",
"eslint": "~8.12.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/src/utils/versions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const nxVersion = '*';
export const nxVersion = require('../../package.json').version;
export const angularVersion = '~13.3.0';
export const angularDevkitVersion = '~13.3.0';
export const angularJsVersion = '1.7.9';
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
},
"homepage": "https://nx.dev",
"dependencies": {
"nx": "*"
"nx": "file:../nx"
}
}
8 changes: 4 additions & 4 deletions packages/cra-to-nx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
},
"homepage": "https://nx.dev",
"dependencies": {
"tslib": "^2.3.0",
"@nrwl/workspace": "*",
"@nrwl/devkit": "*",
"nx": "*",
"@nrwl/devkit": "file:../devkit",
"@nrwl/workspace": "file:../workspace",
"fs-extra": "^10.1.0",
"nx": "file:../nx",
"tslib": "^2.3.0",
"yargs-parser": "21.0.1"
}
}
9 changes: 4 additions & 5 deletions packages/create-nx-plugin/bin/create-nx-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ import {
import enquirer = require('enquirer');
import yargsParser = require('yargs-parser');

const tsVersion = 'TYPESCRIPT_VERSION';
const cliVersion = 'NX_VERSION';
const nxVersion = 'NX_VERSION';
const prettierVersion = 'PRETTIER_VERSION';
const nxVersion = require('../package.json').version;
const tsVersion = 'TYPESCRIPT_VERSION'; // This gets replaced with the typescript version in the root package.json during build
const prettierVersion = 'PRETTIER_VERSION'; // This gets replaced with the prettier version in the root package.json during build

const parsedArgs = yargsParser(process.argv, {
string: ['pluginName', 'packageManager', 'importPath'],
Expand All @@ -41,7 +40,7 @@ function createSandbox(packageManager: string) {
writeJsonFile(path.join(tmpDir, 'package.json'), {
dependencies: {
'@nrwl/workspace': nxVersion,
nx: cliVersion,
nx: nxVersion,
typescript: tsVersion,
prettier: prettierVersion,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/create-nx-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
},
"homepage": "https://nx.dev",
"dependencies": {
"nx": "*",
"@nrwl/devkit": "*",
"@nrwl/devkit": "file:../devkit",
"enquirer": "~2.3.6",
"fs-extra": "^10.1.0",
"nx": "file:../nx",
"tmp": "~0.2.1",
"yargs-parser": "21.0.1"
}
Expand Down
3 changes: 3 additions & 0 deletions packages/create-nx-plugin/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
},
{
"command": "node ./scripts/copy-readme.js create-nx-plugin"
},
{
"command": "node ./scripts/replace-versions.js build/packages/create-nx-plugin/bin/create-nx-plugin.js"
}
],
"parallel": false
Expand Down
11 changes: 5 additions & 6 deletions packages/create-nx-workspace/bin/create-nx-workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,9 @@ const presetOptions: { name: Preset; message: string }[] = [
},
];

const tsVersion = 'TYPESCRIPT_VERSION';
const cliVersion = 'NX_VERSION';
const nxVersion = 'NX_VERSION';
const prettierVersion = 'PRETTIER_VERSION';
const nxVersion = require('../package.json').version;
const tsVersion = 'TYPESCRIPT_VERSION'; // This gets replaced with the typescript version in the root package.json during build
const prettierVersion = 'PRETTIER_VERSION'; // This gets replaced with the prettier version in the root package.json during build

export const commandsObject: yargs.Argv<Arguments> = yargs
.wrap(yargs.terminalWidth())
Expand Down Expand Up @@ -221,7 +220,7 @@ async function main(parsedArgs: yargs.Arguments<Arguments>) {
} = parsedArgs;

output.log({
title: `Nx is creating your v${cliVersion} workspace.`,
title: `Nx is creating your v${nxVersion} workspace.`,
bodyLines: [
'To make sure the command works reliably in all environments, and that the preset is applied correctly,',
`Nx will run "${packageManager} install" several times. Please wait.`,
Expand Down Expand Up @@ -714,7 +713,7 @@ async function createSandbox(packageManager: PackageManager) {
JSON.stringify({
dependencies: {
'@nrwl/workspace': nxVersion,
nx: cliVersion,
nx: nxVersion,
typescript: tsVersion,
prettier: prettierVersion,
},
Expand Down
8 changes: 4 additions & 4 deletions packages/create-nx-workspace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
},
"homepage": "https://nx.dev",
"dependencies": {
"tmp": "~0.2.1",
"yargs": "^17.4.0",
"chalk": "4.1.0",
"enquirer": "~2.3.6",
"flat": "^5.0.2",
"chalk": "4.1.0",
"ora": "5.3.0",
"tslib": "^2.3.0"
"tmp": "~0.2.1",
"tslib": "^2.3.0",
"yargs": "^17.4.0"
}
}
3 changes: 3 additions & 0 deletions packages/create-nx-workspace/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
},
{
"command": "node ./scripts/copy-readme.js create-nx-workspace"
},
{
"command": "node ./scripts/replace-versions.js build/packages/create-nx-workspace/bin/create-nx-workspace.js"
}
],
"parallel": false
Expand Down
14 changes: 7 additions & 7 deletions packages/cypress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@
"migrations": "./migrations.json"
},
"dependencies": {
"@nrwl/devkit": "*",
"@nrwl/linter": "*",
"@nrwl/workspace": "*",
"@cypress/webpack-preprocessor": "^5.9.1",
"@nrwl/devkit": "file:../devkit",
"@nrwl/linter": "file:../linter",
"@nrwl/workspace": "file:../workspace",
"chalk": "4.1.0",
"enhanced-resolve": "^5.8.3",
"fork-ts-checker-webpack-plugin": "6.2.10",
"rxjs": "^6.5.4",
"ts-loader": "^9.2.6",
"tsconfig-paths": "^3.9.0",
"tsconfig-paths-webpack-plugin": "3.5.2",
"webpack-node-externals": "^3.0.0",
"fork-ts-checker-webpack-plugin": "6.2.10",
"rxjs": "^6.5.4",
"tslib": "^2.3.0"
"tslib": "^2.3.0",
"webpack-node-externals": "^3.0.0"
},
"peerDependencies": {
"cypress": ">= 3 < 10"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ exports[`convert-tslint-to-eslint should work for Cypress applications 1`] = `
Object {
"dependencies": Object {},
"devDependencies": Object {
"@nrwl/eslint-plugin-nx": "*",
"@nrwl/linter": "*",
"@nrwl/eslint-plugin-nx": "0.0.1",
"@nrwl/linter": "0.0.1",
"@typescript-eslint/eslint-plugin": "~5.18.0",
"@typescript-eslint/parser": "~5.18.0",
"eslint": "~8.12.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/cypress/src/utils/versions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const nxVersion = '*';
export const nxVersion = require('../../package.json').version;
export const cypressVersion = '^9.1.0';
export const eslintPluginCypressVersion = '^2.10.3';
export const typesNodeVersion = '16.11.7';
10 changes: 5 additions & 5 deletions packages/detox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
"main": "index.js",
"types": "index.d.ts",
"dependencies": {
"@nrwl/devkit": "*",
"@nrwl/jest": "*",
"@nrwl/linter": "*",
"@nrwl/react": "*",
"@nrwl/workspace": "*",
"@nrwl/devkit": "file:../devkit",
"@nrwl/jest": "file:../jest",
"@nrwl/linter": "file:../linter",
"@nrwl/react": "file:../react",
"@nrwl/workspace": "file:../workspace",
"chalk": "^4.1.0"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/detox/src/utils/versions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const nxVersion = '*';
export const nxVersion = require('../../package.json').version;

export const detoxVersion = '19.6.9';
export const testingLibraryJestDom = '5.16.4';
4 changes: 2 additions & 2 deletions packages/eslint-plugin-nx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
}
},
"dependencies": {
"@nrwl/devkit": "*",
"@nrwl/workspace": "*",
"@nrwl/devkit": "file:../devkit",
"@nrwl/workspace": "file:../workspace",
"@typescript-eslint/experimental-utils": "~5.18.0",
"chalk": "4.1.0",
"confusing-browser-globals": "^1.0.9"
Expand Down
6 changes: 3 additions & 3 deletions packages/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"migrations": "./migrations.json"
},
"dependencies": {
"@nrwl/devkit": "*",
"@nrwl/node": "*",
"@nrwl/workspace": "*"
"@nrwl/devkit": "file:../devkit",
"@nrwl/node": "file:../node",
"@nrwl/workspace": "file:../workspace"
},
"peerDependencies": {
"express": "4.17.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/express/src/utils/versions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const nxVersion = '*';
export const nxVersion = require('../../package.json').version;

export const expressVersion = '4.17.2';
export const expressTypingsVersion = '4.17.13';

0 comments on commit 04985be

Please sign in to comment.