-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Vue: Add repro template for vue-cli #19165
Merged
Merged
Changes from 18 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
e757728
Vue: Add repro templates for vue-cli
shilman 33a1d7d
Merge branch 'next' into shilman/vue-cli-repro-templates
shilman 5f220b6
Vue-cli: Don't nuke cwd on init
shilman 7e84537
Escape vue-cli vue2 preset properly
shilman 06d885a
Vue2: Add template components for sandbox
shilman 19f25e0
Merge branch 'next' into shilman/vue-cli-repro-templates
shilman 3dbf5f6
CLI/Vue3: Upgrade vue-loader and install `@vue/compiler-sfc`
shilman 60f1aa5
Vue: Fix typo in template Button
shilman 55f4668
Merge branch 'next' into shilman/vue-cli-repro-templates
shilman 10cfadd
Try fix missing typescript in JS-only project
shilman 05dfc5c
Apply the same fix for vue3 webpack preset
shilman ac16a23
Vue3: Fix babel / ts-loader both run against .ts files
shilman fde61fc
Revert "Apply the same fix for vue3 webpack preset"
tmeasday 024e8a7
Revert "Try fix missing typescript in JS-only project"
tmeasday 2dc7254
Exclude all rules from template-stories
tmeasday 48e3af9
Vue: Add Form/Html template components
shilman b8380fa
Vue2: Fix play's within(canvas) by preserving `#storybook-root`
shilman 1aa24c9
Update snapshots
shilman 70fc932
Don't run source snippet e2e on vue-cli's vue3
shilman 1036cbc
Addon-a11y: Fix template stories
shilman 398dadc
Vue: Fixed Pre template component
shilman 7e7bffb
Fix skip logic for vue-cli snippet test
shilman 5dbe451
Fix duplicate import
shilman 5ef1742
Added Vue2 DOM breaking change to MIGRATION guide
shilman 7571d14
CLI: Don't add babel dependencies
shilman cb4b205
Fix stories
shilman 000e6a1
Actions/Interactions: Identify actions by isAction to fix production …
shilman 18709fc
Task: Prefix chromatic junit keys with templateKey
shilman e957951
Merge branch 'next' into shilman/vue-cli-repro-templates
shilman b9add15
Vue: Disable Vue2 repro template until rendering is fixed
shilman b613372
Fix location of store manual title story
shilman 150cf37
Skip story re-rendering test for vue3/svelte
shilman e5de18d
Fix typo
shilman 4857588
Scripts: Prefix junit into base task runner
shilman c2042c3
fix typo
shilman aa3a8ea
Revert "Vue2: Fix play's within(canvas) by preserving `#storybook-root`"
shilman 1034ba9
Revert "Added Vue2 DOM breaking change to MIGRATION guide"
shilman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<template> | ||
<button type="button" :class="classes" @click="onClick" :style="style">{{ children }}</button> | ||
</template> | ||
|
||
<script> | ||
import './button.css'; | ||
|
||
export default { | ||
name: 'my-button', | ||
|
||
props: { | ||
children: { | ||
type: String, | ||
required: true, | ||
}, | ||
primary: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
size: { | ||
type: String, | ||
default: 'medium', | ||
validator: function (value) { | ||
return ['small', 'medium', 'large'].indexOf(value) !== -1; | ||
}, | ||
}, | ||
backgroundColor: { | ||
type: String, | ||
}, | ||
}, | ||
|
||
computed: { | ||
classes() { | ||
return { | ||
'storybook-button': true, | ||
'storybook-button--primary': this.primary, | ||
'storybook-button--secondary': !this.primary, | ||
[`storybook-button--${this.size}`]: true, | ||
}; | ||
}, | ||
style() { | ||
return { | ||
backgroundColor: this.backgroundColor, | ||
}; | ||
}, | ||
}, | ||
|
||
methods: { | ||
onClick() { | ||
this.$emit('onClick'); | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<template> | ||
<form id="interaction-test-form" @submit.prevent="onSubmit"> | ||
<label> | ||
Enter Value | ||
<input type="text" data-testid="value" :value="value" required @click="setValue" /> | ||
</label> | ||
<button type="submit">Submit</button> | ||
<p v-if="complete">Completed!!</p> | ||
</form> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'my-form', | ||
|
||
props: { | ||
onSuccess: { | ||
type: Function, | ||
}, | ||
}, | ||
|
||
data() { | ||
return { | ||
value: '', | ||
complete: false, | ||
}; | ||
}, | ||
|
||
methods: { | ||
setValue(event) { | ||
this.value = event.target.value; | ||
}, | ||
onSubmit() { | ||
this.onSuccess(this.value); | ||
setTimeout(() => { | ||
this.complete = true; | ||
}, 500); | ||
setTimeout(() => { | ||
this.complete = false; | ||
}, 1500); | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<template> | ||
<div v-html="content"></div> | ||
</template> | ||
|
||
<script> | ||
|
||
export default { | ||
name: 'my-html', | ||
|
||
props: { | ||
content: { | ||
type: String, | ||
required: true, | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<template> | ||
<pre data-testid="pre" :style="style">{{ finalText }}</pre> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'my-pre', | ||
|
||
props: { | ||
// deepscan-disable-next-line | ||
style: { | ||
type: Object, | ||
}, | ||
object: { | ||
type: Object, | ||
}, | ||
text: { | ||
type: String, | ||
default: '', | ||
}, | ||
}, | ||
|
||
computed: { | ||
finalText() { | ||
return props.object ? JSON.stringify(props.object, null, 2) : props.text; | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.storybook-button { | ||
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; | ||
font-weight: 700; | ||
border: 0; | ||
border-radius: 3em; | ||
cursor: pointer; | ||
display: inline-block; | ||
line-height: 1; | ||
} | ||
.storybook-button--primary { | ||
color: white; | ||
background-color: #1ea7fd; | ||
} | ||
.storybook-button--secondary { | ||
color: #333; | ||
background-color: transparent; | ||
box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset; | ||
} | ||
.storybook-button--small { | ||
font-size: 12px; | ||
padding: 10px 16px; | ||
} | ||
.storybook-button--medium { | ||
font-size: 14px; | ||
padding: 11px 20px; | ||
} | ||
.storybook-button--large { | ||
font-size: 16px; | ||
padding: 12px 24px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import globalThis from 'global'; | ||
|
||
import Button from './Button.vue'; | ||
import Pre from './Pre.vue'; | ||
import Form from './Form.vue'; | ||
import Html from './Html.vue'; | ||
|
||
globalThis.Components = { Button, Pre, Form, Html }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is just a snapshot update, but was the removal of tsx intentional?