@cocreate/server-mesh 1.1.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.
package/README.md ADDED
@@ -0,0 +1,65 @@
1
+ # CoCreate-socket-mesh
2
+
3
+ A pluggable, event-driven WebSocket clustering and P2P mesh driver for CoCreate Server, enabling dynamic server-to-server state synchronization across multi-cloud and bare-metal environments.
4
+
5
+ ![GitHub latest release](https://img.shields.io/github/v/release/CoCreate-app/CoCreate-socket-mesh?style=flat-square)
6
+ ![GitHub contributors](https://img.shields.io/github/contributors/CoCreate-app/CoCreate-socket-mesh?style=flat-square)
7
+ ![License](https://img.shields.io/static/v1?style=flat-square&label=license&message=SSPL&color=green)
8
+ ![Hiring](https://img.shields.io/static/v1?style=flat-square&label=&message=Hiring&color=blueviolet)
9
+
10
+ ![CoCreate](https://cdn.cocreate.app/logo.png)
11
+
12
+ [CoCreate Docs](https://cocreate.app/docs/socket-mesh)
13
+
14
+ We want this library to be community-driven, and CoCreate led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/CoCreate-app/Realtime_Admin_CRM_and_CMS/issues) and [pull requests](https://github.com/CoCreate-app/Realtime_Admin_CRM_and_CMS/pulls) or merely upvote or comment on existing issues or pull requests.
15
+
16
+ We appreciate your continued support, thank you!
17
+
18
+ # Table of Contents
19
+
20
+ - [Table of Contents](#table-of-contents)
21
+ - [Announcements](#announcements)
22
+ - [Roadmap](#roadmap)
23
+ - [How to Contribute](#how-to-contribute)
24
+ - [About](#about)
25
+ - [License](#license)
26
+
27
+ <a name="announcements"></a>
28
+
29
+ # Announcements
30
+
31
+ All updates to this library are documented in our [CHANGELOG](https://github.com/CoCreate-app/CoCreate-socket-mesh/blob/master/CHANGELOG.md) and [releases](https://github.com/CoCreate-app/CoCreate-socket-mesh/releases). You may also subscribe to email for releases and breaking changes.
32
+
33
+ <a name="roadmap"></a>
34
+
35
+ # Roadmap
36
+
37
+ If you are interested in the future direction of this project, please take a look at our open [issues](https://github.com/CoCreate-app/CoCreate-socket-mesh/issues) and [pull requests](https://github.com/CoCreate-app/CoCreate-socket-mesh/pulls). We would love to hear your feedback.
38
+
39
+ <a name="about"></a>
40
+
41
+ # About
42
+
43
+ CoCreate-socket-mesh is guided and supported by the CoCreate Developer Experience Team.
44
+
45
+ Please Email the Developer Experience Team [here](mailto:develop@cocreate.app) in case of any queries.
46
+
47
+ CoCreate-socket-mesh is maintained and funded by CoCreate. The names and logos for CoCreate are trademarks of CoCreate, LLC.
48
+
49
+ <a name="contribute"></a>
50
+
51
+ # How to Contribute
52
+
53
+ We encourage contribution to our libraries (you might even score some nifty swag), please see our [CONTRIBUTING](https://github.com/CoCreate-app/CoCreate-socket-mesh/blob/master/CONTRIBUTING.md) guide for details.
54
+
55
+ <a name="license"></a>
56
+
57
+ # License
58
+
59
+ This software is dual-licensed under the GNU Affero General Public License version 3 (AGPLv3) and a commercial license.
60
+
61
+ - **Open Source Use**: For open-source projects and non-commercial use, this software is available under the AGPLv3. The AGPLv3 allows you to freely use, modify, and distribute this software, provided that all modifications and derivative works are also licensed under the AGPLv3. For the full license text, see the [LICENSE file](https://github.com/CoCreate-app/CoCreate-socket-mesh/blob/master/LICENSE).
62
+
63
+ - **Commercial Use**: For-profit companies and individuals intending to use this software for commercial purposes must obtain a commercial license. The commercial license is available when you sign up for an API key on our [website](https://cocreate.app). This license permits proprietary use and modification of the software without the copyleft requirements of the AGPLv3. It is ideal for integrating this software into proprietary commercial products and applications.
64
+
65
+ If you have not purchased a commercial license and intend to use this software for commercial purposes, you are required to sign up for an API key on our website.
package/demo/server.js ADDED
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+ const express = require('express');
3
+ const cors = require('cors')
4
+ const urlencoded = require('body-parser').urlencoded;
5
+
6
+ const app = express();
7
+ app.use(cors())
8
+ app.use(urlencoded({ extended: false }));
9
+
10
+ const socketServer = require("@cocreate/server-mesh")
11
+ const wsManager = new socketServer("ws");
12
+
13
+ const { createServer } = require('http');
14
+ const server = createServer(app);
15
+ server.on('upgrade', function upgrade(request, socket, head) {
16
+ if (!wsManager.handleUpgrade(request, socket, head)) {
17
+ socket.destroy();
18
+ }
19
+ });
20
+
21
+ const components = require("./components")
22
+ components.init(app, wsManager)
23
+
24
+ server.listen(process.env.PORT || 3000);
@@ -0,0 +1,217 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
7
+ <title>CoCreate-server-mesh Documentation | CoCreateJS</title>
8
+ <link
9
+ rel="icon"
10
+ type="image/png"
11
+ sizes="32x32"
12
+ href="https://cocreate.app/images/favicon.ico" />
13
+ <meta
14
+ name="description"
15
+ content="A simple HTML5 and pure javascript component. Easy configuration using data-attributes and highly styleable." />
16
+ <meta
17
+ name="keywords"
18
+ content="helper classes, utility classes, css framework, css library, inline style classes" />
19
+ <meta name="robots" content="index,follow" />
20
+
21
+ <link rel="manifest" href="/manifest.json" />
22
+ </head>
23
+
24
+ <body>
25
+ <div array="" object="" key="" id="cocreate-server-mesh">
26
+ <div
27
+ class="display:flex flex-wrap:wrap justify-content:space-between margin:10px">
28
+ <div class="display:flex align-items:center">
29
+ <h2>CoCreate-server-mesh</h2>
30
+ </div>
31
+ <div
32
+ class="display:flex align-items:center font-size:20px"
33
+ share-height="600"
34
+ share-width="500"
35
+ share-media="https://via.placeholder.com/300/09f/fff.png">
36
+ <a
37
+ href="https://github.com/CoCreate-app/CoCreate-server-mesh"
38
+ target="_blank"
39
+ class="margin-right:15px"
40
+ ><i class="fab fa-github"></i
41
+ ></a>
42
+ <a
43
+ class="margin-right:15px share"
44
+ share-network="twitter"
45
+ title="Share on twitter"
46
+ ><i class="fab fa-twitter"></i
47
+ ></a>
48
+ <a
49
+ class="margin-right:15px share"
50
+ share-network="facebook"
51
+ title="Share on Facebook"
52
+ ><i class="fab fa-facebook"></i
53
+ ></a>
54
+ <a
55
+ class="margin-right:15px share"
56
+ share-network="instagram"
57
+ title="Share on instagram"
58
+ ><i class="fab fa-instagram"></i
59
+ ></a>
60
+ <a
61
+ class="margin-right:15px share"
62
+ share-network="share"
63
+ title="Share on share"
64
+ ><i class="fas fa-share-alt"></i
65
+ ></a>
66
+ </div>
67
+ </div>
68
+ <p class="max-width:500px margin:20px_10px">
69
+ A simple HTML5, CSS and pure javascript component. Easy
70
+ configuration using data-attributes and highly styleable.
71
+ </p>
72
+ <div id="server-mesh-section" class="display:flex flex-wrap:wrap">
73
+ <div
74
+ class="flex-grow:1 min-width:300px width:50% padding:20px_10px">
75
+ <h2
76
+ class="border-bottom:1px_solid_lightgrey padding:5px_0px">
77
+ Install
78
+ </h2>
79
+ <pre
80
+ class="margin-top:15px"><code class="language-javascript">npm install cocreate-server-mesh</code></pre>
81
+ <p class="padding:10px_0px">Or you can use cdn link:</p>
82
+ <pre><code class="language-javascript">https://cdn.cocreate.app/js/CoCreate-server-mesh.min.js</code></pre>
83
+
84
+ <h2
85
+ class="border-bottom:1px_solid_lightgrey margin-top:20px padding:5px_0px">
86
+ Usage
87
+ </h2>
88
+ <p class="padding:10px_0px">server-mesh usage content</p>
89
+ <pre><code class="language-html">&lt;div&gt;&lt;/div&gt;</code></pre>
90
+
91
+ <h2
92
+ class="border-bottom:1px_solid_lightgrey margin-top:20px padding:5px_0px">
93
+ Reference
94
+ </h2>
95
+ <p class="padding:10px_0px">
96
+ This is server-mesh reference content
97
+ </p>
98
+ <pre><code class="language-javascript">&lt;div&gt;&lt;/div&gt;</code></pre>
99
+ <p class="padding:10px_0px">
100
+ This is server-mesh reference content
101
+ </p>
102
+
103
+ <h2
104
+ class="border-bottom:1px_solid_lightgrey margin-top:20px padding:5px_0px">
105
+ Attributes
106
+ </h2>
107
+ <ul class="list-style-type:none">
108
+ <li
109
+ class="padding:15px_0px border-bottom:1px_solid_lightgrey">
110
+ <h4>
111
+ <span>server-mesh</span>
112
+ <span class="cocreate-badge success"
113
+ >string</span
114
+ >
115
+ <span class="cocreate-badge warning"
116
+ >optional</span
117
+ >
118
+ </h4>
119
+ <p>server-mesh-attribute</p>
120
+ </li>
121
+ <li
122
+ class="padding:15px_0px border-bottom:1px_solid_lightgrey">
123
+ <h4>
124
+ <span>server-mesh</span>
125
+ <span class="cocreate-badge success"
126
+ >string</span
127
+ >
128
+ <span class="cocreate-badge warning"
129
+ >optional</span
130
+ >
131
+ </h4>
132
+ <p>server-mesh-attribute</p>
133
+ </li>
134
+ </ul>
135
+ </div>
136
+
137
+ <div
138
+ class="flex-grow:1 min-width:300px width:50% padding:0px_10px margin:20px_0px border-bottom:1px_solid_lightgrey">
139
+ <!-- SandBox -->
140
+ <div
141
+ class="display:flex flex-direction:column position:relative overflow:hidden card border-radius:2px width:auto height:600px margin-top:20px"
142
+ id="playground">
143
+ <div
144
+ id="demo-code"
145
+ resizable
146
+ class="position:relative height:50%">
147
+ <textarea
148
+ type="code"
149
+ lang="html"
150
+ array="demos"
151
+ object=""
152
+ key="demo"
153
+ save="false"
154
+ id="demo"
155
+ class="height:100% width:100% outline:none border:none resize:none padding:5px"></textarea>
156
+ <div
157
+ resize="bottom"
158
+ class="background:lightgrey"></div>
159
+ </div>
160
+
161
+ <div
162
+ id="demo-preview"
163
+ class="position:relative overflow:auto background-color:white">
164
+ <div get-value="#demo" class="padding:20px"></div>
165
+ </div>
166
+
167
+ <div
168
+ class="font-size:20px position:absolute top:10px right:10px opacity:0.6">
169
+ <a
170
+ class="margin-right:10px"
171
+ id="eye"
172
+ show="#eye-slash"
173
+ hide="#eye, #demo-preview"
174
+ toggle="code-height"
175
+ toggle-query="#demo-code"
176
+ ><i class="far fa-eye"></i
177
+ ></a>
178
+ <a
179
+ class="margin-right:10px"
180
+ hidden
181
+ id="eye-slash"
182
+ show="#eye, #demo-preview"
183
+ hide="#eye-slash"
184
+ toggle="code-height"
185
+ toggle-query="#demo-code"
186
+ ><i class="fas fa-eye-slash"></i
187
+ ></a>
188
+ <a
189
+ class="margin-right:10px"
190
+ id="code"
191
+ show="#code-slash"
192
+ hide="#code, #demo-code"
193
+ ><i class="fa fa-code"></i
194
+ ></a>
195
+ <a
196
+ class="margin-right:10px"
197
+ hidden
198
+ id="code-slash"
199
+ show="#code, #demo-code"
200
+ hide="#code-slash"
201
+ ><i class="fas fa-code"></i
202
+ ></a>
203
+ <a
204
+ class="margin-right:5px"
205
+ fullscreen
206
+ target="#playground"
207
+ ><i class="fas fa-expand"></i
208
+ ></a>
209
+ </div>
210
+ </div>
211
+ <!-- End SandBox -->
212
+ </div>
213
+ </div>
214
+ </div>
215
+ <script src="https://CoCreate.app/dist/CoCreate.js"></script>
216
+ </body>
217
+ </html>
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@cocreate/server-mesh",
3
+ "version": "1.1.0",
4
+ "description": "Pluggable, event-driven WebSocket clustering and P2P mesh driver for CoCreate Server, enabling dynamic server-to-server state synchronization across multi-cloud and bare-metal environments.",
5
+ "keywords": [
6
+ "cocreate-socket",
7
+ "low-code",
8
+ "realtime",
9
+ "realtime-framework",
10
+ "collaboration",
11
+ "shared-editing",
12
+ "html5-framework",
13
+ "javascript-framework"
14
+ ],
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "type": "module",
19
+ "main": "./src/index.js",
20
+ "scripts": {
21
+ "demo": "PORT=5000 node demo/server.js",
22
+ "test": "echo \"Error: no test specified\" && exit 1"
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/CoCreate-app/CoCreate-server-mesh.git"
27
+ },
28
+ "author": "CoCreate LLC",
29
+ "license": "AGPL-3.0",
30
+ "bugs": {
31
+ "url": "https://github.com/CoCreate-app/CoCreate-server-mesh/issues"
32
+ },
33
+ "homepage": "https://cocreate.app/docs/CoCreate-server-mesh",
34
+ "dependencies": {
35
+ "ws": "^8.21.0"
36
+ }
37
+ }
@@ -0,0 +1,16 @@
1
+ module.exports = {
2
+ tabWidth: 4,
3
+ semi: true,
4
+ trailingComma: "none",
5
+ bracketSameLine: true,
6
+ useTabs: true,
7
+ overrides: [
8
+ {
9
+ files: ["*.json", "*.yml", "*.yaml"],
10
+ options: {
11
+ tabWidth: 2,
12
+ useTabs: false
13
+ },
14
+ }
15
+ ],
16
+ };
@@ -0,0 +1,30 @@
1
+ export default {
2
+ dryRun: false,
3
+ branches: ["master"],
4
+ plugins: [
5
+ "@semantic-release/commit-analyzer",
6
+ "@semantic-release/release-notes-generator",
7
+ [
8
+ "@semantic-release/changelog",
9
+ {
10
+ changelogFile: "CHANGELOG.md",
11
+ },
12
+ ],
13
+ "@semantic-release/npm",
14
+ [
15
+ "@semantic-release/github",
16
+ {
17
+ successComment: false,
18
+ failTitle: false,
19
+ },
20
+ ],
21
+ [
22
+ "@semantic-release/git",
23
+ {
24
+ // Only stage and commit the changelog and package.json
25
+ assets: ["CHANGELOG.md", "package.json"],
26
+ message: "chore(release): ${nextRelease.version} [skip ci]",
27
+ },
28
+ ],
29
+ ],
30
+ };