Skip to content

Commit

Permalink
Set up monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
robingenz committed Mar 30, 2023
1 parent 6d785f2 commit dcc43f5
Show file tree
Hide file tree
Showing 22 changed files with 5,179 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
14 changes: 14 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": [
"@robingenz/changelog-github",
{ "repo": "capawesome-team/capacitor-plugins" }
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
51 changes: 51 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: 🚨 Bug report
about: Create a report to help us improve
title: "bug: "
labels: ""
assignees: ""
---

**Plugin(s):**
<!-- List the plugins and versions that this bug affects. -->



**Platform(s):**
<!-- List the platforms that this bug affects. -->



**Current behavior:**
<!-- Describe how the bug manifests. -->



**Expected behavior:**
<!-- Describe what the behavior would be without the bug. -->



**Steps to reproduce:**
<!-- Please explain the steps required to reproduce the issue. -->



**Related code:**
<!-- Code which helps to reproduce or better understand the issue. -->

```
insert short code snippets here
```

**Other information:**
<!-- List any other information that is relevant to your issue. Device information, stack traces, screenshots, related issues, etc. -->



**Capacitor doctor:**
<!-- Run `npx cap doctor` in a terminal and paste the output below. -->

```
insert the output from `npx cap doctor` here
```
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
contact_links:
- name: ❓ Support question
url: https://github.com/capawesome-team/capacitor-plugins/discussions
about: This issue tracker is not for support questions. Please post your question on GitHub Discussions.
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: ⚡️ Feature request
about: Suggest an idea for this project
title: "feat: "
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe:**
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->



**Describe the solution you'd like:**
<!-- A clear and concise description of what you want to happen. -->



**Describe alternatives you've considered:**
<!-- A clear and concise description of any alternative solutions or features you've considered. -->



**Additional context:**
<!-- Add any other context or screenshots about the feature request here. -->


6 changes: 6 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Pull request checklist

Please check if your PR fulfills the following requirements:

- [ ] The changes have been tested successfully.
- [ ] A changeset has been created (`npm run changeset`).
65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: CI

on:
push:
branches:
- main
paths-ignore:
- "**.md"
- ".vscode/**"
pull_request:
paths-ignore:
- "**.md"
- ".vscode/**"
workflow_dispatch:

env:
NODE_VERSION: 16
JAVA_VERSION: 11

jobs:
build:
name: Build
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Set up Java ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ env.JAVA_VERSION }}
- name: Install dependencies
run: npm ci
- name: Build packages affected by changes
if: github.ref != 'refs/heads/main'
run: npm run affected:verify
- name: Build all packages
if: github.ref == 'refs/heads/main'
run: npm run verify
lint:
name: Lint
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: npm ci
- name: Lint packages affected by changes
if: github.ref != 'refs/heads/main'
run: npm run affected:lint
- name: Lint all packages
if: github.ref == 'refs/heads/main'
run: npm run lint
21 changes: 21 additions & 0 deletions .github/workflows/lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Lock old issues and pull requests that are closed

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

permissions:
issues: write
pull-requests: write

concurrency:
group: lock

jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v3
with:
issue-inactive-days: '56'
20 changes: 20 additions & 0 deletions .github/workflows/needs-reply-remove.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Remove needs-reply label

on:
issue_comment:
types:
- created

permissions:
issues: write

jobs:
needs-reply:
runs-on: ubuntu-latest
if: github.event.comment.author_association != 'MEMBER'
steps:
- name: Remove needs-reply label
run: |
curl --request DELETE \
--url 'https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels/needs%3A%20reply' \
--header 'Authorization: token ${{ secrets.GITHUB_TOKEN }}'
22 changes: 22 additions & 0 deletions .github/workflows/needs-reply.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Close old issues that need reply

on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:

permissions:
issues: write

concurrency:
group: needs-reply

jobs:
needs-reply:
runs-on: ubuntu-latest
steps:
- name: Close old issues that need reply
uses: dwieeb/needs-reply@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-label: "needs: reply"
20 changes: 20 additions & 0 deletions .github/workflows/needs-triage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Add needs-triage label

on:
issues:
types:
- opened

jobs:
needs-triage:
runs-on: ubuntu-latest
steps:
- name: Add needs-triage label
if: join(github.event.issue.labels) == ''
run: |
curl --request POST \
--url 'https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels' \
--header 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/vnd.github.v3+json' \
--data-raw '{ "labels": ["needs: triage"] }'
83 changes: 83 additions & 0 deletions .github/workflows/package-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Add package label

on:
issues:
types:
- opened

jobs:
package-label:
runs-on: ubuntu-latest
steps:
- name: Add package-app-update label
if: contains(github.event.issue.body, '@capawesome/capacitor-app-update')
run: |
curl --request POST \
--url 'https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels' \
--header 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/vnd.github.v3+json' \
--data-raw '{ "labels": ["package: app-update"] }'
- name: Add package-background-task label
if: contains(github.event.issue.body, '@capawesome/capacitor-background-task')
run: |
curl --request POST \
--url 'https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels' \
--header 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/vnd.github.v3+json' \
--data-raw '{ "labels": ["package: background-task"] }'
- name: Add package-badge label
if: contains(github.event.issue.body, '@capawesome/capacitor-badge')
run: |
curl --request POST \
--url 'https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels' \
--header 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/vnd.github.v3+json' \
--data-raw '{ "labels": ["package: badge"] }'
- name: Add package-cloudinary label
if: contains(github.event.issue.body, '@capawesome/capacitor-cloudinary')
run: |
curl --request POST \
--url 'https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels' \
--header 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/vnd.github.v3+json' \
--data-raw '{ "labels": ["package: cloudinary"] }'
- name: Add package-file-picker label
if: contains(github.event.issue.body, '@capawesome/capacitor-file-picker')
run: |
curl --request POST \
--url 'https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels' \
--header 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/vnd.github.v3+json' \
--data-raw '{ "labels": ["package: file-picker"] }'
- name: Add package-managed-configurations label
if: contains(github.event.issue.body, '@capawesome/capacitor-managed-configurations')
run: |
curl --request POST \
--url 'https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels' \
--header 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/vnd.github.v3+json' \
--data-raw '{ "labels": ["package: managed-configurations"] }'
- name: Add package-photo-editor label
if: contains(github.event.issue.body, '@capawesome/capacitor-photo-editor')
run: |
curl --request POST \
--url 'https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels' \
--header 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/vnd.github.v3+json' \
--data-raw '{ "labels": ["package: photo-editor"] }'
- name: Add package-screen-orientation label
if: contains(github.event.issue.body, '@capawesome/capacitor-screen-orientation')
run: |
curl --request POST \
--url 'https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels' \
--header 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/vnd.github.v3+json' \
--data-raw '{ "labels": ["package: screen-orientation"] }'
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on:
push:
branches:
- main
paths:
- .changeset/**
workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}

env:
NODE_VERSION: 16

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install Dependencies
run: npm ci
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: npm run release
commit: "chore(release): publish"
title: "chore(release): publish"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading

0 comments on commit dcc43f5

Please sign in to comment.