fix cli build script, add commander, fix types

This commit is contained in:
dswbx
2025-11-05 08:27:47 +01:00
parent e9f1241ec3
commit 07a57ebf67
6 changed files with 10 additions and 25 deletions

View File

@@ -1,30 +1,10 @@
import pkg from "./package.json" with { type: "json" };
import c from "picocolors";
import { formatNumber } from "bknd/utils";
import * as esbuild from "esbuild";
const deps = Object.keys(pkg.dependencies);
const external = ["jsonv-ts/*", "wrangler", "bknd", "bknd/*", ...deps];
if (process.env.DEBUG) {
const result = await esbuild.build({
entryPoints: ["./src/cli/index.ts"],
outdir: "./dist/cli",
platform: "node",
minify: true,
format: "esm",
metafile: true,
bundle: true,
external,
define: {
__isDev: "0",
__version: JSON.stringify(pkg.version),
},
});
await Bun.write("./dist/cli/metafile-esm.json", JSON.stringify(result.metafile, null, 2));
process.exit(0);
}
const result = await Bun.build({
entrypoints: ["./src/cli/index.ts"],
target: "node",

View File

@@ -104,6 +104,7 @@
"@vitest/coverage-v8": "3.0.9",
"autoprefixer": "^10.4.21",
"clsx": "^2.1.1",
"commander": "^14.0.2",
"dotenv": "^17.2.3",
"jotai": "^2.12.2",
"jsdom": "^26.1.0",

View File

@@ -1,5 +1,3 @@
/// <reference types="bun-types" />
import path from "node:path";
import { type RuntimeBkndConfig, createRuntimeApp } from "bknd/adapter";
import { registerLocalMediaAdapter } from ".";

View File

@@ -1,5 +1,6 @@
import { createFrameworkApp, type FrameworkBkndConfig } from "bknd/adapter";
import { isNode } from "bknd/utils";
// @ts-expect-error next is not installed
import type { NextApiRequest } from "next";
type NextjsEnv = NextApiRequest["env"];

View File

@@ -1,4 +1,4 @@
import type { JSONSchema7 } from "json-schema";
import type { JSONSchema } from "json-schema-to-ts";
import { omitKeys, type s } from "bknd/utils";
export function extractSchema<
@@ -10,7 +10,7 @@ export function extractSchema<
config: Config,
keys: Keys[],
): [
JSONSchema7,
Exclude<JSONSchema, boolean | null | undefined>,
Partial<Config>,
{
[K in Keys]: {