@mintlify/previewing 3.1.51 → 3.1.53

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.
Files changed (34) hide show
  1. package/README.md +17 -17
  2. package/dist/constants.d.ts +9 -9
  3. package/dist/constants.js +31 -31
  4. package/dist/downloadImage.d.ts +4 -4
  5. package/dist/downloadImage.js +139 -139
  6. package/dist/index.d.ts +3 -3
  7. package/dist/index.js +3 -3
  8. package/dist/local-preview/helper-commands/installDepsCommand.d.ts +2 -2
  9. package/dist/local-preview/helper-commands/installDepsCommand.js +51 -51
  10. package/dist/local-preview/index.d.ts +3 -3
  11. package/dist/local-preview/index.js +212 -212
  12. package/dist/local-preview/listener/categorize.d.ts +8 -8
  13. package/dist/local-preview/listener/categorize.js +193 -193
  14. package/dist/local-preview/listener/generate.d.ts +1 -1
  15. package/dist/local-preview/listener/generate.js +137 -137
  16. package/dist/local-preview/listener/index.d.ts +2 -2
  17. package/dist/local-preview/listener/index.js +317 -317
  18. package/dist/local-preview/listener/update.d.ts +2 -2
  19. package/dist/local-preview/listener/update.js +79 -79
  20. package/dist/local-preview/listener/utils/createPage.d.ts +10 -10
  21. package/dist/local-preview/listener/utils/createPage.js +210 -210
  22. package/dist/local-preview/listener/utils/getOpenApiContext.d.ts +21 -21
  23. package/dist/local-preview/listener/utils/getOpenApiContext.js +55 -55
  24. package/dist/local-preview/listener/utils/mintConfigFile.d.ts +2 -2
  25. package/dist/local-preview/listener/utils/mintConfigFile.js +74 -74
  26. package/dist/local-preview/listener/utils/types.d.ts +2 -2
  27. package/dist/local-preview/listener/utils/types.js +1 -1
  28. package/dist/local-preview/listener/utils.d.ts +13 -13
  29. package/dist/local-preview/listener/utils.js +112 -112
  30. package/dist/tsconfig.tsbuildinfo +1 -1
  31. package/dist/util.d.ts +4 -4
  32. package/dist/util.js +20 -20
  33. package/package.json +87 -85
  34. package/LICENSE +0 -93
package/README.md CHANGED
@@ -1,17 +1,17 @@
1
- # @mintlify/previewing
2
-
3
- Preview Mintlify docs locally.
4
-
5
- ## 🚀 Installation
6
-
7
- ```
8
- npm install @mintlify/previewing
9
- ```
10
-
11
- ## Community
12
-
13
- Join our Discord community if you have questions or just want to chat:
14
-
15
- [![](https://dcbadge.vercel.app/api/server/ACREKdwjG5)](https://discord.gg/ACREKdwjG5)
16
-
17
- _Built with 💚 by the Mintlify community._
1
+ # @mintlify/previewing
2
+
3
+ Preview Mintlify docs locally.
4
+
5
+ ## 🚀 Installation
6
+
7
+ ```
8
+ npm install @mintlify/previewing
9
+ ```
10
+
11
+ ## Community
12
+
13
+ Join our Discord community if you have questions or just want to chat:
14
+
15
+ [![](https://dcbadge.vercel.app/api/server/ACREKdwjG5)](https://discord.gg/ACREKdwjG5)
16
+
17
+ _Built with 💚 by the Mintlify community._
@@ -1,9 +1,9 @@
1
- export declare const TARGET_MINT_VERSION = "v0.0.23";
2
- export declare const INSTALL_PATH: string;
3
- export declare const HOME_DIR: string;
4
- export declare const DOT_MINTLIFY: string;
5
- export declare const VERSION_PATH: string;
6
- export declare const CLIENT_PATH: string;
7
- export declare const MINT_PATH: string;
8
- export declare const CMD_EXEC_PATH: string;
9
- export declare const SUPPORTED_MEDIA_EXTENSIONS: string[];
1
+ export declare const TARGET_MINT_VERSION = "v0.0.23";
2
+ export declare const INSTALL_PATH: string;
3
+ export declare const HOME_DIR: string;
4
+ export declare const DOT_MINTLIFY: string;
5
+ export declare const VERSION_PATH: string;
6
+ export declare const CLIENT_PATH: string;
7
+ export declare const MINT_PATH: string;
8
+ export declare const CMD_EXEC_PATH: string;
9
+ export declare const SUPPORTED_MEDIA_EXTENSIONS: string[];
package/dist/constants.js CHANGED
@@ -1,31 +1,31 @@
1
- import os from 'os';
2
- import path from 'path';
3
- import * as url from 'url';
4
- // Change this to bump to a newer version of mint's client
5
- export var TARGET_MINT_VERSION = 'v0.0.23';
6
- // package installation location
7
- export var INSTALL_PATH = url.fileURLToPath(new URL('.', import.meta.url));
8
- export var HOME_DIR = os.homedir();
9
- export var DOT_MINTLIFY = path.join(HOME_DIR, '.mintlify');
10
- export var VERSION_PATH = path.join(DOT_MINTLIFY, 'mint', 'mint-version.txt');
11
- export var CLIENT_PATH = path.join(DOT_MINTLIFY, 'mint', 'client');
12
- export var MINT_PATH = path.join(DOT_MINTLIFY, 'mint');
13
- // command execution location
14
- export var CMD_EXEC_PATH = process.cwd();
15
- export var SUPPORTED_MEDIA_EXTENSIONS = [
16
- 'jpeg',
17
- 'jpg',
18
- 'jfif',
19
- 'pjpeg',
20
- 'pjp',
21
- 'png',
22
- 'svg',
23
- 'svgz',
24
- 'ico',
25
- 'webp',
26
- 'gif',
27
- 'apng',
28
- 'avif',
29
- 'bmp',
30
- 'mp4',
31
- ];
1
+ import os from 'os';
2
+ import path from 'path';
3
+ import * as url from 'url';
4
+ // Change this to bump to a newer version of mint's client
5
+ export var TARGET_MINT_VERSION = 'v0.0.23';
6
+ // package installation location
7
+ export var INSTALL_PATH = url.fileURLToPath(new URL('.', import.meta.url));
8
+ export var HOME_DIR = os.homedir();
9
+ export var DOT_MINTLIFY = path.join(HOME_DIR, '.mintlify');
10
+ export var VERSION_PATH = path.join(DOT_MINTLIFY, 'mint', 'mint-version.txt');
11
+ export var CLIENT_PATH = path.join(DOT_MINTLIFY, 'mint', 'client');
12
+ export var MINT_PATH = path.join(DOT_MINTLIFY, 'mint');
13
+ // command execution location
14
+ export var CMD_EXEC_PATH = process.cwd();
15
+ export var SUPPORTED_MEDIA_EXTENSIONS = [
16
+ 'jpeg',
17
+ 'jpg',
18
+ 'jfif',
19
+ 'pjpeg',
20
+ 'pjp',
21
+ 'png',
22
+ 'svg',
23
+ 'svgz',
24
+ 'ico',
25
+ 'webp',
26
+ 'gif',
27
+ 'apng',
28
+ 'avif',
29
+ 'bmp',
30
+ 'mp4',
31
+ ];
@@ -1,4 +1,4 @@
1
- export declare function isValidImageSrc(src: string): boolean;
2
- export declare function removeMetadataFromImageSrc(src: string): string;
3
- export declare function cleanImageSrc(src: string, origin: string): string;
4
- export default function downloadImage(imageSrc: string, writePath: string, overwrite?: boolean): Promise<void>;
1
+ export declare function isValidImageSrc(src: string): boolean;
2
+ export declare function removeMetadataFromImageSrc(src: string): string;
3
+ export declare function cleanImageSrc(src: string, origin: string): string;
4
+ export default function downloadImage(imageSrc: string, writePath: string, overwrite?: boolean): Promise<void>;
@@ -1,139 +1,139 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __generator = (this && this.__generator) || function (thisArg, body) {
11
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
- function verb(n) { return function (v) { return step([n, v]); }; }
14
- function step(op) {
15
- if (f) throw new TypeError("Generator is already executing.");
16
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
- if (y = 0, t) op = [op[0] & 2, t.value];
19
- switch (op[0]) {
20
- case 0: case 1: t = op; break;
21
- case 4: _.label++; return { value: op[1], done: false };
22
- case 5: _.label++; y = op[1]; op = [0]; continue;
23
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
- default:
25
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
- if (t[2]) _.ops.pop();
30
- _.trys.pop(); continue;
31
- }
32
- op = body.call(thisArg, _);
33
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
- }
36
- };
37
- import axios from 'axios';
38
- import { existsSync, mkdirSync, createWriteStream } from 'fs';
39
- import path from 'path';
40
- import { SUPPORTED_MEDIA_EXTENSIONS } from './constants.js';
41
- import { getFileExtension } from './util.js';
42
- function writeImageToFile(imageSrc, writePath, overwrite) {
43
- return __awaiter(this, void 0, void 0, function () {
44
- var writer, response, e_1;
45
- return __generator(this, function (_a) {
46
- switch (_a.label) {
47
- case 0:
48
- // Avoid unnecessary downloads
49
- if (existsSync(writePath) && !overwrite) {
50
- return [2 /*return*/, Promise.reject({
51
- code: 'EEXIST',
52
- })];
53
- }
54
- // Create the folders needed if they're missing
55
- mkdirSync(path.dirname(writePath), { recursive: true });
56
- writer = createWriteStream(writePath);
57
- _a.label = 1;
58
- case 1:
59
- _a.trys.push([1, 3, , 4]);
60
- return [4 /*yield*/, axios.get(imageSrc, {
61
- responseType: 'stream',
62
- })];
63
- case 2:
64
- response = _a.sent();
65
- // wx prevents overwriting an image with the exact same name
66
- // being created in the time we were downloading
67
- response.data.pipe(writer, {
68
- flag: 'wx',
69
- });
70
- return [2 /*return*/, new Promise(function (resolve, reject) {
71
- writer.on('finish', resolve);
72
- writer.on('error', reject);
73
- })];
74
- case 3:
75
- e_1 = _a.sent();
76
- return [2 /*return*/, Promise.reject({
77
- code: 'ENOTFOUND',
78
- })];
79
- case 4: return [2 /*return*/];
80
- }
81
- });
82
- });
83
- }
84
- export function isValidImageSrc(src) {
85
- if (!src) {
86
- return false;
87
- }
88
- // We do not support downloading base64 in-line images.
89
- if (src.startsWith('data:')) {
90
- return false;
91
- }
92
- var imageHref = removeMetadataFromImageSrc(src);
93
- var ext = getFileExtension(imageHref);
94
- if (ext && !SUPPORTED_MEDIA_EXTENSIONS.includes(ext)) {
95
- console.error('🚨 We do not support the file extension: ' + ext);
96
- return false;
97
- }
98
- return true;
99
- }
100
- export function removeMetadataFromImageSrc(src) {
101
- // Part of the URL standard
102
- var metadataSymbols = ['?', '#'];
103
- metadataSymbols.forEach(function (dividerSymbol) {
104
- // Some frameworks add metadata after the file extension, we need to remove that.
105
- src = src.split(dividerSymbol)[0];
106
- });
107
- return src;
108
- }
109
- export function cleanImageSrc(src, origin) {
110
- // Add origin if the image tags are using relative sources
111
- return src.startsWith('http') ? src : new URL(src, origin).href;
112
- }
113
- export default function downloadImage(imageSrc, writePath, overwrite) {
114
- if (overwrite === void 0) { overwrite = false; }
115
- return __awaiter(this, void 0, void 0, function () {
116
- return __generator(this, function (_a) {
117
- switch (_a.label) {
118
- case 0: return [4 /*yield*/, writeImageToFile(imageSrc, writePath, overwrite)
119
- .then(function () {
120
- console.log('🖼️ - ' + writePath);
121
- })
122
- .catch(function (e) {
123
- if (e.code === 'EEXIST') {
124
- console.log("\u274C Skipping existing image ".concat(writePath));
125
- }
126
- else if (e.code === 'ENOTFOUND') {
127
- console.error("\uD83D\uDEA8 Cannot download the image, address not found ".concat(imageSrc));
128
- }
129
- else {
130
- console.error(e);
131
- }
132
- })];
133
- case 1:
134
- _a.sent();
135
- return [2 /*return*/];
136
- }
137
- });
138
- });
139
- }
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ import axios from 'axios';
38
+ import { existsSync, mkdirSync, createWriteStream } from 'fs';
39
+ import path from 'path';
40
+ import { SUPPORTED_MEDIA_EXTENSIONS } from './constants.js';
41
+ import { getFileExtension } from './util.js';
42
+ function writeImageToFile(imageSrc, writePath, overwrite) {
43
+ return __awaiter(this, void 0, void 0, function () {
44
+ var writer, response, e_1;
45
+ return __generator(this, function (_a) {
46
+ switch (_a.label) {
47
+ case 0:
48
+ // Avoid unnecessary downloads
49
+ if (existsSync(writePath) && !overwrite) {
50
+ return [2 /*return*/, Promise.reject({
51
+ code: 'EEXIST',
52
+ })];
53
+ }
54
+ // Create the folders needed if they're missing
55
+ mkdirSync(path.dirname(writePath), { recursive: true });
56
+ writer = createWriteStream(writePath);
57
+ _a.label = 1;
58
+ case 1:
59
+ _a.trys.push([1, 3, , 4]);
60
+ return [4 /*yield*/, axios.get(imageSrc, {
61
+ responseType: 'stream',
62
+ })];
63
+ case 2:
64
+ response = _a.sent();
65
+ // wx prevents overwriting an image with the exact same name
66
+ // being created in the time we were downloading
67
+ response.data.pipe(writer, {
68
+ flag: 'wx',
69
+ });
70
+ return [2 /*return*/, new Promise(function (resolve, reject) {
71
+ writer.on('finish', resolve);
72
+ writer.on('error', reject);
73
+ })];
74
+ case 3:
75
+ e_1 = _a.sent();
76
+ return [2 /*return*/, Promise.reject({
77
+ code: 'ENOTFOUND',
78
+ })];
79
+ case 4: return [2 /*return*/];
80
+ }
81
+ });
82
+ });
83
+ }
84
+ export function isValidImageSrc(src) {
85
+ if (!src) {
86
+ return false;
87
+ }
88
+ // We do not support downloading base64 in-line images.
89
+ if (src.startsWith('data:')) {
90
+ return false;
91
+ }
92
+ var imageHref = removeMetadataFromImageSrc(src);
93
+ var ext = getFileExtension(imageHref);
94
+ if (ext && !SUPPORTED_MEDIA_EXTENSIONS.includes(ext)) {
95
+ console.error('🚨 We do not support the file extension: ' + ext);
96
+ return false;
97
+ }
98
+ return true;
99
+ }
100
+ export function removeMetadataFromImageSrc(src) {
101
+ // Part of the URL standard
102
+ var metadataSymbols = ['?', '#'];
103
+ metadataSymbols.forEach(function (dividerSymbol) {
104
+ // Some frameworks add metadata after the file extension, we need to remove that.
105
+ src = src.split(dividerSymbol)[0];
106
+ });
107
+ return src;
108
+ }
109
+ export function cleanImageSrc(src, origin) {
110
+ // Add origin if the image tags are using relative sources
111
+ return src.startsWith('http') ? src : new URL(src, origin).href;
112
+ }
113
+ export default function downloadImage(imageSrc, writePath, overwrite) {
114
+ if (overwrite === void 0) { overwrite = false; }
115
+ return __awaiter(this, void 0, void 0, function () {
116
+ return __generator(this, function (_a) {
117
+ switch (_a.label) {
118
+ case 0: return [4 /*yield*/, writeImageToFile(imageSrc, writePath, overwrite)
119
+ .then(function () {
120
+ console.log('🖼️ - ' + writePath);
121
+ })
122
+ .catch(function (e) {
123
+ if (e.code === 'EEXIST') {
124
+ console.log("\u274C Skipping existing image ".concat(writePath));
125
+ }
126
+ else if (e.code === 'ENOTFOUND') {
127
+ console.error("\uD83D\uDEA8 Cannot download the image, address not found ".concat(imageSrc));
128
+ }
129
+ else {
130
+ console.error(e);
131
+ }
132
+ })];
133
+ case 1:
134
+ _a.sent();
135
+ return [2 /*return*/];
136
+ }
137
+ });
138
+ });
139
+ }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import installDepsCommand from './local-preview/helper-commands/installDepsCommand.js';
2
- import dev from './local-preview/index.js';
3
- export { dev, installDepsCommand };
1
+ import installDepsCommand from './local-preview/helper-commands/installDepsCommand.js';
2
+ import dev from './local-preview/index.js';
3
+ export { dev, installDepsCommand };
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import installDepsCommand from './local-preview/helper-commands/installDepsCommand.js';
2
- import dev from './local-preview/index.js';
3
- export { dev, installDepsCommand };
1
+ import installDepsCommand from './local-preview/helper-commands/installDepsCommand.js';
2
+ import dev from './local-preview/index.js';
3
+ export { dev, installDepsCommand };
@@ -1,2 +1,2 @@
1
- declare const installDeps: () => Promise<void>;
2
- export default installDeps;
1
+ declare const installDeps: () => Promise<void>;
2
+ export default installDeps;
@@ -1,51 +1,51 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __generator = (this && this.__generator) || function (thisArg, body) {
11
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
- function verb(n) { return function (v) { return step([n, v]); }; }
14
- function step(op) {
15
- if (f) throw new TypeError("Generator is already executing.");
16
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
- if (y = 0, t) op = [op[0] & 2, t.value];
19
- switch (op[0]) {
20
- case 0: case 1: t = op; break;
21
- case 4: _.label++; return { value: op[1], done: false };
22
- case 5: _.label++; y = op[1]; op = [0]; continue;
23
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
- default:
25
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
- if (t[2]) _.ops.pop();
30
- _.trys.pop(); continue;
31
- }
32
- op = body.call(thisArg, _);
33
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
- }
36
- };
37
- import shell from 'shelljs';
38
- import { CLIENT_PATH } from '../../constants.js';
39
- import { buildLogger, ensureYarn } from '../../util.js';
40
- var installDeps = function () { return __awaiter(void 0, void 0, void 0, function () {
41
- var logger;
42
- return __generator(this, function (_a) {
43
- logger = buildLogger('');
44
- ensureYarn(logger);
45
- shell.cd(CLIENT_PATH);
46
- shell.exec('yarn');
47
- logger.succeed('Dependencies installed.');
48
- return [2 /*return*/];
49
- });
50
- }); };
51
- export default installDeps;
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ import shell from 'shelljs';
38
+ import { CLIENT_PATH } from '../../constants.js';
39
+ import { buildLogger, ensureYarn } from '../../util.js';
40
+ var installDeps = function () { return __awaiter(void 0, void 0, void 0, function () {
41
+ var logger;
42
+ return __generator(this, function (_a) {
43
+ logger = buildLogger('');
44
+ ensureYarn(logger);
45
+ shell.cd(CLIENT_PATH);
46
+ shell.exec('yarn');
47
+ logger.succeed('Dependencies installed.');
48
+ return [2 /*return*/];
49
+ });
50
+ }); };
51
+ export default installDeps;
@@ -1,3 +1,3 @@
1
- import { ArgumentsCamelCase } from 'yargs';
2
- declare const dev: (argv: ArgumentsCamelCase) => Promise<void>;
3
- export default dev;
1
+ import { ArgumentsCamelCase } from 'yargs';
2
+ declare const dev: (argv: ArgumentsCamelCase) => Promise<void>;
3
+ export default dev;