|
1 |
| -# Turborepo Template <img src="https://github.com/react18-tools/turborepo-template/blob/main/popper.png?raw=true" style="height: 40px"/> |
| 1 | +# React Markdown Autolink <img src="https://github.com/react18-tools/react-markdown-autolink/blob/main/popper.png?raw=true" style="height: 40px"/> |
2 | 2 |
|
3 |
| -[](https://github.com/react18-tools/turborepo-template/actions/workflows/test.yml) [](https://codeclimate.com/github/react18-tools/turborepo-template/maintainability) [](https://codecov.io/gh/react18-tools/turborepo-template) [](https://www.npmjs.com/package/react18-loaders) [](https://www.npmjs.com/package/react18-loaders)  [](https://gitpod.io/from-referrer/) |
| 3 | +[](https://github.com/react18-tools/react-markdown-autolink/actions/workflows/test.yml) [](https://codeclimate.com/github/react18-tools/react-markdown-autolink/maintainability) [](https://codecov.io/gh/react18-tools/react-markdown-autolink) [](https://www.npmjs.com/package/react-markdown-autolink) [](https://www.npmjs.com/package/react-markdown-autolink)  [](https://gitpod.io/from-referrer/) |
4 | 4 |
|
5 |
| -> [Explore featured packages built with this template.](./FEATURED.md) |
| 5 | +React Markdown Autolink is a comprehensive library designed to unlock the full potential of React 18 server components. It provides customizable loading animation components and a fullscreen loader container, seamlessly integrating with React and Next.js. |
6 | 6 |
|
7 |
| -> Exciting news! We've launched a new course to help you master this template: [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) |
| 7 | +✅ Fully Treeshakable (import from `react-markdown-autolink/client/loader-container`) |
8 | 8 |
|
9 |
| -<details> |
10 |
| -<summary style="cursor:pointer"><h2 style="display:inline-block">Features</h2></summary> |
| 9 | +✅ Fully TypeScript Supported |
11 | 10 |
|
12 |
| -This template offers the following pre-configured features. Additionally, your repository will automatically be rebranded with the help of workflows and post-install scripts. |
| 11 | +✅ Leverages the power of React 18 Server components |
13 | 12 |
|
14 |
| -✅ Monorepo powered by Turborepo and GitHub actions for automating building, testing, and deploying your library |
| 13 | +✅ Compatible with all React 18 build systems/tools/frameworks |
15 | 14 |
|
16 |
| -✅ Examples with Next.js, Vite, and Remix to showcase how your library can be utilized (Note: Remix is optional due to instability in monorepo setup and folder imports) |
| 15 | +✅ Documented with [Typedoc](https://react18-tools.github.io/react-markdown-autolink) ([Docs](https://react18-tools.github.io/react-markdown-autolink)) |
17 | 16 |
|
18 |
| -✅ Examples pre-configured for Light/Dark theme based on user preference |
| 17 | +✅ Examples for Next.js, Vite, and Remix |
19 | 18 |
|
20 |
| -✅ Examples ready to be deployed to Vercel |
| 19 | +> <img src="https://github.com/react18-tools/react-markdown-autolink/blob/main/popper.png?raw=true" style="height: 20px"/> Please consider starring [this repository](https://github.com/react18-tools/react-markdown-autolink) and sharing it with your friends. |
21 | 20 |
|
22 |
| -✅ Typedoc setup for automatic documentation generation based on tsdoc comments |
| 21 | +## Getting Started |
23 | 22 |
|
24 |
| -✅ Code of Conduct and contributing files, ready for customization |
| 23 | +### Installation |
25 | 24 |
|
26 |
| -✅ Prettier and linter configured according to modern best practices (Feel free to add your flavor) |
| 25 | +```bash |
| 26 | +$ pnpm add react-markdown-autolink |
| 27 | +``` |
27 | 28 |
|
28 |
| -✅ Recommended VSCode extensions - Prettier and [Kanban board](https://github.com/mayank1513/vscode-extension-trello-kanban-board) for code formatting and project management directly within your IDE |
| 29 | +**_or_** |
29 | 30 |
|
30 |
| -✅ Powerful code generators - try `yarn plop` |
| 31 | +```bash |
| 32 | +$ npm install react-markdown-autolink |
| 33 | +``` |
31 | 34 |
|
32 |
| -✅ Test setup with Vitest - A modern and fast testing framework supporting Jest-like APIs |
| 35 | +**_or_** |
33 | 36 |
|
34 |
| -✅ Workflows to automate testing on every pull-request or code push event |
| 37 | +```bash |
| 38 | +$ yarn add react-markdown-autolink |
| 39 | +``` |
35 | 40 |
|
36 |
| -✅ Workflow to automatically publish and create GitHub releases when you update your library's `package.json` file. |
| 41 | +## Want Lite Version? [](https://www.npmjs.com/package/react-markdown-autolink-lite) [](https://www.npmjs.com/package/react-markdown-autolink-lite) [](https://www.npmjs.com/package/react-markdown-autolink-lite) |
37 | 42 |
|
38 |
| -✅ Workflow to automatically rebrand the entire template based on your repository name. (Refer [TODO.md](./TODO.md)) |
| 43 | +```bash |
| 44 | +$ pnpm add react-markdown-autolink-lite |
| 45 | +``` |
39 | 46 |
|
40 |
| -✅ Plus, this readme file includes a quick checklist for configuring Codecov and other badges, setting up your docs website on GitHub pages, and more. See [Checklist](./TODO.md). |
| 47 | +**or** |
41 | 48 |
|
42 |
| -### Creates a library that is |
| 49 | +```bash |
| 50 | +$ npm install react-markdown-autolink-lite |
| 51 | +``` |
43 | 52 |
|
44 |
| -✅ Fully Treeshakable (e.g., import {Bars1, Bars2} from `react18-loaders/dist/server/bars`) |
| 53 | +**or** |
45 | 54 |
|
46 |
| -✅ Fully TypeScript Supported |
| 55 | +```bash |
| 56 | +$ yarn add react-markdown-autolink-lite |
| 57 | +``` |
47 | 58 |
|
48 |
| -✅ Leverages the power of React 18 Server components |
| 59 | +> You need `r18gs` as a peer-dependency |
49 | 60 |
|
50 |
| -✅ Compatible with all React 18 build systems/tools/frameworks |
| 61 | +### Import Styles |
51 | 62 |
|
52 |
| -✅ Documented with [Typedoc](https://react18-tools.github.io/turborepo-template) ([Docs](https://react18-tools.github.io/turborepo-template)) |
| 63 | +You can import styles globally or within specific components. |
53 | 64 |
|
54 |
| -</details> |
| 65 | +```css |
| 66 | +/* globals.css */ |
| 67 | +@import "react-markdown-autolink/dist"; |
| 68 | +``` |
55 | 69 |
|
56 |
| -## Getting Started: |
| 70 | +```tsx |
| 71 | +// layout.tsx |
| 72 | +import "react-markdown-autolink/dist/index.css"; |
| 73 | +``` |
57 | 74 |
|
58 |
| -This template is based on one of the official Turbo Repo starters but comes with a plethora of additional features specifically designed for developing and publishing JavaScript/TypeScript libraries, especially for React 18. |
| 75 | +For selective imports: |
59 | 76 |
|
60 |
| -To get started, simply click on the `"Use this template"` button to create a new repository based on this template, \*\*update [`sripts/rebrand.config.json`](./scripts/rebrand.config.json) if required, and install dependencies(Will automatically trigger rebrand.js). Customize it according to your requirements for your next JavaScript/TypeScript/React/Next.js library or project. |
| 77 | +```css |
| 78 | +/* globals.css */ |
| 79 | +@import "react-markdown-autolink/dist/client"; /** required if you are using LoaderContainer */ |
| 80 | +@import "react-markdown-autolink/dist/server/bars/bars1"; |
| 81 | +``` |
61 | 82 |
|
62 |
| -For detailed instructions and a checklist, please refer to [TODO.md](./TODO.md). |
| 83 | +### Usage |
63 | 84 |
|
64 |
| -## What's Different from Turborepo official templates? |
| 85 | +Using loaders is straightforward. |
65 | 86 |
|
66 |
| -Compared to the default scaffold from create-turbo, this template offers: |
| 87 | +```tsx |
| 88 | +import { Bars1 } from "react-markdown-autolink/dist/server/bars/bars1"; |
67 | 89 |
|
68 |
| -- Unit tests with `vitest` |
69 |
| -- Build setup with `tsup` and `esbuild-plugin-react18` that supports React Server components out of the box |
70 |
| -- **Automatic file generation** |
71 |
| - - Simply run `yarn plop` and follow the prompts to auto-generate your new component with test files and dependency linking, adhering to best practices automatically |
72 |
| -- GitHub actions/workflows to auto-publish your package when the version changes |
73 |
| -- GitHub action/workflow + pre-install scripts to automatically rebrand your repo on creation |
| 90 | +export default function MyComponent() { |
| 91 | + return someCondition ? <Bars1 /> : <>Something else...</>; |
| 92 | +} |
| 93 | +``` |
74 | 94 |
|
75 |
| -### 🤩 Don't forget to star [this repository](https://github.com/react18-tools/turborepo-template)! |
| 95 | +For detailed API and options, refer to [the API documentation](https://react18-tools.github.io/react-markdown-autolink). |
76 | 96 |
|
77 |
| -Looking for a hands-on course to get 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 TypeScript](https://www.udemy.com/course/game-of-chess-with-nextjs-react-and-typescript/?referralCode=851A28F10B254A8523FE) |
| 97 | +**Using LoaderContainer** |
78 | 98 |
|
79 |
| - |
| 99 | +`LoaderContainer` is a fullscreen component. You can add this component directly in your layout and then use `useLoader` hook to toggle its visibility. |
| 100 | + |
| 101 | +```tsx |
| 102 | +// layout.tsx |
| 103 | +<LoaderContainer /> |
| 104 | + ... |
| 105 | +``` |
| 106 | + |
| 107 | +```tsx |
| 108 | +// some other page or component |
| 109 | +import { useLoader } from "react-markdown-autolink/dist/hooks"; |
| 110 | + |
| 111 | +export default MyComponent() { |
| 112 | + const { setLoading } = useLoader(); |
| 113 | + useCallback(()=>{ |
| 114 | + setLoading(true); |
| 115 | + ...do some work |
| 116 | + setLoading(false); |
| 117 | + }, []) |
| 118 | + ... |
| 119 | +} |
| 120 | +``` |
80 | 121 |
|
81 | 122 | ## License
|
82 | 123 |
|
83 |
| -Licensed under the MPL-2.0 open-source license. |
| 124 | +This library is licensed under the MPL-2.0 open-source license. |
| 125 | + |
| 126 | + |
84 | 127 |
|
85 |
| -> <img src="https://github.com/react18-tools/turborepo-template/blob/main/popper.png?raw=true" style="height: 20px"/> Please consider enrolling in [our courses](https://mayank-chaudhari.vercel.app/courses) or [sponsoring](https://github.com/sponsors/mayank1513) our work. |
| 128 | +> <img src="https://github.com/react18-tools/react-markdown-autolink/blob/main/popper.png?raw=true" style="height: 20px"/> Please consider enrolling in [our courses](https://mayank-chaudhari.vercel.app/courses) or [sponsoring](https://github.com/sponsors/mayank1513) our work. |
86 | 129 |
|
87 | 130 | <hr />
|
88 | 131 |
|
|
0 commit comments