Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ddebcd2
Initial plan
Copilot Aug 5, 2025
17dd3cf
Add frontend monorepo support for Nx and Turborepo
Copilot Aug 6, 2025
fce9c00
Fix dependency chain for monorepo package installers
Copilot Aug 6, 2025
4901be1
Deleting old hooks
aaronpowell Aug 7, 2025
1d09e08
Don't need to wait on the top-level resources as they aren't really d…
aaronpowell Aug 7, 2025
31aaf0a
Adding a callback to configure the app resources if the user wants
aaronpowell Aug 7, 2025
ef8f210
Slight refactoring on the method locations
aaronpowell Aug 7, 2025
9106a95
Removing invalid tests
aaronpowell Aug 7, 2025
2105394
Deleting another obsolete file
aaronpowell Aug 7, 2025
d320bf6
feat(create-turbo): apply official-starter transform
turbobot-temp Aug 7, 2025
8a75cdc
feat(create-turbo): apply package-manager transform
turbobot-temp Aug 7, 2025
f181bc0
feat(create-turbo): install dependencies
turbobot-temp Aug 7, 2025
f4accd5
Whole bunch of refactoring mostly
aaronpowell Aug 7, 2025
907dbae
Installing turbo and nx in CI
aaronpowell Aug 7, 2025
89f661e
Fixing the wait on installer for monorepos
aaronpowell Aug 7, 2025
9699537
Merge branch 'main' into copilot/fix-772
aaronpowell Aug 27, 2025
72220a5
Adding nx demo app
aaronpowell Aug 27, 2025
b932a97
Adding support for using the local install of turbo/nx rather than gl…
aaronpowell Aug 27, 2025
264cbf5
Can't run two nx instances from the same folder
aaronpowell Aug 27, 2025
858108f
Extending timeout
aaronpowell Aug 28, 2025
2246b8a
nx app waited for the wrong thing
aaronpowell Aug 28, 2025
39c33be
Removing the -with-npx as I think the two installers on the same DIR …
aaronpowell Aug 28, 2025
0082be5
Document RunWithPackageManager method for Nx and Turborepo
Copilot Aug 28, 2025
2ac63d2
Merge branch 'main' into copilot/fix-772
aaronpowell Aug 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ echo Install .NET dev certs
dotnet tool update -g linux-dev-certs
dotnet linux-dev-certs install

echo Install the SWA CLI
npm install -g @azure/static-web-apps-cli

echo Install SWA demo packages
cd examples/swa/CommunityToolkit.Aspire.StaticWebApps.WebApp
npm ci
cd ../../../
echo Install JS monorepo tools
npm install -g turbo
npm install -g nx

echo Install Aspire 9 templates
dotnet new install Aspire.ProjectTemplates
Expand Down
9 changes: 4 additions & 5 deletions .github/actions/setup-runtimes-caching/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,12 @@ runs:
dotnet tool update -g linux-dev-certs
dotnet linux-dev-certs install

- name: Setup Node projects
- name: Setup Node globals
shell: bash
if: ${{ contains(inputs.name, 'StaticWebApps') }}
if: ${{ contains(inputs.name, 'Node') }}
run: |
npm install -g @azure/static-web-apps-cli
cd examples/swa/CommunityToolkit.Aspire.StaticWebApps.WebApp
npm ci
npm install -g turbo
npm install -g nx

- name: Login to docker
uses: docker/login-action@v3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,26 @@
.WithPnpmPackageInstallation()
.WithHttpHealthCheck();

// Example of Nx monorepo support - uncomment if you have an Nx workspace
var nx = builder.AddNxApp("nx-demo")
.WithNpmPackageInstaller();

nx.AddApp("blog-monorepo")
.WithHttpEndpoint()
.WithMappedEndpointPort()
.WithHttpHealthCheck();

// Example of Turborepo monorepo support - uncomment if you have a Turborepo workspace
var turbo = builder.AddTurborepoApp("turborepo-demo")
.WithNpmPackageInstaller();

turbo.AddApp("turbo-web", filter: "web")
.WithHttpEndpoint()
.WithMappedEndpointPort()
.WithHttpHealthCheck();
turbo.AddApp("turbo-docs", filter: "docs")
.WithHttpEndpoint()
.WithMappedEndpointPort()
.WithHttpHealthCheck();

builder.Build().Run();
13 changes: 13 additions & 0 deletions examples/nodejs-ext/nx-demo/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
47 changes: 47 additions & 0 deletions examples/nodejs-ext/nx-demo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# See https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files for more about ignoring files.

# compiled output
dist
tmp
out-tsc

# dependencies
node_modules

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db

.nx/cache
.nx/workspace-data
.cursor/rules/nx-rules.mdc
.github/instructions/nx.instructions.md

vite.config.*.timestamp*
vitest.config.*.timestamp*
5 changes: 5 additions & 0 deletions examples/nodejs-ext/nx-demo/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Add files here to ignore them from prettier formatting
/dist
/coverage
/.nx/cache
/.nx/workspace-data
3 changes: 3 additions & 0 deletions examples/nodejs-ext/nx-demo/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
7 changes: 7 additions & 0 deletions examples/nodejs-ext/nx-demo/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"nrwl.angular-console",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint"
]
}
101 changes: 101 additions & 0 deletions examples/nodejs-ext/nx-demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# BlogMonorepo

<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>

✨ Your new, shiny [Nx workspace](https://nx.dev) is ready ✨.

[Learn more about this workspace setup and its capabilities](https://nx.dev/getting-started/tutorials/react-monorepo-tutorial?utm_source=nx_project&amp;utm_medium=readme&amp;utm_campaign=nx_projects) or run `npx nx graph` to visually explore what was created. Now, let's get you up to speed!

## Run tasks

To run the dev server for your app, use:

```sh
npx nx serve blog-monorepo
```

To create a production bundle:

```sh
npx nx build blog-monorepo
```

To see all available targets to run for a project, run:

```sh
npx nx show project blog-monorepo
```

These targets are either [inferred automatically](https://nx.dev/concepts/inferred-tasks?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) or defined in the `project.json` or `package.json` files.

[More about running tasks in the docs &raquo;](https://nx.dev/features/run-tasks?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)

## Add new projects

While you could add new projects to your workspace manually, you might want to leverage [Nx plugins](https://nx.dev/concepts/nx-plugins?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) and their [code generation](https://nx.dev/features/generate-code?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) feature.

Use the plugin's generator to create new projects.

To generate a new application, use:

```sh
npx nx g @nx/react:app demo
```

To generate a new library, use:

```sh
npx nx g @nx/react:lib mylib
```

You can use `npx nx list` to get a list of installed plugins. Then, run `npx nx list <plugin-name>` to learn about more specific capabilities of a particular plugin. Alternatively, [install Nx Console](https://nx.dev/getting-started/editor-setup?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) to browse plugins and generators in your IDE.

[Learn more about Nx plugins &raquo;](https://nx.dev/concepts/nx-plugins?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) | [Browse the plugin registry &raquo;](https://nx.dev/plugin-registry?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)

## Set up CI!

### Step 1

To connect to Nx Cloud, run the following command:

```sh
npx nx connect
```

Connecting to Nx Cloud ensures a [fast and scalable CI](https://nx.dev/ci/intro/why-nx-cloud?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) pipeline. It includes features such as:

- [Remote caching](https://nx.dev/ci/features/remote-cache?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
- [Task distribution across multiple machines](https://nx.dev/ci/features/distribute-task-execution?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
- [Automated e2e test splitting](https://nx.dev/ci/features/split-e2e-tasks?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
- [Task flakiness detection and rerunning](https://nx.dev/ci/features/flaky-tasks?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)

### Step 2

Use the following command to configure a CI workflow for your workspace:

```sh
npx nx g ci-workflow
```

[Learn more about Nx on CI](https://nx.dev/ci/intro/ci-with-nx#ready-get-started-with-your-provider?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)

## Install Nx Console

Nx Console is an editor extension that enriches your developer experience. It lets you run tasks, generate code, and improves code autocompletion in your IDE. It is available for VSCode and IntelliJ.

[Install Nx Console &raquo;](https://nx.dev/getting-started/editor-setup?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)

## Useful links

Learn more:

- [Learn more about this workspace setup](https://nx.dev/getting-started/tutorials/react-monorepo-tutorial?utm_source=nx_project&amp;utm_medium=readme&amp;utm_campaign=nx_projects)
- [Learn about Nx on CI](https://nx.dev/ci/intro/ci-with-nx?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
- [Releasing Packages with Nx release](https://nx.dev/features/manage-releases?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
- [What are Nx plugins?](https://nx.dev/concepts/nx-plugins?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)

And join the Nx community:
- [Discord](https://go.nx.dev/community)
- [Follow us on X](https://twitter.com/nxdevtools) or [LinkedIn](https://www.linkedin.com/company/nrwl)
- [Our Youtube channel](https://www.youtube.com/@nxdevtools)
- [Our blog](https://nx.dev/blog?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
12 changes: 12 additions & 0 deletions examples/nodejs-ext/nx-demo/apps/blog-monorepo/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import nx from '@nx/eslint-plugin';
import baseConfig from '../../eslint.config.mjs';

export default [
...baseConfig,
...nx.configs['flat/react'],
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
// Override or add rules here
rules: {},
},
];
16 changes: 16 additions & 0 deletions examples/nodejs-ext/nx-demo/apps/blog-monorepo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>BlogMonorepo</title>
<base href="/" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link rel="stylesheet" href="/src/styles.css" />
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
5 changes: 5 additions & 0 deletions examples/nodejs-ext/nx-demo/apps/blog-monorepo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "@blog-monorepo/blog-monorepo",
"version": "0.0.1",
"private": true
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* Your styles goes here. */
52 changes: 52 additions & 0 deletions examples/nodejs-ext/nx-demo/apps/blog-monorepo/src/app/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Uncomment this line to use CSS modules
// import styles from './app.module.css';
import NxWelcome from './nx-welcome';

import { Route, Routes, Link } from 'react-router-dom';

export function App() {
return (
<div>
<NxWelcome title="@blog-monorepo/blog-monorepo" />

{/* START: routes */}
{/* These routes and navigation have been generated for you */}
{/* Feel free to move and update them to fit your needs */}
<br />
<hr />
<br />
<div role="navigation">
<ul>
<li>
<Link to="/">Home</Link>
</li>
<li>
<Link to="/page-2">Page 2</Link>
</li>
</ul>
</div>
<Routes>
<Route
path="/"
element={
<div>
This is the generated root route.{' '}
<Link to="/page-2">Click here for page 2.</Link>
</div>
}
/>
<Route
path="/page-2"
element={
<div>
<Link to="/">Click here to go back to root page.</Link>
</div>
}
/>
</Routes>
{/* END: routes */}
</div>
);
}

export default App;
Loading
Loading