Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -288,7 +288,7 @@ export class FunctionAppFilesStep extends AzureWizardPromptStep<IProjectWizardCo
tasks: [
{
label: 'build',
command: '${config:azureLogicAppsStandard.dotnetBinaryPath}',
command: 'dotnet',
type: 'process',
args: ['build', '${workspaceFolder}'],
group: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,25 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { binariesExist } from '../../../utils/binaries';
import { extensionCommand, func, funcDependencyName, funcWatchProblemMatcher, hostStartCommand } from '../../../../constants';
import { extensionCommand, funcWatchProblemMatcher } from '../../../../constants';
import { InitCustomCodeScriptProjectStep } from './initCustomCodeScriptProjectStep';
import type { ITaskInputs, ISettingToAdd } from '@microsoft/vscode-extension-logic-apps';
import type { TaskDefinition } from 'vscode';

export class InitCustomCodeProjectStep extends InitCustomCodeScriptProjectStep {
protected getTasks(): TaskDefinition[] {
const funcBinariesExist = binariesExist(funcDependencyName);
const binariesOptions = funcBinariesExist
? {
options: {
env: {
PATH: '${config:azureLogicAppsStandard.autoRuntimeDependenciesPath}\\NodeJs;${config:azureLogicAppsStandard.autoRuntimeDependenciesPath}\\DotNetSDK;$env:PATH',
},
},
}
: {};
return [
{
label: 'generateDebugSymbols',
command: '${config:azureLogicAppsStandard.dotnetBinaryPath}',
command: 'dotnet',
args: ['${input:getDebugSymbolDll}'],
type: 'process',
problemMatcher: '$msCompile',
},
{
type: funcBinariesExist ? 'shell' : func,
command: funcBinariesExist ? '${config:azureLogicAppsStandard.funcCoreToolsBinaryPath}' : hostStartCommand,
args: funcBinariesExist ? ['host', 'start'] : undefined,
...binariesOptions,
type: 'shell',
command: 'func',
args: ['host', 'start'],
problemMatcher: funcWatchProblemMatcher,
isBackground: true,
label: 'func: host start',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export abstract class InitCustomCodeProjectStepBase extends AzureWizardExecuteSt
"tasks": [
{
"label": "generateDebugSymbols",
"command": '\${config:azureLogicAppsStandard.dotnetBinaryPath}',
"command": 'dotnet',
"args": [
"\${input:getDebugSymbolDll}"
],
Expand All @@ -132,7 +132,7 @@ export abstract class InitCustomCodeProjectStepBase extends AzureWizardExecuteSt
},
{
"type": "shell",
"command":"\${config:azureLogicAppsStandard.funcCoreToolsBinaryPath}",
"command":"func",
"args" : ["host", "start"],
"options": {
"env": {
Expand Down
Loading
Loading