Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank1513 committed Jun 5, 2024
0 parents commit 8c21ae5
Show file tree
Hide file tree
Showing 242 changed files with 21,594 additions and 0 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)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["@example/*"]
}
22 changes: 22 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version = 1

test_patterns = ["**/*.test.*"]

exclude_patterns = [
"docs/**",
"**/*.test.*"
]

[[analyzers]]
name = "javascript"

[analyzers.meta]
plugins = ["react"]
environment = [
"nodejs",
"vitest",
"browser"
]

[[transformers]]
name = "prettier"
14 changes: 14 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# These are supported funding model platforms

github: [mayank1513] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
polar: mayank1513
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: [https://pages.razorpay.com/mayank1513] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Bug report
about: Create a report to help us improve
title: ""
labels: ""
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project
title: ""
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.
45 changes: 45 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Update dependencies and Docs

on:
push:
branches: [main]
schedule:
- cron: "0 */8 * * *"
jobs:
generate-docs:
if: github.event.repository.owner.login == 'react18-tools'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-node@v4
with:
registry-url: https://registry.npmjs.org
node-version: 20
- name: Setup Git
run: |
git config --global user.name "mayank1513"
git config --global user.email "[email protected]"
git fetch
git checkout main
git pull
- run: npm i -g pnpm && pnpm i
name: Install dependencies
- name: Test
run: npm test
- run: git status && git clean -f -d && git status
name: clean up working directory
- run: npx @turbo/codemod update . && pnpm update --latest -r
name: Update dependencies
- run: pnpm build
name: Build all apps to make sure it is not broken due to dependency upgrades
- name: Run unit tests
run: pnpm test
- name: Generate/update docs
run: pnpm doc
- name: Save upgraded packages back to repo
run: git add . && git commit -m "upgrade deps && docs" && git push origin main
44 changes: 44 additions & 0 deletions .github/workflows/manual-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Manually publish to NPM - Apply changeset in the workflow.

# publish only when package json has changed - assuming version upgrade
on:
workflow_dispatch:

jobs:
publish:
if: github.event.repository.owner.login == 'react18-tools'
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write

steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
- name: Setup Git
run: |
git config --global user.name "mayank1513"
git config --global user.email "[email protected]"
- run: npm i -g pnpm && pnpm i
name: Install dependencies
# fail and not publish if any of the unit tests are failing
- name: Test
run: pnpm test
- name: clean up working directory
run: git status && git clean -f -d && git status
# - name: Copy Readme file
# run: cp ./README.md ./lib # todo: uncomment this line while rebranding
- name: Apply changesets, publish and create release, branches and tags
run: node ./scripts/manual-publish.js
env:
BRANCH: ${{ github.ref_name }}
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
46 changes: 46 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish to NPM

# publish only when package json has changed - assuming version upgrade
on:
push:
branches: [main]
paths: "lib/package.json"

jobs:
publish:
# Don't run just after creating repo from template
# Also avoid running after merging set-up PR
if: github.run_number > 2 && github.event.repository.owner.login == 'react18-tools'
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write

steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
- name: Setup Git
run: |
git config --global user.name "mayank1513"
git config --global user.email "[email protected]"
- run: npm i -g pnpm && pnpm i
name: Install dependencies
# fail and not publish if any of the unit tests are failing
- name: Test
run: pnpm test
# - name: Copy Readme file
# run: cp ./README.md ./lib # will be uncommented while rebranding
- name: Apply changesets, publish and create release, branches and tags
run: node ./scripts/publish.js
env:
BRANCH: ${{ github.ref_name }}
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
37 changes: 37 additions & 0 deletions .github/workflows/setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: setup repo

on:
create:
workflow_dispatch:

jobs:
setup:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Git
run: |
git config --global user.name "Mayank Chaudhari<https://mayank-chaudhari.vercel.app>"
git config --global user.email "[email protected]"
git fetch
git checkout main
- name: Set up repo
run: |
sed -i -e "s/rebrand/postinstall/" package.json
sed -i -e "s/.*owner.*/\t\"owner\": \"${{ github.repository_owner }}\",/" ./scripts/rebrand.config.json
sed -i -e "s/.*npm_user.*/\t\"npm_user\": \"${{ github.repository_owner }}\",/" ./scripts/rebrand.config.json
sed -i -e "s/.*repo.*/\t\"repo\": \"${{ github.event.repository.name }}\",/" ./scripts/rebrand.config.json
sed -i -e "s/.*packageName.*/\t\"packageName\": \"${{ github.event.repository.name }}\"/" ./scripts/rebrand.config.json
git rm .tkb
mv ./scripts/.tkb ./.tkb
rm -rf ./docs
- name: Push changes back to repo
run: |
git add .
git commit -m 'Craete rebrand config 💖 <a href="https://mayank-chaudhari.vercel.app" target="_blank">Mayank Kumar Chaudhari</a> [skip ci]'
git push origin main
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: test

on:
push:
pull_request:
schedule:
- cron: "5 */8 * * *"
jobs:
test:
if: github.run_number != 1
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm i -g pnpm && pnpm i
name: Install dependencies
- name: Run unit tests
run: pnpm test
- name: Upload coverage reports to Codecov
continue-on-error: true
uses: codecov/codecov-action@v4
with:
directory: ./lib
token: ${{ secrets.CODECOV_TOKEN }}
- uses: paambaati/[email protected]
continue-on-error: true
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: ./lib/coverage/*.xml:clover
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.DS_Store
node_modules
.turbo
*.log
.next
dist
dist-ssr
*.local
.env
.cache

# test coverage
coverage

# temporary files
tsup.config.bundled*
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
auto-install-peers = true
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*lock.*

# ignore hbs files as prettier removes all spaces and makes it ugly
*hbs
docs
.vscode
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"singleQuote": false,
"printWidth": 100,
"tabWidth": 2,
"arrowParens": "avoid",
"jsxBracketSameLine": true,
"bracketSameLine": true
}
Loading

0 comments on commit 8c21ae5

Please sign in to comment.