Skip to content

Commit e720c25

Browse files
committed
Updated bin
1 parent 489244c commit e720c25

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

packages/docs-md/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"version": "0.1.0-beta1",
44
"type": "module",
55
"bin": {
6-
"docs-md": "src/cli/cli.ts"
6+
"docs-md": "dist/cli/cli.js"
77
},
88
"scripts": {
99
"test": "",
10-
"build": "tsc && cp ./src/generator/docsData/*.gz ./dist/generator/docsData/",
10+
"build": "tsc && cp ./src/generator/docsData/*.gz ./dist/generator/docsData/ && chmod a+x dist/cli/cli.js",
1111
"dev": "",
1212
"format": "prettier --config ../../prettier.config.mjs --ignore-path ../../.gitignore --write \"**/*.{js,jsx,mjs,ts,tsx,mts}\"",
1313
"lint": "eslint \"**/*.{js,jsx,mjs,ts,tsx,mts}\"",

packages/docs-md/src/cli/cli.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env node --experimental-strip-types
1+
#!/usr/bin/env node
22

33
import {
44
existsSync,
@@ -140,12 +140,18 @@ async function getSettings(): Promise<Settings> {
140140
}
141141

142142
// Validate and format various settings, as needed
143+
const configFileDirectory = dirname(configFilePath);
144+
if (!isAbsolute(configFileContents.data.spec)) {
145+
configFileContents.data.spec = resolve(
146+
configFileDirectory,
147+
configFileContents.data.spec
148+
);
149+
}
143150
if (!existsSync(configFileContents.data.spec)) {
144151
throw new Error(
145152
`OpenAPI spec file "${configFileContents.data.spec}" does not exist`
146153
);
147154
}
148-
const configFileDirectory = dirname(configFilePath);
149155
if (!isAbsolute(configFileContents.data.output.pageOutDir)) {
150156
configFileContents.data.output.pageOutDir = resolve(
151157
configFileDirectory,
@@ -180,3 +186,5 @@ for (const [filename, contents] of Object.entries(pageContents)) {
180186
encoding: "utf-8",
181187
});
182188
}
189+
190+
console.log("Success!");

packages/docs-md/src/generator/docsData/getDocsData.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ const wasmPath = join(dirname(fileURLToPath(import.meta.url)), "lib.wasm.gz");
2323
export async function getDocsData(
2424
specContents: string
2525
): Promise<Map<string, Chunk>> {
26+
console.log(
27+
"Parsing OpenAPI spec (you can ignore lock file errors printed below)"
28+
);
2629
const gzippedBuffer = await readFile(wasmPath);
2730
const wasmBuffer = unzipSync(gzippedBuffer);
2831
const go = new Go();
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:c6d017abb6084bd4833fd170991e9ff229b1b99cb3f50a5313854622a91e50cc
3-
size 23327080
2+
oid sha256:2004d93c18cb9c5f4dbf7c84b421b68e3def02e8ea5468c3cdf96b707852c7ab
3+
size 23326040

packages/docs-md/src/generator/generatePages.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ export async function generatePages({
2121
const data = await getDocsData(specContents);
2222

2323
// Generate the content
24+
console.log("Generating Markdown pages");
2425
return generateContent(data);
2526
}

0 commit comments

Comments
 (0)