Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jan 17, 2022
0 parents commit 4379792
Show file tree
Hide file tree
Showing 30 changed files with 649 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# These are supported funding model platforms

github: [jaywcjlove]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: #npm/kkt
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
custom: https://jaywcjlove.github.io/sponsor.html
91 changes: 91 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Build & Deploy
on:
push:
branches:
- main

# env:
# SKIP_PREFLIGHT_CHECK: true
jobs:
windows:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14

- name: Look Changelog
uses: jaywcjlove/changelog-generator@v1.4.8
with:
token: ${{ secrets.GITHUB_TOKEN }}
filter-author: (小弟调调™|Renovate Bot|renovate-bot)
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'

- run: npm install --unsafe-perm
- run: npm run hoist
- run: npm run build
- run: npm run coverage
- run: npm run doc

build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14

- name: Look Changelog
uses: jaywcjlove/changelog-generator@v1.4.8
with:
token: ${{ secrets.GITHUB_TOKEN }}
filter-author: (小弟调调™|Renovate Bot|renovate-bot)
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'

- run: npm install --unsafe-perm
- run: npm run hoist
- run: npm run build
- run: npm run coverage
- run: npm run doc

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/build

- name: Is a tag created auto?
id: create_tag
uses: jaywcjlove/create-tag-action@v1.3.5
with:
token: ${{ secrets.GITHUB_TOKEN }}
package-path: ./core/package.json

- name: Generate Changelog
id: changelog
uses: jaywcjlove/changelog-generator@v1.4.8
if: steps.create_tag.outputs.successful
with:
token: ${{ secrets.GITHUB_TOKEN }}
head-ref: ${{ steps.create_tag.outputs.version }}
filter-author: (小弟调调™|Renovate Bot|renovate-bot)
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'

- name: Create Release
uses: ncipollo/release-action@v1
if: steps.create_tag.outputs.successful
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ steps.changelog.outputs.tag }}
tag: ${{ steps.changelog.outputs.tag }}
body: |
${{ steps.changelog.outputs.compareurl }}
${{ steps.changelog.outputs.changelog }}
# - run: git status
# - run: npm install @jsdevtools/npm-publish -g
# - run: npm-publish --token="${{ secrets.NPM_TOKEN }}" ./core/package.json

30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
node_modules
dist
build
lib
esm
cjs

dist.css

# Log files
npm-debug.log*
yarn.lock
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
package-lock.json

# local env files
.env.local
.env.*.local

# Editor directories and files
.DS_Store
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install lint-staged
12 changes: 12 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
**/*.md
**/*.svg
**/*.ejs
**/*.yml
package.json
node_modules
dist
build
lib
esm
cjs
test
Empty file added .prettierrc
Empty file.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 uiw

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.
1 change: 1 addition & 0 deletions README.md
66 changes: 66 additions & 0 deletions core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
react-monorepo-template
===

Simple [React](https://github.com/facebook/react) package development project example template.

## Directory Structure

```bash
├── LICENSE
├── README.md -> core/README.md
├── core # 📦 package @uiw/react-monorepo-template
│ ├── README.md
│ ├── cjs # 🔄 Compiled cjs directory
│ ├── esm # 🔄 Compiled esm directory
│ ├── src # Package source directory
│ ├── dist.css # 🔄 compile less to css
│ ├── package.json # name => @uiw/react-monorepo-template
│ └── tsconfig.json
├── lerna.json
├── package.json
├── tsconfig.json
├── test # ⛑ test case
└── website # 🐝 Package example test, website
├── README.md
├── package.json
├── public
├── src
└── tsconfig.json
```

## Development

1. Install

```bash
npm install
```

2. Dependencies in the installation package and example

```bash
npm run hoist
```

3. To develop, run the self-reloading build:

```bash
npm run build # Compile packages 📦 @uiw/react-monorepo-template
npm run watch # Real-time compilation 📦 @uiw/react-monorepo-template
```

4. Run Document Website Environment:

```bash
npm run start
```

5. To contribute, please fork repos, add your patch and tests for it (in the `test/` folder) and submit a pull request.

```
npm run test
```

## License

Licensed under the MIT License.
53 changes: 53 additions & 0 deletions core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "@uiw/react-monorepo-template",
"version": "1.0.0",
"description": "React Monorepo Template.",
"author": "Kenny Wong <wowohoo@qq.com>",
"homepage": "https://uiwjs.github.io/react-monorepo-template",
"repository": {
"type": "git",
"url": "https://github.com/uiwjs/react-monorepo-template.git"
},
"license": "MIT",
"main": "./cjs/index.js",
"module": "./esm/index.js",
"files": [
"dist.css",
"cjs",
"esm",
"src"
],
"publishConfig": {
"access": "public"
},
"keywords": [
"react-monorepo-template",
"react.js",
"react",
"template",
"monorepo",
"monorepo-template",
"uiw",
"uiw-react",
"react-component",
"component",
"components",
"ui",
"css",
"uikit",
"react-ui",
"framework"
],
"peerDependencies": {
"react": ">=16.9.0",
"react-dom": ">=16.9.0"
},
"dependencies": {},
"devDependencies": {
"@babel/runtime": "7.16.7",
"@types/react": "17.0.38",
"@types/react-dom": "17.0.11",
"react": "17.0.2",
"react-dom": "17.0.2"
}
}
21 changes: 21 additions & 0 deletions core/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from "react";
import "./style/index.less";

export interface MonorepoTemplateProps
extends React.AllHTMLAttributes<HTMLDivElement> {
prefixCls?: string;
}

export default function MonorepoTemplate(props: MonorepoTemplateProps = {}) {
const { className, prefixCls = "w-template", children, ...others } = props;
const cls = [className, prefixCls].filter(Boolean).join(" ");
return (
<div {...others} className={cls}>
{children &&
React.Children.map(children, (child) => {
if (React.isValidElement(child)) return child;
return <span> {child} </span>;
})}
</div>
);
}
5 changes: 5 additions & 0 deletions core/src/styles/index.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@w-template:~ "w-template";

.@{w-template} {
color: red;
}
9 changes: 9 additions & 0 deletions core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../tsconfig",
"include": ["src"],
"compilerOptions": {
"outDir": "./cjs",
"baseUrl": ".",
"noEmit": false
}
}
4 changes: 4 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"version": "1.0.0",
"packages": ["website", "core"]
}
46 changes: 46 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"private": true,
"scripts": {
"⬇️⬇️⬇️⬇️⬇️ package ⬇️⬇️⬇️⬇️⬇️": "▼▼▼▼▼ package ▼▼▼▼▼",
"build": "lerna exec --scope @uiw/* -- tsbb build && npm run css:build && npm run css:build:dist",
"watch": "lerna exec \"tsbb watch\" --scope @uiw/* && npm run css:watch",
"css:build": "lerna exec --scope @uiw/* -- compile-less -d src -o esm",
"css:watch": "lerna exec --scope @uiw/* -- compile-less -d src -o esm --watch",
"css:build:dist": "lerna exec --scope @uiw/* -- compile-less -d src -o lib --combine=dist.css",
"⬆️⬆️⬆️⬆️⬆️ package ⬆️⬆️⬆️⬆️⬆️": "▲▲▲▲▲ package ▲▲▲▲▲",
"start": "lerna exec --scope website -- npm run start",
"doc": "lerna exec --scope website -- npm run build",
"bootstrap": "lerna bootstrap",
"hoist": "lerna bootstrap --hoist",
"test": "tsbb test",
"coverage": "tsbb test --coverage --bail",
"prepare": "husky install",
"version": "lerna version --exact --force-publish --no-push --no-git-tag-version",
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
"remove": "npm run clean && lerna exec \"rm -rf package-lock.json\" --scope @uiw/* --scope website",
"clean": "lerna clean --yes"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,less,md,json}": [
"prettier --write"
]
},
"jest": {
"testMatch": [
"<rootDir>/test/*.{ts,tsx}"
],
"transformIgnorePatterns": [
"<rootDir>/node_modules/?!(.*)"
]
},
"license": "MIT",
"devDependencies": {
"compile-less-cli": "1.8.11",
"husky": "7.0.4",
"lerna": "4.0.0",
"lint-staged": "12.1.7",
"prettier": "2.5.1",
"pretty-quick": "3.1.3",
"tsbb": "3.5.4"
}
}
3 changes: 3 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["config:base"]
}

0 comments on commit 4379792

Please sign in to comment.