@lakutata/builder 3.1.3 → 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.
@@ -0,0 +1,116 @@
1
+ /**
2
+ * A release of NW.js: its version and the ones of the Node.js and the Chromium it embeds, the systems it is built for
3
+ */
4
+ export type NwjsRelease = {
5
+ /**
6
+ * The version of NW.js (0.119.2)
7
+ */
8
+ version: string;
9
+ /**
10
+ * The day it was released (2026/10/22)
11
+ */
12
+ date: string;
13
+ /**
14
+ * The version of the Node.js it embeds (26.12.1)
15
+ */
16
+ node: string;
17
+ /**
18
+ * The version of the Chromium it embeds (156.0.8078.48)
19
+ */
20
+ chromium: string;
21
+ /**
22
+ * The systems it is built for: win-x64, win-ia32, win-arm64, osx-x64, osx-arm64, linux-x64, linux-ia32, linux-arm64
23
+ */
24
+ platforms: string[];
25
+ };
26
+ /**
27
+ * The flavors of NW.js: normal (the one shipped), sdk (with the developer tools, for the development)
28
+ */
29
+ export type NwjsFlavor = 'normal' | 'sdk';
30
+ /**
31
+ * The options of {@link downloadNwjs}
32
+ */
33
+ export type NwjsRuntimeOptions = {
34
+ /**
35
+ * The version of NW.js: a version (0.72.0), latest (the latest release) or win7 (0.72.0, the last one running on
36
+ * Windows 7, 8 and 8.1)
37
+ */
38
+ version: string;
39
+ /**
40
+ * normal (by default) or sdk
41
+ */
42
+ flavor?: NwjsFlavor;
43
+ /**
44
+ * The system (process.platform: win32, darwin, linux), the one of the machine by default
45
+ */
46
+ platform?: NodeJS.Platform;
47
+ /**
48
+ * The architecture (process.arch: x64, ia32, arm64), the one of the machine by default. On a Mac with Apple silicon,
49
+ * a release without osx-arm64 (before 0.77) is the x64 one, run by Rosetta
50
+ */
51
+ arch?: string;
52
+ };
53
+ /**
54
+ * A runtime of NW.js, downloaded into the cache
55
+ */
56
+ export type NwjsRuntime = NwjsRelease & {
57
+ flavor: NwjsFlavor;
58
+ /**
59
+ * Its system and its architecture as NW.js names them (osx-arm64)
60
+ */
61
+ platform: string;
62
+ /**
63
+ * The directory of the runtime: nw.exe and its libraries, nwjs.app, nw and its libraries
64
+ */
65
+ directory: string;
66
+ /**
67
+ * Its executable: nw.exe, nwjs.app/Contents/MacOS/nwjs, nw
68
+ */
69
+ executable: string;
70
+ };
71
+ /**
72
+ * Compare two versions (1.2.3)
73
+ * @param left
74
+ * @param right
75
+ */
76
+ export declare function compareVersions(left: string, right: string): number;
77
+ /**
78
+ * The releases of NW.js, newest first: the list of nwjs.io (LAKUTATA_NWJS_VERSIONS), kept a day in the cache; the
79
+ * cached one when it cannot be read
80
+ * @example
81
+ * import {nwjsReleases} from '@lakutata/builder'
82
+ *
83
+ * for (const release of (await nwjsReleases()).slice(0, 3)) console.log(release.version, release.node, release.chromium)
84
+ */
85
+ export declare function nwjsReleases(): Promise<NwjsRelease[]>;
86
+ /**
87
+ * A release of NW.js: a version, latest (the latest release) or win7 (0.72.0, the last one running on Windows 7, 8
88
+ * and 8.1). Refused when it embeds a Node.js older than the one lakutata runs on (18.10)
89
+ * @param version
90
+ * @example
91
+ * import {nwjsRelease} from '@lakutata/builder'
92
+ *
93
+ * const release = await nwjsRelease('win7')
94
+ * console.log(release.version, release.node, release.chromium) //0.72.0 19.3.0 109.0.5414.87
95
+ */
96
+ export declare function nwjsRelease(version: string): Promise<NwjsRelease>;
97
+ /**
98
+ * The system and the architecture of a release as NW.js names them (osx-arm64), the x64 build on a Mac with Apple
99
+ * silicon when the release has no arm64 one
100
+ * @param release
101
+ * @param platform
102
+ * @param arch
103
+ */
104
+ export declare function nwjsPlatform(release: NwjsRelease, platform?: NodeJS.Platform, arch?: string): string;
105
+ /**
106
+ * A runtime of NW.js for a system, downloaded once into the cache (~/.cache/lakutata/nwjs, LAKUTATA_CACHE_DIR) from
107
+ * dl.nwjs.io (LAKUTATA_NWJS_MIRROR: a mirror of it) and checked with the SHASUMS256.txt of its release
108
+ * @param options
109
+ * @example
110
+ * import {downloadNwjs} from '@lakutata/builder'
111
+ *
112
+ * //The NW.js of the development (its developer tools), for the machine
113
+ * const runtime = await downloadNwjs({version: 'latest', flavor: 'sdk'})
114
+ * console.log(runtime.executable, runtime.node)
115
+ */
116
+ export declare function downloadNwjs(options: NwjsRuntimeOptions): Promise<NwjsRuntime>;
@@ -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",
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": "^22.13.0 || >=24.11.0"
63
+ "node": ">=18.10.0"
64
64
  },
65
65
  "license": "MIT",
66
66
  "files": [