Pavan Kumar
11/06/2021, 7:42 PMyarn
command from root of mono repo will install the packages for all the workspaces. While running build from seed.run it executes the yarn
twice. Once from root
and second time from service
directory. This is causing build issue as wrong version of packages are being added.
I there a way in seed.run to say don't run yarn
in service directory?
Following is extract from seed.run logs which shows yarn executing twice.
$ cd /tmp/seed/source
INFO: Running before_compile hook
$ n 14.18.1
2.69 s
INFO: Looking for package.json...
$ yarn
236.76 s
$ cd /tmp/seed/source/packages/apps
INFO: Looking for service package.json...
$ yarn
Omi Chowdhury
11/07/2021, 12:30 AMPavan Kumar
11/07/2021, 2:02 AMmy-app/
├─ workspaces/
│ ├─ sst/
│ │ ├─ react/
│ │ │ ├─ package.json
│ │ ├─ package.json
├─ package.json // this was workspace def
The root package has workspace def as below.
{
"name": "monorepo",
"workspaces": [
"workspaces/sst/",
"workspaces/sst/react"
]
}
If yarn
is run from root
it will resolve the package correctly if there are conflicting package between workspaces/sst
and workspaces/sst/react
But when we run yarn
inside workspaces/sst
, the yarn is not aware of workspace/sst/react
and installs packages only defined in sst without any conflict resolution.Omi Chowdhury
11/07/2021, 2:08 AMPavan Kumar
11/07/2021, 2:40 AM1.22.5
version. sst
must be parent of react
app for sst-env
to work.
Extract from sst docs
Note that, sst-env only works if the React or Next.js app is located inside the SST app or inside one of its subdirectories.
Frank
Frank
yarn install
at the root again after the yarn install
in the service directory.Frank
before_build:
- yarn install
Here are more details on adding buildspec on SEED https://seed.run/docs/adding-a-build-spec.htmlFrank
Pavan Kumar
11/09/2021, 6:45 AM