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

feat: accept ts-node tsconfig overrides #929

Merged
merged 2 commits into from
Apr 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions bin/node-pg-migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,17 @@
encoding: 'utf-8',
});
tsconfig = json5 ? json5.parse(config) : JSON.parse(config);

if (tsconfig['ts-node']) {
tsconfig = {
...tsconfig,
...tsconfig['ts-node'],
compilerOptions: {
...(tsconfig.compilerOptions ?? {}),
...(tsconfig['ts-node'].compilerOptions ?? {}),
},
};
}
} catch (err) {
console.error("Can't load tsconfig.json:", err);
}
Expand Down Expand Up @@ -526,13 +537,13 @@
}
: undefined),
},
dir: MIGRATIONS_DIR!,

Check warning on line 540 in bin/node-pg-migrate.ts

View workflow job for this annotation

GitHub Actions / Lint: node-20, ubuntu-latest

Forbidden non-null assertion
ignorePattern: IGNORE_PATTERN,
schema: SCHEMA,
createSchema: CREATE_SCHEMA,
migrationsSchema: MIGRATIONS_SCHEMA,
createMigrationsSchema: CREATE_MIGRATIONS_SCHEMA,
migrationsTable: MIGRATIONS_TABLE!,

Check warning on line 546 in bin/node-pg-migrate.ts

View workflow job for this annotation

GitHub Actions / Lint: node-20, ubuntu-latest

Forbidden non-null assertion
count,
timestamp,
file: migrationName,
Expand Down