pub-server 2.13.0 → 3.0.0
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/LICENSE +1 -1
- package/README.md +0 -1
- package/bin/_pub.js +6 -4
- package/client/_generator.js +1 -2
- package/client/init-opts.js +1 -2
- package/client/pub-sockets.js +1 -1
- package/client/pub-ux.js +2 -4
- package/package.json +28 -31
- package/server/handle-errors.js +1 -1
- package/server/serve-pages.js +1 -1
- package/server/serve-scripts.js +2 -2
- package/server/serve-sockets.js +1 -1
- package/server/serve-statics.js +1 -1
- package/server/watch-sources.js +1 -1
- package/server/watch.js +1 -1
- package/server.js +3 -3
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(The MIT License)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2015-
|
|
3
|
+
Copyright (c) 2015-2026 Jürgen Leschner -- github.com/jldec
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
6
|
a copy of this software and associated documentation files (the
|
package/README.md
CHANGED
package/bin/_pub.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
* pub command script
|
|
5
|
-
* Copyright (c) 2015-
|
|
5
|
+
* Copyright (c) 2015-2026 Jürgen Leschner - github.com/jldec - MIT license
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
var pkg = require('../package.json');
|
|
@@ -77,9 +77,11 @@ if (cli.minify && !cli.dbg) { opts.minify = true; }
|
|
|
77
77
|
|
|
78
78
|
var server = require('../server')(opts);
|
|
79
79
|
|
|
80
|
-
if (cli.config)
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
if (cli.config) {
|
|
81
|
+
console.log(inspect(u.omit(opts, 'source$', 'output$'), {depth:2, colors:true}));
|
|
82
|
+
} else {
|
|
83
|
+
server.run();
|
|
84
|
+
}
|
|
83
85
|
|
|
84
86
|
//--//--//--//--//--//--//--//--//
|
|
85
87
|
|
package/client/_generator.js
CHANGED
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
* served at /pub/_generator.js by serve-scripts.js
|
|
6
6
|
* depends on jquery
|
|
7
7
|
*
|
|
8
|
-
* Copyright (c) 2015-
|
|
8
|
+
* Copyright (c) 2015-2026 Jürgen Leschner - github.com/jldec - MIT license
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
/* global $ */
|
|
12
11
|
/* global pubRef */
|
|
13
12
|
|
|
14
13
|
var debug = require('debug')('pub:generator');
|
package/client/init-opts.js
CHANGED
|
@@ -7,10 +7,9 @@
|
|
|
7
7
|
* possibly by directing browser to gatekeeper for auth roundabout
|
|
8
8
|
* TODO: implement a mechanism to force re-authentication (logout gatekeeper)
|
|
9
9
|
*
|
|
10
|
-
* Copyright (c) 2015-
|
|
10
|
+
* Copyright (c) 2015-2026 Jürgen Leschner - github.com/jldec - MIT license
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
/* global $ */
|
|
14
13
|
/* global pubRef */
|
|
15
14
|
|
|
16
15
|
var dbg = require('debug');
|
package/client/pub-sockets.js
CHANGED
package/client/pub-ux.js
CHANGED
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
* pub-ux.js
|
|
3
3
|
* browserify entry point for legacy pub-pkg-editor
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c) 2015-
|
|
5
|
+
* Copyright (c) 2015-2026 Jürgen Leschner - github.com/jldec - MIT license
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
/* global $ */
|
|
9
|
-
|
|
10
8
|
$(function(){
|
|
11
9
|
|
|
12
10
|
var style =
|
|
@@ -53,7 +51,7 @@ $(function(){
|
|
|
53
51
|
var pubRef = window.pubRef || {};
|
|
54
52
|
var contentHref = (pubRef.href || location.pathname) + location.search + location.hash;
|
|
55
53
|
var editorHref = (pubRef.relPath || '') + '/pub/?page=' + encodeURIComponent(contentHref);
|
|
56
|
-
location = editorHref;
|
|
54
|
+
location = editorHref; // eslint-disable-line no-global-assign
|
|
57
55
|
});
|
|
58
56
|
}
|
|
59
57
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pub-server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "markdown site generator, web server, and editor",
|
|
5
5
|
"main": "server.js",
|
|
6
6
|
"preferGlobal": true,
|
|
@@ -8,41 +8,37 @@
|
|
|
8
8
|
"pub": "./bin/pub.js"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"asyncbuilder": "^1.1.1",
|
|
12
11
|
"body-parser": "^1.20.2",
|
|
13
12
|
"browserify": "^17.0.0",
|
|
14
13
|
"chokidar": "^3.6.0",
|
|
15
14
|
"commander": "^2.20.0",
|
|
16
15
|
"compression": "^1.7.4",
|
|
17
|
-
"debug": "
|
|
16
|
+
"debug": "4.3.6",
|
|
18
17
|
"express": "^4.19.2",
|
|
19
18
|
"fs-extra": "^11.2.0",
|
|
20
19
|
"mime": "^3.0.0",
|
|
21
|
-
"pub-generator": "^4.4.0",
|
|
22
|
-
"pub-pkg-editor": "^2.2.0",
|
|
23
|
-
"pub-pkg-font-awesome": "^3.0.5",
|
|
24
|
-
"pub-pkg-font-open-sans": "^1.5.1",
|
|
25
|
-
"pub-pkg-google-oauth": "^2.2.0",
|
|
26
|
-
"pub-pkg-highlight": "^11.4.0",
|
|
27
|
-
"pub-pkg-jquery": "^1.12.4",
|
|
28
|
-
"pub-pkg-prism": "^2.0.5",
|
|
29
|
-
"pub-pkg-seo": "^1.3.0",
|
|
30
|
-
"pub-resolve-opts": "^1.10.0",
|
|
31
|
-
"pub-serve-sessions": "^2.0.1",
|
|
32
|
-
"pub-src-fs": "^2.2.0",
|
|
33
|
-
"pub-src-github": "^2.1.0",
|
|
34
|
-
"pub-src-http": "^2.0.0",
|
|
35
|
-
"pub-src-redis": "^2.4.0",
|
|
36
|
-
"pub-theme-doc": "^1.2.0",
|
|
37
|
-
"pub-util": "^3.3.0",
|
|
38
20
|
"send": "^0.18.0",
|
|
39
21
|
"socket.io": "^4.7.5",
|
|
40
22
|
"through2": "^4.0.2",
|
|
41
|
-
"uglify-js": "^3.19.3"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
"
|
|
23
|
+
"uglify-js": "^3.19.3",
|
|
24
|
+
"asyncbuilder": "2.0.0",
|
|
25
|
+
"pub-generator": "5.0.0",
|
|
26
|
+
"pub-pkg-editor": "3.0.0",
|
|
27
|
+
"pub-pkg-font-open-sans": "2.0.0",
|
|
28
|
+
"pub-pkg-font-awesome": "4.0.0",
|
|
29
|
+
"pub-pkg-highlight": "12.0.0",
|
|
30
|
+
"pub-pkg-jquery": "2.0.0",
|
|
31
|
+
"pub-pkg-prism": "3.0.0",
|
|
32
|
+
"pub-pkg-seo": "2.0.0",
|
|
33
|
+
"pub-resolve-opts": "2.0.0",
|
|
34
|
+
"pub-serve-sessions": "3.0.0",
|
|
35
|
+
"pub-src-fs": "3.0.0",
|
|
36
|
+
"pub-src-github": "3.0.0",
|
|
37
|
+
"pub-src-http": "3.0.0",
|
|
38
|
+
"pub-theme-doc": "2.0.0",
|
|
39
|
+
"pub-util": "4.0.0",
|
|
40
|
+
"pub-src-redis": "3.0.0",
|
|
41
|
+
"pub-pkg-google-oauth": "4.0.0"
|
|
46
42
|
},
|
|
47
43
|
"files": [
|
|
48
44
|
"bin/",
|
|
@@ -50,9 +46,6 @@
|
|
|
50
46
|
"server/",
|
|
51
47
|
"server.js"
|
|
52
48
|
],
|
|
53
|
-
"scripts": {
|
|
54
|
-
"test": "eslint . && tape test/*.js"
|
|
55
|
-
},
|
|
56
49
|
"keywords": [
|
|
57
50
|
"markdown",
|
|
58
51
|
"editor",
|
|
@@ -62,8 +55,12 @@
|
|
|
62
55
|
],
|
|
63
56
|
"repository": {
|
|
64
57
|
"type": "git",
|
|
65
|
-
"url": "git://github.com/jldec/pub-server.git"
|
|
58
|
+
"url": "git://github.com/jldec/pub-server-monorepo.git",
|
|
59
|
+
"directory": "packages/pub-server"
|
|
66
60
|
},
|
|
67
61
|
"author": "Jürgen Leschner",
|
|
68
|
-
"license": "MIT"
|
|
69
|
-
|
|
62
|
+
"license": "MIT",
|
|
63
|
+
"scripts": {
|
|
64
|
+
"test": "tape test/*.js"
|
|
65
|
+
}
|
|
66
|
+
}
|
package/server/handle-errors.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* - this should be the last handler loaded by the server
|
|
5
5
|
* - depends on serve-pages being invoked before this
|
|
6
6
|
*
|
|
7
|
-
* Copyright (c) 2015-
|
|
7
|
+
* Copyright (c) 2015-2026 Jürgen Leschner - github.com/jldec - MIT license
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/*eslint no-unused-vars: "off"*/
|
package/server/serve-pages.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* with page http-headers, checks http methods
|
|
6
6
|
* also serves redirects
|
|
7
7
|
*
|
|
8
|
-
* Copyright (c) 2015-
|
|
8
|
+
* Copyright (c) 2015-2026 Jürgen Leschner - github.com/jldec - MIT license
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
var debug = require('debug')('pub:server:pages');
|
package/server/serve-scripts.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* server optional, if not passed, no routes served
|
|
9
9
|
* serveStatics.outputAll() - copy scripts to outputs[0] (for pub -O)
|
|
10
10
|
*
|
|
11
|
-
* Copyright (c) 2015-
|
|
11
|
+
* Copyright (c) 2015-2026 Jürgen Leschner - github.com/jldec - MIT license
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
/* eslint no-empty: ["error", { "allowEmptyCatch": true }] */
|
|
@@ -168,7 +168,7 @@ module.exports = function serveScripts(opts) {
|
|
|
168
168
|
// slow! TODO: offer a way to cache between builds
|
|
169
169
|
str = uglify.minify(str, {}).code;
|
|
170
170
|
}
|
|
171
|
-
catch(
|
|
171
|
+
catch(_e) {}
|
|
172
172
|
}
|
|
173
173
|
files.push( { path:script.route, text:str } );
|
|
174
174
|
filemap.push( { path:script.route } );
|
package/server/serve-sockets.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* primary purpose (for now) is for watchers to trigger page reload
|
|
6
6
|
* does nothing if opts.no-sockets is set (and disabled on production)
|
|
7
7
|
*
|
|
8
|
-
* Copyright (c) 2015-
|
|
8
|
+
* Copyright (c) 2015-2026 Jürgen Leschner - github.com/jldec - MIT license
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
|
package/server/serve-statics.js
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* extend to serve files from remote storage
|
|
19
19
|
* (supports only local files for now)
|
|
20
20
|
*
|
|
21
|
-
* Copyright (c) 2015-
|
|
21
|
+
* Copyright (c) 2015-2026 Jürgen Leschner - github.com/jldec - MIT license
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
var debug = require('debug')('pub:static');
|
package/server/watch-sources.js
CHANGED
package/server/watch.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* used by serve-statics and watch-sources
|
|
5
5
|
* TODO: dedup watches and look at aggregating watch paths with single watch
|
|
6
6
|
*
|
|
7
|
-
* Copyright (c) 2015-
|
|
7
|
+
* Copyright (c) 2015-2026 Jürgen Leschner - github.com/jldec - MIT license
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
var debug = require('debug')('pub:watch');
|
package/server.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* invoke directly via node command line, or via require()
|
|
6
6
|
* see: https://nodejs.org/api/modules.html#modules_accessing_the_main_module
|
|
7
7
|
*
|
|
8
|
-
* Copyright (c) 2015-
|
|
8
|
+
* Copyright (c) 2015-2026 Jürgen Leschner - github.com/jldec - MIT license
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
var debug = require('debug')('pub:server');
|
|
@@ -198,14 +198,14 @@ function pubServer(opts) {
|
|
|
198
198
|
server.http.close();
|
|
199
199
|
opts.port = (parseInt(opts.port) || 3001) + 1;
|
|
200
200
|
log('port in use, trying', opts.port);
|
|
201
|
-
server.http.listen(opts.port);
|
|
201
|
+
server.http.listen(opts.port, '0.0.0.0');
|
|
202
202
|
tried ++;
|
|
203
203
|
}
|
|
204
204
|
});
|
|
205
205
|
|
|
206
206
|
require('./server/handle-errors')(server);
|
|
207
207
|
|
|
208
|
-
server.http.listen(opts.port);
|
|
208
|
+
server.http.listen(opts.port, '0.0.0.0');
|
|
209
209
|
log('port', opts.port);
|
|
210
210
|
|
|
211
211
|
process.on('SIGTERM', function() {
|