cc4-embedded-system 3.1.9 → 3.1.10
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/README.md +22 -5
- package/dist/public/index.html +18 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,19 +2,30 @@
|
|
|
2
2
|
- This version based on [html-minifier-next](https://github.com/j9t/html-minifier-next) and rewrite [lwIP makefsdata](https://github.com/m-labs/lwip/tree/master/src/apps/httpd/makefsdata), run on localhost, default port: ```3000```.
|
|
3
3
|
- This tool is deployed on [npm package](https://www.npmjs.com/package/cc4-embedded-system).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Demo
|
|
6
|
+
- Select input directory
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
- Select output file path
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
- Result
|
|
13
|
+
|
|
14
|
+

|
|
6
15
|
|
|
7
16
|
## Structure
|
|
8
17
|
```text
|
|
9
18
|
CC4EmbeddedSystem/
|
|
10
19
|
├── src/
|
|
11
20
|
│ ├── gui.ts // Express server & CLI entry point
|
|
12
|
-
│ │
|
|
21
|
+
│ │ └── utils.ts // To get latest tool version
|
|
13
22
|
│ └── makefsdata.ts // Core C code generation & minification logic
|
|
14
23
|
├── public/
|
|
15
24
|
│ └── index.html // Web GUI dashboard
|
|
16
25
|
├── Sereenshot/
|
|
17
|
-
│
|
|
26
|
+
│ ├── inputs.png // Demo image
|
|
27
|
+
│ ├── output.png // Demo image
|
|
28
|
+
│ └── v3.1.10.png // Demo image
|
|
18
29
|
├── node_modules/ // Required submodules during development
|
|
19
30
|
├── dist/ // Compiled JavaScript output (Auto-generated)
|
|
20
31
|
├── package.json // Project configuration & dependencies
|
|
@@ -37,6 +48,10 @@ CC4EmbeddedSystem/
|
|
|
37
48
|
```bash
|
|
38
49
|
cc4es --port 3002
|
|
39
50
|
```
|
|
51
|
+
- Update
|
|
52
|
+
```bash
|
|
53
|
+
npm install -g cc4-embedded-system@latest
|
|
54
|
+
```
|
|
40
55
|
### Development
|
|
41
56
|
```bash
|
|
42
57
|
# build
|
|
@@ -47,8 +62,10 @@ npm link
|
|
|
47
62
|
cc4es
|
|
48
63
|
|
|
49
64
|
# publish
|
|
65
|
+
npm whoami # verify
|
|
50
66
|
npm login
|
|
51
|
-
|
|
52
|
-
npm run
|
|
67
|
+
npm version patch --no-git-tag-version # if increase version
|
|
68
|
+
npm run dev # dev mode for testing
|
|
69
|
+
npm run build # build the newest
|
|
53
70
|
npm publish --access public
|
|
54
71
|
```
|
package/dist/public/index.html
CHANGED
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
<label>Input Directory</label>
|
|
58
58
|
<div class="input-row">
|
|
59
59
|
<input type="text" id="inputPath" placeholder="e.g., C:\Project\web">
|
|
60
|
-
<button type="button" class="btn-browse" onclick="handleBrowse('inputPath', 'dir')">
|
|
60
|
+
<button type="button" class="btn-browse" onclick="handleBrowse('inputPath', 'dir')">Browse ...</button>
|
|
61
61
|
</div>
|
|
62
62
|
</div>
|
|
63
63
|
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
<label>Output File (fsdata.c)</label>
|
|
66
66
|
<div class="input-row">
|
|
67
67
|
<input type="text" id="outputPath" placeholder="e.g., ./fsdata.c">
|
|
68
|
-
<button type="button" class="btn-browse" onclick="handleBrowse('outputPath', 'file')">
|
|
68
|
+
<button type="button" class="btn-browse" onclick="handleBrowse('outputPath', 'file')">Browse ...</button>
|
|
69
69
|
</div>
|
|
70
70
|
</div>
|
|
71
71
|
|
|
@@ -94,13 +94,13 @@
|
|
|
94
94
|
</div>
|
|
95
95
|
</details>
|
|
96
96
|
|
|
97
|
-
<div id="statsPanel" class="stats-panel">
|
|
98
|
-
<div class="stats-title">📊 Compression Analysis</div>
|
|
99
|
-
<div class="stats-info">
|
|
100
|
-
<span>Compressed: <span id="compSize" style="color: #9cdcfe;">0</span> KB</span>
|
|
101
|
-
<span>Converted: <span id="convSize" style="color: #dcdcaa;">0</span> KB</span>
|
|
102
|
-
<span>Original: <span id="origSize" style="color: #ce9178;">0</span> KB</span>
|
|
103
|
-
</div>
|
|
97
|
+
<div id="statsPanel" class="stats-panel">
|
|
98
|
+
<div class="stats-title">📊 Compression Analysis</div>
|
|
99
|
+
<div class="stats-info">
|
|
100
|
+
<span>Compressed: <span id="compSize" style="color: #9cdcfe;">0</span> KB</span>
|
|
101
|
+
<span>Converted: <span id="convSize" style="color: #dcdcaa;">0</span> KB</span>
|
|
102
|
+
<span>Original: <span id="origSize" style="color: #ce9178;">0</span> KB</span>
|
|
103
|
+
</div>
|
|
104
104
|
<div class="bar-container">
|
|
105
105
|
<div id="barFill" class="bar-fill"></div>
|
|
106
106
|
<div id="barText" class="bar-text">0% Saved</div>
|
|
@@ -262,20 +262,20 @@
|
|
|
262
262
|
const panel = document.getElementById('statsPanel');
|
|
263
263
|
panel.style.display = 'block';
|
|
264
264
|
|
|
265
|
-
const { originalSize, compressedSize, convertedSize } = result.stats;
|
|
266
|
-
const origKB = (originalSize / 1024).toFixed(2);
|
|
267
|
-
const compKB = (compressedSize / 1024).toFixed(2);
|
|
268
|
-
const convKB = (convertedSize / 1024).toFixed(2);
|
|
265
|
+
const { originalSize, compressedSize, convertedSize } = result.stats;
|
|
266
|
+
const origKB = (originalSize / 1024).toFixed(2);
|
|
267
|
+
const compKB = (compressedSize / 1024).toFixed(2);
|
|
268
|
+
const convKB = (convertedSize / 1024).toFixed(2);
|
|
269
269
|
|
|
270
270
|
// ratio: the saved percentage
|
|
271
271
|
const ratio = originalSize > 0 ? (((originalSize - compressedSize) / originalSize) * 100).toFixed(1) : 0;
|
|
272
272
|
// compressedRatio: the remainings percentage
|
|
273
273
|
const compressedRatio = (100 - ratio).toFixed(1);
|
|
274
274
|
|
|
275
|
-
document.getElementById('origSize').innerText = origKB;
|
|
276
|
-
document.getElementById('compSize').innerText = compKB;
|
|
277
|
-
document.getElementById('convSize').innerText = convKB;
|
|
278
|
-
document.getElementById('barText').innerText = `${ratio}% Size Reduced`;
|
|
275
|
+
document.getElementById('origSize').innerText = origKB;
|
|
276
|
+
document.getElementById('compSize').innerText = compKB;
|
|
277
|
+
document.getElementById('convSize').innerText = convKB;
|
|
278
|
+
document.getElementById('barText').innerText = `${ratio}% Size Reduced`;
|
|
279
279
|
|
|
280
280
|
// actual used percentage
|
|
281
281
|
setTimeout(() => {
|
|
@@ -317,4 +317,4 @@
|
|
|
317
317
|
</div>
|
|
318
318
|
|
|
319
319
|
</body>
|
|
320
|
-
</html>
|
|
320
|
+
</html>
|