Skip to content

Commit 99547e9

Browse files
authored
Minor fixes for durable in new NodeJs model (#3587)
- Show entity templates as verified - Install the preview v3 package instead of latest v2
1 parent 2c40d9c commit 99547e9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/templates/script/getScriptVerifiedTemplateIds.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function getScriptVerifiedTemplateIds(version: string): (string | RegExp)
4343

4444
// The Entity templates aren't supported in PowerShell at all, and the DurableFunctionsEntityHttpStart template is not yet supported in Python.
4545
// As a result, we need to manually create their respective regular expressions to account for these edge cases
46-
const entityRegExps = [new RegExp(`^DurableFunctionsEntity-(JavaScript|TypeScript|Python|Custom)$`, 'i'), new RegExp(`^DurableFunctionsEntityHttpStart-(JavaScript|TypeScript|Custom)$`, 'i')];
46+
const entityRegExps = [new RegExp(`^DurableFunctionsEntity-(JavaScript(-4.x)?|TypeScript(-4.x)?|Python|Custom)$`, 'i'), new RegExp(`^DurableFunctionsEntityHttpStart-(JavaScript(-4.x)?|TypeScript(-4.x)?|Custom)$`, 'i')];
4747
return regExps.concat(entityRegExps);
4848
}
4949
}

src/utils/durableUtils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ export namespace durableUtils {
193193

194194
async function installNodeDependencies(context: IFunctionWizardContext): Promise<void> {
195195
try {
196-
await cpUtils.executeCommand(ext.outputChannel, context.projectPath, 'npm', 'install', durableUtils.nodeDfPackage);
196+
const packageVersion = context.languageModel === 4 ? 'preview' : '2';
197+
await cpUtils.executeCommand(ext.outputChannel, context.projectPath, 'npm', 'install', `${durableUtils.nodeDfPackage}@${packageVersion}`);
197198
} catch (error) {
198199
const pError: IParsedError = parseError(error);
199200
const dfDepInstallFailed: string = localize('failedToAddDurableNodeDependency', 'Failed to add or install the "{0}" dependency. Please inspect and verify if it needs to be added manually.', durableUtils.nodeDfPackage);

0 commit comments

Comments
 (0)