Skip to content

Commit

Permalink
chore: use jswork scope
Browse files Browse the repository at this point in the history
  • Loading branch information
afeiship committed Mar 6, 2021
1 parent c6cda0b commit e5e2375
Show file tree
Hide file tree
Showing 32 changed files with 378 additions and 259 deletions.
10 changes: 8 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{
"presets": ["@babel/preset-env", "@babel/react"],
"presets": [[
"@babel/preset-env",
{
"targets": { "browsers": [ "last 2 versions" ] }
}
], "@babel/react"],
"plugins": [
[ "@babel/plugin-proposal-decorators", { "legacy": true } ],
[ "@babel/plugin-proposal-class-properties", { "loose": true } ],
[ "import", { "libraryName": "antd" } ]
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-transform-parameters"
]
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ Gemfile.lock
yarn-error.log
package-lock.json
.DS_Store
dist

# editor
.idea
.vscode
.history
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ examples

# vscode
jsconfig.json
.history

# tests
test
Expand All @@ -31,4 +32,4 @@ __tests__
jest.config.js
jest.setup.js


.release-it.json
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"jsxBracketSameLine": true,
"tabWidth": 2,
"semi": true,
"quoteProps": "consistent",
"singleQuote": true,
"overrides": [
{
Expand Down
14 changes: 14 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"hooks": {
"after:init": [
"t2k"
],
"after:bump": [
"npm run docs",
"npm run build"
]
},
"github": {
"release": true
}
}
5 changes: 0 additions & 5 deletions Gemfile

This file was deleted.

21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2020 afei <1290657123@qq.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.
85 changes: 47 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,40 @@
# react-ant-input-number
> Input number for react.
## installation
```shell
npm install -S @feizheng/react-ant-input-number
```
[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## update
## installation
```shell
npm update @feizheng/react-ant-input-number
npm install -S @jswork/react-ant-input-number
```

## properties
| Name | Type | Default | Description |
| --------- | ------ | ------- | ------------------------------------- |
| className | string | - | The extended className for component. |
| onChange | func | noop | The change handler. |
| Name | Type | Required | Default | Description |
| --------- | ------ | -------- | ------- | ------------------------------------- |
| className | string | false | - | The extended className for component. |
| onChange | func | false | noop | The change handler. |


## usage
1. import css
```scss
@import "~@feizheng/react-ant-input-number/dist/style.scss";
@import "~@jswork/react-ant-input-number/dist/style.css";

// or use sass
@import "~@jswork/react-ant-input-number/dist/style.scss";

// customize your styles:
$react-ant-input-number-options: ()
```
2. import js
```js
import ReactAntInputNumber from '@feizheng/react-ant-input-number';
import ReactDOM from 'react-dom';
import ReactDemokit from '@jswork/react-demokit';
import React from 'react';
import ReactDOM from 'react-dom';
import ReactAntInputNumber from '@jswork/react-ant-input-number';
import './assets/style.scss';

class App extends React.Component {
Expand All @@ -40,31 +44,20 @@ npm update @feizheng/react-ant-input-number

render() {
return (
<div className="app-container">
<div className="item">
<ReactAntInputNumber onChange={this.handleChange} />
</div>
<div className="item">
<ReactAntInputNumber
defaultValue={100}
min={0}
max={100}
formatter={(value) => `${value}%`}
parser={(value) => value.replace('%', '')}
onChange={this.handleChange}
/>
</div>
<div className="item">
<ReactAntInputNumber
defaultValue={100}
min={0}
max={100}
formatter={(value) => `${value}%`}
parser={(value) => value.replace('%', '')}
onChange={this.handleChange}
/>
</div>
</div>
<ReactDemokit
className="p-3 app-container"
url="https://github.com/afeiship/react-ant-input-number">
<ReactAntInputNumber className="is-fullwidth mb-2" placeholder="Input your number." onChange={this.handleChange} />
<ReactAntInputNumber
className="is-fullwidth"
defaultValue={100}
min={0}
max={100}
formatter={(value) => `${value}%`}
parser={(value) => value.replace('%', '')}
onChange={this.handleChange}
/>
</ReactDemokit>
);
}
}
Expand All @@ -75,3 +68,19 @@ npm update @feizheng/react-ant-input-number

## documentation
- https://afeiship.github.io/react-ant-input-number/


## license
Code released under [the MIT license](https://github.com/afeiship/react-ant-input-number/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/react-ant-input-number
[version-url]: https://npmjs.org/package/@jswork/react-ant-input-number

[license-image]: https://img.shields.io/npm/l/@jswork/react-ant-input-number
[license-url]: https://github.com/afeiship/react-ant-input-number/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/react-ant-input-number
[size-url]: https://github.com/afeiship/react-ant-input-number/blob/master/dist/react-ant-input-number.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/react-ant-input-number
[download-url]: https://www.npmjs.com/package/@jswork/react-ant-input-number
4 changes: 0 additions & 4 deletions Rakefile

This file was deleted.

33 changes: 26 additions & 7 deletions build/TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# react-ant-input-number
> Input number for react.
## installation
```shell
npm install -S @feizheng/react-ant-input-number
```
[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## update
## installation
```shell
npm update @feizheng/react-ant-input-number
npm install -S @jswork/react-ant-input-number
```

## properties
Expand All @@ -17,7 +17,10 @@ __GENERATE_DOCS__
## usage
1. import css
```scss
@import "~@feizheng/react-ant-input-number/dist/style.scss";
@import "~@jswork/react-ant-input-number/dist/style.css";

// or use sass
@import "~@jswork/react-ant-input-number/dist/style.scss";

// customize your styles:
$react-ant-input-number-options: ()
Expand All @@ -29,3 +32,19 @@ __GENERATE_DAPP__

## documentation
- https://afeiship.github.io/react-ant-input-number/


## license
Code released under [the MIT license](https://github.com/afeiship/react-ant-input-number/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/react-ant-input-number
[version-url]: https://npmjs.org/package/@jswork/react-ant-input-number

[license-image]: https://img.shields.io/npm/l/@jswork/react-ant-input-number
[license-url]: https://github.com/afeiship/react-ant-input-number/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/react-ant-input-number
[size-url]: https://github.com/afeiship/react-ant-input-number/blob/master/dist/react-ant-input-number.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/react-ant-input-number
[download-url]: https://www.npmjs.com/package/@jswork/react-ant-input-number
16 changes: 12 additions & 4 deletions build/index.js → build/base.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
configs,
inputs,
outputs,
loaders,
outputs,
plugins
} from '@feizheng/webpack-lib-kits';
} from '@jswork/webpack-lib-kits';

export default {
mode: configs.mode(),
Expand All @@ -15,7 +15,15 @@ export default {
alias: configs.alias()
},
module: {
rules: [loaders.babel(), loaders.image(), loaders.sass(), loaders.version()]
rules: [
loaders.babel(),
loaders.image(),
loaders.sass(),
loaders.version()
]
},
plugins: [plugins.minCssExtract()]
plugins: [
plugins.progressBar(),
plugins.minCssExtract()
]
};
22 changes: 0 additions & 22 deletions build/build.js

This file was deleted.

4 changes: 2 additions & 2 deletions build/dev.js → build/development.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import baseConfig from '.';
import baseConfig from './base';
import merge from 'webpack-merge';
import { configs, inputs, outputs, loaders, plugins } from '@feizheng/webpack-lib-kits';
import { configs, inputs, outputs, loaders, plugins } from '@jswork/webpack-lib-kits';

export default merge(baseConfig, {
entry: inputs.docs(),
Expand Down
20 changes: 17 additions & 3 deletions build/docs.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
import baseConfig from '.';
import {
inputs,
outputs,

plugins
} from '@jswork/webpack-lib-kits';
import OfflinePlugin from 'offline-plugin';
import merge from 'webpack-merge';
import { configs, inputs, outputs, loaders, plugins } from '@feizheng/webpack-lib-kits';
import baseConfig from './base';

export default merge(baseConfig, {
entry: inputs.docs(),
output: outputs.docs(),
plugins: [plugins.clean(), plugins.html()]
plugins: [
plugins.clean(),
plugins.html(),
new OfflinePlugin({
ServiceWorker: {
events: true
}
})
]
});
8 changes: 4 additions & 4 deletions build/markdown.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const rmp = require('@feizheng/react-markdown-props');
const rmp = require('@jswork/react-markdown-props');
const fs = require('fs');
const indentString = require('indent-string');

require('@feizheng/next-js-core2');
require('@feizheng/next-replace-in-file');
require('@jswork/next');
require('@jswork/next-replace-in-file');

nx.declare({
statics: {
Expand All @@ -23,7 +23,7 @@ nx.declare({
nx.replaceInFile('README.md', [
['__GENERATE_DOCS__', rmp('./src/components/index.js')],
['__GENERATE_DAPP__', indentString(docApp, 2)],
['../src/main', '@feizheng/react-ant-input-number']
['../src/main', '@jswork/react-ant-input-number']
]);
}
}
Expand Down
Loading

0 comments on commit e5e2375

Please sign in to comment.