@nano-app/backend 0.8.3 → 0.10.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nano-app/backend",
3
- "version": "0.8.3",
3
+ "version": "0.10.0",
4
4
  "description": "Express server with file-convention routes, plugins and an optional PostgreSQL layer",
5
5
  "type": "module",
6
6
  "main": "build/index.js",
@@ -16,9 +16,9 @@
16
16
  "LICENSE"
17
17
  ],
18
18
  "scripts": {
19
- "build": "tsup",
20
- "dev": "tsup --watch",
21
- "test": "tsx --env-file-if-exists=../.env --test tests/*.test.ts",
19
+ "build": "tsdown",
20
+ "dev": "tsdown --watch",
21
+ "test": "tsx --env-file-if-exists=../.env --test tests/*.test.ts ../core/tests/*.test.ts",
22
22
  "prepublishOnly": "pnpm run build"
23
23
  },
24
24
  "keywords": [
@@ -40,7 +40,7 @@
40
40
  "access": "public"
41
41
  },
42
42
  "engines": {
43
- "node": ">=20"
43
+ "node": ">=22"
44
44
  },
45
45
  "dependencies": {
46
46
  "compression": "^1.8.2",
@@ -54,8 +54,9 @@
54
54
  "morgan": "^1.12.1"
55
55
  },
56
56
  "peerDependencies": {
57
- "@prisma/adapter-pg": "^7.8.0",
58
- "@prisma/client": "^7.8.0",
57
+ "@prisma/adapter-pg": "^7.10.1",
58
+ "@prisma/client": "^7.10.1",
59
+ "better-auth": "^1.7.12",
59
60
  "pg": "^8.23.1"
60
61
  },
61
62
  "peerDependenciesMeta": {
@@ -65,26 +66,27 @@
65
66
  "@prisma/client": {
66
67
  "optional": true
67
68
  },
69
+ "better-auth": {
70
+ "optional": true
71
+ },
68
72
  "pg": {
69
73
  "optional": true
70
74
  }
71
75
  },
72
76
  "devDependencies": {
73
- "@prisma/adapter-pg": "^7.8.0",
74
- "@prisma/client": "^7.8.0",
77
+ "@prisma/adapter-pg": "^7.10.1",
78
+ "@prisma/client": "^7.10.1",
75
79
  "@types/compression": "^1.8.1",
76
80
  "@types/cors": "^2.8.19",
77
81
  "@types/express": "^5.0.6",
78
82
  "@types/morgan": "^1.9.10",
79
83
  "@types/node": "^26.6.5",
80
84
  "@types/pg": "^8.20.0",
85
+ "better-auth": "^1.7.12",
81
86
  "pg": "^8.23.1",
82
- "prisma": "^7.8.0",
83
- "tsup": "^9.0.0",
87
+ "prisma": "^7.10.1",
88
+ "tsdown": "^0.23.1",
84
89
  "tsx": "^4.23.15",
85
- "typescript": "^5.9.3"
86
- },
87
- "bin": {
88
- "nano-app": "build/nano-app.js"
90
+ "typescript": "^7.0.2"
89
91
  }
90
92
  }
package/build/nano-app.js DELETED
@@ -1,41 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // bin/nano-app.ts
4
- import "dotenv/config";
5
- import { execFileSync } from "child_process";
6
- import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
7
- import { createRequire } from "module";
8
-
9
- // const.ts
10
- import { dirname, resolve } from "path";
11
- import { fileURLToPath } from "url";
12
- var BASE_DIR = dirname(fileURLToPath(import.meta.url));
13
- var getDir = (...parts) => resolve(BASE_DIR, ...parts);
14
-
15
- // bin/nano-app.ts
16
- var [command, ...args] = process.argv.slice(2);
17
- var prisma = (...prismaArgs) => execFileSync(process.execPath, [createRequire(`${process.cwd()}/`).resolve("prisma/build/index.js"), ...prismaArgs], { stdio: "inherit" });
18
- try {
19
- if (command !== "generate" && command !== "push") {
20
- prisma(...process.argv.slice(2));
21
- } else {
22
- const schemaFlag = args.indexOf("--schema");
23
- const appSchema = schemaFlag >= 0 ? args.splice(schemaFlag, 2)[1] : "src/prisma/schema.prisma";
24
- const names = args.filter((arg) => !arg.startsWith("-"));
25
- const flags = args.filter((arg) => arg.startsWith("-"));
26
- for (const name of names.length ? names : ["app"]) {
27
- const source = name === "app" ? appSchema : getDir("plugins", name, "schema.prisma");
28
- if (!existsSync(source)) {
29
- console.error(`[nano-app] [ERROR] "${name}" has no schema: ${source}`);
30
- process.exit(1);
31
- }
32
- const dir = `${process.cwd()}/.nano-app/prisma-clients/${name}`;
33
- mkdirSync(dir, { recursive: true });
34
- writeFileSync(`${dir}/schema.prisma`, readFileSync(source, "utf-8").replace(/output\s*=\s*"[^"]*"/, 'output = "./generated"'));
35
- prisma("generate", "--schema", `${dir}/schema.prisma`);
36
- if (command === "push") prisma("db", "push", "--schema", `${dir}/schema.prisma`, "--url", process.env.DATABASE_URL ?? "", ...flags);
37
- }
38
- }
39
- } catch (error) {
40
- process.exit(error?.status ?? 1);
41
- }