@dxtmisha/scripts 1.5.2 → 1.5.3
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/CHANGELOG.md +8 -0
- package/bin/design-library.ts +11 -3
- package/dist/library.d.ts +15 -0
- package/dist/library.js +19 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.5.3] - 2026-10-07
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **Configurable Style Import in `LibraryExport`**:
|
|
9
|
+
- Added `style` constructor parameter (default `true`) and `isStyle()` check to `LibraryExport` (`src/classes/Library/LibraryExport.ts`) to conditionally control inclusion of global styles (`style.scss` / `style.css`).
|
|
10
|
+
- Added `--no-style` CLI option to `dxt-library` (`bin/design-library.ts`) allowing generation of library barrel exports without global style imports.
|
|
11
|
+
- Added unit test coverage in `LibraryExport.test.ts` for the `style` constructor option.
|
|
12
|
+
|
|
5
13
|
## [1.5.2] - 2026-10-07
|
|
6
14
|
|
|
7
15
|
### Added
|
package/bin/design-library.ts
CHANGED
|
@@ -3,9 +3,17 @@
|
|
|
3
3
|
import { parseCliArguments } from './arguments'
|
|
4
4
|
import { LibraryExport } from '../dist/library.js'
|
|
5
5
|
|
|
6
|
-
parseCliArguments(
|
|
6
|
+
const { values } = parseCliArguments(
|
|
7
7
|
'Generates exportable data and aggregate module entries for the library.',
|
|
8
|
-
'Usage: dxt-library'
|
|
8
|
+
'Usage: dxt-library [--no-style]',
|
|
9
|
+
{
|
|
10
|
+
'no-style': {
|
|
11
|
+
type: 'boolean',
|
|
12
|
+
description: 'Exclude styles from the exported library'
|
|
13
|
+
}
|
|
14
|
+
}
|
|
9
15
|
)
|
|
10
16
|
|
|
11
|
-
|
|
17
|
+
const style = !values['no-style']
|
|
18
|
+
|
|
19
|
+
new LibraryExport(style).make()
|
package/dist/library.d.ts
CHANGED
|
@@ -4173,6 +4173,14 @@ export declare type LibraryData = {
|
|
|
4173
4173
|
* Класс для генерации экспортируемых данных и агрегации точек входа модулей.
|
|
4174
4174
|
*/
|
|
4175
4175
|
export declare class LibraryExport {
|
|
4176
|
+
protected readonly style: boolean;
|
|
4177
|
+
/**
|
|
4178
|
+
* Constructor for LibraryExport.
|
|
4179
|
+
*
|
|
4180
|
+
* Конструктор для LibraryExport.
|
|
4181
|
+
* @param style whether to include styles in export / подключать ли стили в экспорт
|
|
4182
|
+
*/
|
|
4183
|
+
constructor(style?: boolean);
|
|
4176
4184
|
/**
|
|
4177
4185
|
* Start of data generation.
|
|
4178
4186
|
*
|
|
@@ -4195,6 +4203,13 @@ export declare class LibraryExport {
|
|
|
4195
4203
|
* @returns true if file is eligible for export / true, если файл подлежит экспорту
|
|
4196
4204
|
*/
|
|
4197
4205
|
protected isExport(path: string | string[]): boolean;
|
|
4206
|
+
/**
|
|
4207
|
+
* Checks whether styles should be included in export.
|
|
4208
|
+
*
|
|
4209
|
+
* Проверяет, нужно ли подключать стили в экспорт.
|
|
4210
|
+
* @returns true if styles should be included / true, если стили нужно подключать
|
|
4211
|
+
*/
|
|
4212
|
+
protected isStyle(): boolean;
|
|
4198
4213
|
/**
|
|
4199
4214
|
* Returns a list of all files for export.
|
|
4200
4215
|
*
|
package/dist/library.js
CHANGED
|
@@ -1866,6 +1866,10 @@ ${pt}
|
|
|
1866
1866
|
return u.writeByPath(_, e), this;
|
|
1867
1867
|
}
|
|
1868
1868
|
}, _t = class {
|
|
1869
|
+
style;
|
|
1870
|
+
constructor(e = !0) {
|
|
1871
|
+
this.style = e;
|
|
1872
|
+
}
|
|
1869
1873
|
make() {
|
|
1870
1874
|
console.log("Library export"), u.writeByPath(ee, `${this.initFile().trim()}\r\n`), console.log("\r\nfinish");
|
|
1871
1875
|
}
|
|
@@ -1875,6 +1879,9 @@ ${pt}
|
|
|
1875
1879
|
isExport(e) {
|
|
1876
1880
|
return !u.joinPath(e).match(".test.") && !this.getFile(e).match(pe);
|
|
1877
1881
|
}
|
|
1882
|
+
isStyle() {
|
|
1883
|
+
return this.style;
|
|
1884
|
+
}
|
|
1878
1885
|
getDirectory() {
|
|
1879
1886
|
let e = [];
|
|
1880
1887
|
return te.forEach((t) => {
|
|
@@ -1893,21 +1900,26 @@ ${pt}
|
|
|
1893
1900
|
return u.readFile(e) ?? "";
|
|
1894
1901
|
}
|
|
1895
1902
|
initFile() {
|
|
1896
|
-
let e = this.getDirectory(), t = [
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1903
|
+
let e = this.getDirectory(), t = [], n = this.initStyles();
|
|
1904
|
+
n && t.push(n);
|
|
1905
|
+
let r = [];
|
|
1906
|
+
e.forEach((e) => {
|
|
1907
|
+
let n = e.name;
|
|
1908
|
+
r.push(""), r.push(`// ${this.getName(n)}`), console.log(n), e.files.forEach((i) => {
|
|
1900
1909
|
if (this.isExport([...e.path, i])) {
|
|
1901
|
-
if (console.log(` ${i}`), i.match(/\.ts$/))
|
|
1910
|
+
if (console.log(` ${i}`), i.match(/\.ts$/)) r.push(`export * from './${n}/${i.replace(/\.ts$/, "")}'`);
|
|
1902
1911
|
else if (i.match(/\.vue$/)) {
|
|
1903
1912
|
let e = i.replace(/\.vue$/, "").replace(/^(.*?)([^/]+)$/, "$2");
|
|
1904
|
-
t.push(`import _${e} from './${
|
|
1913
|
+
t.push(`import _${e} from './${n}/${i}'`), r.push(`export const ${e} = _${e}`);
|
|
1905
1914
|
}
|
|
1906
1915
|
}
|
|
1907
1916
|
});
|
|
1908
|
-
})
|
|
1917
|
+
});
|
|
1918
|
+
let i = t.join("\r\n").trim(), a = r.join("\r\n").trim();
|
|
1919
|
+
return i ? `${i}\r\n\r\n${a}` : a;
|
|
1909
1920
|
}
|
|
1910
1921
|
initStyles() {
|
|
1922
|
+
if (!this.isStyle()) return "";
|
|
1911
1923
|
let e = [];
|
|
1912
1924
|
return ["style.scss", "style.css"].forEach((t) => {
|
|
1913
1925
|
let n = ["src", t];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxtmisha/scripts",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "CLI tools, AI integration scripts, and automation utilities for DXT UI — automated component scaffolding, Figma layout generation, library packaging, documentation building, screenshot captures, and AI prompt processing.",
|
|
7
7
|
"keywords": [
|