diff --git a/apps/dep-graph-client/src/graphs/medium.ts b/apps/dep-graph-client/src/graphs/medium.ts index 1713b1bfb45b4..4f9a4e3a8dd8b 100644 --- a/apps/dep-graph-client/src/graphs/medium.ts +++ b/apps/dep-graph-client/src/graphs/medium.ts @@ -25189,7 +25189,7 @@ export const mediumGraph: ProjectGraphCache = { type: 'npm', name: 'npm:@types/node', data: { - version: '~8.9.4', + version: '14.14.33', packageName: '@types/node', files: [], }, diff --git a/apps/dep-graph-client/src/graphs/small.ts b/apps/dep-graph-client/src/graphs/small.ts index 7909a79c33e4f..0bbbe6fffd847 100644 --- a/apps/dep-graph-client/src/graphs/small.ts +++ b/apps/dep-graph-client/src/graphs/small.ts @@ -9513,7 +9513,7 @@ export const smallGraph: ProjectGraphCache = { type: 'npm', name: 'npm:@types/node', data: { - version: '12.12.38', + version: '14.14.33', packageName: '@types/node', files: [], }, diff --git a/e2e/utils/index.ts b/e2e/utils/index.ts index f3cb915098769..aac57cc48408a 100644 --- a/e2e/utils/index.ts +++ b/e2e/utils/index.ts @@ -392,7 +392,7 @@ export function createFile(f: string, content: string = ''): void { export function updateFile( f: string, - content: string | ((content: string) => void) + content: string | ((content: string) => string) ): void { ensureDirSync(path.dirname(tmpProjPath(f))); if (typeof content === 'string') { diff --git a/package.json b/package.json index 190e559c5ef58..ad9cadde954bb 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ "@types/jasminewd2": "~2.0.3", "@types/jest": "26.0.8", "@types/lodash": "^4.14.165", - "@types/node": "12.12.38", + "@types/node": "14.14.33", "@types/prettier": "2.0.0", "@types/react": "16.9.17", "@types/react-dom": "16.9.4", diff --git a/packages/create-nx-plugin/bin/create-nx-plugin.ts b/packages/create-nx-plugin/bin/create-nx-plugin.ts index d2ce0b65423ee..2282d3795f6b3 100644 --- a/packages/create-nx-plugin/bin/create-nx-plugin.ts +++ b/packages/create-nx-plugin/bin/create-nx-plugin.ts @@ -1,15 +1,15 @@ #!/usr/bin/env node // we can't import from '@nrwl/workspace' because it will require typescript -import { output } from '@nrwl/workspace/src/utilities/output'; import { getPackageManagerCommand } from '@nrwl/tao/src/shared/package-manager'; -import { dirSync } from 'tmp'; -import { writeFileSync, readFileSync, removeSync } from 'fs-extra'; -import * as path from 'path'; +import { output } from '@nrwl/workspace/src/utilities/output'; import { execSync } from 'child_process'; +import { readFileSync, removeSync, writeFileSync } from 'fs-extra'; import * as inquirer from 'inquirer'; -import yargsParser = require('yargs-parser'); +import * as path from 'path'; +import { dirSync } from 'tmp'; import { showNxWarning } from './shared'; +import yargsParser = require('yargs-parser'); const tsVersion = 'TYPESCRIPT_VERSION'; const cliVersion = 'NX_VERSION'; @@ -92,7 +92,7 @@ function createNxPlugin(workspaceName, pluginName, packageManager) { function updateWorkspace(workspaceName: string) { const nxJsonPath = path.join(workspaceName, 'nx.json'); - const nxJson = JSON.parse(readFileSync(nxJsonPath).toString('UTF-8')); + const nxJson = JSON.parse(readFileSync(nxJsonPath).toString('utf-8')); nxJson['workspaceLayout'] = { appsDir: 'e2e', @@ -174,13 +174,13 @@ function showHelp() { Create a new Nx workspace - Args: + Args: name workspace name (e.g., org name) Options: - pluginName the name of the plugin to be created + pluginName the name of the plugin to be created `); } diff --git a/packages/gatsby/src/executors/server/server.impl.ts b/packages/gatsby/src/executors/server/server.impl.ts index 4a10718c8f169..8a30230377e26 100644 --- a/packages/gatsby/src/executors/server/server.impl.ts +++ b/packages/gatsby/src/executors/server/server.impl.ts @@ -3,13 +3,11 @@ import { parseTargetString, readTargetOptions, } from '@nrwl/devkit'; - import { ChildProcess, fork } from 'child_process'; import { join } from 'path'; - -import { GatsbyPluginBuilderSchema } from './schema'; import { runGatsbyBuild } from '../build/build.impl'; import { GatsbyPluginBuilderSchema as BuildBuilderSchema } from '../build/schema'; +import { GatsbyPluginBuilderSchema } from './schema'; export default async function* serverExecutor( options: GatsbyPluginBuilderSchema, @@ -83,7 +81,7 @@ async function runGatsbyDevelop(workspaceRoot, projectRoot, options) { } ); - childProcess.on('message', ({ action }) => { + childProcess.on('message', ({ action }: any) => { if ( action?.type === 'ACTIVITY_END' && action?.payload?.status === 'SUCCESS' && diff --git a/packages/workspace/migrations.json b/packages/workspace/migrations.json index b8ba102d17785..2edc2a73e0699 100644 --- a/packages/workspace/migrations.json +++ b/packages/workspace/migrations.json @@ -869,6 +869,10 @@ "dotenv": { "version": "8.2.0", "alwaysAddToPackageJson": false + }, + "@types/node": { + "version": "14.14.33", + "alwaysAddToPackageJson": false } } } diff --git a/packages/workspace/src/core/file-utils.ts b/packages/workspace/src/core/file-utils.ts index 0bb7f3a2ad33a..5624c767b41ca 100644 --- a/packages/workspace/src/core/file-utils.ts +++ b/packages/workspace/src/core/file-utils.ts @@ -1,18 +1,18 @@ +import { toOldFormatOrNull, Workspaces } from '@nrwl/tao/src/shared/workspace'; import { execSync } from 'child_process'; import * as fs from 'fs'; import { readFileSync } from 'fs'; import * as path from 'path'; import { extname, join } from 'path'; +import { performance } from 'perf_hooks'; import { NxArgs } from '../command-line/utils'; import { WorkspaceResults } from '../command-line/workspace-results'; import { appRootPath } from '../utilities/app-root'; import { fileExists, readJsonFile } from '../utilities/fileutils'; import { jsonDiff } from '../utilities/json-diff'; +import { defaultFileHasher } from './hasher/file-hasher'; import { ProjectGraphNode } from './project-graph'; import { Environment, NxJson } from './shared-interfaces'; -import { defaultFileHasher } from './hasher/file-hasher'; -import { performance } from 'perf_hooks'; -import { toOldFormatOrNull, Workspaces } from '@nrwl/tao/src/shared/workspace'; const ignore = require('ignore'); @@ -160,7 +160,9 @@ function getIgnoredGlobs() { } function readFileIfExisting(path: string) { - return fs.existsSync(path) ? fs.readFileSync(path, 'UTF-8').toString() : ''; + return fs.existsSync(path) + ? fs.readFileSync(path, { encoding: 'utf-8' }).toString() + : ''; } export function readWorkspaceJson(): any { @@ -189,7 +191,7 @@ export function workspaceFileName() { export type FileRead = (s: string) => string; export function defaultFileRead(filePath: string): string | null { - return readFileSync(join(appRootPath, filePath), 'UTF-8'); + return readFileSync(join(appRootPath, filePath), { encoding: 'utf-8' }); } export function readPackageJson(): any { diff --git a/packages/workspace/src/generators/new/__snapshots__/new.spec.ts.snap b/packages/workspace/src/generators/new/__snapshots__/new.spec.ts.snap index e8273591f6924..8a4df491f2a87 100644 --- a/packages/workspace/src/generators/new/__snapshots__/new.spec.ts.snap +++ b/packages/workspace/src/generators/new/__snapshots__/new.spec.ts.snap @@ -9,7 +9,7 @@ Object { "@nrwl/cli": "*", "@nrwl/tao": "*", "@nrwl/workspace": "*", - "@types/node": "12.12.38", + "@types/node": "14.14.33", "dotenv": "8.2.0", "prettier": "2.2.1", "ts-node": "~9.1.1", @@ -52,7 +52,7 @@ Object { "@nrwl/cli": "*", "@nrwl/tao": "*", "@nrwl/workspace": "*", - "@types/node": "12.12.38", + "@types/node": "14.14.33", "dotenv": "8.2.0", "prettier": "2.2.1", "ts-node": "~9.1.1", @@ -96,7 +96,7 @@ Object { "@nrwl/react": "*", "@nrwl/tao": "*", "@nrwl/workspace": "*", - "@types/node": "12.12.38", + "@types/node": "14.14.33", "dotenv": "8.2.0", "prettier": "2.2.1", "ts-node": "~9.1.1", diff --git a/packages/workspace/src/generators/workspace/files/package.json__tmpl__ b/packages/workspace/src/generators/workspace/files/package.json__tmpl__ index e73de72195415..cf7cb76d8dc7b 100644 --- a/packages/workspace/src/generators/workspace/files/package.json__tmpl__ +++ b/packages/workspace/src/generators/workspace/files/package.json__tmpl__ @@ -36,7 +36,7 @@ "@nrwl/tao": "<%= nxVersion %>", "@nrwl/cli": "<%= nxVersion %>", "@nrwl/workspace": "<%= nxVersion %>", - "@types/node": "12.12.38", + "@types/node": "14.14.33", "dotenv": "8.2.0", "ts-node": "~9.1.1", "typescript": "<%= typescriptVersion %>", diff --git a/yarn.lock b/yarn.lock index 9971fd1d42216..355213e222691 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4605,10 +4605,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.0.20.tgz#0da05cddbc761e1fa98af88a17244c8c1ff37231" integrity sha512-MRn/NP3dee8yL5QhbSA6riuwkS+UOcsPUMOIOG3KMUQpuor/2TopdRBu8QaaB4fGU+gz/bzyDWt0FtUbeJ8H1A== -"@types/node@12.12.38": - version "12.12.38" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.38.tgz#58841a382f231ad005dbb935c36d44aa1118a26b" - integrity sha512-75eLjX0pFuTcUXnnWmALMzzkYorjND0ezNEycaKesbUBg9eGZp4GHPuDmkRc4mQQvIpe29zrzATNRA6hkYqwmA== +"@types/node@14.14.33": + version "14.14.33" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.33.tgz#9e4f8c64345522e4e8ce77b334a8aaa64e2b6c78" + integrity sha512-oJqcTrgPUF29oUP8AsUqbXGJNuPutsetaa9kTQAQce5Lx5dTYWV02ScBiT/k1BX/Z7pKeqedmvp39Wu4zR7N7g== "@types/normalize-package-data@^2.4.0": version "2.4.0"