@public-ui/kolibri-cli 4.0.3 ā 4.0.4-rc.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/dist/generate-scss/index.js +50 -3
- package/package.json +10 -10
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.default = default_1;
|
|
4
7
|
const components_1 = require("@public-ui/components");
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
5
10
|
const scss_1 = require("typed-bem/scss");
|
|
6
11
|
/**
|
|
7
12
|
* This function is used to register the scss generator command.
|
|
@@ -11,8 +16,50 @@ function default_1(program) {
|
|
|
11
16
|
program
|
|
12
17
|
.command('generate-scss')
|
|
13
18
|
.description('Generate SCSS files with BEM selectors for KoliBri components (experimental).')
|
|
14
|
-
.
|
|
15
|
-
(
|
|
16
|
-
(
|
|
19
|
+
.argument('<components...>', 'Component names to generate (e.g., alert icon)')
|
|
20
|
+
.option('-o, --output <path>', 'Output directory for generated SCSS files', 'src/components')
|
|
21
|
+
.action((components, options) => {
|
|
22
|
+
// Use provided output path relative to current working directory
|
|
23
|
+
const outputDir = path_1.default.resolve(process.cwd(), options.output);
|
|
24
|
+
// Create output directory if it doesn't exist
|
|
25
|
+
if (!fs_1.default.existsSync(outputDir)) {
|
|
26
|
+
fs_1.default.mkdirSync(outputDir, { recursive: true });
|
|
27
|
+
}
|
|
28
|
+
console.log(`š Generating SCSS files in: ${outputDir}`);
|
|
29
|
+
// Change to output directory for generation
|
|
30
|
+
const originalCwd = process.cwd();
|
|
31
|
+
process.chdir(outputDir);
|
|
32
|
+
try {
|
|
33
|
+
// Generate SCSS for each requested component
|
|
34
|
+
for (const component of components) {
|
|
35
|
+
const componentKey = `kol-${component}`;
|
|
36
|
+
// Filter out skeleton and click-button
|
|
37
|
+
if (component === 'skeleton' || component === 'click-button') {
|
|
38
|
+
console.warn(`ā ļø Component '${component}' is not available for generation.`);
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (!components_1.BEM[componentKey]) {
|
|
42
|
+
const availableComponents = Object.keys(components_1.BEM)
|
|
43
|
+
.filter((key) => !key.includes('skeleton') && !key.includes('click-button'))
|
|
44
|
+
.join(', ');
|
|
45
|
+
console.warn(`ā ļø Component '${component}' not found in BEM registry. Available: ${availableComponents}`);
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
// Generate SCSS with fixed kol-theme-component layer
|
|
49
|
+
(0, scss_1.generateBemScssFile)({
|
|
50
|
+
[componentKey]: components_1.BEM[componentKey],
|
|
51
|
+
}, component, { layer: 'kol-theme-component' });
|
|
52
|
+
console.log(`ā
Generated ${component}.scss`);
|
|
53
|
+
}
|
|
54
|
+
console.log(`\nšÆ Generated with CSS layer: @layer kol-theme-component`);
|
|
55
|
+
console.log(`\nš” Next steps:`);
|
|
56
|
+
console.log(` 1. Review generated files in ${options.output}/`);
|
|
57
|
+
console.log(` 2. Add your CSS styles to the BEM selectors`);
|
|
58
|
+
console.log(` 3. Build your theme to include the styled components`);
|
|
59
|
+
}
|
|
60
|
+
finally {
|
|
61
|
+
// Restore original working directory
|
|
62
|
+
process.chdir(originalCwd);
|
|
63
|
+
}
|
|
17
64
|
});
|
|
18
65
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@public-ui/kolibri-cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4-rc.0",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"homepage": "https://public-ui.github.io",
|
|
6
6
|
"repository": {
|
|
@@ -30,26 +30,26 @@
|
|
|
30
30
|
"prettier-plugin-organize-imports": "4.3.0",
|
|
31
31
|
"semver": "7.7.4",
|
|
32
32
|
"typed-bem": "1.0.2",
|
|
33
|
-
"@public-ui/components": "4.0.
|
|
33
|
+
"@public-ui/components": "4.0.4-rc.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@eslint/js": "9.39.
|
|
37
|
-
"@types/node": "25.
|
|
36
|
+
"@eslint/js": "9.39.3",
|
|
37
|
+
"@types/node": "25.3.0",
|
|
38
38
|
"@types/semver": "7.7.1",
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
40
|
-
"@typescript-eslint/parser": "8.
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "8.56.1",
|
|
40
|
+
"@typescript-eslint/parser": "8.56.1",
|
|
41
41
|
"cross-env": "10.1.0",
|
|
42
|
-
"eslint": "9.39.
|
|
42
|
+
"eslint": "9.39.3",
|
|
43
43
|
"eslint-plugin-html": "8.1.4",
|
|
44
44
|
"eslint-plugin-json": "4.0.1",
|
|
45
45
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
46
46
|
"eslint-plugin-react": "7.37.5",
|
|
47
|
-
"knip": "5.
|
|
47
|
+
"knip": "5.85.0",
|
|
48
48
|
"mocha": "11.7.5",
|
|
49
|
-
"nodemon": "3.1.
|
|
49
|
+
"nodemon": "3.1.14",
|
|
50
50
|
"ts-node": "10.9.2",
|
|
51
51
|
"typescript": "5.9.3",
|
|
52
|
-
"@public-ui/components": "4.0.
|
|
52
|
+
"@public-ui/components": "4.0.4-rc.0"
|
|
53
53
|
},
|
|
54
54
|
"engines": {
|
|
55
55
|
"node": ">=22"
|