@dxtmisha/scripts 1.5.1 → 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 CHANGED
@@ -2,6 +2,32 @@
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
+
13
+ ## [1.5.2] - 2026-10-07
14
+
15
+ ### Added
16
+ - **Package Modification Date Tracking in `BuildPackages`**:
17
+ - Added `--date` (`-t`) CLI option to `dxt-build-packages` (`bin/build-packages.ts`) enabling rebuilds when package modification dates or git commit timestamps change.
18
+ - Added `BuildPackagesOptions` interface with `{ path, code, logFile, date }` configuration properties.
19
+ - Added `BuildPackageLogItem` interface (`{ version: string, date?: string }`) supporting structured build log entries.
20
+ - Added `getDate(packageFile)` method resolving commit timestamp via `GitRead.getFileDate()` with filesystem mtime fallback via `PropertiesFile.getTime()`.
21
+ - Added `getDateLog(name)` method to extract cached package timestamps from memory/file build logs.
22
+
23
+ ### Changed
24
+ - **`BuildPackages` Constructor & Options Refactoring**:
25
+ - Refactored `BuildPackages` constructor to accept a unified `BuildPackagesOptions` object instead of separate positional arguments.
26
+ - Enhanced `updateLog()` to record both `version` and `date` in `ui-build.log.json`.
27
+ - Updated `getVersionLog()` to maintain backward compatibility with both legacy string-based and new object-based log records.
28
+ - Updated `isUpdate()` logic to evaluate date invalidation when `date: true` option is enabled.
29
+ - Updated unit test suite in `BuildPackages.test.ts` covering object-based options, date-driven rebuild detection, and log persistence.
30
+
5
31
  ## [1.5.1] - 2026-10-05
6
32
 
7
33
  ### Added
@@ -6,13 +6,18 @@ import { BuildPackages } from '../dist/library.js'
6
6
 
7
7
  const { values } = parseCliArguments(
8
8
  'Scans, sorts, and builds monorepo packages managing build order by priorities.',
9
- 'Usage: dxt-build-packages [--code CODE] [--dir DIR] [--log LOG]',
9
+ 'Usage: dxt-build-packages [--code CODE] [--date] [--dir DIR] [--log LOG]',
10
10
  {
11
11
  code: {
12
12
  type: 'string',
13
13
  short: 'c',
14
14
  description: 'Custom build command or script name to execute'
15
15
  },
16
+ date: {
17
+ type: 'boolean',
18
+ short: 't',
19
+ description: 'Compare package modification date in addition to version'
20
+ },
16
21
  dir: {
17
22
  type: 'string',
18
23
  short: 'd',
@@ -29,8 +34,14 @@ const { values } = parseCliArguments(
29
34
  const dir = typeof values.dir === 'string' ? values.dir : undefined
30
35
  const code = typeof values.code === 'string' ? values.code : undefined
31
36
  const log = typeof values.log === 'string' ? values.log : undefined
37
+ const date = typeof values.date === 'boolean' ? values.date : undefined
32
38
 
33
- new BuildPackages(dir, code, log)
39
+ new BuildPackages({
40
+ path: dir,
41
+ code,
42
+ logFile: log,
43
+ date
44
+ })
34
45
  .make()
35
46
  .catch((error) => {
36
47
  console.error('dxt-build-packages failed:', error)
@@ -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
- new LibraryExport().make()
17
+ const style = !values['no-style']
18
+
19
+ new LibraryExport(style).make()
package/dist/library.d.ts CHANGED
@@ -991,6 +991,18 @@ export declare class BrowserItem {
991
991
  protected toConsole(text: string): void;
992
992
  }
993
993
 
994
+ /**
995
+ * Cached package build log entry.
996
+ *
997
+ * Запись лога сборки пакета в кэше.
998
+ */
999
+ export declare interface BuildPackageLogItem {
1000
+ /** Package version / Версия пакета */
1001
+ version: string;
1002
+ /** Last modification date or commit timestamp / Дата последнего изменения или временная метка коммита */
1003
+ date?: string;
1004
+ }
1005
+
994
1006
  /**
995
1007
  * Orchestrator for scanning, sorting, and building monorepo packages.
996
1008
  * Manages build order based on package priorities and tracks build versions via log cache.
@@ -999,20 +1011,20 @@ export declare class BrowserItem {
999
1011
  * Управляет порядком сборки на основе приоритетов пакетов и отслеживает версии сборки через лог-кэш.
1000
1012
  */
1001
1013
  export declare class BuildPackages {
1014
+ protected readonly options: BuildPackagesOptions;
1015
+ /** Map of cached package build logs / Карта кэшированных логов сборки пакетов */
1016
+ protected log: Record<string, BuildPackageLogItem | string>;
1002
1017
  protected readonly path: string;
1003
- protected readonly code?: string | undefined;
1004
- protected readonly logFile?: string | undefined;
1005
- /** Map of cached package build versions / Карта кэшированных версий сборки пакетов */
1006
- protected log: Record<string, string>;
1018
+ protected readonly code?: string;
1019
+ protected readonly logFile?: string;
1020
+ protected readonly date?: boolean;
1007
1021
  /**
1008
- * Constructor initializes packages path, custom build code, custom log file, and loads build log.
1022
+ * Constructor initializes packages path, custom build code, custom log file, date comparison flag, and loads build log.
1009
1023
  *
1010
- * Конструктор инициализирует путь к пакетам, пользовательский код сборки, пользовательский файл лога и загружает лог сборки.
1011
- * @param path packages directory path / путь к директории пакетов
1012
- * @param code custom build command or script name / пользовательская команда сборки или имя скрипта
1013
- * @param logFile custom log file name or path / пользовательское имя или путь к файлу лога
1024
+ * Конструктор инициализирует путь к пакетам, пользовательский код сборки, пользовательский файл лога, флаг сравнения дат и загружает лог сборки.
1025
+ * @param options configuration options / параметры конфигурации
1014
1026
  */
1015
- constructor(path?: string, code?: string | undefined, logFile?: string | undefined);
1027
+ constructor(options?: BuildPackagesOptions);
1016
1028
  /**
1017
1029
  * Scans the packages directory and builds each package that contains a package.json.
1018
1030
  *
@@ -1024,7 +1036,7 @@ export declare class BuildPackages {
1024
1036
  *
1025
1037
  * Проверяет, нужно ли обновлять пакет.
1026
1038
  * @param packageFile package file object / объект файла пакета
1027
- * @returns true if version differs from log cache / true, если версия отличается от кэша лога
1039
+ * @returns true if version or modification date differs from log cache / true, если версия или дата изменения отличается от кэша лога
1028
1040
  */
1029
1041
  protected isUpdate(packageFile: PackageFile): boolean;
1030
1042
  /**
@@ -1035,6 +1047,22 @@ export declare class BuildPackages {
1035
1047
  * @returns command string or undefined / строка команды или undefined
1036
1048
  */
1037
1049
  protected getCode(packageFile: PackageFile): string | undefined;
1050
+ /**
1051
+ * Returns the last modification date of the package.
1052
+ *
1053
+ * Возвращает дату последнего изменения пакета.
1054
+ * @param packageFile package file instance / экземпляр файла пакета
1055
+ * @returns commit date string / строка даты коммита
1056
+ */
1057
+ protected getDate(packageFile: PackageFile): string;
1058
+ /**
1059
+ * Returns the cached modification date of the package from the build log.
1060
+ *
1061
+ * Возвращает кэшированную дату изменения пакета из лога сборки.
1062
+ * @param name package name / имя пакета
1063
+ * @returns cached date string or undefined / строка кэшированной даты или undefined
1064
+ */
1065
+ protected getDateLog(name: string): string | undefined;
1038
1066
  /**
1039
1067
  * Returns the path segments to the build log file.
1040
1068
  *
@@ -1051,9 +1079,9 @@ export declare class BuildPackages {
1051
1079
  */
1052
1080
  protected getVersionLog(name: string): string;
1053
1081
  /**
1054
- * Updates the build log with the current package version in memory.
1082
+ * Updates the build log with the current package version and date in memory.
1055
1083
  *
1056
- * Обновляет лог сборки текущей версией пакета в памяти.
1084
+ * Обновляет лог сборки текущей версией и датой пакета в памяти.
1057
1085
  * @param packageFile package file object / объект файла пакета
1058
1086
  */
1059
1087
  protected updateLog(packageFile: PackageFile): void;
@@ -1088,6 +1116,22 @@ export declare class BuildPackages {
1088
1116
  private getList;
1089
1117
  }
1090
1118
 
1119
+ /**
1120
+ * Configuration options for BuildPackages.
1121
+ *
1122
+ * Параметры конфигурации для BuildPackages.
1123
+ */
1124
+ export declare interface BuildPackagesOptions {
1125
+ /** Directory path to packages / Путь к директории пакетов */
1126
+ path?: string;
1127
+ /** Custom build command or script name / Пользовательская команда сборки или имя скрипта */
1128
+ code?: string;
1129
+ /** Custom log file name or path / Пользовательское имя или путь к файлу лога */
1130
+ logFile?: string;
1131
+ /** Whether to compare package modification date in addition to version / Сравнивать ли дату изменения пакета дополнительно к версии */
1132
+ date?: boolean;
1133
+ }
1134
+
1091
1135
  /**
1092
1136
  * Orchestrator for scanning and publishing changed packages to the npm registry.
1093
1137
  * Compares current package versions against published versions in npm and publishes updated packages.
@@ -4129,6 +4173,14 @@ export declare type LibraryData = {
4129
4173
  * Класс для генерации экспортируемых данных и агрегации точек входа модулей.
4130
4174
  */
4131
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);
4132
4184
  /**
4133
4185
  * Start of data generation.
4134
4186
  *
@@ -4151,6 +4203,13 @@ export declare class LibraryExport {
4151
4203
  * @returns true if file is eligible for export / true, если файл подлежит экспорту
4152
4204
  */
4153
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;
4154
4213
  /**
4155
4214
  * Returns a list of all files for export.
4156
4215
  *