Skip to content

Commit

Permalink
chore(repo): Merge remote-tracking branch 'upstream/master' into feat…
Browse files Browse the repository at this point in the history
…-link-lint-target-to-executor
  • Loading branch information
meeroslav committed Dec 6, 2023
2 parents 709e54c + ab8c929 commit cc8b916
Show file tree
Hide file tree
Showing 88 changed files with 4,804 additions and 540 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ jobs:
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
if: ${{ !contains(github.ref, '-') }}
if: ${{ !contains(github.ref, '-') && github.event_name != 'schedule' }}
- name: Build
id: build
if: ${{ !contains(github.ref, '-') }}
if: ${{ !contains(github.ref, '-') && github.event_name != 'schedule' }}
uses: cross-platform-actions/action@v0.21.1
env:
DEBUG: napi:*
Expand Down Expand Up @@ -206,15 +206,15 @@ jobs:
killall node || true
echo "COMPLETE"
- name: Upload artifact
if: ${{ !contains(github.ref, '-') }}
if: ${{ !contains(github.ref, '-') && github.event_name != 'schedule' }}
uses: actions/upload-artifact@v3
with:
name: bindings-freebsd
path: packages/**/*.node
if-no-files-found: error

publish:
if: ${{ github.event_name == 'release' && github.repository_owner == 'nrwl' }}
if: ${{ github.repository_owner == 'nrwl' }}
name: Publish
runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -253,7 +253,13 @@ jobs:
# Otherwise, use the tag name (if triggered via release), or explicit version (if triggered via workflow_dispatch)
VERSION="${GITHUB_REF_NAME}"
fi
pnpm nx-release --local=false $VERSION
# If triggered via workflow_dispatch, perform a dry-run
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
DRY_RUN="--dry-run"
else
DRY_RUN=""
fi
pnpm nx-release --local=false $VERSION $DRY_RUN
- name: Trigger Docs Release
# Publish docs only on a full release
if: ${{ !github.event.release.prerelease }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jest.debug.config.js
/graph/client/src/assets/generated-project-graphs
/graph/client/src/assets/generated-task-graphs
/graph/client/src/assets/generated-task-inputs
/graph/client/src/assets/generated-source-maps
/nx-dev/nx-dev/public/documentation
/nx-dev/nx-dev/public/images/open-graph

Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ The scope must be one of the following:
- nx-dev - anything related to docs infrastructure
- react - anything React specific
- react-native - anything React Native specific
- release - anything related to nx release
- repo - anything related to managing the Nx repo itself
- storybook - anything Storybook specific
- testing - anything testing specific (e.g., Jest or Cypress)
Expand Down
2 changes: 1 addition & 1 deletion docs/generated/manifests/nx-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"type": "executor"
},
"/nx-api/angular/executors/application": {
"description": "Builds an application with esbuild with support for incremental builds.",
"description": "Builds an application with esbuild with support for incremental builds. _Note: this is only supported in Angular versions >= 17.0.0_.",
"file": "generated/packages/angular/executors/application.json",
"hidden": false,
"name": "application",
Expand Down
2 changes: 1 addition & 1 deletion docs/generated/packages-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"type": "executor"
},
{
"description": "Builds an application with esbuild with support for incremental builds.",
"description": "Builds an application with esbuild with support for incremental builds. _Note: this is only supported in Angular versions >= 17.0.0_.",
"file": "generated/packages/angular/executors/application.json",
"hidden": false,
"name": "application",
Expand Down
16 changes: 2 additions & 14 deletions docs/generated/packages/angular/executors/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"schema": {
"$schema": "http://json-schema.org/draft-07/schema",
"title": "Schema for Nx Application Executor",
"description": "Builds an application with esbuild with support for incremental builds.",
"description": "Builds an application with esbuild with support for incremental builds. _Note: this is only supported in Angular versions >= 17.0.0_.",
"examplesFile": "The `@nx/angular:application` executor is very similar to the `@angular-devkit/build-angular:application` builder provided by the Angular CLI. It builds an Angular application using [esbuild](https://esbuild.github.io/) with integrated SSR and prerendering capabilities.\n\nIn addition to the features provided by the Angular CLI builder, the `@nx/angular:application` executor also supports the following:\n\n- Providing esbuild plugins\n- Incremental builds\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Providing esbuild plugins\" %}\n\nThe executor accepts a `plugins` option that allows you to provide esbuild plugins that will be used when building your application. It allows providing a path to a plugin file or an object with a `path` and `options` property to provide options to the plugin.\n\n```json\n\"build\": {\n \"executor\": \"@nx/angular:application\",\n \"options\": {\n ...\n \"plugins\": [\n \"apps/my-app/plugins/plugin1.js\",\n {\n \"path\": \"apps/my-app/plugins/plugin2.js\",\n \"options\": {\n \"someOption\": \"someValue\"\n }\n }\n ]\n }\n}\n```\n\n{% /tab %}\n{% /tabs %}\n",
"outputCapture": "direct-nodejs",
"type": "object",
Expand Down Expand Up @@ -191,11 +191,6 @@
"type": "boolean",
"description": "Extract and inline critical CSS definitions to improve first paint time.",
"default": true
},
"removeSpecialComments": {
"type": "boolean",
"description": "Remove comments in global CSS that contains '@license' or '@preserve' or that starts with '//!' or '/*!'.",
"default": true
}
},
"additionalProperties": false
Expand Down Expand Up @@ -227,13 +222,6 @@
{ "type": "boolean" }
]
},
"loader": {
"description": "Defines the type of loader to use with a specified file extension when used with a JavaScript `import`. `text` inlines the content as a string; `binary` inlines the content as a Uint8Array; `file` emits the file and provides the runtime location of the file; `empty` considers the content to be empty and not include it in bundles.",
"type": "object",
"patternProperties": {
"^\\.\\S+$": { "enum": ["text", "binary", "file", "empty"] }
}
},
"fileReplacements": {
"description": "Replace compilation source files with other compilation source files in the build.",
"type": "array",
Expand Down Expand Up @@ -685,7 +673,7 @@
},
"presets": []
},
"description": "Builds an application with esbuild with support for incremental builds.",
"description": "Builds an application with esbuild with support for incremental builds. _Note: this is only supported in Angular versions >= 17.0.0_.",
"aliases": [],
"hidden": false,
"path": "/packages/angular/src/executors/application/schema.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@
"default": true
},
"plugins": {
"description": "A list of ESBuild plugins.",
"description": "A list of ESBuild plugins. _Note: this is only supported in Angular versions >= 17.0.0_.",
"type": "array",
"items": {
"oneOf": [
Expand Down
2 changes: 1 addition & 1 deletion docs/shared/core-features/remote-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ During the setup process you might have seen a link to claim your Nx Cloud conne

Click on this link to associate the workspace with your Nx Cloud account. If you don't have an Nx Cloud account, you can create one on the spot.

![Nx Cloud Workspace Dashboard](/shared/images/ci/nx-cloud-workspace-overview.png)
![Nx Cloud Workspace Dashboard](/shared/images/nx-cloud/nx-cloud-workspace-overview.png)

Claiming your workspace allows you to

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export default config;

### Optional: use `run-commands` and create a `storybook-composition` target

If you want to take advantage of the [`run-commands`](https://nx.dev/api/nx/executors/run-commands) functionality of Nx, you can create a custom target that will invoke the `run-parallel` command for your "composed" Storybook instances.
If you want to take advantage of the [`run-commands`](/nx-api/nx/executors/run-commands) functionality of Nx, you can create a custom target that will invoke the `run-parallel` command for your "composed" Storybook instances.

The objective is to end up with a new target in your `main-host`'s `project.json` file (`apps/main-host/project.json`) that looks like this:
Expand Down
2 changes: 1 addition & 1 deletion e2e/node/src/node-webpack.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('Node Applications + webpack', () => {

await runCLIAsync(`build ${app} --optimization`);
const optimizedContent = readFile(`dist/apps/${app}/main.js`);
expect(optimizedContent).toContain('console.log("foo bar")');
expect(optimizedContent).toContain('console.log("foo "+"bar")');

// Test that serve can re-run dependency builds.
const lib = uniq('nodelib');
Expand Down
7 changes: 7 additions & 0 deletions graph/client/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"graph/client/src/assets/generated-project-graphs/",
"graph/client/src/assets/generated-task-graphs/",
"graph/client/src/assets/generated-task-inputs/",
"graph/client/src/assets/generated-source-maps/",
{
"input": "graph/client/src/assets/dev",
"output": "/",
Expand All @@ -81,6 +82,7 @@
"graph/client/src/assets/project-graphs/",
"graph/client/src/assets/task-graphs/",
"graph/client/src/assets/task-inputs/",
"graph/client/src/assets/source-maps/",
{
"input": "graph/client/src/assets/dev-e2e",
"output": "/",
Expand Down Expand Up @@ -116,6 +118,11 @@
"output": "/assets/task-graphs",
"glob": "e2e.json"
},
{
"input": "graph/client/src/assets/source-maps",
"output": "/assets/source-maps",
"glob": "e2e.json"
},
{
"input": "graph/client/src/assets/release",
"output": "/",
Expand Down
10 changes: 10 additions & 0 deletions graph/client/src/app/fetch-project-graph-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ export class FetchProjectGraphService implements ProjectGraphService {
return response.json();
}

async getSourceMaps(
url: string
): Promise<Record<string, Record<string, string[]>>> {
const request = new Request(url, { mode: 'no-cors' });

const response = await fetch(request);

return response.json();
}

setTaskInputsUrl(url: string) {
this.taskInputsUrl = url;
}
Expand Down
4 changes: 4 additions & 0 deletions graph/client/src/app/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface WorkspaceData {
projectGraphUrl: string;
taskGraphUrl: string;
taskInputsUrl: string;
sourceMapsUrl: string;
}

export interface WorkspaceLayout {
Expand All @@ -25,6 +26,9 @@ export interface ProjectGraphService {
getTaskGraph: (url: string) => Promise<TaskGraphClientResponse>;
setTaskInputsUrl?: (url: string) => void;
getExpandedTaskInputs?: (taskId: string) => Promise<Record<string, string[]>>;
getSourceMaps?: (
url: string
) => Promise<Record<string, Record<string, string[]>>>;
}

export interface Environment {
Expand Down
6 changes: 6 additions & 0 deletions graph/client/src/app/local-project-graph-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,10 @@ export class LocalProjectGraphService implements ProjectGraphService {
resolve(window.expandedTaskInputsResponse[taskId])
);
}

async getSourceMaps(
url: string
): Promise<Record<string, Record<string, string[]>>> {
return new Promise((resolve) => resolve(window.sourceMapsResponse));
}
}
49 changes: 47 additions & 2 deletions graph/client/src/app/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ProjectGraphClientResponse } from 'nx/src/command-line/graph/graph';
/* eslint-enable @nx/enforce-module-boundaries */
import { getProjectGraphDataService } from './hooks/get-project-graph-data-service';
import { TasksSidebarErrorBoundary } from './feature-tasks/tasks-sidebar-error-boundary';
import { ProjectDetails } from '@nx/graph/project-details';

const { appConfig } = getEnvironmentConfig();
const projectGraphDataService = getProjectGraphDataService();
Expand Down Expand Up @@ -47,11 +48,37 @@ const workspaceDataLoader = async (selectedWorkspaceId: string) => {
};

const taskDataLoader = async (selectedWorkspaceId: string) => {
const projectInfo = appConfig.workspaces.find(
const workspaceInfo = appConfig.workspaces.find(
(graph) => graph.id === selectedWorkspaceId
);

return await projectGraphDataService.getTaskGraph(workspaceInfo.taskGraphUrl);
};

const sourceMapsLoader = async (selectedWorkspaceId: string) => {
const workspaceInfo = appConfig.workspaces.find(
(graph) => graph.id === selectedWorkspaceId
);

return await projectGraphDataService.getTaskGraph(projectInfo.taskGraphUrl);
return await projectGraphDataService.getSourceMaps(
workspaceInfo.sourceMapsUrl
);
};

const projectDetailsLoader = async (
selectedWorkspaceId: string,
projectName: string
) => {
const workspaceData = await workspaceDataLoader(selectedWorkspaceId);
const sourceMaps = await sourceMapsLoader(selectedWorkspaceId);

const project = workspaceData.projects.find(
(project) => project.name === projectName
);
return {
project,
sourceMap: sourceMaps[project.data.root],
};
};

const childRoutes: RouteObject[] = [
Expand Down Expand Up @@ -146,6 +173,15 @@ export const devRoutes: RouteObject[] = [
},
children: childRoutes,
},
{
path: ':selectedWorkspaceId/project-details/:projectName',
id: 'selectedProjectDetails',
element: <ProjectDetails />,
loader: async ({ request, params }) => {
const projectName = params.projectName;
return projectDetailsLoader(params.selectedWorkspaceId, projectName);
},
},
],
},
];
Expand Down Expand Up @@ -174,4 +210,13 @@ export const releaseRoutes: RouteObject[] = [
...childRoutes,
],
},
{
path: 'project-details/:projectName',
id: 'selectedProjectDetails',
element: <ProjectDetails />,
loader: async ({ request, params }) => {
const projectName = params.projectName;
return projectDetailsLoader(appConfig.defaultWorkspaceId, projectName);
},
},
];
1 change: 1 addition & 0 deletions graph/client/src/assets/release/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ window.appConfig = {
projectGraphUrl: 'assets/project-graphs/e2e.json',
taskGraphUrl: 'assets/task-graphs/e2e.json',
taskInputsUrl: 'assets/task-inputs/e2e.json',
sourceMapsUrl: 'assets/source-maps/e2e.json',
},
],
defaultWorkspaceId: 'local',
Expand Down
Loading

0 comments on commit cc8b916

Please sign in to comment.