mirror of
https://github.com/LukeHagar/dokploy.git
synced 2025-12-06 12:27:49 +00:00
fix(server): update build paths
This commit is contained in:
@@ -1,16 +0,0 @@
|
|||||||
export interface LemonSqueezyLicenseResponse {
|
|
||||||
valid: boolean;
|
|
||||||
error?: string;
|
|
||||||
meta?: {
|
|
||||||
store_id: string;
|
|
||||||
order_id: number;
|
|
||||||
order_item_id: number;
|
|
||||||
product_id: number;
|
|
||||||
product_name: string;
|
|
||||||
variant_id: number;
|
|
||||||
variant_name: string;
|
|
||||||
customer_id: number;
|
|
||||||
customer_name: string;
|
|
||||||
customer_email: string;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,45 +1,12 @@
|
|||||||
import {
|
import {
|
||||||
deployApplication,
|
|
||||||
deployCompose,
|
|
||||||
deployRemoteApplication,
|
deployRemoteApplication,
|
||||||
deployRemoteCompose,
|
deployRemoteCompose,
|
||||||
rebuildApplication,
|
|
||||||
rebuildCompose,
|
|
||||||
rebuildRemoteApplication,
|
rebuildRemoteApplication,
|
||||||
rebuildRemoteCompose,
|
rebuildRemoteCompose,
|
||||||
updateApplicationStatus,
|
updateApplicationStatus,
|
||||||
updateCompose,
|
updateCompose,
|
||||||
} from "@dokploy/server/dist";
|
} from "@dokploy/server";
|
||||||
import type { DeployJob } from "./schema";
|
import type { DeployJob } from "./schema";
|
||||||
import type { LemonSqueezyLicenseResponse } from "./types";
|
|
||||||
|
|
||||||
// const LEMON_SQUEEZY_API_KEY = process.env.LEMON_SQUEEZY_API_KEY;
|
|
||||||
// const LEMON_SQUEEZY_STORE_ID = process.env.LEMON_SQUEEZY_STORE_ID;
|
|
||||||
// export const validateLemonSqueezyLicense = async (
|
|
||||||
// licenseKey: string,
|
|
||||||
// ): Promise<LemonSqueezyLicenseResponse> => {
|
|
||||||
// try {
|
|
||||||
// const response = await fetch(
|
|
||||||
// "https://api.lemonsqueezy.com/v1/licenses/validate",
|
|
||||||
// {
|
|
||||||
// method: "POST",
|
|
||||||
// headers: {
|
|
||||||
// "Content-Type": "application/json",
|
|
||||||
// "x-api-key": LEMON_SQUEEZY_API_KEY as string,
|
|
||||||
// },
|
|
||||||
// body: JSON.stringify({
|
|
||||||
// license_key: licenseKey,
|
|
||||||
// store_id: LEMON_SQUEEZY_STORE_ID as string,
|
|
||||||
// }),
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
|
|
||||||
// return response.json();
|
|
||||||
// } catch (error) {
|
|
||||||
// console.error("Error validating license:", error);
|
|
||||||
// return { valid: false, error: "Error validating license" };
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
export const deploy = async (job: DeployJob) => {
|
export const deploy = async (job: DeployJob) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
runMongoBackup,
|
runMongoBackup,
|
||||||
runMySqlBackup,
|
runMySqlBackup,
|
||||||
runPostgresBackup,
|
runPostgresBackup,
|
||||||
} from "@dokploy/server/dist";
|
} from "@dokploy/server";
|
||||||
import { db } from "@dokploy/server/dist/db";
|
import { db } from "@dokploy/server/dist/db";
|
||||||
import { backups, server } from "@dokploy/server/dist/db/schema";
|
import { backups, server } from "@dokploy/server/dist/db/schema";
|
||||||
import { eq } from "drizzle-orm";
|
import { eq } from "drizzle-orm";
|
||||||
|
|||||||
@@ -16,18 +16,6 @@
|
|||||||
"./constants": {
|
"./constants": {
|
||||||
"import": "./src/constants/index.ts",
|
"import": "./src/constants/index.ts",
|
||||||
"require": "./dist/constants.cjs.js"
|
"require": "./dist/constants.cjs.js"
|
||||||
},
|
|
||||||
"./dist": {
|
|
||||||
"import": "./dist/index.js",
|
|
||||||
"require": "./dist/index.cjs.js"
|
|
||||||
},
|
|
||||||
"./dist/db": {
|
|
||||||
"import": "./dist/db/index.js",
|
|
||||||
"require": "./dist/db/*.cjs"
|
|
||||||
},
|
|
||||||
"./dist/db/schema": {
|
|
||||||
"import": "./dist/db/schema/index.js",
|
|
||||||
"require": "./dist/db/schema/*.cjs"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ const __dirname = path.dirname(__filename);
|
|||||||
const packagePath = path.resolve(__dirname, "../package.json");
|
const packagePath = path.resolve(__dirname, "../package.json");
|
||||||
const pkg = JSON.parse(fs.readFileSync(packagePath, "utf-8"));
|
const pkg = JSON.parse(fs.readFileSync(packagePath, "utf-8"));
|
||||||
|
|
||||||
|
pkg.main = "./dist/index.js";
|
||||||
|
|
||||||
pkg.exports = {
|
pkg.exports = {
|
||||||
".": {
|
".": {
|
||||||
import: "./dist/index.js",
|
import: "./dist/index.js",
|
||||||
@@ -21,6 +23,18 @@ pkg.exports = {
|
|||||||
import: "./dist/*",
|
import: "./dist/*",
|
||||||
require: "./dist/*.cjs",
|
require: "./dist/*.cjs",
|
||||||
},
|
},
|
||||||
|
"./dist": {
|
||||||
|
import: "./dist/index.js",
|
||||||
|
require: "./dist/index.cjs.js",
|
||||||
|
},
|
||||||
|
"./dist/db": {
|
||||||
|
import: "./dist/db/index.js",
|
||||||
|
require: "./dist/db/index.cjs.js",
|
||||||
|
},
|
||||||
|
"./dist/db/schema": {
|
||||||
|
import: "./dist/db/schema/index.js",
|
||||||
|
require: "./dist/db/schema/index.cjs.js",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
fs.writeFileSync(packagePath, JSON.stringify(pkg, null, 2));
|
fs.writeFileSync(packagePath, JSON.stringify(pkg, null, 2));
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ const packagePath = path.resolve(__dirname, "../package.json");
|
|||||||
// Leer el archivo package.json
|
// Leer el archivo package.json
|
||||||
const pkg = JSON.parse(fs.readFileSync(packagePath, "utf-8"));
|
const pkg = JSON.parse(fs.readFileSync(packagePath, "utf-8"));
|
||||||
|
|
||||||
|
pkg.main = "./src/index.ts";
|
||||||
|
|
||||||
// Modificar los exports
|
// Modificar los exports
|
||||||
pkg.exports = {
|
pkg.exports = {
|
||||||
".": "./src/index.ts",
|
".": "./src/index.ts",
|
||||||
@@ -25,19 +27,6 @@ pkg.exports = {
|
|||||||
import: "./src/constants/index.ts",
|
import: "./src/constants/index.ts",
|
||||||
require: "./dist/constants.cjs.js",
|
require: "./dist/constants.cjs.js",
|
||||||
},
|
},
|
||||||
"./dist": {
|
|
||||||
import: "./dist/index.js",
|
|
||||||
require: "./dist/index.cjs.js",
|
|
||||||
},
|
|
||||||
|
|
||||||
"./dist/db": {
|
|
||||||
import: "./dist/db/index.js",
|
|
||||||
require: "./dist/db/*.cjs",
|
|
||||||
},
|
|
||||||
"./dist/db/schema": {
|
|
||||||
import: "./dist/db/schema/index.js",
|
|
||||||
require: "./dist/db/schema/*.cjs",
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Guardar los cambios en package.json
|
// Guardar los cambios en package.json
|
||||||
|
|||||||
Reference in New Issue
Block a user