Skip to content

Commit a864d4e

Browse files
authored
Initial commit
0 parents  commit a864d4e

27 files changed

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

.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: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
'react-dom': {
16+
root: 'ReactDOM',
17+
commonjs2: 'react-dom',
18+
commonjs: 'react-dom',
19+
amd: 'react-dom',
20+
},
21+
};
22+
}
23+
return conf;
24+
};

core/README.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
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. Dependencies in the installation package and example
37+
38+
```bash
39+
npm run install
40+
```
41+
42+
2. To develop, run the self-reloading build:
43+
44+
```bash
45+
npm run build # Compile packages 📦 @uiw/react-monorepo-template
46+
npm run watch # Real-time compilation 📦 @uiw/react-monorepo-template
47+
```
48+
49+
3. Run Document Website Environment:
50+
51+
```bash
52+
npm run start
53+
```
54+
55+
4. To contribute, please fork repos, add your patch and tests for it (in the `test/` folder) and submit a pull request.
56+
57+
```
58+
npm run test
59+
```
60+
61+
62+
### Using
63+
64+
```jsx mdx:preview
65+
import React from "react";
66+
import MonorepoTemplate from '@uiw/react-monorepo-template';
67+
68+
export default function App() {
69+
return (
70+
<div className="container">
71+
<MonorepoTemplate>
72+
Example test
73+
</MonorepoTemplate>
74+
</div>
75+
);
76+
}
77+
```
78+
79+
## Contributors
80+
81+
As always, thanks to our amazing contributors!
82+
83+
<a href="https://github.com/uiwjs/react-monorepo-template/graphs/contributors">
84+
<img src="https://uiwjs.github.io/react-monorepo-template/CONTRIBUTORS.svg" />
85+
</a>
86+
87+
Made with [contributors](https://github.com/jaywcjlove/github-action-contributors).
88+
89+
## License
90+
91+
Licensed under the MIT License.

0 commit comments

Comments
 (0)