@vkontakte/vk-miniapps-deploy 0.2.0 → 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 +9 -0
- package/README.md +6 -0
- package/index.js +16 -11
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## v1.0.0
|
|
2
|
+
|
|
3
|
+
- Улучшенная скорость и стабильность загрузки статических файлов.
|
|
4
|
+
- ⚠️ Важно: мы меняем внутренние механизмы загрузки статики для мини-приложений, в связи с этим выпускаем новую версию до которой необходимо обновиться.
|
|
5
|
+
|
|
6
|
+
## v0.2.1
|
|
7
|
+
|
|
8
|
+
- ⚠️ Предупреждение: добавлено сообщение в `postinstall`, информирующее о прекращении поддержки версий ниже `v1.0.0`.
|
|
9
|
+
|
|
1
10
|
## v0.2.0
|
|
2
11
|
|
|
3
12
|
- Добавили поддержку деплоя через proxy сервер.
|
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
|
```
|
|
@@ -20,6 +23,7 @@ First add this to your scripts section of `package.json`:
|
|
|
20
23
|
|
|
21
24
|
```JSON
|
|
22
25
|
"scripts": {
|
|
26
|
+
"predeploy": "npm run build",
|
|
23
27
|
"deploy": "vk-miniapps-deploy",
|
|
24
28
|
"clean-source": "rimraf README.md src webroot package.json"
|
|
25
29
|
},
|
|
@@ -79,3 +83,5 @@ rm ~/.config/configstore/@vkontakte/vk-miniapps-deploy.json
|
|
|
79
83
|
|
|
80
84
|
[npm]: https://img.shields.io/npm/v/@vkontakte/vk-miniapps-deploy.svg
|
|
81
85
|
[npm-url]: https://npmjs.com/package/@vkontakte/vk-miniapps-deploy
|
|
86
|
+
|
|
87
|
+
For more details, visit the official [VK Developer Portal](https://dev.vk.com/mini-apps/development/hosting/overview).
|
package/index.js
CHANGED
|
@@ -476,12 +476,13 @@ async function run(cfg) {
|
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
478
|
|
|
479
|
-
const
|
|
480
|
-
|
|
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 =
|
|
485
|
+
const uploadURL = uploadServer.upload_url;
|
|
485
486
|
const bundleFile = cfg.bundleFile || './build.zip';
|
|
486
487
|
|
|
487
488
|
if (!cfg.bundleFile) {
|
|
@@ -497,15 +498,19 @@ async function run(cfg) {
|
|
|
497
498
|
return false;
|
|
498
499
|
}
|
|
499
500
|
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
} else {
|
|
505
|
-
console.error('Upload error:', r);
|
|
506
|
-
process.exit(1);
|
|
507
|
-
}
|
|
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'),
|
|
508
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
|
+
}
|
|
509
514
|
} catch (e) {
|
|
510
515
|
console.error(chalk.red(e));
|
|
511
516
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/vk-miniapps-deploy",
|
|
3
|
-
"version": "0.
|
|
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": {
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"lint:eslint": "eslint ./index.js",
|
|
10
10
|
"lint:prettier": "prettier --check ./index.js",
|
|
11
11
|
"lint:fix": "eslint ./index.js --fix",
|
|
12
|
-
"lint:ci": "yarn lint:eslint && yarn lint:prettier"
|
|
12
|
+
"lint:ci": "yarn lint:eslint && yarn lint:prettier",
|
|
13
|
+
"postinstall": "node -e \"console.warn('WARNING: Versions below 1.0.0 are deprecated. Please upgrade to v1.0.0 or later.')\""
|
|
13
14
|
},
|
|
14
15
|
"license": "MIT",
|
|
15
16
|
"engines": {
|