Skip to content

Commit

Permalink
Prep for v4 GA 🎉 (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
ejizba authored Sep 26, 2023
1 parent 34c305a commit 6e43a2b
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 482 deletions.
24 changes: 24 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Contributing

- Clone the repository locally and open in VS Code
- Run "Extensions: Show Recommended Extensions" from the [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) and install all extensions listed under "Workspace Recommendations"
- Run `npm install`
- Run `npm run build`
- Run `npm link`
- Create or open a local function app to test with
- In the local function app:
- Run `npm link @azure/functions`. This will point your app to the local repository for the `@azure/functions` package
- Add the following settings to your "local.settings.json" file or configure them directly as environment variables
- `languageWorkers__node__arguments`: `--inspect`
> 💡 Tip: Set `logging__logLevel__Worker` to `debug` if you want to view worker-specific logs in the output of `func start`
- Start the app (i.e. run `func start` or press <kbd>F5</kbd>)
- Back in the framework repository, press <kbd>F5</kbd> and select the process for your running function app
- Before you submit a PR, run `npm test` and fix any issues. If you want to debug the tests, switch your [launch profile](https://code.visualstudio.com/docs/editor/debugging) in VS Code to "Launch Unit Tests" and press <kbd>F5</kbd>.

## Code of Conduct

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.

## Contributing to type definitions

The type definitions are located in the `types` folder. Please make sure to update the tests in `./test/types/index.test.ts` as well.
446 changes: 0 additions & 446 deletions NOTICE.html

This file was deleted.

33 changes: 4 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

|Branch|Status|Support level|Node.js Versions|
|---|---|---|---|
|v4.x|[![Build Status](https://img.shields.io/azure-devops/build/azfunc/Azure%2520Functions/145/v4.x)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=145&branchName=v4.x) [![Test Status](https://img.shields.io/azure-devops/tests/azfunc/Azure%2520Functions/146/v4.x?compact_message)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=146&branchName=v4.x)|Preview|20 (Preview), 18|
|v3.x (default)|[![Build Status](https://img.shields.io/azure-devops/build/azfunc/Azure%2520Functions/145/v3.x)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=145&branchName=v3.x) [![Test Status](https://img.shields.io/azure-devops/tests/azfunc/Azure%2520Functions/146/v3.x?compact_message)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=146&branchName=v3.x)|GA (Recommended)|20 (Preview), 18, 16, 14|
|v4.x (default)|[![Build Status](https://img.shields.io/azure-devops/build/azfunc/Azure%2520Functions/145/v4.x)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=145&branchName=v4.x) [![Test Status](https://img.shields.io/azure-devops/tests/azfunc/Azure%2520Functions/146/v4.x?compact_message)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=146&branchName=v4.x)|GA (Recommended)|20 (Preview), 18|
|v3.x|[![Build Status](https://img.shields.io/azure-devops/build/azfunc/Azure%2520Functions/145/v3.x)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=145&branchName=v3.x) [![Test Status](https://img.shields.io/azure-devops/tests/azfunc/Azure%2520Functions/146/v3.x?compact_message)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=146&branchName=v3.x)|GA|20 (Preview), 18, 16, 14|

## Install

```bash
npm install @azure/functions@preview
npm install @azure/functions
```

## Documentation
Expand All @@ -20,11 +20,11 @@ npm install @azure/functions@preview

## Considerations

- During preview, the v4 model requires you to set the app setting `AzureWebJobsFeatureFlags` to `EnableWorkerIndexing`. For more information, see [Enable v4 programming model](https://learn.microsoft.com/azure/azure-functions/functions-reference-node?pivots=nodejs-model-v4#enable-v4-programming-model).
- The Node.js "programming model" shouldn't be confused with the Azure Functions "runtime".
- _**Programming model**_: Defines how you author your code and is specific to JavaScript and TypeScript.
- _**Runtime**_: Defines underlying behavior of Azure Functions and is shared across all languages.
- The programming model version is strictly tied to the version of the [`@azure/functions`](https://www.npmjs.com/package/@azure/functions) npm package, and is versioned independently of the [runtime](https://learn.microsoft.com/azure/azure-functions/functions-versions?pivots=programming-language-javascript). Both the runtime and the programming model use "4" as their latest major version, but that is purely a coincidence.
- You can't mix the v3 and v4 programming models in the same function app. As soon as you register one v4 function in your app, any v3 functions registered in _function.json_ files are ignored.

## Usage

Expand Down Expand Up @@ -65,28 +65,3 @@ app.http('httpTrigger1', {
}
});
```

## Contributing

- Clone the repository locally and open in VS Code
- Run "Extensions: Show Recommended Extensions" from the [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) and install all extensions listed under "Workspace Recommendations"
- Run `npm install`
- Run `npm run build`
- Run `npm link`
- Create or open a local function app to test with
- In the local function app:
- Run `npm link @azure/functions`. This will point your app to the local repository for the `@azure/functions` package
- Add the following settings to your "local.settings.json" file or configure them directly as environment variables
- `languageWorkers__node__arguments`: `--inspect`
> 💡 Tip: Set `logging__logLevel__Worker` to `debug` if you want to view worker-specific logs in the output of `func start`
- Start the app (i.e. run `func start` or press <kbd>F5</kbd>)
- Back in the framework repository, press <kbd>F5</kbd> and select the process for your running function app
- Before you submit a PR, run `npm test` and fix any issues. If you want to debug the tests, switch your [launch profile](https://code.visualstudio.com/docs/editor/debugging) in VS Code to "Launch Unit Tests" and press <kbd>F5</kbd>.

### Code of Conduct

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.

### Contributing to type definitions

The type definitions are located in the `types` folder. Please make sure to update the tests in `./test/types/index.test.ts` as well.
1 change: 0 additions & 1 deletion azure-pipelines/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ jobs:
src/**
types/**
LICENSE
NOTICE.html
package.json
README.md
targetFolder: '$(Build.ArtifactStagingDirectory)'
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ parameters:
- name: NpmPublishTag
displayName: 'Tag'
type: string
default: 'preview'
default: 'latest'
- name: NpmPublishDryRun
displayName: 'Dry Run'
type: boolean
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@azure/functions",
"version": "4.0.0-alpha.13",
"version": "4.0.0",
"description": "Microsoft Azure Functions NodeJS Framework",
"keywords": [
"azure",
Expand All @@ -26,7 +26,6 @@
"types/",
"LICENSE",
"README.md",
"NOTICE.html",
"_manifest"
],
"engines": {
Expand Down
1 change: 1 addition & 0 deletions scripts/validateRelease.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function validateRelease(publishTag: string, dropPath: string): void {
expectedFormat = 'x.x.x-alpha.x';
break;
case 'latest':
case 'legacy':
regex = /^[0-9]+\.[0-9]+\.[0-9]+$/;
expectedFormat = 'x.x.x';
break;
Expand Down
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

export const version = '4.0.0-alpha.13';
export const version = '4.0.0';

export const returnBindingKey = '$return';

0 comments on commit 6e43a2b

Please sign in to comment.