npm package: @heroku/functions-core
Description: This is a shared library for interacting with Salesforce Functions from the following:
Latest version: 0.7.5

# @heroku/functions-core

This is a shared library for interacting with Salesforce Functions from the following:

| Used In            | Project                                                                                                                                 | Documentation                                                                           |
|--------------------|-----------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
| Salesforce CLI     | [@salesforce/plugin-functions](https://github.com/salesforcecli/plugin-functions/blob/main/package.json)                                | https://developer.salesforce.com/tools/sfdxcli                                          |
| Visual Studio Code | [salesforcedx-vscode-core](https://github.com/forcedotcom/salesforcedx-vscode/blob/main/packages/salesforcedx-vscode-core/package.json) | https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode-core |

Currently, this library exposes:

- `generateProject`
- `generateFunction`
- a custom error class (`FunctionsError`).
- `LocalRun` a class for running functions on the local host.
- `runFunction` for sending data to a running function.

## Build

```shell
$ yarn build
```

## Run Validations

```shell
$ yarn test
$ yarn lint
```

## Publishing

1. Open a PR to bump the `version` field in `package.json`
2. Merge the PR once the Languages Team approves
3. Run `npm publish` to publish the library (this step must be performed using `npm` and not `yarn`)
4. Run `git tag -a v{VERSION} -m "Released v{VERSION}" && git push --tags` to tag the release
   > Note:<br>
   > All occurrences of`{VERSION}` in the command above should be replaced with the value of `version` set in `package.json`

### Next Steps

For changes made to this library to make it into the Salesforce CLI and Visual Studio Code plugins it is necessary to
create PRs against those projects.  Steps for each related project are detailed below.

#### @salesforce/plugin-functions

1. Git clone the Functions CLI plugin project at `https://github.com/salesforcecli/plugin-functions`
2. Update [this project's package.json](https://github.com/salesforcecli/plugin-functions/blob/main/package.json) with the latest version for `@heroku/functions-core`
   > Note:<br>
   > Due to path length constraints for Windows machines the `@heroku/functions-core` package is aliased as `@hk/functions-core`
3. Regenerate the `yarn.lock` by running `yarn install`
4. Create a PR for these changes with `fix:` in the title and be sure to include in the description a reference to a work item using `@GUS-W-12345678@`
   > Note:<br>
   > The Languages Team has permission to merge and approve PRs which **only** bump this dependency
5. Once the PR is merged a bot service should:
   * bump the version
   * auto-publish the release to npm
   * tag the release in GitHub
6. **Verify the bot has performed the tasks above before moving on**
7. Git clone the Salesforce CLI project at `https://github.com/salesforcecli/cli`
8. Update [this project's package.json](https://github.com/salesforcecli/cli/blob/main/package.json) with the latest version of `@salesforce/plugin-functions`
   > Note:<br>
   > Due to path length constraints for Windows machines the `@salesforce/plugin-functions` package is aliased as `@sf/functions`
9. Regenerate the `yarn.lock` by running `yarn install`
10. Create a PR with the title `chore: bump plugin-function from {OLD_VERSION} to {NEW_VERSION}`
11. The PR must be approved by CLI team before merging

#### salesforcedx-vscode-core

1. Git clone the VSCode plugin project at `https://github.com/forcedotcom/salesforcedx-vscode`
2. Update [this project's package.json](https://github.com/forcedotcom/salesforcedx-vscode/blob/develop/packages/salesforcedx-vscode-core/package.json) with the latest version of `@heroku/functions-core`
3. Regenerate the `yarn.lock` by running `yarn install` from the project root
4. Create a PR with the title `chore: bump functions-core from {OLD_VERSION} to {NEW_VERSION}`
5. Wait for the PR to be approved and merged