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 b59aa2d commit 4218032
Show file tree
Hide file tree
Showing 30 changed files with 356 additions and 232 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.
73 changes: 47 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,50 @@
# react-digital
> React digital.
## installation
```shell
npm install -S @feizheng/react-digital
```
[![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-digital
npm install -S @jswork/react-digital
```

## properties
| Name | Type | Default | Description |
| --------- | ------ | ------- | ------------------------------------- |
| className | string | - | The extended className for component. |
| value | any | ':' | Default value. |
| onChange | func | noop | The change handler. |
| flat | bool | false | If digit equal width. |
| Name | Type | Required | Default | Description |
| --------- | ------ | -------- | ------- | ------------------------------------- |
| className | string | false | - | The extended className for component. |
| value | any | false | ':' | Default value. |
| onChange | func | false | noop | The change handler. |
| flat | bool | false | false | If digit equal width. |


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

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

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

class App extends React.Component {
componentDidMount() {}
render() {
return (
<div className="app-container">
<ReactDemokit
className="p-3 app-container"
url="https://github.com/afeiship/react-digital">
<div className="dib_ mr5_" style={{ fontSize: 20 }}>
<ReactDigital value={2} />
<ReactDigital value={0} />
Expand All @@ -53,16 +58,16 @@ npm update @feizheng/react-digital
<ReactDigital value={7} />
</div>
<div className="mr5_" style={{ fontSize: 10, marginTop: 20 }}>
<ReactDigital flat={true} className="dib" value={0} />
<ReactDigital flat={true} className="dib" value={0} />
<ReactDigital flat={true} className="dib" value={':'} />
<ReactDigital flat={true} className="dib" value={1} />
<ReactDigital flat={true} className="dib" value={6} />
<ReactDigital flat={true} className="dib" value={':'} />
<ReactDigital flat={true} className="dib" value={0} />
<ReactDigital flat={true} className="dib" value={0} />
<ReactDigital flat className="dib" value={0} />
<ReactDigital flat className="dib" value={0} />
<ReactDigital flat className="dib" value={':'} />
<ReactDigital flat className="dib" value={1} />
<ReactDigital flat className="dib" value={6} />
<ReactDigital flat className="dib" value={':'} />
<ReactDigital flat className="dib" value={0} />
<ReactDigital flat className="dib" value={0} />
</div>
</div>
</ReactDemokit>
);
}
}
Expand All @@ -73,3 +78,19 @@ npm update @feizheng/react-digital
## documentation
- https://afeiship.github.io/react-digital/
## license
Code released under [the MIT license](https://github.com/afeiship/react-digital/blob/master/LICENSE.txt).
[version-image]: https://img.shields.io/npm/v/@jswork/react-digital
[version-url]: https://npmjs.org/package/@jswork/react-digital
[license-image]: https://img.shields.io/npm/l/@jswork/react-digital
[license-url]: https://github.com/afeiship/react-digital/blob/master/LICENSE.txt
[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/react-digital
[size-url]: https://github.com/afeiship/react-digital/blob/master/dist/react-digital.min.js
[download-image]: https://img.shields.io/npm/dm/@jswork/react-digital
[download-url]: https://www.npmjs.com/package/@jswork/react-digital
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-digital
> React digital.
## installation
```shell
npm install -S @feizheng/react-digital
```
[![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-digital
npm install -S @jswork/react-digital
```

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

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

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

## documentation
- https://afeiship.github.io/react-digital/


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

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

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

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

[download-image]: https://img.shields.io/npm/dm/@jswork/react-digital
[download-url]: https://www.npmjs.com/package/@jswork/react-digital
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()
]
};
21 changes: 0 additions & 21 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-digital']
['../src/main', '@jswork/react-digital']
]);
}
}
Expand Down
22 changes: 22 additions & 0 deletions build/production.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {
externals,
inputs,
outputs,
plugins
} from '@jswork/webpack-lib-kits';
import merge from 'webpack-merge';
import baseConfig from './base';

export default merge(baseConfig, {
entry: inputs.build(),
output: outputs.build({
library: 'ReactDigital'
}),
devtool: 'source-map',
externals: externals.node(),
plugins: [
plugins.banner(),
plugins.clean(),
plugins.copyStyles(),
]
});
Loading

0 comments on commit 4218032

Please sign in to comment.