@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,133 +1,133 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* imports
|
|
4
|
-
*/
|
|
5
|
-
import Url from 'url';
|
|
6
|
-
import { _merge } from '@webqit/util/obj/index.js';
|
|
7
|
-
import { _before } from '@webqit/util/str/index.js';
|
|
8
|
-
import { _isObject, _isTypeObject } from '@webqit/util/js/index.js';
|
|
9
|
-
import { Dotfile } from '@webqit/backpack';
|
|
10
|
-
|
|
11
|
-
export default class Origins extends Dotfile {
|
|
12
|
-
|
|
13
|
-
// Base name
|
|
14
|
-
get name() {
|
|
15
|
-
return 'origins';
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// @desc
|
|
19
|
-
static get ['@desc']() {
|
|
20
|
-
return 'Remote origins config.';
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// Defaults merger
|
|
24
|
-
withDefaults(config) {
|
|
25
|
-
let hostname = '', origin = '';
|
|
26
|
-
if (this.cx.PKG && this.cx.PKG.repository) {
|
|
27
|
-
var inferredRepo = Url.parse(_isTypeObject(this.cx.PKG.repository) ? this.cx.PKG.repository.url : this.cx.PKG.repository);
|
|
28
|
-
hostname = _before(inferredRepo.hostname, '.');
|
|
29
|
-
origin = _before(inferredRepo.pathname, '.');
|
|
30
|
-
}
|
|
31
|
-
// Params
|
|
32
|
-
return _merge({
|
|
33
|
-
entries: [{
|
|
34
|
-
host: hostname,
|
|
35
|
-
repo: origin,
|
|
36
|
-
branch: 'master',
|
|
37
|
-
tag: 'root',
|
|
38
|
-
deploy_path: '.',
|
|
39
|
-
autodeploy: true,
|
|
40
|
-
autodeploy_secret: '',
|
|
41
|
-
ondeploy: 'npm install',
|
|
42
|
-
ondeploy_autoexit: true,
|
|
43
|
-
}],
|
|
44
|
-
}, config);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Match
|
|
48
|
-
async match(url) {
|
|
49
|
-
return ((await this.read()).entries || []).filter(_origin => _origin.tag.toLowerCase() === url.toLowerCase() || _origin.repo.toLowerCase() === url.toLowerCase());
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Questions generator
|
|
53
|
-
questions(config, choices = {}) {
|
|
54
|
-
// Choices
|
|
55
|
-
const CHOICES = _merge({
|
|
56
|
-
host: [
|
|
57
|
-
{value: 'github',},
|
|
58
|
-
{value: 'bitbucket',},
|
|
59
|
-
],
|
|
60
|
-
}, choices);
|
|
61
|
-
// Questions
|
|
62
|
-
return [
|
|
63
|
-
{
|
|
64
|
-
name: 'entries',
|
|
65
|
-
type: 'recursive',
|
|
66
|
-
controls: {
|
|
67
|
-
name: 'repository',
|
|
68
|
-
},
|
|
69
|
-
initial: config.entries,
|
|
70
|
-
questions: [
|
|
71
|
-
{
|
|
72
|
-
name: 'host',
|
|
73
|
-
type: 'select',
|
|
74
|
-
message: 'Host name',
|
|
75
|
-
choices: CHOICES.host,
|
|
76
|
-
validation: ['input', 'important'],
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
name: 'repo',
|
|
80
|
-
type: 'text',
|
|
81
|
-
message: 'Enter a repository name (in the format: user-or-org/origin)',
|
|
82
|
-
validation: ['input', 'important'],
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
name: 'branch',
|
|
86
|
-
type: 'text',
|
|
87
|
-
message: 'Specifiy the git branch within the given repository',
|
|
88
|
-
validation: ['input', 'important'],
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
name: 'tag',
|
|
92
|
-
type: 'text',
|
|
93
|
-
message: 'Enter a local name for this origin',
|
|
94
|
-
validation: ['input', 'important'],
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
name: 'deploy_path',
|
|
98
|
-
type: 'text',
|
|
99
|
-
message: 'Enter the relative local path that this origin deploys to',
|
|
100
|
-
validation: ['important'],
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
name: 'autodeploy',
|
|
104
|
-
type: 'toggle',
|
|
105
|
-
message: 'Auto-deploy this origin on every push to branch?',
|
|
106
|
-
active: 'YES',
|
|
107
|
-
inactive: 'NO',
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: 'autodeploy_secret',
|
|
111
|
-
type: (prev, ans) => ans.autodeploy ? 'text' : null,
|
|
112
|
-
message: 'Enter the "secret" for validating the auto-deploy webhook event',
|
|
113
|
-
validation: ['input', 'important'],
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
name: 'ondeploy',
|
|
117
|
-
type: 'text',
|
|
118
|
-
message: 'Enter an optional "command" to run on deploy',
|
|
119
|
-
validation: ['input', 'important'],
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
name: 'ondeploy_autoexit',
|
|
123
|
-
type: (prev, ans) => ans.autodeploy ? 'toggle' : null,
|
|
124
|
-
message: 'Auto exit process on deploy?',
|
|
125
|
-
active: 'YES',
|
|
126
|
-
inactive: 'NO',
|
|
127
|
-
},
|
|
128
|
-
],
|
|
129
|
-
},
|
|
130
|
-
|
|
131
|
-
];
|
|
132
|
-
}
|
|
133
|
-
}
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* imports
|
|
4
|
+
*/
|
|
5
|
+
import Url from 'url';
|
|
6
|
+
import { _merge } from '@webqit/util/obj/index.js';
|
|
7
|
+
import { _before } from '@webqit/util/str/index.js';
|
|
8
|
+
import { _isObject, _isTypeObject } from '@webqit/util/js/index.js';
|
|
9
|
+
import { Dotfile } from '@webqit/backpack';
|
|
10
|
+
|
|
11
|
+
export default class Origins extends Dotfile {
|
|
12
|
+
|
|
13
|
+
// Base name
|
|
14
|
+
get name() {
|
|
15
|
+
return 'origins';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// @desc
|
|
19
|
+
static get ['@desc']() {
|
|
20
|
+
return 'Remote origins config.';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Defaults merger
|
|
24
|
+
withDefaults(config) {
|
|
25
|
+
let hostname = '', origin = '';
|
|
26
|
+
if (this.cx.PKG && this.cx.PKG.repository) {
|
|
27
|
+
var inferredRepo = Url.parse(_isTypeObject(this.cx.PKG.repository) ? this.cx.PKG.repository.url : this.cx.PKG.repository);
|
|
28
|
+
hostname = _before(inferredRepo.hostname, '.');
|
|
29
|
+
origin = _before(inferredRepo.pathname, '.');
|
|
30
|
+
}
|
|
31
|
+
// Params
|
|
32
|
+
return _merge({
|
|
33
|
+
entries: [{
|
|
34
|
+
host: hostname,
|
|
35
|
+
repo: origin,
|
|
36
|
+
branch: 'master',
|
|
37
|
+
tag: 'root',
|
|
38
|
+
deploy_path: '.',
|
|
39
|
+
autodeploy: true,
|
|
40
|
+
autodeploy_secret: '',
|
|
41
|
+
ondeploy: 'npm install',
|
|
42
|
+
ondeploy_autoexit: true,
|
|
43
|
+
}],
|
|
44
|
+
}, config);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Match
|
|
48
|
+
async match(url) {
|
|
49
|
+
return ((await this.read()).entries || []).filter(_origin => _origin.tag.toLowerCase() === url.toLowerCase() || _origin.repo.toLowerCase() === url.toLowerCase());
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Questions generator
|
|
53
|
+
questions(config, choices = {}) {
|
|
54
|
+
// Choices
|
|
55
|
+
const CHOICES = _merge({
|
|
56
|
+
host: [
|
|
57
|
+
{value: 'github',},
|
|
58
|
+
{value: 'bitbucket',},
|
|
59
|
+
],
|
|
60
|
+
}, choices);
|
|
61
|
+
// Questions
|
|
62
|
+
return [
|
|
63
|
+
{
|
|
64
|
+
name: 'entries',
|
|
65
|
+
type: 'recursive',
|
|
66
|
+
controls: {
|
|
67
|
+
name: 'repository',
|
|
68
|
+
},
|
|
69
|
+
initial: config.entries,
|
|
70
|
+
questions: [
|
|
71
|
+
{
|
|
72
|
+
name: 'host',
|
|
73
|
+
type: 'select',
|
|
74
|
+
message: 'Host name',
|
|
75
|
+
choices: CHOICES.host,
|
|
76
|
+
validation: ['input', 'important'],
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'repo',
|
|
80
|
+
type: 'text',
|
|
81
|
+
message: 'Enter a repository name (in the format: user-or-org/origin)',
|
|
82
|
+
validation: ['input', 'important'],
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'branch',
|
|
86
|
+
type: 'text',
|
|
87
|
+
message: 'Specifiy the git branch within the given repository',
|
|
88
|
+
validation: ['input', 'important'],
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'tag',
|
|
92
|
+
type: 'text',
|
|
93
|
+
message: 'Enter a local name for this origin',
|
|
94
|
+
validation: ['input', 'important'],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: 'deploy_path',
|
|
98
|
+
type: 'text',
|
|
99
|
+
message: 'Enter the relative local path that this origin deploys to',
|
|
100
|
+
validation: ['important'],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'autodeploy',
|
|
104
|
+
type: 'toggle',
|
|
105
|
+
message: 'Auto-deploy this origin on every push to branch?',
|
|
106
|
+
active: 'YES',
|
|
107
|
+
inactive: 'NO',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: 'autodeploy_secret',
|
|
111
|
+
type: (prev, ans) => ans.autodeploy ? 'text' : null,
|
|
112
|
+
message: 'Enter the "secret" for validating the auto-deploy webhook event',
|
|
113
|
+
validation: ['input', 'important'],
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'ondeploy',
|
|
117
|
+
type: 'text',
|
|
118
|
+
message: 'Enter an optional "command" to run on deploy',
|
|
119
|
+
validation: ['input', 'important'],
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'ondeploy_autoexit',
|
|
123
|
+
type: (prev, ans) => ans.autodeploy ? 'toggle' : null,
|
|
124
|
+
message: 'Auto exit process on deploy?',
|
|
125
|
+
active: 'YES',
|
|
126
|
+
inactive: 'NO',
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
];
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* imports
|
|
4
|
-
*/
|
|
5
|
-
import { _merge } from '@webqit/util/obj/index.js';
|
|
6
|
-
import { _isObject } from '@webqit/util/js/index.js';
|
|
7
|
-
import { Dotfile } from '@webqit/backpack';
|
|
8
|
-
|
|
9
|
-
export default class Virtualization extends Dotfile {
|
|
10
|
-
|
|
11
|
-
// Base name
|
|
12
|
-
get name() {
|
|
13
|
-
return 'virtualization';
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// @desc
|
|
17
|
-
static get ['@desc']() {
|
|
18
|
-
return 'Layout virtualization config.';
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// Defaults merger
|
|
22
|
-
withDefaults(config) {
|
|
23
|
-
return _merge(true, {
|
|
24
|
-
entries: [],
|
|
25
|
-
}, config);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// Match
|
|
29
|
-
async match(hostname) {
|
|
30
|
-
if (_isObject(hostname)) {
|
|
31
|
-
hostname = hostname.hostname;
|
|
32
|
-
}
|
|
33
|
-
return ((await this.read()).entries || []).filter(vh => vh.host === hostname);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Questions generator
|
|
37
|
-
questions(config, choices = {}) {
|
|
38
|
-
// Questions
|
|
39
|
-
return [
|
|
40
|
-
{
|
|
41
|
-
name: 'entries',
|
|
42
|
-
type: 'recursive',
|
|
43
|
-
controls: {
|
|
44
|
-
name: 'vhost',
|
|
45
|
-
},
|
|
46
|
-
initial: config.entries,
|
|
47
|
-
questions: [
|
|
48
|
-
{
|
|
49
|
-
name: 'host',
|
|
50
|
-
type: 'text',
|
|
51
|
-
message: 'Enter Host name',
|
|
52
|
-
validation: ['important'],
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
name: 'path',
|
|
56
|
-
type: 'text',
|
|
57
|
-
message: 'Enter local path',
|
|
58
|
-
validation: ['important'],
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
];
|
|
64
|
-
}
|
|
65
|
-
}
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* imports
|
|
4
|
+
*/
|
|
5
|
+
import { _merge } from '@webqit/util/obj/index.js';
|
|
6
|
+
import { _isObject } from '@webqit/util/js/index.js';
|
|
7
|
+
import { Dotfile } from '@webqit/backpack';
|
|
8
|
+
|
|
9
|
+
export default class Virtualization extends Dotfile {
|
|
10
|
+
|
|
11
|
+
// Base name
|
|
12
|
+
get name() {
|
|
13
|
+
return 'virtualization';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// @desc
|
|
17
|
+
static get ['@desc']() {
|
|
18
|
+
return 'Layout virtualization config.';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Defaults merger
|
|
22
|
+
withDefaults(config) {
|
|
23
|
+
return _merge(true, {
|
|
24
|
+
entries: [],
|
|
25
|
+
}, config);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Match
|
|
29
|
+
async match(hostname) {
|
|
30
|
+
if (_isObject(hostname)) {
|
|
31
|
+
hostname = hostname.hostname;
|
|
32
|
+
}
|
|
33
|
+
return ((await this.read()).entries || []).filter(vh => vh.host === hostname);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Questions generator
|
|
37
|
+
questions(config, choices = {}) {
|
|
38
|
+
// Questions
|
|
39
|
+
return [
|
|
40
|
+
{
|
|
41
|
+
name: 'entries',
|
|
42
|
+
type: 'recursive',
|
|
43
|
+
controls: {
|
|
44
|
+
name: 'vhost',
|
|
45
|
+
},
|
|
46
|
+
initial: config.entries,
|
|
47
|
+
questions: [
|
|
48
|
+
{
|
|
49
|
+
name: 'host',
|
|
50
|
+
type: 'text',
|
|
51
|
+
message: 'Enter Host name',
|
|
52
|
+
validation: ['important'],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'path',
|
|
56
|
+
type: 'text',
|
|
57
|
+
message: 'Enter local path',
|
|
58
|
+
validation: ['important'],
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* i@mports
|
|
4
|
-
*/
|
|
5
|
-
import Env from './Env.js';
|
|
6
|
-
import Layout from './Layout.js';
|
|
7
|
-
import Origins from './Origins.js';
|
|
8
|
-
import Virtualization from './Virtualization.js';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @exports
|
|
12
|
-
*/
|
|
13
|
-
export {
|
|
14
|
-
Env,
|
|
15
|
-
Layout,
|
|
16
|
-
Origins,
|
|
17
|
-
Virtualization,
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* i@mports
|
|
4
|
+
*/
|
|
5
|
+
import Env from './Env.js';
|
|
6
|
+
import Layout from './Layout.js';
|
|
7
|
+
import Origins from './Origins.js';
|
|
8
|
+
import Virtualization from './Virtualization.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @exports
|
|
12
|
+
*/
|
|
13
|
+
export {
|
|
14
|
+
Env,
|
|
15
|
+
Layout,
|
|
16
|
+
Origins,
|
|
17
|
+
Virtualization,
|
|
18
18
|
}
|
package/src/config-pi/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @imports
|
|
4
|
-
*/
|
|
5
|
-
import * as deployment from './deployment/index.js';
|
|
6
|
-
import * as runtime from './runtime/index.js';
|
|
7
|
-
import * as $static from './static/index.js';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @exports
|
|
11
|
-
*/
|
|
12
|
-
export {
|
|
13
|
-
deployment,
|
|
14
|
-
runtime,
|
|
15
|
-
$static as static,
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* @imports
|
|
4
|
+
*/
|
|
5
|
+
import * as deployment from './deployment/index.js';
|
|
6
|
+
import * as runtime from './runtime/index.js';
|
|
7
|
+
import * as $static from './static/index.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @exports
|
|
11
|
+
*/
|
|
12
|
+
export {
|
|
13
|
+
deployment,
|
|
14
|
+
runtime,
|
|
15
|
+
$static as static,
|
|
16
16
|
}
|
|
@@ -1,101 +1,101 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* imports
|
|
4
|
-
*/
|
|
5
|
-
import { _merge } from '@webqit/util/obj/index.js';
|
|
6
|
-
import { _isNumeric } from '@webqit/util/js/index.js';
|
|
7
|
-
import { _before, _after } from '@webqit/util/str/index.js';
|
|
8
|
-
import { Dotfile } from '@webqit/backpack';
|
|
9
|
-
|
|
10
|
-
export default class Client extends Dotfile {
|
|
11
|
-
|
|
12
|
-
// Base name
|
|
13
|
-
get name() {
|
|
14
|
-
return 'client';
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// @desc
|
|
18
|
-
static get ['@desc']() {
|
|
19
|
-
return 'Client Runtime config.';
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Defaults merger
|
|
23
|
-
withDefaults(config) {
|
|
24
|
-
return _merge(true, {
|
|
25
|
-
bundle_filename: 'bundle.js',
|
|
26
|
-
public_base_url: '/',
|
|
27
|
-
spa_routing: true,
|
|
28
|
-
oohtml_support: 'full',
|
|
29
|
-
service_worker_support: true,
|
|
30
|
-
worker_scope: '/',
|
|
31
|
-
worker_filename: 'worker.js',
|
|
32
|
-
}, config);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Questions generator
|
|
36
|
-
questions(config, choices = {}) {
|
|
37
|
-
// Choices
|
|
38
|
-
const CHOICES = _merge({
|
|
39
|
-
oohtml_support: [
|
|
40
|
-
{value: 'full', title: 'Full'},
|
|
41
|
-
{value: 'namespacing', title: 'namespacing'},
|
|
42
|
-
{value: 'scripting', title: 'scripting'},
|
|
43
|
-
{value: 'templating', title: 'templating'},
|
|
44
|
-
{value: 'none', title: 'none'},
|
|
45
|
-
],
|
|
46
|
-
}, choices);
|
|
47
|
-
// Questions
|
|
48
|
-
return [
|
|
49
|
-
{
|
|
50
|
-
name: 'bundle_filename',
|
|
51
|
-
type: 'text',
|
|
52
|
-
message: 'Specify the bundle filename',
|
|
53
|
-
initial: config.bundle_filename,
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
name: 'public_base_url',
|
|
57
|
-
type: 'text',
|
|
58
|
-
message: '[public_base_url]: Enter the base-URL for public resource URLs',
|
|
59
|
-
initial: DATA.public_base_url,
|
|
60
|
-
validation: ['important'],
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
name: 'spa_routing',
|
|
64
|
-
type: 'toggle',
|
|
65
|
-
message: '[spa_routing]: Enable Single Page Routing Mode',
|
|
66
|
-
active: 'YES',
|
|
67
|
-
inactive: 'NO',
|
|
68
|
-
initial: config.spa_routing,
|
|
69
|
-
validation: ['important'],
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
name: 'oohtml_support',
|
|
73
|
-
type: 'select',
|
|
74
|
-
message: '[oohtml_support]: (Adds OOHTML to your app\'s bundle.) Specify OOHTML support level',
|
|
75
|
-
choices: CHOICES.oohtml_support,
|
|
76
|
-
initial: this.indexOfInitial(CHOICES.oohtml_support, config.oohtml_support),
|
|
77
|
-
validation: ['important'],
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: 'service_worker_support',
|
|
81
|
-
type: 'toggle',
|
|
82
|
-
message: 'Support Service Worker?',
|
|
83
|
-
active: 'YES',
|
|
84
|
-
inactive: 'NO',
|
|
85
|
-
initial: config.service_worker_support,
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
name: 'worker_scope',
|
|
89
|
-
type: (prev, answers) => answers.service_worker_support ? 'text' : null,
|
|
90
|
-
message: 'Specify the Service Worker scope',
|
|
91
|
-
initial: config.worker_scope,
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
name: 'worker_filename',
|
|
95
|
-
type: (prev, answers) => answers.service_worker_support ? 'text' : null,
|
|
96
|
-
message: 'Specify the Service Worker filename',
|
|
97
|
-
initial: config.worker_filename,
|
|
98
|
-
},
|
|
99
|
-
];
|
|
100
|
-
}
|
|
101
|
-
}
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* imports
|
|
4
|
+
*/
|
|
5
|
+
import { _merge } from '@webqit/util/obj/index.js';
|
|
6
|
+
import { _isNumeric } from '@webqit/util/js/index.js';
|
|
7
|
+
import { _before, _after } from '@webqit/util/str/index.js';
|
|
8
|
+
import { Dotfile } from '@webqit/backpack';
|
|
9
|
+
|
|
10
|
+
export default class Client extends Dotfile {
|
|
11
|
+
|
|
12
|
+
// Base name
|
|
13
|
+
get name() {
|
|
14
|
+
return 'client';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// @desc
|
|
18
|
+
static get ['@desc']() {
|
|
19
|
+
return 'Client Runtime config.';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Defaults merger
|
|
23
|
+
withDefaults(config) {
|
|
24
|
+
return _merge(true, {
|
|
25
|
+
bundle_filename: 'bundle.js',
|
|
26
|
+
public_base_url: '/',
|
|
27
|
+
spa_routing: true,
|
|
28
|
+
oohtml_support: 'full',
|
|
29
|
+
service_worker_support: true,
|
|
30
|
+
worker_scope: '/',
|
|
31
|
+
worker_filename: 'worker.js',
|
|
32
|
+
}, config);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Questions generator
|
|
36
|
+
questions(config, choices = {}) {
|
|
37
|
+
// Choices
|
|
38
|
+
const CHOICES = _merge({
|
|
39
|
+
oohtml_support: [
|
|
40
|
+
{value: 'full', title: 'Full'},
|
|
41
|
+
{value: 'namespacing', title: 'namespacing'},
|
|
42
|
+
{value: 'scripting', title: 'scripting'},
|
|
43
|
+
{value: 'templating', title: 'templating'},
|
|
44
|
+
{value: 'none', title: 'none'},
|
|
45
|
+
],
|
|
46
|
+
}, choices);
|
|
47
|
+
// Questions
|
|
48
|
+
return [
|
|
49
|
+
{
|
|
50
|
+
name: 'bundle_filename',
|
|
51
|
+
type: 'text',
|
|
52
|
+
message: 'Specify the bundle filename',
|
|
53
|
+
initial: config.bundle_filename,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'public_base_url',
|
|
57
|
+
type: 'text',
|
|
58
|
+
message: '[public_base_url]: Enter the base-URL for public resource URLs',
|
|
59
|
+
initial: DATA.public_base_url,
|
|
60
|
+
validation: ['important'],
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'spa_routing',
|
|
64
|
+
type: 'toggle',
|
|
65
|
+
message: '[spa_routing]: Enable Single Page Routing Mode',
|
|
66
|
+
active: 'YES',
|
|
67
|
+
inactive: 'NO',
|
|
68
|
+
initial: config.spa_routing,
|
|
69
|
+
validation: ['important'],
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'oohtml_support',
|
|
73
|
+
type: 'select',
|
|
74
|
+
message: '[oohtml_support]: (Adds OOHTML to your app\'s bundle.) Specify OOHTML support level',
|
|
75
|
+
choices: CHOICES.oohtml_support,
|
|
76
|
+
initial: this.indexOfInitial(CHOICES.oohtml_support, config.oohtml_support),
|
|
77
|
+
validation: ['important'],
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'service_worker_support',
|
|
81
|
+
type: 'toggle',
|
|
82
|
+
message: 'Support Service Worker?',
|
|
83
|
+
active: 'YES',
|
|
84
|
+
inactive: 'NO',
|
|
85
|
+
initial: config.service_worker_support,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'worker_scope',
|
|
89
|
+
type: (prev, answers) => answers.service_worker_support ? 'text' : null,
|
|
90
|
+
message: 'Specify the Service Worker scope',
|
|
91
|
+
initial: config.worker_scope,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: 'worker_filename',
|
|
95
|
+
type: (prev, answers) => answers.service_worker_support ? 'text' : null,
|
|
96
|
+
message: 'Specify the Service Worker filename',
|
|
97
|
+
initial: config.worker_filename,
|
|
98
|
+
},
|
|
99
|
+
];
|
|
100
|
+
}
|
|
101
|
+
}
|