Skip to content

Commit b1ee1b3

Browse files
updated requirements and added gulp-data to pass json objects to numnucks teamplates
1 parent 5d566a5 commit b1ee1b3

File tree

8 files changed

+77
-63
lines changed

8 files changed

+77
-63
lines changed

Diff for: .gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
node_modules
2-
dest
2+
dist
33
package-lock.json

Diff for: README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
![](https://img.shields.io/github/release/digi-brains/StreamBuilder.svg?style=flat-square)
2-
![](https://img.shields.io/github/license/digi-brains/StreamBuilder.svg?style=flat-square)
3-
![](https://img.shields.io/github/issues/digi-brains/StreamBuilder.svg?style=flat-square)
1+
![](https://img.shields.io/github/release/sageworksstudio/StreamBuilder.svg?style=flat-square)
2+
![](https://img.shields.io/github/license/sageworksstudio/StreamBuilder.svg?style=flat-square)
3+
![](https://img.shields.io/github/issues/sageworksstudio/StreamBuilder.svg?style=flat-square)
44

55
# StreamBuilder
66

@@ -9,12 +9,12 @@ StreamBuilder is an automated build environment well suited for HTML, CSS and Ja
99

1010
## What it does
1111

12-
By working in the `/src` directory all of your changes are piped and rendered to the `/dest` folder.
12+
By working in the `/src` directory all of your changes are piped and rendered to the `/dist` folder.
1313

14-
- `/src/scss` -> `/dest/css`
15-
- `/src/js` -> `/dest/js`
16-
- `/src/pages` -> `/dest/`
17-
- `/src/img` -> `/dest/img`
14+
- `/src/scss` -> `/dist/css`
15+
- `/src/js` -> `/dist/js`
16+
- `/src/pages` -> `/dist/`
17+
- `/src/img` -> `/dist/img`
1818
- It even refreshes your browser on every change!
1919

20-
[Documentation](https://digi-brains.github.io/StreamBuilder/)
20+
[Documentation](https://sageworksstudio.github.io/StreamBuilder/)

Diff for: docs/index.html

+11-11
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ <h2>What it is</h2>
2525

2626
<h2>What it does</h2>
2727

28-
By working in the <code>/src</code> directory all of your changes are piped and rendered to the <code>/dest</code> folder.
28+
By working in the <code>/src</code> directory all of your changes are piped and rendered to the <code>/dist</code> folder.
2929

3030
<pre>
31-
/src/scss -> /dest/css
32-
/src/js -> /dest/js
33-
/src/pages -> /dest/
34-
/src/img -> /dest/img
31+
/src/scss -> /dist/css
32+
/src/js -> /dist/js
33+
/src/pages -> /dist/
34+
/src/img -> /dist/img
3535
</pre>
3636
<p>
3737
It even refreshes your browser on every change!
@@ -44,11 +44,11 @@ <h2>Requirements</h2>
4444
<h2>Getting Started</h2>
4545

4646
<ol>
47-
<li>Download this repo to your development environment.</li>
48-
<li>Install the node modules listed in the package.json file globally. I.e., <code>sudo npm install -g [node_module]</code>
47+
<li>Download or clone this repo to your development environment.</li>
4948
<li>From a terminal <code>cd path/to/streambuilder</code></li>
50-
<li>Run <code>npm install</code> This will create a new directory "node_modules" where NPM will install all the required node modules.</li>
51-
<li>Edit the paths variable in the <code>gulpfile.js</code> file to reflect your <code>src</code> and <code>dest</code> paths as well as your application URL.</li>
49+
<li>Install the node modules listed in the package.json file. <code>sudo npm install [node_module]</code></li>
50+
<li>Note: you might want to install gulp as a global application <code>sudo npm install -g gulp</code> for Gulp to be visible in your command line.</li>
51+
<li>Edit the paths variable in the <code>gulpfile.js</code> file to reflect your <code>src</code> and <code>dist</code> paths as well as your application URL.</li>
5252
<li>Run <code>gulp</code></li>
5353
</ol>
5454

@@ -61,7 +61,7 @@ <h2>Production mode</h2>
6161

6262
<h2>Advanced configuration</h2>
6363
<p>
64-
You can change anything and everything about StreamBuilder by editing the gulpfile.js. By default StreamBuilder compiles everything to the /dest folder. You can chage this behavior (as well as the URL of the project) by editing the <code>paths</code> vars in the top of gulpfile.js.
64+
You can change anything and everything about StreamBuilder by editing the gulpfile.js. By default StreamBuilder compiles everything to the /dist folder. You can chage this behavior (as well as the URL of the project) by editing the <code>paths</code> vars in the top of gulpfile.js.
6565
</p>
6666
<p>
6767
StreamBuilder comes bundled with SASS and Nunjucks support. You can change this by removing the gulp-scss modules and installing the css pre-processor and template language of your choice then editing the tasks in gulpfile.js. You can find additional modules at <a href="https://www.npmjs.com/">NPM</a>.
@@ -87,7 +87,7 @@ <h3>Goodies</h3>
8787
<h4>Getting Help</h4>
8888

8989
<p>
90-
If you find a bug or want to see a feature, file it in the <a href="https://github.com/digi-brains/StreamBuilder/issues">issues section</a>.
90+
If you find a bug or want to see a feature, file it in the <a href="https://github.com/sageworksstudio/StreamBuilder/issues">issues section</a>.
9191
</p>
9292
</body>
9393
</html>

Diff for: gulpfile.js

+22-17
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,27 @@
55
const paths = {
66
styles: {
77
watch : 'src/scss/**/*.scss',
8-
dest : 'dest/css/'
8+
dist : 'dist/css/'
99
},
1010
scripts: {
1111
watch : 'src/js/**/*.js',
12-
dest : 'dest/js/'
12+
dist : 'dist/js/'
1313
},
1414
pages: {
1515
watch : 'src/pages/**/**/*.njk', // files to watch (include all partials)
1616
compile : 'src/pages/templates', // template used to compile with
1717
render : 'src/pages/*njk', // pages to render (don't render partials)
18-
dest : 'dest/'
18+
dist : 'dist/'
1919
},
2020
images: {
2121
watch : 'src/img/**/*',
22-
dest : 'dest/img/'
22+
dist : 'dist/img/'
23+
},
24+
data: {
25+
src : 'src/data/data.json'
2326
},
2427
url: {
25-
dev : 'http://streambuilder/dest'
28+
dev : 'http://streambuilder/dist'
2629
}
2730
};
2831

@@ -45,6 +48,8 @@ const beeper = require('beeper');
4548
const browserSync = require('browser-sync').create ();
4649
const changed = require('gulp-changed');
4750
const colors = require('ansi-colors');
51+
const data = require('gulp-data');
52+
const fse = require('fs-extra');
4853
const gulp = require('gulp');
4954
const log = require('fancy-log');
5055
const njkRend = require('gulp-nunjucks-render');
@@ -75,7 +80,7 @@ function onError(err) {
7580
beeper(2);
7681
};
7782

78-
// Create a new proxy server to view dest.
83+
// Create a new proxy server to view dist.
7984
function server() {
8085
browserSync.init ({
8186
proxy : paths.url.dev,
@@ -102,7 +107,7 @@ function style(env) {
102107
flexbox: true
103108
}))
104109
.pipe(sourcemaps.write('./')) //maps are set relative to source
105-
.pipe(gulp.dest(paths.styles.dest))
110+
.pipe(gulp.dest(paths.styles.dist))
106111
.pipe(browserSync.stream());
107112
} else {
108113
return gulp.src(paths.styles.watch)
@@ -112,48 +117,48 @@ function style(env) {
112117
outputStyle: 'compressed'
113118
}))
114119
.pipe(sourcemaps.write('./')) //maps are set relative to source
115-
.pipe(gulp.dest(paths.styles.dest));
120+
.pipe(gulp.dest(paths.styles.dist));
116121
}
117122
}
118123

119-
// Save JavaScript to dest and reload browser.
124+
// Save JavaScript to dist and reload browser.
120125
// 'production' task will uglify final JavaScript output.
121126
function script(env) {
122127
if (env !== true) {
123128
return gulp.src(paths.scripts.watch)
124129
.pipe(plumber({
125130
errorHandler : onError
126131
}))
127-
.pipe(gulp.dest(paths.scripts.dest))
132+
.pipe(gulp.dest(paths.scripts.dist))
128133
.pipe(browserSync.stream());
129134
} else {
130135
return gulp.src(paths.scripts.watch)
131136
.pipe(uglify())
132-
.pipe(gulp.dest(paths.scripts.dest));
137+
.pipe(gulp.dest(paths.scripts.dist));
133138
}
134139
}
135140

136141
// Compile HTML on nunjuck change and reload proxy server.
137142
function page() {
138143
return gulp.src(paths.pages.render)
139-
// .pipe(data(function(file){
140-
// return JSON.parse(fse.readFileSync('./src/data/data.json'))
141-
// } ) )
144+
.pipe(data(function(file){
145+
return JSON.parse(fse.readFileSync('./src/data/data.json'))
146+
}))
142147
.pipe(njkRend({
143148
path:[paths.pages.compile]
144149
}))
145150
.pipe(plumber ({
146151
errorHandler : onError
147152
}))
148-
.pipe(gulp.dest(paths.pages.dest))
153+
.pipe(gulp.dest(paths.pages.dist))
149154
.pipe(browserSync.stream());
150155
}
151156

152157
// Images
153158
function image() {
154159
return gulp.src(paths.images.watch)
155-
.pipe(changed(paths.images.dest))
156-
.pipe(gulp.dest(paths.images.dest))
160+
.pipe(changed(paths.images.dist))
161+
.pipe(gulp.dest(paths.images.dist))
157162
.pipe(browserSync.stream());
158163
}
159164

Diff for: package.json

+25-23
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,42 @@
55
"keywords": [
66
"gulp",
77
"scss",
8-
"sass",
98
"node",
109
"nunjucks"
1110
],
1211
"repository": {
1312
"type": "git",
14-
"url": "https://github.com/digi-brains/StreamBuilder"
13+
"url": "https://github.com/sageworksstudio/StreamBuilder"
1514
},
1615
"author": {
1716
"name": "Chris Brown",
18-
"email": "chris@digitalbrains.io",
19-
"url": "https://digitalbrains.io"
17+
"email": "chris@sageworksstudio.com",
18+
"url": "https://sageworksstudio.com"
2019
},
21-
"homepage": "https://github.com/digi-brains/StreamBuilder",
20+
"homepage": "https://github.com/sageworksstudio/StreamBuilder",
2221
"bugs": {
23-
"url": "https://github.com/digi-brains/StreamBuilder/issues",
24-
"email": "chris@digitalbrains.io"
22+
"url": "https://github.com/sageworksstudio/StreamBuilder/issues",
23+
"email": "chris@sageworksstudio.com"
2524
},
2625
"license": "MIT",
2726
"devDependencies": {
28-
"beeper": "2.0.0",
29-
"browser-sync": "2.26.4",
30-
"ansi-colors": "3.2.4",
31-
"fancy-log": "1.3.3",
32-
"fs-extra": "7.0.1",
33-
"gulp": "4.0.1",
34-
"gulp-autoprefixer": "6.1.0",
35-
"gulp-changed": "3.2.0",
36-
"gulp-data": "1.3.1",
37-
"gulp-nunjucks-render": "2.2.3",
38-
"gulp-plumber": "1.2.1",
39-
"gulp-sass": "4.0.2",
40-
"gulp-sourcemaps": "2.6.5",
41-
"gulp-uglify": "3.0.2",
42-
"node-normalize-scss": "8.0.0"
43-
}
27+
"beeper" : "2.0.0",
28+
"browser-sync" : "2.26.7",
29+
"ansi-colors" : "4.1.1",
30+
"fancy-log" : "1.3.3",
31+
"fs-extra" : "8.1.0",
32+
"gulp" : "4.0.2",
33+
"gulp-autoprefixer" : "7.0.1",
34+
"gulp-changed" : "4.0.2",
35+
"gulp-data" : "1.3.1",
36+
"gulp-nunjucks-render" : "2.2.3",
37+
"gulp-plumber" : "1.2.1",
38+
"gulp-sass" : "4.0.2",
39+
"gulp-sourcemaps" : "2.6.5",
40+
"gulp-uglify" : "3.0.2",
41+
"node-normalize-scss" : "8.0.1"
42+
},
43+
"browserslist": [
44+
"defaults"
45+
]
4446
}

Diff for: src/data/data.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"title": {
3+
"title": "StreamBuilder",
4+
"tagline": "a highly customizable, automated build environment well suited for HTML, CSS and JavaScript prototyping"
5+
},
6+
7+
}

Diff for: src/pages/index.njk

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% block content %}
44

55
{% include "partials/header.njk" %}
6-
<main id="main" data-controller="Page" data-action="">
6+
<main id="main" data-controller="page" data-action="">
77

88
<h1>
99
H1 Heading

Diff for: src/pages/templates/layout.njk

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8">
55
<meta http-equiv="x-ua-compatible" content="ie=edge">
6-
<title>StreamBuilder</title>
6+
<title>{{ title.title }} - {{ title.tagline }}</title>
77
<meta name="viewport" content="width=device-width, initial-scale=1">
88
<link rel="stylesheet" href="css/app.css">
99
</head>

0 commit comments

Comments
 (0)