@todesktop/cli 1.19.1 → 1.20.0-1
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 +65 -4
- package/dist/cli.js +66 -11
- package/dist/cli.js.map +2 -2
- package/dist/types.d.ts +47 -2
- package/package.json +6 -4
- package/schemas/schema.json +53 -3
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ Create a `todesktop.json` file in the root of your Electron project.
|
|
|
48
48
|
|
|
49
49
|
```json
|
|
50
50
|
{
|
|
51
|
-
"$schema": "https://unpkg.com/@todesktop/cli@1.
|
|
51
|
+
"$schema": "https://unpkg.com/@todesktop/cli@1.20.0-1/schemas/schema.json",
|
|
52
52
|
"schemaVersion": 1
|
|
53
53
|
"id": "your-todesktop-id",
|
|
54
54
|
"icon": "./desktop-icon.png",
|
|
@@ -413,7 +413,7 @@ To enable JSON validation and IntelliSense for your `todesktop.json` file in com
|
|
|
413
413
|
- For example, if using a hosted version of the schema:
|
|
414
414
|
```json
|
|
415
415
|
{
|
|
416
|
-
"$schema": "https://unpkg.com/@todesktop/cli@1.
|
|
416
|
+
"$schema": "https://unpkg.com/@todesktop/cli@1.20.0-1/schemas/schema.json",
|
|
417
417
|
"id": "your-todesktop-id"
|
|
418
418
|
}
|
|
419
419
|
```
|
|
@@ -535,6 +535,60 @@ Example:
|
|
|
535
535
|
}
|
|
536
536
|
```
|
|
537
537
|
|
|
538
|
+
### `fuses` - (optional) object
|
|
539
|
+
|
|
540
|
+
Configure Electron Fuses to enable or disable certain Electron features at package time. Fuses are compile-time feature flags that cannot be changed at runtime, providing security benefits. See https://www.electronjs.org/docs/latest/tutorial/fuses for more information.
|
|
541
|
+
|
|
542
|
+
Fuses allow you to harden your Electron application by disabling features that
|
|
543
|
+
your app doesn't need. Once a fuse is flipped at build time, it cannot be
|
|
544
|
+
changed at runtime.
|
|
545
|
+
|
|
546
|
+
Example:
|
|
547
|
+
|
|
548
|
+
```json
|
|
549
|
+
{
|
|
550
|
+
"fuses": {
|
|
551
|
+
"runAsNode": false,
|
|
552
|
+
"enableNodeOptionsEnvironmentVariable": false,
|
|
553
|
+
"enableNodeCliInspectArguments": false,
|
|
554
|
+
"enableCookieEncryption": true,
|
|
555
|
+
"onlyLoadAppFromAsar": true
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
#### `fuses.runAsNode` - (optional) boolean
|
|
561
|
+
|
|
562
|
+
Controls whether the ELECTRON_RUN_AS_NODE environment variable is respected. When disabled, the env variable will be ignored. Default: true (enabled).
|
|
563
|
+
|
|
564
|
+
#### `fuses.enableCookieEncryption` - (optional) boolean
|
|
565
|
+
|
|
566
|
+
Controls whether the cookie store on disk is encrypted using OS-level cryptography. Default: false (disabled).
|
|
567
|
+
|
|
568
|
+
#### `fuses.enableNodeOptionsEnvironmentVariable` - (optional) boolean
|
|
569
|
+
|
|
570
|
+
Controls whether the NODE_OPTIONS environment variable is respected. When disabled, the env variable will be ignored. Default: true (enabled).
|
|
571
|
+
|
|
572
|
+
#### `fuses.enableNodeCliInspectArguments` - (optional) boolean
|
|
573
|
+
|
|
574
|
+
Controls whether command line arguments like --inspect are respected. When disabled, these arguments will be ignored. Default: true (enabled).
|
|
575
|
+
|
|
576
|
+
#### `fuses.enableEmbeddedAsarIntegrityValidation` - (optional) boolean
|
|
577
|
+
|
|
578
|
+
Controls whether Electron validates the integrity of the app.asar file. Requires the integrity block in the asar header. Default: false (disabled).
|
|
579
|
+
|
|
580
|
+
#### `fuses.onlyLoadAppFromAsar` - (optional) boolean
|
|
581
|
+
|
|
582
|
+
Controls whether Electron only loads the app from an asar archive. When enabled, Electron will not search for loose files. Default: false (disabled).
|
|
583
|
+
|
|
584
|
+
#### `fuses.loadBrowserProcessSpecificV8Snapshot` - (optional) boolean
|
|
585
|
+
|
|
586
|
+
Controls whether the browser process uses a V8 snapshot file located at browser_v8_context_snapshot.bin. Default: false (disabled).
|
|
587
|
+
|
|
588
|
+
#### `fuses.grantFileProtocolExtraPrivileges` - (optional) boolean
|
|
589
|
+
|
|
590
|
+
Controls whether pages loaded via file:// protocol get extra privileges. When disabled, file:// pages are more restricted. Requires Electron 29+. Default: true (enabled).
|
|
591
|
+
|
|
538
592
|
### `appProtocolScheme` - (optional) string | string[]
|
|
539
593
|
|
|
540
594
|
Default: no protocol scheme is registered
|
|
@@ -1039,11 +1093,11 @@ effective `package.json` that ToDesktop will use.
|
|
|
1039
1093
|
|
|
1040
1094
|
### `packageManager` - (optional) string
|
|
1041
1095
|
|
|
1042
|
-
Default: If `yarn.lock` exists, `yarn` is used. If `pnpm-lock.yaml` or `shrinkwrap.yaml` exists, `pnpm` is used. Otherwise, `npm` is used.
|
|
1096
|
+
Default: If `bun.lockb` or `bun.lock` exists, `bun` is used. If `yarn.lock` exists, `yarn` is used. If `pnpm-lock.yaml` or `shrinkwrap.yaml` exists, `pnpm` is used. Otherwise, `npm` is used.
|
|
1043
1097
|
|
|
1044
1098
|
Example: `yarn`
|
|
1045
1099
|
|
|
1046
|
-
The package manager to use when installing dependencies. Valid values are `npm`, `yarn` or `
|
|
1100
|
+
The package manager to use when installing dependencies. Valid values are `npm`, `yarn`, `pnpm` or `bun`.
|
|
1047
1101
|
|
|
1048
1102
|
### `pnpmVersion` - string
|
|
1049
1103
|
|
|
@@ -1625,6 +1679,13 @@ Now, when we build your app on ToDesktop servers, it will also run your custom
|
|
|
1625
1679
|
|
|
1626
1680
|
## Changelog
|
|
1627
1681
|
|
|
1682
|
+
### 1.20.0
|
|
1683
|
+
|
|
1684
|
+
#### Minor Changes
|
|
1685
|
+
|
|
1686
|
+
- 3ae0eaf: Add support for Electron Fuses configuration
|
|
1687
|
+
- 6e11f24: Add Bun package manager support
|
|
1688
|
+
|
|
1628
1689
|
### 1.19.0
|
|
1629
1690
|
|
|
1630
1691
|
#### Minor Changes
|
package/dist/cli.js
CHANGED
|
@@ -409,6 +409,7 @@ var PlatformName;
|
|
|
409
409
|
})(PlatformName || (PlatformName = {}));
|
|
410
410
|
var PackageManager;
|
|
411
411
|
(function(PackageManager2) {
|
|
412
|
+
PackageManager2["bun"] = "bun";
|
|
412
413
|
PackageManager2["npm"] = "npm";
|
|
413
414
|
PackageManager2["pnpm"] = "pnpm";
|
|
414
415
|
PackageManager2["yarn"] = "yarn";
|
|
@@ -2476,6 +2477,7 @@ var schema_default = {
|
|
|
2476
2477
|
}
|
|
2477
2478
|
},
|
|
2478
2479
|
bytenode: { $ref: "#/definitions/bytenodeConfigProperty" },
|
|
2480
|
+
fuses: { $ref: "#/definitions/fusesConfigProperty" },
|
|
2479
2481
|
asar: { $ref: "#/definitions/asarProperty" },
|
|
2480
2482
|
asarUnpack: { $ref: "#/definitions/asarUnpackProperty" },
|
|
2481
2483
|
buildVersion: { $ref: "#/definitions/buildVersionProperty" },
|
|
@@ -2522,6 +2524,7 @@ var schema_default = {
|
|
|
2522
2524
|
nodeVersion: { $ref: "#/definitions/nodeVersionProperty" },
|
|
2523
2525
|
npmVersion: { $ref: "#/definitions/npmVersionProperty" },
|
|
2524
2526
|
pnpmVersion: { $ref: "#/definitions/pnpmVersionProperty" },
|
|
2527
|
+
bunVersion: { $ref: "#/definitions/bunVersionProperty" },
|
|
2525
2528
|
packageJson: { $ref: "#/definitions/packageJsonProperty" },
|
|
2526
2529
|
packageManager: { $ref: "#/definitions/packageManagerProperty" },
|
|
2527
2530
|
rebuildLibrary: { $ref: "#/definitions/rebuildLibraryProperty" },
|
|
@@ -2596,6 +2599,45 @@ var schema_default = {
|
|
|
2596
2599
|
}
|
|
2597
2600
|
]
|
|
2598
2601
|
},
|
|
2602
|
+
fusesConfigProperty: {
|
|
2603
|
+
type: "object",
|
|
2604
|
+
additionalProperties: false,
|
|
2605
|
+
description: "Configure Electron Fuses to enable or disable certain Electron features at package time. Fuses are compile-time feature flags that cannot be changed at runtime, providing security benefits. See https://www.electronjs.org/docs/latest/tutorial/fuses for more information.",
|
|
2606
|
+
properties: {
|
|
2607
|
+
runAsNode: {
|
|
2608
|
+
type: "boolean",
|
|
2609
|
+
description: "Controls whether the ELECTRON_RUN_AS_NODE environment variable is respected. When disabled, the env variable will be ignored. Default: true (enabled)."
|
|
2610
|
+
},
|
|
2611
|
+
enableCookieEncryption: {
|
|
2612
|
+
type: "boolean",
|
|
2613
|
+
description: "Controls whether the cookie store on disk is encrypted using OS-level cryptography. Default: false (disabled)."
|
|
2614
|
+
},
|
|
2615
|
+
enableNodeOptionsEnvironmentVariable: {
|
|
2616
|
+
type: "boolean",
|
|
2617
|
+
description: "Controls whether the NODE_OPTIONS environment variable is respected. When disabled, the env variable will be ignored. Default: true (enabled)."
|
|
2618
|
+
},
|
|
2619
|
+
enableNodeCliInspectArguments: {
|
|
2620
|
+
type: "boolean",
|
|
2621
|
+
description: "Controls whether command line arguments like --inspect are respected. When disabled, these arguments will be ignored. Default: true (enabled)."
|
|
2622
|
+
},
|
|
2623
|
+
enableEmbeddedAsarIntegrityValidation: {
|
|
2624
|
+
type: "boolean",
|
|
2625
|
+
description: "Controls whether Electron validates the integrity of the app.asar file. Requires the integrity block in the asar header. Default: false (disabled)."
|
|
2626
|
+
},
|
|
2627
|
+
onlyLoadAppFromAsar: {
|
|
2628
|
+
type: "boolean",
|
|
2629
|
+
description: "Controls whether Electron only loads the app from an asar archive. When enabled, Electron will not search for loose files. Default: false (disabled)."
|
|
2630
|
+
},
|
|
2631
|
+
loadBrowserProcessSpecificV8Snapshot: {
|
|
2632
|
+
type: "boolean",
|
|
2633
|
+
description: "Controls whether the browser process uses a V8 snapshot file located at browser_v8_context_snapshot.bin. Default: false (disabled)."
|
|
2634
|
+
},
|
|
2635
|
+
grantFileProtocolExtraPrivileges: {
|
|
2636
|
+
type: "boolean",
|
|
2637
|
+
description: "Controls whether pages loaded via file:// protocol get extra privileges. When disabled, file:// pages are more restricted. Requires Electron 29+. Default: true (enabled)."
|
|
2638
|
+
}
|
|
2639
|
+
}
|
|
2640
|
+
},
|
|
2599
2641
|
appFilesProperty: {
|
|
2600
2642
|
type: "array",
|
|
2601
2643
|
description: "This option allows you to decide which files get uploaded to be built on the ToDesktop servers. By default, all files in your app path are included in your app, except for `node_modules` and `.git`. Dependencies are installed on our build servers as there could be platform-specific postinstall steps.",
|
|
@@ -3089,6 +3131,13 @@ var schema_default = {
|
|
|
3089
3131
|
description: "The version of pnpm that ToDesktop should use for installation.",
|
|
3090
3132
|
examples: ["8.10.5"]
|
|
3091
3133
|
},
|
|
3134
|
+
bunVersionProperty: {
|
|
3135
|
+
type: "string",
|
|
3136
|
+
validSemver: {},
|
|
3137
|
+
minLength: 1,
|
|
3138
|
+
description: "The version of Bun that ToDesktop should use for installation.",
|
|
3139
|
+
examples: ["1.3.6"]
|
|
3140
|
+
},
|
|
3092
3141
|
packageJsonProperty: {
|
|
3093
3142
|
type: "object",
|
|
3094
3143
|
description: "If you want to override the default `package.json` configuration, use the `packageJson` property. For example, you can use this to override the `productName` or `version` properties.",
|
|
@@ -3096,10 +3145,10 @@ var schema_default = {
|
|
|
3096
3145
|
},
|
|
3097
3146
|
packageManagerProperty: {
|
|
3098
3147
|
type: "string",
|
|
3099
|
-
enum: ["npm", "yarn", "pnpm"],
|
|
3100
|
-
description: "The package manager to use when installing dependencies. Valid values are `npm`, `yarn` or `
|
|
3148
|
+
enum: ["npm", "yarn", "pnpm", "bun"],
|
|
3149
|
+
description: "The package manager to use when installing dependencies. Valid values are `npm`, `yarn`, `pnpm` or `bun`.",
|
|
3101
3150
|
examples: ["yarn"],
|
|
3102
|
-
default: "If `yarn.lock` exists, `yarn` is used. If `pnpm-lock.yaml` or `shrinkwrap.yaml` exists, `pnpm` is used. Otherwise, `npm` is used."
|
|
3151
|
+
default: "If `bun.lockb` or `bun.lock` exists, `bun` is used. If `yarn.lock` exists, `yarn` is used. If `pnpm-lock.yaml` or `shrinkwrap.yaml` exists, `pnpm` is used. Otherwise, `npm` is used."
|
|
3103
3152
|
},
|
|
3104
3153
|
rebuildLibraryProperty: {
|
|
3105
3154
|
type: "string",
|
|
@@ -3351,6 +3400,7 @@ var schema_default = {
|
|
|
3351
3400
|
},
|
|
3352
3401
|
appPath: { $ref: "#/definitions/appPathProperty" },
|
|
3353
3402
|
bytenode: { $ref: "#/definitions/bytenodeConfigProperty" },
|
|
3403
|
+
fuses: { $ref: "#/definitions/fusesConfigProperty" },
|
|
3354
3404
|
asar: { $ref: "#/definitions/asarProperty" },
|
|
3355
3405
|
asarUnpack: { $ref: "#/definitions/asarUnpackProperty" },
|
|
3356
3406
|
buildVersion: { $ref: "#/definitions/buildVersionProperty" },
|
|
@@ -3378,6 +3428,7 @@ var schema_default = {
|
|
|
3378
3428
|
nodeVersion: { $ref: "#/definitions/nodeVersionProperty" },
|
|
3379
3429
|
npmVersion: { $ref: "#/definitions/npmVersionProperty" },
|
|
3380
3430
|
pnpmVersion: { $ref: "#/definitions/pnpmVersionProperty" },
|
|
3431
|
+
bunVersion: { $ref: "#/definitions/bunVersionProperty" },
|
|
3381
3432
|
packageJson: { $ref: "#/definitions/packageJsonProperty" },
|
|
3382
3433
|
packageManager: { $ref: "#/definitions/packageManagerProperty" },
|
|
3383
3434
|
rebuildLibrary: { $ref: "#/definitions/rebuildLibraryProperty" },
|
|
@@ -4417,7 +4468,9 @@ var getAppFiles = async (globsInput, appPath, appPkgJson) => {
|
|
|
4417
4468
|
path8.join(appPath, "package-lock.json"),
|
|
4418
4469
|
path8.join(appPath, "yarn.lock"),
|
|
4419
4470
|
path8.join(appPath, "pnpm-lock.yaml"),
|
|
4420
|
-
path8.join(appPath, "shrinkwrap.yaml")
|
|
4471
|
+
path8.join(appPath, "shrinkwrap.yaml"),
|
|
4472
|
+
path8.join(appPath, "bun.lockb"),
|
|
4473
|
+
path8.join(appPath, "bun.lock")
|
|
4421
4474
|
);
|
|
4422
4475
|
} else {
|
|
4423
4476
|
globs.push("**");
|
|
@@ -7522,7 +7575,8 @@ async function getBuildAttributes({
|
|
|
7522
7575
|
id: appId,
|
|
7523
7576
|
nodeVersion,
|
|
7524
7577
|
npmVersion,
|
|
7525
|
-
pnpmVersion
|
|
7578
|
+
pnpmVersion,
|
|
7579
|
+
bunVersion
|
|
7526
7580
|
} = getProjectConfig(configPath).config;
|
|
7527
7581
|
const { id: userId } = await findAppUserId_default(appId);
|
|
7528
7582
|
const contextUserId = (_a2 = currentUser()) == null ? void 0 : _a2.uid;
|
|
@@ -7535,6 +7589,7 @@ async function getBuildAttributes({
|
|
|
7535
7589
|
nodeVersion,
|
|
7536
7590
|
npmVersion,
|
|
7537
7591
|
pnpmVersion,
|
|
7592
|
+
bunVersion,
|
|
7538
7593
|
userId
|
|
7539
7594
|
};
|
|
7540
7595
|
}
|
|
@@ -8633,7 +8688,7 @@ var package_default = {
|
|
|
8633
8688
|
access: "public"
|
|
8634
8689
|
},
|
|
8635
8690
|
name: "@todesktop/cli",
|
|
8636
|
-
version: "1.
|
|
8691
|
+
version: "1.20.0-1",
|
|
8637
8692
|
license: "MIT",
|
|
8638
8693
|
author: "Dave Jeffery <dave@todesktop.com> (http://www.todesktop.com/)",
|
|
8639
8694
|
homepage: "https://todesktop.com/cli",
|
|
@@ -8648,7 +8703,7 @@ var package_default = {
|
|
|
8648
8703
|
node: ">=16"
|
|
8649
8704
|
},
|
|
8650
8705
|
scripts: {
|
|
8651
|
-
build: "node scripts/esbuild.js",
|
|
8706
|
+
build: "npm run docs:generate && npm run types:generate && node scripts/esbuild.js",
|
|
8652
8707
|
dev: "node scripts/esbuild.js --link --watch --stage dev",
|
|
8653
8708
|
"dev:local:prod": "node scripts/esbuild.js --link --watch --stage prod-local",
|
|
8654
8709
|
"dev:prod": "node scripts/esbuild.js --link --watch",
|
|
@@ -8656,18 +8711,18 @@ var package_default = {
|
|
|
8656
8711
|
format: "prettier . --write && eslint --fix",
|
|
8657
8712
|
lint: "prettier . --check && eslint",
|
|
8658
8713
|
"types:generate": "node scripts/generate-types.js",
|
|
8659
|
-
release: "npm run docs:generate && npm run build && pnpx np --tag=latest",
|
|
8660
|
-
"release-beta": "npm run docs:generate && npm run build && npx np --any-branch --no-tests --tag=beta",
|
|
8661
8714
|
test: "ava",
|
|
8662
8715
|
"test:e2e": "node test/output-snapshots/output.test.js",
|
|
8663
8716
|
"test--watch": "npm test -- --watch",
|
|
8664
|
-
typecheck: "tsc --noEmit && tsc-strict"
|
|
8717
|
+
typecheck: "tsc --noEmit && tsc-strict",
|
|
8718
|
+
prepublishOnly: "npm run docs:generate"
|
|
8665
8719
|
},
|
|
8666
8720
|
files: [
|
|
8667
8721
|
"scripts/postinstall.js",
|
|
8668
8722
|
"schemas",
|
|
8669
8723
|
"dist",
|
|
8670
|
-
".env"
|
|
8724
|
+
".env",
|
|
8725
|
+
"README.md"
|
|
8671
8726
|
],
|
|
8672
8727
|
dependencies: {
|
|
8673
8728
|
"@segment/analytics-node": "^2.3.0",
|