Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V1 api #151

Merged
merged 35 commits into from
Jan 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c05061b
First pass at v1 API
jonspalmer Dec 17, 2022
5946b57
Add slots examples
jonspalmer Dec 17, 2022
0cd152a
Move and rename all the things
jonspalmer Dec 17, 2022
6f51ab0
rubocop
jonspalmer Dec 17, 2022
8546ff5
More cleanup
jonspalmer Dec 17, 2022
41c5ffc
cleanup
jonspalmer Dec 17, 2022
8e9e75d
Fix the controls api
jonspalmer Dec 17, 2022
dc256ce
Change control signature
jonspalmer Dec 18, 2022
c2bd37c
More cleanup
jonspalmer Dec 18, 2022
8841396
Fix story ordering
jonspalmer Dec 18, 2022
44365ca
Read control default values from parsed params
jonspalmer Dec 18, 2022
72c5013
rubocop
jonspalmer Dec 18, 2022
c6993c3
cleanup
jonspalmer Dec 18, 2022
cdafef4
Update gemspec
jonspalmer Dec 18, 2022
8b5054a
make StoriesCollection enumerable
jonspalmer Dec 18, 2022
b562228
Simplify control param parsing api
jonspalmer Dec 18, 2022
820a827
Rename Control
jonspalmer Dec 18, 2022
c2511f2
Update docs
jonspalmer Dec 18, 2022
39acb87
rubocop
jonspalmer Dec 18, 2022
9bca969
Expand only and excet options for controls
jonspalmer Dec 20, 2022
0de8549
rubocop
jonspalmer Dec 20, 2022
5b750b9
More cleanup
jonspalmer Dec 20, 2022
322c3dc
Add settings parameters for stories
jonspalmer Dec 22, 2022
564810e
Rubocop
jonspalmer Dec 22, 2022
00cd077
fixes
jonspalmer Dec 22, 2022
8086fd5
fixes
jonspalmer Dec 22, 2022
9ce63bb
rubocop
jonspalmer Dec 22, 2022
95e52d4
ruby 3 fixes
jonspalmer Dec 22, 2022
3cc4b26
fix requires
jonspalmer Jan 7, 2023
ffa937d
fix the require
jonspalmer Jan 7, 2023
6a18d70
Reorg requires
jonspalmer Jan 7, 2023
f99be4e
Add layout options
jonspalmer Jan 7, 2023
b8e5547
Disable main ci until we can fix rubygems version weirdness
jonspalmer Jan 7, 2023
6810390
Move all the collections
jonspalmer Jan 7, 2023
a0f920d
Update Docs
jonspalmer Jan 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
rails_version: [6.0.6, 6.1.7, 7.0.4, main]
rails_version: [6.0.6, 6.1.7, 7.0.4]
ruby_version: [2.6.10, 2.7.7, 3.0.5, 3.1.3]
exclude:
- rails_version: 6.0.6
Expand All @@ -36,8 +36,8 @@ jobs:
ruby_version: 2.5.9
- rails_version: 7.0.4
ruby_version: 2.6.10
- rails_version: main
ruby_version: 2.6.10
# - rails_version: main
# ruby_version: 2.6.10
steps:
- uses: actions/checkout@master
- name: Setup Ruby
Expand Down
10 changes: 7 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
PATH
remote: .
specs:
view_component_storybook (0.12.1)
view_component-storybook (1.0.0)
view_component (>= 2.54)
yard (~> 0.9.25)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -185,7 +186,7 @@ GEM
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.12.0)
rubocop (1.40.0)
rubocop (1.41.1)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.1.2.1)
Expand Down Expand Up @@ -232,11 +233,14 @@ GEM
activesupport (>= 5.2.0, < 8.0)
concurrent-ruby (~> 1.0)
method_source (~> 1.0)
webrick (1.7.0)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
yard (0.9.28)
webrick (~> 1.7.0)
zeitwerk (2.6.6)

PLATFORMS
Expand All @@ -257,7 +261,7 @@ DEPENDENCIES
simplecov (~> 0.21.2)
simplecov-console (~> 0.9)
sprockets-rails (~> 3.4.2)
view_component_storybook!
view_component-storybook!

BUNDLED WITH
2.3.26
46 changes: 0 additions & 46 deletions app/controllers/view_component/storybook/stories_controller.rb

This file was deleted.

8 changes: 0 additions & 8 deletions app/views/view_component/storybook/stories/show.html.erb

This file was deleted.

32 changes: 0 additions & 32 deletions config/locales/en.yml

This file was deleted.

6 changes: 3 additions & 3 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Last 0.x release
* Klazz Control
* Deprecated Controls DSL
* Add support for Object Controls with array values
* Remove ArrayConfig - array aliases ObjectConfig
* Remove ArrayConfig - array aliases Object
* Updated Options Control to match Storybook 6.2 syntax
* `options` as array
* add `labels` option
Expand All @@ -64,6 +64,6 @@ Last 0.x release

## 0.7.0

* Add inclusion validation to NumberConfig type
* Support ObjectConfigs with nested values
* Add inclusion validation to Number type
* Support Objects with nested values
* Support nil control values
10 changes: 6 additions & 4 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ FOr local development this is typically:
// .storybook/preview.js
export const parameters = {
server: {
url: `http://localhost:3000/rails/stories`,
url: `http://localhost:3000/rails/view_components`,
},
};
```
Expand All @@ -27,20 +27,22 @@ Story classes live in `test/components/stories`, which can be configured using t

```ruby
# config/application.rb
config.view_component_storybook.stories_path = Rails.root.join("spec/components/stories")
config.view_component_storybook.stories_paths << Rails.root.join("spec/components/stories")
```

## Stories Route

Stories are served from <http://localhost:3000/rails/stories> by default. To use a different endpoint, set the `stories_route` option:
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:

```ruby
# config/application.rb
config.view_component_storybook.stories_route = "/stories"
config.view_component.preview_route = "/stories"
```

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

For more details see the [ViewCompontent `preview_route` documentation](https://viewcomponent.org/api.html#preview_route--string)

## Stories Title Generation

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:
Expand Down
75 changes: 0 additions & 75 deletions docs/guide/constructor.md

This file was deleted.

Loading