Skip to content
Draft
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions apps/vs-code-designer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@
"scripts": {
"build:extension": "tsup && pnpm run copyFiles",
"build:ui": "tsup --config tsup.e2e.test.config.ts",
"copyFiles": "node extension-copy-svgs.js",
"copyFiles": "node scripts/extension-copy-svgs.js",
"vscode:designer:pack": "pnpm run vscode:designer:pack:step1 && pnpm run vscode:designer:pack:step2",
"vscode:designer:pack:step1": "cd ./dist && npm install",
"vscode:designer:pack:step2": "cd ./dist && vsce package",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"test:extension-unit": "vitest run --retry=3",
"vscode:designer:e2e:ui": "pnpm run build:ui && cd dist && extest setup-and-run ../out/test/**/*.js --coverage",
"vscode:designer:e2e:headless": "pnpm run build:ui && cd dist && extest setup-and-run ../out/test/**/*.js --coverage"
"vscode:designer:e2e:headless": "pnpm run build:ui && cd dist && extest setup-and-run ../out/test/**/*.js --coverage",
"update:extension-bundle-version": "node scripts/update-extension-bundle-version.js"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const copyDoc = async (projectPath) => {
await copy('./src', `${projectPath}`, {
filter: ['LICENSE.md', 'package.json', 'README.md', 'assets/**'],
});
await copy(path.resolve(__dirname, '..', '..'), `${projectPath}`, {
await copy(path.resolve(__dirname, '..'), `${projectPath}`, {
filter: ['CHANGELOG.md'],
});
};
Expand Down
41 changes: 41 additions & 0 deletions apps/vs-code-designer/scripts/update-extension-bundle-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env node
/* eslint-disable no-undef */
const fs = require('fs/promises');
const path = require('path');

async function main() {
const version = process.argv[2];
if (!version) {
console.error('Usage: node scripts/update-extension-bundle-version.js <version>');
process.exitCode = 1;
return;
}

const constantsPath = path.resolve(__dirname, '../src/constants.ts');
const dockerfilePath = path.resolve(__dirname, '../src/container/Dockerfile');

await updateFile(
constantsPath,
/export const EXTENSION_BUNDLE_VERSION = ['"][^'"]+['"];\s*/,
`export const EXTENSION_BUNDLE_VERSION = '${version}';\n`
);
await updateFile(dockerfilePath, /ARG EXTENSION_BUNDLE_VERSION=[^\s]+/, `ARG EXTENSION_BUNDLE_VERSION=${version}`);

console.log(`Updated extension bundle version to ${version}`);
}

async function updateFile(filePath, regex, replacement) {
const original = await fs.readFile(filePath, 'utf8');
if (!regex.test(original)) {
throw new Error(`Could not find target pattern in ${filePath}`);
}
const updated = original.replace(regex, replacement);
if (updated !== original) {
await fs.writeFile(filePath, updated);
}
}

main().catch((err) => {
console.error(err.message || err);
process.exitCode = 1;
});

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import type { CustomLocation } from '@microsoft/vscode-azext-azureappservice';
import { LocationListStep } from '@microsoft/vscode-azext-azureutils';
import { AzureWizardExecuteStep, nonNullOrEmptyValue, nonNullProp } from '@microsoft/vscode-azext-utils';
import type { ILogicAppWizardContext, ConnectionStrings } from '@microsoft/vscode-extension-logic-apps';
import { StorageOptions, FuncVersion, WorkerRuntime } from '@microsoft/vscode-extension-logic-apps';
import { StorageOptions, WorkerRuntime } from '@microsoft/vscode-extension-logic-apps';
import type { Progress } from 'vscode';

export class LogicAppCreateStep extends AzureWizardExecuteStep<ILogicAppWizardContext> {
Expand Down Expand Up @@ -191,18 +191,7 @@ export class LogicAppCreateStep extends AzureWizardExecuteStep<ILogicAppWizardCo
);
}

if (context.version === FuncVersion.v1) {
appSettings.push({
name: 'AzureWebJobsDashboard',
value: storageConnectionString.azureWebJobsDashboardValue,
});
}

if (
context.newSiteOS === WebsiteOS.windows &&
runtimeWithoutVersion.toLowerCase() === WorkerRuntime.Node &&
context.version !== FuncVersion.v1
) {
if (context.newSiteOS === WebsiteOS.windows && runtimeWithoutVersion.toLowerCase() === WorkerRuntime.Node) {
// Linux doesn't need this because it uses linuxFxVersion
// v1 doesn't need this because it only supports one version of Node
appSettings.push({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { latestGAVersion, ProjectLanguage, ProjectType, TargetFramework } from '
import type { ILaunchJson, ISettingToAdd, IWebviewProjectContext } from '@microsoft/vscode-extension-logic-apps';
import {
assetsFolderName,
containerTemplatesFolderName,
deploySubpathSetting,
devContainerFileName,
devContainerFolderName,
extensionCommand,
extensionsFileName,
funcVersionSetting,
Expand Down Expand Up @@ -53,13 +56,19 @@ export async function writeExtensionsJson(context: IActionContext, vscodePath: s
await fse.copyFile(templatePath, extensionsJsonPath);
}

export async function writeTasksJson(context: IActionContext, vscodePath: string): Promise<void> {
export async function writeTasksJson(context: IWebviewProjectContext, vscodePath: string): Promise<void> {
const tasksJsonPath: string = path.join(vscodePath, tasksFileName);
const tasksJsonFile = 'TasksJsonFile';
const tasksJsonFile = context.isDevContainerProject ? 'DevContainerTasksJsonFile' : 'TasksJsonFile';
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there support for working on a 'dev container project' without dev containers, i.e. using the existing solution as a fallback?

const templatePath = path.join(__dirname, assetsFolderName, workspaceTemplatesFolderName, tasksJsonFile);
await fse.copyFile(templatePath, tasksJsonPath);
}

export async function writeDevContainerJson(devContainerPath: string): Promise<void> {
const devContainerJsonPath: string = path.join(devContainerPath, devContainerFileName);
const templatePath = path.join(__dirname, assetsFolderName, containerTemplatesFolderName, devContainerFileName);
await fse.copyFile(templatePath, devContainerJsonPath);
}

export function getDebugConfiguration(logicAppName: string, customCodeTargetFramework?: TargetFramework): DebugConfiguration {
if (customCodeTargetFramework) {
return {
Expand Down Expand Up @@ -129,3 +138,14 @@ export async function createLogicAppVsCodeContents(
myWebviewProjectContext.targetFramework as TargetFramework
);
}

export async function createDevContainerContents(
myWebviewProjectContext: IWebviewProjectContext,
logicAppFolderPath: string
): Promise<void> {
if (myWebviewProjectContext.isDevContainerProject) {
const devContainerPath: string = path.join(logicAppFolderPath, devContainerFolderName);
await fse.ensureDir(devContainerPath);
await writeDevContainerJson(devContainerPath);
}
}
Loading
Loading