Skip to content

Commit 2441fe3

Browse files
author
Iļja Ketris
committed
dependencies updated
1 parent d8e930d commit 2441fe3

File tree

4 files changed

+47
-35
lines changed

4 files changed

+47
-35
lines changed

bin/main.js

Lines changed: 6 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 23 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "20ful",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"description": "Static site generator",
55
"engines": {
66
"node": ">=13.5"
@@ -11,9 +11,9 @@
1111
},
1212
"main": "index.js",
1313
"scripts": {
14-
"prepare": "lsc -k -co bin/ source/",
15-
"pretest": "lsc -k -co bin/ source/",
16-
"test": "lsc -kc test/ && ava --verbose"
14+
"prepare": "npx lsc -k -co bin/ source/",
15+
"pretest": "npx lsc -k -co bin/ source/",
16+
"test": "npx lsc -kc test/ && ava --verbose"
1717
},
1818
"bin": "./cmd.js",
1919
"author": "Iļja Ketris",
@@ -38,6 +38,7 @@
3838
"ava": "^3.5.0"
3939
},
4040
"dependencies": {
41+
"acorn": ">=5.7.4",
4142
"base58": "^2.0.1",
4243
"browser-sync": "^2.26.7",
4344
"chokidar": "^3.3.1",
@@ -50,12 +51,12 @@
5051
"mkdirp": "^1.0.3",
5152
"nunjucks": "^3.2.0",
5253
"ololog": "^1.1.155",
53-
"on-change": "^1.6.4",
54+
"on-change": "^2.0.0",
5455
"pug": "^2.0.4",
5556
"ramda": "^0.27.0",
56-
"sass": "^1.26.2",
57+
"sass": "^1.26.3",
5758
"string-hash": "^1.1.3",
5859
"stylus": "^0.54.7",
59-
"yaml": "^1.8.0"
60+
"yaml": "^1.8.2"
6061
}
6162
}

source/main.ls

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ state =
3030
emptyLayout = src: \pug, dst: \html, body: '|!{body}'
3131

3232
site = {}
33+
# hash of input files
34+
# "done" means: 1: read, 1.5: not html, 2: template compiled, 4: written
35+
3336

3437
tocc = onChange {}, !-> state.rescan = yes
3538

@@ -140,9 +143,11 @@ processFile = (hsh) ->
140143
writeOne x, compiled
141144

142145
.then ->
143-
if allIn! and all ((.done) >> (> 1)), values site
146+
log.warn state.rescan
147+
if allIn! and (state.rescan or all ((.done) >> (> 1)), values site)
144148
Promise.all rebuild!
145149
.then ->
150+
state.rescan = no
146151
if state.mode is '' and all (propEq \done, 4), values site
147152
process.exit 0
148153

@@ -170,9 +175,10 @@ rebuild = ->
170175
js = []
171176

172177
writes = values site
173-
|> filter (.done) >> (is 2)
178+
|> filter ifElse always(state.rescan),
179+
has \cpld
180+
propEq \done, 2
174181
|> map (x) ->
175-
# x.done = 3
176182
layoutName = x.attr.layout or \system
177183
layout = values site
178184
|> find pathEq <[attr template]>, layoutName
@@ -193,7 +199,7 @@ rebuild = ->
193199
#-------------------------------------------------
194200
theError = !->
195201
switch it?name
196-
| \Error => log.error.bgMagenta it.message
202+
| \Error => log.error.bgMagenta it
197203
| _ => log.error.red it
198204
process.exit 1
199205

0 commit comments

Comments
 (0)