Skip to content

Commit 99b433c

Browse files
authored
Initial commit
0 parents  commit 99b433c

27 files changed

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

.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: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
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+
68+
### Using
69+
70+
```jsx mdx:preview
71+
import React from "react";
72+
import MonorepoTemplate from '@uiw/react-monorepo-template';
73+
74+
export default function App() {
75+
return (
76+
<div className="container">
77+
<MonorepoTemplate>
78+
Example test
79+
</MonorepoTemplate>
80+
</div>
81+
);
82+
}
83+
```
84+
85+
## Contributors
86+
87+
As always, thanks to our amazing contributors!
88+
89+
<a href="https://github.com/uiwjs/react-monorepo-template/graphs/contributors">
90+
<img src="https://uiwjs.github.io/react-monorepo-template/CONTRIBUTORS.svg" />
91+
</a>
92+
93+
Made with [github-action-contributors](https://github.com/jaywcjlove/github-action-contributors).
94+
95+
## License
96+
97+
Licensed under the MIT License.

0 commit comments

Comments
 (0)