-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Add separate compiler option for generated declarations output directory. #6723
Comments
Didn't come up with a name, but we'd take a PR on this. Should be easy enough. |
@RyanCavanaugh I think I've narrowed it down to some fooling around that needs to be done here: https://github.com/Microsoft/TypeScript/blob/a324176102b4657b4de6759b5d03f5eeda38f422/src/compiler/utilities.ts#L2070. Some questions though... What organization should be followed inside the declarations folder? Do I just remove the Also, how would I write a test to check where declaration files end up? |
the logic should map to that of --outDir today. for tests just add compliler tests, with flags as "@" comments (see https://github.com/Microsoft/TypeScript/blob/master/tests/cases/compiler/outModuleConcatAmd.ts) the output will have the file name in it |
@mhegazy It seems the generated JS file from the test doesn't contain any artifact that lets you see where the file ends up relative to the project root. E.g. the JS file generated for the following test: // @allowJs: true,map
// @sourcemap: true
// @outdir: out
// @filename: a.ts
class c {
}
// @filename: b.js.map
function foo() {
}
// @filename: b.js
function bar() {
} is: //// [tests/cases/compiler/jsFileCompilationWithMapFileAsJsWithOutDir.ts] ////
//// [a.ts]
class c {
}
//// [b.js.map]
function foo() {
}
//// [b.js]
function bar() {
}
//// [a.js]
var c = (function () {
function c() {
}
return c;
}());
//# sourceMappingURL=a.js.map There's no mention of the |
my bad. that would be the project tests: e.g: https://github.com/Microsoft/TypeScript/blob/master/tests/cases/project/rootDirectory.json, and the output should be in https://github.com/Microsoft/TypeScript/tree/master/tests/baselines/reference/project/rootDirectory/node |
@mhegazy Thanks. This is slightly off topic, but it looks like the test harness stops emitting as soon as it detects a single difference between the local and reference baselines. This means you have to run the testcase until it chokes, copy the mismatched file to the reference folder, run it again until it finds the next difference, and so on. Is this by design? |
@masaeedu the tests keep running when they detect differences. Afterwards you can run |
I couldn't figure it out from reading the above comments but will there be a similar "declarationOutFile" which will concatenate all the definitions into one? Something akin to what https://github.com/SitePen/dts-generator is doing? |
@ca0v There isn't a declarationOutFile yet (although this was discussed on the PR). You can file an issue if you need it. |
I need to make an automated building of my typescript projects. Typescript compilation results (i.e .js and .d.ts files) need further separate processing.
It would be nice if there is separate compilation option to specify output directory for generated declarations. Something like this:
The text was updated successfully, but these errors were encountered: