Skip to content

Commit 5007f31

Browse files
authored
Merge pull request #1 from Bernardo-MG/develop
Develop
2 parents 3362705 + 62470b1 commit 5007f31

Some content is hidden

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

55 files changed

+15057
-19535
lines changed

.eslintrc.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": [
4+
"projects/**/*"
5+
],
6+
"overrides": [
7+
{
8+
"files": [
9+
"*.ts"
10+
],
11+
"parserOptions": {
12+
"project": [
13+
"tsconfig.json"
14+
],
15+
"createDefaultProgram": true
16+
},
17+
"extends": [
18+
"plugin:@angular-eslint/recommended",
19+
"plugin:@angular-eslint/template/process-inline-templates"
20+
],
21+
"rules": {
22+
"@angular-eslint/directive-selector": [
23+
"error",
24+
{
25+
"type": "attribute",
26+
"prefix": ["app", "navigation", "login", "logout", "data"],
27+
"style": "camelCase"
28+
}
29+
],
30+
"@angular-eslint/component-selector": [
31+
"error",
32+
{
33+
"type": "element",
34+
"prefix": ["app", "navigation", "login", "logout", "data"],
35+
"style": "kebab-case"
36+
}
37+
]
38+
}
39+
},
40+
{
41+
"files": [
42+
"*.html"
43+
],
44+
"extends": [
45+
"plugin:@angular-eslint/template/recommended"
46+
],
47+
"rules": {}
48+
}
49+
]
50+
}

.github/workflows/testing.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Testing and validation
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
7+
linting:
8+
name: Linting
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
node: [ 16.x ]
13+
14+
steps:
15+
- name: Check-out
16+
uses: actions/checkout@v2
17+
- name: Set up Node.js ${{ matrix.node }}
18+
uses: actions/setup-node@v2
19+
with:
20+
node-version: ${{ matrix.node }}
21+
cache: 'npm'
22+
- name: Install dependencies
23+
run: npm ci
24+
- name: Install Angular CLI
25+
run: npm install -g @angular/cli
26+
- name: Run linter
27+
run: npm run lint
28+
29+
test:
30+
name: Tests
31+
needs: linting
32+
runs-on: ubuntu-latest
33+
strategy:
34+
matrix:
35+
node: [ 16.x ]
36+
37+
steps:
38+
- name: Check-out
39+
uses: actions/checkout@v2
40+
- name: Set up Node.js ${{ matrix.node }}
41+
uses: actions/setup-node@v2
42+
with:
43+
node-version: ${{ matrix.node }}
44+
cache: 'npm'
45+
- name: Install dependencies
46+
run: npm ci
47+
- name: Install Angular CLI
48+
run: npm install -g @angular/cli
49+
- name: Run tests
50+
run: npm test -- --configuration=ci
51+
52+
test_build:
53+
name: Test build
54+
needs: test
55+
runs-on: ubuntu-latest
56+
strategy:
57+
matrix:
58+
node: [ 16.x ]
59+
60+
steps:
61+
- name: Check-out
62+
uses: actions/checkout@v2
63+
- name: Set up Node.js ${{ matrix.node }}
64+
uses: actions/setup-node@v2
65+
with:
66+
node-version: ${{ matrix.node }}
67+
cache: 'npm'
68+
- name: Install dependencies
69+
run: npm ci
70+
- name: Install Angular CLI
71+
run: npm install -g @angular/cli
72+
- name: Build
73+
run: npm run build

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Angular HTTP Basic Authentication Example
22

3-
Example for setting up HTTP Basic authentication with Angular.
3+
Example for setting up HTTP Basic authentication with Angular. It is prepared to be used with [Spring WS Basic Security Example](https://github.com/bernardo-mg/spring-ws-basic-security-example);
44

55
## Features
66

angular.json

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,13 @@
3131
"src/assets"
3232
],
3333
"styles": [
34-
"src/styles.sass"
34+
"src/styles.sass",
35+
"./node_modules/bootstrap/dist/css/bootstrap.min.css"
3536
],
36-
"scripts": []
37+
"scripts": [
38+
"./node_modules/@popperjs/core/dist/umd/popper.min.js",
39+
"./node_modules/bootstrap/dist/js/bootstrap.min.js"
40+
]
3741
},
3842
"configurations": {
3943
"production": {
@@ -88,6 +92,13 @@
8892
},
8993
"test": {
9094
"builder": "@angular-devkit/build-angular:karma",
95+
"configurations": {
96+
"ci": {
97+
"watch": false,
98+
"progress": false,
99+
"browsers": "ChromeHeadlessCI"
100+
}
101+
},
91102
"options": {
92103
"main": "src/test.ts",
93104
"polyfills": "src/polyfills.ts",
@@ -103,9 +114,21 @@
103114
],
104115
"scripts": []
105116
}
117+
},
118+
"lint": {
119+
"builder": "@angular-eslint/builder:lint",
120+
"options": {
121+
"lintFilePatterns": [
122+
"src/**/*.ts",
123+
"src/**/*.html"
124+
]
125+
}
106126
}
107127
}
108128
}
109129
},
110-
"defaultProject": "angular-http-basic-auth-example"
130+
"defaultProject": "angular-http-basic-auth-example",
131+
"cli": {
132+
"defaultCollection": "@angular-eslint/schematics"
133+
}
111134
}

karma.conf.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ module.exports = function (config) {
3838
logLevel: config.LOG_INFO,
3939
autoWatch: true,
4040
browsers: ['Chrome'],
41+
customLaunchers: {
42+
ChromeHeadlessCI: {
43+
base: 'ChromeHeadless',
44+
flags: ['--no-sandbox']
45+
}
46+
},
4147
singleRun: false,
4248
restartOnFileChange: true
4349
});

0 commit comments

Comments
 (0)