Skip to content

Commit

Permalink
Fix/pnpm linking docs
Browse files Browse the repository at this point in the history
Merge in ADGUARD-FILTERS/tsurlfilter from fix/pnpm-linking-docs-1 to master

Squashed commit of the following:

commit cf2a80c
Merge: c3ccf69 f2952e1
Author: scripthunter7 <[email protected]>
Date:   Fri Apr 19 08:48:00 2024 +0200

    Merge branch 'master' into fix/pnpm-linking-docs

commit c3ccf69
Author: scripthunter7 <[email protected]>
Date:   Wed Apr 17 16:35:55 2024 +0200

    fix nit

commit c8fb77d
Author: scripthunter7 <[email protected]>
Date:   Wed Apr 17 16:33:52 2024 +0200

    update docs

commit cf06893
Author: scripthunter7 <[email protected]>
Date:   Wed Apr 17 09:07:59 2024 +0200

    update docs
  • Loading branch information
maximtop committed Apr 19, 2024
1 parent f2952e1 commit 2e865cd
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,27 @@ This repository uses pnpm workspaces and [Lerna][lerna] to manage multiple packa
[lernacommands]: https://lerna.js.org/docs/api-reference/commands

### Linking packages from this monorepo to another projects

`pnpm` has a nested structure for packages, which is not compatible with the classic `yarn`, because `yarn` using a flat
structure, but you can force `pnpm` to use a flat structure too by setting the `--shamefully-hoist` flag.

For example, if you want to link the `tswebextension` package from this monorepo to the
[browser extension project][browser-extension] which are using `yarn`, you can follow these steps:

1. Install packages in this monorepo with `pnpm install --shamefully-hoist`.
1. Go to the *tswebextension* package directory: `cd packages/tswebextension`, and run `yarn link`.
1. Go to the *browser extension* project directory: `cd /path/to/browser-extension`,
and run `yarn link @adguard/tswebextension`.
This way, the browser extension project will use the linked package from this monorepo, instead of the published one
from the npm registry.

If the other project are using `pnpm`, you can use [`pnpm link`][pnpm-link] to connect the packages locally.
For more details, please check the pnpm documentation.

[browser-extension]: https://github.com/AdguardTeam/AdguardBrowserExtension
[pnpm-link]: https://pnpm.io/cli/link

### Sample extensions

Source code of sample extensions can be found in [`./packages/examples`][examples] directory.
Expand Down

0 comments on commit 2e865cd

Please sign in to comment.