├── .eslintrc.js ├── .gitignore ├── .travis.yml ├── LICENSE.txt ├── README.md ├── compositor.json ├── config ├── env.js ├── jest │ ├── cssTransform.js │ └── fileTransform.js ├── paths.js ├── polyfills.js ├── webpack.config.dev.js ├── webpack.config.prod.js └── webpackDevServer.config.js ├── create-react-app-readme.md ├── package.json ├── public ├── bugsnag-3.min.js ├── favicon.ico ├── index.html ├── manifest.json └── vs │ ├── base │ └── worker │ │ └── workerMain.js │ ├── basic-languages │ └── src │ │ ├── bat.js │ │ ├── coffee.js │ │ ├── cpp.js │ │ ├── csharp.js │ │ ├── css.js │ │ ├── dockerfile.js │ │ ├── fsharp.js │ │ ├── go.js │ │ ├── handlebars.js │ │ ├── html.js │ │ ├── ini.js │ │ ├── java.js │ │ ├── less.js │ │ ├── lua.js │ │ ├── markdown.js │ │ ├── msdax.js │ │ ├── objective-c.js │ │ ├── php.js │ │ ├── postiats.js │ │ ├── powershell.js │ │ ├── pug.js │ │ ├── python.js │ │ ├── r.js │ │ ├── razor.js │ │ ├── ruby.js │ │ ├── sb.js │ │ ├── scss.js │ │ ├── solidity.js │ │ ├── sql.js │ │ ├── swift.js │ │ ├── vb.js │ │ ├── xml.js │ │ └── yaml.js │ ├── editor │ ├── contrib │ │ └── suggest │ │ │ └── browser │ │ │ └── media │ │ │ ├── String_16x.svg │ │ │ └── String_inverse_16x.svg │ ├── editor.main.css │ ├── editor.main.js │ ├── editor.main.nls.de.js │ ├── editor.main.nls.es.js │ ├── editor.main.nls.fr.js │ ├── editor.main.nls.hu.js │ ├── editor.main.nls.it.js │ ├── editor.main.nls.ja.js │ ├── editor.main.nls.js │ ├── editor.main.nls.ko.js │ ├── editor.main.nls.pt-br.js │ ├── editor.main.nls.ru.js │ ├── editor.main.nls.tr.js │ ├── editor.main.nls.zh-cn.js │ ├── editor.main.nls.zh-tw.js │ └── standalone │ │ └── browser │ │ └── quickOpen │ │ └── symbol-sprite.svg │ ├── language │ ├── css │ │ ├── cssMode.js │ │ └── cssWorker.js │ ├── html │ │ ├── htmlMode.js │ │ └── htmlWorker.js │ ├── json │ │ ├── jsonMode.js │ │ └── jsonWorker.js │ └── typescript │ │ ├── lib │ │ └── typescriptServices.js │ │ └── src │ │ ├── mode.js │ │ └── worker.js │ └── loader.js ├── scripts ├── build.js ├── gh-pages.js ├── start.js └── test.js ├── src ├── App.css ├── App.js ├── App.test.js ├── actions │ └── .gitkeep ├── components │ └── HomePage.js ├── constants │ └── .gitkeep ├── containers │ └── .gitkeep ├── index.css ├── index.js ├── reducers │ └── .gitkeep ├── registerServiceWorker.js ├── router │ └── .gitkeep ├── store │ └── .gitkeep ├── styles │ └── .gitkeep └── utils │ ├── drag-drop │ ├── collectors.js │ ├── item-types.js │ ├── specification.js │ ├── withDragDropContext.js │ └── wrapper-component.js │ ├── generateCode.js │ └── typeMap.js └── yarn.lock /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: ['react'], 3 | parser: "babel-eslint", 4 | parserOptions: { 5 | ecmaVersion: 6, 6 | ecmaFeatures: { // 其他语言特性 7 | experimentalObjectRestSpread: true, // ...rest参数和扩展扩算符 8 | jsx: true, 9 | modules: true 10 | }, 11 | sourceType: 'module', // 默认script,可选module 12 | }, 13 | env: { 14 | es6: true, 15 | node: true, 16 | browser: true, 17 | }, 18 | 19 | globals: { // 全局变量,false代表无法重写 20 | React: true, 21 | document: false, 22 | navigator: false, 23 | window: false, 24 | "TEST": true, 25 | "DEV": true, 26 | "PRE": true, 27 | 'Bugsnag': true, 28 | }, 29 | 30 | // http://eslint.org/docs/rules/xxx, xxx代表rule名称, 0=off, 1=warning, 2=error 31 | rules: { // 具体规则 32 | 'accessor-pairs': 2, // getter/setter成对出现 33 | 'arrow-spacing': [2, { 'before': true, 'after': true }], // 箭头函数前后有空格 34 | 'array-bracket-spacing': [2, 'never'], // 数组内前后无空格 35 | 'block-spacing': [2, 'always'], // 单行{}前后有空格 36 | 'brace-style': [2, '1tbs', { 'allowSingleLine': true }], // {}换行,单行不用 37 | 'camelcase': [2, { 'properties': 'never' }], // 属性名可以不是驼峰 38 | 'comma-dangle': [2, 'only-multiline'], // 数组/对象最后一个必须有, 39 | 'comma-spacing': [2, { 'before': false, 'after': true }], // ,前有空格, 后无空格 40 | 'comma-style': [2, 'last'], // ,在最后,不能换行 41 | 'constructor-super': 2, // super()在必须构造函数内 42 | 'curly': [2, 'multi-line'], // if/while等函数可以多行不带{} 43 | 'dot-location': [2, 'property'], // .的位置可以在换行 44 | 'eol-last': 2, // 文件末尾需要空白行 45 | 'eqeqeq': [2, 'allow-null'], // 必须===, null除外 46 | 'generator-star-spacing': [2, { 'before': true, 'after': true }], // generator函数前后有空格 47 | 'handle-callback-err': [2, '^(err|error)$' ], // 有err/error必须处理异常 48 | 'indent': [2, 2, { 'SwitchCase': 1 }], // 缩进2格,switch中1格 49 | 'jsx-quotes': [2, 'prefer-single'], // jsx属性用单引号 50 | 'key-spacing': [2, { 'beforeColon': false, 'afterColon': true }], // 对象属性前有空格, 后无空格 51 | 'keyword-spacing': [2, { 'before': true, 'after': true }], // 关键词前后有空格, 如if-else 52 | 'new-cap': [2, { 'newIsCap': true, 'capIsNew': false }], // new后必须大写开头构造函数, 大写开头不一定要new 53 | 'new-parens': 2, // new的构造函数必须带参数 54 | 'object-curly-spacing': [2, 'always', { objectsInObjects: false }], // 对象{}前后有空格, 对象内的对象例外 55 | 'no-array-constructor': 2, // Array(10)->yes, Array(1, 2)->no 56 | 'no-caller': 2, // 禁止caller/callee 57 | 'no-class-assign': 2, // 禁止赋值class 58 | 'no-cond-assign': 2, // 条件不能有赋值 59 | 'no-const-assign': 2, // 禁止赋值常量(const) 60 | 'no-control-regex': 2, // reg中不能有控制符号 61 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, // node环境prod禁用 62 | 'no-delete-var': 2, // 不能delete变量,可以用在对象 63 | 'no-dupe-args': 2, // 参数不能重复 64 | 'no-dupe-class-members': 2, // class中方法不能有重复 65 | 'no-dupe-keys': 2, // 对象key不能重复 66 | 'no-duplicate-case': 2, // switch不能有重复case 67 | 'no-empty-character-class': 2, // reg中不能有空字符串 68 | 'no-empty-pattern': 2, // 解构不能有空解构模式 69 | 'no-eval': 2, // 不能用eval 70 | 'no-ex-assign': 2, // 不能复制catch中的error 71 | 'no-extend-native': 2, // 不能扩展Object原型 72 | 'no-extra-bind': 2, // bind的函数体中要有明确的this 73 | 'no-extra-boolean-cast': 2, // 禁止多余的Boolean转换 74 | 'no-extra-parens': [2, 'functions'], // 函数中禁止多余的括号 75 | 'no-fallthrough': 2, // switch需要break 76 | 'no-floating-decimal': 2, // float中0不能省略 77 | 'no-func-assign': 2, // 禁止赋值函数 78 | 'no-implied-eval': 2, // 禁止隐性eval 79 | 'no-inner-declarations': [2, 'functions'], // 禁止在条件中声明function 80 | 'no-invalid-regexp': 2, // 禁止无用的reg 81 | 'no-irregular-whitespace': 2, // 禁止不规则空格 82 | 'no-iterator': 2, // 禁止使用__iterator__属性 83 | 'no-label-var': 2, // 禁止label var 84 | 'no-labels': [2, { 'allowLoop': false, 'allowSwitch': false }], // 禁止label表达式 85 | 'no-lone-blocks': 2, // 禁止无用的{} 86 | 'no-mixed-spaces-and-tabs': 2, // space和tab不混用 87 | 'no-multi-spaces': 2, // 禁止多空格 88 | 'no-multi-str': 2, // 禁止多行的string 89 | 'no-multiple-empty-lines': [2, { 'max': 1 }], // 禁止多空行,最大1行 90 | 'no-native-reassign': 2, // 禁止赋值原生对象(window/Object...) 91 | 'no-negated-in-lhs': 2, // !(key in object)->yes, !key in object->no 92 | 'no-new-object': 2, // new Object()->no 93 | 'no-new-require': 2, // new require(xxx)->no 94 | 'no-new-symbol': 2, // new Symbol(xxx)->no 95 | 'no-new-wrappers': 2, // String/Number等不能用new 96 | 'no-obj-calls': 2, // 禁止calling全局对象属性,如Math/JSON 97 | 'no-octal': 2, // 禁止八进制文字 98 | 'no-octal-escape': 2, // 禁止八进制转义 99 | 'no-path-concat': 2, // __dirname和__filename禁止string拼接 100 | 'no-proto': 2, // 禁止使用__proto__ 101 | 'no-redeclare': 2, // 禁止重新复制var 102 | 'no-regex-spaces': 2, // 禁止reg出现多个空格 103 | 'no-return-assign': [2, 'except-parens'], // 禁止return中赋值 104 | 'no-self-assign': 2, // 禁止自身赋值 105 | 'no-self-compare': 2, // 禁止自身比较, 如果NaN->Number.isNaN 106 | 'no-sequences': 2, // 禁止,操作符 107 | 'no-shadow-restricted-names': 2, // 禁止跟踪严格模式下部分关键词 108 | 'no-spaced-func': 2, // function的()不要空格 109 | 'no-sparse-arrays': 2, // array不能用空元素 110 | 'no-this-before-super': 2, // super()前不能用this 111 | 'no-throw-literal': 2, // 禁止直接throw内容,必须是Error() 112 | 'no-trailing-spaces': 2, // 禁止多余的空格 113 | 'no-undef': 2, // 禁止使用未赋值变量 114 | 'no-undef-init': 2, // 变量不能初始化为undefined 115 | 'no-unexpected-multiline': 2, // 禁止有疑义的多行表达式 116 | 'no-unmodified-loop-condition': 2, // 循环中的变量要在循环中修改 117 | 'no-unneeded-ternary': [2, { 'defaultAssignment': false }], // 禁止不必要的三元操作符 118 | 'no-unreachable': 2, // return/throw等之后不应有表达式 119 | 'no-unsafe-finally': 2, // 禁止不安全的finally 120 | 'no-unused-vars': [2, { 'vars': 'all', 'args': 'none' }], // 禁止不使用的变量,参数可以 121 | 'no-useless-call': 2, // 禁止无用的call 122 | 'no-useless-computed-key': 2, // 禁止无用的计算属性 123 | 'no-useless-constructor': 2, // 禁止无用的constructor 124 | 'no-whitespace-before-property': 2, // 属性前不能有空格 125 | 'no-with': 2, // 禁用with 126 | 'one-var': [2, { 'initialized': 'never' }], // 只能一个var, 初始化不检查 127 | 'operator-linebreak': [2, 'after', { 'overrides': { '?': 'before', ':': 'before' } }], // 操作符换行, 默认在行末, ?和:在下一行前 128 | 'padded-blocks': [2, 'never'], // 作用域中没有padded的空行 129 | 'quotes': [2, 'single', { 'avoidEscape': true, 'allowTemplateLiterals': true }], // 使用单引号, 转义或者模版可以例外 130 | 'semi': [2, 'never'], // 禁用结尾; 131 | 'semi-spacing': [2, { 'before': false, 'after': true }], // ;前有空格, 后无空格 132 | 'space-before-blocks': [2, 'always'], // 作用域前有空格 133 | 'space-in-parens': [2, 'never'], // 括号内无空格 134 | 'space-infix-ops': 2, // 插入的操作符需要空格, 如+/- 135 | 'space-unary-ops': [2, { 'words': true, 'nonwords': false }], // 操作符单词类要空格(new/delete), 非单词不要空格(++/--/!) 136 | 'spaced-comment': [2, 'always', { 'markers': ['!', ',', '/', '-'] }], // 注释要空格,markers为例外 137 | 'template-curly-spacing': [2, 'never'], // 模版字符串中变量无空格 138 | 'use-isnan': 2, // 使用isNaN 139 | 'valid-typeof': 2, // typeof的字符串必须正确 140 | 'wrap-iife': [2, 'any'], // 立即调用的function必须有括号 141 | 'yield-star-spacing': [2, 'both'], // yield的*前后有空格 142 | 'yoda': [2, 'never'], // 条件中变量在前 143 | 144 | 'prefer-const': 0, // 能用const场景用const 145 | 'no-useless-escape': 0, // 不检查escape 146 | 'space-before-function-paren': 0, // 函数括号无空格 147 | "react/jsx-uses-react": "error", 148 | "react/jsx-uses-vars": "error", 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | .vscode 13 | # misc 14 | .DS_Store 15 | .env.local 16 | .env.development.local 17 | .env.test.local 18 | .env.production.local 19 | 20 | npm-debug.log* 21 | yarn-debug.log* 22 | yarn-error.log* 23 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 6 4 | cache: 5 | directories: 6 | - node_modules 7 | script: 8 | - npm run build:gh-pages 9 | deploy: 10 | provider: pages 11 | skip_cleanup: true 12 | github_token: 9063e562516703a9623ea844ae6ede6662dd2bc8 # Set in travis-ci.org dashboard 13 | on: 14 | branch: master 15 | local_dir: ./build -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [2017] [lixuejiang] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 基于react+antd的后台管理系统可视化生成工具 2 | [预览地址](http://www.lixuejiang.me/react-antd-visual/index.html)[](https://travis-ci.org/lixuejiang/react-antd-visual) 3 | ## 涉及技术 4 | 5 | ### 脚手架 6 | 7 | - create-react-app 8 | 9 | ### 技术 10 | 11 | - react 12 | - antd 13 | - react-dnd 14 | - react-hot-reloader 15 | 16 | ## 运行步骤 17 | 18 | ``` 19 | git clone https://github.com/lixuejiang/react-antd-visual.git 20 | cd react-antd-visual 21 | yarn 22 | yarn start 23 | ``` 24 | -------------------------------------------------------------------------------- /compositor.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lixuejiang/react-antd-visual", 3 | "version": "0.1.4", 4 | "libraries": { 5 | "xv": "^1.1.25" 6 | }, 7 | "title": "", 8 | "branch": "", 9 | "style": { 10 | "name": "Material", 11 | "componentSet": { 12 | "nav": "nav/DarkAbsoluteNav", 13 | "header": "header/GradientHeader", 14 | "article": "article/BasicArticle", 15 | "footer": "footer/BasicFooter" 16 | }, 17 | "fontFamily": "Roboto, sans-serif", 18 | "heading": { 19 | "fontWeight": 500, 20 | "letterSpacing": "-0.01em" 21 | }, 22 | "colors": { 23 | "text": "#212121", 24 | "background": "#fff", 25 | "primary": "#2196f3", 26 | "secondary": "#1565c0", 27 | "highlight": "#ff4081", 28 | "border": "#e0e0e0", 29 | "muted": "#f5f5f5" 30 | }, 31 | "layout": { 32 | "centered": true, 33 | "bannerHeight": "80vh", 34 | "maxWidth": 896 35 | } 36 | }, 37 | "content": [ 38 | { 39 | "component": "nav", 40 | "links": [ 41 | { 42 | "href": "https://github.com/lixuejiang/react-antd-visual", 43 | "text": "GitHub" 44 | }, 45 | { 46 | "href": "https://npmjs.com/package/react-antd-visual", 47 | "text": "npm" 48 | } 49 | ] 50 | }, 51 | { 52 | "component": "header", 53 | "heading": "react-antd-visual", 54 | "subhead": "基于react和antd的后台可视化生成系统", 55 | "children": [ 56 | { 57 | "component": "ui/TweetButton", 58 | "text": "react-antd-visual: 基于react和antd的后台可视化生成系统", 59 | "url": null 60 | }, 61 | { 62 | "component": "ui/GithubButton", 63 | "user": "lixuejiang", 64 | "repo": "react-antd-visual" 65 | } 66 | ], 67 | "text": "v0.1.0" 68 | }, 69 | { 70 | "component": "article", 71 | "metadata": { 72 | "source": "github.readme" 73 | }, 74 | "html": "
git clone https://github.com/lixuejiang/react-antd-visual.git\ncd react-antd-visual\nyarn\nyarn start" 75 | }, 76 | { 77 | "component": "footer", 78 | "links": [ 79 | { 80 | "href": "https://github.com/lixuejiang/react-antd-visual", 81 | "text": "GitHub" 82 | }, 83 | { 84 | "href": "https://github.com/lixuejiang", 85 | "text": "lixuejiang" 86 | } 87 | ] 88 | } 89 | ] 90 | } -------------------------------------------------------------------------------- /config/env.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const fs = require('fs'); 4 | const path = require('path'); 5 | const paths = require('./paths'); 6 | 7 | // Make sure that including paths.js after env.js will read .env variables. 8 | delete require.cache[require.resolve('./paths')]; 9 | 10 | const NODE_ENV = process.env.NODE_ENV; 11 | if (!NODE_ENV) { 12 | throw new Error( 13 | 'The NODE_ENV environment variable is required but was not specified.' 14 | ); 15 | } 16 | 17 | // https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use 18 | var dotenvFiles = [ 19 | `${paths.dotenv}.${NODE_ENV}.local`, 20 | `${paths.dotenv}.${NODE_ENV}`, 21 | // Don't include `.env.local` for `test` environment 22 | // since normally you expect tests to produce the same 23 | // results for everyone 24 | NODE_ENV !== 'test' && `${paths.dotenv}.local`, 25 | paths.dotenv, 26 | ].filter(Boolean); 27 | 28 | // Load environment variables from .env* files. Suppress warnings using silent 29 | // if this file is missing. dotenv will never modify any environment variables 30 | // that have already been set. 31 | // https://github.com/motdotla/dotenv 32 | dotenvFiles.forEach(dotenvFile => { 33 | if (fs.existsSync(dotenvFile)) { 34 | require('dotenv').config({ 35 | path: dotenvFile, 36 | }); 37 | } 38 | }); 39 | 40 | // We support resolving modules according to `NODE_PATH`. 41 | // This lets you use absolute paths in imports inside large monorepos: 42 | // https://github.com/facebookincubator/create-react-app/issues/253. 43 | // It works similar to `NODE_PATH` in Node itself: 44 | // https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders 45 | // Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored. 46 | // Otherwise, we risk importing Node.js core modules into an app instead of Webpack shims. 47 | // https://github.com/facebookincubator/create-react-app/issues/1023#issuecomment-265344421 48 | // We also resolve them to make sure all tools using them work consistently. 49 | const appDirectory = fs.realpathSync(process.cwd()); 50 | process.env.NODE_PATH = (process.env.NODE_PATH || '') 51 | .split(path.delimiter) 52 | .filter(folder => folder && !path.isAbsolute(folder)) 53 | .map(folder => path.resolve(appDirectory, folder)) 54 | .join(path.delimiter); 55 | 56 | // Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be 57 | // injected into the application via DefinePlugin in Webpack configuration. 58 | const REACT_APP = /^REACT_APP_/i; 59 | 60 | function getClientEnvironment(publicUrl) { 61 | const raw = Object.keys(process.env) 62 | .filter(key => REACT_APP.test(key)) 63 | .reduce( 64 | (env, key) => { 65 | env[key] = process.env[key]; 66 | return env; 67 | }, 68 | { 69 | // Useful for determining whether we’re running in production mode. 70 | // Most importantly, it switches React into the correct mode. 71 | NODE_ENV: process.env.NODE_ENV || 'development', 72 | // Useful for resolving the correct path to static assets in `public`. 73 | // For example,