Skip to content

Commit 64a478f

Browse files
committed
Merge branch 'node-ts-dev' into node-ts-master
2 parents 7475e62 + d9c502a commit 64a478f

File tree

16 files changed

+1438
-1580
lines changed

16 files changed

+1438
-1580
lines changed

README.md

Lines changed: 67 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -35,36 +35,19 @@ Feel free to give feedback and improvements to the repo.
3535
**[node-ts-master:](https://github.com/CKGrafico/Frontend-Boilerplates/tree/node-ts-master)** Stable version of a **Nodejs with TypeScript** example with SCSS and Nodejs.
3636
<br>**[node-ts-dev:](https://github.com/CKGrafico/Frontend-Boilerplates/tree/node-ts-dev)** Dev version of a **Nodejs with TypeScript** example with SCSS and Nodejs.
3737

38-
## 🍩 App Features
39-
On this branch _(Basic)_ we use:
38+
## 🍩 Boilerplate Features
39+
On this branch we use:
4040
- **BEM + BEMIT + etc:** A mix of BEM and related-BEM technologies to create conventions for CSS classes.
41-
- **TypeScript:** This project uses TypeScript instead of JavaScript.
42-
- **Linting:** Linting for JavaScript and SASS.
43-
- **Normalize:** Normalize our css, you can extend it easily.
41+
- **TypeScript:** All the code uses TypeScript.
42+
- **Linting:** Linting for TypeScript and SASS.
4443
- **SASS:** Scss structure with good practises.
4544

4645
**[⬆️ back to top](#quickstart)**
4746

4847
## ⚙️ Automated Tasks
49-
On this branch _(Basic)_ we use:
50-
- **Concurrently:** Execute two tasks in parallel.
51-
- **Gulp Autoprefixer:** Add browser prefixes for last two versions of the browsers.
52-
- **Gulp Clean CSS:** To minify CSS.
53-
- **Gulp Environment:** Call to different tasks depending of the environment.
54-
- **Gulp Fontmin:** Generate fonts from .ttf.
55-
- **Gulp Imagemin:** Compress images.
56-
- **Gulp Load plugins:** Load all the plugins once.
57-
- **Gulp Newer:** On some tasks we want to do something only with the newer files.
58-
- **Gulp Nodemon:** To launch the NodeJS application.
59-
- **Gulp Noop:** Basic Noop but on stream.
60-
- **Gulp Sass:** Compile Scss to CSS.
61-
- **Gulp Sasslint:** Linting for SASS.
62-
- **Gulp Sourcemaps:** Generate Sourcemaps when is necessary.
63-
- **Gulp TSLint:** Linting for TypeScript.
64-
- **Gulp Uglify:** Minify and obfuscate JavaScript.
65-
- **Opn:** Open browser to see the preview.
66-
- **Require all:** Load all gulp tasks once.
67-
- **Yarn:** Instead of NPM.
48+
On this branch we use:
49+
- **Webpack:** Scripts tasks.
50+
- **Gulp:** Styles and assets tasks.
6851

6952
**[⬆️ back to top](#quickstart)**
7053

@@ -84,83 +67,66 @@ To run the tasks we have these three commands:
8467
8568
**[⬆️ back to top](#quickstart)**
8669

87-
## 🔮 Environments
88-
On this project we have two environments:
89-
- **Local:** Use this on your computer
90-
- **Development:** Use this on your dev server
91-
- **Production:** Use this on your production server
92-
9370
## ⛩️ Project structure
94-
On this branch _(Basic)_ the structure is:`
71+
On this branch the structure is:`
9572
```
96-
./
97-
98-
├── app/
99-
│ ├── client/
100-
│ │ ├── assets/
101-
│ │ │ ├── fonts/
102-
│ │ │ │ └── OpenSans
103-
│ │ │ │ ├── OpenSans-Regular.ttf
104-
│ │ │ │ ├── ...
105-
│ │ │ │ └── OpenSans-SemiboldItalic.ttf
106-
│ │ │ │
107-
│ │ │ └── images/
108-
│ │ │ └── example.jpg
109-
│ │
110-
│ │ ├── js/
111-
│ │ │ └── app.js
112-
│ │ │
113-
│ │ └── scss/
114-
│ │ ├── base/
115-
│ │ │ ├── mixins # Some mixins to use on base folder
116-
│ │ │ ├── _fonts.scss # Load the fonts for your project
117-
│ │ │ ├── _globals.scss # Global styles
118-
│ │ │ ├── _states.scss # States classes, like is-hidden, is-visible...
119-
│ │ │ ├── _utilities.scss # Utility classes, like u-mt-10@xs _(margin-top 10px on media screen xs)_
120-
│ │ │ └── _variables.scss # Global variables of the project
121-
│ │ │
122-
│ │ ├── components/
123-
│ │ │ └── _ck-site.scss # Example of BEM based component
124-
│ │ │
125-
│ │ ├── vendor/
126-
│ │ │ └── _normalize.scss # Import and extend Normalize
127-
│ │ │
128-
│ │ └── index.html
129-
│ │
130-
│ ├── server/
131-
│ │ ├── compiler/
132-
│ │ │ ├── fonts/
133-
│ │ │ │ └── compiler.controller.ts
134-
│ │ │ │ └── compiler.service.ts
135-
│ │ └── server.ts
136-
137-
├── dist/ # Distribution folder
138-
139-
├── tasks/ # Gulp tasks
140-
│ ├── config/
141-
│ │ ├── helpers.js # Helpers that useful for tasks
142-
│ │ └── options.js # Internal operation to use with tasks
143-
│ ├── rules/
144-
│ │ ├── scripts.js # Create a bundle for JavaScript files
145-
│ │ └── scripts-lint.js # Check linting of JavaScript files
146-
│ ├── assets.js # Minify images and generate fonts
147-
│ ├── clean.js # Clean distribution folder
148-
│ ├── copy.js # Copy index.html to dist
149-
│ ├── scripts-lint.js # Linting for JavaScript
150-
│ ├── scss.js # Compile and compress SASS files when is necessary
151-
│ ├── scss-lint.js # Linting for SASS
152-
│ ├── serve.js # Open a browser with the preview of the project
153-
│ ├── ts.js # Transpile and compress TypeScript depending of the environment
154-
│ ├── ts-lint.js # Linting for TypeScript
155-
│ └── watch.js # Watcher for files
156-
157-
├── .gulpenvrc.yml # Environments configuration
158-
├── .sass-lint.yml # SASS linting configuration
159-
├── .scripts-lint.yml # JavaScript linting configuration
160-
├── gulpfile.js # Main gulp file
161-
├── package.json # Configure npm tasks and dependencies
162-
├── tasks.config.json # Configure paths and options for tasks
163-
└── webpack.config.js # The Webpack configuration for scripts
73+
├── .gitignore
74+
├── .stylelintrc
75+
├── .ts-lint.json
76+
├── LICENSE
77+
├── README.md
78+
├── app
79+
| ├── assets
80+
| ├── client
81+
| | ├── assets
82+
| | | ├── fonts
83+
| | | | └── OpenSans
84+
| | | └── images
85+
| | | └── example.jpg
86+
| | ├── index.html
87+
| | ├── scss
88+
| | | ├── app.scss
89+
| | | ├── base
90+
| | | | ├── _fonts.scss
91+
| | | | ├── _globals.scss
92+
| | | | ├── _icons.scss
93+
| | | | ├── _states.scss
94+
| | | | ├── _utilities.scss
95+
| | | | ├── _variables.scss
96+
| | | | └── mixins
97+
| | | ├── components
98+
| | | | └── _ck-site.scss
99+
| | | └── vendor
100+
| | | └── _normalize.scss
101+
| | └── ts
102+
| | └── app.ts
103+
| ├── server
104+
| | └── ts
105+
| | ├── compiler
106+
| | | ├── compiler.controller.ts
107+
| | | ├── compiler.service.ts
108+
| | | └── index.ts
109+
| | └── server.ts
110+
| └── styles
111+
| └── vendor
112+
| └── _normalize.scss
113+
├── gulpfile.helpers.js
114+
├── gulpfile.js
115+
├── gulpfile.paths.js
116+
├── package-lock.json
117+
├── package.json
118+
├── tasks
119+
| ├── assets.js
120+
| ├── clean.js
121+
| ├── copy.js
122+
| ├── scss-lint.js
123+
| ├── scss.js
124+
| ├── serve.js
125+
| ├── ts-lint.js
126+
| ├── ts-server.js
127+
| ├── ts.js
128+
| └── watch.js
129+
└── tsconfig.json
164130
```
165131

166132
**[⬆️ back to top](#quickstart)**
@@ -184,33 +150,6 @@ gulp.task('default', gulp.series(tasks.clean, tasks.stylesLint, tasks.styles, ta
184150
gulp.task('watcher', gulp.parallel(tasks.serve, tasks.watch));
185151
```
186152

187-
### Gulpfile helpers
188-
In case that you want to modify some gulp tasks, this helpers can help you.
189-
190-
- Files and folders:
191-
192-
```
193-
_.folder(paths.app.scripts);
194-
```
195-
Returns the path where the scripts are located, example: _'./app/js/'_
196-
197-
```
198-
_.files(paths.app.scripts)
199-
```
200-
Returns the file pattern to get the scripts, example: _'./app/js/**/*.js'_
201-
202-
```
203-
_.files(paths.app.scripts, _.NOT)
204-
```
205-
Exclude scripts, example: _'!./app/js/**/*.js'_
206-
207-
```
208-
_.abs(_.folder(paths.app.scripts), __dirname)
209-
```
210-
Change path to absolute path: _'C:/project/app/js'_
211-
212-
**[⬆️ back to top](#quickstart)**
213-
214153
### Tasks configuration
215154
You can configure different things related with the tasks.
216155
```
@@ -288,8 +227,8 @@ _.files(paths.assets.fonts.roboto)
288227
## 🎩 Contributors
289228

290229

291-
| <img src="https://i.imgur.com/CcJ7vXL.jpg" width="150"><br>**Quique Fdez Guerra**<br>[👨‍💻](https://github.com/CKGrafico)[🌍](http://ckgrafico.com)[🐦](https://twitter.com/CKGrafico) | <img src="https://i.imgur.com/W8Ks7Ss.jpg" width="150"><br>**Juan Carlos**<br>[👨‍💻](https://github.com/jcarloslr10)[🌍](http://plainconcepts.com)[🐦](https://twitter.com/jcarloslr10) | <img src="https://i.imgur.com/kLqGDso.jpg" width="150"><br>**Alex Kryzhanovskyy**<br>[👨‍💻](https://github.com/AlexKryzh)[🌍](http://kryzh.com)[🐦](https://twitter.com/AlexKryzh) |
292-
| :---: | :---: | :---: |
230+
| <img src="https://i.imgur.com/CcJ7vXL.jpg" width="150"><br>**Quique Fdez Guerra**<br>[👨‍💻](https://github.com/CKGrafico)[🌍](http://ckgrafico.com)[🐦](https://twitter.com/CKGrafico) | <img src="https://i.imgur.com/W8Ks7Ss.jpg" width="150"><br>**Juan Carlos**<br>[👨‍💻](https://github.com/jcarloslr10)[🌍](http://plainconcepts.com)[🐦](https://twitter.com/jcarloslr10) | <img src="https://i.imgur.com/kLqGDso.jpg" width="150"><br>**Alex Kryzhanovskyy**<br>[👨‍💻](https://github.com/AlexKryzh)[🌍](http://kryzh.com)[🐦](https://twitter.com/AlexKryzh) | <img src="https://i.imgur.com/ScMiaNz.png" width="150"><br>**Victor Gamez**<br>[👨‍💻](https://github.com/VGamezz19) |
231+
| :---: | :---: | :---: | :---: |
293232

294233
[View Contributors](https://github.com/CKGrafico/Frontend-Boilerplates/graphs/contributors)
295234

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

app/client/scss/base/_fonts.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@
33

44
// Fonts
55
@include font-include(OpenSans, Bold, $font-weight-bold, normal);
6-
@include font-include(OpenSans, BoldItalic, $font-weight-bold, italic);
76
@include font-include(OpenSans, ExtraBold, $font-weight-black, normal);
8-
@include font-include(OpenSans, ExtraBoldItalic, $font-weight-black, italic);
97
@include font-include(OpenSans, Regular, $font-weight-normal, normal);
10-
@include font-include(OpenSans, Italic, $font-weight-normal, italic);
118
@include font-include(OpenSans, Light, $font-weight-light, normal);
12-
@include font-include(OpenSans, LightItalic, $font-weight-light, italic);
139
@include font-include(OpenSans, SemiBold, $font-weight-semibold, normal);
14-
@include font-include(OpenSans, SemiBoldItalic, $font-weight-semibold, italic);

app/client/scss/base/_globals.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ body {
55
$font-size: 16px;
66

77
background: $color-background-bright;
8+
font-family: OpenSans;
89
font-size: $font-size;
910
height: 100%;
1011
width: 100%;

app/client/scss/base/_utilities.scss

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
@import 'variables';
2-
@import 'mixins/offsets';
3-
4-
@include generate-offsets(margin, m, 100);
5-
@include generate-offsets(padding, p, 100);
62

73
.u {
84
&-align {
@@ -18,28 +14,4 @@
1814
text-align: right;
1915
}
2016
}
21-
22-
&-center {
23-
&-vertical {
24-
display: block;
25-
position: absolute;
26-
top: 50%;
27-
transform: translateY(-50%);
28-
}
29-
30-
&-horizontal {
31-
display: block;
32-
left: 50%;
33-
position: absolute;
34-
transform: translateX(-50%);
35-
}
36-
37-
&-both {
38-
display: block;
39-
left: 50%;
40-
position: absolute;
41-
top: 50%;
42-
transform: translate(-50%, -50%);
43-
}
44-
}
4517
}

app/client/scss/base/mixins/_offsets.scss

Lines changed: 0 additions & 40 deletions
This file was deleted.

app/server/ts/server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as express from 'express';
2-
import {json} from 'body-parser';
3-
import {Express, Request, Response} from 'express';
4-
import {CompilerController} from './compiler';
2+
import { json } from 'body-parser';
3+
import { Express, Request, Response } from 'express';
4+
import { CompilerController } from './compiler';
55

66
const PORT = 8080;
77

0 commit comments

Comments
 (0)