-
-
Notifications
You must be signed in to change notification settings - Fork 15
Monorepo support (e.g. yarn workspaces) #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 14 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
1ae7743
Fixes #17
danwetherald 8711914
monorepo example
danwetherald fa869b5
more ignores
danwetherald 06b6386
add app
danwetherald bb5952b
slim down app
danwetherald 5130415
Done
danwetherald d19ffd0
ignore all bs files in examples
danwetherald fee0374
Restructure yarn workspaces example to minimal setup
ryyppy a35f042
Add example README
ryyppy a60802b
Update README feature list
ryyppy 9d99915
Update Changelog
ryyppy fd2ecb8
Clean up common dep
ryyppy c7b67ea
Simplify gitignore for examples
ryyppy a9d7e29
Remove more gitignore
ryyppy e9dc13e
Update monorepo example with a package that has a different bs-platfo…
ryyppy 6404971
Add basic example, remove root package.lock stuff
ryyppy ed862fe
Add per file env update mechanism
ryyppy 93095b3
Introduce :RescriptBuildWorld and :RescriptCleanWorld
ryyppy c0d8ccc
Update Changelog and README
ryyppy d2a2786
Update to rescript-vscode@1.0.4
ryyppy 2a40d06
Update Changelog and README
ryyppy 22d10fb
Adapt workflows for tests
ryyppy b6a40dc
Relocate package.json back to project root to make tests work again
ryyppy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,23 @@ | ||
# yarn workspaces monorepo example | ||
|
||
This example setup is using the `yarn workspace` feature in combination with ReScript's `pinned-dependencies`. | ||
|
||
**Expected IDE plugin behavior:** | ||
|
||
When the editor is opened in one of the subprojects `app` or `common`, the editor extension should correctly detect the `bsc` and `bsb` binary in the monorepo root's `node_modules` directory. | ||
|
||
``` | ||
cd app | ||
nvim . | ||
``` | ||
|
||
## Setup | ||
|
||
``` | ||
cd examples/monorepo-yarn-workspaces | ||
yarn | ||
|
||
# Build the full project | ||
cd app | ||
yarn run build | ||
``` |
This file contains hidden or 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,26 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/rescript-lang/rescript-compiler/master/docs/docson/build-schema.json", | ||
"name": "app", | ||
"version": "1.0.0", | ||
"sources": { | ||
"dir" : "src", | ||
"subdirs" : true | ||
}, | ||
"package-specs": { | ||
"module": "commonjs", | ||
"in-source": true | ||
}, | ||
"suffix": ".js", | ||
"bs-dependencies": [ | ||
"reason-react", | ||
"common" | ||
], | ||
"pinned-dependencies": ["common"], | ||
"ppx-flags": [], | ||
"bsc-flags": ["-bs-super-errors", "-bs-no-version-header"], | ||
"warnings": { | ||
"number": "-44", | ||
"error": "+8+26+27+101" | ||
}, | ||
"reason": {"react-jsx": 3} | ||
} |
This file contains hidden or 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,16 @@ | ||
{ | ||
"name": "app", | ||
"version": "0.1.0", | ||
"private": true, | ||
"dependencies": { | ||
"common": "1.0.0" | ||
}, | ||
"scripts": { | ||
"clean": "bsb -clean-world", | ||
"build": "bsb -make-world", | ||
"watch": "bsb -make-world -w" | ||
}, | ||
"devDependencies": { | ||
"bs-platform": "^8.4.2" | ||
} | ||
} |
This file contains hidden or 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,9 @@ | ||
@react.component | ||
let make = () => { | ||
Common.Header.make(Js.Obj.empty())->Js.log | ||
Common.Footer.make(Js.Obj.empty())->Js.log | ||
|
||
<> <Common.Header /> <div> {React.string("Main content")} <Common.Footer /> </div> </> | ||
} | ||
|
||
make(Js.Obj.empty())->Js.log |
This file contains hidden or 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,25 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/rescript-lang/rescript-compiler/master/docs/docson/build-schema.json", | ||
"name": "common", | ||
"namespace": "Common", | ||
"version": "0.0.1", | ||
"sources": { | ||
"dir" : "src", | ||
"subdirs" : true | ||
}, | ||
"package-specs": { | ||
"module": "commonjs", | ||
"in-source": true | ||
}, | ||
"suffix": ".js", | ||
"bs-dependencies": [ | ||
"reason-react" | ||
], | ||
"ppx-flags": [], | ||
"bsc-flags": ["-bs-super-errors", "-bs-no-version-header"], | ||
"warnings": { | ||
"number": "-44", | ||
"error": "+8+26+27+101" | ||
}, | ||
"reason": {"react-jsx": 3} | ||
} |
This file contains hidden or 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,17 @@ | ||
{ | ||
"name": "common", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"scripts": { | ||
"clean": "bsb -clean-world", | ||
"build": "bsb -make-world", | ||
"watch": "bsb -make-world -w" | ||
}, | ||
"dependencies": { | ||
"reason-react": "^0.9.1" | ||
}, | ||
"devDependencies": { | ||
"bs-platform": "^8.4.2" | ||
} | ||
} |
This file contains hidden or 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,4 @@ | ||
@react.component | ||
let make = () => { | ||
<div> {React.string("Footer")} </div> | ||
} |
This file contains hidden or 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,4 @@ | ||
@react.component | ||
let make = () => { | ||
<div> {"Header"->React.string} </div> | ||
} |
This file contains hidden or 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,10 @@ | ||
{ | ||
"name": "rescript-yarn-workspaces-example", | ||
"private": true, | ||
"workspaces": { | ||
"packages": [ | ||
"app", | ||
"common" | ||
] | ||
} | ||
} |
This file contains hidden or 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,13 @@ | ||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
# yarn lockfile v1 | ||
|
||
|
||
bs-platform@^8.4.2: | ||
version "8.4.2" | ||
resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-8.4.2.tgz#778dabd1dfb3bc95e0086c58dabae74e4ebdee8a" | ||
integrity sha512-9q7S4/LLV/a68CweN382NJdCCr/lOSsJR3oQYnmPK98ChfO/AdiA3lYQkQTp6T+U0I5Z5RypUAUprNstwDtMDQ== | ||
|
||
reason-react@^0.9.1: | ||
version "0.9.1" | ||
resolved "https://registry.yarnpkg.com/reason-react/-/reason-react-0.9.1.tgz#30a887158200b659aa03e2d75ff4cc54dc462bb0" | ||
integrity sha512-nlH0O2TDy9KzOLOW+vlEQk4ExHOeciyzFdoLcsmmiit6hx6H5+CVDrwJ+8aiaLT/kqK5xFOjy4PS7PftWz4plA== |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.