-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2546ab8
Showing
30 changed files
with
922 additions
and
0 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,9 @@ | ||
{ | ||
"package": true, | ||
"output": "CHANGELOG.md", | ||
"template": "compact", | ||
"unreleased": false, | ||
"commitLimit": false, | ||
"ignoreCommitPattern": "^(?!.*\\(\\#\\d+\\)$).*", | ||
"releaseSummary": false | ||
} |
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,22 @@ | ||
# Editor configuration, see https://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.java] | ||
ij_java_imports_layout = $*, |, javax.**, java.**, |, * | ||
|
||
[*.gradle] | ||
indent_size = 4 | ||
|
||
[*.md] | ||
max_line_length = off | ||
trim_trailing_whitespace = false | ||
|
||
[Makefile] | ||
indent_size = 4 |
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,16 @@ | ||
name: build | ||
on: | ||
push: | ||
branches: [ 'main' ] | ||
pull_request: | ||
branches: [ 'main' ] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build | ||
uses: ./.github/actions/build | ||
- name: Run Build | ||
run: npm nest build | ||
|
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,9 @@ | ||
name: cache | ||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
jobs: | ||
cache_cleanup: | ||
name: Clean up cache | ||
uses: evva-sfw/workflows/.github/workflows/cache.yml@main |
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,30 @@ | ||
name: lint | ||
on: | ||
push: | ||
branches: [ 'main' ] | ||
pull_request: | ||
branches: [ 'main' ] | ||
permissions: | ||
id-token: write | ||
attestations: write | ||
jobs: | ||
lint_all: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
attestations: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
- name: Cache node_modules | ||
id: node-modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
node_modules | ||
key: node-modules | ||
- run: npm i | ||
- run: npm run lint |
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,29 @@ | ||
name: npm | ||
on: | ||
push: | ||
branches: [ 'main' ] | ||
pull_request: | ||
branches: [ 'main' ] | ||
jobs: | ||
npm_check-package-sync: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
- name: Cache node_modules | ||
id: node-modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
node_modules | ||
test-app/node_modules | ||
key: node-modules | ||
- name: NPM Install | ||
run: npm i | ||
- name: Check if git is clean | ||
uses: CatChen/check-git-status-action@v1 | ||
with: | ||
fail-if-not-clean: true |
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,80 @@ | ||
name: Release and publish to npm | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
input_version: | ||
type: choice | ||
description: What type of release? | ||
options: | ||
- patch | ||
- minor | ||
- major | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
id-token: write | ||
attestations: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ssh-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }} | ||
- name: Debug inputs | ||
run: | | ||
echo "Type of release:${{ github.event.inputs.input_version }} from user ${GITHUB_ACTOR}" | ||
git config --list | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
- name: Cache node_modules | ||
id: node-modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
node_modules | ||
test-app/node_modules | ||
.yarn/cache | ||
key: node-modules | ||
- name: Import GPG key | ||
id: import-gpg | ||
uses: crazy-max/ghaction-import-gpg@v6 | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
git_user_signingkey: true | ||
git_commit_gpgsign: true | ||
|
||
- name: GPG user IDs | ||
run: | | ||
echo "fingerprint: ${{ steps.import-gpg.outputs.fingerprint }}" | ||
echo "keyid: ${{ steps.import-gpg.outputs.keyid }}" | ||
echo "name: ${{ steps.import-gpg.outputs.name }}" | ||
echo "email: ${{ steps.import-gpg.outputs.email }}" | ||
- name: git config | ||
run: | | ||
git config user.name "${{ steps.import-gpg.outputs.name }}" | ||
git config user.email "${{ steps.import-gpg.outputs.email }}" | ||
- name: Install dependencies | ||
run: npm i | ||
|
||
- name: Authenticate with registry | ||
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Run release-it | ||
run: npx release-it ${{ github.event.inputs.input_version }} --ci | ||
env: | ||
BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} | ||
|
||
- name: Attest | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-path: '${{ github.workspace }}/*.tgz' |
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,14 @@ | ||
name: semantic | ||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
- reopened | ||
permissions: | ||
pull-requests: read | ||
jobs: | ||
semantic_pr-name: | ||
name: semantic_pr-name | ||
uses: evva-sfw/workflows/.github/workflows/semantic.yml@main |
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,16 @@ | ||
name: test | ||
on: | ||
push: | ||
branches: [ 'main' ] | ||
pull_request: | ||
branches: [ 'main' ] | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Capacitor Web | ||
uses: ./.github/actions/capacitor-setup-web | ||
- name: Run Tests | ||
run: npm run test | ||
|
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,10 @@ | ||
.DS_Store | ||
node_modules | ||
.idea | ||
.VSCode | ||
dist | ||
yarn.lock | ||
*.tsbuildinfo | ||
# Package results | ||
*.gz | ||
*.tgz |
Empty file.
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,2 @@ | ||
build | ||
dist |
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,4 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all" | ||
} |
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,87 @@ | ||
{ | ||
"$schema": "https://unpkg.com/release-it@17/schema/release-it.json", | ||
"hooks": { | ||
"after:bump": [ | ||
"rm -f *.tgz", | ||
"yarn pack --out '%s_%v.tgz'", | ||
"npx auto-changelog -c .auto-changelog" | ||
] | ||
}, | ||
"git": { | ||
"commitMessage": "chore: release ${version}", | ||
"tagName": "${version}", | ||
"commitArgs": [ | ||
"-S" | ||
], | ||
"tagArgs": [ | ||
"-s" | ||
] | ||
}, | ||
"npm": { | ||
"publish": true, | ||
"publishArgs": [ | ||
"--provenance" | ||
] | ||
}, | ||
"github": { | ||
"release": true, | ||
"assets": [ | ||
"*.tgz" | ||
], | ||
"tokenRef": "BOT_GITHUB_TOKEN" | ||
}, | ||
"plugins": { | ||
"@release-it/conventional-changelog": { | ||
"preset": { | ||
"name": "conventionalcommits", | ||
"types": [ | ||
{ | ||
"type": "feat", | ||
"section": "🎉 Features" | ||
}, | ||
{ | ||
"type": "fix", | ||
"section": "🐛 Bug Fixes" | ||
}, | ||
{ | ||
"type": "perf", | ||
"section": "⚡️ Performance Improvements" | ||
}, | ||
{ | ||
"type": "revert", | ||
"section": "⏪️ Reverts" | ||
}, | ||
{ | ||
"type": "docs", | ||
"section": "📝 Documentation" | ||
}, | ||
{ | ||
"type": "style", | ||
"section": "🎨 Styles" | ||
}, | ||
{ | ||
"type": "refactor", | ||
"section": "🔀 Code Refactoring" | ||
}, | ||
{ | ||
"type": "test", | ||
"section": "🧪 Tests" | ||
}, | ||
{ | ||
"type": "build", | ||
"section": "⚙️ Build System" | ||
}, | ||
{ | ||
"type": "ci", | ||
"section": "🚀 Continuous Integration" | ||
}, | ||
{ | ||
"type": "chore", | ||
"section": "🧹 Chore" | ||
} | ||
] | ||
}, | ||
"infile": "CHANGELOG.md" | ||
} | ||
} | ||
} |
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,36 @@ | ||
# Contributing | ||
|
||
This guide provides instructions for contributing to this Capacitor plugin. | ||
|
||
## Developing | ||
|
||
### Local Setup | ||
|
||
1. Fork and clone the repo. | ||
1. Install the dependencies. | ||
|
||
```shell | ||
npm install | ||
``` | ||
|
||
### Scripts | ||
|
||
#### `npm run build` | ||
|
||
It will compile the TypeScript code from `src/` into ESM JavaScript in `dist/`. These files are used in apps with bundlers when your plugin is imported. | ||
|
||
#### `npm run lint` / `npm run fmt` | ||
|
||
Check formatting and code quality, autoformat/autofix if possible. | ||
|
||
This template is integrated with TSLint, Prettier. Using these tools is completely optional, but strives to have consistent code style and structure for easier cooperation. | ||
|
||
## Publishing | ||
|
||
There is a `prepack` hook in `package.json` which prepares the plugin before publishing, so all you need to do is run: | ||
|
||
```shell | ||
npm publish | ||
``` | ||
|
||
> **Note**: The [`files`](https://docs.npmjs.com/cli/v7/configuring-npm/package-json#files) array in `package.json` specifies which files get published. If you rename files/directories or add files elsewhere, you may need to update it. |
Oops, something went wrong.