Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove excess logs #111

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/migrate/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export async function migrateDev(project: Project, modules: Module[], opts: Migr
modules,
async ({ databaseUrl, module, tempDir, generatedClientDir }) => {
// Generate migrations & client
console.log("Generating migrations");
const status = await new Deno.Command("deno", {
args: [
"run",
Expand Down Expand Up @@ -72,15 +71,13 @@ export async function migrateDev(project: Project, modules: Module[], opts: Migr
})();

// Compile the ESM library
console.log("Compiling ESM library");
buildPrismaPackage(
generatedClientDir,
join(generatedClientDir, "esm.js"),
);
}

// Copy back migrations dir
console.log("Copying migrations back");
const tempMigrationsDir = join(tempDir, "migrations");
const migrationsDir = join(module.path, "db", "migrations");
if (await exists(tempMigrationsDir)) {
Expand Down
3 changes: 0 additions & 3 deletions src/migrate/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,10 @@ export async function forEachPrismaSchema(
);

// Duplicate db directory
console.log("Copying", dbDir, "to", tempDir);
await copy(dbDir, tempDir, { overwrite: true });

// TODO: This causes a weird error
// // Write package.json
// console.log('Writing package.json');
// const packageJsonPath = join(tempDir, "package.json");
// const packageJson = JSON.stringify({
// "devDependencies": {
Expand All @@ -91,7 +89,6 @@ export async function forEachPrismaSchema(
// await Deno.writeTextFile(packageJsonPath, packageJson);

// Append generator config
console.log("Appending code to schema.prisma");
const tempSchemaPath = join(tempDir, "schema.prisma");
let schema = await Deno.readTextFile(tempSchemaPath);
schema += `
Expand Down
1 change: 0 additions & 1 deletion src/migrate/reset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { forEachPrismaSchema } from "./mod.ts";
export async function migrateReset(project: Project) {
await forEachPrismaSchema(project, [...project.modules.values()], async ({ databaseUrl, tempDir }) => {
// Generate migrations & client
console.log("Generating migrations");
const status = await new Deno.Command("deno", {
args: [
"run",
Expand Down
2 changes: 1 addition & 1 deletion src/project/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface LoadProjectOpts {
export async function loadProject(opts: LoadProjectOpts): Promise<Project> {
const projectRoot = join(Deno.cwd(), opts.path ?? ".");

console.log("Loading project", projectRoot);
// console.log("Loading project", projectRoot);

// Read project config
const projectConfig = await readProjectConfig(
Expand Down
1 change: 0 additions & 1 deletion src/runtime/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export function serverHandler<RegistryT>(runtime: Runtime<RegistryT>): Deno.Serv
info: Deno.ServeHandlerInfo,
): Promise<Response> => {
const url = new URL(req.url);
console.log("url", url.pathname);

const moduleCall = /^\/modules\/(\w+)\/scripts\/(\w+)\/call\/?$/;
if (req.method == "POST" && moduleCall.test(url.pathname)) {
Expand Down
1 change: 0 additions & 1 deletion src/sdk/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export async function generate(path?: string) {
name: string,
config: Generator,
) {
console.log("Generating", name);
const { success } = await new Deno.Command("docker", {
args: [
"run",
Expand Down