Skip to content

Commit 45c6e23

Browse files
committed
Initial commit
0 parents  commit 45c6e23

31 files changed

+716
-0
lines changed

.github/FUNDING.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# These are supported funding model platforms
2+
3+
github: [jaywcjlove]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: #npm/kkt
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
custom: https://jaywcjlove.github.io/sponsor.html

.github/workflows/ci.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
# env:
8+
# SKIP_PREFLIGHT_CHECK: true
9+
jobs:
10+
windows:
11+
runs-on: windows-2019
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v2
15+
with:
16+
node-version: 14
17+
18+
- name: Look Changelog
19+
uses: jaywcjlove/[email protected]
20+
with:
21+
filter-author: (小弟调调™|Renovate Bot|renovate-bot)
22+
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'
23+
24+
- run: npm install --unsafe-perm
25+
- run: npm run hoist
26+
- run: npm run build
27+
- run: npm run coverage
28+
- run: npm run doc
29+
30+
build:
31+
runs-on: ubuntu-18.04
32+
steps:
33+
- uses: actions/checkout@v2
34+
- uses: actions/setup-node@v2
35+
with:
36+
node-version: 14
37+
38+
- name: Look Changelog
39+
uses: jaywcjlove/[email protected]
40+
with:
41+
filter-author: (小弟调调™|Renovate Bot|renovate-bot)
42+
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'
43+
44+
- run: npm install --unsafe-perm
45+
- run: npm run hoist
46+
- run: npm run build
47+
- run: npm run coverage
48+
- run: npm run bundle
49+
- run: npm run bundle:min
50+
- run: npm run doc
51+
52+
- name: Generate Contributors Images
53+
uses: jaywcjlove/github-action-contributors@main
54+
with:
55+
filter-author: (renovate\[bot\]|renovate-bot|dependabot\[bot\])
56+
output: website/build/CONTRIBUTORS.svg
57+
avatarSize: 42
58+
59+
- name: Create Coverage Badges
60+
uses: jaywcjlove/coverage-badges-cli@main
61+
with:
62+
output: website/build/badges.svg
63+
64+
- run: cp -rp coverage website/build
65+
- run: cp -rp core/dist/*js website/build
66+
- run: cp -rp core/dist/*css website/build
67+
68+
- name: Is a tag created auto?
69+
id: create_tag
70+
uses: jaywcjlove/[email protected]
71+
with:
72+
token: ${{ secrets.GITHUB_TOKEN }}
73+
package-path: ./core/package.json
74+
75+
- name: get tag version
76+
id: tag_version
77+
uses: jaywcjlove/[email protected]
78+
79+
- name: Deploy
80+
uses: peaceiris/actions-gh-pages@v3
81+
with:
82+
commit_message: ${{steps.tag_version.outputs.tag}} ${{ github.event.head_commit.message }}
83+
github_token: ${{ secrets.GITHUB_TOKEN }}
84+
publish_dir: ./website/build
85+
86+
- name: Generate Changelog
87+
id: changelog
88+
uses: jaywcjlove/[email protected]
89+
if: steps.create_tag.outputs.successful
90+
with:
91+
head-ref: ${{ steps.create_tag.outputs.version }}
92+
filter-author: (小弟调调™|Renovate Bot|renovate-bot)
93+
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'
94+
95+
- name: Create Release
96+
uses: ncipollo/release-action@v1
97+
if: steps.create_tag.outputs.successful
98+
with:
99+
token: ${{ secrets.GITHUB_TOKEN }}
100+
name: ${{ steps.changelog.outputs.tag }}
101+
tag: ${{ steps.changelog.outputs.tag }}
102+
body: |
103+
Documentation ${{ steps.changelog.outputs.tag }}: https://raw.githack.com/uiwjs/react-monorepo-template/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
104+
Comparing Changes: ${{ steps.changelog.outputs.compareurl }}
105+
106+
${{ steps.changelog.outputs.changelog }}
107+
108+
# - run: git status
109+
# - run: npm install @jsdevtools/npm-publish -g
110+
# - run: npm-publish --token="${{ secrets.NPM_TOKEN }}" ./core/package.json
111+
112+
# - name: 📦 @uiw/react-layout publish to NPM
113+
# uses: JS-DevTools/npm-publish@v1
114+
# with:
115+
# token: ${{ secrets.NPM_TOKEN }}
116+
# package: ./core/package.json

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
node_modules
2+
coverage
3+
dist
4+
build
5+
lib
6+
esm
7+
cjs
8+
9+
dist.css
10+
11+
# Log files
12+
npm-debug.log*
13+
yarn.lock
14+
yarn-debug.log*
15+
yarn-error.log*
16+
pnpm-debug.log*
17+
package-lock.json
18+
19+
# local env files
20+
.env.local
21+
.env.*.local
22+
23+
# Editor directories and files
24+
.DS_Store
25+
.idea
26+
.lerna_backup
27+
.vscode
28+
*.suo
29+
*.ntvs*
30+
*.njsproj
31+
*.sln
32+
*.sw?

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no-install lint-staged

.prettierignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
**/*.md
2+
**/*.svg
3+
**/*.ejs
4+
**/*.yml
5+
package.json
6+
node_modules
7+
dist
8+
build
9+
lib
10+
esm
11+
cjs
12+
test

.prettierrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"printWidth": 120,
5+
"overrides": [
6+
{
7+
"files": ".prettierrc",
8+
"options": { "parser": "json" }
9+
}
10+
]
11+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 uiw
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
core/README.md

core/.kktrc.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { LoaderConfOptions, WebpackConfiguration } from 'kkt';
2+
import lessModules from '@kkt/less-modules';
3+
4+
export default (conf: WebpackConfiguration, env: 'development' | 'production', options: LoaderConfOptions) => {
5+
conf = lessModules(conf, env, options);
6+
if (options.bundle) {
7+
conf.output!.library = '@uiw/react-layout';
8+
conf.externals = {
9+
react: {
10+
root: 'React',
11+
commonjs2: 'react',
12+
commonjs: 'react',
13+
amd: 'react',
14+
},
15+
};
16+
}
17+
return conf;
18+
};

core/README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
react-monorepo-template
2+
===
3+
4+
[![Build & Deploy](https://github.com/uiwjs/react-monorepo-template/actions/workflows/ci.yml/badge.svg)](https://github.com/uiwjs/react-monorepo-template/actions/workflows/ci.yml)
5+
[![Coverage Status](https://uiwjs.github.io/react-monorepo-template/badges.svg)](https://uiwjs.github.io/react-monorepo-template/coverage/lcov-report/)
6+
7+
Simple [React](https://github.com/facebook/react) package development project example template.
8+
9+
## Directory Structure
10+
11+
```bash
12+
├── LICENSE
13+
├── README.md -> core/README.md
14+
├── core # 📦 package @uiw/react-monorepo-template
15+
│ ├── README.md
16+
│ ├── cjs # 🔄 Compiled cjs directory
17+
│ ├── esm # 🔄 Compiled esm directory
18+
│ ├── src # Package source directory
19+
│ ├── dist.css # 🔄 compile less to css
20+
│ ├── package.json # name => @uiw/react-monorepo-template
21+
│ └── tsconfig.json
22+
├── lerna.json
23+
├── package.json
24+
├── tsconfig.json
25+
├── test # ⛑ test case
26+
└── website # 🐝 Package example test, website
27+
├── README.md
28+
├── package.json
29+
├── public
30+
├── src
31+
└── tsconfig.json
32+
```
33+
34+
## Development
35+
36+
1. Install
37+
38+
```bash
39+
npm install
40+
```
41+
42+
2. Dependencies in the installation package and example
43+
44+
```bash
45+
npm run hoist
46+
```
47+
48+
3. To develop, run the self-reloading build:
49+
50+
```bash
51+
npm run build # Compile packages 📦 @uiw/react-monorepo-template
52+
npm run watch # Real-time compilation 📦 @uiw/react-monorepo-template
53+
```
54+
55+
4. Run Document Website Environment:
56+
57+
```bash
58+
npm run start
59+
```
60+
61+
5. To contribute, please fork repos, add your patch and tests for it (in the `test/` folder) and submit a pull request.
62+
63+
```
64+
npm run test
65+
```
66+
67+
## Contributors
68+
69+
As always, thanks to our amazing contributors!
70+
71+
<a href="https://github.com/uiwjs/react-monorepo-template/graphs/contributors">
72+
<img src="https://uiwjs.github.io/react-monorepo-template/CONTRIBUTORS.svg" />
73+
</a>
74+
75+
Made with [github-action-contributors](https://github.com/jaywcjlove/github-action-contributors).
76+
77+
## License
78+
79+
Licensed under the MIT License.

0 commit comments

Comments
 (0)