You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix stacks classic readme
* initial bulk move
* move folders around and bring latest toast changes from the old repo
* package-lock.json
* package.json tweaks
* prettier format
* fix node_modules path
* add local build script to get storybooks working
* bump some package versions
* package-lock.json
* fix storybook and most of the tests setup
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.
* small tweaks
* adjust test workflows to integrate stacks-svelte
* we need to build to test in ci
* pass workspaces
* run tests individually
* add dependency includes to vite
* lint fixes also don't fail fast
* lint fixes
* rename workflow
* create netlify.toml for stacks-svelte
* adjust readme's
* remove Okta login from svelte docs site
* disable git lfs in netlify.toml
* move git_lfs_enabled to env variables section
* add comment
* fix quotes
* tweak storybook overview doc
* fix org name and version
* adjust readme
* adjust changeset for stacks-svelte
* fix expected workflow
* adjust names further
* append workspace to svelte commands
* updated the UserCard for deleted=true prop
* formatting
---------
Co-authored-by: Giamir Buoncristiani <[email protected]>
Co-authored-by: Dan Cormier <[email protected]>
Co-authored-by: Dan Cormier <[email protected]>
Stacks is Stack Overflow’s design system. It includes the resources needed to create consistent, predictable interfaces and workflows that conform to Stack Overflow’s principles, design language, and best practices.
6
4
7
5
Our documentation is built with Stacks itself, using its [immutable, atomic classes](http://johnpolacek.com/rethinking/) and components.
8
6
9
7
The Stacks website documents:
10
8
11
-
###Product
9
+
## Product
12
10
- Semantic and accessible component markup
13
11
- Cross-browser compatible Less / CSS
14
12
- An [icon library](https://github.com/StackExchange/Stacks-Icons)
13
+
- Svelte implementation of our library
15
14
16
-
###Email
15
+
## Email
17
16
- Email templates & components
18
17
19
-
Stacks documentation can be found at https://stackoverflow.design/
20
-
21
18
## Table of contents
22
19
23
20
-[Using Stacks](#using-stacks)
@@ -30,14 +27,14 @@ Stacks documentation can be found at https://stackoverflow.design/
30
27
-[Contributing](#contributing)
31
28
-[License](#license)
32
29
33
-
##Using Stacks
30
+
# Using Stacks
34
31
Using Stacks is outlined in our [usage guidelines](https://stackoverflow.design/product/develop/using-stacks).
35
32
36
33
## Migrating from v1 to v2
37
34
38
35
To migrate from Stacks v1 to v2, see our [migration guide](/MIGRATION_GUIDE.md).
39
36
40
-
##Local Development
37
+
# Local Development
41
38
42
39
This repo follows a monolithic structure and contains multiple packages split into [npm workspaces](https://docs.npmjs.com/cli/v9/using-npm/workspaces). These can be found under the [packages/](https://github.com/StackExchange/Stacks/tree/develop/packages) folder.
43
40
@@ -58,10 +55,14 @@ npm start
58
55
```
59
56
This command will pull up the local dev server at http://localhost:8080. You can also view our [building guidelines](https://stackoverflow.design/product/develop/building).
This workspace contains the css and js sources that define and power the Stacks design system.
64
63
64
+
### Formatting
65
+
65
66
Format the source code with prettier by running:
66
67
```sh
67
68
npm run format -w packages/stacks-classic
@@ -143,7 +144,46 @@ Update the css snapshots via:
143
144
npm run test:less:update -w packages/stacks-classic
144
145
```
145
146
146
-
## Releasing a new version of Stacks Docs / Stacks Classic
147
+
## Stacks Svelte
148
+
149
+
This workspace contains a Svelte implementation of the Stacks Classic design system. Unlike the Stacks-Classic workspace which has its documentation defined in the separate Stacks-Docs workspace, this one defines its documentation site directly within its own workspace which can be reached via https://svelte.stackoverflow.design
150
+
151
+
We use [storybook](https://storybook.js.org/) for local development. To start the storybook server run:
152
+
153
+
```bash
154
+
npm run storybook -w packages/stacks-svelte
155
+
```
156
+
157
+
The storybook server will reflect the changes you make to the components stories in real time.
158
+
We use [this addon](https://storybook.js.org/addons/@storybook/addon-svelte-csf) to write stories directly in Svelte syntax. Stories need to have the `*.stories.svelte` extension to be picked up.
159
+
160
+
### Formatting
161
+
162
+
```bash
163
+
npm run format -w packages/stacks-svelte
164
+
```
165
+
166
+
### Linting
167
+
168
+
```bash
169
+
npm run lint -w packages/stacks-svelte
170
+
```
171
+
172
+
### Testing
173
+
174
+
Stacks Svelte uses [Web Test Runner](https://modern-web.dev/docs/test-runner/overview/) and [Playwright](https://modern-web.dev/docs/test-runner/browser-launchers/playwright/) to run tests in a real browser context.
175
+
176
+
```bash
177
+
npm run test -w packages/stacks-svelte
178
+
```
179
+
180
+
or to run the tests in watch mode:
181
+
182
+
```bash
183
+
npm run test:watch -w packages/stacks-svelte
184
+
```
185
+
186
+
# Releasing a new version of Stacks Docs + Stacks Classic or Stacks Svelte
147
187
This repo uses [Semantic Versioning](https://semver.org/) to distribute Stacks Classic and Stacks Docs via [npm](https://www.npmjs.com/package/@stackoverflow/stacks), and publishes [release notes on Github](https://github.com/StackExchange/Stacks/releases).
148
188
149
189
We use [changesets](https://github.com/changesets/changesets) to automatize the steps necessary to publish to NPM, create GH releases and a changelog.
As more complex components are landing into Stacks Svelte (e.g. Modal, TextInput, etc...) we need a strategy to localize the text contained in those components (e.g. Close Button Label in the Modal) rather than keeping it hardcoded.
10
+
11
+
## Decision
12
+
13
+
We decided to delegate localization and translation concerns to consumers of the library exposing optional props prefixed by `i18n`. The default value of these props will be the English translation (which we will always fallback to in case consumer don't specify the props).
14
+
**No hardcoded text is allowed in any component under any circumnstances.**
Using props and delegating localization concerns to the consumers of the library is the simplest approach we can take to ship components that can be correctly rendered in internationalized pages and apps.
25
+
The picked approach will also make consumption of those components possible with different translation engines (e.g. moonspeak in Core, a potential new translation engine, etc...).
26
+
The downside of the approach is that the API of the components could become a bit bloated with a proliferation of optional props dedicated to pass on localized text. It also create more work for consumers who need to curate and provide the translations.
27
+
28
+
We have considered maintaining localization files for primary languages ourselves and provide the ability for consumers to register their own translations. This solution would be more complex and it will increase maintainance work on our small team therefore we decided to avoid it for now.
29
+
30
+
We don't exclude providing a different way for consumer to localize Stacks Svelte components in the future as the community tools and best practices on this topic evolve. We also expect this ADR to evolve over time as our library grow (e.g. if/when we will introduce a date picker).
31
+
32
+
## Further Reading
33
+
34
+
-[Carbon Svelte Component Library using props for localization](https://github.com/carbon-design-system/carbon-components-svelte/issues/858)
0 commit comments