-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from losandes/feat/es-module-support
feat: adds es module support
- Loading branch information
Showing
22 changed files
with
2,057 additions
and
1,792 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# This workflow will publish the npm package when a release is created | ||
|
||
name: NPM publish | ||
|
||
on: | ||
release: | ||
# This specifies that the build will be triggered when we publish a release | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
|
||
# Run on latest version of ubuntu | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
# "ref" specifies the branch to check out. | ||
# "github.event.release.target_commitish" is a global variable and specifies the branch the release targeted | ||
ref: ${{ github.event.release.target_commitish }} | ||
# install Node.js | ||
- name: Use Node.js 18 | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 18 | ||
# Specifies the registry, this field is required for publishing below! | ||
registry-url: https://registry.npmjs.org/ | ||
|
||
- name: ENVVARS | ||
env: | ||
EVENT_CONTEXT: ${{ toJson(github.event) }} | ||
run: | | ||
git config --global user.name "losandes cicd" | ||
git config --global user.email "[email protected]" | ||
echo "node: $(node --version)" | ||
echo "npm: $(npm --version)" | ||
# echo "EVENT_CONTEXT:" | ||
# echo "$EVENT_CONTEXT" | ||
|
||
- name: Install packages | ||
run: | | ||
npm i -g pnpm | ||
pnpm install | ||
- name: Run tests | ||
env: | ||
CI: true | ||
run: pnpm run test:ci | ||
|
||
# upgrade npm version in package.json to the tag used in the release. | ||
- name: Set package version | ||
run: npm version ${{ github.event.release.tag_name }} | ||
|
||
# publish the package to NPM and set the tag name to the branch name that | ||
# the release is targeting (i.e. latest, latest-v1, etc.) | ||
# Note that npm publish commits a tag to git | ||
# alsosee: https://michaelzanggl.com/articles/github-actions-cd-setup/ | ||
- name: Publish to NPM | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: npm publish --tag ${{ github.event.release.target_commitish }} | ||
|
||
- name: Push version change to latest | ||
env: | ||
# The secret is passed automatically. Nothing to configure. | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
run: git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
How to Contribute | ||
================= | ||
|
||
## Pull Requests | ||
|
||
Generally we like to see pull requests that: | ||
|
||
- Maintain the existing code style | ||
- Include usage examples (e.g. how to use new features or before and after examples that demonstrate the change to existing features) | ||
- Are focused on a single change (i.e. avoid large refactoring or style adjustments in untouched code if not the primary goal of the pull request) | ||
- Have [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) | ||
- Have tests | ||
- Don't decrease the current code coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.