-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Exports in package.json and coder sync
- Loading branch information
1 parent
d7aa1c8
commit 564f3a8
Showing
13 changed files
with
270 additions
and
24 deletions.
There are no files selected for viewing
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Using factorial one "source" | ||
|
||
## Motivation | ||
|
||
For development scenarios is necessary to be agile and be able to apply changes in factorial one and check how then | ||
integrates in the consumer (ex. factorial's monorepo) | ||
|
||
In this scenario the regular release process (build, publish, update dependency's version on the consumer and update) is | ||
very slow and doesn't provide a fast feedback of the | ||
changes. | ||
|
||
Use the `factorial-one`'s source as dependencies has a lot of tradeoffs and issues: aliases, vite plugins, etc. needs to | ||
be configured in the same way in the consumer of `factorial-one` | ||
|
||
### Strategy | ||
|
||
Building the library will be necessary to use it in the same way as in production, but in some scenarios (like local | ||
development) we can skip publishing and reinstalling (check how to: [in local development](#local) | ||
or [in coder](#coder)) | ||
|
||
## How to | ||
|
||
### Using an specific commit | ||
|
||
In the monorepo folder: | ||
|
||
1. open the `package.json` file | ||
2. run `pnpm add `github:factorialco/factorial-one#[COMMIT_SHA1]` where `[COMMIT_SHA1]` is the commit identifier to use: | ||
- example: `pnpm add github:factorialco/factorial-one#9c270d1db734771f7def654c20114ad947f156d2` | ||
|
||
> IMPORTANT: Remember to remove use an stable version before to merge into `main` or release | ||
### How to use local version of `factorial-one` in your local repo (ex. `factorial`'s monorepo) {#local} | ||
|
||
This applies when both `factorial-one` and `factorial`'s monorepo are in the local computer | ||
|
||
1. Go to the `factorial-one` folder: `cd factorial-one` | ||
2. Run `pnpm build:watch` to rebuild the project on any change | ||
3. Run `pnpm link --global` to add the package to the local links | ||
4. Go to the factorial app monorepo: `cd factorial/frontend` | ||
5. Run `pnpm link --global @factorialco/factorial-one` to use the local version of the package | ||
|
||
### How to use local version of `factorial-one` in coder {#cder} | ||
|
||
This applies when `factorial-one` is in your local computer and `factorial`'s monorepo is in coder's dev environment | ||
|
||
**Prerequisites:** | ||
|
||
- [rsync](https://linux.die.net/man/1/rsync) in your local computer: `brew install rsync` | ||
- [coder cli](https://coder.com/docs/getting-started/installation) in your local computer | ||
-  | ||
- Create if not exists `.env.local` and add this line `CODER_REMOTE=[YOUR_CODER_SSH_CONNECTION_STRING]`, for example: | ||
`CODER_REMOTE=coder.sergiocarracedo-dev-env` | ||
> This file is in the `.gitignore` file, so it won't be pushed to the repository | ||
**Steps:** | ||
|
||
1. Go to the `factorial-one` folder: `cd factorial-one` | ||
2. Run `pnpm dev:coder` to rebuild the project on any change and sync that build to coder workspace | ||
|
||
> Now on each change in the `factorial-one`'s source code, the changes will be reflected in the coder workspace and the | ||
> frontend will be reloaded using always the latest `factorial-one`'s code | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.