Skip to content

Commit 40a0c2d

Browse files
authored
Merge pull request #22 from vue-styleguidist/feat-enable-jsx
feat: enable jsx support
2 parents b1d23e1 + 36903d4 commit 40a0c2d

File tree

8 files changed

+8989
-6849
lines changed

8 files changed

+8989
-6849
lines changed

dangerfile.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ const path = require("path");
44
const validateMessage = require("validate-commit-msg");
55

66
const packageChanged = danger.git.modified_files.includes("package.json");
7-
const lockfileChanged = danger.git.modified_files.includes("yarn.lock");
7+
const lockfileChanged = danger.git.modified_files.includes("package-lock.json");
88

99
if (packageChanged && !lockfileChanged) {
10-
warn(`Changes were made to \`package.json\`, but not to \`yarn.lock\`.
11-
If you’ve changed any dependencies (added, removed or updated any packages), please run \`yarn install\` and commit changes in yarn.lock file.`);
10+
warn(`Changes were made to \`package.json\`, but not to \`package-lock.json\`.
11+
If you’ve changed any dependencies (added, removed or updated any packages), please run \`npm install\` and commit changes in package-lock.json file.`);
1212
}
1313

1414
if (!packageChanged && lockfileChanged) {
15-
warn(`Changes were made to \`yarn.lock\`, but not to \`package.json\`.
16-
Please remove \`yarn.lock\` changes from your pull request. Try to run \`git checkout master -- yarn.lock\` and commit changes.`);
15+
warn(`Changes were made to \`package-lock.json\`, but not to \`package.json\`.
16+
Please remove \`package-lock.json\` changes from your pull request. Try to run \`git checkout master -- package-lock.json\` and commit changes.`);
1717
}
1818

1919
// Check test exclusion (.only) is included

demo/App.vue

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
href="https://github.com/vue-styleguidist/vue-live/tree/master/demo"
66
>Check out the source for this demo</a>
77
<h2>With imported components</h2>
8-
<VueLive :code="codeTemplate" :layout="CustomLayout" :components="registeredComponents"/>
8+
<VueLive :code="codeTemplate" :layout="CustomLayout" :components="registeredComponents" />
99
<h2>Display Single File Components</h2>
10-
<VueLive :code="codeSfc" :layout="CustomLayout"/>
10+
<VueLive :code="codeSfc" :layout="CustomLayout" />
1111
<h2>Pure JavaScript code</h2>
12-
<VueLive :code="codeJs" :layout="CustomLayout"/>
12+
<VueLive :code="codeJs" :layout="CustomLayout" />
1313
<h2>Use the requires prop to make libraries and packages available in the browser</h2>
14-
<VueLive :code="codeChicago" :layout="CustomLayout" :requires="chicagoRequires"/>
14+
<VueLive :code="codeChicago" :layout="CustomLayout" :requires="chicagoRequires" />
1515
<h2>With a custom update delay of 2 seconds</h2>
1616
<VueLive
1717
:code="`<input type='button' value='update me' />`"
@@ -20,14 +20,20 @@
2020
/>
2121
<h2>Default Layout</h2>
2222
<div style="width:950px; max-width:95vw; margin:20px auto;">
23-
<VueLive :code="`<input type='button' value='I am Groot' />`"/>
23+
<VueLive :code="`<input type='button' value='I am Groot' />`" />
2424
</div>
2525
<h2>Custom Layout</h2>
2626
<div>
27-
<p>Attributes available for custom layout: <code>code: String</code>, <code>language: String</code></p>
28-
<VueLive :code="`<input type='button' value='I am Groot' />`" :layout="CustomLayout"/>
27+
<p>
28+
Attributes available for custom layout:
29+
<code>code: String</code>,
30+
<code>language: String</code>
31+
</p>
32+
<VueLive :code="`<input type='button' value='I am Groot' />`" :layout="CustomLayout" />
2933
</div>
30-
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
34+
<h2>It even supports jsx</h2>
35+
<VueLive :code="realjsx" :layout="CustomLayout" :jsx="true" />
36+
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet" />
3137
</main>
3238
</template>
3339
<script>
@@ -36,6 +42,7 @@ import CustomLayout from "./CustomLayout";
3642
import DatePicker from "vuejs-datepicker";
3743
import codeSfc from "!!raw-loader!./assets/Button.vue";
3844
import codeJs from "!!raw-loader!./assets/input.js";
45+
import realjsx from "!!raw-loader!./assets/real.jsx";
3946
import codeTemplate from "!!raw-loader!./assets/PureTemplate.html";
4047
import codeChicago from "!!raw-loader!./assets/Chicago.jsx";
4148
import all from "./assets/chicagoNeighbourhoods";
@@ -54,7 +61,8 @@ export default {
5461
codeJs,
5562
codeChicago,
5663
CustomLayout,
57-
chicagoRequires: { "./chicagoNeighbourhoods": all }
64+
chicagoRequires: { "./chicagoNeighbourhoods": all },
65+
realjsx
5866
};
5967
}
6068
};

demo/assets/real.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const args = {
2+
type: "button",
3+
value: "update me"
4+
};
5+
6+
export default {
7+
render() {
8+
return <input {...args} />;
9+
}
10+
};

0 commit comments

Comments
 (0)