@todesktop/cli 1.11.3 → 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 +32 -0
- package/dist/cli.js +13 -2
- package/dist/cli.js.map +2 -2
- package/package.json +1 -1
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,10 @@ 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
|
+
|
|
1163
1195
|
### v1.11.3
|
|
1164
1196
|
|
|
1165
1197
|
- Fix: `linux.imageVersion` now supports any string, not just semver.
|
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: {
|
|
@@ -2407,7 +2414,11 @@ var getAppFiles = async (globsInput, appPath, appPkgJson) => {
|
|
|
2407
2414
|
} else {
|
|
2408
2415
|
globs.push("**");
|
|
2409
2416
|
}
|
|
2410
|
-
for (const hookName of [
|
|
2417
|
+
for (const hookName of [
|
|
2418
|
+
"todesktop:beforeInstall",
|
|
2419
|
+
"todesktop:beforeBuild",
|
|
2420
|
+
"todesktop:afterPack"
|
|
2421
|
+
]) {
|
|
2411
2422
|
if (appPkgJson.scripts && appPkgJson.scripts[hookName]) {
|
|
2412
2423
|
globs.push(path7.join(appPath, appPkgJson.scripts[hookName]));
|
|
2413
2424
|
}
|
|
@@ -5450,7 +5461,7 @@ var package_default = {
|
|
|
5450
5461
|
access: "public"
|
|
5451
5462
|
},
|
|
5452
5463
|
name: "@todesktop/cli",
|
|
5453
|
-
version: "1.11.
|
|
5464
|
+
version: "1.11.3",
|
|
5454
5465
|
license: "MIT",
|
|
5455
5466
|
author: "Dave Jeffery <dave@todesktop.com> (http://www.todesktop.com/)",
|
|
5456
5467
|
homepage: "https://todesktop.com/cli",
|