@lmjs/cli 1.0.22 → 1.0.23
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 +3 -3
- package/index.js +5 -5
- package/lib/app.js +5 -6
- package/lib/check-version.js +1 -1
- package/lib/fcs.js +23 -36
- package/lib/files/build/func.js +0 -0
- package/lib/files/build/package.json +0 -0
- package/lib/files/build/server.js +0 -0
- package/lib/files/build/src/favicon.ico +0 -0
- package/lib/files/build/src/robots.txt +0 -0
- package/lib/files/build/src/sitemap.xml +0 -0
- package/lib/files/build_serverless/.htaccess +0 -0
- package/lib/files/build_serverless/favicon.ico +0 -0
- package/lib/files/build_serverless/robots.txt +0 -0
- package/lib/files/build_serverless/sitemap.xml +0 -0
- package/lib/files/project/config.json +1 -31
- package/lib/files/project/src/404.html +0 -0
- package/lib/files/project/src/index.html +1 -2
- package/lib/files/project/src/index.js +0 -0
- package/lib/files/project/src/tpls/tpl1.tpl +1 -0
- package/lib/files/project/src/views/about.view +0 -0
- package/lib/files/project/src/views/contact.view +0 -0
- package/lib/files/project/src/views/home.view +0 -0
- 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/sub_view.view +0 -0
- package/lib/files/tpl.tpl +1 -0
- package/lib/files/view.view +0 -0
- package/package.json +1 -1
- package/lib/files/comp.tpl +0 -1
- package/lib/files/project/src/comps/comp1.tpl +0 -1
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ LumenJS is a tiny robust reactive javascript framework for building scalable and
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
LumenJS comes along with MobiusCSS library which is a utility-first CSS framework packed with grid and table sectioning systems and classes like g, mt20, pv100, c and sq that can be composed to build any design, directly in your markup.
|
|
11
|
-
<a href="https://mobius.
|
|
11
|
+
<a href="https://mobius.lumenjs.com/" target="_blank">MobiusCSS Documentation</a>
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -50,9 +50,9 @@ lm create -s mysubview
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
Create A
|
|
53
|
+
Create A Template
|
|
54
54
|
```
|
|
55
|
-
lm create -c
|
|
55
|
+
lm create -c mytemplate
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
|
package/index.js
CHANGED
|
@@ -72,7 +72,7 @@ async function buildProject(cmds) {
|
|
|
72
72
|
var dest = projectPath + path.sep + 'dist';
|
|
73
73
|
|
|
74
74
|
let _views = fcs.getAllFiles(`${process.cwd()}` + path.sep + `src` + path.sep + `views` + path.sep);
|
|
75
|
-
let
|
|
75
|
+
let _tpls = fcs.getAllFiles(`${process.cwd()}` + path.sep + `src` + path.sep + `tpls` + path.sep);
|
|
76
76
|
var config = fcs.getConfig();
|
|
77
77
|
|
|
78
78
|
var indexCode = fs.readFileSync(projectPath + path.sep + `src` + path.sep + "index.html", "utf8");
|
|
@@ -86,9 +86,9 @@ async function buildProject(cmds) {
|
|
|
86
86
|
spinner.succeed("Gathering Required Resources");
|
|
87
87
|
var beaCode = "";
|
|
88
88
|
if (cmds.indexOf('--serverless') >= 0) {
|
|
89
|
-
spinner.start('
|
|
89
|
+
spinner.start('Signing & Securing App..');
|
|
90
90
|
|
|
91
|
-
let r = await API.post("https://
|
|
91
|
+
let r = await API.post("https://www.beaapis.com/1/beajs", {
|
|
92
92
|
"data": JSON.stringify(config.apis)
|
|
93
93
|
});
|
|
94
94
|
|
|
@@ -105,12 +105,12 @@ async function buildProject(cmds) {
|
|
|
105
105
|
`;
|
|
106
106
|
}
|
|
107
107
|
beaCode += kkk;
|
|
108
|
-
spinner.start('Packing & Cleaning...');
|
|
108
|
+
spinner.succeed("Signing & Securing App").start('Packing & Cleaning...');
|
|
109
109
|
|
|
110
110
|
beaCode += `
|
|
111
111
|
var _vcData = {
|
|
112
112
|
"views": `+ JSON.stringify(_views) + `,
|
|
113
|
-
"
|
|
113
|
+
"tpls": `+ JSON.stringify(_tpls) + `
|
|
114
114
|
};
|
|
115
115
|
`;
|
|
116
116
|
beaCode += `
|
package/lib/app.js
CHANGED
|
@@ -26,7 +26,7 @@ let session = expressSession({
|
|
|
26
26
|
|
|
27
27
|
var config = fcs.getConfig();
|
|
28
28
|
var _views = {};
|
|
29
|
-
var
|
|
29
|
+
var _tpls = {};
|
|
30
30
|
|
|
31
31
|
app.use(compression());
|
|
32
32
|
app.use(cookieParser());
|
|
@@ -40,7 +40,6 @@ app.use(upload.array());
|
|
|
40
40
|
|
|
41
41
|
wss.on('connection', (ws) => {
|
|
42
42
|
ws.on('message', async (message) => {
|
|
43
|
-
|
|
44
43
|
try {
|
|
45
44
|
const buffer = Buffer.from(message);
|
|
46
45
|
const data = JSON.parse(buffer.toString());
|
|
@@ -55,10 +54,10 @@ wss.on('connection', (ws) => {
|
|
|
55
54
|
if (data.e == "getfiles") {
|
|
56
55
|
_data['payload'] = {
|
|
57
56
|
"views": _views,
|
|
58
|
-
"
|
|
57
|
+
"tpls": _tpls
|
|
59
58
|
};
|
|
60
|
-
} else if (data.e == "
|
|
61
|
-
_data.payload =
|
|
59
|
+
} else if (data.e == "gettpl") {
|
|
60
|
+
_data.payload = _tpls[data.payload];
|
|
62
61
|
} else if (data.e == "getview") {
|
|
63
62
|
_data.payload = _views[data.payload];
|
|
64
63
|
} else if (data.e == "request") {
|
|
@@ -124,5 +123,5 @@ app.post('*', function (req, res) {
|
|
|
124
123
|
server.listen(config.server.port, function () {
|
|
125
124
|
console.log(`LumenJS server running at http://${config.server.host}:${config.server.port}/`);
|
|
126
125
|
_views = fcs.getAllFiles(`${process.cwd()}` + path.sep + `src` + path.sep + `views` + path.sep);
|
|
127
|
-
|
|
126
|
+
_tpls = fcs.getAllFiles(`${process.cwd()}` + path.sep + `src` + path.sep + `tpls` + path.sep);
|
|
128
127
|
});
|
package/lib/check-version.js
CHANGED
package/lib/fcs.js
CHANGED
|
@@ -37,45 +37,32 @@ exports.getConfig = function () {
|
|
|
37
37
|
"cert": "/certificate.cer"
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
|
-
"project_info": {
|
|
41
|
-
"Title": "PROJECT_TITLE",
|
|
42
|
-
"Description": "PROJECT_DESCRIPTION",
|
|
43
|
-
"Keywords": "website,search,tags,goes,here",
|
|
44
|
-
"WebsiteURL": "https://www.example.com/",
|
|
45
|
-
"Favicon": "/images/favicon.ico",
|
|
46
|
-
"SocialMedia": {
|
|
47
|
-
"LI": "https://www.linkedin.com/",
|
|
48
|
-
"IG": "https://www.instagram.com/",
|
|
49
|
-
"FB": "https://www.facebook.com/"
|
|
50
|
-
},
|
|
51
|
-
"MetaTags": {
|
|
52
|
-
"og:url": "https://www.example.com/",
|
|
53
|
-
"og:title": "PROJECT_TITLE",
|
|
54
|
-
"og:type": "business.business",
|
|
55
|
-
"og:site_name": "PROJECT_TITLE",
|
|
56
|
-
"fb:admins": "592515154",
|
|
57
|
-
"fb:app_id": "138025696270006",
|
|
58
|
-
"og:description": "PROJECT_TITLE",
|
|
59
|
-
"og:image": "/images/example.png",
|
|
60
|
-
"business:contact_data:street_address": "Street Address.",
|
|
61
|
-
"business:contact_data:locality": "Tripoli",
|
|
62
|
-
"business:contact_data:postal_code": "1300",
|
|
63
|
-
"business:contact_data:country_name": "Lebanon",
|
|
64
|
-
"business:contact_data:email": "info@example.com",
|
|
65
|
-
"business:contact_data:phone_number": "+96171299411",
|
|
66
|
-
"business:contact_data:fax_number": "+96171299411",
|
|
67
|
-
"business:contact_data:website": "https://www.example.com/"
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
40
|
"apis": [
|
|
71
41
|
{
|
|
72
|
-
"baseURL": "https://
|
|
42
|
+
"baseURL": "https://www.beaapis.com/1",
|
|
73
43
|
"headers": {
|
|
74
44
|
"X-BEA-Application-ID": "YOUR_APPLICATION_ID",
|
|
75
45
|
"X-BEA-Authorization": "YOUR_REST_API_KEY"
|
|
76
46
|
}
|
|
77
47
|
}
|
|
78
|
-
]
|
|
48
|
+
],
|
|
49
|
+
"ftp": {
|
|
50
|
+
"host": "ftp_host",
|
|
51
|
+
"username": "ftp_username",
|
|
52
|
+
"password": "ftp_password",
|
|
53
|
+
"remotePath": "/",
|
|
54
|
+
"concurrency": 4,
|
|
55
|
+
"protocol": "ftp",
|
|
56
|
+
"port": 21,
|
|
57
|
+
"ignore": [],
|
|
58
|
+
"syncOption": {
|
|
59
|
+
"delete": false,
|
|
60
|
+
"ignoreExisting": false,
|
|
61
|
+
"skipCreate": false,
|
|
62
|
+
"update": true
|
|
63
|
+
},
|
|
64
|
+
"connectTimeout": 30000
|
|
65
|
+
}
|
|
79
66
|
};
|
|
80
67
|
let configPath = process.cwd() + path.sep + `config.json`;
|
|
81
68
|
if (fs.existsSync(configPath)) {
|
|
@@ -160,9 +147,9 @@ exports.create = function (conf) {
|
|
|
160
147
|
}
|
|
161
148
|
});
|
|
162
149
|
} else {
|
|
163
|
-
let file = t == "s" ? "sub_view.view" : (t == "c" ? "
|
|
164
|
-
let ident = t == "s" ? "SubView" : (t == "c" ? "
|
|
165
|
-
let dir = t == "c" ? "
|
|
150
|
+
let file = t == "s" ? "sub_view.view" : (t == "c" ? "tpl.tpl" : "view.view");
|
|
151
|
+
let ident = t == "s" ? "SubView" : (t == "c" ? "Template" : "View");
|
|
152
|
+
let dir = t == "c" ? "tpls" : "views";
|
|
166
153
|
let ext = t == "c" ? "tpl" : "view";
|
|
167
154
|
let html5 = Buffer.from(fs.readFileSync(`${__dirname}` + path.sep + `files` + path.sep + file).toString().split("[" + ident + 'Name' + "]").join(ucwords(n)));
|
|
168
155
|
var filePath = `${process.cwd()}` + path.sep + `src` + path.sep + dir + path.sep + `${n}.${ext}`;
|
|
@@ -185,7 +172,7 @@ function copyDir(src, dest, projectName) {
|
|
|
185
172
|
const destPath = path.join(dest.toString(), entry.name.toString());
|
|
186
173
|
if (entry.isDirectory()) {
|
|
187
174
|
if (projectName == "_beajsBuild") {
|
|
188
|
-
if (entry.name != "
|
|
175
|
+
if (entry.name != "tpls" && entry.name != "views" && entry.name != "css" && entry.name != "js") copyDir(srcPath, destPath, projectName);
|
|
189
176
|
}
|
|
190
177
|
else copyDir(srcPath, destPath, projectName);
|
|
191
178
|
} else {
|
package/lib/files/build/func.js
CHANGED
|
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
|
|
@@ -9,39 +9,9 @@
|
|
|
9
9
|
"cert": "/certificate.cer"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
|
-
"project_info": {
|
|
13
|
-
"Title": "PROJECT_TITLE",
|
|
14
|
-
"Description": "PROJECT_DESCRIPTION",
|
|
15
|
-
"Keywords": "website,search,tags,goes,here",
|
|
16
|
-
"WebsiteURL": "https://www.example.com/",
|
|
17
|
-
"Favicon": "/images/favicon.ico",
|
|
18
|
-
"SocialMedia": {
|
|
19
|
-
"LI": "https://www.linkedin.com/",
|
|
20
|
-
"IG": "https://www.instagram.com/",
|
|
21
|
-
"FB": "https://www.facebook.com/"
|
|
22
|
-
},
|
|
23
|
-
"MetaTags": {
|
|
24
|
-
"og:url": "https://www.example.com/",
|
|
25
|
-
"og:title": "PROJECT_TITLE",
|
|
26
|
-
"og:type": "business.business",
|
|
27
|
-
"og:site_name": "PROJECT_TITLE",
|
|
28
|
-
"fb:admins": "592515154",
|
|
29
|
-
"fb:app_id": "138025696270006",
|
|
30
|
-
"og:description": "PROJECT_TITLE",
|
|
31
|
-
"og:image": "/images/example.png",
|
|
32
|
-
"business:contact_data:street_address": "Street Address.",
|
|
33
|
-
"business:contact_data:locality": "Tripoli",
|
|
34
|
-
"business:contact_data:postal_code": "1300",
|
|
35
|
-
"business:contact_data:country_name": "Lebanon",
|
|
36
|
-
"business:contact_data:email": "info@example.com",
|
|
37
|
-
"business:contact_data:phone_number": "+96171299411",
|
|
38
|
-
"business:contact_data:fax_number": "+96171299411",
|
|
39
|
-
"business:contact_data:website": "https://www.example.com/"
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
12
|
"apis": [
|
|
43
13
|
{
|
|
44
|
-
"baseURL": "https://
|
|
14
|
+
"baseURL": "https://www.beaapis.com/1",
|
|
45
15
|
"headers": {
|
|
46
16
|
"X-BEA-Application-ID": "YOUR_APPLICATION_ID",
|
|
47
17
|
"X-BEA-Authorization": "YOUR_REST_API_KEY"
|
|
File without changes
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
17
17
|
<link href="/css/bea.css" rel="stylesheet" type="text/css" />
|
|
18
18
|
<link href="/css/styles.css" rel="stylesheet" type="text/css" />
|
|
19
|
-
<link href="https://
|
|
20
|
-
rel="stylesheet" />
|
|
19
|
+
<link href="https://cdn.jsdelivr.net/npm/@mdi/font@6.9.96/css/materialdesignicons.min.css" rel="stylesheet" />
|
|
21
20
|
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
|
22
21
|
<!-- <link rel="icon" type="image/png" href="/favicon.png" /> -->
|
|
23
22
|
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Template 1
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/files/sub_view.view
CHANGED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[TemplateName]
|
package/lib/files/view.view
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmjs/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.23",
|
|
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": {
|
package/lib/files/comp.tpl
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[ComponentName]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Component 1
|