We'd love to accept your patches and contributions to this project. There are a few small guidelines you need to follow.
Contributions to this project must be accompanied by a Developer Certificate of Origin (DCO). You (or your employer) retain the copyright to your contribution; this gives us permission to use and redistribute your contributions as part of the project. Head over to https://developercertificate.org/ to see your current agreements on file or to sign a new one.
You only need to submit a DTO once, so if you've already submitted one (even if it was for a different project), you probably don't need to do it again.
Commits to this project must follow Conventional Commits 1.0.0 specification, especially the commit message structure.
Besides, we recommend that you could use gitmoji tool in your IDE to add proper emoji prefix to each commit.
All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult GitHub Help for more information on using pull requests.
VS Code provides awesome Node.js debugging features, including the ability to automatically attach debugging to certain Node.js processes that have been launched from VS Code's Integrated Terminal.
Please refer this guide to toggle "Auto Attach" feature, and the default smart
mode is already good enough for debugging our framework.
Once set up Auto Attach, you can create some breakpoints in your codes and run npm t
in VS Code's Integrated Terminal to check whether the breakpoints work as expected.
After enabling Auto Attach, you'll need to restart your terminal. This can be done by clicking the ⚠ icon in the top right of the terminal, or just creating a new one.
All pull requests should have an associated test to ensure foward compatibility.
Make sure you have installed Dapr before running unit tests, check out Install Dapr CLI for more details
To run an individual test, you can run a command such as the following:
npm run test -- -g 'loading function'
When developing a feature locally, you can install a local version of the Functions Framework using npm link
. First compile your local clone of the Functions Framework:
You'll need to install typescript first by:
npm install typescript --save-dev
npx tsc
Then link the Functions Framework using npm link
.
npm link
You can then run the Functions Framework locally using functions-framework
.
This module is published using Release Please. When you merge a release PR, the npm package will be automatically published.
# Login to npm registry, contact repo admin for https://www.npmjs.com/ user name and password
npm login
# First run a dry run to find out errors
npm publish ./ --access public --dry-run
# Then publish the package
npm publish --access public
If the release process fails, you can revert the publish by running the following (i.e. unpublishing 1.10.0
):
# Unpublish the package (must be done within 72 hours of publishing).
# If >72 hours, deprecate a specific release and publish a newer version.
# i.e. `npm deprecate @openfunction/[email protected] "archive old version"`
# See https://docs.npmjs.com/policies/unpublish#what-to-do-if-your-package-does-not-meet-the-unpublish-criteria
npm unpublish @openfunction/[email protected]
# Set the default version to the previous working version.
npm dist-tag add @openfunction/[email protected] latest
To generate the API Extractor documentation, run the API extractor with the following command:
You'll need to install
api-extractor
first bynpm install -g @microsoft/api-extractor
and then installgts
bynpm install gts
npm run docs
The docs will be generated in docs/generated/
.
This project follows CNCF openness guidelines.