Skip to content

Commit

Permalink
Scope the package
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank1513 committed Apr 8, 2024
1 parent 3fdc057 commit 6d387ce
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 135 deletions.
31 changes: 14 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# fork-me
# ForkMe

[![test](https://github.com/react18-tools/fork-me/actions/workflows/test.yml/badge.svg)](https://github.com/react18-tools/fork-me/actions/workflows/test.yml) [![Maintainability](https://api.codeclimate.com/v1/badges/aa896ec14c570f3bb274/maintainability)](https://codeclimate.com/github/react18-tools/fork-me/maintainability) [![codecov](https://codecov.io/gh/react18-tools/fork-me/graph/badge.svg)](https://codecov.io/gh/react18-tools/fork-me) [![Version](https://img.shields.io/npm/v/fork-me.svg?colorB=green)](https://www.npmjs.com/package/fork-me) [![Downloads](https://img.jsdelivr.com/img.shields.io/npm/d18m/fork-me.svg)](https://www.npmjs.com/package/fork-me) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/fork-me) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/from-referrer/)
[![test](https://github.com/react18-tools/fork-me/actions/workflows/test.yml/badge.svg)](https://github.com/react18-tools/fork-me/actions/workflows/test.yml) [![Maintainability](https://api.codeclimate.com/v1/badges/aa896ec14c570f3bb274/maintainability)](https://codeclimate.com/github/react18-tools/fork-me/maintainability) [![codecov](https://codecov.io/gh/react18-tools/fork-me/graph/badge.svg)](https://codecov.io/gh/react18-tools/fork-me) [![Version](https://img.shields.io/npm/v/@mayank1513/fork-me.svg?colorB=green)](https://www.npmjs.com/package/@mayank1513/fork-me) [![Downloads](https://img.jsdelivr.com/img.shields.io/npm/d18m/@mayank1513/fork-me.svg)](https://www.npmjs.com/package/@mayank1513/fork-me) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@mayank1513/fork-me) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/from-referrer/)

> [Featured packages built with this template.](./FEATURED.md)
> We are happy to announce that we have launched a new course to help you understand this template better [Craft Next Gen UI Libraries for React 18 and Next.js 14](https://www.udemy.com/course/craft-next-gen-ui-libraries-for-react-18-and-nextjs-14/?referralCode=46B8C7845ECCEA99E0EF)
## Features

✅ Fully Treeshakable (import from fork-me/client/component)
✅ Fully Treeshakable (import from @mayank1513/fork-me/client/component)

✅ Full TypeScript Support

Expand All @@ -21,24 +21,21 @@
## Install

```bash
$ pnpm add fork-me
$ pnpm add @mayank1513/fork-me
```

or

```bash
$ npm install fork-me
$ npm install @mayank1513/fork-me
```

or

```bash
$ yarn add fork-me
$ yarn add @mayank1513/fork-me
```




## Getting started:

Click on the `"Use this template"` button to customize it for your next JavaScript/TypeScript/React/Vue/Next.js library or project.
Expand All @@ -62,21 +59,21 @@ Compared to the default scaffold from create-turbo, this template offers:
- [ ] Please make sure `owner` is set to your <npmjs.com> username before running the above command.
- [ ] Set up `CodeCov`
- [ ] Visit codecov and setup your repo
- [ ] Create [repository secret](https://github.com/react18-tools/fork-me/settings/secrets/actions) for `CODECOV_TOKEN`
- [ ] Create [repository secret](https://github.com/react18-tools/@mayank1513/fork-me/settings/secrets/actions) for `CODECOV_TOKEN`
- [ ] Set up `CodeClimate`
- [ ] Visit CodeClimate and setup your repo
- [ ] Create [repository secret](https://github.com/react18-tools/fork-me/settings/secrets/actions) for `CC_TEST_REPORTER_ID`
- [ ] Create [repository secret](https://github.com/react18-tools/@mayank1513/fork-me/settings/secrets/actions) for `CC_TEST_REPORTER_ID`
- [ ] add `*.test.*` to ignore patterns on the website
- [ ] update code climate badge
- [ ] Add `NPM_AUTH_TOKEN` to repository secrets to automate publishing package
- [ ] login to your [`npm` account](https://www.npmjs.com/login) and create automation token
- [ ] Create a new repository secrets `NPM_AUTH_TOKEN`
- [ ] Update description in `lib/fork-me/package.json`
- [ ] Update description in `lib/@mayank1513/fork-me/package.json`
- [ ] Update Repo Stats by visiting and setting up [repobeats](https://repobeats.axiom.co/)
- [ ] Create your library and update examples
- [ ] Update README
- [ ] Setup GitHub pages to deploy docs
- [ ] Go to [repo settings](https://github.com/react18-tools/fork-me/settings/pages) -> pages (On left panel); Select deploy from a branch; Then Select `main` and `/docs`
- [ ] Go to [repo settings](https://github.com/react18-tools/@mayank1513/fork-me/settings/pages) -> pages (On left panel); Select deploy from a branch; Then Select `main` and `/docs`
- [ ] (Optional) Set up [Deepsource](https://app.deepsource.com/login) for static code analysis
- [ ] Push your changes/Create PR and see your library being automatically tested and published
- [ ] Optionally deploy your example(s) to Vercel.
Expand All @@ -103,7 +100,7 @@ This Turborepo includes the following packages/examples/lib:

- `nextjs`: a [Next.js](https://nextjs.org/) app
- `vite`: a [Vite.js](https://vitest.dev) app
- `fork-me`: a React component library shared by both `Next.js` and `Vite` examples
- `@mayank1513/fork-me`: a React component library shared by both `Next.js` and `Vite` examples
- `eslint-config-custom`: ESLint configurations (includes `eslint-config-next` and `eslint-config-prettier`)
- `tsconfig`: `tsconfig.json`s used throughout the monorepo

Expand All @@ -114,7 +111,7 @@ Each package/example is 100% [TypeScript](https://www.typescriptlang.org/).
To build all apps and packages, run the following command:

```
cd fork-me
cd @mayank1513/fork-me
pnpm build
```

Expand All @@ -123,7 +120,7 @@ pnpm build
To develop all apps and packages, run the following command:

```
cd fork-me
cd @mayank1513/fork-me
pnpm dev
```

Expand All @@ -138,7 +135,7 @@ Learn more about the power of Turborepo:
- [Configuration Options](https://turbo.build/repo/docs/reference/configuration)
- [CLI Usage](https://turbo.build/repo/docs/reference/command-line-reference)

### 🤩 Don't forger to star [this repo](https://github.com/react18-tools/fork-me)!
### 🤩 Don't forger to star [this repo](https://github.com/react18-tools/@mayank1513/fork-me)!

Want hands-on course for getting started with Turborepo? Check out [React and Next.js with TypeScript](https://mayank-chaudhari.vercel.app/courses/react-and-next-js-with-typescript) and [The Game of Chess with Next.js, React and TypeScrypt](https://www.udemy.com/course/game-of-chess-with-nextjs-react-and-typescrypt/?referralCode=851A28F10B254A8523FE)

Expand Down
57 changes: 28 additions & 29 deletions examples/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
{
"name": "nextjs-example",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"postinstall": "next telemetry disable"
},
"dependencies": {
"@mayank1513/fork-me": "latest",
"fork-me": "workspace:*",
"next": "^14.1.4",
"nextjs-themes": "^3.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"shared-ui": "workspace:*"
},
"devDependencies": {
"@next/eslint-plugin-next": "^14.1.4",
"@types/node": "^20.12.5",
"@types/react": "^18.2.74",
"@types/react-dom": "^18.2.24",
"eslint-config-custom": "workspace:*",
"tsconfig": "workspace:*",
"typescript": "^5.4.4"
}
}
"name": "nextjs-example",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"postinstall": "next telemetry disable"
},
"dependencies": {
"@mayank1513/fork-me": "workspace:*",
"next": "^14.1.4",
"nextjs-themes": "^3.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"shared-ui": "workspace:*"
},
"devDependencies": {
"@next/eslint-plugin-next": "^14.1.4",
"@types/node": "^20.12.5",
"@types/react": "^18.2.74",
"@types/react-dom": "^18.2.24",
"eslint-config-custom": "workspace:*",
"tsconfig": "workspace:*",
"typescript": "^5.4.4"
}
}
99 changes: 49 additions & 50 deletions examples/remix/package.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,50 @@
{
"name": "remix-example",
"version": "0.0.0",
"private": true,
"sideEffects": false,
"type": "module",
"scripts": {
"build": "remix build",
"dev": "remix dev --manual",
"start": "remix-serve ./build/index.js",
"typecheck": "tsc"
},
"dependencies": {
"@mayank1513/fork-me": "latest",
"fork-me": "workspace:*",
"@remix-run/css-bundle": "^2.8.1",
"@remix-run/node": "^2.8.1",
"@remix-run/react": "^2.8.1",
"@remix-run/serve": "^2.8.1",
"isbot": "5.1.4",
"nextjs-themes": "^3.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"shared-ui": "workspace:*"
},
"devDependencies": {
"@remix-run/dev": "^2.8.1",
"@remix-run/eslint-config": "^2.8.1",
"@types/react": "^18.2.74",
"@types/react-dom": "^18.2.24",
"eslint": "^9.0.0",
"typescript": "^5.4.4"
},
"engines": {
"node": ">=18.0.0"
},
"pnpm": {
"packageExtensions": {
"@remix-run/dev": {
"peerDependencies": {
"react-dom": "18.2.0"
}
},
"@remix-run/serve": {
"peerDependencies": {
"react-dom": "18.2.0"
}
}
}
}
}
"name": "remix-example",
"version": "0.0.0",
"private": true,
"sideEffects": false,
"type": "module",
"scripts": {
"build": "remix build",
"dev": "remix dev --manual",
"start": "remix-serve ./build/index.js",
"typecheck": "tsc"
},
"dependencies": {
"@mayank1513/fork-me": "workspace:*",
"@remix-run/css-bundle": "^2.8.1",
"@remix-run/node": "^2.8.1",
"@remix-run/react": "^2.8.1",
"@remix-run/serve": "^2.8.1",
"isbot": "5.1.4",
"nextjs-themes": "^3.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"shared-ui": "workspace:*"
},
"devDependencies": {
"@remix-run/dev": "^2.8.1",
"@remix-run/eslint-config": "^2.8.1",
"@types/react": "^18.2.74",
"@types/react-dom": "^18.2.24",
"eslint": "^9.0.0",
"typescript": "^5.4.4"
},
"engines": {
"node": ">=18.0.0"
},
"pnpm": {
"packageExtensions": {
"@remix-run/dev": {
"peerDependencies": {
"react-dom": "18.2.0"
}
},
"@remix-run/serve": {
"peerDependencies": {
"react-dom": "18.2.0"
}
}
}
}
}
2 changes: 1 addition & 1 deletion examples/remix/remix.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @type {import('@remix-run/dev').AppConfig} */
export default {
ignoredRouteFiles: ["**/.*"],
serverDependenciesToBundle: ["@mayank1513/fork-me", "shared-ui"],
serverDependenciesToBundle: ["@mayank1513/@mayank1513/fork-me", "shared-ui"],
// appDirectory: "app",
// assetsBuildDirectory: "public/build",
// publicPath: "/build/",
Expand Down
61 changes: 30 additions & 31 deletions examples/vite/package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
{
"name": "vite-example",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite --port 3001",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"@mayank1513/fork-me": "latest",
"fork-me": "workspace:*",
"nextjs-themes": "^3.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"shared-ui": "workspace:*"
},
"devDependencies": {
"@types/react": "^18.2.74",
"@types/react-dom": "^18.2.24",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"@vitejs/plugin-react-swc": "^3.6.0",
"eslint": "^9.0.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"typescript": "^5.4.4",
"vite": "^5.2.8"
}
}
"name": "vite-example",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite --port 3001",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"@mayank1513/fork-me": "workspace:*",
"nextjs-themes": "^3.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"shared-ui": "workspace:*"
},
"devDependencies": {
"@types/react": "^18.2.74",
"@types/react-dom": "^18.2.24",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"@vitejs/plugin-react-swc": "^3.6.0",
"eslint": "^9.0.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"typescript": "^5.4.4",
"vite": "^5.2.8"
}
}
6 changes: 3 additions & 3 deletions lib/fork-me/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "fork-me",
"name": "@mayank1513/fork-me",
"author": "Mayank Kumar Chaudhari <https://mayank-chaudhari.vercel.app>",
"private": false,
"version": "0.0.0",
"version": "0.0.0",
"description": "An intuitive React.js fork me ribbon component for promoting open source project forks.",
"main": "./index.ts",
"types": "./index.ts",
Expand Down Expand Up @@ -79,4 +79,4 @@
"mayank1513",
"turborepo-trmplate"
]
}
}
7 changes: 3 additions & 4 deletions packages/shared-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
"name": "shared-ui",
"author": "Mayank Kumar Chaudhari <https://mayank-chaudhari.vercel.app>",
"private": true,
"version": "0.0.0",
"version": "0.0.0",
"description": "Shared UI Package",
"main": "./index.ts",
"types": "./index.ts",
"scripts": {
"lint": "eslint ."
},
"devDependencies": {
"@mayank1513/fork-me": "latest",
"fork-me": "workspace:*",
"@mayank1513/fork-me": "workspace:*",
"@types/node": "^20.12.5",
"@types/react": "^18.2.74",
"@types/react-dom": "^18.2.24",
Expand All @@ -25,4 +24,4 @@
"dependencies": {
"eslint": "^9.0.0"
}
}
}

0 comments on commit 6d387ce

Please sign in to comment.