simple structure

This commit is contained in:
2026-02-09 01:53:04 +01:00
parent 170cb9bc39
commit e344f15430
6 changed files with 33 additions and 9 deletions
+2 -2
View File
@@ -1,13 +1,13 @@
{ {
"name": "next-websockets", "name": "next-websockets",
"version": "1.0.0", "version": "1.0.0",
"main": "dist/cli.js", "main": "dist/index.js",
"repository": "[email protected]:selimaj-dev/next-websockets.git", "repository": "[email protected]:selimaj-dev/next-websockets.git",
"author": "Klesti Selimaj <[email protected]>", "author": "Klesti Selimaj <[email protected]>",
"license": "Apache-2.0", "license": "Apache-2.0",
"type": "module", "type": "module",
"bin": { "bin": {
"next-websockets": "dist/bin/cli.js" "next-websockets": "dist/index.js"
}, },
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
-7
View File
@@ -1,7 +0,0 @@
#!/usr/bin/env node
const args = process.argv.slice(2);
console.log("Dev tool running");
console.log("Args:", args);
console.log("CWD:", process.cwd());
View File
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env node
const args = process.argv.slice(2);
console.log("Dev tool running");
console.log("Args:", args);
console.log("CWD:", process.cwd());
View File
+24
View File
@@ -0,0 +1,24 @@
import fs from "fs";
import path from "path";
export async function listWsFiles(dir: string) {
const files: string[] = [];
function walk(currentDir: string) {
const entries = fs.readdirSync(currentDir, { withFileTypes: true });
for (const entry of entries) {
const fullPath = path.join(currentDir, entry.name);
if (entry.isDirectory()) {
walk(fullPath);
} else if (entry.isFile() && entry.name === "ws.ts") {
files.push(fullPath);
}
}
}
walk(dir);
const modules = await Promise.all(files.map((file) => import(file)));
return modules;
}