Skip to content

Commit

Permalink
🎉 chore: init template
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Sep 2, 2023
0 parents commit 7899fdf
Show file tree
Hide file tree
Showing 32 changed files with 712 additions and 0 deletions.
1 change: 1 addition & 0 deletions .changelogrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@lobehub/lint').changelog;
1 change: 1 addition & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@lobehub/lint').commitlint;
47 changes: 47 additions & 0 deletions .dumirc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { defineConfig } from 'dumi';
import { Github } from 'lucide-react';

import { homepage } from './package.json';

const themeConfig = {
actions: [
{
icon: Github,
link: homepage,
openExternal: true,
text: 'Github',
},
{
link: '/components/action-icon',
text: 'Get Started',
type: 'primary',
},
],
footer: 'Made with 🤯 by LobeHub',
name: 'Realtime Weather',
socialLinks: {
discord: 'https://discord.gg/AYFPHvv2jT',
github: homepage,
},
};

export default defineConfig({
extraBabelPlugins: ['babel-plugin-antd-style'],
favicons: [
'https://registry.npmmirror.com/@lobehub/assets-emoji/1.3.0/files/assets/rainbow.webp',
],
// locales: [{ id: 'en-US', name: 'English' }],
mfsu: {},
npmClient: 'pnpm',
outputPath: 'docs-dist',
// ssr: isProduction ? {} : false,
styles: [
`html, body { background: transparent; }
@media (prefers-color-scheme: dark) {
html, body { background: #000; }
}`,
],
themeConfig,
title: 'RealTime Weather - Lobe Chat Plugin',
});
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/lambda/
/scripts
/config
.history
public
dist
.umi
mock
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const config = require('@lobehub/lint').eslint;

module.exports = config;
19 changes: 19 additions & 0 deletions .fatherrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { defineConfig } from 'father';

export default defineConfig({
umd: {
output: { path: 'dist', filename: 'index' },
externals: {
'react': 'React',
'react-dom': 'ReactDOM',
'antd': 'antd',
'antd-style': 'antd-style',
},

chainWebpack: (memo) => {
// use https://github.com/systemjs/systemjs to dynamic load
memo.output.libraryTarget('system');
return memo;
},
},
});
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Release CI
on:
push:
branches:
- master
- alpha
- beta
- rc

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install deps
run: pnpm install

- name: lint
run: pnpm run lint && pnpm run doctor

- name: Test
run: pnpm run test

release:
needs: test
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install deps
run: pnpm install

- name: release
run: pnpm run release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test
on: [push]

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Install deps
run: pnpm install

- name: Test and coverage
run: pnpm run test:coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
44 changes: 44 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
**/node_modules
# roadhog-api-doc ignore
/src/utils/request-temp.js
_roadhog-api-doc

# production
/dist
/.vscode

# misc
.DS_Store
npm-debug.log*
yarn-error.log

/coverage
.idea
package-lock.json
*bak
.vscode

# visual studio code
.history
*.log
functions/*
.temp/**

# umi
.umi
.umi-production

# screenshot
screenshot
.firebase
.eslintcache

build

.env

.vercel
.next
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit ${1}
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
11 changes: 11 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
lockfile=false
resolution-mode=highest
public-hoist-pattern[]=*@umijs/lint*
public-hoist-pattern[]=*changelog*
public-hoist-pattern[]=*commitlint*
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=*postcss*
public-hoist-pattern[]=*prettier*
public-hoist-pattern[]=*remark*
public-hoist-pattern[]=*semantic-release*
public-hoist-pattern[]=*stylelint*
23 changes: 23 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**/*.svg
**/*.ejs
.umi
.umi-production
/dist
.dockerignore
.DS_Store
.eslintignore
*.png
*.toml
docker
.editorconfig
Dockerfile*
.gitignore
.prettierignore
LICENSE
.eslintcache
*.lock
yarn-error.log
.history
CNAME
/build
/public
1 change: 1 addition & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@lobehub/lint').prettier;
1 change: 1 addition & 0 deletions .releaserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@lobehub/lint').semanticRelease;
1 change: 1 addition & 0 deletions .remarkrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@lobehub/lint').remarklint;
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) 2023 LobeHub

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.
Loading

0 comments on commit 7899fdf

Please sign in to comment.