@todesktop/cli 1.1.2 → 1.1.3

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
@@ -767,6 +767,55 @@ To summarize:
767
767
 
768
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`.
769
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
+
770
819
  ## Changelog
771
820
 
772
821
  ### v1.1.0
@@ -103,7 +103,7 @@ parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcel
103
103
  },{"./CancelBuild":"J4or","./CustomSelectInputIndicator":"OMIR","./CustomSelectInputItem":"oPeF","./ErrorDisplay":"f0Jz","./ViewBuild":"PlpY","../utilities/buildStatus":"in6t","../utilities/firestore":"gzUX","../utilities/projectConfig/getProjectConfig":"Sx1d","../utilities/logger":"XvyO","../utilities/useInput":"CLRu","../utilities/useExit":"QLfx"}],"AYMC":[function(require,module,exports) {
104
104
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=i(require("chalk")),t=i(require("is-installed-globally")),o=i(require("latest-version")),r=i(require("pkg-up")),s=i(require("semver"));function i(e){return e&&e.__esModule?e:{default:e}}var u=()=>{if(process.env.AVA_PATH)return;const i=require(r.default.sync({cwd:__dirname}));(0,o.default)(i.name).then(o=>{if(s.default.gt(o,i.version)){const r=e.default.greenBright(`npm install ${t.default?"-g":"--save-dev"} @todesktop/cli`);console.log(`Your version of @todesktop/cli is out of date.\nRun ${r} to update to v${o}.`),s.default.satisfies(o,`^${i.version}`)||(console.log("CLI is exiting because it is out out of date."),process.exit(1))}})};exports.default=u;
105
105
  },{}],"EHrm":[function(require,module,exports) {
106
- module.exports={private:!1,publishConfig:{access:"public"},name:"@todesktop/cli",version:"1.1.1",license:"MIT",author:"Dave Jeffery <dave@todesktop.com> (http://www.todesktop.com/)",homepage:"https://todesktop.com/cli",bugs:{email:"dave@todesktop.com"},bin:{todesktop:"./build/cli.js"},engines:{node:">=12"},scripts:{dev:"cp-cli dev.env .env && pastel dev","dev:prod":"cp-cli prod.env .env && pastel dev",build:"cross-env NODE_ENV=production pastel build && cp-cli prod.env .env && cp node_modules/pastel/boot.js build/boot.js && sed -i'.bak' 's@pastel\\/boot@.\\/boot@g' build/cli.js",lint:"eslint .","lint--fix":"eslint . --fix",release:"npm run build && npx np --tag=latest","release-beta":"npm run build && npx np --any-branch --no-tests --tag=beta",test:"npm run build && ava","test--watch":"npm test -- --watch"},files:["build","docs",".env","LICENSE","README.md"],dependencies:{"@sentry/node":"^5.27.2",ajv:"^6.12.6","analytics-node":"^4.0.1",archiver:"^5.2.0",axios:"^0.21.1","better-ajv-errors":"^1.2.0",bunyan:"^1.8.14","camelcase-keys":"^5.2.0",chalk:"^4.1.0",conf:"^7.1.2","date-fns":"^2.28.0",decamelize:"^1.2.0",del:"^6.0.0",dotenv:"^8.2.0",du:"^1.0.0","email-regex":"^4.0.0","fast-glob":"^3.2.4","final-form":"^4.20.1","find-up":"^5.0.0",firebase:"^7.24.0","git-rev-sync":"^3.0.2",ink:"^3.2.0","ink-gradient":"^2.0.0","ink-link":"^2.0.0","ink-progress-bar":"^3.0.0","ink-select-input":"^4.2.1","ink-text-input":"^4.0.1","is-installed-globally":"^0.3.2","latest-version":"^5.1.0","lodash.throttle":"^4.1.1","parse-author":"^2.0.0","pkg-up":"^3.1.0","pretty-bytes":"^5.4.1","prop-types":"^15.7.2",react:"^17.0.2","react-final-form":"^6.5.1",semver:"^7.3.2","stream-to-array":"^2.3.0",superagent:"^7.1.3",uuid:"^8.3.1","xdg-basedir":"^4.0.0",yargs:"^15.4.1"},devDependencies:{"@ava/babel":"^1.0.1","@babel/core":"^7.12.3","@babel/plugin-transform-runtime":"^7.12.1","@babel/preset-env":"^7.11.5","@babel/register":"^7.12.1","@types/bunyan":"^1.8.6",ava:"^4.3.1","babel-preset-es2015":"^6.24.1","cp-cli":"^2.0.0","cross-env":"^7.0.2",eslint:"^7.6.0","eslint-config-prettier":"^6.11.0","eslint-config-standard":"^14.1.1","eslint-plugin-import":"^2.22.1","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^3.1.4","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.21.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-standard":"^4.0.1",execa:"^4.0.3","extract-zip":"^2.0.1","fs-extra":"^9.0.1",husky:"^4.3.0","is-ci":"^2.0.0","lint-staged":"^10.2.11",pastel:"^1.1.1",prettier:"^2.1.2",proxyquire:"^2.1.3",sinon:"^9.0.3"},ava:{files:["test/**/*.js","!test/fixtures/**/*","!test/utilities/**/*"],require:["@babel/register"],timeout:"10m"},"lint-staged":{"**/*.js":["eslint . --fix","git add"]},husky:{hooks:{"pre-commit":"lint-staged"}},overrides:{pastel:{"parcel-bundler":{deasync:"0.1.24"}}},resolutions:{"pastel/parcel-bundler/deasync":"0.1.24",ink:"3.2.0",react:"17.0.2"}};
106
+ module.exports={private:!1,publishConfig:{access:"public"},name:"@todesktop/cli",version:"1.1.2",license:"MIT",author:"Dave Jeffery <dave@todesktop.com> (http://www.todesktop.com/)",homepage:"https://todesktop.com/cli",bugs:{email:"dave@todesktop.com"},bin:{todesktop:"./build/cli.js"},engines:{node:">=12"},scripts:{prepublishOnly:"npx force-resolutions",dev:"cp-cli dev.env .env && pastel dev","dev:prod":"cp-cli prod.env .env && pastel dev",build:"cross-env NODE_ENV=production pastel build && cp-cli prod.env .env && cp node_modules/pastel/boot.js build/boot.js && sed -i'.bak' 's@pastel\\/boot@.\\/boot@g' build/cli.js",lint:"eslint .","lint--fix":"eslint . --fix",release:"npm run build && npx np --tag=latest","release-beta":"npm run build && npx np --any-branch --no-tests --tag=beta",test:"npm run build && ava","test--watch":"npm test -- --watch"},files:["build","docs",".env","LICENSE","README.md"],dependencies:{"@sentry/node":"^5.27.2",ajv:"^6.12.6","analytics-node":"^4.0.1",archiver:"^5.2.0",axios:"^0.21.1","better-ajv-errors":"^1.2.0",bunyan:"^1.8.14","camelcase-keys":"^5.2.0",chalk:"^4.1.0",conf:"^7.1.2","date-fns":"^2.28.0",decamelize:"^1.2.0",del:"^6.0.0",dotenv:"^8.2.0",du:"^1.0.0","email-regex":"^4.0.0","fast-glob":"^3.2.4","final-form":"^4.20.1","find-up":"^5.0.0",firebase:"^7.24.0","git-rev-sync":"^3.0.2",ink:"^3.2.0","ink-gradient":"^2.0.0","ink-link":"^2.0.0","ink-progress-bar":"^3.0.0","ink-select-input":"^4.2.1","ink-text-input":"^4.0.1","is-ci":"^3.0.1","is-installed-globally":"^0.3.2","latest-version":"^5.1.0","lodash.throttle":"^4.1.1","parse-author":"^2.0.0","pkg-up":"^3.1.0","pretty-bytes":"^5.4.1","prop-types":"^15.7.2",react:"^17.0.2","react-final-form":"^6.5.1",semver:"^7.3.2","stream-to-array":"^2.3.0",superagent:"^7.1.3",uuid:"^8.3.1","xdg-basedir":"^4.0.0",yargs:"^15.4.1"},devDependencies:{"@ava/babel":"^1.0.1","@babel/core":"^7.12.3","@babel/plugin-transform-runtime":"^7.12.1","@babel/preset-env":"^7.11.5","@babel/register":"^7.12.1","@types/bunyan":"^1.8.6",ava:"^4.3.1","babel-preset-es2015":"^6.24.1","cp-cli":"^2.0.0","cross-env":"^7.0.2",eslint:"^7.6.0","eslint-config-prettier":"^6.11.0","eslint-config-standard":"^14.1.1","eslint-plugin-import":"^2.22.1","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^3.1.4","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.21.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-standard":"^4.0.1",execa:"^4.0.3","extract-zip":"^2.0.1","fs-extra":"^9.0.1",husky:"^4.3.0","lint-staged":"^10.2.11",pastel:"^1.1.1",prettier:"^2.1.2",proxyquire:"^2.1.3",sinon:"^9.0.3"},ava:{files:["test/**/*.js","!test/fixtures/**/*","!test/utilities/**/*"],require:["@babel/register"],timeout:"10m"},"lint-staged":{"**/*.js":["eslint . --fix","git add"]},husky:{hooks:{"pre-commit":"lint-staged"}},overrides:{pastel:{"parcel-bundler":{deasync:"0.1.27"}}},resolutions:{"pastel/parcel-bundler/deasync":"0.1.24",ink:"3.2.0",react:"17.0.2"}};
107
107
  },{}],"SYaU":[function(require,module,exports) {
108
108
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=c(require("@sentry/node")),t=u(require("os")),r=u(require("../../package.json")),n=require("../utilities/configStore"),o=u(require("../utilities/projectConfig/getProjectConfig")),a=u(require("path")),i=u(require("./getEnvironmentVariables"));function u(e){return e&&e.__esModule?e:{default:e}}function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}function c(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}var f=()=>{const{TODESKTOP_CLI_SENTRY_DSN:a}=(0,i.default)();a&&(e.init({dsn:a}),e.configureScope(e=>{try{e.setUser({email:(0,n.getAuthConfig)().email})}catch(a){}try{e.setContext("os",{name:t.default.platform(),version:t.default.release()})}catch(a){}try{e.setContext("runtime",{name:"Node.js",version:process.version})}catch(a){}try{e.setContext("app",{app_name:r.default.name,app_version:r.default.version})}catch(a){}try{const t=(0,o.default)();e.setExtra("config",t)}catch(a){}}))};exports.default=f;
109
109
  },{"../../package.json":"EHrm","../utilities/configStore":"ffKF","../utilities/projectConfig/getProjectConfig":"Sx1d","./getEnvironmentVariables":"gwcX"}],"rPNZ":[function(require,module,exports) {