Skip to content

Commit

Permalink
Merge branch 'master' into fix/swcrc-options
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz authored Sep 22, 2023
2 parents 187a6e2 + d8261b4 commit 6f99473
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 11 deletions.
6 changes: 5 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@
"release": {
"groups": {
"npm": {
"projects": ["packages/*", "packages-legacy/*"],
"projects": [
"packages/*",
"packages/nx/native-packages/*",
"packages-legacy/*"
],
"version": {
"generatorOptions": {
"packageRoot": "build/packages/{projectName}",
Expand Down
5 changes: 4 additions & 1 deletion packages/nx/bin/init-local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ function rewritePositionalArguments(args: string[]) {
const relevantPositionalArgs = [];
const rest = [];
for (let i = 2; i < args.length; i++) {
if (!args[i].startsWith('-')) {
if (args[i] === '--') {
rest.push(...args.slice(i + 1));
break;
} else if (!args[i].startsWith('-')) {
relevantPositionalArgs.push(args[i]);
if (relevantPositionalArgs.length === 2) {
rest.push(...args.slice(i + 1));
Expand Down
3 changes: 2 additions & 1 deletion packages/nx/src/command-line/show/command-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type ShowProjectsOptions = NxShowArgs & {
head: string;
affected: boolean;
projects: string[];
withTarget: string;
withTarget: string[];
};

export type ShowProjectOptions = NxShowArgs & {
Expand Down Expand Up @@ -73,6 +73,7 @@ const showProjectsCommand: CommandModule<NxShowArgs, ShowProjectsOptions> = {
type: 'string',
alias: ['t'],
description: 'Show only projects that have a specific target',
coerce: parseCSV,
})
.implies('untracked', 'affected')
.implies('uncommitted', 'affected')
Expand Down
2 changes: 1 addition & 1 deletion packages/nx/src/command-line/show/show.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function showProjectsHandler(

if (args.withTarget) {
graph.nodes = Object.entries(graph.nodes).reduce((acc, [name, node]) => {
if (node.data.targets?.[args.withTarget]) {
if (args.withTarget.some((target) => node.data.targets?.[target])) {
acc[name] = node;
}
return acc;
Expand Down
9 changes: 5 additions & 4 deletions packages/nx/src/project-graph/project-graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ import { readNxJson } from '../config/nx-json';
*/
export function readCachedProjectGraph(): ProjectGraph {
const projectGraphCache: ProjectGraph = readProjectGraphCache();
const angularSpecificError = fileExists(`${workspaceRoot}/angular.json`)
? stripIndents`
if (!projectGraphCache) {
const angularSpecificError = fileExists(`${workspaceRoot}/angular.json`)
? stripIndents`
Make sure invoke 'node ./decorate-angular-cli.js' in your postinstall script.
The decorated CLI will compute the project graph.
'ng --help' should say 'Smart, Fast and Extensible Build System'.
`
: '';
if (!projectGraphCache) {
: '';

throw new Error(stripIndents`
[readCachedProjectGraph] ERROR: No cached ProjectGraph is available.
Expand Down
4 changes: 1 addition & 3 deletions packages/plugin/src/executors/e2e/e2e.impl.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { ExecutorContext } from '@nx/devkit';

import {
createProjectGraphAsync,
logger,
output,
parseTargetString,
Expand Down Expand Up @@ -44,10 +43,9 @@ async function* runBuildTarget(
buildTarget: string,
context: ExecutorContext
): AsyncGenerator<boolean> {
const graph = await createProjectGraphAsync();
const { project, target, configuration } = parseTargetString(
buildTarget,
graph
context
);
const buildTargetOptions = readTargetOptions(
{ project, target, configuration },
Expand Down

0 comments on commit 6f99473

Please sign in to comment.