binhend 1.5.8 → 1.5.9
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/package.json +3 -4
- package/src/component.build.js +2 -2
- package/src/component.file.js +5 -5
- package/src/component.format.js +2 -2
- package/src/component.js +4 -4
- package/dest/.env +0 -1
- package/dest/build/module/App.js +0 -11
- package/dest/build/module/Hmm.js +0 -7
- package/dest/build/module/index.html +0 -15
- package/dest/build/module/index.js +0 -9
- package/dest/build/module/main.js +0 -9
- package/dest/build/web/App.js +0 -1
- package/dest/build/web/Hmm.js +0 -0
- package/dest/build/web/index.html +0 -15
- package/dest/build/web/index.js +0 -4
- package/dest/build/web/main.js +0 -4
- package/dest/build.dev.js +0 -24
- package/dest/build.js +0 -19
- package/dest/build.prod.js +0 -13
- package/dest/config.js +0 -6
- package/dest/index.dev.js +0 -15
- package/dest/index.js +0 -29
- package/dest/index.prod.js +0 -13
- package/dest/server.js +0 -27
- package/dest/src/App.js +0 -6
- package/dest/src/Hmm.js +0 -0
- package/dest/src/index.html +0 -15
- package/dest/src/index.js +0 -4
- package/dest/src/main.js +0 -4
package/package.json
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "binhend",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Nguyen Duc Binh",
|
|
7
7
|
"license": "UNLICENSED",
|
|
8
8
|
"bin": {
|
|
9
|
-
"
|
|
9
|
+
"binhend": "./bin/index.js"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
12
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
13
13
|
"example-api": "node example_api PORT=5555",
|
|
14
14
|
"example-webcomp": "node example_webcomp",
|
|
15
|
-
"example-web2": "node example_web2"
|
|
16
|
-
"server": "node dest/server.js env=dev"
|
|
15
|
+
"example-web2": "node example_web2"
|
|
17
16
|
},
|
|
18
17
|
"dependencies": {
|
|
19
18
|
"express": "^4.17.1",
|
package/src/component.build.js
CHANGED
|
@@ -9,8 +9,8 @@ const BeautifyJS = require('js-beautify/js');
|
|
|
9
9
|
function processEachFile({ source: sourceRootPath, web: outputRootPath, module: stageRootPath, external: externalPath }, buildCodeMethod, callbackDone) {
|
|
10
10
|
if (sourceRootPath == undefined || outputRootPath == undefined) return;
|
|
11
11
|
stageRootPath = stageRootPath || outputRootPath;
|
|
12
|
-
console.info('[BINHEND][
|
|
13
|
-
console.info('[BINHEND][
|
|
12
|
+
console.info('[BINHEND][WEB-BUILD] Build web components from:', stageRootPath);
|
|
13
|
+
console.info('[BINHEND][WEB-BUILD] to:', outputRootPath);
|
|
14
14
|
|
|
15
15
|
var ref = {};
|
|
16
16
|
externalPath = typeof externalPath === 'string' ? `/${externalPath}/` : null;
|
package/src/component.file.js
CHANGED
|
@@ -81,9 +81,9 @@ function onComplete(done, callback) {
|
|
|
81
81
|
function cloneFile(filepath, outpath) {
|
|
82
82
|
copyFile(filepath, outpath, function(error) {
|
|
83
83
|
if (error) {
|
|
84
|
-
console.error(`[BINHEND][
|
|
85
|
-
console.error(`[BINHEND][
|
|
86
|
-
console.error('[BINHEND][
|
|
84
|
+
console.error(`[BINHEND][WEB-BUILD] Failed copying file from:`, filepath);
|
|
85
|
+
console.error(`[BINHEND][WEB-BUILD] to:`, outpath);
|
|
86
|
+
console.error('[BINHEND][WEB-BUILD] Error details:', error);
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
89
|
}
|
|
@@ -144,8 +144,8 @@ function isSameContent(filePath, content) {
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
function printError(message, id, error) {
|
|
147
|
-
console.error(`[BINHEND][
|
|
148
|
-
console.error('[BINHEND][
|
|
147
|
+
console.error(`[BINHEND][WEB-BUILD] ${message}:`, id);
|
|
148
|
+
console.error('[BINHEND][WEB-BUILD] Error details:', error);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
module.exports = {
|
package/src/component.format.js
CHANGED
|
@@ -10,8 +10,8 @@ var ui = null, service = null, style = null;\r\n\r\n`;
|
|
|
10
10
|
|
|
11
11
|
function generate(sourceRootPath, outputRootPath, callbackDone) {
|
|
12
12
|
if (sourceRootPath == undefined || outputRootPath == undefined) return;
|
|
13
|
-
console.info('[BINHEND][
|
|
14
|
-
console.info('[BINHEND][
|
|
13
|
+
console.info('[BINHEND][WEB-BUILD] Format files from:', sourceRootPath);
|
|
14
|
+
console.info('[BINHEND][WEB-BUILD] to:', outputRootPath);
|
|
15
15
|
|
|
16
16
|
scanNestedFiles(sourceRootPath, (file, done) => {
|
|
17
17
|
if (done) return callbackDone instanceof Function ? callbackDone() : null;
|
package/src/component.js
CHANGED
|
@@ -9,8 +9,8 @@ const CodeFormat = require('./code');
|
|
|
9
9
|
|
|
10
10
|
function generate(source, destination) {
|
|
11
11
|
if (source == undefined) return;
|
|
12
|
-
console.log('[BINHEND][
|
|
13
|
-
console.log('[BINHEND][
|
|
12
|
+
console.log('[BINHEND][WEB-BUILD] Start building components from:', source);
|
|
13
|
+
console.log('[BINHEND][WEB-BUILD] to:', destination);
|
|
14
14
|
processDirectory(source, source, destination);
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -97,8 +97,8 @@ function cloneFile(filepath, outpath) {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
function showError(message, id, error) {
|
|
100
|
-
console.log(`[BINHEND][
|
|
101
|
-
console.log('[BINHEND][
|
|
100
|
+
console.log(`[BINHEND][WEB-BUILD] ${message}:`, id);
|
|
101
|
+
console.log('[BINHEND][WEB-BUILD] Error details:', error);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
var Component = {
|
package/dest/.env
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
port=1234
|
package/dest/build/module/App.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
var { context, tag, svg, script, require, css } = binh.context(module, require);
|
|
2
|
-
binh.component(context, ui, service, style);
|
|
3
|
-
var ui = null, service = null, style = null;
|
|
4
|
-
|
|
5
|
-
tag('h1');
|
|
6
|
-
|
|
7
|
-
function ui() {
|
|
8
|
-
return h1('Hello World');
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
;binh.final(module);
|
package/dest/build/module/Hmm.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
|
|
3
|
-
<html lang="en">
|
|
4
|
-
|
|
5
|
-
<head>
|
|
6
|
-
<title>Binhjs App</title>
|
|
7
|
-
<meta charset="utf-8">
|
|
8
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
-
<script src="https://binhjs.pages.dev/dist/binh.min.js"></script>
|
|
10
|
-
<script src="/main.js"></script>
|
|
11
|
-
</head>
|
|
12
|
-
|
|
13
|
-
<body></body>
|
|
14
|
-
|
|
15
|
-
</html>
|
package/dest/build/web/App.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(){var n,e=window.Binh;e.els=e.element("h1"),n=e.els.h1,e.ui(function(){return n("Hello World")})}();
|
package/dest/build/web/Hmm.js
DELETED
|
File without changes
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
|
|
3
|
-
<html lang="en">
|
|
4
|
-
|
|
5
|
-
<head>
|
|
6
|
-
<title>Binhjs App</title>
|
|
7
|
-
<meta charset="utf-8">
|
|
8
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
-
<script src="https://binhjs.pages.dev/dist/binh.min.js"></script>
|
|
10
|
-
<script src="/main.js"></script>
|
|
11
|
-
</head>
|
|
12
|
-
|
|
13
|
-
<body></body>
|
|
14
|
-
|
|
15
|
-
</html>
|
package/dest/build/web/index.js
DELETED
package/dest/build/web/main.js
DELETED
package/dest/build.dev.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const { Binh } = require('binhend');
|
|
4
|
-
|
|
5
|
-
var app = new Binh();
|
|
6
|
-
|
|
7
|
-
app.webLazy({
|
|
8
|
-
source: 'src',
|
|
9
|
-
module: 'build/module',
|
|
10
|
-
web: 'build/web'
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
// app.cors().port(1234).start();
|
|
14
|
-
|
|
15
|
-
module.exports = app;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
// module.exports = (app) => {
|
|
19
|
-
// app.webLazy({
|
|
20
|
-
// source: 'src',
|
|
21
|
-
// module: 'build/module',
|
|
22
|
-
// web: 'build/web'
|
|
23
|
-
// });
|
|
24
|
-
// };
|
package/dest/build.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// const { Binh } = require('binhend');
|
|
2
|
-
|
|
3
|
-
const { Binh } = require('../src/binh');
|
|
4
|
-
|
|
5
|
-
const app = new Binh();
|
|
6
|
-
|
|
7
|
-
app.config('config.js', afterLoadedConfigs); // import middleware from path './config.js' to run and load configs
|
|
8
|
-
|
|
9
|
-
function afterLoadedConfigs(configs) {
|
|
10
|
-
const options = {
|
|
11
|
-
source: 'src',
|
|
12
|
-
module: 'build/module',
|
|
13
|
-
web: 'build/web'
|
|
14
|
-
};
|
|
15
|
-
console.log("configs.env === 'prod'", configs.env === 'prod');
|
|
16
|
-
configs.env === 'prod' ? app.webBundle(options).minify(true) : app.webLazy(options);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
module.exports = app;
|
package/dest/build.prod.js
DELETED
package/dest/config.js
DELETED
package/dest/index.dev.js
DELETED
package/dest/index.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
const { Binh } = require('binhend');
|
|
2
|
-
|
|
3
|
-
var app = new Binh();
|
|
4
|
-
|
|
5
|
-
app.webBundle({
|
|
6
|
-
source: 'src',
|
|
7
|
-
module: 'build/module',
|
|
8
|
-
web: 'build/web'
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
// app.config('config.js') // execute middleware to load configs
|
|
12
|
-
// .cors()
|
|
13
|
-
// .port('port') // get value from config via key 'port'
|
|
14
|
-
// .start((server, configs) => {
|
|
15
|
-
// console.log('configs', configs);
|
|
16
|
-
// });
|
|
17
|
-
|
|
18
|
-
app.cors();
|
|
19
|
-
|
|
20
|
-
app.config('config.js'); // execute middleware to load configs
|
|
21
|
-
|
|
22
|
-
app.port('port'); // get value from config via key 'port'
|
|
23
|
-
|
|
24
|
-
app.start((server, configs) => {
|
|
25
|
-
console.log('configs', configs);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
module.exports = app;
|
package/dest/index.prod.js
DELETED
package/dest/server.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// const { Binh } = require('binhend');
|
|
2
|
-
// const { Binh } = require('../src/binh');
|
|
3
|
-
|
|
4
|
-
// var app = new Binh();
|
|
5
|
-
|
|
6
|
-
// app.config('config.js', (configs) => { // run middleware to load configs
|
|
7
|
-
// const options = {
|
|
8
|
-
// source: 'src',
|
|
9
|
-
// module: 'build/module',
|
|
10
|
-
// web: 'build/web'
|
|
11
|
-
// };
|
|
12
|
-
|
|
13
|
-
// configs.env === 'prod' ? app.webBundle(options) : app.webLazy(options);
|
|
14
|
-
// });
|
|
15
|
-
|
|
16
|
-
const app = require('./build');
|
|
17
|
-
|
|
18
|
-
app.cors();
|
|
19
|
-
|
|
20
|
-
app.port('port'); // get value from config via key 'port'
|
|
21
|
-
|
|
22
|
-
app.start((server, configs) => {
|
|
23
|
-
console.log('configs', configs);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
module.exports = app;
|
package/dest/src/App.js
DELETED
package/dest/src/Hmm.js
DELETED
|
File without changes
|
package/dest/src/index.html
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
|
|
3
|
-
<html lang="en">
|
|
4
|
-
|
|
5
|
-
<head>
|
|
6
|
-
<title>Binhjs App</title>
|
|
7
|
-
<meta charset="utf-8">
|
|
8
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
-
<script src="https://binhjs.pages.dev/dist/binh.min.js"></script>
|
|
10
|
-
<script src="/main.js"></script>
|
|
11
|
-
</head>
|
|
12
|
-
|
|
13
|
-
<body></body>
|
|
14
|
-
|
|
15
|
-
</html>
|
package/dest/src/index.js
DELETED
package/dest/src/main.js
DELETED