Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
jljsj33 committed May 31, 2019
0 parents commit 6d8f895
Show file tree
Hide file tree
Showing 17 changed files with 378 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*.{js,css}]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
*.iml
*.log
.idea
.ipr
.iws
*~
~*
*.diff
*.patch
*.bak
.DS_Store
Thumbs.db
.project
.*proj
.svn
*.swp
*.swo
*.pyc
*.pyo
node_modules
.cache
*.css
build
lib
coverage
*.js
*.jsx
*.map
dist
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/*.svg
**/*.ejs
**/*.html
package.json
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"singleQuote": true,
"trailingComma": "es5",
"printWidth": 100,
"overrides": [
{
"files": ".prettierrc",
"options": { "parser": "json" }
}
]
}
33 changes: 33 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
language: node_js

sudo: false

notifications:
email:
- [email protected]

node_js:
- 6.9.1

before_install:
- |
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(^(docs|examples))/'
then
echo "Only docs were updated, stopping build process."
exit
fi
npm install [email protected] -g
phantomjs --version
script:
- |
if [ "$TEST_TYPE" = test ]; then
npm test -- --coverage && \
bash <(curl -s https://codecov.io/bash)
else
npm run $TEST_TYPE
fi
env:
matrix:
- TEST_TYPE=lint
- TEST_TYPE=test
- TEST_TYPE=coverage
Empty file added HISTORY.md
Empty file.
22 changes: 22 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT LICENSE

Copyright (c) 2015-present Alipay.com, https://www.alipay.com/

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# rc-editor-jsonschema
---

React EditorJSON Component

[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![codecov](https://codecov.io/gh/ant-motion/editor-jsonschema/branch/master/graph/badge.svg)](https://codecov.io/gh/ant-motion/editor-jsonschema)
[![npm download][download-image]][download-url]

[npm-image]: http://img.shields.io/npm/v/rc-editor-jsonschema.svg?style=flat-square
[npm-url]: http://npmjs.org/package/rc-editor-jsonschema
[travis-image]: https://img.shields.io/travis/ant-motion/editor-jsonschema.svg?style=flat-square
[travis-url]: https://travis-ci.org/ant-motion/editor-jsonschema
[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square
[node-url]: http://nodejs.org/download/
[download-image]: https://img.shields.io/npm/dm/rc-editor-jsonschema.svg?style=flat-square
[download-url]: https://npmjs.org/package/rc-editor-jsonschema

## Example

http://localhost:8010/examples/


online example: http://ant-motion.github.io/editor-jsonschema/


## install


[![rc-editor-jsonschema](https://nodei.co/npm/rc-editor-jsonschema.png)](https://npmjs.org/package/rc-editor-jsonschema)


## Usage

```js
var EditorJSON = require('rc-editor-jsonschema');
var React = require('react');
React.render(<EditorJSON />, container);
```

## API

### props

| name | type | default | description |
|-----------|----------------|-----------|----------------|
| - | - | - | - |


## License

rc-editor-jsonschema is released under the MIT license.
3 changes: 3 additions & 0 deletions assets/index.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.a {
position: relative;
}
1 change: 1 addition & 0 deletions examples/simple.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
placeholder
18 changes: 18 additions & 0 deletions examples/simple.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// use jsx to render html, do not modify simple.html
import EditorJSON from '../src/';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import '../assets/index.less';

class Demo extends React.Component<any, any> {
render() {
return (
<div className="App">
<EditorJSON />
</div>
);
}
}

ReactDOM.render(<Demo />, document.getElementById('__react-content'));

99 changes: 99 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
"name": "rc-editor-jsonschema",
"version": "0.1.0",
"description": "jsonschema for landing in tech",
"keywords": [
"react",
"react-component",
"jsonschema",
"react-editor-jsonschema"
],
"engines": {
"node": ">=6.0.0"
},
"homepage": "https://github.com/ant-motion/editor-jsonschema",
"author": "[email protected]",
"repository": {
"type": "git",
"url": "https://github.com/ant-motion/editor-jsonschema.git"
},
"bugs": "https://github.com/ant-motion/editor-jsonschema/issues",
"files": [
"lib",
"assets/*.css",
"dist",
"es"
],
"license": "MIT",
"main": "./lib/index",
"module": "./es/index",
"config": {
"port": 8008,
"entry": {
"rc-editor-jsonschema": [
"./assets/index.less",
"./src/index.tsx"
]
}
},
"scripts": {
"dist": "rc-tools run dist",
"build": "rc-tools run build",
"gh-pages": "rc-tools run gh-pages",
"start": "rc-tools run server",
"compile": "rc-tools run compile --babel-runtime",
"pub": "rc-tools run pub --babel-runtime",
"lint": "rc-tools run lint",
"karma": "rc-test run karma",
"test": "jest",
"coverage": "jest --coverage"
},
"dependencies": {
"babel-runtime": "^6.26.0"
},
"devDependencies": {
"@types/enzyme": "^3.9.3",
"@types/enzyme-to-json": "^1.5.3",
"@types/jest": "^24.0.13",
"@types/react": "^16.8.19",
"@types/react-dom": "^16.8.4",
"core-js": "^3.1.3",
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.13.2",
"enzyme-to-json": "^3.3.5",
"jest": "^24.8.0",
"pre-commit": "^1.2.2",
"raf": "^3.4.1",
"rc-tools": "^9.5.3",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"ts-jest": "^24.0.2"
},
"pre-commit": [
"lint"
],
"jest": {
"testMatch": [
"**/__tests__/**/*.ts?(x)",
"**/?(*.)(spec|test).ts?(x)"
],
"setupFiles": [
"./tests/setup.ts"
],
"collectCoverageFrom": [
"src/**/*.{ts,tsx}"
],
"coverageDirectory": "./coverage/",
"snapshotSerializers": [
"enzyme-to-json/serializer"
],
"moduleFileExtensions": [
"ts",
"tsx",
"js"
],
"transform": {
"^.+\\.tsx?$": "ts-jest"
}
}
}
13 changes: 13 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as React from 'react';

class EditorJSON extends React.Component {
render() {
return (
<div>
text
</div>
);
}
}
export default EditorJSON;

8 changes: 8 additions & 0 deletions tests/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// do not add tests to this file, add tests to other .spec.js
import * as React from 'react';
import { mount } from 'enzyme';

describe('rc-editor-jsonschema', () => {
it('single rc-editor-jsonschema', () => {
});
});
6 changes: 6 additions & 0 deletions tests/setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require('raf').polyfill();

const Enzyme = require('enzyme');
const Adapter = require('enzyme-adapter-react-16');

Enzyme.configure({ adapter: new Adapter() });
7 changes: 7 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"moduleResolution": "node",
"jsx": "react",
"target": "es6"
}
}
62 changes: 62 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"rules": {
"class-name": true,
"comment-format": [
true,
"check-space"
],
"indent": [
true,
"spaces"
],
"member-ordering": [
true,
"public-before-private",
"static-before-instance",
"variables-before-functions"
],
"no-conditional-assignment": true,
"no-duplicate-variable": true,
"no-eval": true,
"no-internal-module": true,
"no-trailing-whitespace": true,
"no-unused-variable": false,
"no-var-keyword": true,
"one-line": [
true,
"check-open-brace",
"check-whitespace"
],
"quotemark": [
true,
"single",
"jsx-double"
],
"semicolon": [
true,
"always"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"variable-name": [
true,
"ban-keywords"
],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
]
}
}

0 comments on commit 6d8f895

Please sign in to comment.