@webqit/webflo 0.11.61-0 → 0.20.1
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/.github/FUNDING.yml +12 -0
- package/.github/workflows/publish.yml +48 -0
- package/.gitignore +9 -7
- package/LICENSE +21 -21
- package/README.md +100 -2074
- package/docker/Dockerfile +42 -42
- package/docker/README.md +91 -91
- package/docker/package.json +2 -2
- package/package.json +95 -81
- package/site/-/_.md +139 -0
- package/site/-/docs.old.md +2010 -0
- package/site/.vitepress/cache/deps/@braintree_sanitize-url 2.js +93 -0
- package/site/.vitepress/cache/deps/@braintree_sanitize-url.js +93 -0
- package/site/.vitepress/cache/deps/@braintree_sanitize-url.js 2.map +7 -0
- package/site/.vitepress/cache/deps/@braintree_sanitize-url.js.map +7 -0
- package/site/.vitepress/cache/deps/_metadata 2.json +85 -0
- package/site/.vitepress/cache/deps/_metadata.json +85 -0
- package/site/.vitepress/cache/deps/chunk-BUSYA2B4 2.js +9 -0
- package/site/.vitepress/cache/deps/chunk-BUSYA2B4.js +9 -0
- package/site/.vitepress/cache/deps/chunk-BUSYA2B4.js 2.map +7 -0
- package/site/.vitepress/cache/deps/chunk-BUSYA2B4.js.map +7 -0
- package/site/.vitepress/cache/deps/chunk-Q2AYPHVK 2.js +9719 -0
- package/site/.vitepress/cache/deps/chunk-Q2AYPHVK.js +9719 -0
- package/site/.vitepress/cache/deps/chunk-Q2AYPHVK.js 2.map +7 -0
- package/site/.vitepress/cache/deps/chunk-Q2AYPHVK.js.map +7 -0
- package/site/.vitepress/cache/deps/chunk-QAXAIFA7 2.js +12705 -0
- package/site/.vitepress/cache/deps/chunk-QAXAIFA7.js +12705 -0
- package/site/.vitepress/cache/deps/chunk-QAXAIFA7.js 2.map +7 -0
- package/site/.vitepress/cache/deps/chunk-QAXAIFA7.js.map +7 -0
- package/site/.vitepress/cache/deps/cytoscape 2.js +30278 -0
- package/site/.vitepress/cache/deps/cytoscape-cose-bilkent 2.js +4710 -0
- package/site/.vitepress/cache/deps/cytoscape-cose-bilkent.js +4710 -0
- package/site/.vitepress/cache/deps/cytoscape-cose-bilkent.js 2.map +7 -0
- package/site/.vitepress/cache/deps/cytoscape-cose-bilkent.js.map +7 -0
- package/site/.vitepress/cache/deps/cytoscape.js +30278 -0
- package/site/.vitepress/cache/deps/cytoscape.js 2.map +7 -0
- package/site/.vitepress/cache/deps/cytoscape.js.map +7 -0
- package/site/.vitepress/cache/deps/dayjs 2.js +285 -0
- package/site/.vitepress/cache/deps/dayjs.js +285 -0
- package/site/.vitepress/cache/deps/dayjs.js 2.map +7 -0
- package/site/.vitepress/cache/deps/dayjs.js.map +7 -0
- package/site/.vitepress/cache/deps/debug 2.js +453 -0
- package/site/.vitepress/cache/deps/debug.js +453 -0
- package/site/.vitepress/cache/deps/debug.js 2.map +7 -0
- package/site/.vitepress/cache/deps/debug.js.map +7 -0
- package/site/.vitepress/cache/deps/package 2.json +3 -0
- package/site/.vitepress/cache/deps/package.json +3 -0
- package/site/.vitepress/cache/deps/vitepress___@vue_devtools-api 2.js +4507 -0
- package/site/.vitepress/cache/deps/vitepress___@vue_devtools-api.js +4507 -0
- package/site/.vitepress/cache/deps/vitepress___@vue_devtools-api.js 2.map +7 -0
- package/site/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map +7 -0
- package/site/.vitepress/cache/deps/vitepress___@vueuse_core 2.js +584 -0
- package/site/.vitepress/cache/deps/vitepress___@vueuse_core.js +584 -0
- package/site/.vitepress/cache/deps/vitepress___@vueuse_core.js 2.map +7 -0
- package/site/.vitepress/cache/deps/vitepress___@vueuse_core.js.map +7 -0
- package/site/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap 2.js +1166 -0
- package/site/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js +1166 -0
- package/site/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js 2.map +7 -0
- package/site/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js.map +7 -0
- package/site/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js 2.js +1667 -0
- package/site/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js +1667 -0
- package/site/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js 2.map +7 -0
- package/site/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js.map +7 -0
- package/site/.vitepress/cache/deps/vitepress___minisearch 2.js +1815 -0
- package/site/.vitepress/cache/deps/vitepress___minisearch.js +1815 -0
- package/site/.vitepress/cache/deps/vitepress___minisearch.js 2.map +7 -0
- package/site/.vitepress/cache/deps/vitepress___minisearch.js.map +7 -0
- package/site/.vitepress/cache/deps/vue 2.js +344 -0
- package/site/.vitepress/cache/deps/vue.js +344 -0
- package/site/.vitepress/cache/deps/vue.js 2.map +7 -0
- package/site/.vitepress/cache/deps/vue.js.map +7 -0
- package/site/.vitepress/config.ts +147 -0
- package/site/.vitepress/theme/custom.css +50 -0
- package/site/.vitepress/theme/index.ts +6 -0
- package/site/api/webflo-fetch/FormData.md +0 -0
- package/site/api/webflo-fetch/Headers.md +0 -0
- package/site/api/webflo-fetch/LiveResponse.md +0 -0
- package/site/api/webflo-fetch/Request.md +0 -0
- package/site/api/webflo-fetch/Response.md +0 -0
- package/site/api/webflo-fetch/fetch.md +0 -0
- package/site/api/webflo-routing/HttpCookies.md +0 -0
- package/site/api/webflo-routing/HttpEvent/respondWith.md +1 -0
- package/site/api/webflo-routing/HttpEvent/waitUntil.md +1 -0
- package/site/api/webflo-routing/HttpEvent/waitUntilNavigate.md +1 -0
- package/site/api/webflo-routing/HttpEvent.md +30 -0
- package/site/api/webflo-routing/HttpSession.md +0 -0
- package/site/api/webflo-routing/HttpState.md +0 -0
- package/site/api/webflo-routing/HttpUser.md +0 -0
- package/site/api/webflo-routing/handler/fetch.md +42 -0
- package/site/api/webflo-routing/handler/next.md +54 -0
- package/site/api/webflo-routing/handler.md +119 -0
- package/site/api.md +26 -0
- package/site/contributing.md +16 -0
- package/site/docs/advanced/lifecycles.md +20 -0
- package/site/docs/advanced/redirects.md +0 -0
- package/site/docs/advanced/routing.md +1 -0
- package/site/docs/advanced.md +9 -0
- package/site/docs/concepts/realtime.md +637 -0
- package/site/docs/concepts/rendering.md +60 -0
- package/site/docs/concepts/request-response.md +47 -0
- package/site/docs/concepts/routing.md +656 -0
- package/site/docs/concepts/state.md +44 -0
- package/site/docs/concepts/templates.md +48 -0
- package/site/docs/concepts.md +97 -0
- package/site/docs/getting-started.md +378 -0
- package/site/docs/tech-stack.md +56 -0
- package/site/docs.md +100 -0
- package/site/examples/pwa.md +10 -0
- package/site/examples/web.md +11 -0
- package/site/examples.md +10 -0
- package/site/faq.md +13 -0
- package/site/guides/guide-auth.md +13 -0
- package/site/guides/guide-file-upload.md +11 -0
- package/site/guides/guide-service-worker.md +10 -0
- package/site/guides/tutorial-1-todo.md +24 -0
- package/site/guides.md +15 -0
- package/site/index.md +39 -0
- package/site/public/img/brand/logo-670x670.png +0 -0
- package/site/recipes/realtime.md +11 -0
- package/site/recipes/streaming.md +15 -0
- package/site/reference/cli.md +11 -0
- package/site/reference/config.md +13 -0
- package/site/reference/tools.md +9 -0
- package/src/Context.js +71 -79
- package/src/config-pi/deployment/Env.js +55 -68
- package/src/config-pi/deployment/Layout.js +71 -63
- package/src/config-pi/deployment/Origins.js +139 -139
- package/src/config-pi/deployment/Proxy.js +74 -74
- package/src/config-pi/deployment/index.js +17 -17
- package/src/config-pi/index.js +15 -15
- package/src/config-pi/runtime/Client.js +108 -98
- package/src/config-pi/runtime/Server.js +157 -125
- package/src/config-pi/runtime/client/Worker.js +111 -134
- 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 +74 -74
- package/src/config-pi/runtime/server/Redirects.js +69 -69
- package/src/config-pi/runtime/server/index.js +13 -13
- package/src/config-pi/static/Init.js +57 -0
- package/src/config-pi/static/Manifest.js +319 -319
- package/src/config-pi/static/Ssg.js +49 -49
- package/src/config-pi/static/index.js +15 -13
- package/src/deployment-pi/index.js +10 -10
- package/src/deployment-pi/origins/index.js +216 -216
- package/src/deployment-pi/util.js +161 -0
- package/src/index.js +13 -19
- package/src/init-pi/index.js +117 -0
- package/src/init-pi/templates/pwa/app/handler.server.js +8 -0
- package/src/init-pi/templates/pwa/app/page.html +7 -0
- package/src/init-pi/templates/pwa/package.json +19 -0
- package/src/init-pi/templates/pwa/public/assets/app.css +16 -0
- package/src/init-pi/templates/pwa/public/index.html +39 -0
- package/src/init-pi/templates/pwa/public/manifest.json +29 -0
- package/src/init-pi/templates/web/app/handler.server.js +8 -0
- package/src/init-pi/templates/web/app/page.html +7 -0
- package/src/init-pi/templates/web/package.json +19 -0
- package/src/init-pi/templates/web/public/assets/app.css +16 -0
- package/src/init-pi/templates/web/public/index.html +39 -0
- package/src/runtime-pi/WebfloRuntime.js +350 -0
- package/src/runtime-pi/index.js +6 -13
- package/src/runtime-pi/webflo-client/ClientSideCookies.js +17 -0
- package/src/runtime-pi/webflo-client/ClientSideWorkport.js +63 -0
- package/src/runtime-pi/webflo-client/DeviceCapabilities.js +213 -0
- package/src/runtime-pi/webflo-client/WebfloClient.js +500 -0
- package/src/runtime-pi/webflo-client/WebfloRootClient1.js +206 -0
- package/src/runtime-pi/webflo-client/WebfloRootClient2.js +113 -0
- package/src/runtime-pi/webflo-client/WebfloSubClient.js +118 -0
- package/src/runtime-pi/webflo-client/index.js +17 -0
- package/src/runtime-pi/webflo-client/webflo-codegen.js +469 -0
- package/src/runtime-pi/webflo-client/webflo-devmode.js +243 -0
- package/src/runtime-pi/webflo-client/webflo-embedded.js +50 -0
- package/src/runtime-pi/webflo-fetch/LiveResponse.js +437 -0
- package/src/runtime-pi/webflo-fetch/cookies.js +10 -0
- package/src/runtime-pi/webflo-fetch/fetch.js +16 -0
- package/src/runtime-pi/webflo-fetch/formdata.js +54 -0
- package/src/runtime-pi/webflo-fetch/headers.js +151 -0
- package/src/runtime-pi/webflo-fetch/index.js +5 -0
- package/src/runtime-pi/webflo-fetch/message.js +49 -0
- package/src/runtime-pi/webflo-fetch/request.js +62 -0
- package/src/runtime-pi/webflo-fetch/response.js +110 -0
- package/src/runtime-pi/webflo-fetch/util.js +28 -0
- package/src/runtime-pi/webflo-messaging/WQBroadcastChannel.js +10 -0
- package/src/runtime-pi/webflo-messaging/WQMessageChannel.js +26 -0
- package/src/runtime-pi/webflo-messaging/WQMessageEvent.js +87 -0
- package/src/runtime-pi/webflo-messaging/WQMessagePort.js +38 -0
- package/src/runtime-pi/webflo-messaging/WQRelayPort.js +47 -0
- package/src/runtime-pi/webflo-messaging/WQSockPort.js +113 -0
- package/src/runtime-pi/webflo-messaging/WQStarPort.js +104 -0
- package/src/runtime-pi/webflo-messaging/wq-message-port.js +404 -0
- package/src/runtime-pi/webflo-routing/HttpCookies.js +42 -0
- package/src/runtime-pi/webflo-routing/HttpEvent.js +112 -0
- package/src/runtime-pi/webflo-routing/HttpSession.js +11 -0
- package/src/runtime-pi/webflo-routing/HttpState.js +153 -0
- package/src/runtime-pi/webflo-routing/HttpUser.js +54 -0
- package/src/runtime-pi/webflo-routing/WebfloRouter.js +245 -0
- package/src/runtime-pi/webflo-server/ServerSideCookies.js +19 -0
- package/src/runtime-pi/webflo-server/ServerSideSession.js +38 -0
- package/src/runtime-pi/webflo-server/WebfloServer.js +937 -0
- package/src/runtime-pi/webflo-server/index.js +11 -0
- package/src/runtime-pi/webflo-server/messaging/Client.js +27 -0
- package/src/runtime-pi/webflo-server/messaging/ClientRequestRealtime.js +50 -0
- package/src/runtime-pi/webflo-server/messaging/Clients.js +25 -0
- package/src/runtime-pi/webflo-server/webflo-devmode.js +326 -0
- package/src/runtime-pi/{client → webflo-url}/Url.js +155 -205
- package/src/runtime-pi/webflo-url/index.js +1 -0
- package/src/runtime-pi/webflo-url/urlpattern.js +38 -0
- package/src/runtime-pi/{util-url.js → webflo-url/util.js} +109 -147
- package/src/runtime-pi/webflo-url/xURL.js +94 -0
- package/src/runtime-pi/webflo-worker/WebfloWorker.js +234 -0
- package/src/runtime-pi/webflo-worker/WorkerSideCookies.js +19 -0
- package/src/runtime-pi/webflo-worker/WorkerSideWorkport.js +18 -0
- package/src/runtime-pi/webflo-worker/index.js +11 -0
- package/src/services-pi/cert/http-auth-hook.js +22 -22
- package/src/services-pi/cert/http-cleanup-hook.js +22 -22
- package/src/services-pi/cert/index.js +79 -79
- package/src/services-pi/index.js +10 -8
- package/src/services-pi/push/index.js +23 -0
- package/src/util.js +10 -0
- package/src/{webflo.js → webflo-cli.js} +30 -30
- package/test/index.test.js +26 -26
- 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/src/runtime-pi/Application.js +0 -29
- package/src/runtime-pi/Cookies.js +0 -82
- package/src/runtime-pi/HttpEvent.js +0 -107
- package/src/runtime-pi/Router.js +0 -130
- package/src/runtime-pi/Runtime.js +0 -21
- package/src/runtime-pi/client/Application.js +0 -100
- package/src/runtime-pi/client/Context.js +0 -7
- package/src/runtime-pi/client/Router.js +0 -48
- package/src/runtime-pi/client/Runtime.js +0 -332
- package/src/runtime-pi/client/Workport.js +0 -178
- package/src/runtime-pi/client/createStorage.js +0 -57
- package/src/runtime-pi/client/generate.js +0 -472
- package/src/runtime-pi/client/index.js +0 -21
- package/src/runtime-pi/client/oohtml/full.js +0 -7
- package/src/runtime-pi/client/oohtml/namespacing.js +0 -7
- package/src/runtime-pi/client/oohtml/scripting.js +0 -8
- package/src/runtime-pi/client/oohtml/templating.js +0 -8
- package/src/runtime-pi/client/worker/Application.js +0 -44
- package/src/runtime-pi/client/worker/Context.js +0 -7
- package/src/runtime-pi/client/worker/Runtime.js +0 -269
- package/src/runtime-pi/client/worker/Workport.js +0 -86
- package/src/runtime-pi/client/worker/index.js +0 -21
- package/src/runtime-pi/server/Application.js +0 -116
- package/src/runtime-pi/server/Context.js +0 -16
- package/src/runtime-pi/server/Router.js +0 -159
- package/src/runtime-pi/server/Runtime.js +0 -557
- package/src/runtime-pi/server/index.js +0 -21
- package/src/runtime-pi/util-http.js +0 -86
- package/src/runtime-pi/xFormData.js +0 -24
- package/src/runtime-pi/xHeaders.js +0 -146
- package/src/runtime-pi/xRequest.js +0 -46
- package/src/runtime-pi/xRequestHeaders.js +0 -109
- package/src/runtime-pi/xResponse.js +0 -33
- package/src/runtime-pi/xResponseHeaders.js +0 -117
- package/src/runtime-pi/xURL.js +0 -105
- package/src/runtime-pi/xfetch.js +0 -23
- package/src/runtime-pi/xxHttpMessage.js +0 -102
- package/src/static-pi/index.js +0 -11
|
@@ -1,63 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* imports
|
|
4
|
-
*/
|
|
5
|
-
import { Dotfile } from '@webqit/backpack';
|
|
6
|
-
|
|
7
|
-
export default class Layout extends Dotfile {
|
|
8
|
-
|
|
9
|
-
// Base name
|
|
10
|
-
get name() {
|
|
11
|
-
return 'layout';
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// @desc
|
|
15
|
-
static get ['@desc']() {
|
|
16
|
-
return 'Project layout config.';
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// Defaults merger
|
|
20
|
-
withDefaults(config) {
|
|
21
|
-
return this.merge({
|
|
22
|
-
PUBLIC_DIR: './public',
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* imports
|
|
4
|
+
*/
|
|
5
|
+
import { Dotfile } from '@webqit/backpack';
|
|
6
|
+
|
|
7
|
+
export default class Layout extends Dotfile {
|
|
8
|
+
|
|
9
|
+
// Base name
|
|
10
|
+
get name() {
|
|
11
|
+
return 'layout';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// @desc
|
|
15
|
+
static get ['@desc']() {
|
|
16
|
+
return 'Project layout config.';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Defaults merger
|
|
20
|
+
withDefaults(config) {
|
|
21
|
+
return this.merge({
|
|
22
|
+
PUBLIC_DIR: './public',
|
|
23
|
+
VIEWS_DIR: './app',
|
|
24
|
+
SERVER_DIR: './app',
|
|
25
|
+
CLIENT_DIR: './app',
|
|
26
|
+
WORKER_DIR: './app',
|
|
27
|
+
}, config, 'patch');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Questions generator
|
|
31
|
+
getSchema(config, choices = {}) {
|
|
32
|
+
// Questions
|
|
33
|
+
return [
|
|
34
|
+
{
|
|
35
|
+
name: 'PUBLIC_DIR',
|
|
36
|
+
type: 'text',
|
|
37
|
+
message: 'Enter the application\'s public directory',
|
|
38
|
+
initial: config.PUBLIC_DIR,
|
|
39
|
+
validation: ['important'],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'VIEWS_DIR',
|
|
43
|
+
type: 'text',
|
|
44
|
+
message: 'Enter the directory for the application\'s view files (templates)',
|
|
45
|
+
initial: config.VIEWS_DIR,
|
|
46
|
+
validation: ['important'],
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'SERVER_DIR',
|
|
50
|
+
type: 'text',
|
|
51
|
+
message: 'Enter the directory for the application\'s server-side route handlers',
|
|
52
|
+
initial: config.SERVER_DIR,
|
|
53
|
+
validation: ['important'],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'CLIENT_DIR',
|
|
57
|
+
type: 'text',
|
|
58
|
+
message: 'Enter the directory for the application\'s client-side route handlers',
|
|
59
|
+
initial: config.CLIENT_DIR,
|
|
60
|
+
validation: ['important'],
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'WORKER_DIR',
|
|
64
|
+
type: 'text',
|
|
65
|
+
message: 'Enter the directory for the application\'s offline route handlers',
|
|
66
|
+
initial: config.WORKER_DIR,
|
|
67
|
+
validation: ['important'],
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -1,139 +1,139 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* imports
|
|
4
|
-
*/
|
|
5
|
-
import Url from 'url';
|
|
6
|
-
import { _before } from '@webqit/util/str/index.js';
|
|
7
|
-
import { _isTypeObject } from '@webqit/util/js/index.js';
|
|
8
|
-
import { Dotfile } from '@webqit/backpack';
|
|
9
|
-
|
|
10
|
-
export default class Origins extends Dotfile {
|
|
11
|
-
|
|
12
|
-
// Base name
|
|
13
|
-
get name() {
|
|
14
|
-
return 'origins';
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// @desc
|
|
18
|
-
static get ['@desc']() {
|
|
19
|
-
return 'Remote origins config.';
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Defaults merger
|
|
23
|
-
withDefaults(config) {
|
|
24
|
-
let hostname = '', origin = '';
|
|
25
|
-
if (this.cx.PKG && this.cx.PKG.repository) {
|
|
26
|
-
var inferredRepo = Url.parse(_isTypeObject(this.cx.PKG.repository) ? this.cx.PKG.repository.url : this.cx.PKG.repository);
|
|
27
|
-
hostname = _before(inferredRepo.hostname, '.');
|
|
28
|
-
origin = _before(inferredRepo.pathname, '.');
|
|
29
|
-
}
|
|
30
|
-
// Params
|
|
31
|
-
return this.merge({
|
|
32
|
-
entries: [{
|
|
33
|
-
host: hostname,
|
|
34
|
-
access_token: '',
|
|
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, 'patch');
|
|
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
|
-
getSchema(config, choices = {}) {
|
|
54
|
-
// Choices
|
|
55
|
-
const CHOICES = this.merge({
|
|
56
|
-
host: [
|
|
57
|
-
{value: 'github',},
|
|
58
|
-
{value: 'bitbucket',},
|
|
59
|
-
],
|
|
60
|
-
}, choices, 'patch');
|
|
61
|
-
// Questions
|
|
62
|
-
return [
|
|
63
|
-
{
|
|
64
|
-
name: 'entries',
|
|
65
|
-
type: 'recursive',
|
|
66
|
-
controls: {
|
|
67
|
-
name: 'repository',
|
|
68
|
-
},
|
|
69
|
-
initial: config.entries,
|
|
70
|
-
schema: [
|
|
71
|
-
{
|
|
72
|
-
name: 'host',
|
|
73
|
-
type: 'select',
|
|
74
|
-
message: 'Host name',
|
|
75
|
-
choices: CHOICES.host,
|
|
76
|
-
validation: ['input', 'important'],
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
name: 'access_token',
|
|
80
|
-
type: 'text',
|
|
81
|
-
message: 'Enter your Personal Acess Token at host (if exists)',
|
|
82
|
-
validation: ['input', 'important'],
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
name: 'repo',
|
|
86
|
-
type: 'text',
|
|
87
|
-
message: 'Enter a repository name (in the format: user-or-org/origin)',
|
|
88
|
-
validation: ['input', 'important'],
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
name: 'branch',
|
|
92
|
-
type: 'text',
|
|
93
|
-
message: 'Specifiy the git branch within the given repository',
|
|
94
|
-
validation: ['input', 'important'],
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
name: 'tag',
|
|
98
|
-
type: 'text',
|
|
99
|
-
message: 'Enter a local name for this origin',
|
|
100
|
-
validation: ['input', 'important'],
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
name: 'deploy_path',
|
|
104
|
-
type: 'text',
|
|
105
|
-
message: 'Enter the relative local path that this origin deploys to',
|
|
106
|
-
validation: ['important'],
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
name: 'autodeploy',
|
|
110
|
-
type: 'toggle',
|
|
111
|
-
message: 'Auto-deploy this origin on every push to branch?',
|
|
112
|
-
active: 'YES',
|
|
113
|
-
inactive: 'NO',
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
name: 'autodeploy_secret',
|
|
117
|
-
type: (prev, ans) => ans.autodeploy ? 'text' : null,
|
|
118
|
-
message: 'Enter the "secret" for validating the auto-deploy webhook event',
|
|
119
|
-
validation: ['input', 'important'],
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
name: 'ondeploy',
|
|
123
|
-
type: 'text',
|
|
124
|
-
message: 'Enter an optional "command" to run on deploy',
|
|
125
|
-
validation: ['input', 'important'],
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
name: 'ondeploy_autoexit',
|
|
129
|
-
type: (prev, ans) => ans.autodeploy ? 'toggle' : null,
|
|
130
|
-
message: 'Auto exit process on deploy?',
|
|
131
|
-
active: 'YES',
|
|
132
|
-
inactive: 'NO',
|
|
133
|
-
},
|
|
134
|
-
],
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
];
|
|
138
|
-
}
|
|
139
|
-
}
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* imports
|
|
4
|
+
*/
|
|
5
|
+
import Url from 'url';
|
|
6
|
+
import { _before } from '@webqit/util/str/index.js';
|
|
7
|
+
import { _isTypeObject } from '@webqit/util/js/index.js';
|
|
8
|
+
import { Dotfile } from '@webqit/backpack';
|
|
9
|
+
|
|
10
|
+
export default class Origins extends Dotfile {
|
|
11
|
+
|
|
12
|
+
// Base name
|
|
13
|
+
get name() {
|
|
14
|
+
return 'origins';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// @desc
|
|
18
|
+
static get ['@desc']() {
|
|
19
|
+
return 'Remote origins config.';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Defaults merger
|
|
23
|
+
withDefaults(config) {
|
|
24
|
+
let hostname = '', origin = '';
|
|
25
|
+
if (this.cx.PKG && this.cx.PKG.repository) {
|
|
26
|
+
var inferredRepo = Url.parse(_isTypeObject(this.cx.PKG.repository) ? this.cx.PKG.repository.url : this.cx.PKG.repository);
|
|
27
|
+
hostname = _before(inferredRepo.hostname, '.');
|
|
28
|
+
origin = _before(inferredRepo.pathname, '.');
|
|
29
|
+
}
|
|
30
|
+
// Params
|
|
31
|
+
return this.merge({
|
|
32
|
+
entries: [{
|
|
33
|
+
host: hostname,
|
|
34
|
+
access_token: '',
|
|
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, 'patch');
|
|
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
|
+
getSchema(config, choices = {}) {
|
|
54
|
+
// Choices
|
|
55
|
+
const CHOICES = this.merge({
|
|
56
|
+
host: [
|
|
57
|
+
{value: 'github',},
|
|
58
|
+
{value: 'bitbucket',},
|
|
59
|
+
],
|
|
60
|
+
}, choices, 'patch');
|
|
61
|
+
// Questions
|
|
62
|
+
return [
|
|
63
|
+
{
|
|
64
|
+
name: 'entries',
|
|
65
|
+
type: 'recursive',
|
|
66
|
+
controls: {
|
|
67
|
+
name: 'repository',
|
|
68
|
+
},
|
|
69
|
+
initial: config.entries,
|
|
70
|
+
schema: [
|
|
71
|
+
{
|
|
72
|
+
name: 'host',
|
|
73
|
+
type: 'select',
|
|
74
|
+
message: 'Host name',
|
|
75
|
+
choices: CHOICES.host,
|
|
76
|
+
validation: ['input', 'important'],
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'access_token',
|
|
80
|
+
type: 'text',
|
|
81
|
+
message: 'Enter your Personal Acess Token at host (if exists)',
|
|
82
|
+
validation: ['input', 'important'],
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'repo',
|
|
86
|
+
type: 'text',
|
|
87
|
+
message: 'Enter a repository name (in the format: user-or-org/origin)',
|
|
88
|
+
validation: ['input', 'important'],
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'branch',
|
|
92
|
+
type: 'text',
|
|
93
|
+
message: 'Specifiy the git branch within the given repository',
|
|
94
|
+
validation: ['input', 'important'],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: 'tag',
|
|
98
|
+
type: 'text',
|
|
99
|
+
message: 'Enter a local name for this origin',
|
|
100
|
+
validation: ['input', 'important'],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'deploy_path',
|
|
104
|
+
type: 'text',
|
|
105
|
+
message: 'Enter the relative local path that this origin deploys to',
|
|
106
|
+
validation: ['important'],
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: 'autodeploy',
|
|
110
|
+
type: 'toggle',
|
|
111
|
+
message: 'Auto-deploy this origin on every push to branch?',
|
|
112
|
+
active: 'YES',
|
|
113
|
+
inactive: 'NO',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'autodeploy_secret',
|
|
117
|
+
type: (prev, ans) => ans.autodeploy ? 'text' : null,
|
|
118
|
+
message: 'Enter the "secret" for validating the auto-deploy webhook event',
|
|
119
|
+
validation: ['input', 'important'],
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'ondeploy',
|
|
123
|
+
type: 'text',
|
|
124
|
+
message: 'Enter an optional "command" to run on deploy',
|
|
125
|
+
validation: ['input', 'important'],
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: 'ondeploy_autoexit',
|
|
129
|
+
type: (prev, ans) => ans.autodeploy ? 'toggle' : null,
|
|
130
|
+
message: 'Auto exit process on deploy?',
|
|
131
|
+
active: 'YES',
|
|
132
|
+
inactive: 'NO',
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
];
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* imports
|
|
4
|
-
*/
|
|
5
|
-
import { Dotfile } from '@webqit/backpack';
|
|
6
|
-
|
|
7
|
-
export default class Proxy extends Dotfile {
|
|
8
|
-
|
|
9
|
-
// Base name
|
|
10
|
-
get name() {
|
|
11
|
-
return 'proxy';
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// @desc
|
|
15
|
-
static get ['@desc']() {
|
|
16
|
-
return 'Layout proxy config.';
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// Defaults merger
|
|
20
|
-
withDefaults(config) {
|
|
21
|
-
return this.merge({
|
|
22
|
-
entries: [],
|
|
23
|
-
}, config, 'patch');
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Questions generator
|
|
27
|
-
getSchema(config, choices = {}) {
|
|
28
|
-
// Choices
|
|
29
|
-
const CHOICES = this.merge({
|
|
30
|
-
proto: [
|
|
31
|
-
{value: '', title: '(Auto)'},
|
|
32
|
-
{value: 'http', title: 'HTTP'},
|
|
33
|
-
{value: 'https', title: 'HTTPS'},
|
|
34
|
-
],
|
|
35
|
-
}, choices, 'patch');
|
|
36
|
-
// Questions
|
|
37
|
-
return [
|
|
38
|
-
{
|
|
39
|
-
name: 'entries',
|
|
40
|
-
type: 'recursive',
|
|
41
|
-
controls: {
|
|
42
|
-
name: 'vhost',
|
|
43
|
-
},
|
|
44
|
-
initial: config.entries,
|
|
45
|
-
schema: [
|
|
46
|
-
{
|
|
47
|
-
name: 'path',
|
|
48
|
-
type: 'text',
|
|
49
|
-
message: '[path]: Enter local pathname to target server if exists.' + "\r\n" + '(Leave empty to explicitly specify hostnames and port number.)' + "\r\n",
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
name: 'hostnames',
|
|
53
|
-
type: 'list',
|
|
54
|
-
message: '[hostnames]: Enter host names.' + "\r\n" + '(Leave empty to automatically derive hostnames from the config of the target server specified above.)' + "\r\n",
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: 'port',
|
|
58
|
-
type: 'number',
|
|
59
|
-
message: '[port]: Enter the target port number.' + "\r\n" + '(Leave empty to automatically derive target port number from the config of the target server specified above.)' + "\r\n",
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: 'proto',
|
|
63
|
-
type: 'select',
|
|
64
|
-
message: '[protocol]: Enter the target protocol: https/http.' + "\r\n" + '(Leave empty to automatically derive target protocol from the config of the target server specified above.)' + "\r\n",
|
|
65
|
-
choices: CHOICES.proto,
|
|
66
|
-
initial: this.indexOfInitial(CHOICES.proto, config.proto),
|
|
67
|
-
validation: ['important'],
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
];
|
|
73
|
-
}
|
|
74
|
-
}
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* imports
|
|
4
|
+
*/
|
|
5
|
+
import { Dotfile } from '@webqit/backpack';
|
|
6
|
+
|
|
7
|
+
export default class Proxy extends Dotfile {
|
|
8
|
+
|
|
9
|
+
// Base name
|
|
10
|
+
get name() {
|
|
11
|
+
return 'proxy';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// @desc
|
|
15
|
+
static get ['@desc']() {
|
|
16
|
+
return 'Layout proxy config.';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Defaults merger
|
|
20
|
+
withDefaults(config) {
|
|
21
|
+
return this.merge({
|
|
22
|
+
entries: [],
|
|
23
|
+
}, config, 'patch');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Questions generator
|
|
27
|
+
getSchema(config, choices = {}) {
|
|
28
|
+
// Choices
|
|
29
|
+
const CHOICES = this.merge({
|
|
30
|
+
proto: [
|
|
31
|
+
{value: '', title: '(Auto)'},
|
|
32
|
+
{value: 'http', title: 'HTTP'},
|
|
33
|
+
{value: 'https', title: 'HTTPS'},
|
|
34
|
+
],
|
|
35
|
+
}, choices, 'patch');
|
|
36
|
+
// Questions
|
|
37
|
+
return [
|
|
38
|
+
{
|
|
39
|
+
name: 'entries',
|
|
40
|
+
type: 'recursive',
|
|
41
|
+
controls: {
|
|
42
|
+
name: 'vhost',
|
|
43
|
+
},
|
|
44
|
+
initial: config.entries,
|
|
45
|
+
schema: [
|
|
46
|
+
{
|
|
47
|
+
name: 'path',
|
|
48
|
+
type: 'text',
|
|
49
|
+
message: '[path]: Enter local pathname to target server if exists.' + "\r\n" + '(Leave empty to explicitly specify hostnames and port number.)' + "\r\n",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'hostnames',
|
|
53
|
+
type: 'list',
|
|
54
|
+
message: '[hostnames]: Enter host names.' + "\r\n" + '(Leave empty to automatically derive hostnames from the config of the target server specified above.)' + "\r\n",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'port',
|
|
58
|
+
type: 'number',
|
|
59
|
+
message: '[port]: Enter the target port number.' + "\r\n" + '(Leave empty to automatically derive target port number from the config of the target server specified above.)' + "\r\n",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'proto',
|
|
63
|
+
type: 'select',
|
|
64
|
+
message: '[protocol]: Enter the target protocol: https/http.' + "\r\n" + '(Leave empty to automatically derive target protocol from the config of the target server specified above.)' + "\r\n",
|
|
65
|
+
choices: CHOICES.proto,
|
|
66
|
+
initial: this.indexOfInitial(CHOICES.proto, config.proto),
|
|
67
|
+
validation: ['important'],
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -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 Proxy from './Proxy.js';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @exports
|
|
12
|
-
*/
|
|
13
|
-
export {
|
|
14
|
-
Env,
|
|
15
|
-
Layout,
|
|
16
|
-
Origins,
|
|
17
|
-
Proxy,
|
|
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 Proxy from './Proxy.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @exports
|
|
12
|
+
*/
|
|
13
|
+
export {
|
|
14
|
+
Env,
|
|
15
|
+
Layout,
|
|
16
|
+
Origins,
|
|
17
|
+
Proxy,
|
|
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
|
}
|