Skip to content

Commit a3ec744

Browse files
committed
add project configuration file styleguide
1 parent 24e477d commit a3ec744

File tree

3 files changed

+163
-0
lines changed

3 files changed

+163
-0
lines changed

angular/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,55 @@
11
Briisk Angular >= 2.x Style Guide
2+
3+
4+
## Project configuration files
5+
Environment configuration files should be placed into: `src/environments/` directory (following Angular CLI pattern).
6+
7+
Environment configuration directory should contains 4 files:
8+
9+
```
10+
├── environment.ts - localhost config
11+
├── environment.dev.ts - development server config
12+
├── environment.stag.ts - stagging server config
13+
├── environment.prod.ts - production server config
14+
```
15+
16+
Which will be used for providing suitable data for every environment.
17+
18+
Example of configuration file:
19+
```
20+
export const environment = {
21+
production: false,
22+
apiUrl: 'http://example.com/api/',
23+
};
24+
```
25+
26+
#### Repository
27+
Configuration files used for build process should not be stored in remote repository (should be added to `.gitignore`
28+
file) owing to the possibility of including sensitive data.
29+
30+
All configuration files should be replaced with matching `*.ts.example` file.
31+
32+
Files stored in remote reposition:
33+
34+
```
35+
├── environment.ts.example
36+
├── environment.dev.ts.example
37+
├── environment.stag.ts.example
38+
├── environment.prod.ts.example
39+
```
40+
41+
Example of `environment.dev.ts.example`:
42+
```
43+
export const environment = {
44+
production: false,
45+
apiUrl: 'http://example.com/api/',
46+
gcmKey: 'ADD_GCM_KEY_HERE'
47+
};
48+
```
49+
50+
Generating files under `src/environments/` should be done automatically using:
51+
52+
```
53+
npm run init
54+
```
55+
bash command triggered after `npm run init` should be implemented additionally by developer

angularJS/README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,54 @@
11
Briisk AngularJS 1.x Style Guide
2+
3+
## Project configuration files
4+
Environment configuration files should be placed into: `src/environmenjs/` directory (following Angular CLI pattern).
5+
6+
Environment configuration directory should contains 4 files:
7+
8+
```
9+
├── environment.js - localhost config
10+
├── environment.dev.js - development server config
11+
├── environment.stag.js - stagging server config
12+
├── environment.prod.js - production server config
13+
```
14+
15+
Which will be used for providing suitable data for every environment.
16+
17+
Example of configuration file:
18+
```
19+
export const environment = {
20+
production: false,
21+
apiUrl: 'http://example.com/api/',
22+
};
23+
```
24+
25+
#### Repository
26+
Configuration files used for build process should not be stored in remote repository (should be added to `.gitignore`
27+
file) owing to the possibility of including sensitive data.
28+
29+
All configuration files should be replaced with matching `*.js.example` file.
30+
31+
Files stored in remote reposition:
32+
33+
```
34+
├── environment.js.example
35+
├── environment.dev.js.example
36+
├── environment.stag.js.example
37+
├── environment.prod.js.example
38+
```
39+
40+
Example of `environment.dev.js.example`:
41+
```
42+
export const environment = {
43+
production: false,
44+
apiUrl: 'http://example.com/api/',
45+
gcmKey: 'ADD_GCM_KEY_HERE'
46+
};
47+
```
48+
49+
Generating files under `src/environmenjs/` should be done automatically using:
50+
51+
```
52+
npm run init
53+
```
54+
bash command triggered after `npm run init` should be implemented additionally by developer

react/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
1. [Methods](#methods)
2020
1. [Ordering](#ordering)
2121
1. [`isMounted`](#ismounted)
22+
1. [Project configuration files](#project-configuration-files)
23+
2224

2325
## Basic Rules
2426

@@ -617,6 +619,60 @@
617619

618620
[anti-pattern]: https://facebook.github.io/react/blog/2015/12/16/ismounted-antipattern.html
619621

622+
623+
## Project configuration files
624+
Environment configuration files should be placed into: `src/environmenjs/` directory (following Angular CLI pattern).
625+
626+
Environment configuration directory should contains 4 files:
627+
628+
```
629+
├── environment.js - localhost config
630+
├── environment.dev.js - development server config
631+
├── environment.stag.js - stagging server config
632+
├── environment.prod.js - production server config
633+
```
634+
635+
Which will be used for providing suitable data for every environment.
636+
637+
Example of configuration file:
638+
```
639+
export const environment = {
640+
production: false,
641+
apiUrl: 'http://example.com/api/',
642+
};
643+
```
644+
645+
#### Repository
646+
Configuration files used for build process should not be stored in remote repository (should be added to `.gitignore`
647+
file) owing to the possibility of including sensitive data.
648+
649+
All configuration files should be replaced with matching `*.js.example` file.
650+
651+
Files stored in remote reposition:
652+
653+
```
654+
├── environment.js.example
655+
├── environment.dev.js.example
656+
├── environment.stag.js.example
657+
├── environment.prod.js.example
658+
```
659+
660+
Example of `environment.dev.js.example`:
661+
```
662+
export const environment = {
663+
production: false,
664+
apiUrl: 'http://example.com/api/',
665+
gcmKey: 'ADD_GCM_KEY_HERE'
666+
};
667+
```
668+
669+
Generating files under `src/environmenjs/` should be done automatically using:
670+
671+
```
672+
npm run init
673+
```
674+
bash command triggered after `npm run init` should be implemented additionally by developer
675+
620676
## Translation
621677

622678
This JSX/React style guide is also available in other languages:

0 commit comments

Comments
 (0)