@scalar/cli 0.2.302 → 0.2.304
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
1
3
|
import { confirm, isCancel, text, cancel } from '@clack/prompts';
|
|
2
4
|
import { Command } from 'commander';
|
|
3
5
|
import GithubSlugger from 'github-slugger';
|
|
4
6
|
import kleur from 'kleur';
|
|
5
|
-
import fs from 'node:fs';
|
|
6
|
-
import path from 'node:path';
|
|
7
7
|
import { CONFIG_FILE } from '../../utils/useGivenFileOrConfiguration.js';
|
|
8
8
|
|
|
9
9
|
function InitCommand() {
|
|
@@ -83,7 +83,6 @@ function InitCommand() {
|
|
|
83
83
|
}
|
|
84
84
|
const slugger = new GithubSlugger();
|
|
85
85
|
const slug = slugger.slug(response.toString());
|
|
86
|
-
// eslint-disable-next-line no-param-reassign
|
|
87
86
|
subdomain = `${slug}.apidocumentation.com`;
|
|
88
87
|
console.log(`${kleur.green('✔')} Subdomain: ${kleur.green(subdomain)}`);
|
|
89
88
|
}
|
|
@@ -29,8 +29,7 @@ function ServeCommand() {
|
|
|
29
29
|
version: result.version,
|
|
30
30
|
schema: result.schema,
|
|
31
31
|
});
|
|
32
|
-
if (specification?.paths === undefined ||
|
|
33
|
-
Object.keys(specification?.paths).length === 0) {
|
|
32
|
+
if (specification?.paths === undefined || Object.keys(specification?.paths).length === 0) {
|
|
34
33
|
console.log(kleur.bold().yellow('[WARN]'), kleur.grey('Couldn’t find any paths in the OpenAPI file.'));
|
|
35
34
|
}
|
|
36
35
|
const app = new Hono();
|
|
@@ -49,9 +48,7 @@ function ServeCommand() {
|
|
|
49
48
|
if (watch) {
|
|
50
49
|
watchFile(input, async () => {
|
|
51
50
|
const newResult = await loadOpenApiFile(input);
|
|
52
|
-
const specificationHasChanged = newResult?.specification &&
|
|
53
|
-
JSON.stringify(specification) !==
|
|
54
|
-
JSON.stringify(newResult.specification);
|
|
51
|
+
const specificationHasChanged = newResult?.specification && JSON.stringify(specification) !== JSON.stringify(newResult.specification);
|
|
55
52
|
if (specificationHasChanged) {
|
|
56
53
|
console.log(kleur.bold().white('[INFO]'), kleur.grey('OpenAPI file modified'));
|
|
57
54
|
printSpecificationBanner({
|
|
@@ -63,7 +60,6 @@ function ServeCommand() {
|
|
|
63
60
|
}
|
|
64
61
|
});
|
|
65
62
|
}
|
|
66
|
-
// eslint-disable-next-line no-constant-condition
|
|
67
63
|
while (true) {
|
|
68
64
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
69
65
|
}
|
package/dist/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InitCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/init/InitCommand.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InitCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/init/InitCommand.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAMnC;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,oBAAoB,EAAE,CAAA;IAClC,MAAM,EAAE,gBAAgB,EAAE,CAAA;CAC3B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,kBAAkB,EAAE,CAAA;CAC9B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAA;IACvB,KAAK,CAAC,EAAE,kBAAkB,EAAE,CAAA;CAC7B,CAAA;AAED,wBAAgB,WAAW,YAyK1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServeCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/serve/ServeCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"ServeCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/serve/ServeCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAQnC,wBAAgB,YAAY,YAkG3B"}
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"swagger",
|
|
17
17
|
"cli"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.2.
|
|
19
|
+
"version": "0.2.304",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=18"
|
|
22
22
|
},
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"hono": "^4.6.5",
|
|
45
45
|
"kleur": "^4.1.5",
|
|
46
46
|
"prettyjson": "^1.2.5",
|
|
47
|
-
"@scalar/api-reference": "1.25.119",
|
|
48
47
|
"@scalar/config": "0.1.2",
|
|
49
|
-
"@scalar/
|
|
50
|
-
"@scalar/
|
|
51
|
-
"@scalar/
|
|
48
|
+
"@scalar/api-reference": "1.25.121",
|
|
49
|
+
"@scalar/mock-server": "0.2.114",
|
|
50
|
+
"@scalar/oas-utils": "0.2.107",
|
|
51
|
+
"@scalar/openapi-parser": "0.10.8",
|
|
52
52
|
"@scalar/void-server": "2.0.15",
|
|
53
|
-
"@scalar/openapi-types": "0.1.
|
|
53
|
+
"@scalar/openapi-types": "0.1.8"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@rollup/plugin-json": "^6.1.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"rollup-plugin-delete": "^2.0.0",
|
|
62
62
|
"strip-ansi": "^7.1.0",
|
|
63
63
|
"tslib": "^2.6.2",
|
|
64
|
-
"@scalar/build-tooling": "0.1.
|
|
64
|
+
"@scalar/build-tooling": "0.1.14"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"@scalar/cli": "pnpm vite-node src/index.ts",
|