diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml deleted file mode 100644 index 4ad1c8f9..00000000 --- a/.github/workflows/setup.yml +++ /dev/null @@ -1,29 +0,0 @@ -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" - git config --global user.email "mayank.srmu@gmail.com" - 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 💖 Mayank Kumar Chaudhari [skip ci]' - git push origin main diff --git a/README.md b/README.md index 8e77b68f..66cc7ecb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Turborepo template +# nthul -[![test](https://github.com/react18-tools/turborepo-template/actions/workflows/test.yml/badge.svg)](https://github.com/react18-tools/turborepo-template/actions/workflows/test.yml) [![Maintainability](https://api.codeclimate.com/v1/badges/aa896ec14c570f3bb274/maintainability)](https://codeclimate.com/github/react18-tools/turborepo-template/maintainability) [![codecov](https://codecov.io/gh/react18-tools/turborepo-template/graph/badge.svg)](https://codecov.io/gh/react18-tools/turborepo-template) [![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/dt/@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/) +[![test](https://github.com/mayank1513/nthul/actions/workflows/test.yml/badge.svg)](https://github.com/mayank1513/nthul/actions/workflows/test.yml) [![Maintainability](https://api.codeclimate.com/v1/badges/aa896ec14c570f3bb274/maintainability)](https://codeclimate.com/github/mayank1513/nthul/maintainability) [![codecov](https://codecov.io/gh/mayank1513/nthul/graph/badge.svg)](https://codecov.io/gh/mayank1513/nthul) [![Version](https://img.shields.io/npm/v/nthul.svg?colorB=green)](https://www.npmjs.com/package/nthul) [![Downloads](https://img.jsdelivr.com/img.shields.io/npm/dt/nthul.svg)](https://www.npmjs.com/package/nthul) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/nthul) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/from-referrer/) ## Features @@ -30,13 +30,13 @@ This template offers following pre-configured features. Additionally, your repo ✅ Workflow to automatically publish and create a GitHub release when you update your librari's `package.json` file. -✅ Workflow to automatically rebrand entire template based on the name of the repo you create from this template. (As soon as you create a repo from this template, setup workflow is triggered which renames @mayank1513/fork-me to your repo name and does lots of other fixes to set you up and running.) +✅ Workflow to automatically rebrand entire template based on the name of the repo you create from this template. (As soon as you create a repo from this template, setup workflow is triggered which renames nthul to your repo name and does lots of other fixes to set you up and running.) -✅ With all these features, this readme file contains a quick checklist for you to configure Codecov and other badges, setup your docs website on GitHub pages, etc. See [Checklist](https://github.com/react18-tools/turborepo-template/#checklist). +✅ With all these features, this readme file contains a quick checklist for you to configure Codecov and other badges, setup your docs website on GitHub pages, etc. See [Checklist](https://github.com/mayank1513/nthul/#checklist). #### Create a library that is -✅ Fully Treeshakable (import from @mayank1513/fork-me/client/component) +✅ Fully Treeshakable (import from nthul/client/component) ✅ Full TypeScript Support @@ -44,11 +44,28 @@ This template offers following pre-configured features. Additionally, your repo ✅ Works with all build systems/tools/frameworks for React18 -✅ Doccumented with [Typedoc](https://react18-tools.github.io/turborepo-template) ([Docs](https://react18-tools.github.io/turborepo-template)) +✅ Doccumented with [Typedoc](https://mayank1513.github.io/nthul) ([Docs](https://react18-tools.github.io/turborepo-template)) + +## Install + +```bash +$ pnpm add nthul +``` + +or + +```bash +$ npm install nthul +``` + +or + +```bash +$ yarn add nthul +``` + -## Introduction -This template is based on the official starter Turborepo but with additional features tailored for creating and publishing JavaScript/TypeScript and specifically React18 libraries. ## Getting started: @@ -68,8 +85,8 @@ Compared to the default scaffold from create-turbo, this template offers: ## Step by Step Instructions and Checklist -- [ ] Star [this repo](https://github.com/react18-tools/turborepo-template/) so that you and others can find it more easily for your next projects. It also helps me understand that people are using this repo so that I can maintain the repo and the documentation well. -- [ ] Clone this repo +- [ ] Star [this repo](https://github.com/mayank1513/nthul/) so that you and others can find it more easily for your next projects. It also helps me understand that people are using this repo so that I can maintain the repo and the documentation well. + - [ ] Install and setup Node.js and IDE (I prefer VSCode) - [ ] Install the recommended VSCode extensions - [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode), [Trello Kanban](https://marketplace.visualstudio.com/items?itemName=mayank1513.trello-kanban-task-board) - [ ] Install dependencies using `pnpm` @@ -90,12 +107,12 @@ Compared to the default scaffold from create-turbo, this template offers: - [ ] Add `NPM_AUTH_TOKEN` to repository secrets to automate publishing package - [ ] login to your `npm` account and create automation token - [ ] Create a new repository secrets `NPM_AUTH_TOKEN` -- [ ] Update description in `lib/@mayank1513/fork-me/package.json` +- [ ] Update description in `lib/nthul/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/turborepo-template/settings/pages) -> pages (On left panel); Select deploy from a branch; Then Select `main` and `/docs` + - [ ] Go to [repo settings](https://github.com/mayank1513/nthul/settings/pages) -> pages (On left panel); Select deploy from a branch; Then Select `main` and `/docs` - [ ] Push your changes/Create PR and see your library being automatically tested and published - [ ] Optionally deploy your example(s) to Vercel. - [ ] You are most welcome to star this template, contribute, and/or sponsor the `terbo-repo-template` project or my other open-source work @@ -129,7 +146,7 @@ Each package/example is 100% [TypeScript](https://www.typescriptlang.org/). To build all apps and packages, run the following command: ``` -cd my-turborepo +cd nthul pnpm build ``` @@ -138,7 +155,7 @@ pnpm build To develop all apps and packages, run the following command: ``` -cd my-turborepo +cd nthul pnpm dev ``` @@ -153,7 +170,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 start [this repo](https://github.com/mayank1513/turborepo-template)! +### 🤩 Don't forger to start [this repo](https://github.com/mayank1513/nthul)! 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) diff --git a/contributing.md b/contributing.md index fccc2111..05a3c048 100644 --- a/contributing.md +++ b/contributing.md @@ -35,7 +35,7 @@ Each package/example is 100% [TypeScript](https://www.typescriptlang.org/). To build all apps and packages, run the following command: ```bash -cd my-turborepo +cd nthul pnpm build ``` @@ -44,7 +44,7 @@ pnpm build To develop all apps and packages, run the following command: ```bash -cd my-turborepo +cd nthul pnpm dev ``` @@ -53,7 +53,7 @@ pnpm dev To run unit tests, run the following command: ```bash -cd my-turborepo +cd nthul pnpm test ``` @@ -62,7 +62,7 @@ pnpm test Before creating PR make sure lint is passing and also run formatter to properly format the code. ```bash -cd my-turborepo +cd nthul pnpm lint ``` diff --git a/examples/nextjs/package.json b/examples/nextjs/package.json index 6ee3b06d..737a4caa 100644 --- a/examples/nextjs/package.json +++ b/examples/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "nextjs-example", - "version": "1.0.5", + "version": "0.0.0", "private": true, "scripts": { "dev": "next dev", @@ -10,7 +10,8 @@ "postinstall": "next telemetry disable" }, "dependencies": { - "@mayank1513/fork-me": "workspace:*", + "@mayank1513/fork-me": "latest", + "nthul": "workspace:*", "next": "^14.1.0", "nextjs-themes": "^2.1.1", "react": "^18.2.0", diff --git a/examples/remix/package.json b/examples/remix/package.json index 0b813c4f..9a4492bf 100644 --- a/examples/remix/package.json +++ b/examples/remix/package.json @@ -11,7 +11,8 @@ "typecheck": "tsc" }, "dependencies": { - "@mayank1513/fork-me": "workspace:*", + "@mayank1513/fork-me": "latest", + "nthul": "workspace:*", "@remix-run/css-bundle": "^2.6.0", "@remix-run/node": "^2.6.0", "@remix-run/react": "^2.6.0", diff --git a/examples/vite/package.json b/examples/vite/package.json index f891df64..17af5be7 100644 --- a/examples/vite/package.json +++ b/examples/vite/package.json @@ -1,7 +1,7 @@ { "name": "vite-example", "private": true, - "version": "0.0.5", + "version": "0.0.0", "type": "module", "scripts": { "dev": "vite --port 3001", @@ -10,7 +10,8 @@ "preview": "vite preview" }, "dependencies": { - "@mayank1513/fork-me": "workspace:*", + "@mayank1513/fork-me": "latest", + "nthul": "workspace:*", "nextjs-themes": "^2.1.1", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/lib/fork-me/.eslintrc.js b/lib/nthul/.eslintrc.js similarity index 100% rename from lib/fork-me/.eslintrc.js rename to lib/nthul/.eslintrc.js diff --git a/lib/fork-me/.gitignore b/lib/nthul/.gitignore similarity index 100% rename from lib/fork-me/.gitignore rename to lib/nthul/.gitignore diff --git a/lib/fork-me/CHANGELOG.md b/lib/nthul/CHANGELOG.md similarity index 100% rename from lib/fork-me/CHANGELOG.md rename to lib/nthul/CHANGELOG.md diff --git a/lib/fork-me/README.md b/lib/nthul/README.md similarity index 100% rename from lib/fork-me/README.md rename to lib/nthul/README.md diff --git a/lib/fork-me/index.ts b/lib/nthul/index.ts similarity index 100% rename from lib/fork-me/index.ts rename to lib/nthul/index.ts diff --git a/lib/fork-me/package.json b/lib/nthul/package.json similarity index 85% rename from lib/fork-me/package.json rename to lib/nthul/package.json index 81cd6daa..279effff 100644 --- a/lib/fork-me/package.json +++ b/lib/nthul/package.json @@ -1,19 +1,19 @@ { - "name": "@mayank1513/fork-me", + "name": "nthul", "author": "Mayank Kumar Chaudhari ", "private": false, - "version": "2.0.1", + "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", "repository": { "type": "git", - "url": "git+https://github.com/react18-tools/turborepo-template.git" + "url": "git+https://github.com/mayank1513/nthul.git" }, "bugs": { - "url": "https://github.com/react18-tools/turborepo-template/issues" + "url": "https://github.com/mayank1513/nthul/issues" }, - "homepage": "https://github.com/react18-tools/turborepo-template/tree/main/lib/fork-me#readme", + "homepage": "https://github.com/mayank1513/nthul/tree/main/lib/fork-me#readme", "sideEffects": false, "license": "MIT", "scripts": { diff --git a/lib/fork-me/scope.js b/lib/nthul/scope.js similarity index 100% rename from lib/fork-me/scope.js rename to lib/nthul/scope.js diff --git a/lib/fork-me/server.ts b/lib/nthul/server.ts similarity index 100% rename from lib/fork-me/server.ts rename to lib/nthul/server.ts diff --git a/lib/fork-me/src/client/index.ts b/lib/nthul/src/client/index.ts similarity index 100% rename from lib/fork-me/src/client/index.ts rename to lib/nthul/src/client/index.ts diff --git a/lib/fork-me/src/client/star-me/index.ts b/lib/nthul/src/client/star-me/index.ts similarity index 100% rename from lib/fork-me/src/client/star-me/index.ts rename to lib/nthul/src/client/star-me/index.ts diff --git a/lib/fork-me/src/client/star-me/star-me.test.tsx b/lib/nthul/src/client/star-me/star-me.test.tsx similarity index 100% rename from lib/fork-me/src/client/star-me/star-me.test.tsx rename to lib/nthul/src/client/star-me/star-me.test.tsx diff --git a/lib/fork-me/src/client/star-me/star-me.tsx b/lib/nthul/src/client/star-me/star-me.tsx similarity index 100% rename from lib/fork-me/src/client/star-me/star-me.tsx rename to lib/nthul/src/client/star-me/star-me.tsx diff --git a/lib/fork-me/src/declaration.d.ts b/lib/nthul/src/declaration.d.ts similarity index 100% rename from lib/fork-me/src/declaration.d.ts rename to lib/nthul/src/declaration.d.ts diff --git a/lib/fork-me/src/index.ts b/lib/nthul/src/index.ts similarity index 100% rename from lib/fork-me/src/index.ts rename to lib/nthul/src/index.ts diff --git a/lib/fork-me/src/server/fork-me/fork-me.module.css b/lib/nthul/src/server/fork-me/fork-me.module.css similarity index 100% rename from lib/fork-me/src/server/fork-me/fork-me.module.css rename to lib/nthul/src/server/fork-me/fork-me.module.css diff --git a/lib/fork-me/src/server/fork-me/fork-me.test.tsx b/lib/nthul/src/server/fork-me/fork-me.test.tsx similarity index 100% rename from lib/fork-me/src/server/fork-me/fork-me.test.tsx rename to lib/nthul/src/server/fork-me/fork-me.test.tsx diff --git a/lib/fork-me/src/server/fork-me/fork-me.tsx b/lib/nthul/src/server/fork-me/fork-me.tsx similarity index 100% rename from lib/fork-me/src/server/fork-me/fork-me.tsx rename to lib/nthul/src/server/fork-me/fork-me.tsx diff --git a/lib/fork-me/src/server/fork-me/index.ts b/lib/nthul/src/server/fork-me/index.ts similarity index 100% rename from lib/fork-me/src/server/fork-me/index.ts rename to lib/nthul/src/server/fork-me/index.ts diff --git a/lib/fork-me/src/server/index.ts b/lib/nthul/src/server/index.ts similarity index 100% rename from lib/fork-me/src/server/index.ts rename to lib/nthul/src/server/index.ts diff --git a/lib/fork-me/touchup.js b/lib/nthul/touchup.js similarity index 92% rename from lib/fork-me/touchup.js rename to lib/nthul/touchup.js index db383ce2..0ceacc15 100644 --- a/lib/fork-me/touchup.js +++ b/lib/nthul/touchup.js @@ -46,7 +46,7 @@ fs.writeFileSync( JSON.stringify(packageJson, null, 2), ); -fs.copyFileSync(path.resolve(__dirname, "README.md"), path.resolve(__dirname, "dist", "README.md")); +fs.copyFileSync(path.resolve(__dirname, "..", "..", "README.md"), path.resolve(__dirname, "dist", "README.md")); const dirs = [path.resolve(__dirname, "dist")]; diff --git a/lib/fork-me/tsconfig-build.json b/lib/nthul/tsconfig-build.json similarity index 100% rename from lib/fork-me/tsconfig-build.json rename to lib/nthul/tsconfig-build.json diff --git a/lib/fork-me/tsconfig.doc.json b/lib/nthul/tsconfig.doc.json similarity index 100% rename from lib/fork-me/tsconfig.doc.json rename to lib/nthul/tsconfig.doc.json diff --git a/lib/fork-me/tsconfig.json b/lib/nthul/tsconfig.json similarity index 100% rename from lib/fork-me/tsconfig.json rename to lib/nthul/tsconfig.json diff --git a/lib/fork-me/tsup.config.ts b/lib/nthul/tsup.config.ts similarity index 100% rename from lib/fork-me/tsup.config.ts rename to lib/nthul/tsup.config.ts diff --git a/lib/fork-me/turbo/generators/config.ts b/lib/nthul/turbo/generators/config.ts similarity index 100% rename from lib/fork-me/turbo/generators/config.ts rename to lib/nthul/turbo/generators/config.ts diff --git a/lib/fork-me/turbo/generators/templates/component.hbs b/lib/nthul/turbo/generators/templates/component.hbs similarity index 100% rename from lib/fork-me/turbo/generators/templates/component.hbs rename to lib/nthul/turbo/generators/templates/component.hbs diff --git a/lib/fork-me/turbo/generators/templates/component.test.hbs b/lib/nthul/turbo/generators/templates/component.test.hbs similarity index 100% rename from lib/fork-me/turbo/generators/templates/component.test.hbs rename to lib/nthul/turbo/generators/templates/component.test.hbs diff --git a/lib/fork-me/typedoc.config.js b/lib/nthul/typedoc.config.js similarity index 100% rename from lib/fork-me/typedoc.config.js rename to lib/nthul/typedoc.config.js diff --git a/lib/fork-me/vitest.config.ts b/lib/nthul/vitest.config.ts similarity index 100% rename from lib/fork-me/vitest.config.ts rename to lib/nthul/vitest.config.ts diff --git a/package.json b/package.json index fdc1ed96..da10d577 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "doc": "turbo run doc", "lint": "turbo run lint", "format": "prettier --write \"**/*.{ts,tsx,js,jsx,md,css,scss}\"", - "preinstall": "echo setup" + "preinstall": "node -e \"require('child_process').spawn('bash', ['./preinstall.sh'], { stdio: 'inherit'})\"" }, "devDependencies": { "@changesets/cli": "^2.27.1", @@ -17,5 +17,5 @@ "turbo": "^1.12.4" }, "packageManager": "pnpm@8.6.10", - "name": "turborepo-template" + "name": "nthul" } diff --git a/packages/shared-ui/package.json b/packages/shared-ui/package.json index b15f9c1b..54bbba8e 100644 --- a/packages/shared-ui/package.json +++ b/packages/shared-ui/package.json @@ -2,7 +2,7 @@ "name": "shared-ui", "author": "Mayank Kumar Chaudhari ", "private": true, - "version": "1.0.1", + "version": "0.0.0", "description": "Shared UI Package", "main": "./index.ts", "types": "./index.ts", @@ -10,7 +10,8 @@ "lint": "eslint ." }, "devDependencies": { - "@mayank1513/fork-me": "workspace:*", + "@mayank1513/fork-me": "latest", + "nthul": "workspace:*", "@types/node": "^20.11.19", "@types/react": "^18.2.56", "@types/react-dom": "^18.2.19", diff --git a/packages/shared-ui/src/cards/index.tsx b/packages/shared-ui/src/cards/index.tsx index 3ed1159c..8cf2be72 100644 --- a/packages/shared-ui/src/cards/index.tsx +++ b/packages/shared-ui/src/cards/index.tsx @@ -4,12 +4,12 @@ import { Card } from "./card"; const cards = [ { - href: "https://react18-tools.github.io/turborepo-template/", + href: "https://mayank1513.github.io/nthul/", title: "Docs", description: "Explore the official docs.", }, { - href: "https://github.com/react18-tools/turborepo-template", + href: "https://github.com/mayank1513/nthul", title: "More Examples", description: "Explore more examples on official GitHub Repo.", }, diff --git a/packages/shared-ui/src/cards/star-me-card.tsx b/packages/shared-ui/src/cards/star-me-card.tsx index da5266cd..e5ee02c6 100644 --- a/packages/shared-ui/src/cards/star-me-card.tsx +++ b/packages/shared-ui/src/cards/star-me-card.tsx @@ -3,7 +3,7 @@ import styles from "./cards.module.css"; export function StarMeCard() { return ( - +

Star this repo ->

diff --git a/packages/shared-ui/src/common/logo.tsx b/packages/shared-ui/src/common/logo.tsx index 5a7e340b..516e04db 100644 --- a/packages/shared-ui/src/common/logo.tsx +++ b/packages/shared-ui/src/common/logo.tsx @@ -1,5 +1,5 @@ import type { HTMLProps } from "react"; export function Logo(props: HTMLProps) { - return turborepo-template; + return nthul; } diff --git a/packages/shared-ui/src/root-layout.tsx b/packages/shared-ui/src/root-layout.tsx index d3e4c4aa..3c71fc85 100644 --- a/packages/shared-ui/src/root-layout.tsx +++ b/packages/shared-ui/src/root-layout.tsx @@ -24,7 +24,7 @@ export function SharedRootLayout({ children, className = "", ...props }: SharedR