@pepshlr/pepdoc 0.2.2 → 0.2.3
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,14 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* PepsDoc - Post-install onboarding
|
|
4
|
-
*
|
|
3
|
+
* PepsDoc - Post-install onboarding
|
|
4
|
+
* Creates PEPSDOC.md in the user's project root so it appears in VS Code
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
declare const GREEN = "\u001B[32m";
|
|
8
|
-
declare const YELLOW = "\u001B[33m";
|
|
9
|
-
declare const DIM = "\u001B[2m";
|
|
10
|
-
declare const RESET = "\u001B[0m";
|
|
11
|
-
declare const BOLD = "\u001B[1m";
|
|
12
|
-
declare const line: string;
|
|
13
|
-
declare const lines: string[];
|
|
6
|
+
export {};
|
|
14
7
|
//# sourceMappingURL=postinstall.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postinstall.d.ts","sourceRoot":"","sources":["../../src/bin/postinstall.ts"],"names":[],"mappings":";AAEA;;;GAGG
|
|
1
|
+
{"version":3,"file":"postinstall.d.ts","sourceRoot":"","sources":["../../src/bin/postinstall.ts"],"names":[],"mappings":";AAEA;;;GAGG"}
|
package/dist/bin/postinstall.js
CHANGED
|
@@ -1,41 +1,81 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
/**
|
|
4
|
-
* PepsDoc - Post-install onboarding
|
|
5
|
-
*
|
|
4
|
+
* PepsDoc - Post-install onboarding
|
|
5
|
+
* Creates PEPSDOC.md in the user's project root so it appears in VS Code
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
+
}
|
|
13
|
+
Object.defineProperty(o, k2, desc);
|
|
14
|
+
}) : (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
o[k2] = m[k];
|
|
17
|
+
}));
|
|
18
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
19
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
20
|
+
}) : function(o, v) {
|
|
21
|
+
o["default"] = v;
|
|
22
|
+
});
|
|
23
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
24
|
+
var ownKeys = function(o) {
|
|
25
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
26
|
+
var ar = [];
|
|
27
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
28
|
+
return ar;
|
|
29
|
+
};
|
|
30
|
+
return ownKeys(o);
|
|
31
|
+
};
|
|
32
|
+
return function (mod) {
|
|
33
|
+
if (mod && mod.__esModule) return mod;
|
|
34
|
+
var result = {};
|
|
35
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
36
|
+
__setModuleDefault(result, mod);
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
})();
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
const fs = __importStar(require("fs"));
|
|
42
|
+
const path = __importStar(require("path"));
|
|
43
|
+
// INIT_CWD = the directory where the user ran `npm install`
|
|
44
|
+
const projectRoot = process.env.INIT_CWD || process.cwd();
|
|
45
|
+
const outputFile = path.join(projectRoot, 'PEPSDOC.md');
|
|
46
|
+
// Don't run inside the pepsdoc package itself
|
|
47
|
+
if (projectRoot.includes('pepsdoc') && !process.env.INIT_CWD) {
|
|
48
|
+
process.exit(0);
|
|
49
|
+
}
|
|
50
|
+
const content = `# PepsDoc is ready!
|
|
51
|
+
|
|
52
|
+
Paste the prompt below into your AI assistant and it will set everything up automatically:
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
\`\`\`
|
|
57
|
+
@pepshlr/pepdoc is already installed. Do the following:
|
|
58
|
+
|
|
59
|
+
1. Find my main server file and add the adapter:
|
|
60
|
+
- Express → const { pepsdoc } = require('@pepshlr/pepdoc'); pepsdoc(app, { title: 'My API' })
|
|
61
|
+
- Fastify → const { fastifyAdapter } = require('@pepshlr/pepdoc'); fastifyAdapter(app, { title: 'My API' })
|
|
62
|
+
- Hono → const { honoAdapter } = require('@pepshlr/pepdoc'); honoAdapter(app, { title: 'My API' })
|
|
63
|
+
|
|
64
|
+
2. Read all route files in the project and generate JSON documentation
|
|
65
|
+
files in pepsdoc/data/v1/ (one file per group of routes).
|
|
66
|
+
Follow the schema in: node_modules/@pepshlr/pepdoc/templates/ai-skill.md
|
|
67
|
+
|
|
68
|
+
3. Start the server and tell me the URL to access the docs.
|
|
69
|
+
\`\`\`
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
You can delete this file after setting up.
|
|
74
|
+
`;
|
|
75
|
+
try {
|
|
76
|
+
fs.writeFileSync(outputFile, content);
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
// Silently ignore — don't break the install
|
|
80
|
+
}
|
|
41
81
|
//# sourceMappingURL=postinstall.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postinstall.js","sourceRoot":"","sources":["../../src/bin/postinstall.ts"],"names":[],"mappings":";;AAEA;;;GAGG
|
|
1
|
+
{"version":3,"file":"postinstall.js","sourceRoot":"","sources":["../../src/bin/postinstall.ts"],"names":[],"mappings":";;AAEA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAE7B,4DAA4D;AAC5D,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;AAC1D,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AAExD,8CAA8C;AAC9C,IAAI,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;CAwBf,CAAC;AAEF,IAAI,CAAC;IACH,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC;AAAC,MAAM,CAAC;IACP,4CAA4C;AAC9C,CAAC"}
|