Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Commit 7282ecc

Browse files
authored
feat: Support for .NET Core Function Apps (#449)
* feat: Support for .NET Core Function Apps * Added support for offline service
1 parent c5c44c9 commit 7282ecc

34 files changed

+603
-210
lines changed

package-lock.json

Lines changed: 143 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@
6666
"request": "^2.81.0",
6767
"rimraf": "^2.7.1",
6868
"semver": "^6.3.0",
69-
"xml2js": "^0.4.22"
69+
"xml2js": "^0.4.22",
70+
"zip-folder": "^1.0.0"
7071
},
7172
"devDependencies": {
7273
"@azure/ms-rest-js": "^1.8.7",
@@ -85,7 +86,7 @@
8586
"axios-mock-adapter": "^1.16.0",
8687
"babel-jest": "^24.8.0",
8788
"babel-preset-react-app": "^9.0.0",
88-
"clvr": "^0.3.6",
89+
"clvr": "^0.3.8",
8990
"conventional-changelog-cli": "^2.0.23",
9091
"eslint": "^5.16.0",
9192
"jest": "^24.8.0",

src/armTemplates/resources/apim.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ApimResource } from "./apim";
22
import { ServerlessAzureConfig } from "../../models/serverless";
33
import md5 from "md5";
4-
import { configConstants } from "../../config/constants";
4+
import { constants } from "../../shared/constants";
55
import { Runtime } from "../../config/runtime";
66

77
describe("APIM Resource", () => {
@@ -13,7 +13,7 @@ describe("APIM Resource", () => {
1313
it("generates the correct resource name", () => {
1414
const resourceGroupHash = md5(resourceGroupName).substr(
1515
0,
16-
configConstants.resourceGroupHashLength
16+
constants.resourceGroupHashLength
1717
);
1818

1919
const config: ServerlessAzureConfig = {

src/armTemplates/resources/appInsights.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { AppInsightsResource } from "./appInsights";
22
import { ServerlessAzureConfig } from "../../models/serverless";
33
import md5 from "md5";
4-
import { configConstants } from "../../config/constants";
4+
import { constants } from "../../shared/constants";
55
import { Runtime } from "../../config/runtime";
66

77
describe("App Insights Resource", () => {
@@ -13,7 +13,7 @@ describe("App Insights Resource", () => {
1313
it("generates the correct resource name", () => {
1414
const resourceGroupHash = md5(resourceGroupName).substr(
1515
0,
16-
configConstants.resourceGroupHashLength
16+
constants.resourceGroupHashLength
1717
);
1818

1919
const config: ServerlessAzureConfig = {

src/armTemplates/resources/appServicePlan.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { AppServicePlanResource } from "./appServicePlan";
22
import { ServerlessAzureConfig } from "../../models/serverless";
33
import md5 from "md5";
4-
import { configConstants } from "../../config/constants";
4+
import { constants } from "../../shared/constants";
55
import { Runtime, FunctionAppOS } from "../../config/runtime";
66

77
describe("App Service Plan Resource", () => {
@@ -25,7 +25,7 @@ describe("App Service Plan Resource", () => {
2525
it("generates the correct resource name", () => {
2626
const resourceGroupHash = md5(resourceGroupName).substr(
2727
0,
28-
configConstants.resourceGroupHashLength
28+
constants.resourceGroupHashLength
2929
);
3030

3131
const config: ServerlessAzureConfig = {

src/armTemplates/resources/functionApp.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { dockerImages, getRuntimeLanguage, getRuntimeVersion, FunctionAppOS, isNodeRuntime, Runtime, RuntimeLanguages } from "../../config/runtime";
1+
import { dockerImages, getRuntimeLanguage, getRuntimeVersion, FunctionAppOS, isNodeRuntime, Runtime, RuntimeLanguage } from "../../config/runtime";
22
import { ArmParameter, ArmParameters, ArmParamType, ArmResourceTemplate, ArmResourceTemplateGenerator, DefaultArmParams } from "../../models/armTemplates";
33
import { FunctionAppConfig, ServerlessAzureConfig } from "../../models/serverless";
44
import { AzureNamingService, AzureNamingServiceOptions } from "../../services/namingService";
@@ -256,7 +256,7 @@ export class FunctionAppResource implements ArmResourceTemplateGenerator {
256256

257257
private getFunctionWorkerRuntime(runtime: Runtime): string {
258258
const language = getRuntimeLanguage(runtime);
259-
if (language === RuntimeLanguages.NODE){
259+
if (language === RuntimeLanguage.NODE){
260260
return "node";
261261
}
262262
return language;

src/armTemplates/resources/hostingEnvironment.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { HostingEnvironmentResource } from "./hostingEnvironment";
22
import { ServerlessAzureConfig } from "../../models/serverless";
33
import md5 from "md5";
4-
import { configConstants } from "../../config/constants";
4+
import { constants } from "../../shared/constants";
55
import { Runtime } from "../../config/runtime";
66

77
describe("Azure Hosting Environment Resource", () => {
@@ -13,7 +13,7 @@ describe("Azure Hosting Environment Resource", () => {
1313
it("generates the correct resource name", () => {
1414
const resourceGroupHash = md5(resourceGroupName).substr(
1515
0,
16-
configConstants.resourceGroupHashLength
16+
constants.resourceGroupHashLength
1717
);
1818

1919
const config: ServerlessAzureConfig = {

src/armTemplates/resources/storageAccount.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { configConstants } from "../../config/constants";
1+
import { constants } from "../../shared/constants";
22
import { ArmParameters, ArmParamType, ArmResourceTemplate, ArmResourceTemplateGenerator, DefaultArmParams, ArmParameter } from "../../models/armTemplates";
33
import { ResourceConfig, ServerlessAzureConfig } from "../../models/serverless";
44
import { AzureNamingService, AzureNamingServiceOptions } from "../../services/namingService";
@@ -18,7 +18,7 @@ export class StorageAccountResource implements ArmResourceTemplateGenerator {
1818
};
1919
return AzureNamingService.getSafeResourceName({
2020
...options,
21-
maxLength: configConstants.naming.maxLength.storageAccount
21+
maxLength: constants.naming.maxLength.storageAccount
2222
});
2323
}
2424

src/armTemplates/resources/virtualNetwork.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { VirtualNetworkResource } from "./virtualNetwork";
22
import { ServerlessAzureConfig } from "../../models/serverless";
33
import md5 from "md5";
4-
import { configConstants } from "../../config/constants";
4+
import { constants } from "../../shared/constants";
55
import { Runtime } from "../../config/runtime";
66

77
describe("Virtual Network Resource", () => {
@@ -13,7 +13,7 @@ describe("Virtual Network Resource", () => {
1313
it("generates the correct resource name", () => {
1414
const resourceGroupHash = md5(resourceGroupName).substr(
1515
0,
16-
configConstants.resourceGroupHashLength
16+
constants.resourceGroupHashLength
1717
);
1818

1919
const config: ServerlessAzureConfig = {

src/config/cliCommandFactory.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { CliCommandFactory, CliCommand } from "./cliCommandFactory"
2+
3+
describe("Cli Command Factory", () => {
4+
it("registers a CLI command", () => {
5+
const testCommand: CliCommand = {
6+
command: "testCommand",
7+
args: [ "test", "args" ],
8+
}
9+
const factory = new CliCommandFactory();
10+
factory.registerCommand("test", testCommand);
11+
const result = factory.getCommand("test");
12+
expect(result.command).toEqual(testCommand.command);
13+
expect(result.args).toEqual(testCommand.args);
14+
});
15+
});

0 commit comments

Comments
 (0)