@webqit/webflo 0.11.21 → 0.11.24
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/.gitignore +7 -7
- package/LICENSE +20 -20
- package/README.md +2074 -2071
- package/package.json +82 -82
- package/src/Context.js +79 -79
- package/src/config-pi/deployment/Env.js +69 -69
- package/src/config-pi/deployment/Layout.js +65 -65
- package/src/config-pi/deployment/Origins.js +133 -133
- package/src/config-pi/deployment/Virtualization.js +65 -65
- package/src/config-pi/deployment/index.js +17 -17
- package/src/config-pi/index.js +15 -15
- package/src/config-pi/runtime/Client.js +101 -101
- package/src/config-pi/runtime/Server.js +128 -128
- package/src/config-pi/runtime/client/Worker.js +135 -135
- package/src/config-pi/runtime/client/index.js +11 -11
- package/src/config-pi/runtime/index.js +17 -17
- package/src/config-pi/runtime/server/Headers.js +77 -77
- package/src/config-pi/runtime/server/Redirects.js +73 -73
- package/src/config-pi/runtime/server/index.js +13 -13
- package/src/config-pi/static/Manifest.js +321 -321
- package/src/config-pi/static/Ssg.js +51 -51
- package/src/config-pi/static/index.js +13 -13
- package/src/deployment-pi/index.js +10 -10
- package/src/deployment-pi/origins/index.js +215 -215
- package/src/index.js +19 -19
- package/src/runtime-pi/Router.js +131 -131
- package/src/runtime-pi/client/Context.js +6 -6
- package/src/runtime-pi/client/Router.js +47 -47
- package/src/runtime-pi/client/Runtime.js +357 -341
- package/src/runtime-pi/client/RuntimeClient.js +98 -98
- package/src/runtime-pi/client/Storage.js +56 -56
- package/src/runtime-pi/client/Url.js +205 -205
- package/src/runtime-pi/client/Workport.js +163 -163
- package/src/runtime-pi/client/generate.js +467 -467
- package/src/runtime-pi/client/index.js +23 -23
- package/src/runtime-pi/client/oohtml/full.js +6 -6
- package/src/runtime-pi/client/oohtml/namespacing.js +6 -6
- package/src/runtime-pi/client/oohtml/scripting.js +7 -7
- package/src/runtime-pi/client/oohtml/templating.js +7 -7
- package/src/runtime-pi/client/whatwag.js +27 -27
- package/src/runtime-pi/client/worker/Context.js +6 -6
- package/src/runtime-pi/client/worker/Worker.js +291 -291
- package/src/runtime-pi/client/worker/WorkerClient.js +46 -46
- package/src/runtime-pi/client/worker/Workport.js +79 -79
- package/src/runtime-pi/client/worker/index.js +23 -23
- package/src/runtime-pi/index.js +13 -13
- package/src/runtime-pi/server/Context.js +15 -15
- package/src/runtime-pi/server/Router.js +157 -157
- package/src/runtime-pi/server/Runtime.js +547 -547
- package/src/runtime-pi/server/RuntimeClient.js +112 -112
- package/src/runtime-pi/server/index.js +23 -23
- package/src/runtime-pi/server/whatwag.js +35 -35
- package/src/runtime-pi/util.js +162 -162
- package/src/runtime-pi/xFormData.js +59 -59
- package/src/runtime-pi/xHeaders.js +87 -87
- package/src/runtime-pi/xHttpEvent.js +92 -92
- package/src/runtime-pi/xHttpMessage.js +179 -179
- package/src/runtime-pi/xRequest.js +73 -73
- package/src/runtime-pi/xRequestHeaders.js +94 -94
- package/src/runtime-pi/xResponse.js +68 -68
- package/src/runtime-pi/xResponseHeaders.js +109 -109
- package/src/runtime-pi/xURL.js +110 -110
- package/src/runtime-pi/xfetch.js +6 -6
- package/src/services-pi/certbot/http-auth-hook.js +22 -22
- package/src/services-pi/certbot/http-cleanup-hook.js +22 -22
- package/src/services-pi/certbot/index.js +79 -79
- package/src/services-pi/index.js +8 -8
- package/src/static-pi/index.js +10 -10
- package/src/webflo.js +31 -31
- package/test/index.test.js +26 -25
- package/test/site/package.json +9 -9
- package/test/site/public/bundle.html +5 -5
- package/test/site/public/bundle.html.json +3 -3
- package/test/site/public/bundle.js +2 -2
- package/test/site/public/bundle.webflo.js +15 -15
- package/test/site/public/index.html +29 -29
- package/test/site/public/index1.html +34 -34
- package/test/site/public/page-2/bundle.html +4 -4
- package/test/site/public/page-2/bundle.js +2 -2
- package/test/site/public/page-2/index.html +45 -45
- package/test/site/public/page-2/main.html +2 -2
- package/test/site/public/page-4/subpage/bundle.js +2 -2
- package/test/site/public/page-4/subpage/index.html +30 -30
- package/test/site/public/sparoots.json +4 -4
- package/test/site/public/worker.js +3 -3
- package/test/site/server/index.js +15 -15
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* imports
|
|
4
|
-
*/
|
|
5
|
-
import Url from 'url';
|
|
6
|
-
import { _merge } from '@webqit/util/obj/index.js';
|
|
7
|
-
import { _isObject } from '@webqit/util/js/index.js';
|
|
8
|
-
import { Dotfile } from '@webqit/backpack';
|
|
9
|
-
|
|
10
|
-
export default class Headers extends Dotfile {
|
|
11
|
-
|
|
12
|
-
// Base name
|
|
13
|
-
get name() {
|
|
14
|
-
return 'headers';
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// @desc
|
|
18
|
-
static get ['@desc']() {
|
|
19
|
-
return 'Automatic headers config.';
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Defaults merger
|
|
23
|
-
withDefaults(config) {
|
|
24
|
-
return _merge(true, {
|
|
25
|
-
entries: [],
|
|
26
|
-
}, config);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Questions generator
|
|
30
|
-
questions(config, choices = {}) {
|
|
31
|
-
const CHOICES = _merge({
|
|
32
|
-
type: [
|
|
33
|
-
{value: 'request', title: 'Request Header'},
|
|
34
|
-
{value: 'response', title: 'Response Header'},
|
|
35
|
-
]
|
|
36
|
-
}, choices);
|
|
37
|
-
// Questions
|
|
38
|
-
return [
|
|
39
|
-
{
|
|
40
|
-
name: 'entries',
|
|
41
|
-
type: 'recursive',
|
|
42
|
-
controls: {
|
|
43
|
-
name: 'header',
|
|
44
|
-
},
|
|
45
|
-
initial: config.entries,
|
|
46
|
-
questions: [
|
|
47
|
-
{
|
|
48
|
-
name: 'type',
|
|
49
|
-
type: 'text',
|
|
50
|
-
message: 'Choose header type',
|
|
51
|
-
validation: ['important'],
|
|
52
|
-
initial: function() { return this.indexOfInitial(CHOICES.type, this.value); },
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
name: 'url',
|
|
56
|
-
type: 'text',
|
|
57
|
-
message: 'Enter URL',
|
|
58
|
-
validation: ['important'],
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: 'name',
|
|
62
|
-
type: 'text',
|
|
63
|
-
message: 'Enter header name',
|
|
64
|
-
validation: ['important'],
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
name: 'value',
|
|
68
|
-
type: 'text',
|
|
69
|
-
message: 'Enter header value',
|
|
70
|
-
validation: ['important'],
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
];
|
|
76
|
-
}
|
|
77
|
-
}
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* imports
|
|
4
|
+
*/
|
|
5
|
+
import Url from 'url';
|
|
6
|
+
import { _merge } from '@webqit/util/obj/index.js';
|
|
7
|
+
import { _isObject } from '@webqit/util/js/index.js';
|
|
8
|
+
import { Dotfile } from '@webqit/backpack';
|
|
9
|
+
|
|
10
|
+
export default class Headers extends Dotfile {
|
|
11
|
+
|
|
12
|
+
// Base name
|
|
13
|
+
get name() {
|
|
14
|
+
return 'headers';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// @desc
|
|
18
|
+
static get ['@desc']() {
|
|
19
|
+
return 'Automatic headers config.';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Defaults merger
|
|
23
|
+
withDefaults(config) {
|
|
24
|
+
return _merge(true, {
|
|
25
|
+
entries: [],
|
|
26
|
+
}, config);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Questions generator
|
|
30
|
+
questions(config, choices = {}) {
|
|
31
|
+
const CHOICES = _merge({
|
|
32
|
+
type: [
|
|
33
|
+
{value: 'request', title: 'Request Header'},
|
|
34
|
+
{value: 'response', title: 'Response Header'},
|
|
35
|
+
]
|
|
36
|
+
}, choices);
|
|
37
|
+
// Questions
|
|
38
|
+
return [
|
|
39
|
+
{
|
|
40
|
+
name: 'entries',
|
|
41
|
+
type: 'recursive',
|
|
42
|
+
controls: {
|
|
43
|
+
name: 'header',
|
|
44
|
+
},
|
|
45
|
+
initial: config.entries,
|
|
46
|
+
questions: [
|
|
47
|
+
{
|
|
48
|
+
name: 'type',
|
|
49
|
+
type: 'text',
|
|
50
|
+
message: 'Choose header type',
|
|
51
|
+
validation: ['important'],
|
|
52
|
+
initial: function() { return this.indexOfInitial(CHOICES.type, this.value); },
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'url',
|
|
56
|
+
type: 'text',
|
|
57
|
+
message: 'Enter URL',
|
|
58
|
+
validation: ['important'],
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'name',
|
|
62
|
+
type: 'text',
|
|
63
|
+
message: 'Enter header name',
|
|
64
|
+
validation: ['important'],
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'value',
|
|
68
|
+
type: 'text',
|
|
69
|
+
message: 'Enter header value',
|
|
70
|
+
validation: ['important'],
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* imports
|
|
4
|
-
*/
|
|
5
|
-
import Url from 'url';
|
|
6
|
-
import { _merge } from '@webqit/util/obj/index.js';
|
|
7
|
-
import { _after } from '@webqit/util/str/index.js';
|
|
8
|
-
import { _isObject, _isNumeric } from '@webqit/util/js/index.js';
|
|
9
|
-
import { Dotfile } from '@webqit/backpack';
|
|
10
|
-
|
|
11
|
-
export default class Redirects extends Dotfile {
|
|
12
|
-
|
|
13
|
-
// Base name
|
|
14
|
-
get name() {
|
|
15
|
-
return 'redirects';
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// @desc
|
|
19
|
-
static get ['@desc']() {
|
|
20
|
-
return 'Automatic redirects config.';
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// Defaults merger
|
|
24
|
-
withDefaults(config) {
|
|
25
|
-
return _merge(true, {
|
|
26
|
-
entries: [],
|
|
27
|
-
}, config);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Questions generator
|
|
31
|
-
questions(config, choices = {}) {
|
|
32
|
-
// Choices
|
|
33
|
-
const CHOICES = _merge({
|
|
34
|
-
code: [
|
|
35
|
-
{value: 302,},
|
|
36
|
-
{value: 301,},
|
|
37
|
-
],
|
|
38
|
-
}, choices);
|
|
39
|
-
// Questions
|
|
40
|
-
return [
|
|
41
|
-
{
|
|
42
|
-
name: 'entries',
|
|
43
|
-
type: 'recursive',
|
|
44
|
-
controls: {
|
|
45
|
-
name: 'redirect',
|
|
46
|
-
},
|
|
47
|
-
initial: config.entries,
|
|
48
|
-
questions: [
|
|
49
|
-
{
|
|
50
|
-
name: 'from',
|
|
51
|
-
type: 'text',
|
|
52
|
-
message: 'Enter "from" URL',
|
|
53
|
-
validation: ['important'],
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
name: 'to',
|
|
57
|
-
type: 'text',
|
|
58
|
-
message: 'Enter "to" URL',
|
|
59
|
-
validation: ['important'],
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: 'code',
|
|
63
|
-
type: 'select',
|
|
64
|
-
choices: CHOICES.code,
|
|
65
|
-
message: 'Enter redirect code',
|
|
66
|
-
validation: ['number'],
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
];
|
|
72
|
-
}
|
|
73
|
-
}
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* imports
|
|
4
|
+
*/
|
|
5
|
+
import Url from 'url';
|
|
6
|
+
import { _merge } from '@webqit/util/obj/index.js';
|
|
7
|
+
import { _after } from '@webqit/util/str/index.js';
|
|
8
|
+
import { _isObject, _isNumeric } from '@webqit/util/js/index.js';
|
|
9
|
+
import { Dotfile } from '@webqit/backpack';
|
|
10
|
+
|
|
11
|
+
export default class Redirects extends Dotfile {
|
|
12
|
+
|
|
13
|
+
// Base name
|
|
14
|
+
get name() {
|
|
15
|
+
return 'redirects';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// @desc
|
|
19
|
+
static get ['@desc']() {
|
|
20
|
+
return 'Automatic redirects config.';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Defaults merger
|
|
24
|
+
withDefaults(config) {
|
|
25
|
+
return _merge(true, {
|
|
26
|
+
entries: [],
|
|
27
|
+
}, config);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Questions generator
|
|
31
|
+
questions(config, choices = {}) {
|
|
32
|
+
// Choices
|
|
33
|
+
const CHOICES = _merge({
|
|
34
|
+
code: [
|
|
35
|
+
{value: 302,},
|
|
36
|
+
{value: 301,},
|
|
37
|
+
],
|
|
38
|
+
}, choices);
|
|
39
|
+
// Questions
|
|
40
|
+
return [
|
|
41
|
+
{
|
|
42
|
+
name: 'entries',
|
|
43
|
+
type: 'recursive',
|
|
44
|
+
controls: {
|
|
45
|
+
name: 'redirect',
|
|
46
|
+
},
|
|
47
|
+
initial: config.entries,
|
|
48
|
+
questions: [
|
|
49
|
+
{
|
|
50
|
+
name: 'from',
|
|
51
|
+
type: 'text',
|
|
52
|
+
message: 'Enter "from" URL',
|
|
53
|
+
validation: ['important'],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'to',
|
|
57
|
+
type: 'text',
|
|
58
|
+
message: 'Enter "to" URL',
|
|
59
|
+
validation: ['important'],
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'code',
|
|
63
|
+
type: 'select',
|
|
64
|
+
choices: CHOICES.code,
|
|
65
|
+
message: 'Enter redirect code',
|
|
66
|
+
validation: ['number'],
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @imports
|
|
4
|
-
*/
|
|
5
|
-
import Headers from './Headers.js';
|
|
6
|
-
import Redirects from './Redirects.js';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @exports
|
|
10
|
-
*/
|
|
11
|
-
export {
|
|
12
|
-
Headers,
|
|
13
|
-
Redirects,
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* @imports
|
|
4
|
+
*/
|
|
5
|
+
import Headers from './Headers.js';
|
|
6
|
+
import Redirects from './Redirects.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @exports
|
|
10
|
+
*/
|
|
11
|
+
export {
|
|
12
|
+
Headers,
|
|
13
|
+
Redirects,
|
|
14
14
|
}
|