Skip to content

Commit

Permalink
chore: use workspaces & support react 18.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jun 14, 2022
1 parent c6a62d7 commit 51be410
Show file tree
Hide file tree
Showing 35 changed files with 682 additions and 249 deletions.
35 changes: 25 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,40 @@ jobs:
- run: npm run bundle:min
- run: npm run doc

- working-directory: core
run: |
npm run type-check
- name: Generate Contributors Images
uses: jaywcjlove/github-action-contributors@main
with:
filter-author: (renovate\[bot\]|renovate-bot|dependabot\[bot\])
output: build/CONTRIBUTORS.svg
avatarSize: 42

- name: Create Tag
id: create_tag
uses: jaywcjlove/create-tag-action@v1.3.6
with:
package-path: ./core/package.json

- name: get tag version
id: tag_version
uses: jaywcjlove/changelog-generator@v1.5.6

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
commit_message: ${{steps.tag_version.outputs.tag}} ${{ github.event.head_commit.message }}
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build

- name: Create Tag
id: create_tag
uses: jaywcjlove/create-tag-action@v1.3.5
with:
package-path: ./package.json
publish_dir: ./www/build
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'

- name: Generate Changelog
id: changelog
uses: jaywcjlove/changelog-generator@v1.4.8
uses: jaywcjlove/changelog-generator@v1.5.6
with:
token: ${{ secrets.GITHUB_TOKEN }}
head-ref: ${{steps.create_tag.outputs.version}}
Expand All @@ -69,5 +80,9 @@ jobs:
${{ steps.changelog.outputs.changelog }}
- run: npm install @jsdevtools/npm-publish -g
- run: npm-publish --token="${{ secrets.NPM_TOKEN }}" ./package.json
- name: 📦 @uiw/react-heat-map publish to NPM
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./core/package.json

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cjs
esm
lib
build
dist
node_modules
Expand Down
77 changes: 0 additions & 77 deletions .kktrc.ts

This file was deleted.

6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Basic usage example, Please pay warning to the time setting.

⚠️ Example: ~~`2016-01-11`<!--rehype:style=color: red;background-color: #ffd8d8;-->~~ -> `2016/01/11`<!--rehype:style=color: green;background: #a7e4b5;-->, Support `Safari`<!--rehype:style=background-color: #87d499;-->

<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->
```jsx
import ReactDOM from 'react-dom';
import HeatMap from '@uiw/react-heat-map';
Expand Down Expand Up @@ -284,6 +283,10 @@ ReactDOM.render(<Demo />, _mount_);

Runs the project in development mode.

```bash
npm i
```

```bash
# Step 1, run first, listen to the component compile and output the .js file
# listen for compilation output type .d.ts file
Expand All @@ -298,6 +301,7 @@ Builds the app for production to the build folder.

```bash
npm run build
npm run doc
```

The build is minified and the filenames include the hashes.
Expand Down
22 changes: 22 additions & 0 deletions core/.kktrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// import path from 'path';
import { Configuration } from 'webpack';
import { LoaderConfOptions } from 'kkt';
import lessModules from '@kkt/less-modules';
// import rawModules from '@kkt/raw-modules';
// import pkg from './package.json';

export default (conf: Configuration, env: 'production' | 'development', options: LoaderConfOptions) => {
conf = lessModules(conf, env, options);
if (options.bundle) {
conf.output!.library = '@uiw/react-heat-map';
conf.externals = {
react: {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react',
},
};
}
return conf;
};
Loading

0 comments on commit 51be410

Please sign in to comment.