diff --git a/.github/workflows/e2e-matrix.yml b/.github/workflows/e2e-matrix.yml index 6516c79a8b..26e2915506 100644 --- a/.github/workflows/e2e-matrix.yml +++ b/.github/workflows/e2e-matrix.yml @@ -37,7 +37,7 @@ jobs: - name: Install dependencies uses: actions/setup-node@v2 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ matrix.node_version }} - run: yarn install - name: Install PNPM diff --git a/e2e/workspace/src/run-commands.test.ts b/e2e/workspace/src/run-commands.test.ts index e4f7dc42ca..6aa7856557 100644 --- a/e2e/workspace/src/run-commands.test.ts +++ b/e2e/workspace/src/run-commands.test.ts @@ -6,7 +6,6 @@ import { uniq, updateFile, workspaceConfigName, - getPackageManagerCommand, } from '@nrwl/e2e/utils'; describe('Run Commands', () => { @@ -26,17 +25,21 @@ describe('Run Commands', () => { 'SHARED_VAR=shared-nested-value\nNESTED_ONLY=nested-only-value' ); - const command = - process.platform === 'win32' - ? `"echo %SHARED_VAR% %ROOT_ONLY% %NESTED_ONLY%"` // Windows - : getPackageManagerCommand().runNx.startsWith('yarn') - ? `'echo $SHARED_VAR $ROOT_ONLY $NESTED_ONLY'` // Yarn - : `'echo "\\$SHARED_VAR" "\\$ROOT_ONLY" "\\$NESTED_ONLY"'`; // NPM, PNPM const envFile = `apps/${nodeapp}/.custom.env`; runCLI( - `generate @nrwl/workspace:run-commands echoEnvVariables --command=${command} --envFile=${envFile} --project=${nodeapp}` + `generate @nrwl/workspace:run-commands echoEnvVariables --command=echo --envFile=${envFile} --project=${nodeapp}` ); + const command = + process.platform === 'win32' + ? `%SHARED_VAR% %ROOT_ONLY% %NESTED_ONLY%` // Windows + : `$SHARED_VAR $ROOT_ONLY $NESTED_ONLY`; + const config = readJson(workspaceConfigName()); + config.projects[ + nodeapp + ].targets.echoEnvVariables.options.command += ` ${command}`; + updateFile(workspaceConfigName(), JSON.stringify(config, null, 2)); + const result = runCLI('echoEnvVariables'); expect(result).toContain('shared-root-value'); expect(result).not.toContain('shared-nested-value'); diff --git a/packages/react/package.json b/packages/react/package.json index 2221716a01..0819edfa7e 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -40,7 +40,7 @@ "eslint-plugin-import": "^2.20.1", "eslint-plugin-jsx-a11y": "^6.2.3", "eslint-plugin-react": "^7.18.3", - "eslint-plugin-react-hooks": "^2.4.0", + "eslint-plugin-react-hooks": "4.2.0", "url-loader": "^3.0.0" } } diff --git a/scripts/e2e.ts b/scripts/e2e.ts index dd168586f7..58ab67d671 100755 --- a/scripts/e2e.ts +++ b/scripts/e2e.ts @@ -1,11 +1,11 @@ import { execSync } from 'child_process'; import { readdirSync } from 'fs'; -import { ensureDirSync, removeSync } from 'fs-extra'; +import { ensureDirSync, removeSync, writeFileSync } from 'fs-extra'; const kill = require('tree-kill'); import { build } from './package'; process.env.PUBLISHED_VERSION = `9999.0.2`; -process.env.npm_config_registry = `http://localhost:4872/`; +process.env.npm_config_registry = `http://localhost:4872`; process.env.YARN_REGISTRY = process.env.npm_config_registry; export const getDirectories = (source) => @@ -19,7 +19,7 @@ function updateVersion(packagePath) { }); } -function publishPackage(packagePath) { +function publishPackage(packagePath, npmMajorVersion: number) { if (process.env.npm_config_registry.indexOf('http://localhost') === -1) { throw Error(` ------------------ @@ -29,6 +29,21 @@ function publishPackage(packagePath) { } try { console.log(` 📦 ${packagePath}`); + + // NPM@7 requires a token to publish, thus, is just a matter of fake a token to bypass npm. + // See: https://twitter.com/verdaccio_npm/status/1357798427283910660 + if (npmMajorVersion === 7) { + writeFileSync( + `${packagePath}/.npmrc`, + `registry=${ + process.env.npm_config_registry + }\n${process.env.npm_config_registry.replace( + 'http:', + '' + )}/:_authToken=fake` + ); + } + execSync(`npm publish`, { cwd: packagePath, env: process.env, @@ -40,9 +55,14 @@ function publishPackage(packagePath) { } export function setup() { + const npmMajorVersion = execSync(`npm --version`) + .toString('utf-8') + .trim() + .split('.')[0]; + getDirectories('./build/packages').map((pkg) => { updateVersion(`./build/packages/${pkg}`); - publishPackage(`./build/packages/${pkg}`); + publishPackage(`./build/packages/${pkg}`, +npmMajorVersion); }); } diff --git a/scripts/local-registry/config.yml b/scripts/local-registry/config.yml index 5a3cc113a8..3fcb084fc9 100644 --- a/scripts/local-registry/config.yml +++ b/scripts/local-registry/config.yml @@ -1,9 +1,5 @@ # path to a directory with all packages storage: ../../tmp/local-registry/storage -auth: - htpasswd: - file: ./htpasswd - max_users: 1 # a list of other known repositories we can talk to uplinks: diff --git a/scripts/local-registry/htpasswd b/scripts/local-registry/htpasswd deleted file mode 100644 index 8391cd4b0a..0000000000 --- a/scripts/local-registry/htpasswd +++ /dev/null @@ -1 +0,0 @@ -test:$6FrCaT/v0dwE:autocreated 2020-03-25T19:10:50.254Z