Skip to content

Commit aea466c

Browse files
Merge pull request #2 from KonsumGandalf/sim-1
Feat: Initialization of Angular Nx Workspace Frontend with Basic Routing and Leaflet Integration
2 parents c343649 + 0f54281 commit aea466c

File tree

92 files changed

+26444
-25524
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+26444
-25524
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
name: CI
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
88

99
permissions:
10-
actions: read
11-
contents: read
10+
actions: read
11+
contents: read
1212

1313
jobs:
14-
main:
15-
runs-on: ubuntu-latest
16-
steps:
17-
- uses: actions/checkout@v4
18-
with:
19-
fetch-depth: 0
14+
main:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
2020

21-
# This enables task distribution via Nx Cloud
22-
# Run this command as early as possible, before dependencies are installed
23-
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
24-
# Uncomment this line to enable task distribution
25-
# - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci"
21+
# This enables task distribution via Nx Cloud
22+
# Run this command as early as possible, before dependencies are installed
23+
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
24+
# Uncomment this line to enable task distribution
25+
# - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci"
2626

27-
# Cache node_modules
28-
- uses: actions/setup-node@v4
29-
with:
30-
node-version: 20
31-
cache: 'npm'
27+
# Cache node_modules
28+
- uses: actions/setup-node@v4
29+
with:
30+
node-version: 20
31+
cache: 'npm'
3232

33-
- run: npm ci --legacy-peer-deps
34-
- run: npx playwright install --with-deps
35-
- uses: nrwl/nx-set-shas@v4
33+
- run: npm ci --legacy-peer-deps
34+
- run: npx playwright install --with-deps
35+
- uses: nrwl/nx-set-shas@v4
3636

37-
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
38-
# - run: npx nx-cloud record -- echo Hello World
39-
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
40-
# When you enable task distribution, run the e2e-ci task instead of e2e
41-
- run: npx nx affected -t lint test build e2e
37+
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
38+
# - run: npx nx-cloud record -- echo Hello World
39+
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
40+
# When you enable task distribution, run the e2e-ci task instead of e2e
41+
- run: npx nx affected -t lint test build e2e

.prettierrc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
{
2-
"singleQuote": true
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"tabWidth": 4,
5+
"useTabs": true,
6+
"semi": true,
7+
"printWidth": 100,
8+
"arrowParens": "always"
39
}

.vscode/extensions.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"recommendations": [
3-
"nrwl.angular-console",
4-
"esbenp.prettier-vscode",
5-
"firsttris.vscode-jest-runner",
6-
"ms-playwright.playwright"
7-
]
2+
"recommendations": [
3+
"nrwl.angular-console",
4+
"esbenp.prettier-vscode",
5+
"firsttris.vscode-jest-runner",
6+
"ms-playwright.playwright"
7+
]
88
}

README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44

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

7-
[Learn more about this workspace setup and its capabilities](https://nx.dev/getting-started/tutorials/angular-standalone-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!
7+
[Learn more about this workspace setup and its capabilities](https://nx.dev/getting-started/tutorials/angular-standalone-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!
88

99
## Finish your CI setup
1010

1111
[Click here to finish setting up your workspace!](https://cloud.nx.app/connect/RGx3BjjnUA)
1212

13-
1413
## Run tasks
1514

1615
To run the dev server for your app, use:
@@ -57,7 +56,6 @@ You can use `npx nx list` to get a list of installed plugins. Then, run `npx nx
5756

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

60-
6159
[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)
6260

6361
## Install Nx Console
@@ -70,13 +68,14 @@ Nx Console is an editor extension that enriches your developer experience. It le
7068

7169
Learn more:
7270

73-
- [Learn more about this workspace setup](https://nx.dev/getting-started/tutorials/angular-standalone-tutorial?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
74-
- [Learn about Nx on CI](https://nx.dev/ci/intro/ci-with-nx?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
75-
- [Releasing Packages with Nx release](https://nx.dev/features/manage-releases?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
76-
- [What are Nx plugins?](https://nx.dev/concepts/nx-plugins?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
71+
- [Learn more about this workspace setup](https://nx.dev/getting-started/tutorials/angular-standalone-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)
7775

7876
And join the Nx community:
79-
- [Discord](https://go.nx.dev/community)
80-
- [Follow us on X](https://twitter.com/nxdevtools) or [LinkedIn](https://www.linkedin.com/company/nrwl)
81-
- [Our Youtube channel](https://www.youtube.com/@nxdevtools)
82-
- [Our blog](https://nx.dev/blog?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
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)

e2e/eslint.config.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ const baseConfig = require('../eslint.base.config.js');
22
const playwright = require('eslint-plugin-playwright');
33

44
module.exports = [
5-
...baseConfig,
5+
...baseConfig,
66

7-
playwright.configs['flat/recommended'],
8-
{
9-
files: ['**/*.ts', '**/*.js'],
10-
// Override or add rules here
11-
rules: {},
12-
},
7+
playwright.configs['flat/recommended'],
8+
{
9+
files: ['**/*.ts', '**/*.js'],
10+
// Override or add rules here
11+
rules: {},
12+
},
1313
];

e2e/playwright.config.ts

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { defineConfig, devices } from '@playwright/test';
2-
import { nxE2EPreset } from '@nx/playwright/preset';
3-
41
import { workspaceRoot } from '@nx/devkit';
2+
import { nxE2EPreset } from '@nx/playwright/preset';
3+
import { defineConfig, devices } from '@playwright/test';
54

65
// For CI, you may want to set BASE_URL to the deployed application.
76
const baseURL = process.env['BASE_URL'] || 'http://localhost:4200';
@@ -16,38 +15,38 @@ const baseURL = process.env['BASE_URL'] || 'http://localhost:4200';
1615
* See https://playwright.dev/docs/test-configuration.
1716
*/
1817
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 simra: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-
},
18+
...nxE2EPreset(__filename, { testDir: './src' }),
19+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
20+
use: {
21+
baseURL,
22+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
23+
trace: 'on-first-retry',
24+
},
25+
/* Run your local dev server before starting the tests */
26+
webServer: {
27+
command: 'npx nx run simra:serve',
28+
url: 'http://localhost:4200',
29+
reuseExistingServer: !process.env.CI,
30+
cwd: workspaceRoot,
31+
},
32+
projects: [
33+
{
34+
name: 'chromium',
35+
use: { ...devices['Desktop Chrome'] },
36+
},
3837

39-
{
40-
name: 'firefox',
41-
use: { ...devices['Desktop Firefox'] },
42-
},
38+
{
39+
name: 'firefox',
40+
use: { ...devices['Desktop Firefox'] },
41+
},
4342

44-
{
45-
name: 'webkit',
46-
use: { ...devices['Desktop Safari'] },
47-
},
43+
{
44+
name: 'webkit',
45+
use: { ...devices['Desktop Safari'] },
46+
},
4847

49-
// Uncomment for mobile browsers support
50-
/* {
48+
// Uncomment for mobile browsers support
49+
/* {
5150
name: 'Mobile Chrome',
5251
use: { ...devices['Pixel 5'] },
5352
},
@@ -56,14 +55,14 @@ export default defineConfig({
5655
use: { ...devices['iPhone 12'] },
5756
}, */
5857

59-
// Uncomment for branded browsers
60-
/* {
58+
// Uncomment for branded browsers
59+
/* {
6160
name: 'Microsoft Edge',
6261
use: { ...devices['Desktop Edge'], channel: 'msedge' },
6362
},
6463
{
6564
name: 'Google Chrome',
6665
use: { ...devices['Desktop Chrome'], channel: 'chrome' },
6766
} */
68-
],
67+
],
6968
});

e2e/project.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "e2e",
3-
"$schema": "../node_modules/nx/schemas/project-schema.json",
4-
"projectType": "application",
5-
"sourceRoot": "e2e/src",
6-
"implicitDependencies": ["simra"],
7-
"// targets": "to see all targets run: nx show project e2e --web",
8-
"targets": {}
2+
"name": "e2e",
3+
"$schema": "../node_modules/nx/schemas/project-schema.json",
4+
"projectType": "application",
5+
"sourceRoot": "e2e/src",
6+
"implicitDependencies": ["simra"],
7+
"// targets": "to see all targets run: nx show project e2e --web",
8+
"targets": {}
99
}

e2e/src/example.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { test, expect } from '@playwright/test';
22

33
test('has title', async ({ page }) => {
4-
await page.goto('/');
4+
await page.goto('/');
55

6-
// Expect h1 to contain a substring.
7-
expect(await page.locator('h1').innerText()).toContain('Welcome');
6+
// Expect h1 to contain a substring.
7+
expect(await page.locator('a').innerText()).toContain('');
88
});

e2e/tsconfig.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
2-
"extends": "../tsconfig.base.json",
3-
"compilerOptions": {
4-
"allowJs": true,
5-
"outDir": "../dist/out-tsc",
6-
"sourceMap": false,
7-
"module": "commonjs",
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-
]
2+
"extends": "../tsconfig.base.json",
3+
"compilerOptions": {
4+
"allowJs": true,
5+
"outDir": "../dist/out-tsc",
6+
"sourceMap": false,
7+
"module": "commonjs",
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+
]
2525
}

0 commit comments

Comments
 (0)