@webqit/webflo 0.8.51 → 0.8.52
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/docker/Dockerfile +3 -2
- package/docker/README.md +8 -2
- package/package.json +3 -3
- package/src/{cmd/client.js → build/client/index.js} +24 -11
- package/src/build/index.js +5 -0
- package/src/index.js +47 -45
- package/src/{modules → runtime}/Router.js +0 -0
- package/src/{modules → runtime}/_FormData.js +0 -0
- package/src/{modules → runtime}/_Headers.js +0 -0
- package/src/{modules → runtime}/_MessageStream.js +0 -0
- package/src/{modules → runtime}/_NavigationEvent.js +0 -0
- package/src/{modules → runtime}/_Request.js +0 -0
- package/src/{modules → runtime}/_RequestHeaders.js +0 -0
- package/src/{modules → runtime}/_Response.js +0 -0
- package/src/{modules → runtime}/_ResponseHeaders.js +0 -0
- package/src/{modules → runtime}/_URL.js +0 -0
- package/src/{modules → runtime}/client/Cache.js +0 -0
- package/src/{modules → runtime}/client/Http.js +1 -1
- package/src/{modules → runtime}/client/NavigationEvent.js +0 -0
- package/src/{modules → runtime}/client/Router.js +0 -0
- package/src/{modules/client/Client.js → runtime/client/Runtime.js} +1 -1
- package/src/{modules → runtime}/client/StdRequest.js +0 -0
- package/src/{modules → runtime}/client/Storage.js +0 -0
- package/src/{modules → runtime}/client/Url.js +0 -0
- package/src/{modules → runtime}/client/Worker.js +0 -0
- package/src/{modules → runtime}/client/WorkerClient.js +0 -0
- package/src/{modules → runtime}/client/WorkerComm.js +0 -0
- package/src/{modules → runtime}/client/effects/sounds.js +0 -0
- package/src/runtime/index.js +5 -0
- package/src/{modules → runtime}/server/NavigationEvent.js +0 -0
- package/src/{modules → runtime}/server/Router.js +0 -0
- package/src/{modules/server/Server.js → runtime/server/Runtime.js} +3 -3
- package/src/{cmd/server.js → runtime/server/index.js} +8 -8
- package/src/{modules/server/start.mjs → runtime/server/index.mjs} +2 -2
- package/src/{modules → runtime}/util.js +0 -0
- package/src/{modules → services}/certbot/http-auth-hook.js +0 -0
- package/src/{modules → services}/certbot/http-cleanup-hook.js +0 -0
- package/src/{cmd/certbot.js → services/certbot/index.js} +2 -3
- package/src/services/index.js +6 -0
- package/src/{cmd/origins.js → services/origins/index.js} +3 -3
- package/src/cmd/index.js +0 -8
package/docker/Dockerfile
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Base installations
|
|
2
2
|
FROM node:12-alpine
|
|
3
|
-
RUN apk
|
|
3
|
+
RUN apk add git
|
|
4
4
|
|
|
5
5
|
# We'll install npm packages at one-level higher than
|
|
6
6
|
# actuall app root, so that we can bind-mount host system's app root
|
|
@@ -12,6 +12,7 @@ RUN npm install @webqit/playui-cli -g
|
|
|
12
12
|
|
|
13
13
|
# Move one-level in, for the reasons above
|
|
14
14
|
WORKDIR /home/www/app
|
|
15
|
+
ENV NODE_OPTIONS=--openssl-legacy-provider
|
|
15
16
|
|
|
16
17
|
# To auto-start app (flags optional), we would add...
|
|
17
18
|
# CMD ["webflo", "start", "--env=dev", "--watch", "--http-only"]
|
|
@@ -22,4 +23,4 @@ WORKDIR /home/www/app
|
|
|
22
23
|
# To publish to docker hub...
|
|
23
24
|
# docker login -u webqit
|
|
24
25
|
# docker tag webflo webqit/webflo
|
|
25
|
-
# docker push webqit/webflo
|
|
26
|
+
# docker push webqit/webflo
|
package/docker/README.md
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
# Webflo Container
|
|
2
|
+
|
|
2
3
|
This is simply a node.js container with the `@webqit/webflo` framework installed. Once started, any webflo app can be deployed into the container from any git repository.
|
|
3
4
|
|
|
4
5
|
## Usage
|
|
6
|
+
|
|
5
7
|
This container image lives on Docker Hub and can be pulled to a local machine or a remote Virtual Machine (VM) on any cloud platform.
|
|
6
8
|
|
|
7
9
|
+ [To Use Locally](#to-use-locally)
|
|
@@ -9,6 +11,7 @@ This container image lives on Docker Hub and can be pulled to a local machine or
|
|
|
9
11
|
* [To Deploy An App From Any Repo](#to-deploy-an-app-from-any-repo)
|
|
10
12
|
|
|
11
13
|
### To Use Locally
|
|
14
|
+
|
|
12
15
|
Ensure you have docker installed on your computer and run the following command from any location on your terminal:
|
|
13
16
|
|
|
14
17
|
```shell
|
|
@@ -20,6 +23,7 @@ The above command pulls the `webqit/webflo` image to your local machine. (But th
|
|
|
20
23
|
Next is to use the following commands to start the container and the Webflo runtime. In each case, the first part of the command starts the container, while the second part (from `webflo start`) starts the application.
|
|
21
24
|
|
|
22
25
|
#### To Start
|
|
26
|
+
|
|
23
27
|
Start the container using `docker run`; map a port (e.g `80`) of your host machine to `3000` of the container (unless changed webflo expects to run on port `3000`); optionally, give your container a name; reference `webqit/webflo` as the image to use; and lastly, start webflo using `webflo start`.
|
|
24
28
|
|
|
25
29
|
```shell
|
|
@@ -29,6 +33,7 @@ docker run -d -p 80:3000 --name my-app webqit/webflo webflo start
|
|
|
29
33
|
Visit [localhost](http://localhost) to view your app.
|
|
30
34
|
|
|
31
35
|
#### To Start In Dev Mode
|
|
36
|
+
|
|
32
37
|
Webflo's *dev* mode is the perfect mode for developing locally. All you do is append the `--env=dev --watch` flags to your webflo commands. [(Learn more)](#)
|
|
33
38
|
|
|
34
39
|
```shell
|
|
@@ -41,12 +46,12 @@ In *dev* mode, webflo automatically restarts as you make changes to your codebas
|
|
|
41
46
|
docker run -d -v /Users/me/my-app:/home/www/app -p 80:3000 --name my-app webqit/webflo webflo start --env=dev --watch
|
|
42
47
|
```
|
|
43
48
|
|
|
44
|
-
docker run -d -v /Users/ox-harris/Documents/CODE/webqit/webqit.io:/home/www/app -p 80:3000 --name my-app webqit/webflo webflo start --env=dev --watch
|
|
45
|
-
|
|
46
49
|
### To Use In the Cloud
|
|
50
|
+
|
|
47
51
|
TODO
|
|
48
52
|
|
|
49
53
|
### To Deploy An App From Any Repo
|
|
54
|
+
|
|
50
55
|
Whether running locally or in the cloud, webflo can easily take your application from any git repo. This follows webflo's normal `deploy` command.
|
|
51
56
|
|
|
52
57
|
Simply point docker at your container (using `docker exec [container-name]`) and execute the `webflo deploy` command.
|
|
@@ -68,4 +73,5 @@ docker exec my-app webflo restart
|
|
|
68
73
|
```
|
|
69
74
|
|
|
70
75
|
## Extending this Build
|
|
76
|
+
|
|
71
77
|
TODO
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"vanila-javascript"
|
|
13
13
|
],
|
|
14
14
|
"homepage": "https://webqit.io/tooling/webflo",
|
|
15
|
-
"version": "0.8.
|
|
15
|
+
"version": "0.8.52",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"bin": {
|
|
31
31
|
"webflo": "src/index.js",
|
|
32
|
-
"webflo-certbot-http-auth-hook": "src/
|
|
33
|
-
"webflo-certbot-http-cleanup-hook": "src/
|
|
32
|
+
"webflo-certbot-http-auth-hook": "src/services/certbot/http-auth-hook.js",
|
|
33
|
+
"webflo-certbot-http-cleanup-hook": "src/services/certbot/http-cleanup-hook.js"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@octokit/auth-basic": "^1.4.6",
|
|
@@ -9,7 +9,7 @@ import Webpack from 'webpack';
|
|
|
9
9
|
import { _beforeLast } from '@webqit/util/str/index.js';
|
|
10
10
|
import { _isObject, _isArray, _isEmpty } from '@webqit/util/js/index.js';
|
|
11
11
|
import * as DotJs from '@webqit/backpack/src/dotfiles/DotJs.js';
|
|
12
|
-
import * as client from '
|
|
12
|
+
import * as client from '../../config/client.js'
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -27,7 +27,7 @@ export async function build(Ui, flags = {}, layout = {}) {
|
|
|
27
27
|
const config = await client.read(flags, layout);
|
|
28
28
|
// Consistent forward slashing
|
|
29
29
|
const forwardSlash = str => str.replace(/\\/g, '/');
|
|
30
|
-
var modulesDir = forwardSlash(Url.fileURLToPath(Path.join(import.meta.url, '
|
|
30
|
+
var modulesDir = forwardSlash(Url.fileURLToPath(Path.join(import.meta.url, '../../../runtime/client')));
|
|
31
31
|
|
|
32
32
|
var workerDirSplit = Path.resolve(layout.WORKER_DIR).replace(/\\/g, '/').split('/');
|
|
33
33
|
var workerParams = config.worker || {};
|
|
@@ -85,17 +85,17 @@ export async function build(Ui, flags = {}, layout = {}) {
|
|
|
85
85
|
Ui.title(`CLIENT BUILD`);
|
|
86
86
|
|
|
87
87
|
const clientBuild = { imports: {}, code: [], };
|
|
88
|
-
clientBuild.imports[modulesDir + '/
|
|
88
|
+
clientBuild.imports[modulesDir + '/Runtime.js'] = 'Runtime';
|
|
89
89
|
|
|
90
90
|
// ------------------
|
|
91
91
|
// >> Routes mapping
|
|
92
92
|
buildRoutes(clientBuild, Ui, Path.resolve(layout.CLIENT_DIR), 'Client-Side Routing:');
|
|
93
93
|
clientBuild.code.push(``);
|
|
94
|
-
clientBuild.code.push(`// >>
|
|
94
|
+
clientBuild.code.push(`// >> Runtime Params`);
|
|
95
95
|
buildParams(clientBuild, clientParams, 'params');
|
|
96
96
|
clientBuild.code.push(``);
|
|
97
|
-
clientBuild.code.push(`// >>
|
|
98
|
-
clientBuild.code.push(`
|
|
97
|
+
clientBuild.code.push(`// >> Runtime Instantiation`);
|
|
98
|
+
clientBuild.code.push(`Runtime.call(null, layout, params);`);
|
|
99
99
|
// ------------------
|
|
100
100
|
|
|
101
101
|
// ------------------
|
|
@@ -107,9 +107,9 @@ export async function build(Ui, flags = {}, layout = {}) {
|
|
|
107
107
|
};
|
|
108
108
|
waiting = Ui.waiting(`Writing the client entry file: ${clientBundlingConfig.intermediate}`);
|
|
109
109
|
waiting.start();
|
|
110
|
-
DotJs.write(clientBuild, clientBundlingConfig.intermediate, '
|
|
110
|
+
DotJs.write(clientBuild, clientBundlingConfig.intermediate, 'Runtime Build File');
|
|
111
111
|
waiting.stop();
|
|
112
|
-
Ui.info(Ui.f`
|
|
112
|
+
Ui.info(Ui.f`Runtime Build file: ${clientBundlingConfig.intermediate}`);
|
|
113
113
|
// ------------------
|
|
114
114
|
|
|
115
115
|
// -------------------
|
|
@@ -124,10 +124,23 @@ export async function build(Ui, flags = {}, layout = {}) {
|
|
|
124
124
|
await createBundle(Ui, workerBundlingConfig, 'Bundling the Service Worker Build file');
|
|
125
125
|
}
|
|
126
126
|
if (clientParams.bundling !== false) {
|
|
127
|
-
|
|
127
|
+
clientBundlingConfig.experiments = clientBundlingConfig.experiments || {};
|
|
128
|
+
if (!('outputModule' in clientBundlingConfig.experiments)) {
|
|
129
|
+
clientBundlingConfig.experiments.outputModule = true;
|
|
130
|
+
clientBundlingConfig.externalsType = 'module';
|
|
131
|
+
}
|
|
132
|
+
if (clientBundlingConfig.experiments.outputModule !== false) {
|
|
133
|
+
clientBundlingConfig.output = clientBundlingConfig.output || {};
|
|
134
|
+
clientBundlingConfig.output.environment = clientBundlingConfig.output.environment || {};
|
|
135
|
+
if (!('module' in clientBundlingConfig.output)) {
|
|
136
|
+
clientBundlingConfig.output.module = true;
|
|
137
|
+
clientBundlingConfig.output.environment.module = true;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
await createBundle(Ui, clientBundlingConfig, 'Bundling the Runtime Build file');
|
|
128
141
|
}
|
|
129
142
|
|
|
130
|
-
}
|
|
143
|
+
}
|
|
131
144
|
|
|
132
145
|
/**
|
|
133
146
|
* Creates a bundle using webpack
|
|
@@ -245,4 +258,4 @@ const buildParams = (build, params, varName = null, indentation = 0) => {
|
|
|
245
258
|
}
|
|
246
259
|
});
|
|
247
260
|
if (varName) build.code.push(`};`);
|
|
248
|
-
}
|
|
261
|
+
};
|
package/src/index.js
CHANGED
|
@@ -9,16 +9,18 @@ import parseArgs from '@webqit/backpack/src/cli/parseArgs.js';
|
|
|
9
9
|
import Ui from '@webqit/backpack/src/cli/Ui.js';
|
|
10
10
|
import * as DotJson from '@webqit/backpack/src/dotfiles/DotJson.js';
|
|
11
11
|
import { Promptx } from '@webqit/backpack/src/cli/Promptx.js';
|
|
12
|
+
import * as build from './build/index.js';
|
|
12
13
|
import * as config from './config/index.js';
|
|
13
|
-
import * as
|
|
14
|
+
import * as runtime from './runtime/index.js';
|
|
15
|
+
import * as services from './services/index.js';
|
|
14
16
|
|
|
15
17
|
// ------------------------------------------
|
|
16
18
|
|
|
17
19
|
const commands = {
|
|
18
20
|
config: 'Starts a configuration process.',
|
|
19
|
-
build:
|
|
20
|
-
deploy:
|
|
21
|
-
...
|
|
21
|
+
build: build.client.desc.build,
|
|
22
|
+
deploy: services.origins.desc.deploy,
|
|
23
|
+
...runtime.server.desc,
|
|
22
24
|
};
|
|
23
25
|
|
|
24
26
|
// ------------------------------------------
|
|
@@ -37,60 +39,60 @@ console.log('');
|
|
|
37
39
|
// --------------------------
|
|
38
40
|
|
|
39
41
|
case 'build':
|
|
40
|
-
|
|
42
|
+
build.client.build(Ui, flags, layout);
|
|
41
43
|
break;
|
|
42
44
|
|
|
43
45
|
// --------------------------
|
|
44
46
|
|
|
45
|
-
case '
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
case 'config':
|
|
48
|
+
|
|
49
|
+
var domain = Object.keys(keywords)[0];
|
|
48
50
|
// ----------------
|
|
49
|
-
if (!
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
origin = await Promptx({
|
|
55
|
-
name: 'origin',
|
|
51
|
+
if (!domain && ellipsis) {
|
|
52
|
+
domain = await Promptx({
|
|
53
|
+
name: 'domain',
|
|
56
54
|
type: 'select',
|
|
57
|
-
choices:
|
|
58
|
-
message: 'Please select a
|
|
59
|
-
}).then(d => d.
|
|
55
|
+
choices: Object.keys(config).map(c => ({value: c})),
|
|
56
|
+
message: 'Please select a configuration domain',
|
|
57
|
+
}).then(d => d.domain);
|
|
60
58
|
}
|
|
61
|
-
if (!
|
|
62
|
-
Ui.log(Ui.f`Please add
|
|
59
|
+
if (!domain || !config[domain]) {
|
|
60
|
+
Ui.log(Ui.f`Please add a configuration domain to the ${command} command. For options, use the ellipsis ${'...'}`);
|
|
63
61
|
return;
|
|
64
62
|
}
|
|
65
63
|
// ----------------
|
|
66
|
-
|
|
64
|
+
const data = await config[domain].read(flags, layout);
|
|
65
|
+
Promptx(await config[domain].questions(data, {}, layout)).then(async _data => {
|
|
66
|
+
await config[domain].write(_merge(data, _data), flags, layout);
|
|
67
|
+
});
|
|
68
|
+
|
|
67
69
|
break;
|
|
68
70
|
|
|
69
71
|
// --------------------------
|
|
70
72
|
|
|
71
73
|
case 'start':
|
|
72
|
-
|
|
74
|
+
runtime.server.start(Ui, flags, layout);
|
|
73
75
|
break;
|
|
74
76
|
|
|
75
77
|
case 'stop':
|
|
76
78
|
case 'restart':
|
|
77
|
-
var
|
|
79
|
+
var _runtime = Object.keys(keywords)[0];
|
|
78
80
|
// ----------------
|
|
79
|
-
if (!
|
|
80
|
-
|
|
81
|
+
if (!_runtime && ellipsis) {
|
|
82
|
+
_runtime = await Promptx({
|
|
81
83
|
name: 'runtime',
|
|
82
84
|
type: 'select',
|
|
83
|
-
choices: (await
|
|
85
|
+
choices: (await runtime.server.processes(Ui)).map(r => ({title: r.name, description: r.status, value: r.name})).concat({description: 'All of the above', value: 'all'}),
|
|
84
86
|
message: 'Please select a runtime name',
|
|
85
87
|
}).then(d => d.runtime);
|
|
86
88
|
}
|
|
87
89
|
// ----------------
|
|
88
|
-
await
|
|
90
|
+
await runtime.server[command](Ui, _runtime || 'all', flags);
|
|
89
91
|
process.exit();
|
|
90
92
|
break;
|
|
91
93
|
|
|
92
94
|
case 'processes':
|
|
93
|
-
const processes = await
|
|
95
|
+
const processes = await runtime.server.processes(Ui, flags);
|
|
94
96
|
Ui.title(`SERVERS`);
|
|
95
97
|
if (processes.length) {
|
|
96
98
|
processes.forEach(service => {
|
|
@@ -104,35 +106,35 @@ console.log('');
|
|
|
104
106
|
|
|
105
107
|
// --------------------------
|
|
106
108
|
|
|
107
|
-
case '
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
case 'deploy':
|
|
110
|
+
var origin = Object.keys(keywords)[0],
|
|
111
|
+
options;
|
|
110
112
|
// ----------------
|
|
111
|
-
if (!
|
|
112
|
-
|
|
113
|
-
|
|
113
|
+
if (!origin && ellipsis) {
|
|
114
|
+
if (!(options = (await config.origins.read(flags, layout)).REPOS) || _isEmpty(options)) {
|
|
115
|
+
Ui.log(Ui.f`Please configure an origin (${'webflo config ...'}) to use the ${'deploy'} command.`);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
origin = await Promptx({
|
|
119
|
+
name: 'origin',
|
|
114
120
|
type: 'select',
|
|
115
|
-
choices:
|
|
116
|
-
message: 'Please select a
|
|
117
|
-
}).then(d => d.
|
|
121
|
+
choices: options.map(r => ({value: r.TAG})),
|
|
122
|
+
message: 'Please select a origin',
|
|
123
|
+
}).then(d => d.origin);
|
|
118
124
|
}
|
|
119
|
-
if (!
|
|
120
|
-
Ui.log(Ui.f`Please add
|
|
125
|
+
if (!origin) {
|
|
126
|
+
Ui.log(Ui.f`Please add an origin name to the ${command} command. For options, use the ellipsis ${'...'}`);
|
|
121
127
|
return;
|
|
122
128
|
}
|
|
123
129
|
// ----------------
|
|
124
|
-
|
|
125
|
-
Promptx(await config[domain].questions(data, {}, layout)).then(async _data => {
|
|
126
|
-
await config[domain].write(_merge(data, _data), flags, layout);
|
|
127
|
-
});
|
|
128
|
-
|
|
130
|
+
services.origins.deploy(Ui, origin, flags, layout);
|
|
129
131
|
break;
|
|
130
132
|
|
|
131
133
|
// --------------------------
|
|
132
134
|
|
|
133
135
|
case 'cert':
|
|
134
136
|
var domains = Object.keys(keywords);
|
|
135
|
-
|
|
137
|
+
services.certbot.generate(Ui, domains, flags, layout);
|
|
136
138
|
break;
|
|
137
139
|
|
|
138
140
|
case 'help':
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -172,7 +172,7 @@ export default class Http {
|
|
|
172
172
|
instance.history.pushState(instance.history.state, '', instance.location.href);
|
|
173
173
|
} catch(e) {}
|
|
174
174
|
}
|
|
175
|
-
}, {diff: true});
|
|
175
|
+
}, { diff: true });
|
|
176
176
|
|
|
177
177
|
// ----------------------------------
|
|
178
178
|
const createRequest = (url, referrer, e = {}) => {
|
|
File without changes
|
|
File without changes
|
|
@@ -152,7 +152,7 @@ export default function(layout, params) {
|
|
|
152
152
|
// Render...
|
|
153
153
|
// --------
|
|
154
154
|
|
|
155
|
-
if (
|
|
155
|
+
if (/*document.activeElement === document.body && */event && _isObject(event.detail) && (event.detail.src instanceof Element) && /* do only on url path change */ _before(event.value, '?') !== _before(event.oldValue, '?')) {
|
|
156
156
|
setTimeout(() => {
|
|
157
157
|
var urlTarget;
|
|
158
158
|
if (clientNavigationEvent.url.hash && (urlTarget = document.querySelector(clientNavigationEvent.url.hash))) {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -19,7 +19,7 @@ import _delay from '@webqit/util/js/delay.js';
|
|
|
19
19
|
import { slice as _streamSlice } from 'stream-slice';
|
|
20
20
|
import { v4 as uuidv4, v5 as uuidv5 } from 'uuid';
|
|
21
21
|
import * as config from '../../config/index.js';
|
|
22
|
-
import * as
|
|
22
|
+
import * as services from '../../services/index.js';
|
|
23
23
|
import NavigationEvent from './NavigationEvent.js';
|
|
24
24
|
import Router from './Router.js';
|
|
25
25
|
|
|
@@ -321,8 +321,8 @@ export async function run(instanceSetup, hostSetup, request, response, Ui, flags
|
|
|
321
321
|
// --------
|
|
322
322
|
// ROUTE FOR DEPLOY
|
|
323
323
|
// --------
|
|
324
|
-
if (
|
|
325
|
-
await
|
|
324
|
+
if (services.origins) {
|
|
325
|
+
await services.origins.hook(Ui, serverNavigationEvent, async (payload, defaultPeployFn) => {
|
|
326
326
|
var exitCode = await router.route('deploy', serverNavigationEvent, payload, function(event, _payload) {
|
|
327
327
|
return defaultPeployFn(_payload);
|
|
328
328
|
});
|
|
@@ -7,8 +7,8 @@ import Path from 'path';
|
|
|
7
7
|
import Pm2 from 'pm2';
|
|
8
8
|
import _promise from '@webqit/util/js/promise.js';
|
|
9
9
|
import * as DotJson from '@webqit/backpack/src/dotfiles/DotJson.js';
|
|
10
|
-
import * as server from '
|
|
11
|
-
import
|
|
10
|
+
import * as server from '../../config/server.js'
|
|
11
|
+
import Runtime from './Runtime.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @description
|
|
@@ -26,7 +26,7 @@ export const desc = {
|
|
|
26
26
|
export async function start(Ui, flags = {}, layout = {}) {
|
|
27
27
|
const config = await server.read(flags, layout);
|
|
28
28
|
const currentDir = Path.dirname(Url.fileURLToPath(import.meta.url));
|
|
29
|
-
const script = Path.resolve(currentDir, '
|
|
29
|
+
const script = Path.resolve(currentDir, './index.mjs');
|
|
30
30
|
// -------------------
|
|
31
31
|
// Splash screen
|
|
32
32
|
// -------------------
|
|
@@ -34,7 +34,7 @@ export async function start(Ui, flags = {}, layout = {}) {
|
|
|
34
34
|
// -------------------
|
|
35
35
|
// Splash screen
|
|
36
36
|
// -------------------
|
|
37
|
-
const WEBFLO = DotJson.read(Path.join(currentDir, '
|
|
37
|
+
const WEBFLO = DotJson.read(Path.join(currentDir, '../../../package.json'));
|
|
38
38
|
Ui.banner(WEBFLO.title, WEBFLO.version);
|
|
39
39
|
Ui.log('');
|
|
40
40
|
Ui.log(Ui.f`${'-------------------------------'}`);
|
|
@@ -51,7 +51,7 @@ export async function start(Ui, flags = {}, layout = {}) {
|
|
|
51
51
|
Ui.log(Ui.f`${'-------------------------------'}`);
|
|
52
52
|
Ui.log('');
|
|
53
53
|
if (processName) {
|
|
54
|
-
Ui.success(`
|
|
54
|
+
Ui.success(`Runtime running in ${Ui.style.keyword('production')}; ${(processAutoRestart ? 'will' : 'wo\'nt')} autorestart on crash!`);
|
|
55
55
|
Ui.info(Ui.f`Process name: ${processName}`);
|
|
56
56
|
Ui.log('');
|
|
57
57
|
}
|
|
@@ -109,7 +109,7 @@ export async function start(Ui, flags = {}, layout = {}) {
|
|
|
109
109
|
});
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
|
-
await
|
|
112
|
+
await Runtime.call(null, Ui, flags);
|
|
113
113
|
showRunning();
|
|
114
114
|
};
|
|
115
115
|
|
|
@@ -124,7 +124,7 @@ export function stop(Ui, name, flags = {}) {
|
|
|
124
124
|
if (err) {
|
|
125
125
|
Ui.error(err);
|
|
126
126
|
} else {
|
|
127
|
-
Ui.success(Ui.f`
|
|
127
|
+
Ui.success(Ui.f`Runtime ${flags.kill ? 'killed' : 'stopped'}: ${name}`);
|
|
128
128
|
}
|
|
129
129
|
resolve();
|
|
130
130
|
};
|
|
@@ -148,7 +148,7 @@ export function restart(Ui, name, flags = {}) {
|
|
|
148
148
|
if (err) {
|
|
149
149
|
Ui.error(err);
|
|
150
150
|
} else {
|
|
151
|
-
Ui.success(Ui.f`
|
|
151
|
+
Ui.success(Ui.f`Runtime restarted: ${name}`);
|
|
152
152
|
}
|
|
153
153
|
resolve();
|
|
154
154
|
});
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import parseArgs from '@webqit/backpack/src/cli/parseArgs.js';
|
|
6
6
|
import Ui from '@webqit/backpack/src/cli/Ui.js';
|
|
7
|
-
import
|
|
7
|
+
import Runtime from './Runtime.js';
|
|
8
8
|
|
|
9
9
|
const { flags } = parseArgs(process.argv);
|
|
10
|
-
|
|
10
|
+
Runtime.call(null, Ui, flags);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
* imports
|
|
4
4
|
*/
|
|
5
5
|
import Fs from 'fs';
|
|
6
|
-
import Readline from 'readline';
|
|
7
6
|
import { spawn } from 'child_process';
|
|
8
7
|
import _arrFrom from '@webqit/util/arr/from.js';
|
|
9
|
-
import * as _server from '
|
|
8
|
+
import * as _server from '../../config/server.js';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* @description
|
|
@@ -72,4 +71,4 @@ export async function generate(Ui, allDomains, flags = {}, layout = {}) {
|
|
|
72
71
|
}
|
|
73
72
|
process.exit();
|
|
74
73
|
});
|
|
75
|
-
}
|
|
74
|
+
}
|
|
@@ -10,7 +10,7 @@ import _beforeLast from '@webqit/util/str/beforeLast.js';
|
|
|
10
10
|
import _isObject from '@webqit/util/js/isObject.js';
|
|
11
11
|
import SimpleGit from 'simple-git';
|
|
12
12
|
import Webhooks from '@octokit/webhooks';
|
|
13
|
-
import * as origins from '
|
|
13
|
+
import * as origins from '../../config/origins.js';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @description
|
|
@@ -133,7 +133,7 @@ export async function deploy(Ui, origin, flags = {}, layout = {}) {
|
|
|
133
133
|
return pull();
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
|
-
}
|
|
136
|
+
}
|
|
137
137
|
|
|
138
138
|
/**
|
|
139
139
|
* @hook
|
|
@@ -183,4 +183,4 @@ export async function hook(Ui, event, deployCallback, flags = {}, layout = {}) {
|
|
|
183
183
|
payload: submits.payload /* JSON object */,
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
|
-
}
|
|
186
|
+
}
|