kimu-core 0.4.1 → 0.5.0
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/.editorconfig +116 -30
- package/.gitattributes +81 -11
- package/.github/FUNDING.yml +8 -8
- package/.github/kimu-copilot-instructions.md +3779 -3779
- package/.github/workflows/deploy-demo.yml +39 -39
- package/.nvmrc +1 -0
- package/.prettierignore +44 -0
- package/.prettierrc +16 -0
- package/FUNDING.md +31 -31
- package/icon.svg +10 -10
- package/kimu-core-0.5.0.tgz +0 -0
- package/package.json +10 -3
- package/scripts/minify-css-assets.js +82 -82
- package/src/core/index.ts +47 -47
- package/src/core/kimu-global-styles.ts +136 -136
- package/src/core/kimu-reactive.ts +196 -196
- package/src/extensions/{kimu-home → app-root}/component.ts +5 -5
- package/src/extensions/extensions-manifest.json +4 -4
- package/src/main.ts +3 -3
- package/src/modules-repository/api-axios/CHANGELOG.md +48 -48
- package/src/modules-repository/api-axios/QUICK-REFERENCE.md +178 -178
- package/src/modules-repository/api-axios/README.md +304 -304
- package/src/modules-repository/api-axios/api-axios-service.ts +355 -355
- package/src/modules-repository/api-axios/examples.ts +293 -293
- package/src/modules-repository/api-axios/index.ts +19 -19
- package/src/modules-repository/api-axios/interfaces.ts +71 -71
- package/src/modules-repository/api-axios/module.ts +41 -41
- package/src/modules-repository/api-core/CHANGELOG.md +42 -42
- package/src/modules-repository/api-core/QUICK-REFERENCE.md +192 -192
- package/src/modules-repository/api-core/README.md +435 -435
- package/src/modules-repository/api-core/api-core-service.ts +289 -289
- package/src/modules-repository/api-core/examples.ts +432 -432
- package/src/modules-repository/api-core/index.ts +8 -8
- package/src/modules-repository/api-core/interfaces.ts +83 -83
- package/src/modules-repository/api-core/module.ts +30 -30
- package/src/modules-repository/event-bus/README.md +273 -273
- package/src/modules-repository/event-bus/event-bus-service.ts +176 -176
- package/src/modules-repository/event-bus/module.ts +30 -30
- package/src/modules-repository/notification/README.md +423 -423
- package/src/modules-repository/notification/module.ts +30 -30
- package/src/modules-repository/notification/notification-service.ts +436 -436
- package/src/modules-repository/router/README.it.md +61 -10
- package/src/modules-repository/router/README.md +61 -10
- package/src/modules-repository/router/router-config.ts.example +61 -0
- package/src/modules-repository/router/router.ts +18 -0
- package/src/modules-repository/state/README.md +409 -409
- package/src/modules-repository/state/module.ts +30 -30
- package/src/modules-repository/state/state-service.ts +296 -296
- package/src/modules-repository/theme/README.md +311 -267
- package/src/modules-repository/theme/module.ts +30 -30
- package/src/modules-repository/theme/pre-build.js +40 -40
- package/src/modules-repository/theme/theme-service.ts +411 -389
- package/src/modules-repository/theme/themes/theme-cherry-blossom.css +78 -78
- package/src/modules-repository/theme/themes/theme-cozy.css +111 -111
- package/src/modules-repository/theme/themes/theme-cyberpunk.css +150 -150
- package/src/modules-repository/theme/themes/theme-dark.css +79 -79
- package/src/modules-repository/theme/themes/theme-forest.css +171 -171
- package/src/modules-repository/theme/themes/theme-gold.css +100 -100
- package/src/modules-repository/theme/themes/theme-high-contrast.css +126 -126
- package/src/modules-repository/theme/themes/theme-lava.css +101 -101
- package/src/modules-repository/theme/themes/theme-lavender.css +90 -90
- package/src/modules-repository/theme/themes/theme-light.css +79 -79
- package/src/modules-repository/theme/themes/theme-matrix.css +103 -103
- package/src/modules-repository/theme/themes/theme-midnight.css +81 -81
- package/src/modules-repository/theme/themes/theme-nord.css +94 -94
- package/src/modules-repository/theme/themes/theme-ocean.css +84 -84
- package/src/modules-repository/theme/themes/theme-retro80s.css +343 -343
- package/src/modules-repository/theme/themes/theme-sunset.css +62 -62
- package/src/modules-repository/theme/themes-config-default.json +19 -0
- package/src/modules-repository/theme/themes-config.d.ts +27 -27
- package/src/modules-repository/theme/{themes-config.json → themes-config.json.example} +223 -213
- /package/src/extensions/{kimu-home → app-root}/lang/en.json +0 -0
- /package/src/extensions/{kimu-home → app-root}/lang/it.json +0 -0
- /package/src/extensions/{kimu-home → app-root}/style.css +0 -0
- /package/src/extensions/{kimu-home → app-root}/view.html +0 -0
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
name: Deploy Demo to GitHub Pages
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
build-and-deploy:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
steps:
|
|
12
|
-
- name: Checkout repository
|
|
13
|
-
uses: actions/checkout@v4
|
|
14
|
-
|
|
15
|
-
- name: Setup Node.js
|
|
16
|
-
uses: actions/setup-node@v4
|
|
17
|
-
with:
|
|
18
|
-
node-version: '20'
|
|
19
|
-
|
|
20
|
-
- name: Install dependencies
|
|
21
|
-
run: npm ci
|
|
22
|
-
|
|
23
|
-
- name: Build project
|
|
24
|
-
run: npm run build
|
|
25
|
-
|
|
26
|
-
- name: Sposta i file in demo/
|
|
27
|
-
run: |
|
|
28
|
-
mkdir -p dist/demo
|
|
29
|
-
shopt -s extglob
|
|
30
|
-
mv dist/!(demo) dist/demo/
|
|
31
|
-
|
|
32
|
-
- name: Deploy to GitHub Pages
|
|
33
|
-
uses: peaceiris/actions-gh-pages@v4
|
|
34
|
-
with:
|
|
35
|
-
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
36
|
-
publish_dir: ./dist
|
|
37
|
-
publish_branch: gh-pages
|
|
38
|
-
user_name: 'github-actions[bot]'
|
|
39
|
-
user_email: 'github-actions[bot]@users.noreply.github.com'
|
|
1
|
+
name: Deploy Demo to GitHub Pages
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build-and-deploy:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- name: Checkout repository
|
|
13
|
+
uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- name: Setup Node.js
|
|
16
|
+
uses: actions/setup-node@v4
|
|
17
|
+
with:
|
|
18
|
+
node-version: '20'
|
|
19
|
+
|
|
20
|
+
- name: Install dependencies
|
|
21
|
+
run: npm ci
|
|
22
|
+
|
|
23
|
+
- name: Build project
|
|
24
|
+
run: npm run build
|
|
25
|
+
|
|
26
|
+
- name: Sposta i file in demo/
|
|
27
|
+
run: |
|
|
28
|
+
mkdir -p dist/demo
|
|
29
|
+
shopt -s extglob
|
|
30
|
+
mv dist/!(demo) dist/demo/
|
|
31
|
+
|
|
32
|
+
- name: Deploy to GitHub Pages
|
|
33
|
+
uses: peaceiris/actions-gh-pages@v4
|
|
34
|
+
with:
|
|
35
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
36
|
+
publish_dir: ./dist
|
|
37
|
+
publish_branch: gh-pages
|
|
38
|
+
user_name: 'github-actions[bot]'
|
|
39
|
+
user_email: 'github-actions[bot]@users.noreply.github.com'
|
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
18
|
package/.prettierignore
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Build outputs
|
|
2
|
+
dist/
|
|
3
|
+
build/
|
|
4
|
+
out/
|
|
5
|
+
coverage/
|
|
6
|
+
*.tsbuildinfo
|
|
7
|
+
|
|
8
|
+
# Dependencies
|
|
9
|
+
node_modules/
|
|
10
|
+
|
|
11
|
+
# Lock files
|
|
12
|
+
package-lock.json
|
|
13
|
+
yarn.lock
|
|
14
|
+
pnpm-lock.yaml
|
|
15
|
+
|
|
16
|
+
# Logs
|
|
17
|
+
*.log
|
|
18
|
+
|
|
19
|
+
# Environment files
|
|
20
|
+
.env
|
|
21
|
+
.env.*
|
|
22
|
+
|
|
23
|
+
# Cache
|
|
24
|
+
.eslintcache
|
|
25
|
+
.parcel-cache
|
|
26
|
+
|
|
27
|
+
# Temporary files
|
|
28
|
+
tmp/
|
|
29
|
+
temp/
|
|
30
|
+
*.tmp
|
|
31
|
+
|
|
32
|
+
# Test outputs
|
|
33
|
+
test-*/
|
|
34
|
+
|
|
35
|
+
# Generated files
|
|
36
|
+
*.generated.*
|
|
37
|
+
|
|
38
|
+
# OS files
|
|
39
|
+
.DS_Store
|
|
40
|
+
Thumbs.db
|
|
41
|
+
|
|
42
|
+
# IDE
|
|
43
|
+
.vscode/
|
|
44
|
+
.idea/
|
package/.prettierrc
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"semi": true,
|
|
3
|
+
"trailingComma": "es5",
|
|
4
|
+
"singleQuote": true,
|
|
5
|
+
"printWidth": 100,
|
|
6
|
+
"tabWidth": 2,
|
|
7
|
+
"useTabs": false,
|
|
8
|
+
"endOfLine": "lf",
|
|
9
|
+
"arrowParens": "always",
|
|
10
|
+
"bracketSpacing": true,
|
|
11
|
+
"proseWrap": "preserve",
|
|
12
|
+
"quoteProps": "as-needed",
|
|
13
|
+
"requirePragma": false,
|
|
14
|
+
"insertPragma": false,
|
|
15
|
+
"htmlWhitespaceSensitivity": "css"
|
|
16
|
+
}
|
package/FUNDING.md
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
# Supporta KIMU-Core / Support KIMU-Core
|
|
2
|
-
|
|
3
|
-
🇮🇹 **Vuoi sostenere lo sviluppo di KIMU-Core?**
|
|
4
|
-
Il tuo contributo aiuta a mantenere il progetto open source, migliorarne le funzionalità e supportare la community!
|
|
5
|
-
|
|
6
|
-
Puoi donare tramite:
|
|
7
|
-
- [GitHub Sponsors](https://github.com/sponsors/hocram)
|
|
8
|
-
- [OpenCollective](https://opencollective.com/unicoverso)
|
|
9
|
-
- [Patreon](https://www.patreon.com/UnicoVerso)
|
|
10
|
-
- [Ko-fi](https://ko-fi.com/marcodipasquale)
|
|
11
|
-
- [PayPal](https://paypal.me/marcodipasquale)
|
|
12
|
-
- [BuyMeACoffee](https://www.buymeacoffee.com/hocram)
|
|
13
|
-
- [unicoverso.com/dona](https://unicoverso.com/dona)
|
|
14
|
-
|
|
15
|
-
Ogni donazione, anche piccola, fa la differenza!
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
🇬🇧 **Want to support KIMU-Core development?**
|
|
20
|
-
Your contribution helps keep the project open source, improve its features, and support the community!
|
|
21
|
-
|
|
22
|
-
You can donate via:
|
|
23
|
-
- [GitHub Sponsors](https://github.com/sponsors/hocram)
|
|
24
|
-
- [OpenCollective](https://opencollective.com/unicoverso)
|
|
25
|
-
- [Patreon](https://www.patreon.com/UnicoVerso)
|
|
26
|
-
- [Ko-fi](https://ko-fi.com/marcodipasquale)
|
|
27
|
-
- [PayPal](https://paypal.me/marcodipasquale)
|
|
28
|
-
- [BuyMeACoffee](https://www.buymeacoffee.com/hocram)
|
|
29
|
-
- [unicoverso.com/dona](https://unicoverso.com/dona)
|
|
30
|
-
|
|
31
|
-
Every donation, even small, makes a difference!
|
|
1
|
+
# Supporta KIMU-Core / Support KIMU-Core
|
|
2
|
+
|
|
3
|
+
🇮🇹 **Vuoi sostenere lo sviluppo di KIMU-Core?**
|
|
4
|
+
Il tuo contributo aiuta a mantenere il progetto open source, migliorarne le funzionalità e supportare la community!
|
|
5
|
+
|
|
6
|
+
Puoi donare tramite:
|
|
7
|
+
- [GitHub Sponsors](https://github.com/sponsors/hocram)
|
|
8
|
+
- [OpenCollective](https://opencollective.com/unicoverso)
|
|
9
|
+
- [Patreon](https://www.patreon.com/UnicoVerso)
|
|
10
|
+
- [Ko-fi](https://ko-fi.com/marcodipasquale)
|
|
11
|
+
- [PayPal](https://paypal.me/marcodipasquale)
|
|
12
|
+
- [BuyMeACoffee](https://www.buymeacoffee.com/hocram)
|
|
13
|
+
- [unicoverso.com/dona](https://unicoverso.com/dona)
|
|
14
|
+
|
|
15
|
+
Ogni donazione, anche piccola, fa la differenza!
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
🇬🇧 **Want to support KIMU-Core development?**
|
|
20
|
+
Your contribution helps keep the project open source, improve its features, and support the community!
|
|
21
|
+
|
|
22
|
+
You can donate via:
|
|
23
|
+
- [GitHub Sponsors](https://github.com/sponsors/hocram)
|
|
24
|
+
- [OpenCollective](https://opencollective.com/unicoverso)
|
|
25
|
+
- [Patreon](https://www.patreon.com/UnicoVerso)
|
|
26
|
+
- [Ko-fi](https://ko-fi.com/marcodipasquale)
|
|
27
|
+
- [PayPal](https://paypal.me/marcodipasquale)
|
|
28
|
+
- [BuyMeACoffee](https://www.buymeacoffee.com/hocram)
|
|
29
|
+
- [unicoverso.com/dona](https://unicoverso.com/dona)
|
|
30
|
+
|
|
31
|
+
Every donation, even small, makes a difference!
|
package/icon.svg
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<svg viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<g transform="translate(0,-0.83295207)">
|
|
3
|
-
<g transform="matrix(0.91533181,0,0,0.91533181,0,14)">
|
|
4
|
-
<path fill="#88d1e2" d="M57.47 111.07c18.74 0 33.94-15.19 33.94-33.94 0-9.65-4.03-18.36-10.49-24.54L47.95 109.7c3.02.88 6.22 1.36 9.53 1.36z"/>
|
|
5
|
-
<path fill="#f45e32" d="M82.48 0C63.74 0 48.54 15.19 48.54 33.94c0 9.65 4.03 18.36 10.49 24.54L92.01 1.36C88.99.48 85.79 0 82.48 0z"/>
|
|
6
|
-
<path fill="#fff463" d="M3.59 71.31c9.37 16.23 30.13 21.79 46.36 12.42 8.36-4.82 13.88-12.67 16-21.36H0c.75 3.06 1.93 6.07 3.59 8.94z"/>
|
|
7
|
-
<path fill="#91d292" d="M136.25 39.58c-9.37-16.23-30.13-21.79-46.36-12.42-8.36 4.82-13.88 12.67-16 21.36h65.95c-.75-3.06-1.93-6.07-3.59-8.94z"/>
|
|
8
|
-
</g>
|
|
9
|
-
</g>
|
|
10
|
-
</svg>
|
|
1
|
+
<svg viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g transform="translate(0,-0.83295207)">
|
|
3
|
+
<g transform="matrix(0.91533181,0,0,0.91533181,0,14)">
|
|
4
|
+
<path fill="#88d1e2" d="M57.47 111.07c18.74 0 33.94-15.19 33.94-33.94 0-9.65-4.03-18.36-10.49-24.54L47.95 109.7c3.02.88 6.22 1.36 9.53 1.36z"/>
|
|
5
|
+
<path fill="#f45e32" d="M82.48 0C63.74 0 48.54 15.19 48.54 33.94c0 9.65 4.03 18.36 10.49 24.54L92.01 1.36C88.99.48 85.79 0 82.48 0z"/>
|
|
6
|
+
<path fill="#fff463" d="M3.59 71.31c9.37 16.23 30.13 21.79 46.36 12.42 8.36-4.82 13.88-12.67 16-21.36H0c.75 3.06 1.93 6.07 3.59 8.94z"/>
|
|
7
|
+
<path fill="#91d292" d="M136.25 39.58c-9.37-16.23-30.13-21.79-46.36-12.42-8.36 4.82-13.88 12.67-16 21.36h65.95c-.75-3.06-1.93-6.07-3.59-8.94z"/>
|
|
8
|
+
</g>
|
|
9
|
+
</g>
|
|
10
|
+
</svg>
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kimu-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MPL-2.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"build:dev": "npm run generate-config:dev && npm run build:compile && npm run build:bundle && npm run build:post",
|
|
39
39
|
"build:local": "npm run generate-config:local && npm run build:compile && npm run build:bundle && npm run build:post",
|
|
40
40
|
"build:prod": "npm run generate-config:prod && npm run build:compile && npm run build:bundle && npm run build:post",
|
|
41
|
-
"build:compile": "
|
|
41
|
+
"build:compile": "npm run generate-config:dev && tsc",
|
|
42
42
|
"build:bundle": "vite build && npm run minify:css",
|
|
43
43
|
"build:post": "npm run build:all-config && npm run build:all-core && npm run build:all-modules && npm run build:all-ext",
|
|
44
44
|
"generate-config": "node scripts/generate-kimu-build-config.js dev",
|
|
@@ -55,10 +55,16 @@
|
|
|
55
55
|
"install:module": "node scripts/install-module.js",
|
|
56
56
|
"remove:module": "node scripts/remove-module.js",
|
|
57
57
|
"list:modules": "node scripts/list-modules.js",
|
|
58
|
+
"format": "prettier --write \"src/**/*.{ts,js,json,css,html,md}\"",
|
|
59
|
+
"format:check": "prettier --check \"src/**/*.{ts,js,json,css,html,md}\"",
|
|
60
|
+
"lint": "echo 'Add ESLint configuration if needed'",
|
|
58
61
|
"pack": "npm pack",
|
|
59
62
|
"pack:dry": "npm pack --dry-run",
|
|
60
63
|
"prepack": "npm run clear:build",
|
|
61
|
-
"postpack": "echo 'Package created successfully! Check kimu-core-*.tgz'"
|
|
64
|
+
"postpack": "echo 'Package created successfully! Check kimu-core-*.tgz'",
|
|
65
|
+
"publish:check": "npm run pack:dry && npm whoami && echo '\n✅ Ready to publish! Run: npm publish'",
|
|
66
|
+
"publish:dry": "npm publish --dry-run",
|
|
67
|
+
"prepublishOnly": "npm run pack:dry"
|
|
62
68
|
},
|
|
63
69
|
"engines": {
|
|
64
70
|
"node": ">=18.0.0",
|
|
@@ -72,6 +78,7 @@
|
|
|
72
78
|
"devDependencies": {
|
|
73
79
|
"esbuild": "^0.25.2",
|
|
74
80
|
"path": "^0.12.7",
|
|
81
|
+
"prettier": "^3.7.4",
|
|
75
82
|
"rollup-plugin-copy": "^3.5.0",
|
|
76
83
|
"typescript": "^5.8.3",
|
|
77
84
|
"vite": "^6.2.0"
|
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This script minifies CSS files in the dist/assets folder after build.
|
|
3
|
-
* It removes comments, whitespace, and optimizes the CSS for production.
|
|
4
|
-
*
|
|
5
|
-
* Key functionalities:
|
|
6
|
-
* - Reads all CSS files from dist/assets
|
|
7
|
-
* - Minifies each CSS file by removing comments and excess whitespace
|
|
8
|
-
* - Preserves the original file structure
|
|
9
|
-
* - Logs the size reduction for each file
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import fs from 'fs';
|
|
13
|
-
import path from 'path';
|
|
14
|
-
import { fileURLToPath } from 'url';
|
|
15
|
-
|
|
16
|
-
// Get the directory name of the current script file
|
|
17
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
18
|
-
|
|
19
|
-
// Resolve the path to the dist/assets directory
|
|
20
|
-
const assetsPath = path.resolve(__dirname, '../dist/assets');
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Simple CSS minification function
|
|
24
|
-
* - Removes comments
|
|
25
|
-
* - Removes excess whitespace
|
|
26
|
-
* - Compresses color codes
|
|
27
|
-
*/
|
|
28
|
-
function minifyCSS(css) {
|
|
29
|
-
return css
|
|
30
|
-
// Remove comments
|
|
31
|
-
.replace(/\/\*[\s\S]*?\*\//g, '')
|
|
32
|
-
// Remove whitespace around selectors and declarations
|
|
33
|
-
.replace(/\s*([{}:;,])\s*/g, '$1')
|
|
34
|
-
// Remove leading/trailing whitespace
|
|
35
|
-
.trim()
|
|
36
|
-
// Remove empty rules
|
|
37
|
-
.replace(/[^}]+\{\}/g, '')
|
|
38
|
-
// Compress color codes (#ffffff -> #fff)
|
|
39
|
-
.replace(/#([0-9a-f])\1([0-9a-f])\2([0-9a-f])\3/gi, '#$1$2$3');
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Process all CSS files in the assets directory
|
|
44
|
-
*/
|
|
45
|
-
function minifyAssetsCSS() {
|
|
46
|
-
if (!fs.existsSync(assetsPath)) {
|
|
47
|
-
console.log('[KIMU] ⚠️ Assets directory not found, skipping CSS minification');
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const files = fs.readdirSync(assetsPath);
|
|
52
|
-
const cssFiles = files.filter(file => file.endsWith('.css'));
|
|
53
|
-
|
|
54
|
-
if (cssFiles.length === 0) {
|
|
55
|
-
console.log('[KIMU] ℹ️ No CSS files found in assets directory');
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
let totalSaved = 0;
|
|
60
|
-
|
|
61
|
-
cssFiles.forEach(file => {
|
|
62
|
-
const filePath = path.join(assetsPath, file);
|
|
63
|
-
const originalContent = fs.readFileSync(filePath, 'utf-8');
|
|
64
|
-
const originalSize = Buffer.byteLength(originalContent, 'utf-8');
|
|
65
|
-
|
|
66
|
-
const minifiedContent = minifyCSS(originalContent);
|
|
67
|
-
const minifiedSize = Buffer.byteLength(minifiedContent, 'utf-8');
|
|
68
|
-
|
|
69
|
-
fs.writeFileSync(filePath, minifiedContent, 'utf-8');
|
|
70
|
-
|
|
71
|
-
const saved = originalSize - minifiedSize;
|
|
72
|
-
totalSaved += saved;
|
|
73
|
-
|
|
74
|
-
const reduction = ((saved / originalSize) * 100).toFixed(1);
|
|
75
|
-
console.log(`[KIMU] ✅ Minified ${file}: ${(originalSize/1024).toFixed(2)}KB → ${(minifiedSize/1024).toFixed(2)}KB (-${reduction}%)`);
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
console.log(`[KIMU] 🎉 Total CSS size reduction: ${(totalSaved/1024).toFixed(2)}KB`);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Run the minification
|
|
82
|
-
minifyAssetsCSS();
|
|
1
|
+
/**
|
|
2
|
+
* This script minifies CSS files in the dist/assets folder after build.
|
|
3
|
+
* It removes comments, whitespace, and optimizes the CSS for production.
|
|
4
|
+
*
|
|
5
|
+
* Key functionalities:
|
|
6
|
+
* - Reads all CSS files from dist/assets
|
|
7
|
+
* - Minifies each CSS file by removing comments and excess whitespace
|
|
8
|
+
* - Preserves the original file structure
|
|
9
|
+
* - Logs the size reduction for each file
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import fs from 'fs';
|
|
13
|
+
import path from 'path';
|
|
14
|
+
import { fileURLToPath } from 'url';
|
|
15
|
+
|
|
16
|
+
// Get the directory name of the current script file
|
|
17
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
18
|
+
|
|
19
|
+
// Resolve the path to the dist/assets directory
|
|
20
|
+
const assetsPath = path.resolve(__dirname, '../dist/assets');
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Simple CSS minification function
|
|
24
|
+
* - Removes comments
|
|
25
|
+
* - Removes excess whitespace
|
|
26
|
+
* - Compresses color codes
|
|
27
|
+
*/
|
|
28
|
+
function minifyCSS(css) {
|
|
29
|
+
return css
|
|
30
|
+
// Remove comments
|
|
31
|
+
.replace(/\/\*[\s\S]*?\*\//g, '')
|
|
32
|
+
// Remove whitespace around selectors and declarations
|
|
33
|
+
.replace(/\s*([{}:;,])\s*/g, '$1')
|
|
34
|
+
// Remove leading/trailing whitespace
|
|
35
|
+
.trim()
|
|
36
|
+
// Remove empty rules
|
|
37
|
+
.replace(/[^}]+\{\}/g, '')
|
|
38
|
+
// Compress color codes (#ffffff -> #fff)
|
|
39
|
+
.replace(/#([0-9a-f])\1([0-9a-f])\2([0-9a-f])\3/gi, '#$1$2$3');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Process all CSS files in the assets directory
|
|
44
|
+
*/
|
|
45
|
+
function minifyAssetsCSS() {
|
|
46
|
+
if (!fs.existsSync(assetsPath)) {
|
|
47
|
+
console.log('[KIMU] ⚠️ Assets directory not found, skipping CSS minification');
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const files = fs.readdirSync(assetsPath);
|
|
52
|
+
const cssFiles = files.filter(file => file.endsWith('.css'));
|
|
53
|
+
|
|
54
|
+
if (cssFiles.length === 0) {
|
|
55
|
+
console.log('[KIMU] ℹ️ No CSS files found in assets directory');
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
let totalSaved = 0;
|
|
60
|
+
|
|
61
|
+
cssFiles.forEach(file => {
|
|
62
|
+
const filePath = path.join(assetsPath, file);
|
|
63
|
+
const originalContent = fs.readFileSync(filePath, 'utf-8');
|
|
64
|
+
const originalSize = Buffer.byteLength(originalContent, 'utf-8');
|
|
65
|
+
|
|
66
|
+
const minifiedContent = minifyCSS(originalContent);
|
|
67
|
+
const minifiedSize = Buffer.byteLength(minifiedContent, 'utf-8');
|
|
68
|
+
|
|
69
|
+
fs.writeFileSync(filePath, minifiedContent, 'utf-8');
|
|
70
|
+
|
|
71
|
+
const saved = originalSize - minifiedSize;
|
|
72
|
+
totalSaved += saved;
|
|
73
|
+
|
|
74
|
+
const reduction = ((saved / originalSize) * 100).toFixed(1);
|
|
75
|
+
console.log(`[KIMU] ✅ Minified ${file}: ${(originalSize/1024).toFixed(2)}KB → ${(minifiedSize/1024).toFixed(2)}KB (-${reduction}%)`);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
console.log(`[KIMU] 🎉 Total CSS size reduction: ${(totalSaved/1024).toFixed(2)}KB`);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Run the minification
|
|
82
|
+
minifyAssetsCSS();
|
package/src/core/index.ts
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* KIMU Core - Central Export File
|
|
3
|
-
*
|
|
4
|
-
* This file exports all core KIMU framework classes, decorators, and utilities
|
|
5
|
-
* for convenient importing in extensions and applications.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
// Core application classes
|
|
9
|
-
export { KimuApp } from './kimu-app';
|
|
10
|
-
export { KimuComponentElement } from './kimu-component-element';
|
|
11
|
-
export { KimuComponent } from './kimu-component';
|
|
12
|
-
export { KimuEngine } from './kimu-engine';
|
|
13
|
-
export { KimuRender } from './kimu-render';
|
|
14
|
-
|
|
15
|
-
// Extension and module management
|
|
16
|
-
export { KimuExtensionManager } from './kimu-extension-manager';
|
|
17
|
-
export { KimuModule } from './kimu-module';
|
|
18
|
-
export { KimuModuleManager } from './kimu-module-manager';
|
|
19
|
-
|
|
20
|
-
// Asset and style management
|
|
21
|
-
export { KimuAssetManager } from './kimu-asset-manager';
|
|
22
|
-
export { KimuGlobalStyles } from './kimu-global-styles';
|
|
23
|
-
|
|
24
|
-
// Configuration and storage
|
|
25
|
-
export { KimuPathConfig } from './kimu-path-config';
|
|
26
|
-
export { KimuStore } from './kimu-store';
|
|
27
|
-
|
|
28
|
-
// Reactive system - Optimized & Minimal
|
|
29
|
-
export {
|
|
30
|
-
property,
|
|
31
|
-
initReactiveProperties,
|
|
32
|
-
getObservedAttributes,
|
|
33
|
-
handleAttributeChange
|
|
34
|
-
} from './kimu-reactive';
|
|
35
|
-
|
|
36
|
-
// Type definitions
|
|
37
|
-
export type {
|
|
38
|
-
KimuAsset,
|
|
39
|
-
KimuGroupAsset,
|
|
40
|
-
KimuLang,
|
|
41
|
-
KimuExtensionLanguages,
|
|
42
|
-
KimuExtensionMeta,
|
|
43
|
-
KimuModuleOptions
|
|
44
|
-
} from './kimu-types';
|
|
45
|
-
|
|
46
|
-
// Reactive system types
|
|
47
|
-
export type { PropertyOptions } from './kimu-reactive';
|
|
1
|
+
/**
|
|
2
|
+
* KIMU Core - Central Export File
|
|
3
|
+
*
|
|
4
|
+
* This file exports all core KIMU framework classes, decorators, and utilities
|
|
5
|
+
* for convenient importing in extensions and applications.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// Core application classes
|
|
9
|
+
export { KimuApp } from './kimu-app';
|
|
10
|
+
export { KimuComponentElement } from './kimu-component-element';
|
|
11
|
+
export { KimuComponent } from './kimu-component';
|
|
12
|
+
export { KimuEngine } from './kimu-engine';
|
|
13
|
+
export { KimuRender } from './kimu-render';
|
|
14
|
+
|
|
15
|
+
// Extension and module management
|
|
16
|
+
export { KimuExtensionManager } from './kimu-extension-manager';
|
|
17
|
+
export { KimuModule } from './kimu-module';
|
|
18
|
+
export { KimuModuleManager } from './kimu-module-manager';
|
|
19
|
+
|
|
20
|
+
// Asset and style management
|
|
21
|
+
export { KimuAssetManager } from './kimu-asset-manager';
|
|
22
|
+
export { KimuGlobalStyles } from './kimu-global-styles';
|
|
23
|
+
|
|
24
|
+
// Configuration and storage
|
|
25
|
+
export { KimuPathConfig } from './kimu-path-config';
|
|
26
|
+
export { KimuStore } from './kimu-store';
|
|
27
|
+
|
|
28
|
+
// Reactive system - Optimized & Minimal
|
|
29
|
+
export {
|
|
30
|
+
property,
|
|
31
|
+
initReactiveProperties,
|
|
32
|
+
getObservedAttributes,
|
|
33
|
+
handleAttributeChange
|
|
34
|
+
} from './kimu-reactive';
|
|
35
|
+
|
|
36
|
+
// Type definitions
|
|
37
|
+
export type {
|
|
38
|
+
KimuAsset,
|
|
39
|
+
KimuGroupAsset,
|
|
40
|
+
KimuLang,
|
|
41
|
+
KimuExtensionLanguages,
|
|
42
|
+
KimuExtensionMeta,
|
|
43
|
+
KimuModuleOptions
|
|
44
|
+
} from './kimu-types';
|
|
45
|
+
|
|
46
|
+
// Reactive system types
|
|
47
|
+
export type { PropertyOptions } from './kimu-reactive';
|