@pepshlr/pepdoc 0.2.1 → 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,13 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * PepsDoc - Post-install onboarding message
4
- * Shows a welcome message after npm install
3
+ * PepsDoc - Post-install onboarding
4
+ * Creates PEPSDOC.md in the user's project root so it appears in VS Code
5
5
  */
6
- declare const PURPLE = "\u001B[35m";
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;
6
+ export {};
13
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;AAEH,QAAA,MAAM,MAAM,eAAa,CAAC;AAC1B,QAAA,MAAM,KAAK,eAAa,CAAC;AACzB,QAAA,MAAM,MAAM,eAAa,CAAC;AAC1B,QAAA,MAAM,GAAG,cAAY,CAAC;AACtB,QAAA,MAAM,KAAK,cAAY,CAAC;AACxB,QAAA,MAAM,IAAI,cAAY,CAAC;AAEvB,QAAA,MAAM,IAAI,QAAiB,CAAC"}
1
+ {"version":3,"file":"postinstall.d.ts","sourceRoot":"","sources":["../../src/bin/postinstall.ts"],"names":[],"mappings":";AAEA;;;GAGG"}
@@ -1,38 +1,81 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
  /**
4
- * PepsDoc - Post-install onboarding message
5
- * Shows a welcome message after npm install
4
+ * PepsDoc - Post-install onboarding
5
+ * Creates PEPSDOC.md in the user's project root so it appears in VS Code
6
6
  */
7
- const PURPLE = '\x1b[35m';
8
- const GREEN = '\x1b[32m';
9
- const YELLOW = '\x1b[33m';
10
- const DIM = '\x1b[2m';
11
- const RESET = '\x1b[0m';
12
- const BOLD = '\x1b[1m';
13
- const line = '─'.repeat(58);
14
- console.log('');
15
- console.log(` ${PURPLE}${BOLD}✦ PepsDoc${RESET} installed!`);
16
- console.log('');
17
- console.log(` ${GREEN}${BOLD}Let AI document your entire API automatically.${RESET}`);
18
- console.log(` ${DIM}Copy the prompt below and paste it into your AI assistant:${RESET}`);
19
- console.log('');
20
- console.log(` ┌${line}┐`);
21
- console.log(` │ ${YELLOW}pepsdoc: integrate and document my entire API ${RESET} │`);
22
- console.log(` │ │`);
23
- console.log(` │ @pepshlr/pepdoc is already installed. Do the following: │`);
24
- console.log(` │ │`);
25
- console.log(` │ 1. Find my main server file and add the adapter: │`);
26
- console.log(` │ Express pepsdoc(app, { title: '...' }) │`);
27
- console.log(` │ Fastify fastifyAdapter(app, { title: '...' }) │`);
28
- console.log(` │ Hono → honoAdapter(app, { title: '...' }) │`);
29
- console.log(` │ │`);
30
- console.log(` │ 2. Read all route files in the project and generate │`);
31
- console.log(` │ JSON docs in pepsdoc/data/v1/ (one file per group). │`);
32
- console.log(` │ Schema: node_modules/@pepshlr/pepdoc/templates/ │`);
33
- console.log(` │ ai-skill.md │`);
34
- console.log(` │ │`);
35
- console.log(` │ 3. Start the server and tell me the docs URL. │`);
36
- console.log(` └${line}┘`);
37
- console.log('');
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
+ }
38
81
  //# sourceMappingURL=postinstall.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"postinstall.js","sourceRoot":"","sources":["../../src/bin/postinstall.ts"],"names":[],"mappings":";;AAEA;;;GAGG;AAEH,MAAM,MAAM,GAAG,UAAU,CAAC;AAC1B,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,MAAM,MAAM,GAAG,UAAU,CAAC;AAC1B,MAAM,GAAG,GAAG,SAAS,CAAC;AACtB,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,IAAI,GAAG,SAAS,CAAC;AAEvB,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAE5B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAChB,OAAO,CAAC,GAAG,CAAC,KAAK,MAAM,GAAG,IAAI,YAAY,KAAK,aAAa,CAAC,CAAC;AAC9D,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAChB,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,GAAG,IAAI,iDAAiD,KAAK,EAAE,CAAC,CAAC;AACvF,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,6DAA6D,KAAK,EAAE,CAAC,CAAC;AAC1F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAChB,OAAO,CAAC,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC;AAC3B,OAAO,CAAC,GAAG,CAAC,OAAO,MAAM,4DAA4D,KAAK,IAAI,CAAC,CAAC;AAChG,OAAO,CAAC,GAAG,CAAC,gEAAgE,CAAC,CAAC;AAC9E,OAAO,CAAC,GAAG,CAAC,gEAAgE,CAAC,CAAC;AAC9E,OAAO,CAAC,GAAG,CAAC,gEAAgE,CAAC,CAAC;AAC9E,OAAO,CAAC,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;;;;;;;;CAwBf,CAAC;AAEF,IAAI,CAAC;IACH,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC;AAAC,MAAM,CAAC;IACP,4CAA4C;AAC9C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pepshlr/pepdoc",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "API documentation, beautifully automated.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",