Create your application with openpgp and our webpack config.
$ npm i -D github:ProtonMail/proton-pack.git#semver:^1.0.0$ npx proton-pack initIf you want to use our boilerplate$ npm start🍿 App available on :8080
As for the WebClient you need to have appConfig.json (previously env.json)
A new key exists inside this file now, to add more config
-
$ proton-pack help -
$ proton-pack init <type> -
type: default (default) basic app
-
type: auth basic app with login + private routes
Create a basic app from our boilerplate with openpgp
$ proton-pack extract-i18n
Extract translations for the app
$ proton-pack compile$ proton-pack dev-server
Run a dev server available on
8080by default. You can customize the port viaNODE_ENV_PORT
You can also pass custom flags:
-
--port=<Number>: to use a custom port -
--publicPath=/settings/: to serve the app on /settings/ -
--api=<key>|<url>: key one of the ones from the appConfig (ex: .dev.api -> key= dev) or URL ex: https://mail.protonmail.com/api -
$ proton-pack compile
Build your app
$ proton-pack print-config
Print as JSON the current config
Create a file proton.config.js at the root of your app.
- It takes and object as argument
webpackConfig - It must return the config
It's a standard webpack config, nothing custom. It contains our config.
Ex: to have a verbose dev server
module.exports = (webpackConfig) => {
webpackConfig.devServer.stats = 'normal';
return webpackConfig;
}
{ "appConfig": { "clientId": "WebMail", // use to identify the application by the API "appName": "protonmail", // use to identify the application by the proton react components "urlI18n": "", // [mandatory if not protonmail] Url for i18n, ex: settings for protonmail-settings "clientType": "", // Custom client type "version": "", // Custom version } }