Skip to content

Commit e1f96d7

Browse files
author
amir_choubani
committed
an empty nx workspace generated using "npx create-nx-workspace" command with one app inside
1 parent 7017da8 commit e1f96d7

39 files changed

+25713
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": ["**/*"],
4+
"plugins": ["@nx"],
5+
"overrides": [
6+
{
7+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
8+
"rules": {
9+
"@nx/enforce-module-boundaries": [
10+
"error",
11+
{
12+
"enforceBuildableLibDependency": true,
13+
"allow": [],
14+
"depConstraints": [
15+
{
16+
"sourceTag": "*",
17+
"onlyDependOnLibsWithTags": ["*"]
18+
}
19+
]
20+
}
21+
]
22+
}
23+
},
24+
{
25+
"files": ["*.ts", "*.tsx"],
26+
"extends": ["plugin:@nx/typescript"],
27+
"rules": {}
28+
},
29+
{
30+
"files": ["*.js", "*.jsx"],
31+
"extends": ["plugin:@nx/javascript"],
32+
"rules": {}
33+
},
34+
{
35+
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
36+
"env": {
37+
"jest": true
38+
},
39+
"rules": {}
40+
}
41+
]
42+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
dist
5+
tmp
6+
/out-tsc
7+
8+
# dependencies
9+
node_modules
10+
11+
# IDEs and editors
12+
/.idea
13+
.project
14+
.classpath
15+
.c9/
16+
*.launch
17+
.settings/
18+
*.sublime-workspace
19+
20+
# IDE - VSCode
21+
.vscode/*
22+
!.vscode/settings.json
23+
!.vscode/tasks.json
24+
!.vscode/launch.json
25+
!.vscode/extensions.json
26+
27+
# misc
28+
/.sass-cache
29+
/connect.lock
30+
/coverage
31+
/libpeerconnection.log
32+
npm-debug.log
33+
yarn-error.log
34+
testem.log
35+
/typings
36+
37+
# System Files
38+
.DS_Store
39+
Thumbs.db
40+
41+
.nx/cache
42+
.nx/workspace-data
43+
44+
.angular
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
image: node:20
2+
variables:
3+
CI: 'true'
4+
5+
# Main job
6+
CI:
7+
interruptible: true
8+
only:
9+
- main
10+
- merge_requests
11+
script:
12+
# This enables task distribution via Nx Cloud
13+
# Run this command as early as possible, before dependencies are installed
14+
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
15+
# Uncomment this line to enable task distribution
16+
# - npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci"
17+
18+
- npm ci --legacy-peer-deps
19+
- npx playwright install --with-deps
20+
- NX_HEAD=$CI_COMMIT_SHA
21+
- NX_BASE=${CI_MERGE_REQUEST_DIFF_BASE_SHA:-$CI_COMMIT_BEFORE_SHA}
22+
23+
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
24+
# - npx nx-cloud record -- echo Hello World
25+
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
26+
# When you enable task distribution, run the e2e-ci task instead of e2e
27+
- npx nx affected -t lint test build e2e
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Add files here to ignore them from prettier formatting
2+
/dist
3+
/coverage
4+
/.nx/cache
5+
/.nx/workspace-data
6+
.angular
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"nrwl.angular-console",
4+
"esbenp.prettier-vscode",
5+
"firsttris.vscode-jest-runner",
6+
"ms-playwright.playwright"
7+
]
8+
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Plain
2+
3+
<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>
4+
5+
✨ Your new, shiny [Nx workspace](https://nx.dev) is almost ready ✨.
6+
7+
[Learn more about this workspace setup and its capabilities](https://nx.dev/getting-started/tutorials/angular-monorepo-tutorial?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) or run `npx nx graph` to visually explore what was created. Now, let's get you up to speed!
8+
9+
## Finish your CI setup
10+
11+
[Click here to finish setting up your workspace!](https://cloud.nx.app/connect/gmJU3vxCLA)
12+
13+
## Run tasks
14+
15+
To run the dev server for your app, use:
16+
17+
```sh
18+
npx nx serve app-1
19+
```
20+
21+
To create a production bundle:
22+
23+
```sh
24+
npx nx build app-1
25+
```
26+
27+
To see all available targets to run for a project, run:
28+
29+
```sh
30+
npx nx show project app-1
31+
```
32+
33+
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.
34+
35+
[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)
36+
37+
## Add new projects
38+
39+
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.
40+
41+
Use the plugin's generator to create new projects.
42+
43+
To generate a new application, use:
44+
45+
```sh
46+
npx nx g @nx/angular:app demo
47+
```
48+
49+
To generate a new library, use:
50+
51+
```sh
52+
npx nx g @nx/angular:lib mylib
53+
```
54+
55+
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.
56+
57+
[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)
58+
59+
[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)
60+
61+
## Install Nx Console
62+
63+
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.
64+
65+
[Install Nx Console &raquo;](https://nx.dev/getting-started/editor-setup?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
66+
67+
## Useful links
68+
69+
Learn more:
70+
71+
- [Learn more about this workspace setup](https://nx.dev/getting-started/tutorials/angular-monorepo-tutorial?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
72+
- [Learn about Nx on CI](https://nx.dev/ci/intro/ci-with-nx?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
73+
- [Releasing Packages with Nx release](https://nx.dev/features/manage-releases?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
74+
- [What are Nx plugins?](https://nx.dev/concepts/nx-plugins?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
75+
76+
And join the Nx community:
77+
78+
- [Discord](https://go.nx.dev/community)
79+
- [Follow us on X](https://twitter.com/nxdevtools) or [LinkedIn](https://www.linkedin.com/company/nrwl)
80+
- [Our Youtube channel](https://www.youtube.com/@nxdevtools)
81+
- [Our blog](https://nx.dev/blog?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"extends": ["plugin:playwright/recommended", "../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
},
17+
{
18+
"files": ["src/**/*.{ts,js,tsx,jsx}"],
19+
"rules": {}
20+
}
21+
]
22+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import { defineConfig, devices } from '@playwright/test';
2+
import { nxE2EPreset } from '@nx/playwright/preset';
3+
4+
import { workspaceRoot } from '@nx/devkit';
5+
6+
// For CI, you may want to set BASE_URL to the deployed application.
7+
const baseURL = process.env['BASE_URL'] || 'http://localhost:4200';
8+
9+
/**
10+
* Read environment variables from file.
11+
* https://github.com/motdotla/dotenv
12+
*/
13+
// require('dotenv').config();
14+
15+
/**
16+
* See https://playwright.dev/docs/test-configuration.
17+
*/
18+
export default defineConfig({
19+
...nxE2EPreset(__filename, { testDir: './src' }),
20+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
21+
use: {
22+
baseURL,
23+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
24+
trace: 'on-first-retry',
25+
},
26+
/* Run your local dev server before starting the tests */
27+
webServer: {
28+
command: 'npx nx run app-1:serve',
29+
url: 'http://localhost:4200',
30+
reuseExistingServer: !process.env.CI,
31+
cwd: workspaceRoot,
32+
},
33+
projects: [
34+
{
35+
name: 'chromium',
36+
use: { ...devices['Desktop Chrome'] },
37+
},
38+
39+
{
40+
name: 'firefox',
41+
use: { ...devices['Desktop Firefox'] },
42+
},
43+
44+
{
45+
name: 'webkit',
46+
use: { ...devices['Desktop Safari'] },
47+
},
48+
49+
// Uncomment for mobile browsers support
50+
/* {
51+
name: 'Mobile Chrome',
52+
use: { ...devices['Pixel 5'] },
53+
},
54+
{
55+
name: 'Mobile Safari',
56+
use: { ...devices['iPhone 12'] },
57+
}, */
58+
59+
// Uncomment for branded browsers
60+
/* {
61+
name: 'Microsoft Edge',
62+
use: { ...devices['Desktop Edge'], channel: 'msedge' },
63+
},
64+
{
65+
name: 'Google Chrome',
66+
use: { ...devices['Desktop Chrome'], channel: 'chrome' },
67+
} */
68+
],
69+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "app-1-e2e",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"projectType": "application",
5+
"sourceRoot": "apps/app-1-e2e/src",
6+
"implicitDependencies": ["app-1"],
7+
"// targets": "to see all targets run: nx show project app-1-e2e --web",
8+
"targets": {}
9+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test('has title', async ({ page }) => {
4+
await page.goto('/');
5+
6+
// Expect h1 to contain a substring.
7+
expect(await page.locator('h1').innerText()).toContain('Welcome');
8+
});
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"allowJs": true,
5+
"outDir": "../../dist/out-tsc",
6+
"module": "commonjs",
7+
"sourceMap": false,
8+
"forceConsistentCasingInFileNames": true,
9+
"strict": true,
10+
"noImplicitOverride": true,
11+
"noPropertyAccessFromIndexSignature": true,
12+
"noImplicitReturns": true,
13+
"noFallthroughCasesInSwitch": true
14+
},
15+
"include": [
16+
"**/*.ts",
17+
"**/*.js",
18+
"playwright.config.ts",
19+
"src/**/*.spec.ts",
20+
"src/**/*.spec.js",
21+
"src/**/*.test.ts",
22+
"src/**/*.test.js",
23+
"src/**/*.d.ts"
24+
]
25+
}

0 commit comments

Comments
 (0)