Skip to content

Commit

Permalink
refactor: 迁移源码到挂件仓库 siyuan-note/bazaar#1095
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed May 9, 2023
1 parent 0614822 commit 56fd048
Show file tree
Hide file tree
Showing 410 changed files with 174,685 additions and 1,674 deletions.
21 changes: 21 additions & 0 deletions .env.development.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 是否开启info日志,true | false,建议生产环境设置为false
VITE_LOG_INFO_ENABLED=true

# 思源笔记授权api
# VITE_SIYUAN_API_URL=http://127.0.0.1:6806
# 思源笔记授权token
# VITE_SIYUAN_CONFIG_TOKEN=

# 开发阶段模拟的页面ID,仅限调试使用,生产环境无需此配置
# VITE_SIYUAN_DEV_PAGE_ID=20220927094918-1d85uyp
# VITE_SIYUAN_DEV_PAGE_ID=

# 图表服务器
# PLANT_UML_SERVR=https://www.plantuml.com/plantuml/svg/
# PLANT_UML_SERVR=

# 非挂件模式需要中间服务器实现跨域,生产环境可不设置,使用本项目
# VITE_MIDDLEWARE_URL=https://api.terwer.space/api/middleware
# VITE_MIDDLEWARE_URL=

# VITE_DEBUG_MODE=false
18 changes: 18 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 是否开启info日志,true | false,建议生产环境设置为false
VITE_LOG_INFO_ENABLED=false

# 思源笔记授权api
# VITE_SIYUAN_API_URL=http://127.0.0.1:6806
# 思源笔记授权token
# VITE_SIYUAN_CONFIG_TOKEN=

# 开发阶段模拟的页面ID,仅限调试使用,生产环境无需此配置
# VITE_SIYUAN_DEV_PAGE_ID=

# 图表服务器
# PLANT_UML_SERVR=https://www.plantuml.com/plantuml/svg/
# PLANT_UML_SERVR=

# 非挂件模式需要中间服务器实现跨域,生产环境可不设置,使用本项目
# VITE_MIDDLEWARE_URL=https://api.terwer.space/api/middleware
# VITE_MIDDLEWARE_URL=
19 changes: 19 additions & 0 deletions .env.production.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 是否开启info日志,true | false,建议生产环境设置为false
VITE_LOG_INFO_ENABLED=true
VITE_DEBUG_MODE=false

# 思源笔记授权api
# VITE_SIYUAN_API_URL=http://127.0.0.1:6806
# 思源笔记授权token
# VITE_SIYUAN_CONFIG_TOKEN=

# 开发阶段模拟的页面ID,仅限调试使用,生产环境无需此配置
# VITE_SIYUAN_DEV_PAGE_ID=

# 图表服务器
# PLANT_UML_SERVR=https://www.plantuml.com/plantuml/svg/
# PLANT_UML_SERVR=

# 非挂件模式需要中间服务器实现跨域,生产环境可不设置,使用本项目
# VITE_MIDDLEWARE_URL=https://api.terwer.space/api/middleware
# VITE_MIDDLEWARE_URL=
21 changes: 21 additions & 0 deletions .env.test.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 是否开启info日志,true | false,建议生产环境设置为false
VITE_LOG_INFO_ENABLED=true

# 思源笔记授权api
VITE_SIYUAN_API_URL=http://127.0.0.1:6806
# 思源笔记授权token
VITE_SIYUAN_CONFIG_TOKEN=

# 开发阶段模拟的页面ID,仅限调试使用,生产环境无需此配置
# VITE_SIYUAN_DEV_PAGE_ID=20220927094918-1d85uyp

# 非挂件模式需要中间服务器实现跨域,生产环境可不设置,使用本项目
# VITE_MIDDLEWARE_URL=https://api.terwer.space/api/middleware
# VITE_MIDDLEWARE_URL=

# ====================================
# 下面是测试专属
# ====================================
VITE_TEST_WORDPRESS_PASSWORD=
VITE_TEST_LIANDI_TOKEN=
VITE_TEST_GITHUB_TOKEN=
32 changes: 32 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": ["eslint:recommended", "plugin:vue/vue3-essential", "standard-with-typescript", "prettier"],
"overrides": [],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"parser": "@typescript-eslint/parser",
"project": "./tsconfig.json",
"extraFileExtensions": [".vue"]
},
"plugins": ["@typescript-eslint", "vue"],
"ignorePatterns": ["node_modules/", ".vercel/", ".idea/", "*.js", "*.d.ts", "*.mts", "*.map", "vite.config.ts"],
"rules": {
"vue/multi-word-component-names": "off",
"@typescript-eslint/strict-boolean-expressions": 0,
"@typescript-eslint/triple-slash-reference": 0,
"@typescript-eslint/restrict-template-expressions": 1,
"@typescript-eslint/no-var-requires": 1,
"@typescript-eslint/prefer-nullish-coalescing": 0,
"@typescript-eslint/restrict-plus-operands": 0,
"no-undef": 0,
"no-undef-init": 1,
"no-undefined": 0,
"no-prototype-builtins": 1,
"no-unused-expressions": 1
}
}
32 changes: 32 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: 2
updates:
# Fetch and update latest `npm` packages
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "00:00"
open-pull-requests-limit: 10
reviewers:
- terwer
assignees:
- terwer
commit-message:
prefix: fix
prefix-development: chore
include: scope
# Fetch and update latest `github-actions` pkgs
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
time: "00:00"
open-pull-requests-limit: 10
reviewers:
- terwer
assignees:
- terwer
commit-message:
prefix: fix
prefix-development: chore
include: scope
5 changes: 5 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Always validate the PR title AND all the commits
titleAndCommits: true
# Allows use of Merge commits (eg on github: "Merge branch 'master' into feature/ride-unicorns")
# this is only relevant when using commitsOnly: true (or titleAndCommits: true)
allowMergeCommits: true
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: ci

on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies and build for production
run: pnpm install && pnpm new && pnpm run build
37 changes: 37 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
on:
push:
branches:
- main
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
# create release pr
- uses: google-github-actions/release-please-action@v3
with:
release-type: node
package-name: release-please-action
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false}]'
- run: echo "A release was created."
if: ${{ steps.release.outputs.releases_created }}
# For root level packages: ${{ steps.release.outputs.package-a--tag_name }}
- run: echo "Release ${{ steps.release.outputs['packages/package-a--tag_name'] }} created for package-a."
if: ${{ steps.release.outputs['packages/package-a--release_created'] }}

# create tag
- uses: actions/checkout@v3
- name: tag major and minor versions
if: ${{ steps.release.outputs.release_created }}
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git"
git tag -d v${{ steps.release.outputs.major }} || true
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
git push origin :v${{ steps.release.outputs.major }} || true
git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
git push origin v${{ steps.release.outputs.major }}
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}
29 changes: 29 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env sh
#
# Copyright (c) 2022, Terwer . All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Terwer designates this
# particular file as subject to the "Classpath" exception as provided
# by Terwer in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com
# or visit www.terwer.space if you need additional information or have any
# questions.
#

. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shamefully-hoist=true
22 changes: 22 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# platform
.github
.husky
.settings
.vercel
.vscode

# Ignore artifacts:
build
coverage
dist
extension
node_modules
out

# Ignore all HTML files:
*.html

# lib
*.min.js
*mathjax*
/pnpm-lock.yaml
5 changes: 5 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": false,
"printWidth": 120
}
Loading

0 comments on commit 56fd048

Please sign in to comment.