generated from nhcarrigan/template
This commit is contained in:
+2
-1
@@ -1 +1,2 @@
|
|||||||
prod
|
prod
|
||||||
|
src/data/docs.ts
|
||||||
+11
-2
@@ -68,9 +68,18 @@ const results = await Promise.all(
|
|||||||
|
|
||||||
const flat = results.flat();
|
const flat = results.flat();
|
||||||
|
|
||||||
|
const string = `/**
|
||||||
|
* @copyright nhcarrigan
|
||||||
|
* @license Naomi's Public License
|
||||||
|
* @author Naomi Carrigan
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const documentationData = ${JSON.stringify(flat, null, 2)};
|
||||||
|
`;
|
||||||
|
|
||||||
await fs.writeFile(
|
await fs.writeFile(
|
||||||
path.resolve(process.cwd(), "src", "data", "docs.json"),
|
path.resolve(process.cwd(), "src", "data", "docs.ts"),
|
||||||
JSON.stringify(flat, null, 2)
|
string
|
||||||
);
|
);
|
||||||
|
|
||||||
await fs.rm(docsDirectory, { recursive: true, force: true });
|
await fs.rm(docsDirectory, { recursive: true, force: true });
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
"main": "prod/index.js",
|
"main": "prod/index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "eslint ./src --max-warnings 0",
|
"lint": "eslint ./src --max-warnings 0 --ignore-pattern ./src/data",
|
||||||
"dev": "NODE_ENV=dev op run --env-file=./dev.env -- tsx watch ./src/index.ts",
|
"dev": "NODE_ENV=dev op run --env-file=./dev.env -- tsx watch ./src/index.ts",
|
||||||
"build": "tsx ./getDocs.ts && tsc",
|
"build": "tsx ./getDocs.ts && tsc",
|
||||||
"start": "op run --env-file=./prod.env -- node ./prod/index.js",
|
"start": "op run --env-file=./prod.env -- node ./prod/index.js",
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -4,7 +4,7 @@
|
|||||||
* @author Naomi Carrigan
|
* @author Naomi Carrigan
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import documentationData from "../data/docs.json" assert { type: "json" };
|
import { documentationData } from "../data/docs.js";
|
||||||
import type { FastifyPluginAsync } from "fastify";
|
import type { FastifyPluginAsync } from "fastify";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,8 +3,6 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"outDir": "./prod",
|
"outDir": "./prod",
|
||||||
"resolveJsonModule": true,
|
|
||||||
"module": "esnext"
|
|
||||||
},
|
},
|
||||||
"exclude": ["./getDocs.ts"]
|
"exclude": ["./getDocs.ts"]
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user