├── .editorconfig
├── .gitignore
├── JSXEditor.vue
├── README.md
├── index.js
├── package.json
├── poi.config.js
├── router.js
├── static
└── _redirects
└── yarn.lock
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_style = space
5 | indent_size = 2
6 | end_of_line = lf
7 | charset = utf-8
8 | trim_trailing_whitespace = true
9 | insert_final_newline = true
10 |
11 | [*.md]
12 | trim_trailing_whitespace = false
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | dist
3 | .DS_Store
4 | *.log
5 |
--------------------------------------------------------------------------------
/JSXEditor.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
20 |
21 |
22 |
23 |
24 |
25 |
{{ error }}
26 |
27 |
28 |
29 |
30 |
31 |
32 |
158 |
159 |
160 |
161 |
162 |
163 |
266 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # JSX Live Editor
2 |
3 | https://jsx.egoist.sh
4 |
5 | ## Development
6 |
7 | ```bash
8 | # dev
9 | yarn dev
10 | # build
11 | yarn build
12 | ```
13 |
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import router from './router'
3 |
4 | new Vue({
5 | el: '#app',
6 | router,
7 | render(h) {
8 | return h('router-view')
9 | }
10 | })
11 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jsx-editor",
3 | "productName": "JSX Live Editor",
4 | "version": "1.0.0",
5 | "main": "index.js",
6 | "license": "MIT",
7 | "scripts": {
8 | "dev": "poi --serve",
9 | "build": "poi --prod",
10 | "deploy": "npm run build && surge -d jsx.surge.sh -p dist"
11 | },
12 | "author": {
13 | "name": "EGOIST",
14 | "email": "0x142857@gmail.com"
15 | },
16 | "postcss": {
17 | "plugins": {
18 | "postcss-nested": {}
19 | }
20 | },
21 | "devDependencies": {
22 | "babel-helper-vue-jsx-merge-props": "^2.0.3",
23 | "babel-plugin-syntax-jsx": "^6.18.0",
24 | "babel-plugin-transform-vue-jsx": "^4.0.0",
25 | "babel-preset-env": "^1.7.0",
26 | "poi": "^12.0.0-beta.8",
27 | "postcss-nested": "^2.1.2",
28 | "vue": "^2.5.17",
29 | "vue-template-compiler": "^2.5.17"
30 | },
31 | "dependencies": {
32 | "@babel/standalone": "^7.0.0",
33 | "axios": "^0.16.2",
34 | "cm-highlight": "^0.1.1",
35 | "codemirror": "^5.28.0",
36 | "normalize.css": "^7.0.0",
37 | "nprogress": "^0.2.0",
38 | "vue-cm": "^1.1.0",
39 | "vue-router": "^2.7.0"
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/poi.config.js:
--------------------------------------------------------------------------------
1 | const vueJsxVersion = require('babel-plugin-transform-vue-jsx/package').version
2 | const babelVersion = require('@babel/standalone/package').version
3 |
4 | module.exports = {
5 | chainWebpack(config) {
6 | config.module.set('noParse', /babel-standalone/)
7 | },
8 | envs: {
9 | VUE_JSX_VERSION: vueJsxVersion,
10 | BABEL_VERSION: babelVersion,
11 | // It's fine to be exposed :)
12 | APP_GH_TOKEN: '0b481a3c7fe634bdbb3bb16d1d157717959f67be'
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/router.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Router from 'vue-router'
3 |
4 | Vue.use(Router)
5 |
6 | export default new Router({
7 | mode: 'history',
8 | routes: [{
9 | path: '/',
10 | component: () => import('./JSXEditor.vue'),
11 | name: 'home'
12 | }, {
13 | path: '/gist/:id',
14 | component: () => import('./JSXEditor.vue'),
15 | name: 'gist'
16 | }]
17 | })
18 |
--------------------------------------------------------------------------------
/static/_redirects:
--------------------------------------------------------------------------------
1 | /* /index.html 200
2 |
--------------------------------------------------------------------------------