Skip to content

Commit 6dbf30b

Browse files
committed
- fix bug: srcbuild-pug triggers a directory traverse which shouldn't happen.
- add option `initScan` for toggling initial directory traverse.:wq - bump version
1 parent 9c45dc8 commit 6dbf30b

11 files changed

Lines changed: 25 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change Log
22

3+
## v0.0.64
4+
5+
- fix bug: `srcbuild-pug` triggers a directory traverse which shouldn't happen.
6+
- add option `initScan` for toggling initial directory traverse.
7+
8+
9+
310
## v0.0.63
411

512
- bundle should add both codesrc and src so the dependencies will be accurate

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ and the common options for `init` are as following:
7070
- `srcdir`: directory for source files. should be relative to `base`. default `src` if omitted.
7171
- `desdir`: directory for built files. should be relative to `base`. default `static` if omitted.
7272
- `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.
7374

7475
check `src/ext/lsc.ls` or `src/ext/pug.ls` for example.
7576

dist/adapter.js

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

dist/ext/base.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/pug-cli

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ yargs = require('yargs');
88
pug = require('pug');
99
pugbuild = require("./ext/pug");
1010
opt = {
11-
basedir: '.'
11+
basedir: '.',
12+
initScan: false
1213
};
1314
argv = yargs.option('base', {
1415
alias: 'b',

dist/pug-cli.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"author": "zbryikt",
33
"name": "@plotdb/srcbuild",
4-
"version": "0.0.63",
4+
"version": "0.0.64",
55
"description": "",
66
"main": "./dist/main.js",
77
"files": [

src/adapter.ls

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ adapter = (opt={}) ->
44
@opt = opt
55
@base = opt.base or '.'
66
@log = opt.logger or aux.logger
7+
@init-scan = if opt.init-scan? => opt.init-scan else true
78
@ignored = opt.{}watcher.ignored or []
89
@depends = {on: {}, by: {}}
910

@@ -79,6 +80,7 @@ adapter.prototype = Object.create(Object.prototype) <<< do
7980
@build files.map((file) -> {file, mtime: recurse(file)})
8081

8182
init: ->
83+
if !@init-scan => return Promise.resolve!
8284
init-builds = []
8385
recurse = (root) ~>
8486
if !fs.exists-sync(root) => return

src/ext/base.ls

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ basebuild.prototype = Object.create(Object.prototype) <<< do
3232
build: (files) ~> @build files
3333
purge: (files) ~> @purge files
3434
resolve: (file) ~> @resolve file
35+
init-scan: opt.init-scan
3536
@adapter.init!
3637
get-adapter: -> @adapter
3738

0 commit comments

Comments
 (0)