@webqit/webflo 0.11.61-0 → 1.0.0

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.
Files changed (118) hide show
  1. package/.gitignore +7 -7
  2. package/LICENSE +20 -20
  3. package/README.md +2079 -2074
  4. package/docker/Dockerfile +42 -42
  5. package/docker/README.md +91 -91
  6. package/docker/package.json +2 -2
  7. package/package.json +80 -81
  8. package/src/{Context.js → AbstractContext.js} +71 -79
  9. package/src/config-pi/deployment/Env.js +68 -68
  10. package/src/config-pi/deployment/Layout.js +63 -63
  11. package/src/config-pi/deployment/Origins.js +139 -139
  12. package/src/config-pi/deployment/Proxy.js +74 -74
  13. package/src/config-pi/deployment/index.js +17 -17
  14. package/src/config-pi/index.js +15 -15
  15. package/src/config-pi/runtime/Client.js +116 -98
  16. package/src/config-pi/runtime/Server.js +125 -125
  17. package/src/config-pi/runtime/client/Worker.js +109 -134
  18. package/src/config-pi/runtime/client/index.js +11 -11
  19. package/src/config-pi/runtime/index.js +17 -17
  20. package/src/config-pi/runtime/server/Headers.js +74 -74
  21. package/src/config-pi/runtime/server/Redirects.js +69 -69
  22. package/src/config-pi/runtime/server/index.js +13 -13
  23. package/src/config-pi/static/Manifest.js +319 -319
  24. package/src/config-pi/static/Ssg.js +49 -49
  25. package/src/config-pi/static/index.js +13 -13
  26. package/src/deployment-pi/index.js +10 -10
  27. package/src/deployment-pi/origins/index.js +216 -216
  28. package/src/index.js +11 -19
  29. package/src/runtime-pi/HttpEvent.js +126 -106
  30. package/src/runtime-pi/HttpUser.js +126 -0
  31. package/src/runtime-pi/MessagingOverBroadcast.js +9 -0
  32. package/src/runtime-pi/MessagingOverChannel.js +85 -0
  33. package/src/runtime-pi/MessagingOverSocket.js +106 -0
  34. package/src/runtime-pi/MultiportMessagingAPI.js +81 -0
  35. package/src/runtime-pi/WebfloCookieStorage.js +27 -0
  36. package/src/runtime-pi/WebfloEventTarget.js +39 -0
  37. package/src/runtime-pi/WebfloMessageEvent.js +58 -0
  38. package/src/runtime-pi/WebfloMessagingAPI.js +69 -0
  39. package/src/runtime-pi/{Router.js → WebfloRouter.js} +99 -130
  40. package/src/runtime-pi/WebfloRuntime.js +52 -0
  41. package/src/runtime-pi/WebfloStorage.js +109 -0
  42. package/src/runtime-pi/client/ClientMessaging.js +5 -0
  43. package/src/runtime-pi/client/Context.js +3 -7
  44. package/src/runtime-pi/client/CookieStorage.js +17 -0
  45. package/src/runtime-pi/client/Router.js +38 -48
  46. package/src/runtime-pi/client/SessionStorage.js +33 -0
  47. package/src/runtime-pi/client/Url.js +156 -205
  48. package/src/runtime-pi/client/WebfloClient.js +544 -0
  49. package/src/runtime-pi/client/WebfloRootClient1.js +179 -0
  50. package/src/runtime-pi/client/WebfloRootClient2.js +109 -0
  51. package/src/runtime-pi/client/WebfloSubClient.js +165 -0
  52. package/src/runtime-pi/client/Workport.js +118 -178
  53. package/src/runtime-pi/client/generate.js +480 -471
  54. package/src/runtime-pi/client/index.js +16 -21
  55. package/src/runtime-pi/client/worker/ClientMessaging.js +5 -0
  56. package/src/runtime-pi/client/worker/Context.js +3 -7
  57. package/src/runtime-pi/client/worker/CookieStorage.js +17 -0
  58. package/src/runtime-pi/client/worker/SessionStorage.js +13 -0
  59. package/src/runtime-pi/client/worker/WebfloWorker.js +294 -0
  60. package/src/runtime-pi/client/worker/Workport.js +17 -85
  61. package/src/runtime-pi/client/worker/index.js +10 -21
  62. package/src/runtime-pi/index.js +6 -13
  63. package/src/runtime-pi/server/ClientMessaging.js +18 -0
  64. package/src/runtime-pi/server/ClientMessagingRegistry.js +57 -0
  65. package/src/runtime-pi/server/Context.js +11 -15
  66. package/src/runtime-pi/server/CookieStorage.js +17 -0
  67. package/src/runtime-pi/server/Router.js +93 -159
  68. package/src/runtime-pi/server/SessionStorage.js +53 -0
  69. package/src/runtime-pi/server/WebfloServer.js +755 -0
  70. package/src/runtime-pi/server/index.js +10 -21
  71. package/src/runtime-pi/util-http.js +322 -86
  72. package/src/runtime-pi/util-url.js +146 -146
  73. package/src/runtime-pi/xURL.js +108 -105
  74. package/src/runtime-pi/xfetch.js +22 -22
  75. package/src/services-pi/cert/http-auth-hook.js +22 -22
  76. package/src/services-pi/cert/http-cleanup-hook.js +22 -22
  77. package/src/services-pi/cert/index.js +79 -79
  78. package/src/services-pi/index.js +8 -8
  79. package/src/static-pi/index.js +10 -10
  80. package/src/webflo.js +30 -30
  81. package/test/index.test.js +26 -26
  82. package/test/site/package.json +9 -9
  83. package/test/site/public/bundle.html +5 -5
  84. package/test/site/public/bundle.html.json +3 -3
  85. package/test/site/public/bundle.js +2 -2
  86. package/test/site/public/bundle.webflo.js +15 -15
  87. package/test/site/public/index.html +29 -29
  88. package/test/site/public/index1.html +34 -34
  89. package/test/site/public/page-2/bundle.html +4 -4
  90. package/test/site/public/page-2/bundle.js +2 -2
  91. package/test/site/public/page-2/index.html +45 -45
  92. package/test/site/public/page-2/main.html +2 -2
  93. package/test/site/public/page-4/subpage/bundle.js +2 -2
  94. package/test/site/public/page-4/subpage/index.html +30 -30
  95. package/test/site/public/sparoots.json +4 -4
  96. package/test/site/public/worker.js +3 -3
  97. package/test/site/server/index.js +15 -15
  98. package/src/runtime-pi/Application.js +0 -29
  99. package/src/runtime-pi/Cookies.js +0 -82
  100. package/src/runtime-pi/Runtime.js +0 -21
  101. package/src/runtime-pi/client/Application.js +0 -100
  102. package/src/runtime-pi/client/Runtime.js +0 -332
  103. package/src/runtime-pi/client/createStorage.js +0 -57
  104. package/src/runtime-pi/client/oohtml/full.js +0 -7
  105. package/src/runtime-pi/client/oohtml/namespacing.js +0 -7
  106. package/src/runtime-pi/client/oohtml/scripting.js +0 -8
  107. package/src/runtime-pi/client/oohtml/templating.js +0 -8
  108. package/src/runtime-pi/client/worker/Application.js +0 -44
  109. package/src/runtime-pi/client/worker/Runtime.js +0 -269
  110. package/src/runtime-pi/server/Application.js +0 -116
  111. package/src/runtime-pi/server/Runtime.js +0 -557
  112. package/src/runtime-pi/xFormData.js +0 -24
  113. package/src/runtime-pi/xHeaders.js +0 -146
  114. package/src/runtime-pi/xRequest.js +0 -46
  115. package/src/runtime-pi/xRequestHeaders.js +0 -109
  116. package/src/runtime-pi/xResponse.js +0 -33
  117. package/src/runtime-pi/xResponseHeaders.js +0 -117
  118. package/src/runtime-pi/xxHttpMessage.js +0 -102
package/docker/Dockerfile CHANGED
@@ -1,43 +1,43 @@
1
- # Base installations
2
- # (Node 18 is the minimum required version: stable Fetch API, etc)
3
- FROM node:18-alpine
4
- RUN apk add git
5
- RUN apk add certbot
6
-
7
- # Refer to https://www.digitalocean.com/community/tutorials/how-to-build-a-node-js-application-with-docker
8
- # By default, the Docker Node image includes a non-root node user that we can use to avoid running the application container as root.
9
- USER node
10
-
11
- # Create the working directory with node-user permissions
12
- RUN mkdir -p /home/node/www/app && chown -R node:node /home/node/www
13
- WORKDIR /home/node/www
14
-
15
- # Adding this COPY instruction before running npm install or copying the application code allows you to take advantage of Docker’s caching mechanism.
16
- COPY -chown=node:node package*.json ./
17
-
18
- # Install
19
- RUN npm install
20
- # If you are building your code for production
21
- # RUN npm ci --only=production
22
-
23
- # Copy application code with node-user permissions
24
- COPY --chown=node:node . .
25
-
26
- # Install Webflo and friends globally
27
- RUN npm install @webqit/webflo -g
28
- RUN npm install @webqit/oohtml-cli -g
29
- RUN npm install pm2 -g
30
-
31
- # The deployment directory
32
- WORKDIR /home/node/www/app
33
-
34
- # To auto-start app (flags optional), we would add...
35
- # CMD ["webflo", "start"]
36
-
37
- # To build the image locally...
38
- # docker build --no-cache -t webflo ./docker
39
-
40
- # To publish to docker hub...
41
- # docker login -u webqit
42
- # docker tag webflo webqit/webflo
1
+ # Base installations
2
+ # (Node 18 is the minimum required version: stable Fetch API, etc)
3
+ FROM node:18-alpine
4
+ RUN apk add git
5
+ RUN apk add certbot
6
+
7
+ # Refer to https://www.digitalocean.com/community/tutorials/how-to-build-a-node-js-application-with-docker
8
+ # By default, the Docker Node image includes a non-root node user that we can use to avoid running the application container as root.
9
+ USER node
10
+
11
+ # Create the working directory with node-user permissions
12
+ RUN mkdir -p /home/node/www/app && chown -R node:node /home/node/www
13
+ WORKDIR /home/node/www
14
+
15
+ # Adding this COPY instruction before running npm install or copying the application code allows you to take advantage of Docker’s caching mechanism.
16
+ COPY -chown=node:node package*.json ./
17
+
18
+ # Install
19
+ RUN npm install
20
+ # If you are building your code for production
21
+ # RUN npm ci --only=production
22
+
23
+ # Copy application code with node-user permissions
24
+ COPY --chown=node:node . .
25
+
26
+ # Install Webflo and friends globally
27
+ RUN npm install @webqit/webflo -g
28
+ RUN npm install @webqit/oohtml-cli -g
29
+ RUN npm install pm2 -g
30
+
31
+ # The deployment directory
32
+ WORKDIR /home/node/www/app
33
+
34
+ # To auto-start app (flags optional), we would add...
35
+ # CMD ["webflo", "start"]
36
+
37
+ # To build the image locally...
38
+ # docker build --no-cache -t webflo ./docker
39
+
40
+ # To publish to docker hub...
41
+ # docker login -u webqit
42
+ # docker tag webflo webqit/webflo
43
43
  # docker push webqit/webflo
package/docker/README.md CHANGED
@@ -1,91 +1,91 @@
1
- # Webflo Container
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.
4
-
5
- ## Usage
6
-
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.
8
-
9
- + [To Use Locally](#to-use-locally)
10
- + [To Use In the Cloud](#to-use-in-the-cloud)
11
- * [To Deploy An App From Any Repo](#to-deploy-an-app-from-any-repo)
12
-
13
- ### To Use Locally
14
-
15
- Ensure you have docker installed on your computer and run the following command from any location on your terminal:
16
-
17
- ```shell
18
- docker pull webqit/webflo:latest
19
- ```
20
-
21
- The above command pulls the `webqit/webflo` image to your local machine. (But this can be automatically done by docker on running any docker commands that reference the `webqit/webflo` image.)
22
-
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.
24
-
25
- #### To Start
26
-
27
- Start the container using `docker run`; map a port (e.g `80`) of your host machine to `3000` of the container; optionally, give your container a name; reference `webqit/webflo` as the image to use; and lastly, start webflo using `webflo start`.
28
-
29
- ```shell
30
- docker run -d -p 80:3000 --name my-app webqit/webflo webflo start
31
- ```
32
-
33
- > Unless a port has been explicitly set via `webflo config server`, webflo *HTTP* port defaults to `3000` or the value specified in an environmental variable named `PORT`. If a `PORT` variable has been defined, then port mapping above would now need to use that variable: `-p 80:${PORT}`.
34
-
35
- Visit [localhost](http://localhost) to view your app.
36
-
37
- #### To Run In HTTPS Mode
38
-
39
- To run Webflo apps in HTTPS inside a container, you basically need to map the appropriate SSL port from the host machine to a custom port in the container.
40
-
41
- Below, we're now mapping port `443` to an application-level port defined as `${SSL_PORT}`.
42
-
43
- ```shell
44
- docker run -d -p 80:${PORT} 443:${SSL_PORT} --name my-app webqit/webflo webflo start
45
- ```
46
-
47
- > Unless an SSL port has been explicitly set via `webflo config server`, webflo *HTTPS* port defaults to `0` (no HTTPS) or the value specified in an environmental variable named `SSL_PORT`.
48
-
49
- If you will be managing your SSL certificates in the host machine, you would also need to *bind-mount* the appropriate certificate volume from the host to the container.
50
-
51
- Below, we're now mapping the directory `/etc/letsencrypt/` - the default location for `letsencrypt` certificates - to an equivalent directory in the container.
52
-
53
- ```shell
54
- docker run -d -p 80:${PORT} 443:${SSL_PORT} -v /etc/letsencrypt/:/etc/letsencrypt/ --name my-app webqit/webflo webflo start
55
- ```
56
-
57
- > Webflo lets you generate `letsencrypt` certificates with the `webflo generate:cert <domain1,domain2,etc>` command. Just be sure to have your app running in HTTP mode to enable the process handle certbot's `http` challenge.
58
-
59
- #### To Start In Dev Mode
60
-
61
- 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)](#)
62
-
63
- ```shell
64
- docker run -d -p 80:3000 --name my-app webqit/webflo webflo start --env=dev --watch
65
- ```
66
-
67
- In *dev* mode, webflo automatically restarts as you make changes to your codebase. But since webflo now lives inside a container, you'll need to *bind* the directory of your source code on your host machine to the `/home/node/www/app` directory of the container.
68
-
69
- ```shell
70
- docker run -d -v /Users/me/my-app:/home/node/www/app -p 80:3000 --name my-app webqit/webflo webflo start --env=dev --watch
71
- ```
72
-
73
- ### To Use In the Cloud
74
-
75
- TODO
76
-
77
- ### To Deploy An App From Any Repo
78
-
79
- Whether running locally or in the cloud, webflo can easily take your application from any git repo. This follows webflo's normal `deploy` command.
80
-
81
- Simply point docker at your container (using `docker exec [container-name]`) and execute the `webflo deploy` command.
82
-
83
- ```shell
84
- docker exec my-app webflo deploy https://github.com/me/my-app.git
85
- ```
86
-
87
- If you will need to install any npm dependencies, you would run `npm install` from within your container.
88
-
89
- ```shell
90
- docker exec my-app npm install
91
- ```
1
+ # Webflo Container
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.
4
+
5
+ ## Usage
6
+
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.
8
+
9
+ + [To Use Locally](#to-use-locally)
10
+ + [To Use In the Cloud](#to-use-in-the-cloud)
11
+ * [To Deploy An App From Any Repo](#to-deploy-an-app-from-any-repo)
12
+
13
+ ### To Use Locally
14
+
15
+ Ensure you have docker installed on your computer and run the following command from any location on your terminal:
16
+
17
+ ```shell
18
+ docker pull webqit/webflo:latest
19
+ ```
20
+
21
+ The above command pulls the `webqit/webflo` image to your local machine. (But this can be automatically done by docker on running any docker commands that reference the `webqit/webflo` image.)
22
+
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.
24
+
25
+ #### To Start
26
+
27
+ Start the container using `docker run`; map a port (e.g `80`) of your host machine to `3000` of the container; optionally, give your container a name; reference `webqit/webflo` as the image to use; and lastly, start webflo using `webflo start`.
28
+
29
+ ```shell
30
+ docker run -d -p 80:3000 --name my-app webqit/webflo webflo start
31
+ ```
32
+
33
+ > Unless a port has been explicitly set via `webflo config server`, webflo *HTTP* port defaults to `3000` or the value specified in an environmental variable named `PORT`. If a `PORT` variable has been defined, then port mapping above would now need to use that variable: `-p 80:${PORT}`.
34
+
35
+ Visit [localhost](http://localhost) to view your app.
36
+
37
+ #### To Run In HTTPS Mode
38
+
39
+ To run Webflo apps in HTTPS inside a container, you basically need to map the appropriate SSL port from the host machine to a custom port in the container.
40
+
41
+ Below, we're now mapping port `443` to an application-level port defined as `${SSL_PORT}`.
42
+
43
+ ```shell
44
+ docker run -d -p 80:${PORT} 443:${SSL_PORT} --name my-app webqit/webflo webflo start
45
+ ```
46
+
47
+ > Unless an SSL port has been explicitly set via `webflo config server`, webflo *HTTPS* port defaults to `0` (no HTTPS) or the value specified in an environmental variable named `SSL_PORT`.
48
+
49
+ If you will be managing your SSL certificates in the host machine, you would also need to *bind-mount* the appropriate certificate volume from the host to the container.
50
+
51
+ Below, we're now mapping the directory `/etc/letsencrypt/` - the default location for `letsencrypt` certificates - to an equivalent directory in the container.
52
+
53
+ ```shell
54
+ docker run -d -p 80:${PORT} 443:${SSL_PORT} -v /etc/letsencrypt/:/etc/letsencrypt/ --name my-app webqit/webflo webflo start
55
+ ```
56
+
57
+ > Webflo lets you generate `letsencrypt` certificates with the `webflo generate:cert <domain1,domain2,etc>` command. Just be sure to have your app running in HTTP mode to enable the process handle certbot's `http` challenge.
58
+
59
+ #### To Start In Dev Mode
60
+
61
+ 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)](#)
62
+
63
+ ```shell
64
+ docker run -d -p 80:3000 --name my-app webqit/webflo webflo start --env=dev --watch
65
+ ```
66
+
67
+ In *dev* mode, webflo automatically restarts as you make changes to your codebase. But since webflo now lives inside a container, you'll need to *bind* the directory of your source code on your host machine to the `/home/node/www/app` directory of the container.
68
+
69
+ ```shell
70
+ docker run -d -v /Users/me/my-app:/home/node/www/app -p 80:3000 --name my-app webqit/webflo webflo start --env=dev --watch
71
+ ```
72
+
73
+ ### To Use In the Cloud
74
+
75
+ TODO
76
+
77
+ ### To Deploy An App From Any Repo
78
+
79
+ Whether running locally or in the cloud, webflo can easily take your application from any git repo. This follows webflo's normal `deploy` command.
80
+
81
+ Simply point docker at your container (using `docker exec [container-name]`) and execute the `webflo deploy` command.
82
+
83
+ ```shell
84
+ docker exec my-app webflo deploy https://github.com/me/my-app.git
85
+ ```
86
+
87
+ If you will need to install any npm dependencies, you would run `npm install` from within your container.
88
+
89
+ ```shell
90
+ docker exec my-app npm install
91
+ ```
@@ -1,3 +1,3 @@
1
- {
2
- "name": "webqit/webflo-docker"
1
+ {
2
+ "name": "webqit/webflo-docker"
3
3
  }
package/package.json CHANGED
@@ -1,81 +1,80 @@
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.61-0",
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-pi/cert/http-auth-hook.js",
35
- "webflo-certbot-http-cleanup-hook": "src/services-pi/cert/http-cleanup-hook.js"
36
- },
37
- "dependencies": {
38
- "@octokit/webhooks": "^7.15.1",
39
- "@webqit/backpack": "^0.1.6",
40
- "@webqit/oohtml-ssr": "^1.1.5",
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.1",
47
- "mime-types": "^2.1.33",
48
- "simple-git": "^2.20.1",
49
- "stream-slice": "^0.1.2",
50
- "urlpattern-polyfill": "^4.0.3"
51
- },
52
- "devDependencies": {
53
- "chai": "^4.3.6",
54
- "coveralls": "^3.1.1",
55
- "mocha": "^10.0.0",
56
- "mocha-lcov-reporter": "^1.3.0"
57
- },
58
- "author": "Oxford Harrison <oxharris.dev@gmail.com>",
59
- "maintainers": [
60
- "Oxford Harrison <oxharris.dev@gmail.com>"
61
- ],
62
- "contributors": [],
63
- "funding": {
64
- "type": "patreon",
65
- "url": "https://patreon.com/ox_harris"
66
- },
67
- "badges": {
68
- "list": [
69
- "npmversion",
70
- "npmdownloads",
71
- "patreon"
72
- ],
73
- "config": {
74
- "patreonUsername": "ox_harris",
75
- "githubUsername": "webqit",
76
- "githubRepository": "webflo",
77
- "githubSlug": "webqit/webflo",
78
- "npmPackageName": "@webqit/webflo"
79
- }
80
- }
81
- }
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": "1.0.0",
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 --tag next",
30
+ "postpublish": "git push && git push --tags"
31
+ },
32
+ "bin": {
33
+ "webflo": "src/webflo.js",
34
+ "webflo-certbot-http-auth-hook": "src/services-pi/cert/http-auth-hook.js",
35
+ "webflo-certbot-http-cleanup-hook": "src/services-pi/cert/http-cleanup-hook.js"
36
+ },
37
+ "dependencies": {
38
+ "@octokit/webhooks": "^7.15.1",
39
+ "@webqit/backpack": "^0.1.6",
40
+ "@webqit/observer": "^2.0.7",
41
+ "@webqit/oohtml-ssr": "^2.1.1",
42
+ "@webqit/util": "^0.8.11",
43
+ "client-sessions": "^0.8.0",
44
+ "esbuild": "^0.14.38",
45
+ "jsdom": "^21.1.1",
46
+ "mime-types": "^2.1.33",
47
+ "simple-git": "^2.20.1",
48
+ "stream-slice": "^0.1.2",
49
+ "urlpattern-polyfill": "^4.0.3"
50
+ },
51
+ "devDependencies": {
52
+ "chai": "^4.3.6",
53
+ "coveralls": "^3.1.1",
54
+ "mocha": "^10.0.0",
55
+ "mocha-lcov-reporter": "^1.3.0"
56
+ },
57
+ "author": "Oxford Harrison <oxharris.dev@gmail.com>",
58
+ "maintainers": [
59
+ "Oxford Harrison <oxharris.dev@gmail.com>"
60
+ ],
61
+ "contributors": [],
62
+ "funding": {
63
+ "type": "patreon",
64
+ "url": "https://patreon.com/ox_harris"
65
+ },
66
+ "badges": {
67
+ "list": [
68
+ "npmversion",
69
+ "npmdownloads",
70
+ "patreon"
71
+ ],
72
+ "config": {
73
+ "patreonUsername": "ox_harris",
74
+ "githubUsername": "webqit",
75
+ "githubRepository": "webflo",
76
+ "githubSlug": "webqit/webflo",
77
+ "npmPackageName": "@webqit/webflo"
78
+ }
79
+ }
80
+ }
@@ -1,80 +1,72 @@
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
- Object.defineProperty(this.dict, 'flags', { value } );
60
- }
61
-
62
- // layout
63
- get layout() {
64
- return this.dict.layout || {};
65
- }
66
-
67
- set layout(value) {
68
- Object.defineProperty(this.dict, 'layout', { value } );
69
- }
70
-
71
- // logger
72
- get logger() {
73
- return this.dict.logger;
74
- }
75
-
76
- set logger(value) {
77
- Object.defineProperty(this.dict, 'logger', { value } );
78
- }
79
-
1
+ export class AbstractContext {
2
+
3
+ constructor(dict, CD = null) {
4
+ // dict can be plain object or some Context instance itself
5
+ // Using it as only a prototype protects it from being mutated down here
6
+ Object.defineProperty(this, 'dict', { value: Object.create(dict), });
7
+ // Now, for enumerable props thet need to be enumerable, where no getter/setter on both instances
8
+ for (let prop in this.dict) {
9
+ if (prop in this) continue;
10
+ this[prop] = this.dict[prop];
11
+ }
12
+ if (arguments.length > 1) {
13
+ Object.defineProperty(this.dict, 'CWD', { get: () => CD });
14
+ }
15
+ }
16
+
17
+ get name() {
18
+ return 'webflo';
19
+ }
20
+
21
+ // create
22
+ static create(...args) {
23
+ return new this(...args);
24
+ }
25
+
26
+ // CWD
27
+ get CWD() {
28
+ return this.dict.CWD || '';
29
+ }
30
+
31
+ // meta
32
+ get meta() {
33
+ return this.dict.meta || {};
34
+ }
35
+
36
+ // app
37
+ get app() {
38
+ return this.dict.app || {};
39
+ }
40
+
41
+ // config
42
+ get config() {
43
+ return this.dict.config || {};
44
+ }
45
+
46
+ // flags
47
+ get flags() {
48
+ return this.dict.flags || {};
49
+ }
50
+
51
+ set flags(value) {
52
+ Object.defineProperty(this.dict, 'flags', { value } );
53
+ }
54
+
55
+ // layout
56
+ get layout() {
57
+ return this.dict.layout || {};
58
+ }
59
+
60
+ set layout(value) {
61
+ Object.defineProperty(this.dict, 'layout', { value } );
62
+ }
63
+
64
+ // logger
65
+ get logger() {
66
+ return this.dict.logger;
67
+ }
68
+
69
+ set logger(value) {
70
+ Object.defineProperty(this.dict, 'logger', { value } );
71
+ }
80
72
  }