@vkontakte/vk-miniapps-deploy 0.2.1 → 1.0.1

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/CHANGELOG.md CHANGED
@@ -1,6 +1,19 @@
1
+ ## v1.0.1
2
+
3
+ - Все адреса изменены с `vk.com` на `vk.ru`.
4
+ - `api.vk.com` → `api.vk.ru`
5
+ - `dev.vk.com` → `dev.vk.ru`
6
+ - `vk.com` → `vk.ru`
7
+ - `oauth.vk.com` → `oauth.vk.ru`
8
+
9
+ ## v1.0.0
10
+
11
+ - Улучшенная скорость и стабильность загрузки статических файлов.
12
+ - ⚠️ Важно: мы меняем внутренние механизмы загрузки статики для мини-приложений, в связи с этим выпускаем новую версию до которой необходимо обновиться.
13
+
1
14
  ## v0.2.1
2
15
 
3
- - ⚠️ Предупреждение: добавлено сообщение в `postinstall`, информирующее о прекращении поддержки версий ниже `v1.0.0`.
16
+ - ⚠️ Предупреждение: добавлено сообщение в `postinstall`, информирующее о прекращении поддержки версий ниже `v1.0.0`.
4
17
 
5
18
  ## v0.2.0
6
19
 
package/README.md CHANGED
@@ -1,9 +1,12 @@
1
- [<img width="134" src="https://sun9-30.userapi.com/IMLu3sXowImUG-VtL34AqHT4qIUBapkCO0dyhA/bz55lWspvOk.svg">](https://vk.com/services)
1
+ [<img width="134" src="https://sun9-30.userapi.com/IMLu3sXowImUG-VtL34AqHT4qIUBapkCO0dyhA/bz55lWspvOk.svg">](https://vk.ru/services)
2
2
 
3
3
  # VK Mini Apps Deploy [![npm][npm]][npm-url]
4
4
 
5
5
  Deploy straight to VK Mini Apps hosting with one simple command.
6
6
 
7
+ ## ⚠️Attention
8
+ All versions of the package below `v1.0.0` are deprecated and no longer supported. This is due to the migration of our static hosting from PHP to Go, which has resulted in improved performance and stability. Please upgrade to version `v1.0.0` or later to continue receiving support, bug fixes, and performance improvements.
9
+
7
10
  ## Usage
8
11
 
9
12
  ```
@@ -81,4 +84,4 @@ rm ~/.config/configstore/@vkontakte/vk-miniapps-deploy.json
81
84
  [npm]: https://img.shields.io/npm/v/@vkontakte/vk-miniapps-deploy.svg
82
85
  [npm-url]: https://npmjs.com/package/@vkontakte/vk-miniapps-deploy
83
86
 
84
- For more details, visit the official [VK Developer Portal](https://dev.vk.com/mini-apps/development/hosting/overview).
87
+ For more details, visit the official [VK Developer Portal](https://dev.vk.ru/mini-apps/development/hosting/overview).
package/index.js CHANGED
@@ -17,8 +17,8 @@ prompt.delimiter = '=>'.grey;
17
17
 
18
18
  const DEBUG_MODE = !!cfg.debug;
19
19
 
20
- const API_HOST = cfg.api_host || 'https://api.vk.com/method/';
21
- const OAUTH_HOST = cfg.oauth_host || 'https://oauth.vk.com/';
20
+ const API_HOST = cfg.api_host || 'https://api.vk.ru/method/';
21
+ const OAUTH_HOST = cfg.oauth_host || 'https://oauth.vk.ru/';
22
22
 
23
23
  const API_VERSION = '5.131';
24
24
  const DEPLOY_APP_ID = 6670517;
@@ -51,9 +51,9 @@ const URL_NAMES = {
51
51
  };
52
52
 
53
53
  const PLATFORMS = {
54
- WEB: 'vk.com',
54
+ WEB: 'vk.ru',
55
55
  MOBILE: 'iOS & Android',
56
- MOBILE_WEB: 'm.vk.com',
56
+ MOBILE_WEB: 'm.vk.ru',
57
57
  };
58
58
 
59
59
  const URL_NAMES_MAP = {
@@ -476,12 +476,13 @@ async function run(cfg) {
476
476
  }
477
477
  }
478
478
 
479
- const r = await api('apps.getBundleUploadServer', params);
480
- if (!r || !r.upload_url) {
479
+ const uploadServer = await api('apps.getGoHostingUploadServer', params);
480
+
481
+ if (!uploadServer || !uploadServer.upload_url) {
481
482
  throw new Error(JSON.stringify('upload_url is undefined', r));
482
483
  }
483
484
 
484
- const uploadURL = r.upload_url;
485
+ const uploadURL = uploadServer.upload_url;
485
486
  const bundleFile = cfg.bundleFile || './build.zip';
486
487
 
487
488
  if (!cfg.bundleFile) {
@@ -497,19 +498,19 @@ async function run(cfg) {
497
498
  return false;
498
499
  }
499
500
 
500
- return await upload(uploadURL, bundleFile).then((r) => {
501
- if (r.version) {
502
- console.log('Uploaded version ' + r.version + '!');
503
- console.warn(
504
- 'WARNING: Versions below 1.0.0 are deprecated. Please upgrade to v1.0.0 or later.',
505
- );
506
-
507
- return getQueue(r.version, cfg);
508
- } else {
509
- console.error('Upload error:', r);
510
- process.exit(1);
511
- }
501
+ const uploadResponse = await upload(uploadURL, bundleFile);
502
+ const taskData = await api('apps.createGoHostingTask', {
503
+ ...params,
504
+ upload_response: Buffer.from(JSON.stringify(uploadResponse)).toString('base64'),
512
505
  });
506
+
507
+ if (taskData.version) {
508
+ console.log('Uploaded version ' + taskData.version + '!');
509
+ return getQueue(taskData.version, cfg);
510
+ } else {
511
+ console.error('Upload error:', r);
512
+ process.exit(1);
513
+ }
513
514
  } catch (e) {
514
515
  console.error(chalk.red(e));
515
516
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/vk-miniapps-deploy",
3
- "version": "0.2.1",
3
+ "version": "1.0.1",
4
4
  "description": "Deploy to VK Mini Apps hosting with one simple command",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -18,17 +18,17 @@
18
18
  },
19
19
  "author": {
20
20
  "name": "VK",
21
- "url": "https://vk.com"
21
+ "url": "https://vk.ru"
22
22
  },
23
23
  "contributors": [
24
24
  {
25
25
  "name": "Ilya Egorov",
26
- "url": "https://vk.com/mobyman"
26
+ "url": "https://vk.ru/mobyman"
27
27
  },
28
28
  {
29
29
  "name": "Gleb Vorontsov",
30
30
  "email": "vorontsov.gleb@gmail.com",
31
- "url": "https://vk.com/boy"
31
+ "url": "https://vk.ru/boy"
32
32
  }
33
33
  ],
34
34
  "bin": "./bin/vk-miniapps-deploy",