@asafarim/direxpo-server 0.2.0

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.
package/README.md ADDED
@@ -0,0 +1,120 @@
1
+ # @asafarim/direxpo-server
2
+
3
+ Express API wrapper for MD Exporter with tree generation capabilities.
4
+
5
+ ## Features
6
+
7
+ - **Express Router**: Ready-to-use API endpoints
8
+ - **Tree Integration**: Automatic folder structure generation
9
+ - **File Management**: Download and open exported files
10
+ - **Tree-Only Export**: Export just the folder structure
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ pnpm add @asafarim/direxpo-server
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ ### Basic Setup
21
+
22
+ ```typescript
23
+ import express from 'express';
24
+ import { createDirexpoRouter } from '@asafarim/direxpo-server';
25
+
26
+ const app = express();
27
+ app.use(express.json());
28
+
29
+ const { router } = createDirexpoRouter({ outputDir: '.output' });
30
+ app.use('/api', router);
31
+
32
+ app.listen(5199, () => {
33
+ console.log('Server running on http://localhost:5199');
34
+ });
35
+ ```
36
+
37
+ ## API Endpoints
38
+
39
+ ### POST `/api/run`
40
+
41
+ Export files to markdown.
42
+
43
+ **Request Body:**
44
+ ```json
45
+ {
46
+ "options": {
47
+ "targetPath": "./src",
48
+ "filter": "tsx",
49
+ "exclude": ["tests"],
50
+ "maxSize": 5,
51
+ "includeTree": true,
52
+ "treeOnly": false
53
+ }
54
+ }
55
+ ```
56
+
57
+ **Response:**
58
+ ```json
59
+ {
60
+ "outputPath": "/path/to/output.md",
61
+ "report": {
62
+ "included": 42,
63
+ "bytesWritten": 123456
64
+ }
65
+ }
66
+ ```
67
+
68
+ ### POST `/api/discover`
69
+
70
+ Discover files without exporting.
71
+
72
+ **Request Body:**
73
+ ```json
74
+ {
75
+ "options": {
76
+ "targetPath": "./src",
77
+ "filter": "tsx"
78
+ }
79
+ }
80
+ ```
81
+
82
+ **Response:**
83
+ ```json
84
+ {
85
+ "files": ["src/index.ts", "src/app.tsx"]
86
+ }
87
+ ```
88
+
89
+ ### GET `/api/download/:filename`
90
+
91
+ Download an exported markdown file.
92
+
93
+ ### POST `/api/open-file`
94
+
95
+ Open an exported file in the default application.
96
+
97
+ **Request Body:**
98
+ ```json
99
+ {
100
+ "filename": "export_20240106.md"
101
+ }
102
+ ```
103
+
104
+ ## Options
105
+
106
+ ### DirexpoRunOptions
107
+
108
+ Extends `ExportOptions` from `@asafarim/md-exporter` with:
109
+
110
+ - `includeTree?: boolean` - Prepend folder structure to export
111
+ - `treeOnly?: boolean` - Export only the folder structure
112
+ - `filePaths?: string[]` - Pre-discovered file paths
113
+
114
+ ### DirexpoServerOptions
115
+
116
+ - `outputDir?: string` - Output directory (default: `.output`)
117
+
118
+ ## License
119
+
120
+ MIT
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dev-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-server.d.ts","sourceRoot":"","sources":["../src/dev-server.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import express from "express";
2
+ import { createDirexpoRouter } from "./router.js";
3
+ const app = express();
4
+ app.use(express.json());
5
+ const { router } = createDirexpoRouter({ outputDir: ".output" });
6
+ app.use("/api", router);
7
+ const PORT = 5199;
8
+ app.listen(PORT, () => {
9
+ console.log(`direxpo-server running on http://localhost:${PORT}`);
10
+ });
11
+ //# sourceMappingURL=dev-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-server.js","sourceRoot":"","sources":["../src/dev-server.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;AACtB,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AAExB,MAAM,EAAE,MAAM,EAAE,GAAG,mBAAmB,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;AACjE,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAExB,MAAM,IAAI,GAAG,IAAI,CAAC;AAClB,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;IACpB,OAAO,CAAC,GAAG,CAAC,8CAA8C,IAAI,EAAE,CAAC,CAAC;AACpE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export type { DirexpoRunOptions, DirexpoServerOptions } from "./types.js";
2
+ export { createDirexpoRouter } from "./router.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { createDirexpoRouter } from "./router.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { type Router } from "express";
2
+ import type { DirexpoServerOptions } from "./types.js";
3
+ type DirexpoRouterResult = {
4
+ router: Router;
5
+ outputDir: string;
6
+ };
7
+ export declare function createDirexpoRouter(opts?: DirexpoServerOptions): DirexpoRouterResult;
8
+ export {};
9
+ //# sourceMappingURL=router.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAM/C,OAAO,KAAK,EAAqB,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAK1E,KAAK,mBAAmB,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAyDF,wBAAgB,mBAAmB,CACjC,IAAI,GAAE,oBAAyB,GAC9B,mBAAmB,CA4IrB"}
package/dist/router.js ADDED
@@ -0,0 +1,174 @@
1
+ import express from "express";
2
+ import { runExport } from "@asafarim/md-exporter";
3
+ import { readFile, writeFile, mkdir } from "fs/promises";
4
+ import { join, resolve } from "path";
5
+ import { exec } from "child_process";
6
+ import { promisify } from "util";
7
+ import { discoverFiles, generateTreeSection } from "@asafarim/direxpo-core";
8
+ const execAsync = promisify(exec);
9
+ function normalizeOptions(input) {
10
+ const normalized = {
11
+ targetPath: input.targetPath,
12
+ };
13
+ if (input.filter) {
14
+ normalized.filter = input.filter;
15
+ }
16
+ if (input.pattern && typeof input.pattern === "string" && input.pattern.trim()) {
17
+ normalized.pattern = input.pattern.trim();
18
+ if (!input.filter) {
19
+ normalized.filter = "glob";
20
+ }
21
+ }
22
+ if (input.exclude) {
23
+ let excludeArray = [];
24
+ if (typeof input.exclude === "string") {
25
+ excludeArray = input.exclude
26
+ .split(/[,\n]+/)
27
+ .map((s) => s.trim())
28
+ .filter((s) => s.length > 0);
29
+ }
30
+ else if (Array.isArray(input.exclude)) {
31
+ excludeArray = input.exclude
32
+ .map((s) => (typeof s === "string" ? s.trim() : ""))
33
+ .filter((s) => s.length > 0);
34
+ }
35
+ if (excludeArray.length > 0) {
36
+ normalized.exclude = excludeArray;
37
+ }
38
+ }
39
+ let maxSizeBytes = 0;
40
+ if (input.maxSizeMb !== undefined && typeof input.maxSizeMb === "number") {
41
+ maxSizeBytes = input.maxSizeMb;
42
+ }
43
+ else if (input.maxSize !== undefined && typeof input.maxSize === "number") {
44
+ maxSizeBytes = input.maxSize / (1024 * 1024);
45
+ }
46
+ if (maxSizeBytes > 0 && isFinite(maxSizeBytes)) {
47
+ normalized.maxSize = maxSizeBytes;
48
+ }
49
+ return normalized;
50
+ }
51
+ export function createDirexpoRouter(opts = {}) {
52
+ const router = express.Router();
53
+ const OUTPUT_DIR = resolve(opts.outputDir ?? join(process.cwd(), ".output"));
54
+ mkdir(OUTPUT_DIR, { recursive: true }).catch(() => {
55
+ // ignore
56
+ });
57
+ router.post("/run", async (req, res) => {
58
+ try {
59
+ const { options } = req.body;
60
+ const { includeTree, treeOnly, filePaths, ...baseOptions } = options;
61
+ // Tree-only: produce markdown that contains only the tree
62
+ if (treeOnly) {
63
+ const normalizedOpts = normalizeOptions(baseOptions);
64
+ const paths = filePaths && filePaths.length
65
+ ? filePaths
66
+ : await discoverFiles(normalizedOpts);
67
+ const treeSection = generateTreeSection(paths, baseOptions.targetPath);
68
+ const timestamp = new Date()
69
+ .toISOString()
70
+ .replace(/[:.]/g, "")
71
+ .slice(0, -5);
72
+ const filename = `tree_${timestamp}.md`;
73
+ const outputPath = join(OUTPUT_DIR, filename);
74
+ await writeFile(outputPath, treeSection, "utf-8");
75
+ res.json({
76
+ outputPath,
77
+ report: {
78
+ included: paths.length,
79
+ bytesWritten: treeSection.length,
80
+ treeOnly: true,
81
+ },
82
+ });
83
+ return;
84
+ }
85
+ // Normal export
86
+ const normalizedOpts = normalizeOptions(baseOptions);
87
+ const result = await runExport({
88
+ ...normalizedOpts,
89
+ outDir: OUTPUT_DIR,
90
+ });
91
+ // Prepend tree if requested
92
+ if (includeTree && result.outputMarkdownPath) {
93
+ const paths = filePaths && filePaths.length
94
+ ? filePaths
95
+ : await discoverFiles(normalizedOpts);
96
+ if (paths.length) {
97
+ try {
98
+ const markdownContent = await readFile(result.outputMarkdownPath, "utf-8");
99
+ const treeSection = generateTreeSection(paths, baseOptions.targetPath);
100
+ if (treeSection) {
101
+ await writeFile(result.outputMarkdownPath, treeSection + "\n" + markdownContent, "utf-8");
102
+ }
103
+ }
104
+ catch {
105
+ // ignore tree failure
106
+ }
107
+ }
108
+ }
109
+ res.json({
110
+ outputPath: result.outputMarkdownPath,
111
+ report: result.report,
112
+ });
113
+ }
114
+ catch (error) {
115
+ res.status(500).json({
116
+ error: error instanceof Error ? error.message : "Unknown error",
117
+ });
118
+ }
119
+ });
120
+ router.post("/discover", async (req, res) => {
121
+ try {
122
+ const { options } = req.body;
123
+ const normalizedOpts = normalizeOptions(options);
124
+ const files = await discoverFiles(normalizedOpts);
125
+ res.json({ files });
126
+ }
127
+ catch (error) {
128
+ res.status(500).json({
129
+ error: error instanceof Error ? error.message : "Unknown error",
130
+ });
131
+ }
132
+ });
133
+ router.get("/download/:filename", async (req, res) => {
134
+ try {
135
+ const { filename } = req.params;
136
+ const filepath = join(OUTPUT_DIR, filename);
137
+ const content = await readFile(filepath, "utf-8");
138
+ res.setHeader("Content-Type", "text/markdown");
139
+ res.setHeader("Content-Disposition", `attachment; filename="${filename}"`);
140
+ res.send(content);
141
+ }
142
+ catch {
143
+ res.status(404).json({ error: "File not found" });
144
+ }
145
+ });
146
+ router.post("/open-file", async (req, res) => {
147
+ try {
148
+ const { filename } = req.body;
149
+ const filepath = join(OUTPUT_DIR, filename);
150
+ await readFile(filepath, "utf-8");
151
+ const isWindows = process.platform === "win32";
152
+ const isMac = process.platform === "darwin";
153
+ const isLinux = process.platform === "linux";
154
+ let command;
155
+ if (isWindows)
156
+ command = `start "" "${filepath}"`;
157
+ else if (isMac)
158
+ command = `open "${filepath}"`;
159
+ else if (isLinux)
160
+ command = `xdg-open "${filepath}"`;
161
+ else
162
+ throw new Error("Unsupported operating system");
163
+ await execAsync(command);
164
+ res.json({ success: true });
165
+ }
166
+ catch (error) {
167
+ res.status(500).json({
168
+ error: error instanceof Error ? error.message : "Failed to open file",
169
+ });
170
+ }
171
+ });
172
+ return { router, outputDir: OUTPUT_DIR };
173
+ }
174
+ //# sourceMappingURL=router.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router.js","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAAA,OAAO,OAAwB,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE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;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { ExportOptions } from "@asafarim/md-exporter";
2
+ export interface DirexpoRunOptions extends ExportOptions {
3
+ includeTree?: boolean;
4
+ treeOnly?: boolean;
5
+ filePaths?: string[];
6
+ }
7
+ export interface DirexpoServerOptions {
8
+ outputDir?: string;
9
+ }
10
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@asafarim/direxpo-server",
3
+ "version": "0.2.0",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./dist/index.d.ts",
8
+ "default": "./dist/index.js"
9
+ }
10
+ },
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "dependencies": {
15
+ "@asafarim/md-exporter": "0.2.3",
16
+ "@asafarim/direxpo-core": "^0.4.0",
17
+ "express": "^4.18.2"
18
+ },
19
+ "devDependencies": {
20
+ "@types/express": "^4.17.21",
21
+ "@types/node": "^20.10.6",
22
+ "tsx": "^4.7.0",
23
+ "typescript": "^5.3.3",
24
+ "gh-pages": "^6.3.0",
25
+ "concurrently": "^8.2.2"
26
+ },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/AliSafari-IT/direxpo-server.git"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "author": "Ali Safari",
35
+ "license": "MIT",
36
+ "scripts": {
37
+ "build": "tsc -p tsconfig.json",
38
+ "dev": "tsx src/dev-server.ts",
39
+ "demo": "pnpm run build && pnpm --filter direxpo-server-demo dev",
40
+ "deploy:demo": "gh-pages -d demo/dist",
41
+ "deploy": "pnpm run deploy:demo",
42
+ "release": "node scripts/release.js",
43
+ "start": "concurrently \"pnpm run dev\" \"pnpm run demo\""
44
+ }
45
+ }