@lakutata/builder 3.1.1 → 3.1.5
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/README.md +11 -1
- package/README.zh-CN.md +5 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/lib/Archive.js +3 -2
- package/dist/esm/lib/Bundle.js +12 -5
- package/dist/esm/lib/Directories.js +18 -0
- package/dist/esm/lib/Executable.js +27 -6
- package/dist/esm/lib/Files.js +44 -5
- package/dist/esm/lib/Installer.js +26 -12
- package/dist/esm/lib/Native.js +58 -4
- package/dist/esm/lib/NativeRuntime.js +2 -0
- package/dist/esm/lib/linux/Linux.js +57 -8
- package/dist/esm/lib/mac/Mac.js +39 -11
- package/dist/esm/lib/nwjs/Addons.js +307 -0
- package/dist/esm/lib/nwjs/Package.js +149 -0
- package/dist/esm/lib/nwjs/Runtime.js +214 -0
- package/dist/esm/lib/nwjs/Stage.js +92 -0
- package/dist/esm/lib/win/Windows.js +63 -41
- package/dist/types/index.d.ts +4 -0
- package/dist/types/lib/Bundle.d.ts +5 -0
- package/dist/types/lib/Directories.d.ts +8 -0
- package/dist/types/lib/Executable.d.ts +7 -0
- package/dist/types/lib/Files.d.ts +11 -1
- package/dist/types/lib/Installer.d.ts +33 -4
- package/dist/types/lib/Native.d.ts +23 -1
- package/dist/types/lib/mac/Mac.d.ts +1 -1
- package/dist/types/lib/nwjs/Addons.d.ts +51 -0
- package/dist/types/lib/nwjs/Package.d.ts +52 -0
- package/dist/types/lib/nwjs/Runtime.d.ts +116 -0
- package/dist/types/lib/nwjs/Stage.d.ts +104 -0
- package/dist/types/lib/win/Windows.d.ts +28 -0
- package/package.json +2 -2
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { type BundleResult } from '../Bundle.js';
|
|
2
|
+
import { type NwjsRelease } from './Runtime.js';
|
|
3
|
+
import { type NwjsAddons } from './Addons.js';
|
|
4
|
+
/**
|
|
5
|
+
* The NW.js of an application: the "lakutata.nwjs" of its package.json
|
|
6
|
+
*/
|
|
7
|
+
export type NwjsConfig = {
|
|
8
|
+
/**
|
|
9
|
+
* The version of NW.js: a version (0.119.2), latest, or win7 (0.72.0, the last one running on Windows 7, 8 and 8.1)
|
|
10
|
+
*/
|
|
11
|
+
version: string;
|
|
12
|
+
/**
|
|
13
|
+
* The name of the application in NW.js, which names the directory of its data: the appId of its installer, else the
|
|
14
|
+
* name of its package (in lower case)
|
|
15
|
+
*/
|
|
16
|
+
name?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The arguments given to Chromium (the "chromium-args" of the manifest of NW.js)
|
|
19
|
+
*/
|
|
20
|
+
chromiumArgs?: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* The options of {@link stageNwjsApp}
|
|
24
|
+
*/
|
|
25
|
+
export type NwjsStageOptions = {
|
|
26
|
+
/**
|
|
27
|
+
* The directory of the application (its package.json), the current one by default
|
|
28
|
+
*/
|
|
29
|
+
project?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The directory of the application of NW.js made
|
|
32
|
+
*/
|
|
33
|
+
outdir: string;
|
|
34
|
+
/**
|
|
35
|
+
* The version of NW.js, the one of lakutata.nwjs by default
|
|
36
|
+
*/
|
|
37
|
+
version?: string;
|
|
38
|
+
/**
|
|
39
|
+
* The compiled entry of the application (the "main" of the package.json by default)
|
|
40
|
+
*/
|
|
41
|
+
entry?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Minify the bundle (false by default)
|
|
44
|
+
*/
|
|
45
|
+
minify?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* The modules left out of the bundle
|
|
48
|
+
*/
|
|
49
|
+
external?: string[];
|
|
50
|
+
/**
|
|
51
|
+
* The system of the runtime (process.platform), the one of the machine by default
|
|
52
|
+
*/
|
|
53
|
+
platform?: NodeJS.Platform;
|
|
54
|
+
/**
|
|
55
|
+
* The architecture of the runtime (process.arch), the one of the machine by default (x64 on a Mac with Apple silicon
|
|
56
|
+
* for the releases without osx-arm64)
|
|
57
|
+
*/
|
|
58
|
+
arch?: string;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* The application of NW.js made by {@link stageNwjsApp}
|
|
62
|
+
*/
|
|
63
|
+
export type NwjsStage = {
|
|
64
|
+
/**
|
|
65
|
+
* Its directory: its manifest (package.json), its background script (main.js), the bundle of the application (app.cjs),
|
|
66
|
+
* its native tree (app.native) and its resources (resources)
|
|
67
|
+
*/
|
|
68
|
+
directory: string;
|
|
69
|
+
/**
|
|
70
|
+
* The release of NW.js it is made for
|
|
71
|
+
*/
|
|
72
|
+
release: NwjsRelease;
|
|
73
|
+
/**
|
|
74
|
+
* Its name in NW.js (the directory of its data)
|
|
75
|
+
*/
|
|
76
|
+
name: string;
|
|
77
|
+
/**
|
|
78
|
+
* The build of NW.js it is made for (win-x64, osx-arm64…)
|
|
79
|
+
*/
|
|
80
|
+
platform: string;
|
|
81
|
+
bundle: BundleResult;
|
|
82
|
+
/**
|
|
83
|
+
* What was done to its native addons to load them in NW.js
|
|
84
|
+
*/
|
|
85
|
+
addons: NwjsAddons;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* The NW.js of an application, from the "lakutata.nwjs" of its package.json
|
|
89
|
+
* @param manifest
|
|
90
|
+
*/
|
|
91
|
+
export declare function nwjsConfig(manifest: Record<string, any>): NwjsConfig;
|
|
92
|
+
/**
|
|
93
|
+
* Make the application of NW.js of a project: its bundle (CommonJS, for the Node.js of the release), its native tree
|
|
94
|
+
* and its resources (lakutata.resources), the manifest of NW.js (its name, its background script, the partition of the
|
|
95
|
+
* webviews holding its user interface) and the background script running the bundle
|
|
96
|
+
* @param options
|
|
97
|
+
* @example
|
|
98
|
+
* import {stageNwjsApp} from '@lakutata/builder'
|
|
99
|
+
*
|
|
100
|
+
* //The application of the development, run by: nw .nwjs/app
|
|
101
|
+
* const stage = await stageNwjsApp({outdir: '.nwjs/app'})
|
|
102
|
+
* console.log(stage.directory, stage.release.version, stage.name)
|
|
103
|
+
*/
|
|
104
|
+
export declare function stageNwjsApp(options: NwjsStageOptions): Promise<NwjsStage>;
|
|
@@ -1,10 +1,38 @@
|
|
|
1
1
|
import type { InstallerPlan } from '../Installer.js';
|
|
2
|
+
import type { InstallerHook } from '../Scripts.js';
|
|
2
3
|
/**
|
|
3
4
|
* The installers of Windows: the installer of NSIS (.exe), the package of Windows Installer (.msi), the zip archive of
|
|
4
5
|
* the directory of the executable
|
|
5
6
|
*/
|
|
6
7
|
export declare const WINDOWS_TARGETS: readonly ["nsis", "msi", "zip"];
|
|
7
8
|
export type WindowsTarget = typeof WINDOWS_TARGETS[number];
|
|
9
|
+
/**
|
|
10
|
+
* The script of NSIS of the installer: its files in Program Files, its uninstaller registered, its script run (the
|
|
11
|
+
* service of the version it replaces stopped first, its files being replaced); the scripts of the application run from
|
|
12
|
+
* its temporary directory (the preinstall one before its files are installed, the postinstall one before the service
|
|
13
|
+
* starts, the preremove one once it is stopped, the postremove one once the files are removed), the macros of the file
|
|
14
|
+
* of NSIS it includes inserted
|
|
15
|
+
* @param plan
|
|
16
|
+
* @param stage the files it installs
|
|
17
|
+
* @param file
|
|
18
|
+
* @param scripts the scripts of the application (written with the mark of UTF-8, which Windows PowerShell reads them by)
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare function nsisScript(plan: InstallerPlan, stage: string, file: string, scripts: {
|
|
22
|
+
hooks: Partial<Record<InstallerHook, string>>;
|
|
23
|
+
include?: string;
|
|
24
|
+
}): string;
|
|
25
|
+
/**
|
|
26
|
+
* The source of WiX of the package: its files (a component each, their directories), its service (WinSW) installed,
|
|
27
|
+
* started, stopped and removed by Windows Installer, its PATH, its data in ProgramData (its environment file kept by
|
|
28
|
+
* the upgrades and the removals), the versions replaced by the upgrades
|
|
29
|
+
* @param plan
|
|
30
|
+
* @param stage the files it installs
|
|
31
|
+
* @param serviceDirectory the files of its service (WinSW and its configuration)
|
|
32
|
+
* @param environment the environment file
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export declare function wixSource(plan: InstallerPlan, stage: string, serviceDirectory: string, environment: string | undefined): string;
|
|
8
36
|
/**
|
|
9
37
|
* Make the installers of Windows of an application: the installer of NSIS, the package of Windows Installer (WiX), the
|
|
10
38
|
* zip archive of the directory of the executable; its service run by WinSW
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lakutata/builder",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
4
4
|
"description": "The builder of the applications of the lakutata framework: their bundles, their executables (Node.js, Bun) with their native addons and their resources.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lakutata",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
"engines": {
|
|
63
|
-
"node": "
|
|
63
|
+
"node": ">=18.10.0"
|
|
64
64
|
},
|
|
65
65
|
"license": "MIT",
|
|
66
66
|
"files": [
|