@todesktop/cli 1.1.1 → 1.1.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 CHANGED
@@ -229,6 +229,16 @@ Example: `word`.
229
229
 
230
230
  If you want to register a protocol for your application (e.g. `example://`) and or support deeplinking, you will need to use this option. If your desired protocol is `example://`, you would set `"appProtocolScheme": "example"`. NOTE: these features also require additional application logic.
231
231
 
232
+ ### `asarUnpack` - (optional) boolean or array of glob patterns
233
+
234
+ Default: [`**/*.node`]
235
+
236
+ This option allows you to decide which files get unpacked from the asar archive. By default we unpack all native `*.node` files.
237
+
238
+ If you want to unpack only files that are required to be unpacked, you can set this property to `false`.
239
+
240
+ You can also specify a list of glob patterns to unpack.
241
+
232
242
  ### `copyright` - (optional) string
233
243
 
234
244
  Default: The `package.json` [productName](#recommendations-for-app-packagejson) / `name`.
@@ -757,6 +767,55 @@ To summarize:
757
767
 
758
768
  Note: **Do not put a token in this file**. You are specifying a literal value of `${NPM_TOKEN}`. NPM will replace the value for you. 5. Add `.npmrc` to your `appFiles` array `[".npmrc"]` in `todesktop.json`.
759
769
 
770
+ ### How do I create a staging version of my app?
771
+
772
+ The easiest way to do this is to create a second app and switch the `todesktop.json` file to point to the staging app when you wish to deploy the staging app. There are a number of ways to do this. Let's do an example, save the file below as `scripts/mod-staging.js`.
773
+
774
+ ```js
775
+ const path = require("path");
776
+ const fs = require("fs");
777
+
778
+ const rootDir = path.join(__dirname, "..");
779
+ const packageJson = require(rootDir + "/package.json");
780
+ const toDesktopJson = require(rootDir + "/todesktop.json");
781
+
782
+ function modStaging() {
783
+ packageJson.name = "myapp-staging";
784
+ packageJson.productName = "My App Staging";
785
+
786
+ toDesktopJson.id = "220718gzrs4pfe8";
787
+ toDesktopJson.icon = "./resources/staging.png";
788
+ toDesktopJson.appId = "myapp.staging.app";
789
+
790
+ fs.writeFileSync(
791
+ rootDir + "/package.json",
792
+ JSON.stringify(packageJson, null, 2)
793
+ );
794
+ fs.writeFileSync(
795
+ rootDir + "/todesktop.json",
796
+ JSON.stringify(toDesktopJson, null, 2)
797
+ );
798
+ }
799
+
800
+ modStaging();
801
+ ```
802
+
803
+ Create a similar script to revert the `todesktop.json` back to the original settings (let's save it as `scripts/mod-revert.js`).
804
+ Then in your package.json, you could do something like this:
805
+
806
+ ```js
807
+ {
808
+ "name": "myapp",
809
+ // ...
810
+ "scripts": {
811
+ "todesktop-build": "todesktop build",
812
+ "todesktop-staging-build": "node scripts/mod-staging.js && todesktop build && node scripts/mod-revert.js"
813
+ },
814
+ }
815
+ ```
816
+
817
+ Now you can run `npm run todesktop-build` to build the production app. Or you can run `npm run todesktop-staging-build` to build the staging app.
818
+
760
819
  ## Changelog
761
820
 
762
821
  ### v1.1.0