Skip to content

Commit

Permalink
docs: adds development guide (#8)
Browse files Browse the repository at this point in the history
* docs: adds development guide

* docs: adds a note

---------

Co-authored-by: Kevin Hermawan <[email protected]>
  • Loading branch information
kevinhermawan and kevin-hyperjump authored Jul 16, 2024
1 parent 492696e commit 78712b6
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ jobs:
- name: Install dependencies
run: npm install

- name: Build package
run: npm run build
- name: Build packages
run: npm run build:packages
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
- name: Install dependencies
run: npm install

- name: Build package
run: npm run build
- name: Build packages
run: npm run build:packages

- name: Release @hyperjumptech/react-next-pathname
run: npm publish --provenance --access public
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,28 @@ const Sidebar = () => {

Currently, the `@hyperjumptech/react-next-pathname-nextjs` package only supports the Page Router. If you are using the App Router, you can use the `@hyperjumptech/react-next-pathname` package. However, please note that it is not fully optimized for the App Router.

## Development Guide

If this is the first time you have cloned the repository, run the following commands:

```bash
npm install
npm run build:packages
```

If you want to run the example, navigate to the example app directory and run the development server:

```bash
cd apps/example-nextjs
npm run dev
```

Every time you make changes in packages and want to see them in the example app, you need to run:

```bash
npm run build:packages
```

## License

[MIT License](/LICENSE)
2 changes: 1 addition & 1 deletion apps/example-nextjs/src/components/navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useNextPathname } from "../../../../packages/react-next-pathname-nextjs/dist/index.mjs";
import { useNextPathname } from "@hyperjumptech/react-next-pathname-nextjs";
import Link from "next/link";

const tabs = [
Expand Down
2 changes: 1 addition & 1 deletion apps/example-nextjs/src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "~/styles/globals.css";

import type { AppProps } from "next/app";
import { NextPathnameProvider } from "../../../../packages/react-next-pathname-nextjs/dist/index.mjs";
import { NextPathnameProvider } from "@hyperjumptech/react-next-pathname-nextjs";
import Navbar from "~/components/navbar";

export default function App({ Component, pageProps }: AppProps) {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "react-next-pathname",
"private": true,
"scripts": {
"build": "turbo build",
"build:packages": "turbo run build --filter=@hyperjumptech/*",
"build:apps": "turbo run build --filter=example-*",
"lint": "turbo lint",
"test": "turbo test",
"test:coverage": "turbo test:coverage"
Expand Down

0 comments on commit 78712b6

Please sign in to comment.