@zbryikt/template 2.3.32 → 2.3.33

Sign up to get free protection for your applications and to get access to all the features.
package/bin/cli.js CHANGED
@@ -5,7 +5,7 @@ t1 = Date.now();
5
5
  fs = require('fs');
6
6
  path = require('path');
7
7
  yargs = require('yargs');
8
- colors = require('colors');
8
+ colors = require('@plotdb/colors');
9
9
  srcbuild = require('@plotdb/srcbuild');
10
10
  lib = path.dirname(fs.realpathSync(__filename));
11
11
  server = require(lib + "/lib/server");
package/bin/lib/logger.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Generated by LiveScript 1.6.0
2
2
  var colors, logger;
3
- colors = require('colors');
3
+ colors = require('@plotdb/colors');
4
4
  logger = {};
5
5
  [['debug', 'blue'], ['info', 'green'], ['warn', 'yellow'], ['error', 'red']].map(function(n){
6
6
  return logger[n[0]] = function(){
package/bin/lib/server.js CHANGED
@@ -2,7 +2,7 @@
2
2
  var express, path, colors, i18nextHttpMiddleware, open, pug, i18n, logger, server;
3
3
  express = require('express');
4
4
  path = require('path');
5
- colors = require('colors');
5
+ colors = require('@plotdb/colors');
6
6
  i18nextHttpMiddleware = require('i18next-http-middleware');
7
7
  open = require('open');
8
8
  pug = require('@plotdb/srcbuild/dist/view/pug');
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "license": "MIT",
5
5
  "main": "bin/lib/index.js",
6
6
  "description": "simple, quick template for bootstrap a page",
7
- "version": "2.3.32",
7
+ "version": "2.3.33",
8
8
  "files": [
9
9
  "bin/**/*"
10
10
  ],
@@ -21,30 +21,24 @@
21
21
  "start": "./bin/cli.js -o true"
22
22
  },
23
23
  "dependencies": {
24
- "@loadingio/debounce.js": "^0.0.1",
25
- "@plotdb/srcbuild": "^0.0.33",
24
+ "@plotdb/srcbuild": "^0.0.36",
25
+ "@plotdb/colors": "^0.0.1",
26
26
  "chokidar": "^3.0.0",
27
- "colors": "^1.3.3",
28
27
  "express": "^4.16.4",
29
28
  "fs-extra": "^8.0.0",
30
29
  "i18next": "^19.8.3",
31
30
  "i18next-fs-backend": "^1.0.7",
32
31
  "i18next-http-middleware": "^3.0.6",
33
- "js-yaml": "^3.13.1",
34
32
  "livescript": "^1.6.0",
35
- "marked": "0.7.0",
36
33
  "open": "^7.3.0",
37
- "pug": "^3.0.2",
38
34
  "require-reload": "^0.2.2",
39
- "stylus": "^0.55.0",
40
- "uglify-js": "^3.2.0",
41
- "uglifycss": "^0.0.29",
42
35
  "yargs": "^16.1.0"
43
36
  },
44
37
  "bin": {
45
38
  "server": "./bin/cli.js"
46
39
  },
47
40
  "devDependencies": {
48
- "ldview": "^0.0.2"
41
+ "@loadingio/debounce.js": "^0.0.1",
42
+ "ldview": "^0.2.7"
49
43
  }
50
44
  }
package/CHANGELOG.md DELETED
@@ -1,246 +0,0 @@
1
- # Change Log
2
-
3
- ## v2.3.32
4
-
5
- - bump @plotdb/srcbuild version for libLoader bug fixing
6
-
7
-
8
- ## v2.3.31
9
-
10
- - bump @plotdb/srcbuild version for bundler relative path feature
11
-
12
-
13
- ## v2.3.30
14
-
15
- - bump @plotdb/srcbuild version for stylus dependency and script option bug fixing
16
-
17
-
18
- ## v2.3.29
19
-
20
- - bump @plotdb/srcbuild version for script and css loading bug fixing
21
-
22
-
23
- ## v2.3.28
24
-
25
- - bump @plotdb/srcbuild version for natively supporting script and css loading
26
-
27
-
28
- ## v2.3.27
29
-
30
- - bump @plotdb/srcbuild version for bundler bug fixing
31
-
32
-
33
- ## v2.3.26
34
-
35
- - bump @plotdb/srcbuild version for disabling js compression in minification
36
-
37
-
38
- ## v2.3.25
39
-
40
- - bump @plotdb/srcbuild version for js minifying compression issue
41
-
42
-
43
- ## v2.3.24
44
-
45
- - bump @plotdb/srcbuild version for log removal
46
-
47
-
48
- ## v2.3.23
49
-
50
- - bump @plotdb/srcbuild version for builder update
51
-
52
-
53
- ## v2.3.22
54
-
55
- - bump @plotdb/srcbuild version for tweaking pug generation
56
- - add legacy / deprecated notes for cfgfile
57
- - add `lsp` option in config
58
-
59
-
60
- ## v2.3.21
61
-
62
- - bump @plotdb/srcbuild version for bug fixing
63
-
64
-
65
- ## v2.3.20
66
-
67
- - bump @plotdb/srcbuild version for bug fixing
68
-
69
-
70
- ## v2.3.19
71
-
72
- - bump @plotdb/srcbuild version for resolving module from basedir in ext/pug
73
-
74
-
75
- ## v2.3.18
76
-
77
- - bump stylus and @plotdb/srcbuild version for removing deprecated dependencies
78
-
79
-
80
- ## v2.3.17
81
-
82
- - bump `@plotdb/srcubild` version to 0.0.18 for livescript building failed issue
83
-
84
-
85
- ## v2.3.16
86
-
87
- - upgrade `@plotdb/srcbuild` for `json` reading feature
88
-
89
-
90
- ## v2.3.15
91
-
92
- - upgrade `@plotdb/srcbuild` for bug fixing
93
-
94
-
95
- ## v2.3.14
96
-
97
- - upgrade `path-parse` for resolving ReDoS vulnerability
98
- - upgrade `@plotdb/srcbuild` for supporting glslify transformation of lsc files
99
-
100
-
101
- ## v2.3.13
102
-
103
- - upgrade `@plotdb/srcbuild` for new pug api
104
-
105
-
106
- ## v2.3.12
107
-
108
- - fix module interface issue by removing non-existed dependency
109
-
110
-
111
- ## v2.3.11
112
-
113
- - upgrade `@plotdb/srcbuild` to `0.0.13` for fixing view/pug -> ext/pug parameter passing issue
114
-
115
-
116
- ## v2.3.10
117
-
118
- - upgrade `@plotdb/srcbuild` to `0.0.12` for fixing base, desdir and bundling path log bug
119
-
120
-
121
- ## v2.3.9
122
-
123
- - add `debug` level in default logger.
124
- - update `@plotdb/srcbuild` for view engine bug fixing
125
- - remove builtin pug view engine
126
- - remove useless `watch.ls`
127
-
128
-
129
- ## v2.3.8
130
-
131
- - skipped version due to typo
132
-
133
-
134
- ## v2.3.7
135
-
136
- - update `@plotdb/srcbuild`
137
-
138
-
139
- ## v2.3.6
140
-
141
- - update `@plotdb/srcbuild` for dependencies tracking bug fix
142
-
143
-
144
- ## v2.3.5
145
-
146
- - update `@plotdb/srcbuild` for bundling support
147
-
148
-
149
- ## v2.3.4
150
-
151
- - update `@plotdb/srcbuild` for bug fixing
152
-
153
-
154
- ## v2.3.3
155
-
156
- - enable i18n only if i18n in option is defined.
157
-
158
-
159
- ## v2.3.2
160
-
161
- - upgrade `@plotdb/srcbuild` for bug fixing
162
- - add test case for special pug include path rule
163
-
164
-
165
- ## v2.3.1
166
-
167
- - update `@plotdb/srcbuild` for pug path bug fix
168
- - add test case for pug inclusion and extend
169
- - fix bug: lsp should use '.' instead of
170
-
171
-
172
- ## v2.3.0
173
-
174
- - use `@plotdb/srcbuild` for source code building
175
- - remove local source code building codes
176
-
177
-
178
- ## v2.2.4
179
-
180
- - fix bug: incorrect path resolving in customized resolve plugin
181
- - use local js instead of npx for running local script
182
- - add test case for relative / absolute path inclusion
183
-
184
-
185
- ## v2.2.3
186
-
187
- - fix bug: pug dependency path resolving incorrect
188
-
189
-
190
- ## v2.2.2
191
-
192
- - fix bug: pug malformat crashes the whole server
193
-
194
-
195
- ## v2.2.1
196
-
197
- - fix bug: update of dependencies doesn't trigger pug file's rebuilding.
198
- - calculate pug dependencies based on pug native function
199
-
200
-
201
- ## v2.2.0
202
-
203
- - add module / static path for including pug files
204
-
205
-
206
- ## v2.1.10
207
-
208
- - trim i18n key when use to prevent confusion
209
-
210
-
211
- ## v2.1.9
212
-
213
- - add `intlbase` pug function for wrapping url with i18n base.
214
-
215
-
216
- ## v2.1.8
217
-
218
- - tweak build script.
219
- - add `-p` / `--port` option for assigning port to listen.
220
-
221
-
222
- ## v2.1.7
223
-
224
- - support auto-open functionality with option `-o` or config `open`. default false ( suppressed )
225
-
226
-
227
- ## v2.1.6
228
-
229
- - fix bug: we should require scoped packages with their full name.
230
-
231
-
232
- ## v2.1.5
233
-
234
- - use dependency debounce.js from npm instead of github.
235
-
236
-
237
- ## v2.1.4
238
-
239
- - remove LiveScript header comment.
240
- - add lson format support.
241
- - upgrade from `LiveScript 1.3` to `livescript 1.6` for json support.
242
- - update build script to adopt livescript 1.3 -> 1.6 change.
243
-
244
- ## v2.1.3
245
-
246
- - make web root customizable and formalize server arguments.
package/bin/lib/view.js DELETED
@@ -1,118 +0,0 @@
1
- // Generated by LiveScript 1.6.0
2
- var fs, path, pug, stylus, livescript, reload, pugExtapi, pugCached, log, engine;
3
- fs = require('fs');
4
- path = require('path');
5
- pug = require('pug');
6
- stylus = require('stylus');
7
- livescript = require('livescript');
8
- reload = require("require-reload")(require);
9
- pugExtapi = {
10
- filters: {
11
- 'lsc': function(text, opt){
12
- return livescript.compile(text, {
13
- bare: true,
14
- header: false
15
- });
16
- },
17
- 'lson': function(text, opt){
18
- return livescript.compile(text, {
19
- bare: true,
20
- header: false,
21
- json: true
22
- });
23
- },
24
- 'stylus': function(text, opt){
25
- return stylus(text).set('filename', 'inline').define('index', function(a, b){
26
- a = (a.string || a.val).split(' ');
27
- return new stylus.nodes.Unit(a.indexOf(b.val));
28
- }).render();
29
- }
30
- }
31
- };
32
- pugCached = {};
33
- log = function(f, opt, t, type, cache){
34
- f = f.replace(opt.basedir, '');
35
- return console.log("[VIEW] " + f + " served in " + t + "ms (" + type + (cache ? ' cached' : '') + ")");
36
- };
37
- engine = function(f, opt, cb){
38
- var lc, intl, viewdir, basedir, pc, t1, mtime, cache, ret, t2, e, p;
39
- lc = {};
40
- if (opt.settings.env === 'development') {
41
- lc.dev = true;
42
- }
43
- lc.cache = true || opt.settings['view cache'];
44
- intl = opt.i18n ? path.join("intl", opt._locals.language) : '';
45
- viewdir = opt.viewdir, basedir = opt.basedir;
46
- pc = path.join(viewdir, intl, f.replace(basedir, '').replace(/\.pug$/, '.js'));
47
- try {
48
- t1 = Date.now();
49
- mtime = fs.statSync(pc).mtime;
50
- cache = false;
51
- ret = pugCached[pc] = !lc.cache || !pugCached[pc] || mtime - pugCached[pc].mtime > 0
52
- ? {
53
- js: reload(pc),
54
- mtime: mtime
55
- }
56
- : (cache = true, pugCached[pc]);
57
- if (!ret.js) {
58
- throw new Error();
59
- }
60
- ret = ret.js(opt);
61
- t2 = Date.now();
62
- if (lc.dev) {
63
- log(f, opt, t2 - t1, 'precompiled', cache);
64
- }
65
- return cb(null, ret);
66
- } catch (e$) {
67
- e = e$;
68
- t1 = Date.now();
69
- mtime = fs.statSync(f).mtime;
70
- p = !lc.cache || !pugCached[f] || (pugCached[f] && mtime - pugCached[f].mtime > 0)
71
- ? new Promise(function(res, rej){
72
- return fs.readFile(f, function(e, b){
73
- if (e) {
74
- return rej(e);
75
- } else {
76
- return res(b);
77
- }
78
- });
79
- }).then(function(buf){
80
- return pugCached[f] = {
81
- buf: buf
82
- };
83
- })
84
- : Promise.resolve(pugCached[f]);
85
- return p.then(function(obj){
86
- var cache, ret, ref$, t2;
87
- if (!(cache = obj.mtime != null && lc.cache)) {
88
- obj.mtime = mtime;
89
- }
90
- ret = pug.render(obj.buf, import$((ref$ = import$({}, opt), ref$.filename = f, ref$.cache = cache, ref$.basedir = basedir, ref$), pugExtapi));
91
- t2 = Date.now();
92
- if (lc.dev) {
93
- log(f, opt, t2 - t1, 'from pug', cache);
94
- }
95
- return cb(null, ret);
96
- })['catch'](function(){
97
- console.log("[VIEW] " + f.replace(opt.basedir, '') + " serve failed.");
98
- return cb(e, null);
99
- });
100
- }
101
- };
102
- engine.opt = function(opt){
103
- opt == null && (opt = {});
104
- if (opt.i18n) {
105
- pugExtapi.i18n = function(it){
106
- return opt.i18n.t(it);
107
- };
108
- return (pugExtapi.filters || (pugExtapi.filters = {})).i18n = function(t, o){
109
- return opt.i18n.t(t);
110
- };
111
- }
112
- };
113
- module.exports = engine;
114
- function import$(obj, src){
115
- var own = {}.hasOwnProperty;
116
- for (var key in src) if (own.call(src, key)) obj[key] = src[key];
117
- return obj;
118
- }