Skip to content

Commit 1736bb9

Browse files
committed
update pnpm-link.sh
1 parent 9ca81fc commit 1736bb9

File tree

3 files changed

+35
-31
lines changed

3 files changed

+35
-31
lines changed

README.md

+21-21
Original file line numberDiff line numberDiff line change
@@ -39,29 +39,29 @@ or
3939
Below are notes and instructions on how to get your development environment up and running,
4040
and enjoyable.
4141

42-
1. **Install dependencies** -- we use yarn workspaces, so please use yarn instead of npm.
43-
Run, `yarn install`
42+
1. **Install dependencies**
43+
Run, `pnpm install`
4444

4545
2. **Workflow** -- we use the amazing [preconstruct](https://github.com/preconstruct/preconstruct)
4646
package to handle our monorepo build system.
4747

4848
3. **Local dev** -- when you're working on the code in this repository, you can safely run
49-
`yarn dev` at the root-level, which will link all packages/** together, so that when a
49+
`pnpm dev` at the root-level, which will link all packages/** together, so that when a
5050
local dependency from packages/** is used by another, it will automatically be linked
51-
without having to run a build command. Just remember: run `yarn dev` anytime you developing
52-
in this repo. Note, that when you run `yarn build` it will clear the dev environment, so
53-
you will need to run `yarn dev` again after a build. However, `yarn build` should only be
51+
without having to run a build command. Just remember: run `pnpm dev` anytime you developing
52+
in this repo. Note, that when you run `pnpm build` it will clear the dev environment, so
53+
you will need to run `pnpm dev` again after a build. However, `pnpm build` should only be
5454
used when making a release.
5555

56-
4. **Testing** -- to test the system, you can run `yarn test` at the top-level or at an individual
56+
4. **Testing** -- to test the system, you can run `pnpm test` at the top-level or at an individual
5757
package-level.
5858

59-
5. **Type-checking** -- to typecheck the system you can run `yarn typecheck` at any level.
59+
5. **Type-checking** -- to typecheck the system you can run `pnpm typecheck` at any level.
6060

61-
6. **Building** -- to _compile_ the project to dist files for a release, run `yarn build` at
61+
6. **Building** -- to _compile_ the project to dist files for a release, run `pnpm build` at
6262
the root-level. Note building packages repeatedly during development is unnecessary with
63-
`preconstruct`. During local development run `yarn dev` and when building to make a release,
64-
run `yarn build`.
63+
`preconstruct`. During local development run `pnpm dev` and when building to make a release,
64+
run `pnpm build`.
6565

6666
7. **Versioning** -- this repository uses the handy [changesets](https://github.com/atlassian/changesets)
6767
package for package versioning across the monorepo, as well as changelogs. See _Releasing_ section below.
@@ -73,17 +73,17 @@ and enjoyable.
7373

7474
### How to do a release
7575

76-
1. Run `yarn` to make sure everything is up to date
76+
1. Run `pnpm` to make sure everything is up to date
7777
2. Code.. do your magic
78-
3. Run `yarn changeset` to generate a new .changeset/ entry explaining the code changes
78+
3. Run `pnpm changeset` to generate a new .changeset/ entry explaining the code changes
7979
4. Version bump all packages regardless of them having changes or not
8080
5. Commit and submit your changes as a PR for review
8181
6. Once merged and you're ready to make a release, continue to the next step. If you're not
8282
ready to make a release, then go back to step 2.
83-
7. Run `yarn build && yarn test` to double check all tests pass
84-
8. Run `yarn version-packages` to bump versions of the packages
83+
7. Run `pnpm build && pnpm test` to double check all tests pass
84+
8. Run `pnpm version-packages` to bump versions of the packages
8585
9. Commit files after versioning. This is the commit that will be published and tagged: `git push --no-verify`
86-
10. Run `yarn release`. If the 2FA code timesout while publishing, run the command again
86+
10. Run `pnpm release`. If the 2FA code timesout while publishing, run the command again
8787
with a new code, only the packages that were not published will be published.
8888
11. Finally, push your git tags, via: `git push --tags --no-verify`
8989

@@ -92,15 +92,15 @@ and enjoyable.
9292

9393
NOTE: snapshot release is for dev preview, it's similar to the above, but:
9494

95-
1. `yarn changeset`
96-
2. `yarn changeset version --snapshot`
97-
3. `yarn changeset publish --tag snapshot`
95+
1. `pnpm changeset`
96+
2. `pnpm changeset version --snapshot`
97+
3. `pnpm changeset publish --tag snapshot`
9898

9999

100100
## NOTES
101101

102-
1. Browser tests can be run with `yarn test` or, separately `yarn test:server` and `yarn test:run`
103-
2. To run a specific test, run `yarn test:only <test-file-basename>`, ie. `yarn test:only window-transport`
102+
1. Browser tests can be run with `pnpm test` or, separately `pnpm test:server` and `pnpm test:run`
103+
2. To run a specific test, run `pnpm test:only <test-file-basename>`, ie. `pnpm test:only window-transport`
104104

105105

106106
## TIPS

packages/0xsequence/README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ Sequence is a critical piece of software and any change should be delivered via
2020
workflow.
2121

2222
As well, sequence.js's monorepo tooling is setup with preconstruct, which links all sub-packages together
23-
so it feels like a single program and is easy to work with. Please run `yarn dev` in the root of `sequence.js/`
23+
so it feels like a single program and is easy to work with. Please run `pnpm dev` in the root of `sequence.js/`
2424
folder to ensure the monorepo is in 'dev-mode'.
2525

26-
Second, you can run the test suite directly from console with a single `yarn test`, or you can boot up the Typescript
27-
compiling server (`yarn test:server`) and ethereum test node (`yarn start:hardhat` and `yarn start:hardhat2`) manually
26+
Second, you can run the test suite directly from console with a single `pnpm test`, or you can boot up the Typescript
27+
compiling server (`pnpm test:server`) and ethereum test node (`pnpm start:hardhat` and `pnpm start:hardhat2`) manually
2828
in separate terminals, and then run a specific test directly from your browser instance. We recommend running the
2929
test stack separately and running specific browser tests manually during development. See [here for recommended setup](./#from-browser).
3030

@@ -40,9 +40,9 @@ we highly recommend to view your tests running from the browser as its more clea
4040

4141
### From Browser
4242

43-
1. `yarn test:server` -- in one terminal, to start the webpack server compiling typescript
44-
2. `yarn start:hardhat` -- in a second terminal, to start hardhat local ethereum test node
45-
3. `yarn start:hardhat2` -- (2nd chain) in a third terminal, to start hardhat2 local ethereum test node
43+
1. `pnpm test:server` -- in one terminal, to start the webpack server compiling typescript
44+
2. `pnpm start:hardhat` -- in a second terminal, to start hardhat local ethereum test node
45+
3. `pnpm start:hardhat2` -- (2nd chain) in a third terminal, to start hardhat2 local ethereum test node
4646
4. open browser to `http://localhost:9999/{browser-test-dir}/{test-filename}.test.html` for example,
4747
http://localhost:9999/wallet-provider/dapp.test.html
4848
5. open your browser console so you can see the tests running and their results.
@@ -53,14 +53,14 @@ following the last test case, so you will preempt the runner after a certain tes
5353
As well, since you have all the services running in terminals, you can also execute commands via
5454
the cli by calling `test:run`, which is similar to step 4 above, but executing all tests from the terminal.
5555
There is also the `test:only` command if you'd like to execute a specific test from ./tests/browser/*.spec.ts
56-
file, ie. `yarn test:only window-transport`.
56+
file, ie. `pnpm test:only window-transport`.
5757

5858

5959
### From CLI
6060

6161
With a single command, you can spin up the testing stack and execute tests:
6262

63-
`yarn test`
63+
`pnpm test`
6464

6565
This is useful for a sanity check to ensure tests pass, or using it with the CI. However, if you're
6666
developing on sequence.js, its highly recommended you follow the [development workflow instructions](./#development-workflow).

scripts/yarn-link.sh scripts/pnpm-link.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,14 @@ case "$option" in
2323
;;
2424
esac
2525

26-
packages=(./packages/*)
26+
repo_dir=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && cd .. && pwd)
27+
28+
packages=($repo_dir/packages/*)
2729
for p in "${packages[@]}"
2830
do
29-
(cd $p && yarn $option)
31+
x=$(realpath $p)
32+
# echo $x
33+
pnpm link $x
3034
done
3135

3236
exit $?

0 commit comments

Comments
 (0)