Capgo CLI
A CLI to upload and download files from the Capacitor go Cloud.
Install
npm i -g capgo
Usage
Before use the CLI you should register here : https://capgo.app/
Then go in you account in apikey section and click in the read/write key to copy it.
Add new app to Cloud
capgo add [appId] --apikey=********
[appId]
your app ID the format com.test.app
is explained here
Optionally you can give:
- icon with
--icon /path/to/my/icon
to have a custom icon in the list - name with
--name test
to have a custom name in the list
Send version to Cloud
capgo upload [appId] --apikey=********
[appId]
is your app ID the format is explained here
Optionally you can give:
- icon with
--path /path/to/my/dist/folder
to send your code to the cloud - name with
--name test
to have a custom name in the list - channel with
--channel prod
to link this version to channel
Send version to Cloud channel
capgo set [appId] [version] [channel] --apikey=********
[appId]
your app ID the format is explained here
[version]
your app version already sended to the cloud
[channel]
the channel you want to link the version
Delete package to Cloud
capgo delete [appId] --apikey=********
[appId]
your app ID present in the Cloud
Dev contribution
-
Install development dependencies
rm -rf node_modules npm i
-
Set
"sourceMap": true,
in tsconfig.json -
Run webpack development server
npm run dev
-
Attach debugger to the process started with
npm run dev
VScode:
- Run
Debug on fixtures
launch configuration - Edit configuration to debug on different files
Other IDEs:
- Attach debugger of your choice to the running process, use .vscode/launch.json
Debug on fixtures
configuration as the example
- Run
Production build
-
Set
"sourceMap": false,
in tsconfig.jsonTODO: add separate build config
-
Run
npm install && set NODE_ENV=production&& npx webpack --config webpack.config.js && rm -rf node_modules && npm i --only=prod && npm prune --production && npm shrinkwrap
Publish to NPM
To release a new package version:
-
Bump version in
package.json
manually -
Run commands from Production build section
-
Run
npm publish --dry-run
:-
ensure that only necessary files are listed in package preview
-
ensure that
npm-shrinkwrap.json
does not include development dependencies
-
-
Run
npm publish
ornpm publish --tag beta
Pack executable
prerequisite: perform production build
Pkg will not resolve dynamic module imports, so avoid these at all costs. (Basically, just use plain ordinary static
import Something from 'somewhere'
and no issue should arise)
Build for all supported platforms
pkg ./dist/index.js
You can specify targets with
-t
option (refer topkg --help
and examples on pkg's npm) e.g. usepkg -t node14-win-x64 ./dist/index.js
to build for Node14, Windows x64
Build for Node14 Windows x64
pkg -t node14-win-x64 ./dist/index.js