@vkontakte/vk-miniapps-deploy 0.2.1 → 1.0.0

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,3 +1,8 @@
1
+ ## v1.0.0
2
+
3
+ - Улучшенная скорость и стабильность загрузки статических файлов.
4
+ - ⚠️ Важно: мы меняем внутренние механизмы загрузки статики для мини-приложений, в связи с этим выпускаем новую версию до которой необходимо обновиться.
5
+
1
6
  ## v0.2.1
2
7
 
3
8
  - ⚠️ Предупреждение: добавлено сообщение в `postinstall`, информирующее о прекращении поддержки версий ниже `v1.0.0`.
package/README.md CHANGED
@@ -4,6 +4,9 @@
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
  ```
package/index.js CHANGED
@@ -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.0",
4
4
  "description": "Deploy to VK Mini Apps hosting with one simple command",
5
5
  "main": "index.js",
6
6
  "scripts": {