@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
package/package.json
CHANGED
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@webqit/webflo",
|
|
3
|
-
"title": "Webflo",
|
|
4
|
-
"description": "The universal, fullstack JavaScript framework.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"git-workflow",
|
|
7
|
-
"self-hosting",
|
|
8
|
-
"automatic-deployment",
|
|
9
|
-
"command-line-interface",
|
|
10
|
-
"progressive-web-apps",
|
|
11
|
-
"single-page-apps",
|
|
12
|
-
"vanila-javascript"
|
|
13
|
-
],
|
|
14
|
-
"homepage": "https://webqit.io/tooling/webflo",
|
|
15
|
-
"version": "0.11.
|
|
16
|
-
"license": "MIT",
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/webqit/webflo.git"
|
|
20
|
-
},
|
|
21
|
-
"bugs": {
|
|
22
|
-
"url": "https://github.com/webqit/webflo/issues"
|
|
23
|
-
},
|
|
24
|
-
"type": "module",
|
|
25
|
-
"main": "./src/index.js",
|
|
26
|
-
"scripts": {
|
|
27
|
-
"test": "mocha --extension .test.js --exit",
|
|
28
|
-
"test:coverage": "c8 --reporter=text-lcov npm run test | coveralls",
|
|
29
|
-
"postversion": "npm publish",
|
|
30
|
-
"postpublish": "git push && git push --tags"
|
|
31
|
-
},
|
|
32
|
-
"bin": {
|
|
33
|
-
"webflo": "src/webflo.js",
|
|
34
|
-
"webflo-certbot-http-auth-hook": "src/services/certbot/http-auth-hook.js",
|
|
35
|
-
"webflo-certbot-http-cleanup-hook": "src/services/certbot/http-cleanup-hook.js"
|
|
36
|
-
},
|
|
37
|
-
"dependencies": {
|
|
38
|
-
"@octokit/webhooks": "^7.15.1",
|
|
39
|
-
"@webqit/backpack": "^0.1.2",
|
|
40
|
-
"@webqit/oohtml-ssr": "^1.1.0",
|
|
41
|
-
"@webqit/util": "^0.8.9",
|
|
42
|
-
"client-sessions": "^0.8.0",
|
|
43
|
-
"esbuild": "^0.14.38",
|
|
44
|
-
"form-data-encoder": "^1.6.0",
|
|
45
|
-
"formdata-node": "^4.3.0",
|
|
46
|
-
"formidable": "^2.0.0-dev.20200131.2",
|
|
47
|
-
"mime-types": "^2.1.33",
|
|
48
|
-
"node-fetch": "^2.6.1",
|
|
49
|
-
"simple-git": "^2.20.1",
|
|
50
|
-
"stream-slice": "^0.1.2",
|
|
51
|
-
"urlpattern-polyfill": "^4.0.3"
|
|
52
|
-
},
|
|
53
|
-
"devDependencies": {
|
|
54
|
-
"chai": "^4.3.6",
|
|
55
|
-
"coveralls": "^3.1.1",
|
|
56
|
-
"mocha": "^10.0.0",
|
|
57
|
-
"mocha-lcov-reporter": "^1.3.0"
|
|
58
|
-
},
|
|
59
|
-
"author": "Oxford Harrison <oxharris.dev@gmail.com>",
|
|
60
|
-
"maintainers": [
|
|
61
|
-
"Oxford Harrison <oxharris.dev@gmail.com>"
|
|
62
|
-
],
|
|
63
|
-
"contributors": [],
|
|
64
|
-
"funding": {
|
|
65
|
-
"type": "patreon",
|
|
66
|
-
"url": "https://patreon.com/ox_harris"
|
|
67
|
-
},
|
|
68
|
-
"badges": {
|
|
69
|
-
"list": [
|
|
70
|
-
"npmversion",
|
|
71
|
-
"npmdownloads",
|
|
72
|
-
"patreon"
|
|
73
|
-
],
|
|
74
|
-
"config": {
|
|
75
|
-
"patreonUsername": "ox_harris",
|
|
76
|
-
"githubUsername": "webqit",
|
|
77
|
-
"githubRepository": "webflo",
|
|
78
|
-
"githubSlug": "webqit/webflo",
|
|
79
|
-
"npmPackageName": "@webqit/webflo"
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@webqit/webflo",
|
|
3
|
+
"title": "Webflo",
|
|
4
|
+
"description": "The universal, fullstack JavaScript framework.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"git-workflow",
|
|
7
|
+
"self-hosting",
|
|
8
|
+
"automatic-deployment",
|
|
9
|
+
"command-line-interface",
|
|
10
|
+
"progressive-web-apps",
|
|
11
|
+
"single-page-apps",
|
|
12
|
+
"vanila-javascript"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://webqit.io/tooling/webflo",
|
|
15
|
+
"version": "0.11.24",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/webqit/webflo.git"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/webqit/webflo/issues"
|
|
23
|
+
},
|
|
24
|
+
"type": "module",
|
|
25
|
+
"main": "./src/index.js",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"test": "mocha --extension .test.js --exit",
|
|
28
|
+
"test:coverage": "c8 --reporter=text-lcov npm run test | coveralls",
|
|
29
|
+
"postversion": "npm publish",
|
|
30
|
+
"postpublish": "git push && git push --tags"
|
|
31
|
+
},
|
|
32
|
+
"bin": {
|
|
33
|
+
"webflo": "src/webflo.js",
|
|
34
|
+
"webflo-certbot-http-auth-hook": "src/services/certbot/http-auth-hook.js",
|
|
35
|
+
"webflo-certbot-http-cleanup-hook": "src/services/certbot/http-cleanup-hook.js"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@octokit/webhooks": "^7.15.1",
|
|
39
|
+
"@webqit/backpack": "^0.1.2",
|
|
40
|
+
"@webqit/oohtml-ssr": "^1.1.0",
|
|
41
|
+
"@webqit/util": "^0.8.9",
|
|
42
|
+
"client-sessions": "^0.8.0",
|
|
43
|
+
"esbuild": "^0.14.38",
|
|
44
|
+
"form-data-encoder": "^1.6.0",
|
|
45
|
+
"formdata-node": "^4.3.0",
|
|
46
|
+
"formidable": "^2.0.0-dev.20200131.2",
|
|
47
|
+
"mime-types": "^2.1.33",
|
|
48
|
+
"node-fetch": "^2.6.1",
|
|
49
|
+
"simple-git": "^2.20.1",
|
|
50
|
+
"stream-slice": "^0.1.2",
|
|
51
|
+
"urlpattern-polyfill": "^4.0.3"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"chai": "^4.3.6",
|
|
55
|
+
"coveralls": "^3.1.1",
|
|
56
|
+
"mocha": "^10.0.0",
|
|
57
|
+
"mocha-lcov-reporter": "^1.3.0"
|
|
58
|
+
},
|
|
59
|
+
"author": "Oxford Harrison <oxharris.dev@gmail.com>",
|
|
60
|
+
"maintainers": [
|
|
61
|
+
"Oxford Harrison <oxharris.dev@gmail.com>"
|
|
62
|
+
],
|
|
63
|
+
"contributors": [],
|
|
64
|
+
"funding": {
|
|
65
|
+
"type": "patreon",
|
|
66
|
+
"url": "https://patreon.com/ox_harris"
|
|
67
|
+
},
|
|
68
|
+
"badges": {
|
|
69
|
+
"list": [
|
|
70
|
+
"npmversion",
|
|
71
|
+
"npmdownloads",
|
|
72
|
+
"patreon"
|
|
73
|
+
],
|
|
74
|
+
"config": {
|
|
75
|
+
"patreonUsername": "ox_harris",
|
|
76
|
+
"githubUsername": "webqit",
|
|
77
|
+
"githubRepository": "webflo",
|
|
78
|
+
"githubSlug": "webqit/webflo",
|
|
79
|
+
"npmPackageName": "@webqit/webflo"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
package/src/Context.js
CHANGED
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
export default class Context {
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Initializes a context.
|
|
6
|
-
*
|
|
7
|
-
* @param Object dict
|
|
8
|
-
* @param String CD
|
|
9
|
-
*/
|
|
10
|
-
constructor(dict, CD = null) {
|
|
11
|
-
// dict can be plain object or some Context instance itself
|
|
12
|
-
// Using it as only a prototype protects it from being mutated down here
|
|
13
|
-
Object.defineProperty(this, 'dict', { value: Object.create(dict), });
|
|
14
|
-
// Now, for enumerable props thet need to be enumerable, where no getter/setter on both instances
|
|
15
|
-
for (let prop in this.dict) {
|
|
16
|
-
if (prop in this) continue;
|
|
17
|
-
this[prop] = this.dict[prop];
|
|
18
|
-
}
|
|
19
|
-
if (arguments.length > 1) {
|
|
20
|
-
Object.defineProperty(this.dict, 'CWD', { get: () => CD });
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
get name() {
|
|
25
|
-
return 'webflo';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// create
|
|
29
|
-
static create(...args) {
|
|
30
|
-
return new this(...args);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// CWD
|
|
34
|
-
get CWD() {
|
|
35
|
-
return this.dict.CWD || '';
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// meta
|
|
39
|
-
get meta() {
|
|
40
|
-
return this.dict.meta || {};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// app
|
|
44
|
-
get app() {
|
|
45
|
-
return this.dict.app || {};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// config
|
|
49
|
-
get config() {
|
|
50
|
-
return this.dict.config || {};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// flags
|
|
54
|
-
get flags() {
|
|
55
|
-
return this.dict.flags || {};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
set flags(value) {
|
|
59
|
-
this.dict.flags = value;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// layout
|
|
63
|
-
get layout() {
|
|
64
|
-
return this.dict.layout || {};
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
set layout(value) {
|
|
68
|
-
this.dict.layout = value;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// logger
|
|
72
|
-
get logger() {
|
|
73
|
-
return this.dict.logger;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
set logger(value) {
|
|
77
|
-
this.dict.logger = value;
|
|
78
|
-
}
|
|
79
|
-
|
|
1
|
+
|
|
2
|
+
export default class Context {
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Initializes a context.
|
|
6
|
+
*
|
|
7
|
+
* @param Object dict
|
|
8
|
+
* @param String CD
|
|
9
|
+
*/
|
|
10
|
+
constructor(dict, CD = null) {
|
|
11
|
+
// dict can be plain object or some Context instance itself
|
|
12
|
+
// Using it as only a prototype protects it from being mutated down here
|
|
13
|
+
Object.defineProperty(this, 'dict', { value: Object.create(dict), });
|
|
14
|
+
// Now, for enumerable props thet need to be enumerable, where no getter/setter on both instances
|
|
15
|
+
for (let prop in this.dict) {
|
|
16
|
+
if (prop in this) continue;
|
|
17
|
+
this[prop] = this.dict[prop];
|
|
18
|
+
}
|
|
19
|
+
if (arguments.length > 1) {
|
|
20
|
+
Object.defineProperty(this.dict, 'CWD', { get: () => CD });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
get name() {
|
|
25
|
+
return 'webflo';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// create
|
|
29
|
+
static create(...args) {
|
|
30
|
+
return new this(...args);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// CWD
|
|
34
|
+
get CWD() {
|
|
35
|
+
return this.dict.CWD || '';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// meta
|
|
39
|
+
get meta() {
|
|
40
|
+
return this.dict.meta || {};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// app
|
|
44
|
+
get app() {
|
|
45
|
+
return this.dict.app || {};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// config
|
|
49
|
+
get config() {
|
|
50
|
+
return this.dict.config || {};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// flags
|
|
54
|
+
get flags() {
|
|
55
|
+
return this.dict.flags || {};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
set flags(value) {
|
|
59
|
+
this.dict.flags = value;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// layout
|
|
63
|
+
get layout() {
|
|
64
|
+
return this.dict.layout || {};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
set layout(value) {
|
|
68
|
+
this.dict.layout = value;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// logger
|
|
72
|
+
get logger() {
|
|
73
|
+
return this.dict.logger;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
set logger(value) {
|
|
77
|
+
this.dict.logger = value;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
80
|
}
|
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* imports
|
|
4
|
-
*/
|
|
5
|
-
import { _merge } from '@webqit/util/obj/index.js';
|
|
6
|
-
import { Dotfile } from '@webqit/backpack';
|
|
7
|
-
|
|
8
|
-
export default class Env extends Dotfile {
|
|
9
|
-
|
|
10
|
-
// Base name
|
|
11
|
-
get name() {
|
|
12
|
-
return 'env';
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// @desc
|
|
16
|
-
static get ['@desc']() {
|
|
17
|
-
return 'Environmental variables config.';
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// isEnv
|
|
21
|
-
get isEnv() {
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Defaults merger
|
|
26
|
-
withDefaults(config) {
|
|
27
|
-
return _merge({
|
|
28
|
-
autoload: true,
|
|
29
|
-
}, config);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// Questions generator
|
|
33
|
-
questions(config, choices = {}) {
|
|
34
|
-
// Questions
|
|
35
|
-
return [
|
|
36
|
-
{
|
|
37
|
-
name: 'entries',
|
|
38
|
-
type: 'recursive',
|
|
39
|
-
controls: {
|
|
40
|
-
name: 'variable',
|
|
41
|
-
combomode: true,
|
|
42
|
-
},
|
|
43
|
-
initial: config.entries,
|
|
44
|
-
questions: [
|
|
45
|
-
{
|
|
46
|
-
name: 'name',
|
|
47
|
-
type: 'text',
|
|
48
|
-
message: 'Name',
|
|
49
|
-
validation: ['important'],
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
name: 'value',
|
|
53
|
-
type: 'text',
|
|
54
|
-
message: 'Value',
|
|
55
|
-
validation: ['important'],
|
|
56
|
-
},
|
|
57
|
-
],
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
name: 'autoload',
|
|
61
|
-
type: 'toggle',
|
|
62
|
-
message: 'Choose whether to autoload variables into "process.env"',
|
|
63
|
-
active: 'YES',
|
|
64
|
-
inactive: 'NO',
|
|
65
|
-
initial: config.autoload,
|
|
66
|
-
},
|
|
67
|
-
];
|
|
68
|
-
}
|
|
69
|
-
}
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* imports
|
|
4
|
+
*/
|
|
5
|
+
import { _merge } from '@webqit/util/obj/index.js';
|
|
6
|
+
import { Dotfile } from '@webqit/backpack';
|
|
7
|
+
|
|
8
|
+
export default class Env extends Dotfile {
|
|
9
|
+
|
|
10
|
+
// Base name
|
|
11
|
+
get name() {
|
|
12
|
+
return 'env';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// @desc
|
|
16
|
+
static get ['@desc']() {
|
|
17
|
+
return 'Environmental variables config.';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// isEnv
|
|
21
|
+
get isEnv() {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Defaults merger
|
|
26
|
+
withDefaults(config) {
|
|
27
|
+
return _merge({
|
|
28
|
+
autoload: true,
|
|
29
|
+
}, config);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Questions generator
|
|
33
|
+
questions(config, choices = {}) {
|
|
34
|
+
// Questions
|
|
35
|
+
return [
|
|
36
|
+
{
|
|
37
|
+
name: 'entries',
|
|
38
|
+
type: 'recursive',
|
|
39
|
+
controls: {
|
|
40
|
+
name: 'variable',
|
|
41
|
+
combomode: true,
|
|
42
|
+
},
|
|
43
|
+
initial: config.entries,
|
|
44
|
+
questions: [
|
|
45
|
+
{
|
|
46
|
+
name: 'name',
|
|
47
|
+
type: 'text',
|
|
48
|
+
message: 'Name',
|
|
49
|
+
validation: ['important'],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'value',
|
|
53
|
+
type: 'text',
|
|
54
|
+
message: 'Value',
|
|
55
|
+
validation: ['important'],
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'autoload',
|
|
61
|
+
type: 'toggle',
|
|
62
|
+
message: 'Choose whether to autoload variables into "process.env"',
|
|
63
|
+
active: 'YES',
|
|
64
|
+
inactive: 'NO',
|
|
65
|
+
initial: config.autoload,
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* imports
|
|
4
|
-
*/
|
|
5
|
-
import { _merge } from '@webqit/util/obj/index.js';
|
|
6
|
-
import { Dotfile } from '@webqit/backpack';
|
|
7
|
-
|
|
8
|
-
export default class Layout extends Dotfile {
|
|
9
|
-
|
|
10
|
-
// Base name
|
|
11
|
-
get name() {
|
|
12
|
-
return 'layout';
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// @desc
|
|
16
|
-
static get ['@desc']() {
|
|
17
|
-
return 'Project layout config.';
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// Defaults merger
|
|
21
|
-
withDefaults(config) {
|
|
22
|
-
return _merge({
|
|
23
|
-
ROOT: process.cwd(),
|
|
24
|
-
PUBLIC_DIR: './public',
|
|
25
|
-
SERVER_DIR: './server',
|
|
26
|
-
CLIENT_DIR: './client',
|
|
27
|
-
WORKER_DIR: './worker',
|
|
28
|
-
}, config);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Questions generator
|
|
32
|
-
questions(config, choices = {}) {
|
|
33
|
-
// Questions
|
|
34
|
-
return [
|
|
35
|
-
{
|
|
36
|
-
name: 'PUBLIC_DIR',
|
|
37
|
-
type: 'text',
|
|
38
|
-
message: 'Enter the application\'s public directory',
|
|
39
|
-
initial: config.PUBLIC_DIR,
|
|
40
|
-
validation: ['important'],
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
name: 'SERVER_DIR',
|
|
44
|
-
type: 'text',
|
|
45
|
-
message: 'Enter the directory for the application\'s server-side route handlers',
|
|
46
|
-
initial: config.SERVER_DIR,
|
|
47
|
-
validation: ['important'],
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
name: 'CLIENT_DIR',
|
|
51
|
-
type: 'text',
|
|
52
|
-
message: 'Enter the directory for the application\'s client-side route handlers',
|
|
53
|
-
initial: config.CLIENT_DIR,
|
|
54
|
-
validation: ['important'],
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: 'WORKER_DIR',
|
|
58
|
-
type: 'text',
|
|
59
|
-
message: 'Enter the directory for the application\'s offline route handlers',
|
|
60
|
-
initial: config.WORKER_DIR,
|
|
61
|
-
validation: ['important'],
|
|
62
|
-
},
|
|
63
|
-
];
|
|
64
|
-
}
|
|
65
|
-
}
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* imports
|
|
4
|
+
*/
|
|
5
|
+
import { _merge } from '@webqit/util/obj/index.js';
|
|
6
|
+
import { Dotfile } from '@webqit/backpack';
|
|
7
|
+
|
|
8
|
+
export default class Layout extends Dotfile {
|
|
9
|
+
|
|
10
|
+
// Base name
|
|
11
|
+
get name() {
|
|
12
|
+
return 'layout';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// @desc
|
|
16
|
+
static get ['@desc']() {
|
|
17
|
+
return 'Project layout config.';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Defaults merger
|
|
21
|
+
withDefaults(config) {
|
|
22
|
+
return _merge({
|
|
23
|
+
ROOT: process.cwd(),
|
|
24
|
+
PUBLIC_DIR: './public',
|
|
25
|
+
SERVER_DIR: './server',
|
|
26
|
+
CLIENT_DIR: './client',
|
|
27
|
+
WORKER_DIR: './worker',
|
|
28
|
+
}, config);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Questions generator
|
|
32
|
+
questions(config, choices = {}) {
|
|
33
|
+
// Questions
|
|
34
|
+
return [
|
|
35
|
+
{
|
|
36
|
+
name: 'PUBLIC_DIR',
|
|
37
|
+
type: 'text',
|
|
38
|
+
message: 'Enter the application\'s public directory',
|
|
39
|
+
initial: config.PUBLIC_DIR,
|
|
40
|
+
validation: ['important'],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'SERVER_DIR',
|
|
44
|
+
type: 'text',
|
|
45
|
+
message: 'Enter the directory for the application\'s server-side route handlers',
|
|
46
|
+
initial: config.SERVER_DIR,
|
|
47
|
+
validation: ['important'],
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'CLIENT_DIR',
|
|
51
|
+
type: 'text',
|
|
52
|
+
message: 'Enter the directory for the application\'s client-side route handlers',
|
|
53
|
+
initial: config.CLIENT_DIR,
|
|
54
|
+
validation: ['important'],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'WORKER_DIR',
|
|
58
|
+
type: 'text',
|
|
59
|
+
message: 'Enter the directory for the application\'s offline route handlers',
|
|
60
|
+
initial: config.WORKER_DIR,
|
|
61
|
+
validation: ['important'],
|
|
62
|
+
},
|
|
63
|
+
];
|
|
64
|
+
}
|
|
65
|
+
}
|