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 string = `/**
|
||||
* @copyright nhcarrigan
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
|
||||
export const documentationData = ${JSON.stringify(flat, null, 2)};
|
||||
`;
|
||||
|
||||
await fs.writeFile(
|
||||
path.resolve(process.cwd(), "src", "data", "docs.json"),
|
||||
JSON.stringify(flat, null, 2)
|
||||
path.resolve(process.cwd(), "src", "data", "docs.ts"),
|
||||
string
|
||||
);
|
||||
|
||||
await fs.rm(docsDirectory, { recursive: true, force: true });
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
"main": "prod/index.js",
|
||||
"type": "module",
|
||||
"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",
|
||||
"build": "tsx ./getDocs.ts && tsc",
|
||||
"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
|
||||
*/
|
||||
|
||||
import documentationData from "../data/docs.json" assert { type: "json" };
|
||||
import { documentationData } from "../data/docs.js";
|
||||
import type { FastifyPluginAsync } from "fastify";
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
"compilerOptions": {
|
||||
"rootDir": "./src",
|
||||
"outDir": "./prod",
|
||||
"resolveJsonModule": true,
|
||||
"module": "esnext"
|
||||
},
|
||||
"exclude": ["./getDocs.ts"]
|
||||
}
|
||||
Reference in New Issue
Block a user