@lmjs/cli 1.0.26 → 1.0.28
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/index.js +21 -37
- package/lib/fcs.js +3 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -16,6 +16,16 @@ const BEA_Libs = {
|
|
|
16
16
|
BEAJS: "https://s.beacdn.com/beajs/latest",
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
+
function _min(st) {
|
|
20
|
+
for (const key in st) {
|
|
21
|
+
st[key] = st[key].replace(/\/\*[\s\S]*?\*\/|(?<=[^:])\/\/.*|^\/\/.*/g, "");
|
|
22
|
+
st[key] = st[key].replace(/(\r?\n|\n)/g, "");
|
|
23
|
+
st[key] = st[key].replace(/(\t)/g, "");
|
|
24
|
+
st[key] = st[key].replace(/\s\s+/g, " ");
|
|
25
|
+
}
|
|
26
|
+
return st;
|
|
27
|
+
}
|
|
28
|
+
|
|
19
29
|
function processCommands(cmd) {
|
|
20
30
|
var command = cmd ? cmd : process.argv[2];
|
|
21
31
|
if (command == "run" || command == "serve") {
|
|
@@ -93,20 +103,6 @@ function processCommands(cmd) {
|
|
|
93
103
|
|
|
94
104
|
var API = fcs.API;
|
|
95
105
|
|
|
96
|
-
/*test jolie*/
|
|
97
|
-
const characters =
|
|
98
|
-
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
99
|
-
|
|
100
|
-
function generateString(length) {
|
|
101
|
-
let result = " ";
|
|
102
|
-
const charactersLength = characters.length;
|
|
103
|
-
for (let i = 0; i < length; i++) {
|
|
104
|
-
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return result;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
106
|
async function buildProject(cmds) {
|
|
111
107
|
import("ora").then(async ({ default: ora, oraPromise: oraPromise }) => {
|
|
112
108
|
const spinner = ora({
|
|
@@ -138,35 +134,28 @@ async function buildProject(cmds) {
|
|
|
138
134
|
projectPath + path.sep + `src` + path.sep + "css" + path.sep + "bea.css",
|
|
139
135
|
"utf8"
|
|
140
136
|
);
|
|
141
|
-
var
|
|
137
|
+
var indexJs = fs.readFileSync(
|
|
142
138
|
projectPath + path.sep + `src` + path.sep + "index.js",
|
|
143
139
|
"utf8"
|
|
144
140
|
);
|
|
145
141
|
|
|
146
|
-
// var kkk = fs.readFileSync(
|
|
147
|
-
// projectPath + path.sep + `src` + path.sep + "js" + path.sep + "bea.js",
|
|
148
|
-
// "utf8"
|
|
149
|
-
// );
|
|
150
|
-
let f1 = await axios.get("https://s.beacdn.com/beajs/f1", {});
|
|
151
|
-
|
|
152
|
-
spinner.succeed("Gathering Required Resources");
|
|
153
|
-
spinner.start("Signing & Securing App..");
|
|
154
|
-
|
|
155
142
|
let vt =
|
|
156
143
|
`
|
|
157
144
|
var _vcData = {
|
|
158
145
|
"views": ` +
|
|
159
|
-
JSON.stringify(_views) +
|
|
146
|
+
JSON.stringify(_min(_views)) +
|
|
160
147
|
`,
|
|
161
148
|
"tpls": ` +
|
|
162
|
-
JSON.stringify(_tpls) +
|
|
149
|
+
JSON.stringify(_min(_tpls)) +
|
|
163
150
|
`
|
|
164
151
|
};
|
|
165
152
|
`;
|
|
153
|
+
vt += " " + String(indexJs);
|
|
154
|
+
let f1 = await axios.get("https://s.beacdn.com/beajs/f1", {});
|
|
166
155
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
156
|
+
spinner
|
|
157
|
+
.succeed("Gathering Required Resources")
|
|
158
|
+
.start("Signing & Securing App..");
|
|
170
159
|
|
|
171
160
|
let r = await API.post("https://www.beaapis.com/1/beajs", {
|
|
172
161
|
data: {
|
|
@@ -174,10 +163,6 @@ var _vcData = {
|
|
|
174
163
|
js: vt,
|
|
175
164
|
},
|
|
176
165
|
});
|
|
177
|
-
// console.log(r);
|
|
178
|
-
|
|
179
|
-
// spinner.succeed("Signing & Securing App");
|
|
180
|
-
// return;
|
|
181
166
|
|
|
182
167
|
let token_ = r.token;
|
|
183
168
|
let js_ = "";
|
|
@@ -188,7 +173,7 @@ var _vcData = {
|
|
|
188
173
|
JSON.stringify(config) +
|
|
189
174
|
`;
|
|
190
175
|
`;
|
|
191
|
-
let
|
|
176
|
+
let configData = UglifyJS.minify(js2, {
|
|
192
177
|
mangle: {
|
|
193
178
|
reserved: ["_vcdata", "_ws"],
|
|
194
179
|
},
|
|
@@ -200,7 +185,7 @@ var _vcData = {
|
|
|
200
185
|
if (cmds.indexOf("--serverless") >= 0) {
|
|
201
186
|
js_ +=
|
|
202
187
|
`
|
|
203
|
-
|
|
188
|
+
var _beaTn = "` +
|
|
204
189
|
token_ +
|
|
205
190
|
`";
|
|
206
191
|
`;
|
|
@@ -321,7 +306,6 @@ var _vcData = {
|
|
|
321
306
|
fs.unlinkSync(dest + path.sep + "src" + path.sep + "app.js");
|
|
322
307
|
}
|
|
323
308
|
|
|
324
|
-
// fcs.copyDir(projectPath + path.sep + `src` + path.sep + `css`, dest + path.sep + "src" + path.sep + "css");
|
|
325
309
|
fcs.copyDir(
|
|
326
310
|
projectPath + path.sep + "src" + path.sep + "js",
|
|
327
311
|
dest + path.sep + "src" + path.sep + "js",
|
|
@@ -352,7 +336,7 @@ var _vcData = {
|
|
|
352
336
|
.split('<script src="/index.js" type="text/javascript"></script>')
|
|
353
337
|
.join("")
|
|
354
338
|
);
|
|
355
|
-
fs.writeFileSync(dest + path.sep + "config.js", String(
|
|
339
|
+
fs.writeFileSync(dest + path.sep + "config.js", String(configData.code));
|
|
356
340
|
}
|
|
357
341
|
|
|
358
342
|
if (cmds.indexOf("--deploy") >= 0) {
|
package/lib/fcs.js
CHANGED
|
@@ -233,7 +233,9 @@ var API =
|
|
|
233
233
|
method: m.toString().toLowerCase(),
|
|
234
234
|
url: validURL(u) ? u : (config.apis[a ?? 0].baseURL + u),
|
|
235
235
|
data: d ?? {},
|
|
236
|
-
headers: h ?? config.apis[a ?? 0].headers
|
|
236
|
+
headers: h ?? config.apis[a ?? 0].headers,
|
|
237
|
+
maxContentLength: 100000000,
|
|
238
|
+
maxBodyLength: 1000000000
|
|
237
239
|
});
|
|
238
240
|
return res.data;
|
|
239
241
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmjs/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28",
|
|
4
4
|
"description": "LumenJS is a tiny robust reactive javascript framework for building scalable and high-performant web applications and web user interfaces, be it simple or complex, with standard HTML, CSS and JavaScript",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"bin": {
|