@stackoverflow/stacks 2.5.3 → 2.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.MD +9 -9
- package/README.md +180 -180
- package/dist/css/stacks.css +104 -122
- package/dist/css/stacks.min.css +1 -1
- package/lib/atomic/border.less +139 -139
- package/lib/atomic/color.less +36 -36
- package/lib/atomic/flex.less +426 -426
- package/lib/atomic/gap.less +44 -44
- package/lib/atomic/grid.less +139 -139
- package/lib/atomic/misc.less +374 -374
- package/lib/atomic/spacing.less +98 -98
- package/lib/atomic/typography.less +264 -264
- package/lib/atomic/width-height.less +194 -194
- package/lib/base/body.less +44 -44
- package/lib/base/configuration-static.less +61 -61
- package/lib/base/fieldset.less +5 -5
- package/lib/base/icon.less +11 -11
- package/lib/base/internal.less +220 -220
- package/lib/base/reset-meyer.less +64 -64
- package/lib/base/reset-normalize.less +449 -449
- package/lib/base/reset.less +20 -20
- package/lib/components/activity-indicator/activity-indicator.less +53 -53
- package/lib/components/anchor/anchor.less +78 -68
- package/lib/components/avatar/avatar.less +108 -108
- package/lib/components/award-bling/award-bling.less +31 -31
- package/lib/components/badge/badge.less +258 -258
- package/lib/components/banner/banner.less +44 -44
- package/lib/components/banner/banner.ts +149 -149
- package/lib/components/block-link/block-link.less +82 -82
- package/lib/components/breadcrumbs/breadcrumbs.less +41 -41
- package/lib/components/button/button.less +473 -473
- package/lib/components/button-group/button-group.less +82 -82
- package/lib/components/card/card.less +37 -37
- package/lib/components/check-control/check-control.less +17 -17
- package/lib/components/check-group/check-group.less +19 -19
- package/lib/components/checkbox_radio/checkbox_radio.less +159 -159
- package/lib/components/code-block/code-block.fixtures.ts +88 -88
- package/lib/components/code-block/code-block.less +116 -116
- package/lib/components/description/description.less +9 -9
- package/lib/components/empty-state/empty-state.less +16 -16
- package/lib/components/expandable/expandable.less +118 -118
- package/lib/components/expandable/expandable.ts +238 -238
- package/lib/components/input-fill/input-fill.less +35 -35
- package/lib/components/input-icon/input-icon.less +45 -45
- package/lib/components/input-message/input-message.less +49 -49
- package/lib/components/input_textarea/input_textarea.less +150 -150
- package/lib/components/label/label.less +110 -110
- package/lib/components/link/link.less +135 -120
- package/lib/components/link-preview/link-preview.less +148 -148
- package/lib/components/menu/menu.less +41 -41
- package/lib/components/modal/modal.less +118 -118
- package/lib/components/modal/modal.ts +383 -383
- package/lib/components/navigation/navigation.less +136 -136
- package/lib/components/navigation/navigation.ts +128 -128
- package/lib/components/notice/notice.less +195 -195
- package/lib/components/page-title/page-title.less +51 -51
- package/lib/components/pagination/pagination.less +65 -65
- package/lib/components/popover/popover.less +159 -157
- package/lib/components/popover/popover.ts +651 -651
- package/lib/components/popover/tooltip.ts +343 -343
- package/lib/components/post-summary/post-summary.less +457 -447
- package/lib/components/progress-bar/progress-bar.less +291 -291
- package/lib/components/prose/prose.less +452 -452
- package/lib/components/select/select.less +138 -138
- package/lib/components/sidebar-widget/sidebar-widget.less +257 -257
- package/lib/components/spinner/spinner.less +103 -103
- package/lib/components/table/table.less +307 -307
- package/lib/components/table/table.ts +296 -296
- package/lib/components/table-container/table-container.less +4 -4
- package/lib/components/tag/tag.less +186 -186
- package/lib/components/toast/toast.less +35 -35
- package/lib/components/toast/toast.ts +357 -357
- package/lib/components/toggle-switch/toggle-switch.less +104 -104
- package/lib/components/topbar/topbar.less +553 -553
- package/lib/components/uploader/uploader.less +205 -205
- package/lib/components/uploader/uploader.ts +207 -207
- package/lib/components/user-card/user-card.less +129 -129
- package/lib/controllers.ts +33 -33
- package/lib/exports/color-mixins.less +283 -283
- package/lib/exports/color-sets.less +711 -711
- package/lib/exports/color.less +65 -65
- package/lib/exports/constants-helpers.less +108 -108
- package/lib/exports/constants-type.less +155 -155
- package/lib/exports/exports.less +15 -15
- package/lib/exports/mixins.less +333 -333
- package/lib/exports/spacing-mixins.less +67 -67
- package/lib/index.ts +32 -32
- package/lib/input-utils.less +41 -41
- package/lib/stacks-dynamic.less +24 -24
- package/lib/stacks-static.less +93 -93
- package/lib/stacks.less +13 -13
- package/lib/stacks.ts +113 -113
- package/lib/test/a11y-test-utils.ts +94 -94
- package/lib/test/assertions.ts +36 -36
- package/lib/test/less-test-utils.ts +28 -28
- package/lib/test/open-wc-testing-patch.d.ts +26 -26
- package/lib/test/test-utils.ts +364 -364
- package/lib/test/visual-test-utils.ts +58 -58
- package/lib/tsconfig.build.json +4 -4
- package/lib/tsconfig.json +17 -17
- package/package.json +115 -115
package/LICENSE.MD
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright 2017-2024 Stack Exchange Inc.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright 2017-2024 Stack Exchange Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,180 +1,180 @@
|
|
|
1
|
-
# Stacks
|
|
2
|
-
|
|
3
|
-
[![ci status][gh-action-badge]][gh-action-url] [![npm version][npm-badge]][npm-url]
|
|
4
|
-
|
|
5
|
-
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
|
-
|
|
7
|
-
Our documentation is built with Stacks itself, using its [immutable, atomic classes](http://johnpolacek.com/rethinking/) and components.
|
|
8
|
-
|
|
9
|
-
The Stacks website documents:
|
|
10
|
-
|
|
11
|
-
### Product
|
|
12
|
-
- Semantic and accessible component markup
|
|
13
|
-
- Cross-browser compatible Less / CSS
|
|
14
|
-
- An [icon library](https://github.com/StackExchange/Stacks-Icons)
|
|
15
|
-
|
|
16
|
-
### Email
|
|
17
|
-
- Email templates & components
|
|
18
|
-
|
|
19
|
-
Stacks documentation can be found at https://stackoverflow.design/
|
|
20
|
-
|
|
21
|
-
## Table of contents
|
|
22
|
-
|
|
23
|
-
- [Using Stacks](#using-stacks)
|
|
24
|
-
- [Migrating from v1 to v2](#migrating-from-v1-to-v2)
|
|
25
|
-
- [Building Stacks](#building-stacks)
|
|
26
|
-
- [Format Stacks](#format-stacks)
|
|
27
|
-
- [Linting Stacks](#linting-stacks)
|
|
28
|
-
- [Testing Stacks](#testing-stacks)
|
|
29
|
-
- [Releasing Stacks](#releasing-a-new-version-of-stacks)
|
|
30
|
-
- [Bugs and feature requests](#bugs-and-feature-requests)
|
|
31
|
-
- [Contributing](#contributing)
|
|
32
|
-
- [License](#license)
|
|
33
|
-
|
|
34
|
-
## Using Stacks
|
|
35
|
-
Using Stacks is outlined in our [usage guidelines](https://stackoverflow.design/product/develop/using-stacks).
|
|
36
|
-
|
|
37
|
-
## Migrating from v1 to v2
|
|
38
|
-
|
|
39
|
-
To migrate from Stacks v1 to v2, see our [migration guide](/MIGRATION_GUIDE.md).
|
|
40
|
-
|
|
41
|
-
## Building Stacks
|
|
42
|
-
To contribute to Stacks documentation or its CSS library, you’ll need to build Stacks locally. View our [building guidelines](https://stackoverflow.design/product/develop/building).
|
|
43
|
-
|
|
44
|
-
Having trouble getting these steps to work? Open [an issue](https://github.com/StackExchange/Stacks/issues/new) with a `setup` label.
|
|
45
|
-
|
|
46
|
-
## Format Stacks
|
|
47
|
-
|
|
48
|
-
Format the source code with prettier via running:
|
|
49
|
-
```sh
|
|
50
|
-
npm run format
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Linting Stacks
|
|
54
|
-
|
|
55
|
-
Run all lint suites by running:
|
|
56
|
-
```sh
|
|
57
|
-
npm run lint
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Lint the styles (stylelint) by running:
|
|
61
|
-
```sh
|
|
62
|
-
npm run lint:css
|
|
63
|
-
```
|
|
64
|
-
Lint the typescript source code (eslint) via running:
|
|
65
|
-
```sh
|
|
66
|
-
npm run lint:ts
|
|
67
|
-
```
|
|
68
|
-
Lint the source code format (prettier) via running:
|
|
69
|
-
```sh
|
|
70
|
-
npm run lint:format
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
## Testing Stacks
|
|
74
|
-
|
|
75
|
-
Run all test suites by running:
|
|
76
|
-
```sh
|
|
77
|
-
npm test
|
|
78
|
-
```
|
|
79
|
-
### Unit/Component Tests
|
|
80
|
-
|
|
81
|
-
Unit/Component tests are written with [DOM Testing Library](https://testing-library.com/docs/dom-testing-library/intro).
|
|
82
|
-
Please follow the library's principles and documentation to write tests.
|
|
83
|
-
|
|
84
|
-
Stacks 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.
|
|
85
|
-
|
|
86
|
-
Execute the unit/component tests suite by running:
|
|
87
|
-
```sh
|
|
88
|
-
npm run test:unit
|
|
89
|
-
```
|
|
90
|
-
or if you prefer watch mode run:
|
|
91
|
-
```sh
|
|
92
|
-
npm run test:unit:watch
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### Visual Regression Tests
|
|
96
|
-
|
|
97
|
-
**Prerequisites:**
|
|
98
|
-
- `git lfs` ([installation docs](https://docs.github.com/en/repositories/working-with-files/managing-large-files/installing-git-large-file-storage))
|
|
99
|
-
- `docker` ([installation docs](https://docs.docker.com/engine/install/))
|
|
100
|
-
- `pwsh` ([Installation docs](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.3))
|
|
101
|
-
- Run `git config diff.lfs.textconv cat` to make sure image diff works as expected ([More info](https://github.com/microsoft/vscode/issues/86611#issuecomment-875894108))
|
|
102
|
-
|
|
103
|
-
This [Web Test Runner plugin](https://www.npmjs.com/package/@web/test-runner-visual-regression) is used to run visual regression tests.
|
|
104
|
-
Visual regression tests end with this suffix `*.visual.test.ts`.
|
|
105
|
-
|
|
106
|
-
Execute the visual regression tests suite by running:
|
|
107
|
-
```sh
|
|
108
|
-
npm run test:visual
|
|
109
|
-
```
|
|
110
|
-
After the first run, if there are failing snapshots, they end up overriding the baseline ones in the filesystem (e.g. `/screenshots/<browser>/baseline/<name>.png`).
|
|
111
|
-
We do this for easier comparison of the dif directly in vscode and to make sure only the failing snapshots get regenerated (see [this GH discussion](https://github.com/modernweb-dev/web/discussions/427#discussioncomment-3543771) that inspired the approach).
|
|
112
|
-
|
|
113
|
-
We also recommend to install [this vscode extension](https://marketplace.visualstudio.com/items?itemName=RayWiis.png-image-diff) for getting better diffs.
|
|
114
|
-
|
|
115
|
-
### Less Tests
|
|
116
|
-
|
|
117
|
-
This is an experimental suite to test the generation of CSS from Less files.
|
|
118
|
-
Less tests end with this suffix `*.less.test.ts`.
|
|
119
|
-
|
|
120
|
-
Execute the less tests suite by running:
|
|
121
|
-
```sh
|
|
122
|
-
npm run test:less
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
Update the css snapshots via:
|
|
126
|
-
```sh
|
|
127
|
-
npm run test:less:update
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
## Releasing a new version of Stacks
|
|
131
|
-
Stacks uses [Semantic Versioning](https://semver.org/), is distributed via [npm](https://www.npmjs.com/package/@stackoverflow/stacks), and publishes [release notes on Github](https://github.com/StackExchange/Stacks/releases). Follow the steps below to release a new version of Stacks.
|
|
132
|
-
|
|
133
|
-
### Bump the version number
|
|
134
|
-
```sh
|
|
135
|
-
npm version [major | minor | patch]
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
### Push the new tag
|
|
139
|
-
```sh
|
|
140
|
-
git push && git push --tags
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### Create release notes [on Github](https://github.com/StackExchange/Stacks/releases/new)
|
|
144
|
-
|
|
145
|
-
1. Visit https://github.com/StackExchange/Stacks/releases/new
|
|
146
|
-
1. Choose your new version from the "Choose a tag" dropdown
|
|
147
|
-
1. Click "Generate release notes"
|
|
148
|
-
1. Cleanup and complete the release notes
|
|
149
|
-
- Prominently mention any breaking changes, if applicable
|
|
150
|
-
- Include a "What's Changed" section in the release notes
|
|
151
|
-
- Mention significant bug fixes
|
|
152
|
-
- Mention new features
|
|
153
|
-
- Mention significant under-the-hood changes that could impact consumers
|
|
154
|
-
|
|
155
|
-
### Ship your newly created version to [npm](https://www.npmjs.com/package/@stackoverflow/stacks)
|
|
156
|
-
```sh
|
|
157
|
-
npm publish
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
### Merge `develop` into `production` and push
|
|
161
|
-
```sh
|
|
162
|
-
git checkout production && git merge develop && git push
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
### Push the updated docs site
|
|
166
|
-
Head to [Netlify](https://app.netlify.com), navigate to the Stacks overview, click on "Production deploys", and select "Deploy site" from the "Trigger deploy" dropdown.
|
|
167
|
-
|
|
168
|
-
## Bugs and feature requests
|
|
169
|
-
Have a bug or feature request? First search existing or closed issues to make sure the issue hasn’t been noted yet. If not, review our [issue guidelines](/CONTRIBUTING.md#open-an-issue) for submitting [a bug report](/CONTRIBUTING.md#reporting-bugs) or [feature request](/CONTRIBUTING.md#feature-requests).
|
|
170
|
-
|
|
171
|
-
## Contributing
|
|
172
|
-
If you’d like to contribute to Stacks, please read through our [contribution guidelines](/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development.
|
|
173
|
-
|
|
174
|
-
## License
|
|
175
|
-
Code and documentation copyright 2017-2024 Stack Exchange, Inc and released under the [MIT License](/LICENSE.MD).
|
|
176
|
-
|
|
177
|
-
[gh-action-url]: https://github.com/StackExchange/Stacks/actions/workflows/main.yml
|
|
178
|
-
[gh-action-badge]: https://github.com/StackExchange/Stacks/actions/workflows/workflow.yml/badge.svg?branch=develop
|
|
179
|
-
[npm-url]: https://npmjs.org/package/@stackoverflow/stacks
|
|
180
|
-
[npm-badge]: https://img.shields.io/npm/v/@stackoverflow/stacks.svg
|
|
1
|
+
# Stacks
|
|
2
|
+
|
|
3
|
+
[![ci status][gh-action-badge]][gh-action-url] [![npm version][npm-badge]][npm-url]
|
|
4
|
+
|
|
5
|
+
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
|
+
|
|
7
|
+
Our documentation is built with Stacks itself, using its [immutable, atomic classes](http://johnpolacek.com/rethinking/) and components.
|
|
8
|
+
|
|
9
|
+
The Stacks website documents:
|
|
10
|
+
|
|
11
|
+
### Product
|
|
12
|
+
- Semantic and accessible component markup
|
|
13
|
+
- Cross-browser compatible Less / CSS
|
|
14
|
+
- An [icon library](https://github.com/StackExchange/Stacks-Icons)
|
|
15
|
+
|
|
16
|
+
### Email
|
|
17
|
+
- Email templates & components
|
|
18
|
+
|
|
19
|
+
Stacks documentation can be found at https://stackoverflow.design/
|
|
20
|
+
|
|
21
|
+
## Table of contents
|
|
22
|
+
|
|
23
|
+
- [Using Stacks](#using-stacks)
|
|
24
|
+
- [Migrating from v1 to v2](#migrating-from-v1-to-v2)
|
|
25
|
+
- [Building Stacks](#building-stacks)
|
|
26
|
+
- [Format Stacks](#format-stacks)
|
|
27
|
+
- [Linting Stacks](#linting-stacks)
|
|
28
|
+
- [Testing Stacks](#testing-stacks)
|
|
29
|
+
- [Releasing Stacks](#releasing-a-new-version-of-stacks)
|
|
30
|
+
- [Bugs and feature requests](#bugs-and-feature-requests)
|
|
31
|
+
- [Contributing](#contributing)
|
|
32
|
+
- [License](#license)
|
|
33
|
+
|
|
34
|
+
## Using Stacks
|
|
35
|
+
Using Stacks is outlined in our [usage guidelines](https://stackoverflow.design/product/develop/using-stacks).
|
|
36
|
+
|
|
37
|
+
## Migrating from v1 to v2
|
|
38
|
+
|
|
39
|
+
To migrate from Stacks v1 to v2, see our [migration guide](/MIGRATION_GUIDE.md).
|
|
40
|
+
|
|
41
|
+
## Building Stacks
|
|
42
|
+
To contribute to Stacks documentation or its CSS library, you’ll need to build Stacks locally. View our [building guidelines](https://stackoverflow.design/product/develop/building).
|
|
43
|
+
|
|
44
|
+
Having trouble getting these steps to work? Open [an issue](https://github.com/StackExchange/Stacks/issues/new) with a `setup` label.
|
|
45
|
+
|
|
46
|
+
## Format Stacks
|
|
47
|
+
|
|
48
|
+
Format the source code with prettier via running:
|
|
49
|
+
```sh
|
|
50
|
+
npm run format
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Linting Stacks
|
|
54
|
+
|
|
55
|
+
Run all lint suites by running:
|
|
56
|
+
```sh
|
|
57
|
+
npm run lint
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Lint the styles (stylelint) by running:
|
|
61
|
+
```sh
|
|
62
|
+
npm run lint:css
|
|
63
|
+
```
|
|
64
|
+
Lint the typescript source code (eslint) via running:
|
|
65
|
+
```sh
|
|
66
|
+
npm run lint:ts
|
|
67
|
+
```
|
|
68
|
+
Lint the source code format (prettier) via running:
|
|
69
|
+
```sh
|
|
70
|
+
npm run lint:format
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Testing Stacks
|
|
74
|
+
|
|
75
|
+
Run all test suites by running:
|
|
76
|
+
```sh
|
|
77
|
+
npm test
|
|
78
|
+
```
|
|
79
|
+
### Unit/Component Tests
|
|
80
|
+
|
|
81
|
+
Unit/Component tests are written with [DOM Testing Library](https://testing-library.com/docs/dom-testing-library/intro).
|
|
82
|
+
Please follow the library's principles and documentation to write tests.
|
|
83
|
+
|
|
84
|
+
Stacks 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.
|
|
85
|
+
|
|
86
|
+
Execute the unit/component tests suite by running:
|
|
87
|
+
```sh
|
|
88
|
+
npm run test:unit
|
|
89
|
+
```
|
|
90
|
+
or if you prefer watch mode run:
|
|
91
|
+
```sh
|
|
92
|
+
npm run test:unit:watch
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Visual Regression Tests
|
|
96
|
+
|
|
97
|
+
**Prerequisites:**
|
|
98
|
+
- `git lfs` ([installation docs](https://docs.github.com/en/repositories/working-with-files/managing-large-files/installing-git-large-file-storage))
|
|
99
|
+
- `docker` ([installation docs](https://docs.docker.com/engine/install/))
|
|
100
|
+
- `pwsh` ([Installation docs](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.3))
|
|
101
|
+
- Run `git config diff.lfs.textconv cat` to make sure image diff works as expected ([More info](https://github.com/microsoft/vscode/issues/86611#issuecomment-875894108))
|
|
102
|
+
|
|
103
|
+
This [Web Test Runner plugin](https://www.npmjs.com/package/@web/test-runner-visual-regression) is used to run visual regression tests.
|
|
104
|
+
Visual regression tests end with this suffix `*.visual.test.ts`.
|
|
105
|
+
|
|
106
|
+
Execute the visual regression tests suite by running:
|
|
107
|
+
```sh
|
|
108
|
+
npm run test:visual
|
|
109
|
+
```
|
|
110
|
+
After the first run, if there are failing snapshots, they end up overriding the baseline ones in the filesystem (e.g. `/screenshots/<browser>/baseline/<name>.png`).
|
|
111
|
+
We do this for easier comparison of the dif directly in vscode and to make sure only the failing snapshots get regenerated (see [this GH discussion](https://github.com/modernweb-dev/web/discussions/427#discussioncomment-3543771) that inspired the approach).
|
|
112
|
+
|
|
113
|
+
We also recommend to install [this vscode extension](https://marketplace.visualstudio.com/items?itemName=RayWiis.png-image-diff) for getting better diffs.
|
|
114
|
+
|
|
115
|
+
### Less Tests
|
|
116
|
+
|
|
117
|
+
This is an experimental suite to test the generation of CSS from Less files.
|
|
118
|
+
Less tests end with this suffix `*.less.test.ts`.
|
|
119
|
+
|
|
120
|
+
Execute the less tests suite by running:
|
|
121
|
+
```sh
|
|
122
|
+
npm run test:less
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Update the css snapshots via:
|
|
126
|
+
```sh
|
|
127
|
+
npm run test:less:update
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Releasing a new version of Stacks
|
|
131
|
+
Stacks uses [Semantic Versioning](https://semver.org/), is distributed via [npm](https://www.npmjs.com/package/@stackoverflow/stacks), and publishes [release notes on Github](https://github.com/StackExchange/Stacks/releases). Follow the steps below to release a new version of Stacks.
|
|
132
|
+
|
|
133
|
+
### Bump the version number
|
|
134
|
+
```sh
|
|
135
|
+
npm version [major | minor | patch]
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Push the new tag
|
|
139
|
+
```sh
|
|
140
|
+
git push && git push --tags
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Create release notes [on Github](https://github.com/StackExchange/Stacks/releases/new)
|
|
144
|
+
|
|
145
|
+
1. Visit https://github.com/StackExchange/Stacks/releases/new
|
|
146
|
+
1. Choose your new version from the "Choose a tag" dropdown
|
|
147
|
+
1. Click "Generate release notes"
|
|
148
|
+
1. Cleanup and complete the release notes
|
|
149
|
+
- Prominently mention any breaking changes, if applicable
|
|
150
|
+
- Include a "What's Changed" section in the release notes
|
|
151
|
+
- Mention significant bug fixes
|
|
152
|
+
- Mention new features
|
|
153
|
+
- Mention significant under-the-hood changes that could impact consumers
|
|
154
|
+
|
|
155
|
+
### Ship your newly created version to [npm](https://www.npmjs.com/package/@stackoverflow/stacks)
|
|
156
|
+
```sh
|
|
157
|
+
npm publish
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Merge `develop` into `production` and push
|
|
161
|
+
```sh
|
|
162
|
+
git checkout production && git merge develop && git push
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Push the updated docs site
|
|
166
|
+
Head to [Netlify](https://app.netlify.com), navigate to the Stacks overview, click on "Production deploys", and select "Deploy site" from the "Trigger deploy" dropdown.
|
|
167
|
+
|
|
168
|
+
## Bugs and feature requests
|
|
169
|
+
Have a bug or feature request? First search existing or closed issues to make sure the issue hasn’t been noted yet. If not, review our [issue guidelines](/CONTRIBUTING.md#open-an-issue) for submitting [a bug report](/CONTRIBUTING.md#reporting-bugs) or [feature request](/CONTRIBUTING.md#feature-requests).
|
|
170
|
+
|
|
171
|
+
## Contributing
|
|
172
|
+
If you’d like to contribute to Stacks, please read through our [contribution guidelines](/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development.
|
|
173
|
+
|
|
174
|
+
## License
|
|
175
|
+
Code and documentation copyright 2017-2024 Stack Exchange, Inc and released under the [MIT License](/LICENSE.MD).
|
|
176
|
+
|
|
177
|
+
[gh-action-url]: https://github.com/StackExchange/Stacks/actions/workflows/main.yml
|
|
178
|
+
[gh-action-badge]: https://github.com/StackExchange/Stacks/actions/workflows/workflow.yml/badge.svg?branch=develop
|
|
179
|
+
[npm-url]: https://npmjs.org/package/@stackoverflow/stacks
|
|
180
|
+
[npm-badge]: https://img.shields.io/npm/v/@stackoverflow/stacks.svg
|