fix
This commit is contained in:
parent
d4b30272c3
commit
2fef5e11ed
|
|
@ -6,26 +6,18 @@ declare module "app/srv/api/npm-size" {
|
||||||
api(mode: "site" | "page", id: string): Promise<string>;
|
api(mode: "site" | "page", id: string): Promise<string>;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
declare module "app/srv/api/auth/login" {
|
declare module "app/srv/api/auth/session" {
|
||||||
export const _: {
|
|
||||||
url: string;
|
|
||||||
api(username: string, password: string): Promise<{
|
|
||||||
status: string;
|
|
||||||
session: any;
|
|
||||||
reason?: undefined;
|
|
||||||
} | {
|
|
||||||
status: string;
|
|
||||||
reason: string;
|
|
||||||
session?: undefined;
|
|
||||||
}>;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
declare module "app/srv/api/session" {
|
|
||||||
export const _: {
|
export const _: {
|
||||||
url: string;
|
url: string;
|
||||||
api(): Promise<any>;
|
api(): Promise<any>;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
declare module "app/srv/api/site-dts" {
|
||||||
|
export const _: {
|
||||||
|
url: string;
|
||||||
|
api(site_id: string): Promise<string>;
|
||||||
|
};
|
||||||
|
}
|
||||||
declare module "app/srv/global" {
|
declare module "app/srv/global" {
|
||||||
import { site, user } from "dbgen";
|
import { site, user } from "dbgen";
|
||||||
import { ExecaChildProcess } from "execa";
|
import { ExecaChildProcess } from "execa";
|
||||||
|
|
@ -52,18 +44,6 @@ declare module "app/srv/global" {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
declare module "app/srv/api/npm" {
|
|
||||||
export const _: {
|
|
||||||
url: string;
|
|
||||||
api(mode: "site" | "page", id: string): Promise<void>;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
declare module "app/srv/api/local-ip" {
|
|
||||||
export const _: {
|
|
||||||
url: string;
|
|
||||||
api(): Promise<string[]>;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
declare module "app/web/src/utils/types/ws" {
|
declare module "app/web/src/utils/types/ws" {
|
||||||
export type WS_MSG = WS_MSG_GET_COMP | WS_MSG_SET_COMP | WS_MSG_GET_PAGE | WS_MSG_SET_PAGE | WS_MSG_SV_LOCAL | WS_MSG_SVDIFF_REMOTE | WS_MSG_DIFF_LOCAL | WS_MSG_UNDO | WS_MSG_REDO | WS_MSG_NEW_COMP | WS_SITE_JS | {
|
export type WS_MSG = WS_MSG_GET_COMP | WS_MSG_SET_COMP | WS_MSG_GET_PAGE | WS_MSG_SET_PAGE | WS_MSG_SV_LOCAL | WS_MSG_SVDIFF_REMOTE | WS_MSG_DIFF_LOCAL | WS_MSG_UNDO | WS_MSG_REDO | WS_MSG_NEW_COMP | WS_SITE_JS | {
|
||||||
type: "ping";
|
type: "ping";
|
||||||
|
|
@ -606,10 +586,30 @@ declare module "app/srv/api/npm-bundle" {
|
||||||
api(mode: "site" | "page", id: string): Promise<any>;
|
api(mode: "site" | "page", id: string): Promise<any>;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
declare module "app/srv/api/site-dts" {
|
declare module "app/srv/api/npm" {
|
||||||
export const _: {
|
export const _: {
|
||||||
url: string;
|
url: string;
|
||||||
api(site_id: string): Promise<string>;
|
api(mode: "site" | "page", id: string): Promise<void>;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
declare module "app/srv/api/auth/login" {
|
||||||
|
export const _: {
|
||||||
|
url: string;
|
||||||
|
api(username: string, password: string): Promise<{
|
||||||
|
status: string;
|
||||||
|
session: any;
|
||||||
|
reason?: undefined;
|
||||||
|
} | {
|
||||||
|
status: string;
|
||||||
|
reason: string;
|
||||||
|
session?: undefined;
|
||||||
|
}>;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
declare module "app/srv/api/local-ip" {
|
||||||
|
export const _: {
|
||||||
|
url: string;
|
||||||
|
api(): Promise<string[]>;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
declare module "app/srv/exports" {
|
declare module "app/srv/exports" {
|
||||||
|
|
@ -620,33 +620,19 @@ declare module "app/srv/exports" {
|
||||||
args: string[];
|
args: string[];
|
||||||
handler: Promise<typeof import("app/srv/api/npm-size")>;
|
handler: Promise<typeof import("app/srv/api/npm-size")>;
|
||||||
};
|
};
|
||||||
export const login: {
|
|
||||||
name: string;
|
|
||||||
url: string;
|
|
||||||
path: string;
|
|
||||||
args: string[];
|
|
||||||
handler: Promise<typeof import("app/srv/api/auth/login")>;
|
|
||||||
};
|
|
||||||
export const session: {
|
export const session: {
|
||||||
name: string;
|
name: string;
|
||||||
url: string;
|
url: string;
|
||||||
path: string;
|
path: string;
|
||||||
args: any[];
|
args: any[];
|
||||||
handler: Promise<typeof import("app/srv/api/session")>;
|
handler: Promise<typeof import("app/srv/api/auth/session")>;
|
||||||
};
|
};
|
||||||
export const npm: {
|
export const site_dts: {
|
||||||
name: string;
|
name: string;
|
||||||
url: string;
|
url: string;
|
||||||
path: string;
|
path: string;
|
||||||
args: string[];
|
args: string[];
|
||||||
handler: Promise<typeof import("app/srv/api/npm")>;
|
handler: Promise<typeof import("app/srv/api/site-dts")>;
|
||||||
};
|
|
||||||
export const local_ip: {
|
|
||||||
name: string;
|
|
||||||
url: string;
|
|
||||||
path: string;
|
|
||||||
args: any[];
|
|
||||||
handler: Promise<typeof import("app/srv/api/local-ip")>;
|
|
||||||
};
|
};
|
||||||
export const npm_bundle: {
|
export const npm_bundle: {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
@ -655,12 +641,26 @@ declare module "app/srv/exports" {
|
||||||
args: string[];
|
args: string[];
|
||||||
handler: Promise<typeof import("app/srv/api/npm-bundle")>;
|
handler: Promise<typeof import("app/srv/api/npm-bundle")>;
|
||||||
};
|
};
|
||||||
export const site_dts: {
|
export const npm: {
|
||||||
name: string;
|
name: string;
|
||||||
url: string;
|
url: string;
|
||||||
path: string;
|
path: string;
|
||||||
args: string[];
|
args: string[];
|
||||||
handler: Promise<typeof import("app/srv/api/site-dts")>;
|
handler: Promise<typeof import("app/srv/api/npm")>;
|
||||||
|
};
|
||||||
|
export const login: {
|
||||||
|
name: string;
|
||||||
|
url: string;
|
||||||
|
path: string;
|
||||||
|
args: string[];
|
||||||
|
handler: Promise<typeof import("app/srv/api/auth/login")>;
|
||||||
|
};
|
||||||
|
export const local_ip: {
|
||||||
|
name: string;
|
||||||
|
url: string;
|
||||||
|
path: string;
|
||||||
|
args: any[];
|
||||||
|
handler: Promise<typeof import("app/srv/api/local-ip")>;
|
||||||
};
|
};
|
||||||
export const _upload: {
|
export const _upload: {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
@ -676,13 +676,6 @@ declare module "app/srv/exports" {
|
||||||
args: any[];
|
args: any[];
|
||||||
handler: Promise<any>;
|
handler: Promise<any>;
|
||||||
};
|
};
|
||||||
export const _file: {
|
|
||||||
name: string;
|
|
||||||
url: string;
|
|
||||||
path: string;
|
|
||||||
args: any[];
|
|
||||||
handler: Promise<any>;
|
|
||||||
};
|
|
||||||
export const _api_frm: {
|
export const _api_frm: {
|
||||||
name: string;
|
name: string;
|
||||||
url: string;
|
url: string;
|
||||||
|
|
@ -697,4 +690,11 @@ declare module "app/srv/exports" {
|
||||||
args: string[];
|
args: string[];
|
||||||
handler: Promise<any>;
|
handler: Promise<any>;
|
||||||
};
|
};
|
||||||
|
export const _file: {
|
||||||
|
name: string;
|
||||||
|
url: string;
|
||||||
|
path: string;
|
||||||
|
args: any[];
|
||||||
|
handler: Promise<any>;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,3 +2,4 @@ git reset --hard
|
||||||
git pull
|
git pull
|
||||||
bun run build
|
bun run build
|
||||||
bun run deploy
|
bun run deploy
|
||||||
|
pm2 restart prasi:4550
|
||||||
|
|
@ -11,7 +11,6 @@ import { preparePrisma } from "./utils/prisma";
|
||||||
|
|
||||||
g.status = "init";
|
g.status = "init";
|
||||||
|
|
||||||
|
|
||||||
await createLogger();
|
await createLogger();
|
||||||
g.api = {};
|
g.api = {};
|
||||||
g.mode = process.argv.includes("dev") ? "dev" : "prod";
|
g.mode = process.argv.includes("dev") ? "dev" : "prod";
|
||||||
|
|
@ -31,9 +30,10 @@ if (g.db) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
createServer();
|
|
||||||
await parcelBuild();
|
await parcelBuild();
|
||||||
|
await createServer();
|
||||||
await generateAPIFrm();
|
await generateAPIFrm();
|
||||||
await prepareApiRoutes();
|
await prepareApiRoutes();
|
||||||
await prepareAPITypes();
|
await prepareAPITypes();
|
||||||
|
|
||||||
g.status = "ready";
|
g.status = "ready";
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ const cache = {
|
||||||
export type WSData = { url: URL };
|
export type WSData = { url: URL };
|
||||||
|
|
||||||
export const createServer = async () => {
|
export const createServer = async () => {
|
||||||
await waitUntil(() => g.status !== "init");
|
|
||||||
g.router = createRouter({ strictTrailingSlash: false });
|
g.router = createRouter({ strictTrailingSlash: false });
|
||||||
|
|
||||||
for (const route of Object.values(g.api)) {
|
for (const route of Object.values(g.api)) {
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,9 @@ export const parcelBuild = async () => {
|
||||||
"--dist-dir",
|
"--dist-dir",
|
||||||
dir.path(`app/static`),
|
dir.path(`app/static`),
|
||||||
];
|
];
|
||||||
g.log.info(`Building web with parcel`);
|
|
||||||
if (g.mode === "dev") {
|
if (g.mode === "dev") {
|
||||||
|
g.log.info(`Building web with parcel`);
|
||||||
|
|
||||||
await new Promise<void>((resolve) => {
|
await new Promise<void>((resolve) => {
|
||||||
const parcel = spawn({
|
const parcel = spawn({
|
||||||
cmd: args,
|
cmd: args,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue