fix(repo): fix dependenies/discrepancies causing e2e tests with PNPM to fail
This commit is contained in:
parent
c92f4ba96b
commit
96625c77fb
@ -13,6 +13,7 @@ import {
|
||||
} from 'fs-extra';
|
||||
import * as path from 'path';
|
||||
import { detectPackageManager } from '@nrwl/tao/src/shared/package-manager';
|
||||
import * as isCI from 'is-ci';
|
||||
|
||||
interface RunCmdOpts {
|
||||
silenceError?: boolean;
|
||||
@ -124,15 +125,23 @@ export function newProject(): string {
|
||||
|
||||
if (!useBackupProject || !directoryExists(tmpBackupProjPath())) {
|
||||
runCreateWorkspace(projScope, { preset: 'empty', packageManager });
|
||||
|
||||
// Temporary hack to prevent installing with `--frozen-lockfile`
|
||||
if (isCI && packageManager === 'pnpm') {
|
||||
updateFile('.npmrc', 'prefer-frozen-lockfile=false');
|
||||
}
|
||||
|
||||
const packages = [
|
||||
`@nrwl/angular`,
|
||||
`@nrwl/express`,
|
||||
`@nrwl/nest`,
|
||||
`@nrwl/next`,
|
||||
`@nrwl/node`,
|
||||
`@nrwl/react`,
|
||||
`@nrwl/storybook`,
|
||||
`@nrwl/nx-plugin`,
|
||||
`@nrwl/eslint-plugin-nx`,
|
||||
`@nrwl/web`,
|
||||
];
|
||||
packageInstall(packages.join(` `), projScope);
|
||||
if (useBackupProject) {
|
||||
@ -324,13 +333,13 @@ export function runCommand(command: string): string {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets maxWorkers in CircleCI on all projects that require it
|
||||
* Sets maxWorkers in CI on all projects that require it
|
||||
* so that it doesn't try to run it with 34 workers
|
||||
*
|
||||
* maxWorkers required for: node, web, jest
|
||||
*/
|
||||
function setMaxWorkers() {
|
||||
if (process.env['CIRCLECI']) {
|
||||
if (isCI) {
|
||||
const workspaceFile = workspaceConfigName();
|
||||
const workspace = readJson(workspaceFile);
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@ describe('Run Commands', () => {
|
||||
const command =
|
||||
process.platform === 'win32'
|
||||
? `"echo %SHARED_VAR% %ROOT_ONLY% %NESTED_ONLY%"`
|
||||
: `'echo "\\$SHARED_VAR \\$ROOT_ONLY \\$NESTED_ONLY"'`;
|
||||
: `'echo "\\$SHARED_VAR" "\\$ROOT_ONLY" "\\$NESTED_ONLY"'`;
|
||||
const envFile = `apps/${nodeapp}/.custom.env`;
|
||||
runCLI(
|
||||
`generate @nrwl/workspace:run-commands echoEnvVariables --command=${command} --envFile=${envFile} --project=${nodeapp}`
|
||||
|
||||
@ -14,20 +14,6 @@ import {
|
||||
workspaceConfigName,
|
||||
} from '@nrwl/e2e/utils';
|
||||
|
||||
let originalCIValue: any;
|
||||
|
||||
/**
|
||||
* Setting CI=true makes it simpler to configure assertions around output, as there
|
||||
* won't be any colors.
|
||||
*/
|
||||
beforeAll(() => {
|
||||
originalCIValue = process.env.CI;
|
||||
process.env.CI = 'true';
|
||||
});
|
||||
afterAll(() => {
|
||||
process.env.CI = originalCIValue;
|
||||
});
|
||||
|
||||
describe('run-one', () => {
|
||||
it('should build specific project', () => {
|
||||
const proj = newProject();
|
||||
|
||||
15
package.json
15
package.json
@ -67,13 +67,13 @@
|
||||
"@ngrx/store-devtools": "9.1.0",
|
||||
"@ngtools/webpack": "~10.1.3",
|
||||
"@nrwl/cli": "11.1.0-beta.2",
|
||||
"@nrwl/tao": "11.1.0-beta.2",
|
||||
"@nrwl/cypress": "11.1.0-beta.2",
|
||||
"@nrwl/eslint-plugin-nx": "11.1.0-beta.2",
|
||||
"@nrwl/jest": "11.1.0-beta.2",
|
||||
"@nrwl/linter": "11.1.0-beta.2",
|
||||
"@nrwl/node": "11.1.0-beta.2",
|
||||
"@nrwl/nx-cloud": "10.1.10",
|
||||
"@nrwl/tao": "11.1.0-beta.2",
|
||||
"@nrwl/web": "11.1.0-beta.2",
|
||||
"@nrwl/workspace": "11.1.0-beta.2",
|
||||
"@reduxjs/toolkit": "1.3.2",
|
||||
@ -94,6 +94,7 @@
|
||||
"@types/eslint": "^7.2.2",
|
||||
"@types/express": "4.17.0",
|
||||
"@types/fs-extra": "7.0.0",
|
||||
"@types/is-ci": "^2.0.0",
|
||||
"@types/jasmine": "~2.8.6",
|
||||
"@types/jasminewd2": "~2.0.3",
|
||||
"@types/jest": "26.0.8",
|
||||
@ -149,7 +150,9 @@
|
||||
"depcheck": "^1.3.1",
|
||||
"document-register-element": "^1.13.1",
|
||||
"dotenv": "6.2.0",
|
||||
"ejs": "^3.1.5",
|
||||
"eslint": "7.10.0",
|
||||
"eslint-config-prettier": "^7.1.0",
|
||||
"eslint-plugin-cypress": "^2.10.3",
|
||||
"express": "4.17.1",
|
||||
"file-loader": "4.2.0",
|
||||
@ -159,11 +162,13 @@
|
||||
"fs-extra": "7.0.1",
|
||||
"glob": "7.1.4",
|
||||
"html-webpack-plugin": "^3.2.0",
|
||||
"http-server": "0.12.3",
|
||||
"husky": "^3.0.3",
|
||||
"identity-obj-proxy": "3.0.0",
|
||||
"ignore": "^5.0.4",
|
||||
"import-fresh": "^3.1.0",
|
||||
"injection-js": "^2.3.1",
|
||||
"is-ci": "^2.0.0",
|
||||
"jasmine-core": "~2.99.1",
|
||||
"jasmine-marbles": "~0.6.0",
|
||||
"jasmine-spec-reporter": "~4.2.1",
|
||||
@ -189,6 +194,7 @@
|
||||
"next": "9.5.2",
|
||||
"ng-packagr": "10.1.2",
|
||||
"ngrx-store-freeze": "0.2.4",
|
||||
"node-watch": "0.7.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"open": "6.4.0",
|
||||
"opn": "^5.3.0",
|
||||
@ -238,6 +244,7 @@
|
||||
"ts-jest": "26.4.0",
|
||||
"ts-loader": "5.4.5",
|
||||
"ts-node": "9.1.1",
|
||||
"tsconfig-paths": "^3.9.0",
|
||||
"tsconfig-paths-webpack-plugin": "3.2.0",
|
||||
"tsickle": "^0.38.1",
|
||||
"tslib": "^2.0.0",
|
||||
@ -255,11 +262,7 @@
|
||||
"worker-plugin": "3.2.0",
|
||||
"yargs": "15.4.1",
|
||||
"yargs-parser": "20.0.0",
|
||||
"zone.js": "^0.10.0",
|
||||
"ejs": "^3.1.5",
|
||||
"tsconfig-paths": "^3.9.0",
|
||||
"node-watch": "0.7.0",
|
||||
"http-server": "0.12.3"
|
||||
"zone.js": "^0.10.0"
|
||||
},
|
||||
"author": "Victor Savkin",
|
||||
"license": "MIT",
|
||||
|
||||
@ -3,6 +3,6 @@ export const angularVersion = '^11.0.0';
|
||||
export const angularDevkitVersion = '~0.1100.1';
|
||||
export const angularJsVersion = '1.7.9';
|
||||
export const ngrxVersion = '10.0.0';
|
||||
export const rxjsVersion = '~6.5.5';
|
||||
export const rxjsVersion = '~6.6.3';
|
||||
export const jestPresetAngularVersion = '8.3.2';
|
||||
export const angularEslintVersion = '~1.0.0';
|
||||
|
||||
@ -3,6 +3,6 @@ export const nxVersion = '*';
|
||||
export const nestJsVersion = '^7.0.0';
|
||||
export const nestJsSchematicsVersion = '^7.0.0';
|
||||
|
||||
export const rxjsVersion = '~6.5.5';
|
||||
export const rxjsVersion = '~6.6.3';
|
||||
|
||||
export const reflectMetadataVersion = '^0.1.13';
|
||||
|
||||
@ -29,6 +29,7 @@ export default function (schema: Schema): Rule {
|
||||
{},
|
||||
{
|
||||
'@nrwl/devkit': nxVersion,
|
||||
'@nrwl/node': nxVersion,
|
||||
tslib: '^2.0.0',
|
||||
}
|
||||
),
|
||||
|
||||
@ -2,11 +2,11 @@ import { ProjectGraph, ProjectGraphNode } from '../core/project-graph';
|
||||
import { Environment, NxJson } from '../core/shared-interfaces';
|
||||
import { Task } from '../tasks-runner/tasks-runner';
|
||||
import { createTask, getRunner } from '../tasks-runner/run-command';
|
||||
import { basename } from 'path';
|
||||
import { getCommandAsString, getOutputs } from '../tasks-runner/utils';
|
||||
import * as yargs from 'yargs';
|
||||
import { NxArgs } from './utils';
|
||||
import { Hasher } from '../core/hasher/hasher';
|
||||
import { detectPackageManager } from '@nrwl/tao/src/shared/package-manager';
|
||||
|
||||
export async function printAffected(
|
||||
affectedProjectsWithTargetAndConfig: ProjectGraphNode[],
|
||||
@ -61,12 +61,13 @@ async function createTasks(
|
||||
);
|
||||
|
||||
const taskHashes = await hasher.hashTasks(tasks);
|
||||
const isYarn = basename(process.env.npm_execpath || 'npm').startsWith('yarn');
|
||||
const pm = detectPackageManager();
|
||||
const isYarn = pm === 'yarn';
|
||||
return tasks.map((task, index) => ({
|
||||
id: task.id,
|
||||
overrides: overrides,
|
||||
target: task.target,
|
||||
command: `${isYarn ? 'yarn' : 'npm run'} ${getCommandAsString(
|
||||
command: `${isYarn ? 'yarn' : `${pm} run`} ${getCommandAsString(
|
||||
'nx',
|
||||
isYarn,
|
||||
task
|
||||
|
||||
@ -28,11 +28,15 @@ function publishPackage(packagePath) {
|
||||
`);
|
||||
}
|
||||
try {
|
||||
console.log(` 📦 ${packagePath}`);
|
||||
execSync(`npm publish`, {
|
||||
cwd: packagePath,
|
||||
env: process.env,
|
||||
stdio: ['ignore', 'ignore', 'ignore'],
|
||||
});
|
||||
} catch (e) {}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
export function setup() {
|
||||
|
||||
17
yarn.lock
17
yarn.lock
@ -4180,6 +4180,11 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/braces/-/braces-3.0.0.tgz#7da1c0d44ff1c7eb660a36ec078ea61ba7eb42cb"
|
||||
integrity sha512-TbH79tcyi9FHwbyboOKeRachRq63mSuWYXOflsNO9ZyE5ClQ/JaozNKl+aWUq87qPNsXasXxi2AbgfwIJ+8GQw==
|
||||
|
||||
"@types/ci-info@*":
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/ci-info/-/ci-info-2.0.0.tgz#51848cc0f5c30c064f4b25f7f688bf35825b3971"
|
||||
integrity sha512-5R2/MHILQLDCzTuhs1j4Qqq8AaKUf7Ma4KSSkCtc12+fMs47zfa34qhto9goxpyX00tQK1zxB885VCiawZ5Qhg==
|
||||
|
||||
"@types/color-name@^1.1.1":
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
|
||||
@ -4327,6 +4332,13 @@
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/is-ci@^2.0.0":
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/is-ci/-/is-ci-2.0.0.tgz#e2b81d0f9275861649d501dbc39a480fbf311459"
|
||||
integrity sha512-J8ytIdkALbTrqcJ6OZiEv0B9skfyok/zCDj1q06GGCDa1rlHnPobUBT0BYR1vku2oZVwVEgCurtXqCASAfjCiQ==
|
||||
dependencies:
|
||||
"@types/ci-info" "*"
|
||||
|
||||
"@types/is-function@^1.0.0":
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/is-function/-/is-function-1.0.0.tgz#1b0b819b1636c7baf0d6785d030d12edf70c3e83"
|
||||
@ -10673,6 +10685,11 @@ escodegen@^1.11.1, escodegen@^1.14.1:
|
||||
optionalDependencies:
|
||||
source-map "~0.6.1"
|
||||
|
||||
eslint-config-prettier@^7.1.0:
|
||||
version "7.1.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-7.1.0.tgz#5402eb559aa94b894effd6bddfa0b1ca051c858f"
|
||||
integrity sha512-9sm5/PxaFG7qNJvJzTROMM1Bk1ozXVTKI0buKOyb0Bsr1hrwi0H/TzxF/COtf1uxikIK8SwhX7K6zg78jAzbeA==
|
||||
|
||||
eslint-plugin-cypress@^2.10.3:
|
||||
version "2.11.2"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-cypress/-/eslint-plugin-cypress-2.11.2.tgz#a8f3fe7ec840f55e4cea37671f93293e6c3e76a0"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user