Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a6642bf2a8 | |||
| bd8cbfaddd | |||
| 6f03d0c50a | |||
| 1bbeed0ac0 | |||
| c420793d5e | |||
| 16c212fc2c | |||
| 4e2d33c9e1 | |||
| 0defcad1a2 | |||
| 4233effd06 | |||
| 1488728aa3 | |||
| a627a0c26f | |||
| 75c06380c6 | |||
| 127e8d44c1 | |||
| 6e08e3f7a6 | |||
| b93d46dbc9 | |||
| 197105af9a | |||
| 84dd4180ba | |||
| f7fcc6facb | |||
| 8beb4e4424 | |||
| 7eec0d73ae | |||
| a0fb8df4d2 | |||
| 4942eb4965 | |||
| f4724bc621 | |||
| 08de51eea7 | |||
| c63bf49c97 | |||
| e7e78c56cd |
@@ -194,7 +194,7 @@ jobs:
|
||||
pnpm nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD &
|
||||
pids+=($!)
|
||||
|
||||
pnpm nx run-many -t check-imports check-commit check-lock-files depcheck --parallel=1 --no-dte &
|
||||
pnpm nx run-many -t check-imports check-commit check-lock-files depcheck check-codeowners --parallel=1 --no-dte &
|
||||
pids+=($!)
|
||||
|
||||
pnpm nx affected --target=lint --base=$NX_BASE --head=$NX_HEAD --parallel=3 &
|
||||
|
||||
@@ -2,6 +2,7 @@ name: publish
|
||||
env:
|
||||
DEBUG: napi:*
|
||||
NX_RUN_GROUP: ${{ github.run_id }}-${{ github.run_attempt }}
|
||||
NPM_CONFIG_PROVENANCE: true
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
@@ -203,6 +204,8 @@ jobs:
|
||||
if: ${{ github.repository_owner == 'nrwl' }}
|
||||
name: Publish
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
id-token: write
|
||||
needs:
|
||||
# - build-freebsd
|
||||
- build
|
||||
|
||||
+8
-6
@@ -11,7 +11,7 @@ pnpm-lock.yaml @FrozenPandaz @vsavkin @AgentEnder @jaysoo @JamesHenry
|
||||
/docs @bcabanes @isaacplmann @juristr
|
||||
/docs/nx-cloud @StalkAltan @rarmatei @isaacplmann @juristr @bcabanes
|
||||
/graph/** @philipjfulcher @FrozenPandaz @bcabanes
|
||||
/images/shared @bcabanes @isaacplmann @juristr
|
||||
/images @bcabanes @isaacplmann @juristr
|
||||
/nx-dev/** @bcabanes @isaacplmann @juristr
|
||||
/typedoc-theme @bcabanes @isaacplmann
|
||||
|
||||
@@ -76,7 +76,6 @@ pnpm-lock.yaml @FrozenPandaz @vsavkin @AgentEnder @jaysoo @JamesHenry
|
||||
/docs/shared/packages/web/** @jaysoo @mandarini @ndcunningham
|
||||
/docs/shared/packages/webpack/** @jaysoo @mandarini @ndcunningham
|
||||
/docs/shared/packages/esbuild/** @nartc @jaysoo @ndcunningham
|
||||
/docs/shared/packages/rollup/** @jaysoo @mandarini @ndcunningham
|
||||
/docs/shared/packages/vite/** @jaysoo @mandarini @ndcunningham
|
||||
/packages/js/** @nartc @jaysoo @ndcunningham
|
||||
/e2e/js/** @nartc @jaysoo @ndcunningham
|
||||
@@ -121,14 +120,17 @@ pnpm-lock.yaml @FrozenPandaz @vsavkin @AgentEnder @jaysoo @JamesHenry
|
||||
/docs/generated/devkit/** @FrozenPandaz @AgentEnder
|
||||
/docs/generated/packages/devkit/** @FrozenPandaz @AgentEnder
|
||||
/packages/devkit/** @FrozenPandaz @AgentEnder
|
||||
/packages/devkit/index.ts @FrozenPandaz @vsavkin
|
||||
/packages/devkit/index.js @FrozenPandaz @vsavkin
|
||||
/packages/devkit/index.d.ts @FrozenPandaz @vsavkin
|
||||
/packages/devkit/public-api.ts @FrozenPandaz @vsavkin
|
||||
/packages/devkit/nx.ts @FrozenPandaz @vsavkin
|
||||
/packages/devkit/src/utils/module-federation @jaysoo @Coly010
|
||||
|
||||
# Nx-Plugin
|
||||
/docs/generated/packages/plugin/** @AgentEnder @FrozenPandaz
|
||||
/docs/shared/packages/plugin/** @AgentEnder @FrozenPandaz @isaacplmann @juristr
|
||||
/packages/plugin/** @AgentEnder @FrozenPandaz
|
||||
/e2e/nx-plugin/** @AgentEnder @FrozenPandaz
|
||||
/e2e/plugin/** @AgentEnder @FrozenPandaz
|
||||
|
||||
## Core
|
||||
/docs/generated/packages/nx/** @vsavkin @FrozenPandaz @AgentEnder
|
||||
@@ -136,7 +138,7 @@ pnpm-lock.yaml @FrozenPandaz @vsavkin @AgentEnder @jaysoo @JamesHenry
|
||||
/packages/nx/** @vsavkin @FrozenPandaz @AgentEnder
|
||||
/packages/nx/src/adapter @AgentEnder @leosvelperez
|
||||
/packages/nx/src/native @vsavkin @FrozenPandaz @Cammisuli
|
||||
/packages/nx/src/lock-file @meeroslav @FrozenPandaz
|
||||
/packages/nx/src/plugins/js/lock-file @meeroslav @FrozenPandaz
|
||||
/packages/nx/src/nx-init/angular/** @Coly010 @leosvelperez @FrozenPandaz
|
||||
/e2e/nx-init/src/nx-init-angular.test.ts @Coly010 @leosvelperez
|
||||
/packages/nx/src/nx-init/react/** @jaysoo @xiongemi @mandarini
|
||||
@@ -170,7 +172,7 @@ pnpm-lock.yaml @FrozenPandaz @vsavkin @AgentEnder @jaysoo @JamesHenry
|
||||
# Global Files
|
||||
project.json @FrozenPandaz @vsavkin
|
||||
jest.config.ts @barbados-clemens @FrozenPandaz
|
||||
jest.preset.ts @barbados-clemens @FrozenPandaz
|
||||
jest.preset.js @barbados-clemens @FrozenPandaz
|
||||
|
||||
# Overrides - These are applied last, so override any matches above.
|
||||
docs/generated/manifests/* @bcabanes @FrozenPandaz @jaysoo @AgentEnder @isaacplmann @juristr
|
||||
|
||||
+3
-3
@@ -142,19 +142,19 @@ nx test jest
|
||||
To make sure your changes do not break any E2E tests, run:
|
||||
|
||||
```bash
|
||||
nx e2e e2e-cli # or any other project here
|
||||
nx e2e e2e-vite # or any other project here
|
||||
```
|
||||
|
||||
Running E2E tests can take some time, so it is often useful to run a single test. To run a single suite of tests, run:
|
||||
|
||||
```bash
|
||||
nx e2e e2e-cli -t versions # I often add qqqq to my test name so I can use -t qqqq
|
||||
nx e2e e2e-vite -t versions # I often add qqqq to my test name so I can use -t qqqq
|
||||
```
|
||||
|
||||
Sometimes tests pass locally but they fail on the CI. To reproduce the CI environment and be able to debug the issue, run:
|
||||
|
||||
```bash
|
||||
NX_VERBOSE_LOGGING=true CI=true SELECTED_PM=pnpm pnpm nx e2e e2e-cli --t="should do something is this test"
|
||||
NX_VERBOSE_LOGGING=true CI=true SELECTED_PM=pnpm pnpm nx e2e e2e-vite --t="should do something is this test"
|
||||
```
|
||||
|
||||
The above command sets verbose logging (this exposes stack traces and underlying errors), sets the defaults to be CI-like and sets Pnpm as the selected package manager.
|
||||
|
||||
@@ -159,6 +159,11 @@
|
||||
"type": "boolean",
|
||||
"description": "Generate package.json with 'exports' field. This field defines entry points in the package and is used by Node and the TypeScript compiler.",
|
||||
"default": false
|
||||
},
|
||||
"skipTypeCheck": {
|
||||
"type": "boolean",
|
||||
"description": "Whether to skip TypeScript type checking.",
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
"required": ["tsConfig", "main", "outputPath"],
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"packages": ["build/packages/*", "build/packages/nx/native-packages/*"],
|
||||
"version": "16.1.0",
|
||||
"version": "16.1.3",
|
||||
"granularPathspec": false,
|
||||
"command": {
|
||||
"publish": {
|
||||
|
||||
+9
-9
@@ -11,6 +11,7 @@
|
||||
"check-imports": "node ./scripts/check-imports.js",
|
||||
"check-lock-files": "node ./scripts/check-lock-files.js",
|
||||
"check-documentation-map": "ts-node -P ./scripts/tsconfig.scripts.json ./scripts/documentation/map-link-checker.ts",
|
||||
"check-codeowners": "ts-node -P ./scripts/tsconfig.scripts.json ./scripts/check-codeowners.ts",
|
||||
"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",
|
||||
"nx-release": "ts-node -P ./scripts/tsconfig.release.json ./scripts/nx-release",
|
||||
@@ -48,8 +49,6 @@
|
||||
"@jest/reporters": "^29.4.1",
|
||||
"@jest/test-result": "^29.4.1",
|
||||
"@jest/types": "^29.4.1",
|
||||
"@lerna/publish": "6.0.0",
|
||||
"@lerna/version": "6.0.0",
|
||||
"@monodon/rust": "1.1.2",
|
||||
"@napi-rs/cli": "2.14.0",
|
||||
"@nestjs/cli": "^9.0.0",
|
||||
@@ -86,11 +85,11 @@
|
||||
"@rollup/plugin-node-resolve": "^13.0.4",
|
||||
"@rollup/plugin-url": "^7.0.0",
|
||||
"@schematics/angular": "~16.0.0",
|
||||
"@storybook/addon-essentials": "^7.0.8",
|
||||
"@storybook/core-server": "^7.0.8",
|
||||
"@storybook/react": "^7.0.8",
|
||||
"@storybook/react-webpack5": "^7.0.8",
|
||||
"@storybook/types": "^7.0.8",
|
||||
"@storybook/addon-essentials": "^7.0.9",
|
||||
"@storybook/core-server": "^7.0.9",
|
||||
"@storybook/react": "^7.0.9",
|
||||
"@storybook/react-webpack5": "^7.0.9",
|
||||
"@storybook/types": "^7.0.9",
|
||||
"@svgr/rollup": "^6.1.2",
|
||||
"@svgr/webpack": "^6.1.2",
|
||||
"@swc-node/register": "^1.4.2",
|
||||
@@ -194,7 +193,7 @@
|
||||
"jsonc-eslint-parser": "^2.1.0",
|
||||
"jsonc-parser": "3.2.0",
|
||||
"kill-port": "^1.6.1",
|
||||
"lerna": "6.0.0",
|
||||
"lerna": "6.6.2",
|
||||
"less": "4.1.3",
|
||||
"less-loader": "11.1.0",
|
||||
"license-webpack-plugin": "^4.0.2",
|
||||
@@ -311,7 +310,7 @@
|
||||
"history": "^5.3.0",
|
||||
"json-schema-to-typescript": "^10.1.5",
|
||||
"jsonpointer": "^5.0.0",
|
||||
"next": "13.1.1",
|
||||
"next": "13.3.4",
|
||||
"next-seo": "^5.13.0",
|
||||
"npm-run-path": "^4.0.1",
|
||||
"preact": "10.6.4",
|
||||
@@ -341,6 +340,7 @@
|
||||
"check-format",
|
||||
"check-imports",
|
||||
"check-lock-files",
|
||||
"check-codeowners",
|
||||
"depcheck",
|
||||
"documentation"
|
||||
]
|
||||
|
||||
@@ -1110,6 +1110,22 @@
|
||||
"alwaysAddToPackageJson": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"16.1.3-jest": {
|
||||
"version": "16.1.3-beta.0",
|
||||
"requires": {
|
||||
"@angular-devkit/build-angular": ">=13.0.0 <17.0.0",
|
||||
"@angular/compiler-cli": ">=13.0.0 <17.0.0",
|
||||
"@angular/core": ">=13.0.0 <17.0.0",
|
||||
"@angular/platform-browser-dynamic": ">=13.0.0 <17.0.0",
|
||||
"jest": "^29.0.0"
|
||||
},
|
||||
"packages": {
|
||||
"jest-preset-angular": {
|
||||
"version": "~13.1.0",
|
||||
"alwaysAddToPackageJson": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,6 @@ export const postcssUrlVersion = '~10.1.3';
|
||||
export const autoprefixerVersion = '^10.4.0';
|
||||
export const tsNodeVersion = '10.9.1';
|
||||
|
||||
export const jestPresetAngularVersion = '~13.0.0';
|
||||
export const jestPresetAngularVersion = '~13.1.0';
|
||||
export const typesNodeVersion = '16.11.7';
|
||||
export const jasmineMarblesVersion = '^0.9.2';
|
||||
|
||||
@@ -18,6 +18,7 @@ export function visitNotIgnoredFiles(
|
||||
ig.add(tree.read('.gitignore', 'utf-8'));
|
||||
}
|
||||
if (tree.exists('.nxignore')) {
|
||||
ig ??= ignore();
|
||||
ig.add(tree.read('.nxignore', 'utf-8'));
|
||||
}
|
||||
dirPath = normalizePathRelativeToRoot(dirPath, tree.root);
|
||||
|
||||
@@ -165,6 +165,14 @@ describe('replaceNrwlPackageWithNxPackage', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should handle broken package.json files', () => {
|
||||
tree.write('package.json', '{ broken: "json ');
|
||||
|
||||
expect(() =>
|
||||
replaceNrwlPackageWithNxPackage(tree, 'old-package', 'new-package')
|
||||
).not.toThrow();
|
||||
});
|
||||
|
||||
it('should replace any mentions in files', () => {
|
||||
expect(tree.read('README.txt').toString()).toContain('new-package');
|
||||
expect(tree.read('README.txt').toString()).not.toContain('old-package');
|
||||
|
||||
@@ -4,6 +4,7 @@ import { requireNx } from '../../nx';
|
||||
import { visitNotIgnoredFiles } from '../generators/visit-not-ignored-files';
|
||||
import { basename } from 'path';
|
||||
import { isBinaryPath } from './binary-extensions';
|
||||
const { logger } = requireNx();
|
||||
|
||||
const {
|
||||
getProjects,
|
||||
@@ -37,20 +38,26 @@ function replacePackageInDependencies(
|
||||
return;
|
||||
}
|
||||
|
||||
updateJson<PackageJson>(tree, path, (packageJson) => {
|
||||
for (const deps of [
|
||||
packageJson.dependencies ?? {},
|
||||
packageJson.devDependencies ?? {},
|
||||
packageJson.peerDependencies ?? {},
|
||||
packageJson.optionalDependencies ?? {},
|
||||
]) {
|
||||
if (oldPackageName in deps) {
|
||||
deps[newPackageName] = deps[oldPackageName];
|
||||
delete deps[oldPackageName];
|
||||
try {
|
||||
updateJson<PackageJson>(tree, path, (packageJson) => {
|
||||
for (const deps of [
|
||||
packageJson.dependencies ?? {},
|
||||
packageJson.devDependencies ?? {},
|
||||
packageJson.peerDependencies ?? {},
|
||||
packageJson.optionalDependencies ?? {},
|
||||
]) {
|
||||
if (oldPackageName in deps) {
|
||||
deps[newPackageName] = deps[oldPackageName];
|
||||
delete deps[oldPackageName];
|
||||
}
|
||||
}
|
||||
}
|
||||
return packageJson;
|
||||
});
|
||||
return packageJson;
|
||||
});
|
||||
} catch (e) {
|
||||
console.warn(
|
||||
`Could not replace ${oldPackageName} with ${newPackageName} in ${path}.`
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -162,15 +169,23 @@ function replaceMentions(
|
||||
return;
|
||||
}
|
||||
|
||||
const contents = tree.read(path).toString();
|
||||
try {
|
||||
const contents = tree.read(path).toString();
|
||||
|
||||
if (!contents.includes(oldPackageName)) {
|
||||
return;
|
||||
if (!contents.includes(oldPackageName)) {
|
||||
return;
|
||||
}
|
||||
|
||||
tree.write(
|
||||
path,
|
||||
contents.replace(new RegExp(oldPackageName, 'g'), newPackageName)
|
||||
);
|
||||
} catch {
|
||||
// Its **probably** ok, contents can be null if the file is too large or
|
||||
// there was an access exception.
|
||||
logger.warn(
|
||||
`An error was thrown when trying to update ${path}. If you believe the migration should have updated it, be sure to review the file and open an issue.`
|
||||
);
|
||||
}
|
||||
|
||||
tree.write(
|
||||
path,
|
||||
contents.replace(new RegExp(oldPackageName, 'g'), newPackageName)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
} from '@nx/devkit';
|
||||
import { findNodes } from '@nx/js';
|
||||
import { getModifiers } from '@typescript-eslint/type-utils';
|
||||
import { existsSync, readFileSync } from 'fs';
|
||||
import { existsSync, lstatSync, readdirSync, readFileSync } from 'fs';
|
||||
import { dirname } from 'path';
|
||||
import ts = require('typescript');
|
||||
|
||||
@@ -81,6 +81,16 @@ function hasMemberExport(exportedMember, filePath) {
|
||||
}
|
||||
|
||||
export function getRelativeImportPath(exportedMember, filePath, basePath) {
|
||||
if (lstatSync(filePath).isDirectory()) {
|
||||
const file = readdirSync(filePath).find((file) =>
|
||||
/^index\.[jt]sx?$/.exec(file)
|
||||
);
|
||||
if (file) {
|
||||
filePath = joinPathFragments(filePath, file);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
const fileContent = readFileSync(filePath, 'utf8');
|
||||
|
||||
// use the TypeScript AST to find the path to the file where exportedMember is defined
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
import * as path from 'path';
|
||||
import type { NextConfig } from 'next';
|
||||
import type { NextConfigFn } from '../src/utils/config';
|
||||
import { forNextVersion } from '../src/utils/config';
|
||||
import type { NextBuildBuilderOptions } from '../src/utils/types';
|
||||
import type { DependentBuildableProjectNode } from '@nx/js/src/utils/buildable-libs-utils';
|
||||
import type { ProjectGraph, ProjectGraphProjectNode, Target } from '@nx/devkit';
|
||||
@@ -156,6 +155,15 @@ function withNx(
|
||||
_nextConfig = {} as WithNxOptions,
|
||||
context: WithNxContext = getWithNxContext()
|
||||
): NextConfigFn {
|
||||
// If this is not set user will see compile errors in Next.js 13.4.
|
||||
// See: https://github.com/nrwl/nx/issues/16692, https://github.com/vercel/next.js/issues/49169
|
||||
// TODO(jack): Remove this once Nx is refactored to invoke CLI directly.
|
||||
forNextVersion('>=13.4.0', () => {
|
||||
process.env['__NEXT_PRIVATE_PREBUNDLED_REACT'] =
|
||||
// Not in Next 13.3 or earlier, so need to access config via string
|
||||
_nextConfig.experimental['serverActions'] ? 'experimental' : 'next';
|
||||
});
|
||||
|
||||
return async (phase: string) => {
|
||||
const { PHASE_PRODUCTION_SERVER } = await import('next/constants');
|
||||
if (phase === PHASE_PRODUCTION_SERVER) {
|
||||
@@ -456,6 +464,15 @@ export function getAliasForProject(
|
||||
return null;
|
||||
}
|
||||
|
||||
// Runs a function if the Next.js version satisfies the range.
|
||||
export function forNextVersion(range: string, fn: () => void) {
|
||||
const semver = require('semver');
|
||||
const nextJsVersion = require('next/package.json').version;
|
||||
if (semver.satisfies(nextJsVersion, range)) {
|
||||
fn();
|
||||
}
|
||||
}
|
||||
|
||||
// Support for older generated code: `const withNx = require('@nx/next/plugins/with-nx');`
|
||||
module.exports = withNx;
|
||||
// Support for newer generated code: `const { withNx } = require(...);`
|
||||
|
||||
@@ -107,12 +107,3 @@ function isTsRule(r: RuleSetRule): boolean {
|
||||
|
||||
return r.test.test('a.ts');
|
||||
}
|
||||
|
||||
// Runs a function if the Next.js version satisfies the range.
|
||||
export function forNextVersion(range: string, fn: () => void) {
|
||||
const semver = require('semver');
|
||||
const nextJsVersion = require('next/package.json').version;
|
||||
if (semver.satisfies(nextJsVersion, range)) {
|
||||
fn();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
{
|
||||
"name": "@nx/nx-darwin-arm64",
|
||||
"version": "0.0.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nrwl/nx.git",
|
||||
"directory": "packages/nx/native-packages/darwin-arm64"
|
||||
},
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
{
|
||||
"name": "@nx/nx-darwin-x64",
|
||||
"version": "0.0.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nrwl/nx.git",
|
||||
"directory": "packages/nx/native-packages/darwin-x64"
|
||||
},
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
{
|
||||
"name": "@nx/nx-linux-arm-gnueabihf",
|
||||
"version": "0.0.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nrwl/nx.git",
|
||||
"directory": "packages/nx/native-packages/linux-arm-gnueabihf"
|
||||
},
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
{
|
||||
"name": "@nx/nx-linux-arm64-gnu",
|
||||
"version": "0.0.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nrwl/nx.git",
|
||||
"directory": "packages/nx/native-packages/linux-arm64-gnu"
|
||||
},
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
{
|
||||
"name": "@nx/nx-linux-arm64-musl",
|
||||
"version": "0.0.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nrwl/nx.git",
|
||||
"directory": "packages/nx/native-packages/linux-arm64-musl"
|
||||
},
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
{
|
||||
"name": "@nx/nx-linux-x64-gnu",
|
||||
"version": "0.0.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nrwl/nx.git",
|
||||
"directory": "packages/nx/native-packages/linux-x64-gnu"
|
||||
},
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
{
|
||||
"name": "@nx/nx-linux-x64-musl",
|
||||
"version": "0.0.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nrwl/nx.git",
|
||||
"directory": "packages/nx/native-packages/linux-x64-musl"
|
||||
},
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
{
|
||||
"name": "@nx/nx-win32-arm64-msvc",
|
||||
"version": "0.0.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nrwl/nx.git",
|
||||
"directory": "packages/nx/native-packages/win32-arm64-msvc"
|
||||
},
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
{
|
||||
"name": "@nx/nx-win32-x64-msvc",
|
||||
"version": "0.0.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nrwl/nx.git",
|
||||
"directory": "packages/nx/native-packages/win32-x64-msvc"
|
||||
},
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
|
||||
@@ -54,7 +54,7 @@ export async function listHandler(args: ListArgs): Promise<void> {
|
||||
bodyLines: [
|
||||
'Looking for a technology / framework not listed above?',
|
||||
'There are many excellent plugins matintained by the Nx community.',
|
||||
'Search for the one you need here: https://nx.dev/community.',
|
||||
'Search for the one you need here: https://nx.dev/plugins/registry.',
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
@@ -1558,7 +1558,7 @@ async function runNxMigration(
|
||||
name
|
||||
);
|
||||
const fn = require(implPath)[fnSymbol];
|
||||
const host = new FsTree(root, false);
|
||||
const host = new FsTree(root, process.env.NX_VERBOSE_LOGGING === 'true');
|
||||
await fn(host, {});
|
||||
host.lock();
|
||||
const changes = host.listChanges();
|
||||
|
||||
@@ -218,10 +218,12 @@ function findCreatedProjectFiles(tree: Tree) {
|
||||
if (fileName === 'project.json') {
|
||||
createdProjectFiles.push(change.path);
|
||||
} else if (fileName === 'package.json') {
|
||||
const contents: PackageJson = JSON.parse(change.content.toString());
|
||||
if (contents.nx) {
|
||||
createdProjectFiles.push(change.path);
|
||||
}
|
||||
try {
|
||||
const contents: PackageJson = JSON.parse(change.content.toString());
|
||||
if (contents.nx) {
|
||||
createdProjectFiles.push(change.path);
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,8 +93,8 @@ export function createPackageJson(
|
||||
}
|
||||
|
||||
const getVersion = (
|
||||
packageName,
|
||||
version,
|
||||
packageName: string,
|
||||
version: string,
|
||||
section: 'devDependencies' | 'dependencies'
|
||||
) => {
|
||||
return (
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
jest.mock('fs');
|
||||
import * as fs from 'fs';
|
||||
import * as configModule from 'nx/src/config/configuration';
|
||||
import { detectPackageManager } from 'nx/src/utils/package-manager';
|
||||
|
||||
describe('package-manager', () => {
|
||||
it('should detect package manager in nxJson', () => {
|
||||
jest.spyOn(configModule, 'readNxJson').mockReturnValueOnce({
|
||||
cli: {
|
||||
packageManager: 'pnpm',
|
||||
},
|
||||
});
|
||||
const packageManager = detectPackageManager();
|
||||
expect(packageManager).toEqual('pnpm');
|
||||
expect(fs.existsSync).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should detect yarn package manager from yarn.lock', () => {
|
||||
jest.spyOn(configModule, 'readNxJson').mockReturnValueOnce({});
|
||||
(fs.existsSync as jest.Mock).mockReturnValueOnce(true);
|
||||
const packageManager = detectPackageManager();
|
||||
expect(packageManager).toEqual('yarn');
|
||||
expect(fs.existsSync).toHaveBeenNthCalledWith(1, 'yarn.lock');
|
||||
});
|
||||
|
||||
it('should detect pnpm package manager from pnpm-lock.yaml', () => {
|
||||
jest.spyOn(configModule, 'readNxJson').mockReturnValueOnce({});
|
||||
(fs.existsSync as jest.Mock).mockImplementation((path) => {
|
||||
return path === 'pnpm-lock.yaml';
|
||||
});
|
||||
const packageManager = detectPackageManager();
|
||||
expect(packageManager).toEqual('pnpm');
|
||||
expect(fs.existsSync).toHaveBeenCalledTimes(3);
|
||||
});
|
||||
|
||||
it('should use npm package manager as default', () => {
|
||||
jest.spyOn(configModule, 'readNxJson').mockReturnValueOnce({});
|
||||
(fs.existsSync as jest.Mock).mockReturnValue(false);
|
||||
const packageManager = detectPackageManager();
|
||||
expect(packageManager).toEqual('npm');
|
||||
expect(fs.existsSync).toHaveBeenCalledTimes(5);
|
||||
});
|
||||
});
|
||||
@@ -8,6 +8,7 @@ import { writeJsonFile } from './fileutils';
|
||||
import { readModulePackageJson } from './package-json';
|
||||
import { gte, lt } from 'semver';
|
||||
import { workspaceRoot } from './workspace-root';
|
||||
import { readNxJson } from '../config/configuration';
|
||||
|
||||
const execAsync = promisify(exec);
|
||||
|
||||
@@ -28,11 +29,15 @@ export interface PackageManagerCommands {
|
||||
* Detects which package manager is used in the workspace based on the lock file.
|
||||
*/
|
||||
export function detectPackageManager(dir: string = ''): PackageManager {
|
||||
return existsSync(join(dir, 'yarn.lock'))
|
||||
? 'yarn'
|
||||
: existsSync(join(dir, 'pnpm-lock.yaml'))
|
||||
? 'pnpm'
|
||||
: 'npm';
|
||||
const nxJson = readNxJson();
|
||||
return (
|
||||
nxJson.cli?.packageManager ??
|
||||
(existsSync(join(dir, 'yarn.lock'))
|
||||
? 'yarn'
|
||||
: existsSync(join(dir, 'pnpm-lock.yaml'))
|
||||
? 'pnpm'
|
||||
: 'npm')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -982,6 +982,27 @@ describe('params', () => {
|
||||
).not.toThrow();
|
||||
});
|
||||
|
||||
it('should handle const value', () => {
|
||||
const schema = {
|
||||
properties: {
|
||||
a: {
|
||||
const: 3,
|
||||
},
|
||||
},
|
||||
};
|
||||
expect(() => validateOptsAgainstSchema({ a: 3 }, schema)).not.toThrow();
|
||||
expect(() =>
|
||||
validateOptsAgainstSchema({ a: true }, schema)
|
||||
).toThrowErrorMatchingInlineSnapshot(
|
||||
`"Property 'a' does not match the schema. 'true' should be '3'."`
|
||||
);
|
||||
expect(() =>
|
||||
validateOptsAgainstSchema({ a: 123 }, schema)
|
||||
).toThrowErrorMatchingInlineSnapshot(
|
||||
`"Property 'a' does not match the schema. '123' should be '3'."`
|
||||
);
|
||||
});
|
||||
|
||||
describe('array', () => {
|
||||
it('should handle validating patterns', () => {
|
||||
const schema = {
|
||||
|
||||
@@ -33,6 +33,7 @@ type PropertyDescription = {
|
||||
| { $source: 'projectName' }
|
||||
| { $source: 'unparsed' };
|
||||
additionalProperties?: boolean;
|
||||
const?: any;
|
||||
'x-prompt'?:
|
||||
| string
|
||||
| { message: string; type: string; items?: any[]; multiselect?: boolean };
|
||||
@@ -359,6 +360,12 @@ function validateProperty(
|
||||
|
||||
const isPrimitive = typeof value !== 'object';
|
||||
if (isPrimitive) {
|
||||
if (schema.const !== undefined && value !== schema.const) {
|
||||
throw new SchemaError(
|
||||
`Property '${propName}' does not match the schema. '${value}' should be '${schema.const}'.`
|
||||
);
|
||||
}
|
||||
|
||||
if (Array.isArray(schema.type)) {
|
||||
const passes = schema.type.some((t) => {
|
||||
try {
|
||||
|
||||
@@ -44,6 +44,7 @@ export function normalizeRollupExecutorOptions(
|
||||
project,
|
||||
projectRoot,
|
||||
outputPath,
|
||||
skipTypeCheck: options.skipTypeCheck || false,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ export function createRollupOptions(
|
||||
json(),
|
||||
(useTsc || useBabel) &&
|
||||
require('rollup-plugin-typescript2')({
|
||||
check: true,
|
||||
check: !options.skipTypeCheck,
|
||||
tsconfig: options.tsConfig,
|
||||
tsconfigOverride: {
|
||||
compilerOptions: createTsCompilerOptions(
|
||||
|
||||
@@ -31,4 +31,5 @@ export interface RollupExecutorOptions {
|
||||
compiler?: 'babel' | 'tsc' | 'swc';
|
||||
javascriptEnabled?: boolean;
|
||||
generateExportsField?: boolean;
|
||||
skipTypeCheck?: boolean;
|
||||
}
|
||||
|
||||
@@ -146,6 +146,11 @@
|
||||
"type": "boolean",
|
||||
"description": "Generate package.json with 'exports' field. This field defines entry points in the package and is used by Node and the TypeScript compiler.",
|
||||
"default": false
|
||||
},
|
||||
"skipTypeCheck": {
|
||||
"type": "boolean",
|
||||
"description": "Whether to skip TypeScript type checking.",
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
"required": ["tsConfig", "main", "outputPath"],
|
||||
|
||||
@@ -62,6 +62,114 @@
|
||||
}
|
||||
},
|
||||
"packageJsonUpdates": {
|
||||
"16.1.3": {
|
||||
"version": "16.1.3-beta.0",
|
||||
"requires": {
|
||||
"@storybook/core-server": ">=7.0.0 <7.0.9"
|
||||
},
|
||||
"packages": {
|
||||
"@storybook/core-server": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/angular": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/react": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/web-components-vite": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/web-components-webpack5": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/builder-vite": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/builder-webpack5": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/addon-a11y": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/addon-actions": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/addon-backgrounds": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/addon-controls": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/addon-docs": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/addon-essentials": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/addon-mdx-gfm": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/addon-highlight": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/addon-interactions": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/addon-jest": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/addon-links": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/addon-measure": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/addon-outline": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/addon-storyshots": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/addon-storyshots-puppeteer": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/addon-storysource": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/addon-toolbars": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@storybook/addon-viewport": {
|
||||
"version": "^7.0.9",
|
||||
"alwaysAddToPackageJson": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"16.1.0": {
|
||||
"version": "16.1.0-beta.0",
|
||||
"requires": {
|
||||
|
||||
@@ -10,10 +10,10 @@ exports[`@nx/storybook:init dependencies for package.json should add angular rel
|
||||
"devDependencies": {
|
||||
"@angular/forms": "*",
|
||||
"@nx/js": "0.0.1",
|
||||
"@nx/storybook": "^7.0.8",
|
||||
"@storybook/addon-essentials": "7.0.8",
|
||||
"@storybook/angular": "7.0.8",
|
||||
"@storybook/core-server": "7.0.8",
|
||||
"@nx/storybook": "^7.0.9",
|
||||
"@storybook/addon-essentials": "7.0.9",
|
||||
"@storybook/angular": "7.0.9",
|
||||
"@storybook/core-server": "7.0.9",
|
||||
"existing": "1.0.0",
|
||||
"prettier": "^2.6.2",
|
||||
"typescript": "~5.0.2",
|
||||
|
||||
@@ -5,5 +5,5 @@ export const storybookTestRunnerVersion = '^0.7.2';
|
||||
export const litVersion = '^2.6.1';
|
||||
export const tsNodeVersion = '10.9.1';
|
||||
|
||||
export const storybookVersion = '^7.0.8';
|
||||
export const storybookVersion = '^7.0.9';
|
||||
export const reactVersion = '^18.2.0';
|
||||
|
||||
Generated
+884
-1382
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,49 @@
|
||||
import * as fg from 'fast-glob';
|
||||
import * as path from 'path';
|
||||
import * as fs from 'fs';
|
||||
import { output } from '@nx/devkit';
|
||||
|
||||
async function main() {
|
||||
const codeowners = fs.readFileSync(
|
||||
path.join(__dirname, '../CODEOWNERS'),
|
||||
'utf-8'
|
||||
);
|
||||
const codeownersLines = codeowners
|
||||
.split('\n')
|
||||
.filter((line) => line.trim().length > 0 && !line.startsWith('#'));
|
||||
|
||||
const errors: string[] = [];
|
||||
|
||||
for (const line of codeownersLines) {
|
||||
// This is perhaps a bit naive, but it should
|
||||
// work for all paths and patterns that do not
|
||||
// contain spaces.
|
||||
const specifiedPattern = line.split(' ')[0];
|
||||
let foundMatchingFiles = false;
|
||||
|
||||
const patternsToCheck = specifiedPattern.startsWith('/')
|
||||
? [`.${specifiedPattern}`]
|
||||
: [`./${specifiedPattern}`, `**/${specifiedPattern}`];
|
||||
|
||||
for (const pattern of patternsToCheck) {
|
||||
foundMatchingFiles ||=
|
||||
fg.sync(pattern, {
|
||||
ignore: ['node_modules', 'dist', 'build', '.git'],
|
||||
cwd: path.join(__dirname, '..'),
|
||||
onlyFiles: false,
|
||||
}).length > 0;
|
||||
}
|
||||
if (!foundMatchingFiles) {
|
||||
errors.push(specifiedPattern);
|
||||
}
|
||||
}
|
||||
if (errors.length > 0) {
|
||||
output.error({
|
||||
title: `The following patterns in CODEOWNERS do not match any files:`,
|
||||
bodyLines: errors.map((e) => `- ${e}`),
|
||||
});
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
@@ -7,8 +7,8 @@ import { join } from 'path';
|
||||
|
||||
import { parse } from 'semver';
|
||||
|
||||
import * as version from '@lerna/version';
|
||||
import * as publish from '@lerna/publish';
|
||||
const version = require('lerna/commands/version');
|
||||
const publish = require('lerna/commands/publish');
|
||||
|
||||
const lernaJsonPath = join(__dirname, '../lerna.json');
|
||||
const originalLernaJson = readFileSync(lernaJsonPath);
|
||||
|
||||
Reference in New Issue
Block a user