@lmjs/cli 1.0.51 → 2.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.
- package/LICENSE +0 -0
- package/README.md +5 -16
- package/dist/bin/commands.js +2 -0
- package/dist/lib/app.js +3 -0
- package/dist/lib/check-version.js +2 -0
- package/dist/lib/fcs.js +11 -0
- package/{lib → dist/lib}/files/build_serverless/.htaccess +0 -0
- package/{lib/files/build/src → dist/lib/files/build_serverless}/favicon.ico +0 -0
- package/{lib/files/build/src → dist/lib/files/build_serverless}/robots.txt +0 -0
- package/{lib/files/build/src → dist/lib/files/build_serverless}/sitemap.xml +0 -0
- package/dist/lib/files/layout.layout +4 -0
- package/dist/lib/files/libs/bea.css +1 -0
- package/dist/lib/files/libs/lm-with-plugins.js +539 -0
- package/dist/lib/files/libs/lm.js +30 -0
- package/dist/lib/files/libs/lumenjs-plugins.css +2822 -0
- package/{lib → dist/lib}/files/project/config.json +1 -1
- package/dist/lib/files/project/package.json +6 -0
- package/{lib → dist/lib}/files/project/src/404.html +1 -1
- package/{lib → dist/lib}/files/project/src/index.html +3 -3
- package/dist/lib/files/project/src/index.js +1 -0
- package/dist/lib/files/project/src/layouts/default.layout +4 -0
- package/{lib → dist/lib}/files/project/src/views/home.view +2 -3
- package/{lib → dist/lib}/files/sub_view.view +0 -0
- package/dist/lib/files/view.view +13 -0
- package/dist/lib/npm-bundle.js +1 -0
- package/dist/lib/plugins-esbuild-plugin.js +3 -0
- package/package.json +37 -19
- package/bin/commands.js +0 -2
- package/lib/app.js +0 -132
- package/lib/check-version.js +0 -28
- package/lib/fcs.js +0 -804
- package/lib/files/build/func.js +0 -102
- package/lib/files/build/package.json +0 -31
- package/lib/files/build/server.js +0 -58
- package/lib/files/build_serverless/favicon.ico +0 -0
- package/lib/files/build_serverless/robots.txt +0 -4
- package/lib/files/build_serverless/sitemap.xml +0 -9
- package/lib/files/project/src/index.js +0 -15
- package/lib/files/project/src/tpls/tpl1.tpl +0 -1
- package/lib/files/project/src/views/widgets/footer.view +0 -0
- package/lib/files/project/src/views/widgets/header.view +0 -0
- package/lib/files/project/src/views/widgets/nav.view +0 -0
- package/lib/files/tpl.tpl +0 -1
- package/lib/files/view.view +0 -14
- /package/{lib → dist/lib}/files/project/src/images/lumenjs.svg +0 -0
package/lib/files/build/func.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
const axios = require("axios").default;
|
|
2
|
-
const path = require("path");
|
|
3
|
-
const express = require("express");
|
|
4
|
-
var compression = require("compression");
|
|
5
|
-
const app = express();
|
|
6
|
-
const server = require("http").createServer(app);
|
|
7
|
-
|
|
8
|
-
var WebSocketServer = require("ws").Server;
|
|
9
|
-
var wss = new WebSocketServer({ server: server, path: "/" });
|
|
10
|
-
|
|
11
|
-
var cookieParser = require("cookie-parser");
|
|
12
|
-
var expressSession = require("express-session");
|
|
13
|
-
const bodyParser = require("body-parser");
|
|
14
|
-
var multer = require("multer");
|
|
15
|
-
const config = require("./config").config;
|
|
16
|
-
var upload = multer();
|
|
17
|
-
let session = expressSession({
|
|
18
|
-
secret: "lumenjs",
|
|
19
|
-
resave: true,
|
|
20
|
-
saveUninitialized: true,
|
|
21
|
-
cookie: { maxAge: 9999000 },
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
function validURL(string) {
|
|
25
|
-
let url;
|
|
26
|
-
try {
|
|
27
|
-
url = new URL(string);
|
|
28
|
-
} catch (_) {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
return url.protocol === "http:" || url.protocol === "https:";
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
exports.validURL = validURL;
|
|
35
|
-
|
|
36
|
-
exports.config = config;
|
|
37
|
-
exports.server = function () {
|
|
38
|
-
return server;
|
|
39
|
-
};
|
|
40
|
-
exports.app = function () {
|
|
41
|
-
app.use(cookieParser());
|
|
42
|
-
app.use(session);
|
|
43
|
-
app.use(compression());
|
|
44
|
-
app.use(express.static(path.join(__dirname, "./src")));
|
|
45
|
-
app.set("etag", false);
|
|
46
|
-
app.use(bodyParser.urlencoded({ extended: true }));
|
|
47
|
-
app.use(bodyParser.json());
|
|
48
|
-
app.use(bodyParser.raw());
|
|
49
|
-
app.use(upload.array());
|
|
50
|
-
|
|
51
|
-
wss.on("connection", (ws) => {
|
|
52
|
-
ws.on("message", async (message) => {
|
|
53
|
-
try {
|
|
54
|
-
const buffer = Buffer.from(message);
|
|
55
|
-
const data = JSON.parse(buffer.toString());
|
|
56
|
-
|
|
57
|
-
if (data.hasOwnProperty("e")) {
|
|
58
|
-
var _data = {
|
|
59
|
-
e: data.e,
|
|
60
|
-
_iter: data._iter,
|
|
61
|
-
payload: {},
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
if (data.e == "request") {
|
|
65
|
-
try {
|
|
66
|
-
let pata = data.payload;
|
|
67
|
-
let __data = pata["data"];
|
|
68
|
-
let _body = pata["body"];
|
|
69
|
-
let res = await axios({
|
|
70
|
-
method: _body["method"].toString().toLowerCase(),
|
|
71
|
-
url: fcs.validURL(_body["path"])
|
|
72
|
-
? _body["path"]
|
|
73
|
-
: config.apis[_body["api"] ?? 0].baseURL + _body["path"],
|
|
74
|
-
data: __data ?? {},
|
|
75
|
-
headers:
|
|
76
|
-
_body["headers"] ?? config.apis[_body["api"] ?? 0].headers,
|
|
77
|
-
});
|
|
78
|
-
_data.payload = _body["full"]
|
|
79
|
-
? {
|
|
80
|
-
headers: res.headers,
|
|
81
|
-
data: res.data,
|
|
82
|
-
}
|
|
83
|
-
: res.data;
|
|
84
|
-
ws.send(JSON.stringify(_data));
|
|
85
|
-
} catch (e) {
|
|
86
|
-
_data.payload = {
|
|
87
|
-
code: 108,
|
|
88
|
-
error: e.message,
|
|
89
|
-
type: "RequestError",
|
|
90
|
-
};
|
|
91
|
-
ws.send(JSON.stringify(_data));
|
|
92
|
-
}
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
ws.send(JSON.stringify(_data));
|
|
97
|
-
}
|
|
98
|
-
} catch (e) {}
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
return app;
|
|
102
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "beajs-client",
|
|
3
|
-
"version": "1.0.1",
|
|
4
|
-
"description": "Client server for BEA's reactive Javascript Library",
|
|
5
|
-
"main": "./server.js",
|
|
6
|
-
"files": [
|
|
7
|
-
"src/",
|
|
8
|
-
"server.js"
|
|
9
|
-
],
|
|
10
|
-
"keywords": [
|
|
11
|
-
"beajs",
|
|
12
|
-
"BEAJS Client",
|
|
13
|
-
"devkit",
|
|
14
|
-
"sdk",
|
|
15
|
-
"BEAJS DevKit",
|
|
16
|
-
"bea-client",
|
|
17
|
-
"bea.com.lb"
|
|
18
|
-
],
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"axios": "^0.27.2",
|
|
21
|
-
"cookie-parser": "^1.4.6",
|
|
22
|
-
"express": "^4.18.1",
|
|
23
|
-
"express-session": "^1.17.3",
|
|
24
|
-
"compression": "^1.7.4",
|
|
25
|
-
"multer": "^1.4.5-lts.1",
|
|
26
|
-
"ws": "^8.8.1"
|
|
27
|
-
},
|
|
28
|
-
"engines": {
|
|
29
|
-
"node": ">=12.0.0"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const axios = require("axios").default;
|
|
3
|
-
const func = require('./func');
|
|
4
|
-
const app = func.app();
|
|
5
|
-
const server = func.server();
|
|
6
|
-
var config = func.config;
|
|
7
|
-
|
|
8
|
-
var API =
|
|
9
|
-
{
|
|
10
|
-
get: async function (u, d, h, a) {
|
|
11
|
-
return await this.req(u, d, h, "GET", a);
|
|
12
|
-
},
|
|
13
|
-
put: async function (u, d, h, a) {
|
|
14
|
-
return await this.req(u, d, h, "PUT", a);
|
|
15
|
-
},
|
|
16
|
-
post: async function (u, d, h, a) {
|
|
17
|
-
return await this.req(u, d, h, "POST", a);
|
|
18
|
-
},
|
|
19
|
-
delete: async function (u, d, h, a) {
|
|
20
|
-
return await this.req(u, d, h, "DELETE", a);
|
|
21
|
-
},
|
|
22
|
-
patch: async function (u, d, h, a) {
|
|
23
|
-
return await this.req(u, d, h, "PATCH", a);
|
|
24
|
-
},
|
|
25
|
-
req: async function (u, d, h, m, a) {
|
|
26
|
-
let res = await axios({
|
|
27
|
-
method: m.toString().toLowerCase(),
|
|
28
|
-
url: func.validURL(u) ? u : (config.apis[a ?? 0].baseURL + u),
|
|
29
|
-
data: d ?? {},
|
|
30
|
-
headers: h ?? config.apis[a ?? 0].headers
|
|
31
|
-
});
|
|
32
|
-
return res.data;
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
//APP_HOLDER
|
|
37
|
-
|
|
38
|
-
app.get('/', (req, res) => {
|
|
39
|
-
res.sendFile(path.join(__dirname, './src/index.html'));
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
app.get('*', function (req, res) {
|
|
43
|
-
let nodes = req.params[0].split("/");
|
|
44
|
-
if (nodes.length) nodes.shift();
|
|
45
|
-
res.sendFile(path.join(__dirname, './src/index.html'));
|
|
46
|
-
});
|
|
47
|
-
app.post('*', function (req, res) {
|
|
48
|
-
let nodes = req.params[0].split("/");
|
|
49
|
-
if (nodes.length) nodes.shift();
|
|
50
|
-
// console.log(req.body);
|
|
51
|
-
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
52
|
-
res.write("");
|
|
53
|
-
return res.end();
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
server.listen(config.server.port, function () {
|
|
57
|
-
console.log(`LumenJS client server running at http://${config.server.host}:${config.server.port}/`);
|
|
58
|
-
});
|
|
Binary file
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
|
|
3
|
-
<url>
|
|
4
|
-
<loc>https://www.lumenjs.com/</loc>
|
|
5
|
-
<lastmod>2023-06-16T08:42:57+00:00</lastmod>
|
|
6
|
-
<changefreq>always</changefreq>
|
|
7
|
-
<priority>1.00</priority>
|
|
8
|
-
</url>
|
|
9
|
-
</urlset>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Template 1
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/files/tpl.tpl
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[TemplateName]
|
package/lib/files/view.view
DELETED
|
File without changes
|