@todesktop/cli 1.11.2 → 1.11.4
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 +36 -0
- package/dist/cli.js +14 -4
- package/dist/cli.js.map +2 -2
- package/package.json +1 -1
- package/schemas/schema.json +1 -2
package/README.md
CHANGED
|
@@ -954,6 +954,7 @@ To specify a script, add a `scripts` property to your `package.json` file. The k
|
|
|
954
954
|
{
|
|
955
955
|
"scripts": {
|
|
956
956
|
"todesktop:beforeInstall": "./scripts/beforeInstall.js",
|
|
957
|
+
"todesktop:beforeBuild": "./scripts/beforeBuild.js",
|
|
957
958
|
"todesktop:afterPack": "./scripts/afterPack.js"
|
|
958
959
|
}
|
|
959
960
|
}
|
|
@@ -972,6 +973,33 @@ module.exports = async ({ pkgJsonPath, pkgJson, appDir, hookName }) => {
|
|
|
972
973
|
};
|
|
973
974
|
```
|
|
974
975
|
|
|
976
|
+
### `todesktop:beforeBuild` - (optional) path to script
|
|
977
|
+
|
|
978
|
+
Example: `./scripts/beforeBuild.js`.
|
|
979
|
+
|
|
980
|
+
The path to a script that will run before dependencies are rebuilt for target architectures.
|
|
981
|
+
|
|
982
|
+
Example script:
|
|
983
|
+
|
|
984
|
+
```js
|
|
985
|
+
// Set environment variable depending on the architecture
|
|
986
|
+
module.exports = async ({
|
|
987
|
+
pkgJsonPath,
|
|
988
|
+
pkgJson,
|
|
989
|
+
appDir,
|
|
990
|
+
electronVersion,
|
|
991
|
+
platform,
|
|
992
|
+
arch,
|
|
993
|
+
hookName,
|
|
994
|
+
}) => {
|
|
995
|
+
if (arch === "arm64") {
|
|
996
|
+
process.env.VARIABLE = "value";
|
|
997
|
+
} else {
|
|
998
|
+
process.env.VARIABLE = "alternative-value";
|
|
999
|
+
}
|
|
1000
|
+
};
|
|
1001
|
+
```
|
|
1002
|
+
|
|
975
1003
|
### `todesktop:beforeInstall` - (optional) path to script
|
|
976
1004
|
|
|
977
1005
|
Example: `./scripts/beforeInstall.js`.
|
|
@@ -1160,6 +1188,14 @@ Now, when we build your app on ToDesktop servers, it will also run your custom `
|
|
|
1160
1188
|
|
|
1161
1189
|
## Changelog
|
|
1162
1190
|
|
|
1191
|
+
### v1.11.4
|
|
1192
|
+
|
|
1193
|
+
- Add support for `beforeBuild` hook.
|
|
1194
|
+
|
|
1195
|
+
### v1.11.3
|
|
1196
|
+
|
|
1197
|
+
- Fix: `linux.imageVersion` now supports any string, not just semver.
|
|
1198
|
+
|
|
1163
1199
|
### v1.11.2
|
|
1164
1200
|
|
|
1165
1201
|
- Stop erroring in cases where `appId` is not defined in an extended `todesktop.json`.
|
package/dist/cli.js
CHANGED
|
@@ -1140,6 +1140,13 @@ var packageJSON_default = (context) => {
|
|
|
1140
1140
|
mustBeFile: true
|
|
1141
1141
|
}
|
|
1142
1142
|
},
|
|
1143
|
+
"todesktop:beforeBuild": {
|
|
1144
|
+
type: "string",
|
|
1145
|
+
file: {
|
|
1146
|
+
from: context.projectRoot,
|
|
1147
|
+
mustBeFile: true
|
|
1148
|
+
}
|
|
1149
|
+
},
|
|
1143
1150
|
"todesktop:afterPack": {
|
|
1144
1151
|
type: "string",
|
|
1145
1152
|
file: {
|
|
@@ -1661,8 +1668,7 @@ var schema_default = {
|
|
|
1661
1668
|
},
|
|
1662
1669
|
imageVersion: {
|
|
1663
1670
|
type: "string",
|
|
1664
|
-
minLength: 1
|
|
1665
|
-
validSemver: {}
|
|
1671
|
+
minLength: 1
|
|
1666
1672
|
},
|
|
1667
1673
|
noSandbox: {
|
|
1668
1674
|
type: "boolean"
|
|
@@ -2408,7 +2414,11 @@ var getAppFiles = async (globsInput, appPath, appPkgJson) => {
|
|
|
2408
2414
|
} else {
|
|
2409
2415
|
globs.push("**");
|
|
2410
2416
|
}
|
|
2411
|
-
for (const hookName of [
|
|
2417
|
+
for (const hookName of [
|
|
2418
|
+
"todesktop:beforeInstall",
|
|
2419
|
+
"todesktop:beforeBuild",
|
|
2420
|
+
"todesktop:afterPack"
|
|
2421
|
+
]) {
|
|
2412
2422
|
if (appPkgJson.scripts && appPkgJson.scripts[hookName]) {
|
|
2413
2423
|
globs.push(path7.join(appPath, appPkgJson.scripts[hookName]));
|
|
2414
2424
|
}
|
|
@@ -5451,7 +5461,7 @@ var package_default = {
|
|
|
5451
5461
|
access: "public"
|
|
5452
5462
|
},
|
|
5453
5463
|
name: "@todesktop/cli",
|
|
5454
|
-
version: "1.11.
|
|
5464
|
+
version: "1.11.3",
|
|
5455
5465
|
license: "MIT",
|
|
5456
5466
|
author: "Dave Jeffery <dave@todesktop.com> (http://www.todesktop.com/)",
|
|
5457
5467
|
homepage: "https://todesktop.com/cli",
|