If you'd like to contribute to this repository, please read the following guidelines. Contributors are more than welcome to share their learnings with others in this centralized location.
This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
Remember that this repository is maintained by community members who volunteer their time to help. Be courteous and patient.
Please do not open GitHub issues for general support questions as the GitHub list should be used for feature requests and bug reports. This way we can more easily track actual issues or bugs from the code and keep the general discussion separate from the actual code.
If you have questions about how to use Power Fx or any of the provided samples, please use the following locations.
Whenever you submit any changes to the Power Fx sample repositories, please follow these recommendations.
- Always fork the repository to your own account before making your modifications
- Do not combine multiple changes to one pull request. For example, submit any samples and documentation updates using separate PRs
- If your pull request shows merge conflicts, make sure to update your local main to be a mirror of what's in the main repo before making your modifications
- If you are submitting multiple samples, please create a specific PR for each of them
- If you are submitting typo or documentation fix, you can combine modifications to single PR where suitable
When you submit a new sample, please follow these guidelines:
- Each sample must be placed in a folder under the
samples
folder - Your sample folder must include the following content:
- A
sourcecode
containing the unpacked solution - An
assets
folder, containing screenshots - A
README.md
file
- A
- You must only submit samples for which you have the rights to share. Make sure that you asked for permission from your employer and/or clients before committing the code to an open-source repository, because once you submit a pull request, the information is public and cannot be removed.
- When submitting a new sample solution, please name the sample solution folder accordingly
- Do not use words such as
sample
,powerfx
orfunction
in the folder or sample name - this is the repository for Power Fx sample functions - Do not use period/dot in the folder name of the provided sample
- For security reasons, we do not accept pull requests containing
.msapp
files. We only accept source code files for applications. We will review the source code and will pack the.msapp
only from reviewed code. - You can extract source code files using these instructions.
- Make sure to place the root of your solution's source code in the
sourcecode
folder (i.e.: yoursourcecode
folder should include aCanvasManifest.json
,Src
folder,pkgs
folder, etc.)
- You will need to have a
README.md
file for your contribution, which is based on the provided template under thesamples
folder. Please copy this template to your project and update it accordingly. YourREADME.md
must be named exactlyREADME.md
-- with capital letters -- as this is the information we use to make your sample public. - You will need to have a screenshot picture of your sample in action in the
README.md
file ("pics or it didn't happen"). The preview image must be located in theassets
folder in the root of your sample folder.- All screen shots must be located in the
assets
folder. Do not point to your own repository or any other external source
- All screen shots must be located in the
- The
README
template contains a specific tracking image at the bottom of the file with animg
tag, where thesrc
attribute points tohttps://telemetry.sharepointpnp.com/powerfx-samples/samples/readme-template
. This is a transparent image which is used to track viewership of individual samples in GitHub.- Update the image
src
attribute according with the repository name and folder information.
- Update the image
- If you find an existing sample which is similar to yours, please extend the existing one rather than submitting a new similar sample
- When you update existing samples, please update also
README.md
file accordingly with information on provided changes and with your author details
- When you update existing samples, please update also
- Make sure to document each function in the
README.md
- Make sure to use Power Fx known data types when describing data types
- If you include your social media information under Authors in the Solution section, we'll use this information to promote your contribution on social media, blog posts, and community calls.
- Try to use the following syntax:
folder name | Author Name ([@yourtwitterhandle](https://twitter.com/yourtwitterhandle))
- If you include your company name after your name, we'll try to include your company name in blog posts and community calls.
- Try to use the following syntax:
folder name | Author Name ([@yourtwitterhandle](https://twitter.com/yourtwitterhandle)), Company Name
- For multiple authors, please provide one line per author
- If you prefer to not use social media or disclose your name, we'll still accept your sample, but we'll assume that you don't want us to promote your contribution on social media.
- To help people make sense of your sample, make sure to always include at least one screenshot of your solution in action. We know it's a little harder to do with Power Fx, but people are more likely to click on a sample if they can preview it before installing it.
- Please provide a high-quality screenshot
- If possible, use a resolution of 1920x1080
- You can add as many screen shots as you'd like to help users understand your sample without having to download it and install it.
- You can include animated images (such as
.gif
files), but you must provide at least one static.png
file
If you aren't familiar with how to contribute to open-source repositories using GitHub, or if you find the instructions on this page confusing, sign up for one of our Sharing is Caring events. It's completely free, and we'll guide you through the process.
Here's a high-level process for submitting new samples or updates to existing ones.
- Sign the Contributor License Agreement (see below)
- Fork this repository pnp/powerfx-samples to your GitHub account
- Create a new branch from the
main
branch for your fork for the contribution - Include your changes to your branch
- Commit your changes using descriptive commit message * These are used to track changes on the repositories for monthly communications
- Create a pull request in your own fork and target the
main
branch - Fill up the provided PR template with the requested details
Before you submit your pull request consider the following guidelines:
-
Search GitHub for an open or closed Pull Request which relates to your submission. You don't want to duplicate effort.
-
Make sure you have a link in your local cloned fork to the pnp/powerfx-samples:
# check if you have a remote pointing to the Microsoft repo: git remote -v # if you see a pair of remotes (fetch & pull) that point to https://github.com/pnp/powerfx-samples, you're ok... otherwise you need to add one # add a new remote named "upstream" and point to the Microsoft repo git remote add upstream https://github.com/pnp/powerfx-samples.git
-
Make your changes in a new git branch:
git checkout -b mycustomfunction main
-
Ensure your fork is updated and not behind the upstream powerfx-samples repo. Refer to these resources for more information on syncing your repo:
-
Keep Your Forked Git Repo Updated with Changes from the Original Upstream Repo
-
For a quick cheat sheet:
# assuming you are in the folder of your locally cloned fork.... git checkout main # assuming you have a remote named `upstream` pointing official **powerfx-samples** repo git fetch upstream # update your local main to be a mirror of what's in the main repo git pull --rebase upstream main # switch to your branch where you are working, say "mycustomfunction" git checkout mycustomfunction # update your branch to update it's fork point to the current tip of main & put your changes on top of it git rebase main
-
Push your branch to GitHub:
git push origin mycustomfunction
If the sample you wish to contribute is stored in your own GitHub repository, you can use the following steps to merge it with this repository:
-
Fork the
powerfx-samples
repository from GitHub -
Create a local git repository
md powerfx-samples cd powerfx-samples git init
-
Pull your forked copy of
powerfx-samples
into your local repositorygit remote add origin https://github.com/yourgitaccount/powerfx-samples.git git pull origin main
-
Pull your other project from GitHub into the
samples
folder of your local copy ofpowerfx-samples
git subtree add --prefix=samples/projectname https://github.com/yourgitaccount/projectname.git main
-
Push the changes up to your forked repository
git push origin main
Before we can accept your pull requests you will be asked to sign electronically Contributor License Agreement (CLA), which is a pre-requisite for any contributions all PnP repositories. This will be one-time process, so for any future contributions you will not be asked to re-sign anything. After the CLA has been signed, our PnP core team members will have a look at your submission for a final verification of the submission. Please do not delete your development branch until the submission has been closed.
You can find Microsoft CLA from the following address - https://cla.microsoft.com.
Thank you for your contribution.
Sharing is caring.