Skip to content

Commit

Permalink
feat: core-x项目的基本结构初始化
Browse files Browse the repository at this point in the history
  • Loading branch information
mmdapl committed Jun 17, 2024
1 parent e18d4a2 commit 668c6be
Show file tree
Hide file tree
Showing 39 changed files with 10,697 additions and 4 deletions.
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules
*/logs
*/run
*/typings
.idea
.github
nginx
docs
eslint.config.js
.gitignore

71 changes: 71 additions & 0 deletions .github/workflows/CD.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# CD持续交付
# - 部署到Github Pages
# - 部署到Vercel托管平台
# - 发布新的Github Release
# 参考:https://v2.vuepress.vuejs.org/zh/guide/deployment.html#github-pages
#

name: CD

on:
push:
branches:
- next
workflow_dispatch:

jobs:
# 版本发布
release:
name: 创建Github发布
runs-on: ubuntu-latest
# 主库next且执行release更新时执行
if: github.repository == '142vip/142vip-oauth' && startsWith(github.event.head_commit.message, 'chore(release):')

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
token: ${{ secrets.TOKEN }}
persist-credentials: false
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
fetch-depth: 0

# 打成压缩包
- name: Create Zip Package
run: |
zip -r 142vip-oauth.zip . \
-x "node_modules/*" \
-x "*.git*"
# 提取版本号
- name: Get New Version Number
id: releaseVersion
run: |
echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
# 创建发布版本
- name: Create New Release
id: createRelease
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
tag_name: v${{ steps.releaseVersion.outputs.version }}
release_name: v${{ steps.releaseVersion.outputs.version }}
body: |
Release ${{ steps.releaseVersion.outputs.version }}
### ✨ Features
### 🐛 Bug Fixes
# 更新资源
- name: Upload Resource Assets
uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
upload_url: ${{ steps.createRelease.outputs.upload_url }}
asset_path: ./142vip-oauth.zip
asset_name: 142vip-oauth.zip
asset_content_type: application/zip
68 changes: 68 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# 代码检查
name: CI

# 触发条件
on:
# 提PR到next分支触发CI
# pull_request:
# branches:
# - next
# push:
# branches:
# - next

# 手动触发部署
workflow_dispatch:

schedule:
- cron: '0 0 1 * *'

jobs:
# 本地构建
Base-Build:
name: 基础编译构建
runs-on: ubuntu-latest
if: github.repository == '142vip/142vip-oauth' && github.event_name == 'pull_request'
permissions:
actions: read
pull-requests: read

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
token: ${{ secrets.TOKEN }}
persist-credentials: false
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
fetch-depth: 0

# 安装PNPM
- name: PNPM Install
uses: pnpm/action-setup@v2
with:
version: 7.33.2

# 安装Node环境
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18.18.0
# 淘宝镜像加速
registry-url: 'https://registry.npmmirror.com'
# 缓存
cache: pnpm

# 下载依赖,并执行初始化脚本:钩子函数、思维导图构建
- name: Install Dependencies
run: |
./scripts/ci
# todo lint校验待优化
# - name: Code LintFix
# run: |
# ./scripts/lint

- name: Build Midway Example Code
run: |
./scripts/build xxx
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
logs/
node_modules/
package-lock.json
coverage/
.idea/
run/
.DS_Store
typings/
.vscode
/**/.DS_Store
/.vscode/
dist/
*/jsconfig.json
*/.turbo/
.husky
/**/jsconfig.json
/**/**/.nuxt/
/.turbo/
**/.turbo/
**/**/.output/

75 changes: 75 additions & 0 deletions .markdownlint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/**
* markdownlint-cli格式化markdown文档
* 规则参考:https://github.com/updownpress/markdown-lint/tree/master/rules
*/
module.exports = {
default: true,
MD001: false,
MD003: {
style: 'atx',
},
MD004: {
style: 'dash',
},
MD013: false,
MD024: {
allow_different_nesting: true,
},
MD025: {
front_matter_title: '',
},
MD033: {
allowed_elements: [
'br',
'template',
'script',
'style',
'ArtPlayer',
'AudioPlayer',
'AutoCatalog',
'Badge',
'BiliBili',
'Catalog',
'CodePen',
'DemoProject',
'FontIcon',
'HighlightPanel',
'ProjectLink',
'PDF',
'Replit',
'Share',
'SiteInfo',
'StackBlitz',
'XiGua',
'VidStack',
'VideoPlayer',
'YouTube',
'AppearanceSwitch',
'HopeIcon',
'FlowChartPlayground',
'IconDisplay',
'KatexPlayground',
'PrintButton',
'ThemeColorPicker',
'ToggleFullScreenButton',
'ToggleRTLButton',
'div',
'a',
'p',
'img',
'table',
'strong',
'sub',
],
},
MD035: {
style: '---',
},
MD036: false,
MD040: true,
MD045: false,
MD041: false,
MD042: false,
MD046: false,
MD049: false,
}
5 changes: 5 additions & 0 deletions .markdownlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**/node_modules/**
LICENSE
.idea
.husky
.github
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shamefully-hoist=true
registry=https://registry.npmmirror.com
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License
The MIT License (MIT)

Copyright (c) 2024 142vip
Copyright (c) 2019-2024 142vip 储凡

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# core-x
核心库开源,x代表一切可能性
# @142vip/core-x

坚持开源,x代表一切都有可能
3 changes: 3 additions & 0 deletions apps/egg-demo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "egg-demo"
}
27 changes: 27 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# 支持服务:
#
version: '2'
services:
oauth-client:
image: xxxx
container_name: oauth-client
hostname: oauth-client
ports:
- '0.0.0.0:8000:80'
networks:
net:
ipv4_address: 172.30.0.12

# 创建桥接网络
networks:
# 桥接网络名称,配合文件前缀,最后为dev_test_env_net 参考:https://www.jianshu.com/p/d70c61d45364
net:
driver: bridge
# external: true
ipam:
driver: default
config:
- subnet: 172.30.0.0/24
# 网关
gateway: 172.30.0.1
35 changes: 35 additions & 0 deletions docs/技术栈.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## 技术栈

- Nuxtjs框架
- Vue-Ant-Design框架
- Oauth2登录授权

### 功能细节

### 存在问题

### 开发

> 总的来说,是基于Vue来进行页面开发,针对SSR和页面效果会选用不同的框架;
- UI框架:vue-ant-design

- 开发框架:Nuxtjs

- 前端请求:axios

### 部署

阿里云

### 脚本

```shell
##bin/bash
## 阿里云密码
pwd=${1}

## 登录阿里云
docker login --username=litiao2237221210 --password=${pwd} registry.cn-hangzhou.aliyuncs.com

```
Loading

0 comments on commit 668c6be

Please sign in to comment.