Skip to content

Commit 2781fb4

Browse files
authored
V1 api (#151)
Add v1 API as discussed in #150
1 parent 7793928 commit 2781fb4

101 files changed

Lines changed: 1498 additions & 3570 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
runs-on: ubuntu-latest
2626
strategy:
2727
matrix:
28-
rails_version: [6.0.6, 6.1.7, 7.0.4, main]
28+
rails_version: [6.0.6, 6.1.7, 7.0.4]
2929
ruby_version: [2.6.10, 2.7.7, 3.0.5, 3.1.3]
3030
exclude:
3131
- rails_version: 6.0.6
@@ -36,8 +36,8 @@ jobs:
3636
ruby_version: 2.5.9
3737
- rails_version: 7.0.4
3838
ruby_version: 2.6.10
39-
- rails_version: main
40-
ruby_version: 2.6.10
39+
# - rails_version: main
40+
# ruby_version: 2.6.10
4141
steps:
4242
- uses: actions/checkout@master
4343
- name: Setup Ruby

Gemfile.lock

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
PATH
22
remote: .
33
specs:
4-
view_component_storybook (0.12.1)
4+
view_component-storybook (1.0.0)
55
view_component (>= 2.54)
6+
yard (~> 0.9.25)
67

78
GEM
89
remote: https://rubygems.org/
@@ -185,7 +186,7 @@ GEM
185186
rspec-mocks (~> 3.10)
186187
rspec-support (~> 3.10)
187188
rspec-support (3.12.0)
188-
rubocop (1.40.0)
189+
rubocop (1.41.1)
189190
json (~> 2.3)
190191
parallel (~> 1.10)
191192
parser (>= 3.1.2.1)
@@ -232,11 +233,14 @@ GEM
232233
activesupport (>= 5.2.0, < 8.0)
233234
concurrent-ruby (~> 1.0)
234235
method_source (~> 1.0)
236+
webrick (1.7.0)
235237
websocket-driver (0.7.5)
236238
websocket-extensions (>= 0.1.0)
237239
websocket-extensions (0.1.5)
238240
xpath (3.2.0)
239241
nokogiri (~> 1.8)
242+
yard (0.9.28)
243+
webrick (~> 1.7.0)
240244
zeitwerk (2.6.6)
241245

242246
PLATFORMS
@@ -257,7 +261,7 @@ DEPENDENCIES
257261
simplecov (~> 0.21.2)
258262
simplecov-console (~> 0.9)
259263
sprockets-rails (~> 3.4.2)
260-
view_component_storybook!
264+
view_component-storybook!
261265

262266
BUNDLED WITH
263267
2.3.26

app/controllers/view_component/storybook/stories_controller.rb

Lines changed: 0 additions & 46 deletions
This file was deleted.

app/views/view_component/storybook/stories/show.html.erb

Lines changed: 0 additions & 8 deletions
This file was deleted.

config/locales/en.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

docs/CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Last 0.x release
4444
* Klazz Control
4545
* Deprecated Controls DSL
4646
* Add support for Object Controls with array values
47-
* Remove ArrayConfig - array aliases ObjectConfig
47+
* Remove ArrayConfig - array aliases Object
4848
* Updated Options Control to match Storybook 6.2 syntax
4949
* `options` as array
5050
* add `labels` option
@@ -64,6 +64,6 @@ Last 0.x release
6464

6565
## 0.7.0
6666

67-
* Add inclusion validation to NumberConfig type
68-
* Support ObjectConfigs with nested values
67+
* Add inclusion validation to Number type
68+
* Support Objects with nested values
6969
* Support nil control values

docs/configuration.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ FOr local development this is typically:
1414
// .storybook/preview.js
1515
export const parameters = {
1616
server: {
17-
url: `http://localhost:3000/rails/stories`,
17+
url: `http://localhost:3000/rails/view_components`,
1818
},
1919
};
2020
```
@@ -27,20 +27,22 @@ Story classes live in `test/components/stories`, which can be configured using t
2727

2828
```ruby
2929
# config/application.rb
30-
config.view_component_storybook.stories_path = Rails.root.join("spec/components/stories")
30+
config.view_component_storybook.stories_paths << Rails.root.join("spec/components/stories")
3131
```
3232

3333
## Stories Route
3434

35-
Stories are served from <http://localhost:3000/rails/stories> by default. To use a different endpoint, set the `stories_route` option:
35+
Stories are served from the same route as ViewComponent previews <http://localhost:3000/rails/view_components> by default. To use a different endpoint, set the ViewComponent `previews_route` option:
3636

3737
```ruby
3838
# config/application.rb
39-
config.view_component_storybook.stories_route = "/stories"
39+
config.view_component.preview_route = "/stories"
4040
```
4141

4242
This example will make the previews available from <http://localhost:3000/stories>.
4343

44+
For more details see the [ViewCompontent `preview_route` documentation](https://viewcomponent.org/api.html#preview_route--string)
45+
4446
## Stories Title Generation
4547

4648
You may wish to customize how the title of stories are generated, this can be done by setting a custom `stories_title_generator` lambda function:

docs/guide/constructor.md

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)