Skip to content

Commit 7b6eb4e

Browse files
authored
feat(angular): update angular starter application to v4 (#160)
1 parent 5e38804 commit 7b6eb4e

File tree

91 files changed

+15144
-2033
lines changed

Some content is hidden

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

91 files changed

+15144
-2033
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,12 @@ jobs:
5050
run: |
5151
cd ./apps/react-starter
5252
pnpm exec playwright install chromium --with-deps
53-
- name: Test
54-
run: pnpm test
53+
54+
- name: Test (React)
55+
run: pnpm --filter ix-react-starter test
56+
57+
- name: Test (Angular)
58+
run: pnpm --filter ix-angular-starter test
5559

5660
e2e:
5761
# Depend on build job to ensure the build is completed before running E2E tests
@@ -64,18 +68,36 @@ jobs:
6468
- uses: actions/checkout@v3
6569
- uses: ./.github/workflows/actions/install
6670

67-
- name: Install Playwright Browsers
71+
# React E2E
72+
- name: Install Playwright Browsers (React)
6873
run: |
6974
cd ./apps/react-starter
7075
pnpm playwright install chromium --with-deps
7176
72-
- name: E2E
73-
run: pnpm e2e
77+
- name: E2E (React)
78+
run: pnpm --filter ix-react-starter e2e
7479

75-
- name: E2E Report
80+
- name: E2E Report (React)
7681
if: ${{ !cancelled() }}
7782
uses: actions/upload-artifact@v4
7883
with:
7984
name: react-playwright-report
8085
path: apps/react-starter/playwright-report/
8186
retention-days: 1
87+
88+
# Angular E2E
89+
- name: Install Playwright Browsers (Angular)
90+
run: |
91+
cd ./apps/angular-starter
92+
pnpm playwright install chromium --with-deps
93+
94+
- name: E2E (Angular)
95+
run: pnpm --filter ix-angular-starter e2e
96+
97+
- name: E2E Report (Angular)
98+
if: ${{ !cancelled() }}
99+
uses: actions/upload-artifact@v4
100+
with:
101+
name: angular-playwright-report
102+
path: apps/angular-starter/playwright-report/
103+
retention-days: 1

.github/workflows/deploy-pages.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,27 @@ jobs:
2727
BRAND_URL: ${{ vars.BRAND_URL }}
2828

2929
- name: Build React Starter
30-
run: pnpm build
30+
run: pnpm build --filter ix-react-starter
3131
env:
3232
REACT_BASE: /ix-starter/react-starter/
3333
VITE_THEME: 1
3434

35-
- name: Deploy GitHub Pages 🚀
35+
- name: Enable Brand Theme in Angular Starter
36+
run: |
37+
cd ./apps/angular-starter
38+
sed -i "s/BRAND_THEME: false/BRAND_THEME: true/" src/environments/environment.ts
39+
40+
- name: Build Angular Starter
41+
run: pnpm --filter ix-angular-starter run build --base-href /ix-starter/angular-starter/
42+
43+
- name: Deploy React App 🚀
3644
uses: JamesIves/github-pages-deploy-action@v4
3745
with:
3846
folder: ./apps/react-starter/dist
3947
target-folder: react-starter
48+
49+
- name: Deploy Angular App 🚀
50+
uses: JamesIves/github-pages-deploy-action@v4
51+
with:
52+
folder: ./apps/angular-starter/dist/browser
53+
target-folder: angular-starter

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ To develop all apps and packages, run the following command:
5151
pnpm dev --filter ix-react-starter
5252
```
5353

54+
55+
#### Angular
56+
57+
```
58+
pnpm dev --filter ix-angular-starter
59+
5460
## Useful Links
5561
5662
Learn more about the power of Turborepo:

apps/angular-starter/.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Editor configuration, see https://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+
[*.ts]
12+
quote_type = single
13+
ij_typescript_use_double_quotes = false
14+
15+
[*.md]
16+
max_line_length = off
17+
trim_trailing_whitespace = false

apps/angular-starter/.gitignore

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
2+
3+
# Compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
/bazel-out
8+
9+
# Node
10+
/node_modules
11+
npm-debug.log
12+
yarn-error.log
13+
14+
# IDEs and editors
15+
.idea/
16+
.project
17+
.classpath
18+
.c9/
19+
*.launch
20+
.settings/
21+
*.sublime-workspace
22+
23+
# Visual Studio Code
24+
.vscode/*
25+
!.vscode/settings.json
26+
!.vscode/tasks.json
27+
!.vscode/launch.json
28+
!.vscode/extensions.json
29+
.history/*
30+
31+
# Miscellaneous
32+
/.angular/cache
33+
.sass-cache/
34+
/connect.lock
35+
/coverage
36+
/libpeerconnection.log
37+
testem.log
38+
/typings
39+
40+
# System files
41+
.DS_Store
42+
Thumbs.db
43+
44+
# Playwright
45+
node_modules/
46+
/test-results/
47+
/playwright-report/
48+
/blob-report/
49+
/playwright/.cache/
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
3+
"recommendations": ["angular.ng-template"]
4+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
3+
"version": "0.2.0",
4+
"configurations": [
5+
{
6+
"name": "ng serve",
7+
"type": "chrome",
8+
"request": "launch",
9+
"preLaunchTask": "npm: start",
10+
"url": "http://localhost:4200/"
11+
},
12+
{
13+
"name": "ng test",
14+
"type": "chrome",
15+
"request": "launch",
16+
"preLaunchTask": "npm: test",
17+
"url": "http://localhost:9876/debug.html"
18+
}
19+
]
20+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
// For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
3+
"version": "2.0.0",
4+
"tasks": [
5+
{
6+
"type": "npm",
7+
"script": "start",
8+
"isBackground": true,
9+
"problemMatcher": {
10+
"owner": "typescript",
11+
"pattern": "$tsc",
12+
"background": {
13+
"activeOnStart": true,
14+
"beginsPattern": {
15+
"regexp": "(.*?)"
16+
},
17+
"endsPattern": {
18+
"regexp": "bundle generation complete"
19+
}
20+
}
21+
}
22+
},
23+
{
24+
"type": "npm",
25+
"script": "test",
26+
"isBackground": true,
27+
"problemMatcher": {
28+
"owner": "typescript",
29+
"pattern": "$tsc",
30+
"background": {
31+
"activeOnStart": true,
32+
"beginsPattern": {
33+
"regexp": "(.*?)"
34+
},
35+
"endsPattern": {
36+
"regexp": "bundle generation complete"
37+
}
38+
}
39+
}
40+
}
41+
]
42+
}

apps/angular-starter/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# `@siemens/ix-angular` + Angular + Angular CLI
2+
3+
## A starter template for Angular applications using Siemens Industrial Experience (ix-Angular).
4+
5+
## Install dependencies
6+
7+
Execute pnpm install/npm install
8+
9+
## Development
10+
11+
Execute `pnpm start`
12+
13+
## Build
14+
15+
Execute `pnpm build`
16+
The build artifacts will be stored in the dist/ directory
17+
18+
## Testing
19+
20+
### Unit Tests (Jasmine + Karma)
21+
22+
Execute `pnpm test`
23+
24+
### E2E tests (playwright)
25+
26+
Execute `pnpm e2e`
27+
28+
### Generate Components/Services
29+
30+
pnpm ng generate component [name]
31+
32+
pnpm ng generate service [name]
33+
34+
pnpm ng generate pipe [name]

apps/angular-starter/angular.json

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"ixd-angular-starter": {
7+
"projectType": "application",
8+
"schematics": {
9+
"@schematics/angular:component": {
10+
"style": "scss"
11+
}
12+
},
13+
"root": "",
14+
"sourceRoot": "src",
15+
"prefix": "app",
16+
"architect": {
17+
"build": {
18+
"builder": "@angular-devkit/build-angular:application",
19+
"options": {
20+
"outputPath": "dist",
21+
"index": "src/index.html",
22+
"browser": "src/main.ts",
23+
"polyfills": ["zone.js"],
24+
"tsConfig": "tsconfig.app.json",
25+
"inlineStyleLanguage": "scss",
26+
"assets": [
27+
{
28+
"glob": "**/*",
29+
"input": "public"
30+
},
31+
"src/assets"
32+
],
33+
"styles": ["src/styles.scss"],
34+
"scripts": []
35+
},
36+
"configurations": {
37+
"production": {
38+
"budgets": [
39+
{
40+
"type": "initial",
41+
"maximumWarning": "5MB",
42+
"maximumError": "5MB"
43+
},
44+
{
45+
"type": "anyComponentStyle",
46+
"maximumWarning": "4kB",
47+
"maximumError": "8kB"
48+
}
49+
],
50+
"outputHashing": "all"
51+
},
52+
"development": {
53+
"optimization": false,
54+
"extractLicenses": false,
55+
"sourceMap": true
56+
}
57+
},
58+
"defaultConfiguration": "production"
59+
},
60+
"serve": {
61+
"builder": "@angular-devkit/build-angular:dev-server",
62+
"configurations": {
63+
"production": {
64+
"buildTarget": "ixd-angular-starter:build:production"
65+
},
66+
"development": {
67+
"buildTarget": "ixd-angular-starter:build:development"
68+
}
69+
},
70+
"defaultConfiguration": "development"
71+
},
72+
"extract-i18n": {
73+
"builder": "@angular-devkit/build-angular:extract-i18n"
74+
},
75+
"test": {
76+
"builder": "@angular-devkit/build-angular:karma",
77+
"options": {
78+
"polyfills": ["zone.js", "zone.js/testing"],
79+
"tsConfig": "tsconfig.spec.json",
80+
"karmaConfig": "karma.config.js",
81+
"inlineStyleLanguage": "scss",
82+
"assets": [
83+
{
84+
"glob": "**/*",
85+
"input": "public"
86+
}
87+
],
88+
"styles": ["src/styles.scss"],
89+
"scripts": []
90+
}
91+
},
92+
"lint": {
93+
"builder": "@angular-eslint/builder:lint",
94+
"options": {
95+
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
96+
}
97+
}
98+
}
99+
}
100+
},
101+
"cli": {
102+
"schematicCollections": [
103+
"angular-eslint"
104+
],
105+
"analytics": false
106+
}
107+
}

0 commit comments

Comments
 (0)