Is there a way to make SEED always deploy a servic...
# seed
o
Is there a way to make SEED always deploy a service - but for only one service in an app? We’re using lerna/yarn in a monorepo, and that setup works great for SLS, but lerna is failing to recognise changes to our SST apps (we have two SST apps in our monorepo). We need to do this because we’re currently stuck between hard, rocky places with: • yarn 1 not supported nested workspaces • SST handlers needing to live below sst.json • not being able to add internal packages from our monorepo to the package.json alongside sst.json
t
What do you mean by yarn 1 doesn't support nested workspaces
I thought I was using yarn 1 with workspaces
o
you can’t have a yarn workspace in a sub-folder of another yarn workspace
Our folder structure is:
Copy code
libs/
  my-sweet-lib/
    package.json
  my-cool-lib/
    package.json

services/
  cats-service/
    package.json
    serverless.yml
    handler.ts

sst-services/
  sst.json
  package.json
  index.ts

  stacks/
    users-service.ts
    dogs-service.ts  

  services/
    users-service/
      package.json
      handler.ts
    dogs-service/
      package.json
      handler.ts
Right now our package.json has this config:
Copy code
"workspaces": [
    "libs/*",
    "services/*",
    "sst-services",
    "sst-services/services/*"
  ],
And our lerna.json is:
Copy code
{
  "version": "independent",
  "npmClient": "yarn",
  "packages": [
    "libs/*",
    "services/*",
    "sst-services"
  ]
}
The problem comes if we update
my-sweet-lib
- then SEED doesn’t redeploy sst-services, because
my-sweet-lib
is listed as a dependency in
sst-services/services/users-service/package.json
but not
sst-services/package.json
j
@Frank just putting this on your radar.
f
@Jay let’s talk about how to best support this.
@Omi Chowdhury as a workaround, is it possible to temporarily add the
sst-services/services/*
packages as dependencies for
sst-services
?
o
@Frank added them to the package json, doesn’t break the build, but need to see if it picks up updates over a few builds - will let you know