Skip to content

Commit c19e6eb

Browse files
authored
Merge pull request #2 from sourcefuse/GH-1
feat(angular-boiler-plate): added the basic angular boiler plate
2 parents 8af507b + b55f6eb commit c19e6eb

File tree

307 files changed

+41320
-2
lines changed

Some content is hidden

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

307 files changed

+41320
-2
lines changed

.czferc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const scopes = [
2828
{name: 'ci-cd'},
2929
{name: 'core'},
3030
{name: 'styles'},
31-
{name: 'auth'},
31+
{name: 'angular-boiler-plate'},
3232
{name: 'theme'},
3333
{name: 'shared'},
3434
];

apps/boiler-plate/.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# compiled output
2+
/dist
3+
/tmp
4+
/out-tsc
5+
6+
# dependencies
7+
/node_modules

apps/boiler-plate/.env.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
PRODUCTION=
2+
CLIENT_ID=
3+
CLIENT_SECRET=
4+
BASE_API_URL=
5+
CSP_API_URL=
6+
AUTH_SERVICE_URL=
7+
USER_SERVICE_URL=

apps/boiler-plate/.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": "boiler",
27+
"style": "camelCase"
28+
}
29+
],
30+
"@angular-eslint/component-selector": [
31+
"error",
32+
{
33+
"type": "element",
34+
"prefix": "boiler",
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+
}

apps/boiler-plate/.gitignore

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
# Only exists if Bazel was run
8+
/bazel-out
9+
10+
# dependencies
11+
/node_modules
12+
13+
# profiling files
14+
chrome-profiler-events*.json
15+
speed-measure-plugin*.json
16+
17+
# IDEs and editors
18+
/.idea
19+
.project
20+
.classpath
21+
.c9/
22+
*.launch
23+
.settings/
24+
*.sublime-workspace
25+
26+
# IDE - VSCode
27+
.vscode/*
28+
!.vscode/settings.json
29+
!.vscode/tasks.json
30+
!.vscode/launch.json
31+
!.vscode/extensions.json
32+
.history/*
33+
34+
# misc
35+
/.sass-cache
36+
/connect.lock
37+
/coverage
38+
/libpeerconnection.log
39+
npm-debug.log
40+
yarn-error.log
41+
testem.log
42+
/typings
43+
44+
# System Files
45+
.DS_Store
46+
Thumbs.db
47+
48+
.env
49+
50+
*.log
51+
.run
52+
53+
/instrumented
54+
55+
/.nyc_output
56+
/.angular
57+
**/environment.json

apps/boiler-plate/.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist
2+
*.json
3+
coverage

apps/boiler-plate/.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"bracketSpacing": false,
3+
"singleQuote": true,
4+
"printWidth": 80,
5+
"trailingComma": "all",
6+
"arrowParens": "avoid"
7+
}

apps/boiler-plate/Dockerfile

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Using Node 10 Alpine image as the builder
2+
FROM node:14-alpine as builder
3+
ARG BASE_HREF
4+
ARG ENV_CONFIG
5+
ARG DIST_FOLDER=dist
6+
7+
# Setting Env Var Production as true
8+
ENV PRODUCTION true
9+
#COPY vendor ./vendor
10+
11+
# Creating a new dir for the app
12+
RUN mkdir /ng-app
13+
14+
# Copying package.json (done to implement docker caching and speed up build)
15+
COPY package.json package-lock.json ./ng-app/
16+
17+
# Setting current working dir
18+
WORKDIR /ng-app
19+
20+
# Setting npm config and cleaning cache
21+
# RUN npm set progress=false && npm config set depth 0 && npm cache clean --force
22+
23+
# Installing node dependencies
24+
RUN npm install
25+
26+
# Copying all files into the working dir
27+
COPY . .
28+
29+
# Creating a build version of the app for deployment
30+
RUN if [ "$DIST_FOLDER" = "instrumented" ] ; then \
31+
npm run build:dev -- --configuration instrument --base-href ${BASE_HREF} && \
32+
npm run instrument ; \
33+
else \
34+
npm run build -- --configuration ${ENV_CONFIG} --base-href ${BASE_HREF} ; \
35+
fi
36+
37+
# compress dist folder
38+
RUN if [ "$DIST_FOLDER" = "instrumented" ] ; then \
39+
npm run compress:instrument ; \
40+
else \
41+
npm run compress ; \
42+
fi
43+
44+
# Using NGINX as the web server image
45+
FROM sourcefuse/nginx:release-1.0.5
46+
47+
ARG DIST_FOLDER=dist
48+
49+
# Replacing the defaut config of NGINX
50+
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
51+
52+
# Removing unwanted files from the base NGINX folder
53+
RUN rm -rf /usr/share/nginx/html/*
54+
55+
# Copying build files from the builder to the app's root dir
56+
COPY --from=builder /ng-app/${DIST_FOLDER}/rakuten-pms-ui /usr/share/nginx/html
57+
58+
# Copying the startup script
59+
COPY docker/startup.sh /startup.sh
60+
61+
# Enabling executable rights on the script
62+
RUN chmod +x startup.sh
63+
64+
# Running the startup script
65+
CMD ["/bin/sh","-c","./startup.sh"]

apps/boiler-plate/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# AngularBoilerPlate
2+
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.0.4.
4+
5+
## Development server
6+
7+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
8+
9+
## Code scaffolding
10+
11+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12+
13+
## Build
14+
15+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
16+
17+
## Running unit tests
18+
19+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20+
21+
## Running end-to-end tests
22+
23+
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
24+
25+
## Further help
26+
27+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.

apps/boiler-plate/angular.json

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"angular-boiler-plate": {
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:browser",
19+
"options": {
20+
"outputPath": "dist/angular-boiler-plate",
21+
"index": "src/index.html",
22+
"main": "src/main.ts",
23+
"polyfills": "src/polyfills.ts",
24+
"tsConfig": "tsconfig.app.json",
25+
"inlineStyleLanguage": "scss",
26+
"assets": [
27+
"src/favicon.ico",
28+
"src/assets"
29+
],
30+
"styles": [
31+
"src/styles.scss"
32+
],
33+
"scripts": []
34+
},
35+
"configurations": {
36+
"production": {
37+
"budgets": [
38+
{
39+
"type": "initial",
40+
"maximumWarning": "3mb",
41+
"maximumError": "6mb"
42+
},
43+
{
44+
"type": "anyComponentStyle",
45+
"maximumWarning": "2kb",
46+
"maximumError": "5kb"
47+
}
48+
],
49+
"outputHashing": "all"
50+
},
51+
"development": {
52+
"buildOptimizer": false,
53+
"optimization": false,
54+
"vendorChunk": true,
55+
"extractLicenses": false,
56+
"sourceMap": true,
57+
"namedChunks": true
58+
}
59+
},
60+
"defaultConfiguration": "production"
61+
},
62+
"serve": {
63+
"builder": "@angular-devkit/build-angular:dev-server",
64+
"configurations": {
65+
"production": {
66+
"browserTarget": "angular-boiler-plate:build:production"
67+
},
68+
"development": {
69+
"browserTarget": "angular-boiler-plate:build:development"
70+
}
71+
},
72+
"defaultConfiguration": "development"
73+
},
74+
"extract-i18n": {
75+
"builder": "@angular-devkit/build-angular:extract-i18n",
76+
"options": {
77+
"browserTarget": "angular-boiler-plate:build"
78+
}
79+
},
80+
"test": {
81+
"builder": "@angular-devkit/build-angular:karma",
82+
"options": {
83+
"polyfills": "src/polyfills.ts",
84+
"main": "src/test.ts",
85+
"tsConfig": "tsconfig.spec.json",
86+
"karmaConfig": "karma.conf.js",
87+
"inlineStyleLanguage": "scss",
88+
"assets": [
89+
"src/favicon.ico",
90+
"src/assets"
91+
],
92+
"styles": [
93+
"src/styles.scss"
94+
],
95+
"scripts": []
96+
}
97+
},
98+
"lint": {
99+
"builder": "@angular-eslint/builder:lint",
100+
"options": {
101+
"lintFilePatterns": [
102+
"src/**/*.ts",
103+
"src/**/*.html"
104+
]
105+
}
106+
}
107+
}
108+
}
109+
},
110+
"cli": {
111+
"schematicCollections": [
112+
"@angular-eslint/schematics"
113+
]
114+
}
115+
}

0 commit comments

Comments
 (0)