-
Notifications
You must be signed in to change notification settings - Fork 75
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
Support customization process part2 #1967
Changes from 43 commits
9d5881a
7207b5d
2b00178
ad35497
a2fc5d6
a20ce42
89ad9fc
94e79ec
890aab5
b4080b2
c03c07a
b8d60f6
ad14bd0
b58bc6a
c94ef20
8ec4ab6
1011af8
ecd3e24
3bce460
5b7f99a
47583d8
6f5ae84
0e2793c
d2477cc
d377cc0
4fb4808
298d5cc
89e8f72
cc25f84
e56e944
ecea2c0
4f7c3cb
01cf8d7
467becb
2b5698f
d5f5e7b
e22c75e
bdb342d
8c188b8
85cb4f5
0b76416
8076f8c
088c3f9
930ab6a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,16 +5,16 @@ import { Project } from "ts-morph"; | |
import { RLCModel } from "../interfaces.js"; | ||
|
||
export function buildApiExtractorConfig(model: RLCModel) { | ||
const generateMetadata = Boolean(model.options?.generateMetadata); | ||
if (!generateMetadata) { | ||
return; | ||
} | ||
const { generateTest, packageDetails } = model.options || {}; | ||
let { generateTest, packageDetails, isModularLibrary } = model.options || {}; | ||
// Take the undefined as true by default | ||
generateTest = generateTest === true || generateTest === undefined; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we have some automatical check if the tests exist or not ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do this automatical check in emitter side, https://github.com/Azure/autorest.typescript/pull/1967/files#diff-3d0e467e1b9edbc8377b86fbeaac71ce5bc0ddc8260bee5e56a777360cf19398R236-R242. In common layer we also need to check if we need to generate test relevant stuff so we have the dependency of |
||
const project = new Project(); | ||
const config = { | ||
$schema: | ||
"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | ||
mainEntryPointFilePath: `./types${generateTest ? "/src" : ""}/index.d.ts`, | ||
mainEntryPointFilePath: `./types${ | ||
generateTest || isModularLibrary ? "/src" : "" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why isModularLibrary can have impact on this mainEntryPointFilePath ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For modular the generated There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. even if we don't generate tests and samples ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is because in modular tsconfig.json we by default add below option which would always intro a src folder in dist-ems folder.
|
||
}/index.d.ts`, | ||
docModel: { | ||
enabled: true | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small fix when there is no sample folder included.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this trying to completely ignore the samples-dev folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the small fix, sample folder should be ignored if there is no samples generated.
Should not be ignored if there is samples generated.
autorest.typescript/packages/autorest.typescript/test/smoke/generated/agrifood-data-plane/package.json
Line 34 in 2b5698f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you point to me where you add this check in the codegen side ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/Azure/autorest.typescript/pull/1967/files#diff-c986168a4919c6df1a665149746b826e4876f0a438955d39d098852eec9abc53R74-R76