@plotdb/srcbuild 0.0.63 → 0.0.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/adapter.js +4 -0
- package/dist/ext/base.js +2 -1
- package/dist/pug-cli +2 -1
- package/dist/pug-cli.js +2 -1
- package/dist/view/pug.js +6 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -70,6 +70,7 @@ and the common options for `init` are as following:
|
|
|
70
70
|
- `srcdir`: directory for source files. should be relative to `base`. default `src` if omitted.
|
|
71
71
|
- `desdir`: directory for built files. should be relative to `base`. default `static` if omitted.
|
|
72
72
|
- `logger`: logger for log output. use `console` if omitted.
|
|
73
|
+
- `initScan`: default true. if true, run a directory scanning for files to build when adapter is initing.
|
|
73
74
|
|
|
74
75
|
check `src/ext/lsc.ls` or `src/ext/pug.ls` for example.
|
|
75
76
|
|
package/dist/adapter.js
CHANGED
|
@@ -11,6 +11,7 @@ adapter = function(opt){
|
|
|
11
11
|
this.opt = opt;
|
|
12
12
|
this.base = opt.base || '.';
|
|
13
13
|
this.log = opt.logger || aux.logger;
|
|
14
|
+
this.initScan = opt.initScan != null ? opt.initScan : true;
|
|
14
15
|
this.ignored = (opt.watcher || (opt.watcher = {})).ignored || [];
|
|
15
16
|
this.depends = {
|
|
16
17
|
on: {},
|
|
@@ -168,6 +169,9 @@ adapter.prototype = import$(Object.create(Object.prototype), {
|
|
|
168
169
|
},
|
|
169
170
|
init: function(){
|
|
170
171
|
var initBuilds, recurse, t1, this$ = this;
|
|
172
|
+
if (!this.initScan) {
|
|
173
|
+
return Promise.resolve();
|
|
174
|
+
}
|
|
171
175
|
initBuilds = [];
|
|
172
176
|
recurse = function(root){
|
|
173
177
|
var len1, len2, files, i$, len$, file, stat, e, results$ = [];
|
package/dist/ext/base.js
CHANGED
package/dist/pug-cli
CHANGED
package/dist/pug-cli.js
CHANGED
package/dist/view/pug.js
CHANGED
|
@@ -32,7 +32,7 @@ pugViewEngine = function(options){
|
|
|
32
32
|
return logger.debug(f.replace(opt.basedir, '') + " served in " + t + "ms (" + type + (cache ? ' cached' : '') + ")");
|
|
33
33
|
};
|
|
34
34
|
return function(src, opt, cb){
|
|
35
|
-
var lc, intl, ref$, desv, desh, startTime, mtime, ret, e;
|
|
35
|
+
var lc, intl, ref$, desv, desh, startTime, mtime, mtimeSrc, ret, e;
|
|
36
36
|
lc = {
|
|
37
37
|
isCached: false
|
|
38
38
|
};
|
|
@@ -45,6 +45,10 @@ pugViewEngine = function(options){
|
|
|
45
45
|
startTime = Date.now();
|
|
46
46
|
try {
|
|
47
47
|
mtime = +fs.statSync(desv).mtime;
|
|
48
|
+
mtimeSrc = +fs.statSync(src).mtime;
|
|
49
|
+
if (mtimeSrc - mtime > 0) {
|
|
50
|
+
throw new Error("src dirty");
|
|
51
|
+
}
|
|
48
52
|
if (!lc.useCache || !pugcache[desv] || mtime - pugcache[desv].mtime > 0) {
|
|
49
53
|
ret = pugcache[desv] = {
|
|
50
54
|
js: reload(desv),
|
|
@@ -65,7 +69,7 @@ pugViewEngine = function(options){
|
|
|
65
69
|
} catch (e$) {
|
|
66
70
|
e = e$;
|
|
67
71
|
return Promise.resolve().then(function(){
|
|
68
|
-
lc.mtime =
|
|
72
|
+
lc.mtime = mtimeSrc;
|
|
69
73
|
if (!lc.useCache || !pugcache[src] || lc.mtime - pugcache[src].mtime > 0) {
|
|
70
74
|
return fsp.readFile(src).then(function(buf){
|
|
71
75
|
return pugcache[src] = {
|