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 CHANGED
@@ -1,19 +1,18 @@
1
1
  {
2
2
  "name": "binhend",
3
- "version": "1.5.8",
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
- "binh": "./bin/index.js"
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",
@@ -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][COMPONENT] Build web components from:', stageRootPath);
13
- console.info('[BINHEND][COMPONENT] to:', outputRootPath);
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;
@@ -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][COMPONENT] Failed copying file from:`, filepath);
85
- console.error(`[BINHEND][COMPONENT] to:`, outpath);
86
- console.error('[BINHEND][COMPONENT] Error details:', error);
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][COMPONENT] ${message}:`, id);
148
- console.error('[BINHEND][COMPONENT] Error details:', error);
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 = {
@@ -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][COMPONENT] Format files from:', sourceRootPath);
14
- console.info('[BINHEND][COMPONENT] to:', outputRootPath);
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][COMPONENT] Start building components from:', source);
13
- console.log('[BINHEND][COMPONENT] to:', destination);
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][COMPONENT] ${message}:`, id);
101
- console.log('[BINHEND][COMPONENT] Error details:', error);
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
@@ -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);
@@ -1,7 +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
-
6
-
7
- ;binh.final(module);
@@ -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>
@@ -1,9 +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
- Binh({
6
- '': '/App.js'
7
- });
8
-
9
- ;binh.final(module);
@@ -1,9 +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
- Binh({
6
- '': '/App.js'
7
- });
8
-
9
- ;binh.final(module);
@@ -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")})}();
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>
@@ -1,4 +0,0 @@
1
-
2
- Binh({
3
- '': '/App.js'
4
- });
@@ -1,4 +0,0 @@
1
-
2
- Binh({
3
- '': '/App.js'
4
- });
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;
@@ -1,13 +0,0 @@
1
- 'use strict';
2
-
3
- const { Binh } = require('binhend');
4
-
5
- var app = new Binh();
6
-
7
- app.webBundle({
8
- source: 'src',
9
- module: 'build/module',
10
- web: 'build/web'
11
- });
12
-
13
- module.exports = app;
package/dest/config.js DELETED
@@ -1,6 +0,0 @@
1
- const path = require('path');
2
-
3
- module.exports = function(loader) {
4
- loader.file(path.join(__dirname, '.env'));
5
- loader.cli();
6
- };
package/dest/index.dev.js DELETED
@@ -1,15 +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;
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;
@@ -1,13 +0,0 @@
1
- 'use strict';
2
-
3
- const { Binh } = require('binhend');
4
-
5
- var app = new Binh();
6
-
7
- app.webBundle({
8
- source: 'src',
9
- module: 'build/module',
10
- web: 'build/web'
11
- });
12
-
13
- module.exports = app;
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
@@ -1,6 +0,0 @@
1
-
2
- tag('h1');
3
-
4
- function ui() {
5
- return h1('Hello World');
6
- }
package/dest/src/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/src/index.js DELETED
@@ -1,4 +0,0 @@
1
-
2
- Binh({
3
- '': '/App.js'
4
- });
package/dest/src/main.js DELETED
@@ -1,4 +0,0 @@
1
-
2
- Binh({
3
- '': '/App.js'
4
- });