Skip to content

Commit

Permalink
fix: 修复依赖问题
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Mar 17, 2023
1 parent 7956955 commit 3090ea0
Show file tree
Hide file tree
Showing 10 changed files with 234 additions and 23 deletions.
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
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 ci
15 changes: 15 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
on:
push:
branches:
- main
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
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}]'
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# zhi-blog

Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
a blog based on siyuan-note api

## 规范

Expand All @@ -20,7 +20,7 @@ pnpm install
Start the development server on http://localhost:3000

```bash
pnpm dev -o
pnpm dev
```

## Production
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"name": "zhi-blog",
"version": "0.0.1",
"description": "a simple blog for siyuan-note",
"version": "1.1.2",
"description": "a blog based on siyuan-note api",
"type": "module",
"scripts": {
"dev": "pnpm build:css && nuxt dev",
"watch:css": "stylus --watch blog.styl --out ./public/blog.css",
"build": "pnpm build:css && pnpm build:js",
"build:css": "stylus --compress blog.styl --out ./public/blog.css",
"build:js": "nuxt build",
"dev": "pnpm build:css && nuxt dev",
"generate": "pnpm build:css && nuxt generate",
"generate:vercel": "pnpm build:css && BUILD_TYPE=vercel nuxt generate",
"ci": "pnpm inatsll && pnpm build",
"preview": "nuxt preview",
"postinstall": "nuxt prepare",
"package:vercel": "bash package.sh",
Expand All @@ -36,7 +37,7 @@
"vue-tsc": "^1.2.0"
},
"dependencies": {
"zhi-common": "^1.0.7"
"zhi-sdk": "^1.0.12"
},
"keywords": [
"zhi",
Expand Down
3 changes: 2 additions & 1 deletion pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
</template>

<script setup lang="ts">
import ZhiUtil, { ThemeFromEnum } from "zhi-common"
import ZhiUtil from "~/utils/zhiUtil"
import { version } from "~/package.json"
import Env from "zhi-env"
import ThemeFromEnum from "~/utils/enums/themeFromEnum"
const nuxtEnv = useRuntimeConfig()
const env = new Env(nuxtEnv)
Expand Down
26 changes: 10 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions utils/enums/themeFromEnum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2023, 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.
*/

/**
* 主题来源
*
* @public
* @author terwer
* @since 0.0.1
*/
enum ThemeFromEnum {
/**
* 主题
*/
ThemeFrom_Blog = "zhi-blog",
}

export default ThemeFromEnum
25 changes: 25 additions & 0 deletions utils/vdoingUtil.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
/*
* Copyright (c) 2023, 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.
*/

import { normalize } from "pathe"

export const hashRE = /#.*$/
Expand Down
55 changes: 55 additions & 0 deletions utils/zhiUtil.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright (c) 2023, 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.
*/

import ZhiSdk from "zhi-sdk"
import Env from "zhi-env"

/**
* 工具类统一入口
*
* @public
* @author terwer
* @since 1.0.0
*/
class ZhiUtil {
private static zhiSdkObj: ZhiSdk

/**
* 获取 zhi-sdk 实例
*
* @param env - 环境变量对象
*/
public static zhiSdk(env: Env) {
if (!ZhiUtil.zhiSdkObj) {
ZhiUtil.zhiSdkObj = new ZhiSdk(env)
const logger = ZhiUtil.zhiSdkObj.getLogger()
const common = ZhiUtil.zhiSdkObj.common
logger.debug(common.strUtil.f("ZhiSdk inited, components are available now, like logger, env and so on."))
}
return ZhiUtil.zhiSdkObj
}
}

export default ZhiUtil

0 comments on commit 3090ea0

Please sign in to comment.