Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove authored Aug 4, 2023
0 parents commit 99b433c
Show file tree
Hide file tree
Showing 27 changed files with 672 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
119 changes: 119 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: CI
on:
push:
branches:
- main

# env:
# SKIP_PREFLIGHT_CHECK: true
jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16

- name: Look Changelog
uses: jaywcjlove/changelog-generator@main
with:
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-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'

- run: npm install --unsafe-perm
# - run: npm run hoist
- run: npm run build
- run: npm run coverage
- run: npm run bundle
- run: npm run bundle:min
- run: npm run doc

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

- name: Create Coverage Badges
uses: jaywcjlove/coverage-badges-cli@main
with:
output: website/build/badges.svg

- run: cp -rp coverage website/build
- run: cp -rp core/dist/*js website/build
- run: cp -rp core/dist/*css website/build

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

- name: get tag version
id: tag_version
uses: jaywcjlove/changelog-generator@main

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
commit_message: ${{steps.tag_version.outputs.tag}} ${{ github.event.head_commit.message }}
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/build

- name: Generate Changelog
id: changelog
uses: jaywcjlove/changelog-generator@main
if: steps.create_tag.outputs.successful
with:
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: |
Documentation ${{ steps.changelog.outputs.tag }}: https://raw.githack.com/uiwjs/react-monorepo-template/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
Comparing Changes: ${{ 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

# - name: 📦 @uiw/react-layout publish to NPM
# uses: JS-DevTools/npm-publish@v1
# with:
# token: ${{ secrets.NPM_TOKEN }}
# package: ./core/package.json

# - run: npm publish --access public
# name: 📦 @uiw/react-monorepo-template to NPM
# working-directory: core
# continue-on-error: true
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
node_modules
coverage
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
.lerna_backup
.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
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 120,
"overrides": [
{
"files": ".prettierrc",
"options": { "parser": "json" }
}
]
}
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
18 changes: 18 additions & 0 deletions core/.kktrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { LoaderConfOptions, WebpackConfiguration } from 'kkt';
import lessModules from '@kkt/less-modules';

export default (conf: WebpackConfiguration, env: 'development' | 'production', options: LoaderConfOptions) => {
conf = lessModules(conf, env, options);
if (options.bundle) {
conf.output!.library = '@uiw/react-layout';
conf.externals = {
react: {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react',
},
};
}
return conf;
};
97 changes: 97 additions & 0 deletions core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
react-monorepo-template
===

[![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)
[![Coverage Status](https://uiwjs.github.io/react-monorepo-template/badges.svg)](https://uiwjs.github.io/react-monorepo-template/coverage/lcov-report/)

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
```


### Using

```jsx mdx:preview
import React from "react";
import MonorepoTemplate from '@uiw/react-monorepo-template';

export default function App() {
return (
<div className="container">
<MonorepoTemplate>
Example test
</MonorepoTemplate>
</div>
);
}
```

## Contributors

As always, thanks to our amazing contributors!

<a href="https://github.com/uiwjs/react-monorepo-template/graphs/contributors">
<img src="https://uiwjs.github.io/react-monorepo-template/CONTRIBUTORS.svg" />
</a>

Made with [github-action-contributors](https://github.com/jaywcjlove/github-action-contributors).

## 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.1.0",
"description": "React Monorepo Template.",
"author": "Kenny Wong <[email protected]>",
"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",
"dist",
"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"
},
"devDependencies": {
"@babel/runtime": "^7.18.9",
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
}
Loading

0 comments on commit 99b433c

Please sign in to comment.