onreza-release 2.0.0 → 2.1.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/cli.js +125 -9
- package/dist/cli.js.map +4 -4
- package/dist/index.js +123 -7
- package/dist/index.js.map +4 -4
- package/dist/types.d.ts +30 -0
- package/dist/utils/binary-postinstall-generator.d.ts +34 -1
- package/package.json +1 -1
- package/schema.json +26 -0
package/dist/types.d.ts
CHANGED
|
@@ -672,6 +672,31 @@ export interface BinaryManifest {
|
|
|
672
672
|
/** Маппинг платформ на URL-ы для скачивания */
|
|
673
673
|
assets: Record<BinaryPlatform, string>;
|
|
674
674
|
}
|
|
675
|
+
/**
|
|
676
|
+
* Настройки npm пакета для бинарной дистрибуции
|
|
677
|
+
*/
|
|
678
|
+
export interface BinariesNpmConfig {
|
|
679
|
+
/**
|
|
680
|
+
* Генерировать postinstall скрипт и bin wrapper
|
|
681
|
+
* @default true
|
|
682
|
+
*/
|
|
683
|
+
generateScripts: boolean;
|
|
684
|
+
/**
|
|
685
|
+
* Директория для postinstall скрипта
|
|
686
|
+
* @default "scripts"
|
|
687
|
+
*/
|
|
688
|
+
scriptsDir: string;
|
|
689
|
+
/**
|
|
690
|
+
* Директория для bin wrapper
|
|
691
|
+
* @default "bin"
|
|
692
|
+
*/
|
|
693
|
+
binDir: string;
|
|
694
|
+
/**
|
|
695
|
+
* Обновлять package.json с правильными bin и scripts.postinstall
|
|
696
|
+
* @default true
|
|
697
|
+
*/
|
|
698
|
+
updatePackageJson: boolean;
|
|
699
|
+
}
|
|
675
700
|
/**
|
|
676
701
|
* Конфигурация бинарной дистрибуции
|
|
677
702
|
*/
|
|
@@ -740,6 +765,11 @@ export interface BinariesConfig {
|
|
|
740
765
|
* @default false
|
|
741
766
|
*/
|
|
742
767
|
continueOnError: boolean;
|
|
768
|
+
/**
|
|
769
|
+
* Настройки генерации npm пакета
|
|
770
|
+
* Генерирует postinstall скрипт который скачивает бинарник с Release
|
|
771
|
+
*/
|
|
772
|
+
npm?: BinariesNpmConfig;
|
|
743
773
|
}
|
|
744
774
|
/**
|
|
745
775
|
* Успешный результат загрузки asset
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BinaryManifest, BinaryPlatform } from "../types";
|
|
1
|
+
import type { BinariesNpmConfig, BinaryManifest, BinaryPlatform } from "../types";
|
|
2
2
|
/**
|
|
3
3
|
* Генерирует postinstall скрипт для скачивания бинарника
|
|
4
4
|
*
|
|
@@ -32,3 +32,36 @@ export declare function createBinaryManifest(version: string, binName: string, a
|
|
|
32
32
|
* @returns Содержимое package.json
|
|
33
33
|
*/
|
|
34
34
|
export declare function generateMasterPackageJson(name: string, version: string, binName: string, description?: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* Опции для записи npm файлов
|
|
37
|
+
*/
|
|
38
|
+
export interface WriteNpmFilesOptions {
|
|
39
|
+
/** Манифест с URL-ами */
|
|
40
|
+
manifest: BinaryManifest;
|
|
41
|
+
/** Имя бинарника для wrapper */
|
|
42
|
+
binName: string;
|
|
43
|
+
/** Настройки npm */
|
|
44
|
+
npmConfig: BinariesNpmConfig;
|
|
45
|
+
/** Базовая директория проекта */
|
|
46
|
+
baseDir?: string;
|
|
47
|
+
/** Dry-run режим */
|
|
48
|
+
dryRun?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Результат записи npm файлов
|
|
52
|
+
*/
|
|
53
|
+
export interface WriteNpmFilesResult {
|
|
54
|
+
/** Путь к postinstall скрипту */
|
|
55
|
+
postinstallPath: string;
|
|
56
|
+
/** Путь к bin wrapper */
|
|
57
|
+
binWrapperPath: string;
|
|
58
|
+
/** Был ли обновлён package.json */
|
|
59
|
+
packageJsonUpdated: boolean;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Записывает postinstall скрипт и bin wrapper в проект
|
|
63
|
+
*
|
|
64
|
+
* @param options - Опции записи
|
|
65
|
+
* @returns Результат записи
|
|
66
|
+
*/
|
|
67
|
+
export declare function writeNpmFiles(options: WriteNpmFilesOptions): Promise<WriteNpmFilesResult>;
|
package/package.json
CHANGED
package/schema.json
CHANGED
|
@@ -54,6 +54,32 @@
|
|
|
54
54
|
"description": "Base name for binary (e.g., 'myapp' creates myapp-linux-x64.tar.gz assets)",
|
|
55
55
|
"type": "string"
|
|
56
56
|
},
|
|
57
|
+
"npm": {
|
|
58
|
+
"description": "NPM package generation settings. Generates postinstall script that downloads binary from Release assets",
|
|
59
|
+
"properties": {
|
|
60
|
+
"binDir": {
|
|
61
|
+
"default": "bin",
|
|
62
|
+
"description": "Directory for bin wrapper script",
|
|
63
|
+
"type": "string"
|
|
64
|
+
},
|
|
65
|
+
"generateScripts": {
|
|
66
|
+
"default": true,
|
|
67
|
+
"description": "Generate postinstall.js and bin wrapper scripts",
|
|
68
|
+
"type": "boolean"
|
|
69
|
+
},
|
|
70
|
+
"scriptsDir": {
|
|
71
|
+
"default": "scripts",
|
|
72
|
+
"description": "Directory for postinstall script",
|
|
73
|
+
"type": "string"
|
|
74
|
+
},
|
|
75
|
+
"updatePackageJson": {
|
|
76
|
+
"default": true,
|
|
77
|
+
"description": "Update package.json with bin and scripts.postinstall entries",
|
|
78
|
+
"type": "boolean"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"type": "object"
|
|
82
|
+
},
|
|
57
83
|
"platformMap": {
|
|
58
84
|
"additionalProperties": {
|
|
59
85
|
"enum": ["linux-x64", "linux-arm64", "darwin-x64", "darwin-arm64", "win32-x64", "win32-arm64"],
|