@agung_dhewe/webapps 1.1.2 → 1.2.4
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/lib/fgta5js-dist/fgta5js-v1.8.5.min.js +11 -0
- package/lib/fgta5js-dist/fgta5js-v1.8.5.min.js.map +1 -0
- package/{libs → lib}/webmodule/module-edit.css +73 -18
- package/{libs → lib}/webmodule/module-list.css +13 -0
- package/lib/webmodule/module-print.css +28 -0
- package/{libs → lib}/webmodule/module.css +13 -6
- package/{libs → lib}/webmodule/module.js +14 -4
- package/lib/webmodule/pagehelper.mjs +129 -0
- package/modules/generator/appgen-io.mjs +153 -76
- package/modules/generator/appgen-ui.mjs +234 -167
- package/modules/generator/generator-designtemplate-def.html +38 -0
- package/modules/generator/generator-designtemplate.html +11 -1492
- package/modules/generator/generator.css +103 -65
- package/modules/generator/generator.mjs +1 -1
- package/modules/generator/generator.svg +98 -0
- package/modules/generator/generatorEdit.mjs +43 -35
- package/modules/generator/generatorList.mjs +27 -0
- package/modules/generator/tpl-designerinfo.html +100 -0
- package/modules/generator/tpl-field-checkbox.html +200 -0
- package/modules/generator/tpl-field-combobox.html +228 -0
- package/modules/generator/tpl-field-datepicker.html +192 -0
- package/modules/generator/tpl-field-filebox.html +189 -0
- package/modules/generator/tpl-field-numberbox.html +218 -0
- package/modules/generator/tpl-field-textbox.html +255 -0
- package/modules/generator/tpl-field-timepicker.html +192 -0
- package/modules/generator/tpl-searchdesign.html +32 -0
- package/modules/generator/tpl-uniquedesign.html +25 -0
- package/modules/login/login.css +10 -2
- package/package.json +5 -3
- package/percobaan/coba-sequencer.js +16 -0
- package/src/api.js +12 -9
- package/src/apis/generator.api.js +35 -23
- package/src/apis/login.api.js +1 -0
- package/src/context.js +12 -2
- package/src/db.js +58 -32
- package/src/generator/createApiModule.js +4 -1
- package/src/generator/createIcon.js +24 -2
- package/src/generator/createLayoutCss.js +107 -0
- package/src/generator/createModuleDetilEditHtml.js +12 -1
- package/src/generator/createModuleDetilEditMjs.js +32 -28
- package/src/generator/createModuleDetilListHtml.js +14 -7
- package/src/generator/createModuleDetilListMjs.js +13 -1
- package/src/generator/createModuleHeaderEditHtml.js +13 -1
- package/src/generator/createModuleHeaderEditMjs.js +23 -2
- package/src/generator/createProgramData.js +3 -2
- package/src/generator/createTable.js +42 -38
- package/src/generator/helper.js +45 -27
- package/src/generator/templates/__rollup-module copy.ejs +90 -0
- package/src/generator/templates/__rollup-module.ejs +102 -31
- package/src/generator/templates/api-module.js.ejs +171 -32
- package/src/generator/templates/layout.css.ejs +24 -0
- package/src/generator/templates/module-ext.html.ejs +1 -1
- package/src/generator/templates/module-ext.mjs.ejs +19 -1
- package/src/generator/templates/module.ejs.ejs +8 -0
- package/src/generator/templates/module.mjs.ejs +42 -5
- package/src/generator/templates/moduleDetilEdit.html.ejs +11 -0
- package/src/generator/templates/moduleDetilEdit.mjs.ejs +135 -30
- package/src/generator/templates/moduleDetilList.html.ejs +2 -1
- package/src/generator/templates/moduleDetilList.mjs.ejs +86 -11
- package/src/generator/templates/moduleHeaderEdit.html.ejs +8 -1
- package/src/generator/templates/moduleHeaderEdit.mjs.ejs +123 -36
- package/src/generator/templates/moduleHeaderList.html.ejs +5 -1
- package/src/generator/templates/moduleHeaderList.mjs.ejs +47 -15
- package/src/generator/trygenerate.js +18 -2
- package/src/generator/worker.js +83 -72
- package/src/helper.js +12 -13
- package/src/logger.js +12 -12
- package/src/notifier.js +29 -0
- package/src/routers/generatorApi.js +9 -3
- package/src/routers/generatorPage.js +3 -1
- package/src/routers/moduleApi.js +1 -1
- package/src/routers/modulePage.js +42 -7
- package/src/sequencerdoc.js +22 -46
- package/src/sequencerline.js +16 -4
- package/src/session.js +69 -33
- package/src/startup.js +47 -10
- package/src/webapps.js +62 -18
- package/templates/_lib_debug.ejs +8 -8
- package/templates/_lib_production.ejs +2 -2
- package/templates/application.page.ejs +43 -8
- package/templates/generator.page.ejs +4 -3
- package/templates/index.page.ejs +2 -2
- package/templates/login.page.ejs +3 -3
- package/libs/fgta5js-dist/fgta5js-v1.8.3.min.js +0 -11
- package/libs/fgta5js-dist/fgta5js-v1.8.3.min.js.map +0 -1
- package/libs/webmodule/pagehelper.mjs +0 -45
- package/modules/generator/generator.png +0 -0
- /package/{libs/fgta5js-dist/fgta5js-v1.8.3.min.css → lib/fgta5js-dist/fgta5js-v1.8.5.min.css} +0 -0
- /package/{libs → lib}/fgta5js-dist/fonts/karla-italic-latin-ext.woff2 +0 -0
- /package/{libs → lib}/fgta5js-dist/fonts/karla-italic-latin.woff2 +0 -0
- /package/{libs → lib}/fgta5js-dist/fonts/karla-normal-latin-ext.woff2 +0 -0
- /package/{libs → lib}/fgta5js-dist/fonts/karla-normal-latin.woff2 +0 -0
- /package/{libs → lib}/fgta5js-dist/fonts/karla.css +0 -0
- /package/{libs → lib}/webmodule/module-footer.css +0 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/************************************************************************
|
|
2
|
+
* minimize script using rollup
|
|
3
|
+
*
|
|
4
|
+
* you need to install rollup & terser to use this tools
|
|
5
|
+
*
|
|
6
|
+
* usage:
|
|
7
|
+
* npx rollup -c ./public/modules/<%=moduleName%>/__rollup.<%=moduleName%>.js
|
|
8
|
+
*
|
|
9
|
+
* This module is generated by fgta5 generator
|
|
10
|
+
************************************************************************/
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
import terser from '@rollup/plugin-terser';
|
|
14
|
+
import { writeFileSync } from 'fs';
|
|
15
|
+
import { readFile, unlink, access } from 'fs/promises';
|
|
16
|
+
import { join } from 'path';
|
|
17
|
+
import { constants } from 'fs';
|
|
18
|
+
|
|
19
|
+
const currentdate = (new Date()).toISOString().split('T')[0]
|
|
20
|
+
const banner = `<%=moduleName%>
|
|
21
|
+
*
|
|
22
|
+
* build at ${currentdate}
|
|
23
|
+
`
|
|
24
|
+
|
|
25
|
+
const filename = `version.txt`;
|
|
26
|
+
const filepath = join('public/modules/<%=moduleName%>', filename);
|
|
27
|
+
|
|
28
|
+
/* Hapus versi sebelumnya */
|
|
29
|
+
if (await isExists(filepath)) {
|
|
30
|
+
const previousVersionNumber = await readFile(filepath, 'utf8');
|
|
31
|
+
const previousFile = `public/modules/<%=moduleName%>/<%=moduleName%>-${previousVersionNumber}.min.mjs`
|
|
32
|
+
await unlink(previousFile);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Create New Version */
|
|
36
|
+
const newVersionNumber = getTimestampYYMMDDHHII()
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
// Simpan ke file
|
|
40
|
+
writeFileSync(filepath, newVersionNumber, 'utf8')
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
input: "public/modules/<%=moduleName%>/<%=moduleName%>.mjs", // File utama yang menjadi entry point
|
|
45
|
+
output: {
|
|
46
|
+
file: `public/modules/<%=moduleName%>/<%=moduleName%>-${newVersionNumber}.min.mjs`, // Lokasi output file hasil bundle
|
|
47
|
+
format: "esm", // Format modul ECMAScript
|
|
48
|
+
banner: `/*! ${banner}*/`,
|
|
49
|
+
// manualChunks: (id) => {
|
|
50
|
+
// console.log('Chunking:', id);
|
|
51
|
+
// if (id.includes('module.mjs') || id.includes('-ext.mjs') || id.includes('public/libs/webmodule')) return null;
|
|
52
|
+
// }
|
|
53
|
+
},
|
|
54
|
+
external: (id) => {
|
|
55
|
+
return id.includes('module.mjs') || id === '$fgta5' || id.includes('public/libs/webmodule');
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
preserveEntrySignatures: 'strict',
|
|
59
|
+
|
|
60
|
+
plugins: [
|
|
61
|
+
terser({
|
|
62
|
+
compress: {
|
|
63
|
+
pure_funcs: ['console.log', 'console.warn'] // hanya log dan warn dihilangkan, sedangkan error tidak
|
|
64
|
+
// drop_console: true // hapus console
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
function getTimestampYYMMDDHHII() {
|
|
72
|
+
const now = new Date();
|
|
73
|
+
const yy = String(now.getFullYear()).slice(-2);
|
|
74
|
+
const mm = String(now.getMonth() + 1).padStart(2, '0');
|
|
75
|
+
const dd = String(now.getDate()).padStart(2, '0');
|
|
76
|
+
const hh = String(now.getHours()).padStart(2, '0');
|
|
77
|
+
const ii = String(now.getMinutes()).padStart(2, '0');
|
|
78
|
+
return `${yy}${mm}${dd}${hh}${ii}`;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
async function isExists(filepath) {
|
|
83
|
+
try {
|
|
84
|
+
await access(filepath, constants.F_OK);
|
|
85
|
+
return true
|
|
86
|
+
} catch {
|
|
87
|
+
return false
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
}
|
|
@@ -6,66 +6,113 @@
|
|
|
6
6
|
* usage:
|
|
7
7
|
* npx rollup -c ./public/modules/<%=moduleName%>/__rollup.<%=moduleName%>.js
|
|
8
8
|
*
|
|
9
|
-
* This module is generated by fgta5 generator
|
|
9
|
+
* This module is generated by fgta5 generator
|
|
10
10
|
************************************************************************/
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
import terser from '@rollup/plugin-terser';
|
|
14
|
+
import postcss from 'rollup-plugin-postcss';
|
|
15
|
+
import cssnano from 'cssnano';
|
|
16
|
+
import atImport from 'postcss-import';
|
|
17
|
+
import del from 'rollup-plugin-delete';
|
|
18
|
+
|
|
14
19
|
import { writeFileSync } from 'fs';
|
|
15
20
|
import { readFile, unlink, access } from 'fs/promises';
|
|
16
21
|
import { join } from 'path';
|
|
17
22
|
import { constants } from 'fs';
|
|
18
23
|
|
|
24
|
+
|
|
25
|
+
const moduleName = '<%=moduleName%>'
|
|
26
|
+
const moduleDirPath = `public/modules/${moduleName}`
|
|
27
|
+
const filename = `version.txt`;
|
|
28
|
+
const filepath = join(moduleDirPath, filename);
|
|
29
|
+
|
|
19
30
|
const currentdate = (new Date()).toISOString().split('T')[0]
|
|
20
|
-
const banner =
|
|
31
|
+
const banner = `${moduleName}
|
|
21
32
|
*
|
|
22
33
|
* build at ${currentdate}
|
|
23
34
|
`
|
|
24
35
|
|
|
25
|
-
|
|
26
|
-
const filepath = join('public/modules/<%=moduleName%>', filename);
|
|
36
|
+
|
|
27
37
|
|
|
28
38
|
/* Hapus versi sebelumnya */
|
|
29
39
|
if (await isExists(filepath)) {
|
|
30
40
|
const previousVersionNumber = await readFile(filepath, 'utf8');
|
|
31
|
-
const
|
|
32
|
-
|
|
41
|
+
const previousMjsFile = join(moduleDirPath, `${moduleName}-${previousVersionNumber}.min.mjs`)
|
|
42
|
+
const previousCssFile = join(moduleDirPath, `${moduleName}-${previousVersionNumber}.min.css`)
|
|
43
|
+
|
|
44
|
+
await Promise.all([
|
|
45
|
+
remove(previousMjsFile),
|
|
46
|
+
remove(previousCssFile)
|
|
47
|
+
])
|
|
33
48
|
}
|
|
34
49
|
|
|
50
|
+
const cssFiles = await getCssFiles()
|
|
51
|
+
|
|
52
|
+
|
|
35
53
|
/* Create New Version */
|
|
36
54
|
const newVersionNumber = getTimestampYYMMDDHHII()
|
|
37
55
|
|
|
38
56
|
|
|
57
|
+
|
|
39
58
|
// Simpan ke file
|
|
40
59
|
writeFileSync(filepath, newVersionNumber, 'utf8')
|
|
41
60
|
|
|
42
61
|
|
|
43
|
-
export default
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
62
|
+
export default [
|
|
63
|
+
{
|
|
64
|
+
input: join(moduleDirPath, `${moduleName}.mjs`), // File utama yang menjadi entry point
|
|
65
|
+
output: {
|
|
66
|
+
file: join(moduleDirPath, `${moduleName}-${newVersionNumber}.min.mjs`), // Lokasi output file hasil bundle
|
|
67
|
+
format: "esm", // Format modul ECMAScript
|
|
68
|
+
banner: `/*! ${banner}*/`,
|
|
69
|
+
},
|
|
70
|
+
external: (id) => {
|
|
71
|
+
return id.includes('module.mjs') || id === '$fgta5' || id.includes('public/libs/webmodule');
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
preserveEntrySignatures: 'strict',
|
|
75
|
+
|
|
76
|
+
plugins: [
|
|
77
|
+
terser({
|
|
78
|
+
compress: {
|
|
79
|
+
pure_funcs: ['console.log', 'console.warn'] // hanya log dan warn dihilangkan, sedangkan error tidak
|
|
80
|
+
// drop_console: true // hapus console
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
]
|
|
56
84
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
85
|
+
|
|
86
|
+
{
|
|
87
|
+
input: cssFiles,
|
|
88
|
+
output: {
|
|
89
|
+
dir: moduleDirPath
|
|
90
|
+
},
|
|
91
|
+
plugins: [
|
|
92
|
+
|
|
93
|
+
// Konfigurasi PostCSS untuk CSS
|
|
94
|
+
postcss({
|
|
95
|
+
extract: `${moduleName}-${newVersionNumber}.min.css`, // Nama file output CSS
|
|
96
|
+
minimize: true, // Aktifkan minifikasi
|
|
97
|
+
plugins: [
|
|
98
|
+
atImport(), // 1. Gabungkan semua @import menjadi satu file
|
|
99
|
+
cssnano() // Plugin untuk optimasi CSS
|
|
100
|
+
]
|
|
101
|
+
}),
|
|
102
|
+
del({
|
|
103
|
+
targets: [
|
|
104
|
+
join(moduleDirPath, `${moduleName}.js`),
|
|
105
|
+
join(moduleDirPath, `${moduleName}.layout.js`),
|
|
106
|
+
],
|
|
107
|
+
hook: 'closeBundle' // Jalankan setelah semua proses selesai
|
|
108
|
+
})
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
]
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
69
116
|
|
|
70
117
|
|
|
71
118
|
function getTimestampYYMMDDHHII() {
|
|
@@ -79,6 +126,30 @@ function getTimestampYYMMDDHHII() {
|
|
|
79
126
|
};
|
|
80
127
|
|
|
81
128
|
|
|
129
|
+
async function remove(filepath) {
|
|
130
|
+
if (await isExists(filepath)) {
|
|
131
|
+
await unlink(filepath)
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
async function getCssFiles() {
|
|
137
|
+
const cssFiles = []
|
|
138
|
+
const cssMainFile = join(moduleDirPath, `${moduleName}.css`)
|
|
139
|
+
const cssLayoutFile = join(moduleDirPath, `${moduleName}.layout.css`)
|
|
140
|
+
|
|
141
|
+
if (await isExists(cssMainFile)) {
|
|
142
|
+
cssFiles.push(cssMainFile)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (await isExists(cssLayoutFile)) {
|
|
146
|
+
cssFiles.push(cssLayoutFile)
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return cssFiles;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
|
|
82
153
|
async function isExists(filepath) {
|
|
83
154
|
try {
|
|
84
155
|
await access(filepath, constants.F_OK);
|