sst / ion

❍ — a new engine for SST
https://ion.sst.dev
MIT License
1.09k stars 128 forks source link

Feature: Publish JS Modules for Creating Components #398

Open san4d opened 1 month ago

san4d commented 1 month ago

Ask

Publish the JS modules needed to create custom components separately from the sst CLI. This would allow me to create SST components separately from having an "sst app", allow the community to publish SST modules that the core team wouldn't need to support, and improve the first-time setup for projects creating custom SST components (related to sst init).

Context

I'm running two logically separate applications in a pnpm monorepo: one for my marketing website and another for my core application. The core application is an Astro JS app plus a few lambdas used for async processing (this roughly follows the existing monorepo example provided in the SST docs). The marketing website is also an Astro JS application. In addition to these two apps, I have a package that manages my AWS Org account that manages things like DNS.

I'd like to keep all three of these separated with different app prefixes while being able to share definitions of custom components.

Example Structure

.
├── README.md
├── apps
│ ├── core
│ │ ├── package.json
│ │ └── sst.config.ts
│ ├── marketing
│ │ ├── package.json
│ │ └── sst.config.ts
│ └── org
│ ├── package.json
│ └── sst.config.ts
├── packages
│ └── common-infra
│ └── package.json
├── pnpm-lock.yaml
└── pnpm-workspace.yaml
san4d commented 1 month ago

@thdxr I noticed you formatted my example structure. I'm not sure if that was automated, but I wanted to clarify a few things:

  1. core, marketing, and org all have their own package.json and sst.config.ts
  2. common-infra is a package with its own package.json but does not have a sst.config.ts.
  3. apps and packages are parent directories without package.json or sst.config.ts.
jayair commented 1 month ago

This is something we want to do to support 3rd party integrations and components.

Not sure about the timing of it just yet.