A CLI to upload and download files from the Capgo Cloud.
Before use the CLI you should register here : https://capgo.app/
Then go to your account in apikey
section and click in the all
key to copy it.
npx @capgo/cli login API_KEY
API_KEY
your apikey
copied in the previous step
npx @capgo/cli add [appId]
[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
npx @capgo/cli upload [appId]
[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
npx @capgo/cli set [appId] [version] [channel]
[appId]
your app ID the format is explained here
[version]
your app version already sent to the cloud
[channel]
the channel you want to link the version
npx @capgo/cli delete [appId]
[appId]
your app ID present in the Cloud
npx @capgo/cli cleanup [appId] --bundle=[majorVersion] --keep=[numberToKeep]
[appId]
your app ID present in the Cloud
[majorVersion]
a version you wish to remove previous packages for, it will keep the last one + numberToKeep
[numberToKeep]
the number of packages you wish to keep
For example:
If you have 10 versions, from 10.0.1 to 10.0.11, and you use
npx @capgo/cli cleanup [appId] --bundle=10.0.0
it will remove 10.0.1 to 10.0.6.
10.0.7 untill 10.0.11 will be kept
This command will show a list of what it will be removing and ask for confirmation
npx @capgo/cli set [appId] --channel dev
Optionally, you can give:
[appId] your app ID the format is explained here
--bundle your app bundle already sent to the cloud, to link it to a channel
--latest get the bundle version from package.json:version
, cannot be use with --bundle
--state set the channel state, can be normal or default. To use in your app, one channel need to be "default".
--downgrade allow the channel to send downgrade version to devices.
--no-downgrade disallow the channel to send downgrade version to devices.
--upgrade allow the channel to send upgrade (major) version to devices.
--no-upgrade disallow the channel to send upgrade (major) version to devices.
--ios allow the channel to send version to iOS devices.
--no-ios disallow the channel to send version to iOS devices.
--android allow the channel to send version to android devices.
--no-android disallow the channel to send version to android devices.
--self-assign allow devices to self assign to this channel.
--no-self-assign disallow devices to self assign to this channel.
-
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
VS Code:
- 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
-
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
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
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