0.1.7 • Published 1 month ago

@vkontakte/vk-miniapps-deploy v0.1.7

Weekly downloads
486
License
MIT
Repository
github
Last release
1 month ago

VK Mini Apps Deploy npm

Deploy straight to VK Mini Apps hosting with one simple command.

Usage

# install it from npm and symlink it into your PATH
npm install @vkontakte/vk-miniapps-deploy -g

# now run it!
vk-miniapps-deploy

You can also use npm run to package it with your app without installing it globally.

First add this to your scripts section of package.json:

  "scripts": {
    "deploy": "vk-miniapps-deploy",
    "clean-source": "rimraf README.md src webroot package.json"
  },

And then install vk-miniapps-deploy as a devDependency:

npm install @vkontakte/vk-miniapps-deploy --save-dev

And now you can run npm run deploy to run the vk-miniapps-deploy installed in the local node_modules folder (even if you have never done npm install vk-miniapps-deploy -g).

Options

To configure vk-miniapps-deploy all you need to do is specify a couple of things in your vk-hosting-config.json

{
  "static_path": "build",
  "app_id": "...",
  "endpoints": {
    "mobile": "index.html",
    "mvk": "index.html",
    "web": "index.html"
  }
}

How to use:

  • Make sure that in package.json the key value «homepage» is «./»
  • Copy the example config to the root folder of your application vk-hosting-config.json.example and remove the suffix «.example»
  • Run yarn deploy

For your CI, you can use

$ env MINI_APPS_ACCESS_TOKEN=<token> yarn deploy

with user token retrieved from vk-miniapps-deploy OR service token of deployable application

There are two values to specify MINI_APPS_ENVIRONMENT: production or dev. All production builds will be also deployed on dev environment.

If you grep URL paths, you can use environment variable CI_URLS = true.

Troubleshooting:

If you get an error User authorization failed: invalid session, try this comand:

rm ~/.config/configstore/@vkontakte/vk-miniapps-deploy.json
0.1.7

1 month ago

0.1.6

9 months ago

0.1.2

12 months ago

0.1.4

12 months ago

0.1.3

12 months ago

0.1.5

12 months ago

0.0.26

2 years ago

0.0.24

3 years ago

0.0.25

3 years ago

0.0.23

3 years ago

0.0.22

4 years ago

0.0.21

4 years ago

0.0.20

4 years ago

0.0.19

4 years ago

0.0.18

4 years ago

0.0.15

4 years ago

0.0.16

4 years ago

0.0.17

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago