@plotdb/srcbuild 0.0.33 → 0.0.37

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/dist/adapter.js CHANGED
@@ -142,14 +142,20 @@ adapter.prototype = import$(Object.create(Object.prototype), {
142
142
  var mtimes, recurse, this$ = this;
143
143
  mtimes = {};
144
144
  recurse = function(file){
145
- var that;
145
+ var that, stat, e;
146
146
  if (that = mtimes[file]) {
147
147
  return that;
148
148
  }
149
149
  if (!fs.existsSync(file)) {
150
150
  return 0;
151
151
  }
152
- return mtimes[file] = Math.max.apply(Math, [+fs.statSync(file).mtime].concat(Array.from(this$.depends.by[file] || []).map(function(f){
152
+ try {
153
+ stat = fs.statSync(file);
154
+ } catch (e$) {
155
+ e = e$;
156
+ return 0;
157
+ }
158
+ return mtimes[file] = Math.max.apply(Math, [+stat.mtime].concat(Array.from(this$.depends.by[file] || []).map(function(f){
153
159
  return recurse(f);
154
160
  })));
155
161
  };
@@ -164,7 +170,7 @@ adapter.prototype = import$(Object.create(Object.prototype), {
164
170
  var initBuilds, recurse, t1, this$ = this;
165
171
  initBuilds = [];
166
172
  recurse = function(root){
167
- var len1, len2, files, i$, len$, file, e, results$ = [];
173
+ var len1, len2, files, i$, len$, file, stat, e, results$ = [];
168
174
  if (!fs.existsSync(root)) {
169
175
  return;
170
176
  }
@@ -179,7 +185,13 @@ adapter.prototype = import$(Object.create(Object.prototype), {
179
185
  });
180
186
  for (i$ = 0, len$ = files.length; i$ < len$; ++i$) {
181
187
  file = files[i$];
182
- if (fs.statSync(file).isDirectory()) {
188
+ try {
189
+ stat = fs.statSync(file);
190
+ } catch (e$) {
191
+ e = e$;
192
+ continue;
193
+ }
194
+ if (stat.isDirectory()) {
183
195
  recurse(file);
184
196
  }
185
197
  if (!this$.isSupported(file)) {
package/dist/aux.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // Generated by LiveScript 1.6.0
2
2
  var fs, colors, aux, log;
3
3
  fs = require('fs');
4
- colors = require('colors');
4
+ colors = require('@plotdb/colors');
5
5
  aux = {
6
6
  newer: function(f1, files, strict){
7
7
  var mtime, dtime;
@@ -5,7 +5,7 @@ path = require('path');
5
5
  fsExtra = require('fs-extra');
6
6
  uglifyJs = require('uglify-js');
7
7
  uglifycss = require('uglifycss');
8
- colors = require('colors');
8
+ colors = require('@plotdb/colors');
9
9
  base = require('./base');
10
10
  aux = require('../aux');
11
11
  adapter = require('../adapter');
package/dist/ext/lsc.js CHANGED
@@ -6,7 +6,7 @@ stream = require('stream');
6
6
  fsExtra = require('fs-extra');
7
7
  livescript = require('livescript');
8
8
  uglifyJs = require('uglify-js');
9
- colors = require('colors');
9
+ colors = require('@plotdb/colors');
10
10
  base = require('./base');
11
11
  aux = require('../aux');
12
12
  adapter = require('../adapter');
package/dist/ext/pug.js CHANGED
@@ -10,7 +10,7 @@ uglifycss = require('uglifycss');
10
10
  stylus = require('stylus');
11
11
  jsYaml = require('js-yaml');
12
12
  marked = require('marked');
13
- colors = require('colors');
13
+ colors = require('@plotdb/colors');
14
14
  base = require('./base');
15
15
  aux = require('../aux');
16
16
  pugbuild = function(opt){
@@ -109,13 +109,13 @@ pugbuild.prototype = import$(Object.create(base.prototype), {
109
109
  });
110
110
  },
111
111
  'md': function(text, opt){
112
- return marked(text);
112
+ return marked.parse(text);
113
113
  }
114
114
  },
115
115
  json: function(it){
116
116
  return JSON.parse(fs.readFileSync(it));
117
117
  },
118
- md: marked,
118
+ md: marked.parse,
119
119
  yaml: function(it){
120
120
  return jsYaml.load(fs.readFileSync(it));
121
121
  },
@@ -5,7 +5,7 @@ path = require('path');
5
5
  fsExtra = require('fs-extra');
6
6
  stylus = require('stylus');
7
7
  uglifycss = require('uglifycss');
8
- colors = require('colors');
8
+ colors = require('@plotdb/colors');
9
9
  base = require('./base');
10
10
  aux = require('../aux');
11
11
  adapter = require('../adapter');
package/dist/lib.pug CHANGED
@@ -4,7 +4,7 @@
4
4
  libLoader = {
5
5
  js: {url: {}},
6
6
  css: {url: {}},
7
- root: function(r) { this._root = r; },
7
+ root: function(r) { libLoader._r = r; },
8
8
  _r: "/assets/lib",
9
9
  _v: "",
10
10
  version: function(v) { libLoader._v = (v ? "?v=" + v : ""); }
@@ -12,28 +12,30 @@
12
12
  if(version) { libLoader.version(version); }
13
13
  }
14
14
 
15
- mixin script(os)
15
+ mixin script(os,cfg)
16
16
  -
17
17
  if(!Array.isArray(os)) { os = [os]; }
18
18
  each o in os
19
19
  -
20
- if(typeof(o) == "string") { url = o; }
20
+ c = o;
21
+ if(typeof(o) == "string") { url = o; c = cfg || {};}
21
22
  else if(o.url) { url = o.url; }
22
23
  else { url = libLoader._r + "/" + o.name + "/" + (o.version || 'main') + "/" + (o.path || "index.min.js"); }
23
24
  if !libLoader.js.url[url]
24
25
  - libLoader.js.url[url] = true;
25
- - defer = (typeof(o.defer) == "undefined" ? true : !!o.defer);
26
+ - defer = (typeof(c.defer) == "undefined" ? true : !!c.defer);
26
27
  if /^https?:\/\/./.exec(url)
27
- script(type="text/javascript",src=url, defer=defer, async=!!o.async)
28
+ script(type="text/javascript",src=url, defer=defer, async=!!c.async)
28
29
  else
29
- script(type="text/javascript",src=url + libLoader._v, defer=defer, async=!!o.async)
30
+ script(type="text/javascript",src=url + libLoader._v, defer=defer, async=!!c.async)
30
31
 
31
- mixin css(os)
32
+ mixin css(os,cfg)
32
33
  -
33
34
  if(!Array.isArray(os)) { os = [os]; }
34
35
  each o in os
35
36
  -
36
- if(typeof(o) == "string") { url = o; }
37
+ c = o;
38
+ if(typeof(o) == "string") { url = o; c = cfg || {};}
37
39
  else if(o.url) { url = o.url; }
38
40
  else { url = libLoader._r + "/" + o.name + "/" + (o.version || 'main') + "/" + (o.path || "index.min.css"); }
39
41
  if !libLoader.css.url[url]
package/dist/watch.js CHANGED
@@ -4,7 +4,7 @@ fs = require('fs');
4
4
  path = require('path');
5
5
  fsExtra = require('fs-extra');
6
6
  chokidar = require('chokidar');
7
- colors = require('colors');
7
+ colors = require('@plotdb/colors');
8
8
  debounce = require('@loadingio/debounce.js');
9
9
  aux = require('./aux');
10
10
  watch = function(opt){
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "zbryikt",
3
3
  "name": "@plotdb/srcbuild",
4
- "version": "0.0.33",
4
+ "version": "0.0.37",
5
5
  "description": "",
6
6
  "main": "./dist/main.js",
7
7
  "files": [
@@ -12,6 +12,7 @@
12
12
  "srcbuild-pug": "./dist/pug-cli"
13
13
  },
14
14
  "scripts": {
15
+ "prepare": "mkdir -p ./node_modules/@plotdb/srcbuild/dist; cp dist/lib.pug ./node_modules/@plotdb/srcbuild/dist/",
15
16
  "start": "./node_modules/.bin/lsc watch.ls"
16
17
  },
17
18
  "license": "MIT",
@@ -29,7 +30,7 @@
29
30
  "anymatch": "^3.1.2",
30
31
  "browserify": "^17.0.0",
31
32
  "chokidar": "^3.5.1",
32
- "colors": "^1.4.0",
33
+ "@plotdb/colors": "^0.0.1",
33
34
  "fs-extra": "^9.1.0",
34
35
  "glslify": "^7.1.1",
35
36
  "i18next": "^19.9.2",
@@ -37,7 +38,7 @@
37
38
  "i18next-http-middleware": "^3.1.0",
38
39
  "js-yaml": "^4.0.0",
39
40
  "livescript": "^1.6.0",
40
- "marked": "^2.0.1",
41
+ "marked": "^4.0.10",
41
42
  "pug": "^3.0.2",
42
43
  "require-reload": "^0.2.2",
43
44
  "stylus": "^0.55.0",