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

Put "ts-node" object at the top of --showConfig output #1355

Merged
merged 4 commits into from Jun 6, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 12 additions & 10 deletions src/bin.ts
Expand Up @@ -213,16 +213,18 @@ export function main(
);
process.exit(1);
}
const json = ts.convertToTSConfig(
service.config,
service.configFilePath ?? join(cwd, 'ts-node-implicit-tsconfig.json'),
service.ts.sys
);
json['ts-node'] = {
...service.options,
experimentalEsmLoader: undefined,
compilerOptions: undefined,
project: service.configFilePath ?? service.options.project,
const json = {
['ts-node']: {
...service.options,
experimentalEsmLoader: undefined,
compilerOptions: undefined,
project: service.configFilePath ?? service.options.project,
},
...ts.convertToTSConfig(
service.config,
service.configFilePath ?? join(cwd, 'ts-node-implicit-tsconfig.json'),
service.ts.sys
),
};
console.log(
// Assumes that all configuration options which can possibly be specified via the CLI are JSON-compatible.
Expand Down
12 changes: 6 additions & 6 deletions src/test/index.spec.ts
Expand Up @@ -888,6 +888,12 @@ test.suite('ts-node', (test) => {
stdout,
JSON.stringify(
{
'ts-node': {
cwd: native(`${ROOT_DIR}/tests`),
projectSearchDir: native(`${ROOT_DIR}/tests`),
project: native(`${ROOT_DIR}/tests/tsconfig.json`),
require: [],
},
compilerOptions: {
target: 'es6',
jsx: 'react',
Expand All @@ -904,12 +910,6 @@ test.suite('ts-node', (test) => {
outDir: './.ts-node',
module: 'commonjs',
},
'ts-node': {
cwd: native(`${ROOT_DIR}/tests`),
projectSearchDir: native(`${ROOT_DIR}/tests`),
project: native(`${ROOT_DIR}/tests/tsconfig.json`),
require: [],
},
},
null,
2
Expand Down