Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank1513 committed Feb 21, 2024
0 parents commit d95d336
Show file tree
Hide file tree
Showing 129 changed files with 4,314 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": []
}
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: [mayank1513] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
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:
packages: write
contents: write
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-node@v3
with:
registry-url: https://registry.npmjs.org
node-version: 20
- 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 -w
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: Setup Git
run: |
git config --global user.name "mayank1513"
git config --global user.email "[email protected]"
git fetch
git checkout main
- name: Save upgraded packages back to repo
run: git add . && git commit -m "upgrade deps && docs" && git push origin main
57 changes: 57 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Publish to NPM

# publish only when package json has changed - assuming version upgrade
on:
push:
branches: [main]
paths: "lib/fork-me/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:
packages: write
contents: write
id-token: write

defaults:
run:
working-directory: ./lib/fork-me

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

- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org
- 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: Create release and publish to NPM
run: pnpm build && pnpm publish-package
# continue on error to publish scoped package name <- by default repo is setup for a non-scoped + scoped package name
continue-on-error: true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.event.repository.owner.login }}
REPO: ${{ github.event.repository.name }}

- name: Publish Scoped package to NPM
# continue on error - expecing npm to trow error if scoping is done twice
continue-on-error: true
id: publish_scoped
run: cd dist && node ../scope.js && npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.event.repository.owner.login }}
REPO: ${{ github.event.repository.name }}
29 changes: 29 additions & 0 deletions .github/workflows/setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: setup repo

on:
create:

jobs:
setup:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Git and create PR
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: chmod +x ./setup.sh && (sudo bash ./setup.sh ${{ github.event.repository.owner.login }} ${{ github.event.repository.name }} || ./setup.sh ${{ github.event.repository.owner.login }} ${{ github.event.repository.name }})
- name: Push changes back to repo
run: |
git add .
git commit -m 'Rebrand 💖 <a href="https://mayank-chaudhari.vercel.app" target="_blank">Mayank Kumar Chaudhari</a> [skip ci]'
git push origin main
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: test

on:
push:
pull_request:
schedule:
- cron: "5 */8 * * *"
jobs:
test:
if: github.run_number != 1
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
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@v3
with:
directory: ./lib/fork-me
token: ${{ secrets.CODECOV_TOKEN }}
flags: fork-me
- uses: paambaati/[email protected]
continue-on-error: true
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: ./lib/fork-me/coverage/*.xml:clover
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
.pnp
.pnp.js

# testing
coverage

# next.js
.next/
out/
build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# turbo
.turbo

# vercel
.vercel

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

# ignore hbs files as prettier removes all spaces and makes it ugly
*hbs
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"singleQuote": false,
"printWidth": 100,
"tabWidth": 2,
"arrowParens": "avoid",
"jsxBracketSameLine": true,
"bracketSameLine": true,
"useTabs": true
}
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["esbenp.prettier-vscode", "mayank1513.trello-kanban-task-board"]
}
31 changes: 31 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
// Formatting using Prettier by default for all languages
"editor.defaultFormatter": "esbenp.prettier-vscode",
// Formatting using Prettier for JavaScript, overrides VSCode default.
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},

// Ensure enough terminal history is preserved when running tests.
"terminal.integrated.scrollback": 10000,

// Configure todo-tree to exclude node_modules, dist, and compiled.
"todo-tree.filtering.excludeGlobs": ["**/node_modules", "**/dist", "**/compiled"],
// Match TODO-APP in addition to other TODOs.
"todo-tree.general.tags": ["BUG", "HACK", "FIXME", "TODO", "XXX", "[ ]", "[x]", "TODO-APP"],

// Disable TypeScript surveys.
"typescript.surveys.enabled": false,

"grammarly.selectors": [
{
"language": "markdown",
"scheme": "file"
}
],
"editor.tabSize": 2,
"editor.wordWrap": "on",
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.formatOnSaveMode": "file"
}
Loading

0 comments on commit d95d336

Please sign in to comment.