Skip to content

Make FDC generated SDK prompt clearer #8920

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

Merged
merged 2 commits into from
Aug 12, 2025
Merged
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: 1 addition & 2 deletions src/init/features/dataconnect/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
connectorInfo: ConnectorInfo;
displayIOSWarning: boolean;
};
export async function doSetup(setup: Setup, config: Config): Promise<void> {

Check warning on line 38 in src/init/features/dataconnect/sdk.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing JSDoc comment
const sdkInfo = await askQuestions(setup, config);
await actuate(sdkInfo, config);
logSuccess(
Expand Down Expand Up @@ -111,20 +111,19 @@
);
if (targetPlatform === Platform.WEB) {
const unusedFrameworks = SUPPORTED_FRAMEWORKS.filter(
(framework) => !newConnectorYaml!.generate?.javascriptSdk![framework],

Check warning on line 114 in src/init/features/dataconnect/sdk.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Forbidden non-null assertion

Check warning on line 114 in src/init/features/dataconnect/sdk.ts

View workflow job for this annotation

GitHub Actions / lint (20)

This assertion is unnecessary since it does not change the type of the expression

Check warning on line 114 in src/init/features/dataconnect/sdk.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Forbidden non-null assertion
);
if (unusedFrameworks.length > 0) {
const additionalFrameworks = await checkbox<(typeof SUPPORTED_FRAMEWORKS)[number]>({
message:
"Which frameworks would you like to generate SDKs for? " +
"Press Space to select features, then Enter to confirm your choices.",
"Which frameworks would you like to generate SDKs for in addition to the TypeScript SDK? Press Enter to skip.\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The new prompt mentions a 'TypeScript SDK', but it seems a 'vanilla JavaScript SDK' is generated by default for the web platform. This is also what the pull request description mentions. To avoid confusion, could you update the prompt to refer to the 'vanilla JavaScript SDK'?

Suggested change
"Which frameworks would you like to generate SDKs for in addition to the TypeScript SDK? Press Enter to skip.\n",
"Which frameworks would you like to generate SDKs for in addition to the vanilla JavaScript SDK? Press Enter to skip.\n",

choices: SUPPORTED_FRAMEWORKS.map((frameworkStr) => ({
value: frameworkStr,
checked: newConnectorYaml?.generate?.javascriptSdk?.[frameworkStr],
})),
});
for (const framework of additionalFrameworks) {
newConnectorYaml!.generate!.javascriptSdk![framework] = true;

Check warning on line 126 in src/init/features/dataconnect/sdk.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Forbidden non-null assertion

Check warning on line 126 in src/init/features/dataconnect/sdk.ts

View workflow job for this annotation

GitHub Actions / lint (20)

This assertion is unnecessary since it does not change the type of the expression

Check warning on line 126 in src/init/features/dataconnect/sdk.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Forbidden non-null assertion

Check warning on line 126 in src/init/features/dataconnect/sdk.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Forbidden non-null assertion
}
}
}
Expand All @@ -149,7 +148,7 @@
* and short-circuit the prompt.
*
* `FDC_CONNECTOR` should have the same `<location>/<serviceId>/<connectorId>`.
* @param choices

Check warning on line 151 in src/init/features/dataconnect/sdk.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing JSDoc @param "choices" description
*/
async function chooseExistingConnector(choices: connectorChoice[]): Promise<ConnectorInfo> {
if (choices.length === 1) {
Expand All @@ -173,7 +172,7 @@
});
}

export async function generateSdkYaml(

Check warning on line 175 in src/init/features/dataconnect/sdk.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing JSDoc comment
targetPlatform: Platform,
connectorYaml: ConnectorYaml,
connectorDir: string,
Expand Down
Loading