Skip to content

Conversation

mukunku
Copy link
Collaborator

@mukunku mukunku commented Oct 1, 2025

Summary

This PR exposes our internal Svelte implementation of the Stacks design library publicly by adding it to the monorepo.

How to Test

  • Clone the repo and test all the npm scripts in the stacks-svelte workspace to confirm the PR is good.
  • I already pointed https://svelte.stackoverflow.design to this branch. I will point it to production once this PR is merged and releases are performed.
  • Click around the deploy previews from Netlify below. They should work as they did before.

How to Review

Below are the most important files to checkout as part of reviewing this PR:

/
├── .changeset
│   └── cyan-teachers-hear.md
├── .github
│   └── workflows
│       └── workflow.yml
├── .gitignore
├── README.md
└── packages
    ├── stacks-docs
    │   └── assets
    │       └── js
    │           └── index.ts
    └── stacks-svelte
        ├── .storybook
        │   └── getting-started
        │       └── Overview.mdx
        ├── README.md
        ├── netlify.toml
        ├── package.json
        ├── vite.config.ts
        └── .storybook
            └── preview.ts

mukunku and others added 13 commits September 16, 2025 10:39
in this commit I have done the following:
- ensure that the correct typescript config is picked up by the svelte config (and consequentially vite)
- ensure that svelte-sonnet does not get prebundled by esbuild (this was causing issues for the tests)
- Keep peer dependencies for stacks svelte marked (we cannot put * because that would indicate that consumers can install any svelte or stacks classic version which is not the case)
- Adjust stacks svelte web test runner config to point at the css bundle generated in stacks classic and also ensure that a fresh build of stacks classic is run before running the tests (I also removed the reference to stacks.js because we don't depend on that in stacks-svelte)
- IMPORTANT: Ensure that storybook point at our stacks.less bundle in the preview.ts file. This has the benefit that whatever styles we change in stacks classic it will be hot reloaded in storybook (this is pretty much the whole point why we switch to monorepo - make a change in stacks classic and see it reflected in stacks svelte in a matter of milliseconds - pretty cool :) )
- There are 2 unit tests failing for the Select component - I have not looked too much into it because the component need to be migrated to use the new Svelte 5 runes API. Before spending too much time trying to debug the tests I would rather go ahead and migrate it. It should be rather simple.
Copy link

changeset-bot bot commented Oct 1, 2025

🦋 Changeset detected

Latest commit: 0aa46de

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented Oct 1, 2025

Deploy Preview for stacks failed. Why did it fail? →

Name Link
🔨 Latest commit 11087f6
🔍 Latest deploy log https://app.netlify.com/projects/stacks/deploys/68e0108f6128d60008ed917b

Copy link

netlify bot commented Oct 3, 2025

Deploy Preview for sal-docs canceled.

Name Link
🔨 Latest commit e09becd
🔍 Latest deploy log https://app.netlify.com/projects/sal-docs/deploys/68dfe6ab7796390008b25483

@mukunku mukunku requested review from giamir and dancormier October 3, 2025 13:42
Comment on lines +1 to +4
import "@stackoverflow/stacks/lib/index";
import "../less/stacks-documentation.less";
import "./controllers/docs-resizer";
import * as Stacks from "../../../stacks-classic/lib/index";
import * as Stacks from "@stackoverflow/stacks/lib/index";
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm creates symbolic links of local peer dependencies inside node_modules so it's possible to reference the files as an npm package. Thought that was cool so changed these imports to this. Let me know if we think relative paths were better here.

Copy link

netlify bot commented Oct 3, 2025

Deploy Preview for stacks-svelte ready!

Name Link
🔨 Latest commit 0aa46de
🔍 Latest deploy log https://app.netlify.com/projects/stacks-svelte/deploys/68e4354125db6b0008e58650
😎 Deploy Preview https://deploy-preview-1991--stacks-svelte.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

netlify bot commented Oct 3, 2025

Deploy Preview for stacks ready!

Name Link
🔨 Latest commit 0aa46de
🔍 Latest deploy log https://app.netlify.com/projects/stacks/deploys/68e43541062aa500082ca87d
😎 Deploy Preview https://deploy-preview-1991--stacks.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@@ -0,0 +1,26 @@
import type { Preview } from "@storybook/svelte";
import "@stackoverflow/stacks/lib/stacks.less";
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above:

npm creates symbolic links of local peer dependencies inside node_modules so it's possible to reference the files as an npm package. Thought that was cool so changed these imports to this. Let me know if we think relative paths were better here.

@StackExchange StackExchange deleted a comment from netlify bot Oct 3, 2025
@mukunku mukunku marked this pull request as ready for review October 3, 2025 19:11
@@ -0,0 +1,43 @@
{
"name": "@stackoverflow/stacks-svelte",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed the package from @stackeng/stacks-svelte to @stackoverflow/stacks-svelte so it matches the org name for stacks classic. We can update internal consumers to the new package in separate PR's.

Copy link
Contributor

@dancormier dancormier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work with this @mukunku! I have one minor suggestion but nothing so significant that see it unchanged would be a real issue.

@dancormier
Copy link
Contributor

dancormier commented Oct 6, 2025

Context for @giamir / @ttaylor-stack

I've reviewed this PR and found it to be pretty solid. The only necessary further context I think is necessary is the follow up tasks to happen post-merge:

@mukunku mukunku merged commit b9dba0e into develop Oct 7, 2025
16 checks passed
@mukunku mukunku deleted the sal/SPARK-48 branch October 7, 2025 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants