@dxtmisha/scripts 1.5.1 → 1.5.2
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 +18 -0
- package/bin/build-packages.ts +13 -2
- package/dist/library.d.ts +57 -13
- package/dist/library.js +263 -246
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.5.2] - 2026-10-07
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **Package Modification Date Tracking in `BuildPackages`**:
|
|
9
|
+
- Added `--date` (`-t`) CLI option to `dxt-build-packages` (`bin/build-packages.ts`) enabling rebuilds when package modification dates or git commit timestamps change.
|
|
10
|
+
- Added `BuildPackagesOptions` interface with `{ path, code, logFile, date }` configuration properties.
|
|
11
|
+
- Added `BuildPackageLogItem` interface (`{ version: string, date?: string }`) supporting structured build log entries.
|
|
12
|
+
- Added `getDate(packageFile)` method resolving commit timestamp via `GitRead.getFileDate()` with filesystem mtime fallback via `PropertiesFile.getTime()`.
|
|
13
|
+
- Added `getDateLog(name)` method to extract cached package timestamps from memory/file build logs.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- **`BuildPackages` Constructor & Options Refactoring**:
|
|
17
|
+
- Refactored `BuildPackages` constructor to accept a unified `BuildPackagesOptions` object instead of separate positional arguments.
|
|
18
|
+
- Enhanced `updateLog()` to record both `version` and `date` in `ui-build.log.json`.
|
|
19
|
+
- Updated `getVersionLog()` to maintain backward compatibility with both legacy string-based and new object-based log records.
|
|
20
|
+
- Updated `isUpdate()` logic to evaluate date invalidation when `date: true` option is enabled.
|
|
21
|
+
- Updated unit test suite in `BuildPackages.test.ts` covering object-based options, date-driven rebuild detection, and log persistence.
|
|
22
|
+
|
|
5
23
|
## [1.5.1] - 2026-10-05
|
|
6
24
|
|
|
7
25
|
### Added
|
package/bin/build-packages.ts
CHANGED
|
@@ -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(
|
|
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)
|
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
|
|
1004
|
-
protected readonly logFile?: string
|
|
1005
|
-
|
|
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
|
|
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(
|
|
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.
|