Skip to content

Commit

Permalink
feat: 发布工具插件版第一版-初始化
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Jun 22, 2023
1 parent 2028cac commit 5e6ad90
Show file tree
Hide file tree
Showing 49 changed files with 3,027 additions and 460 deletions.
42 changes: 38 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
.idea
.DS_Store
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
dist
build
.pnp
.pnp.js

# testing
coverage

# next.js
.next/
out/
build

# misc
.DS_Store
*.pem

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

# local env files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# turbo
.turbo

# vercel
.vercel

# IDE
.idea
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
auto-install-peers = true
Empty file added CHANGELOG.md
Empty file.
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 Terwer

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.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Publisher

![](https://raw.githubusercontent.com/terwer/siyuan-plugin-publisher/main/plugins/publisher-main/public/icon.png)
![](https://raw.githubusercontent.com/terwer/siyuan-plugin-publisher/main/apps/publisher-main/public/icon.png)

Publishing articles from siyuan-note to platforms such as Yuque, Cnblogs, WordPress, Typecho, Hexo, Hugo and more.

Expand All @@ -22,7 +22,7 @@ This plugin promises that all functions will be free forever. If you want to sup
- **Extremely fast release**: One-time configuration, one-click release
- **Picture bed management**: Integrate PicGO picture bed, support s3, minio, watermark plugin
- **Support for extensions**: Based on the unified blog API specification, built-in support for metaweblogAPI, WordPress
and Github, and provides a unified adapter, which can theoretically be extended to any platform
and GitHub, and provides a unified adapter, which can theoretically be extended to any platform
- **Platform switch**: All platforms support enabling and disabling, the blog garden is enabled by default, and can be
disabled at any time
- **Dynamic Newly Added**: Support custom adding platform
Expand Down
14 changes: 6 additions & 8 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# 发布工具

![](https://raw.githubusercontent.com/terwer/siyuan-plugin-publisher/main/plugins/publisher-main/public/icon.png)
![](https://raw.githubusercontent.com/terwer/siyuan-plugin-publisher/main/apps/publisher-main/public/icon.png)

将思源笔记的文章发布到语雀、Cnblogs、WordPress、Typecho、Hexo、Hugo 等平台,支持极速发布、图床管理、平台扩展、智能标签等特色功能。

Expand Down Expand Up @@ -64,21 +64,21 @@

A3:**可以。**

插件默认内置了一个桥接器,可以通过插件唤起挂件。该功能需要在 `设置 -> 使用挂件版`​​ 开启。
插件默认内置了一个桥接器,可以通过插件唤起挂件。该功能需要在 `设置 -> 使用挂件版` 开启。

<u>注意 1:插件版用插件系统内置的菜单,所有插件版唤起的时候菜单插槽会禁用。</u>

<u>注意 2:开启挂件版之后会关闭插件版的所有功能,避免引起混淆。</u>

**我们强烈推荐您使用插件版,因为插件版将是以后长久维护的主要版本,挂架版本已废弃,仅作为修复问题以及兼容历史用户。**

* Q4:我以前是通过 `自定义JS片段 `​​ 或者 直接添加 `挂件`​​ 来使用的,现在还需要下载该插件吗?
* Q4:我以前是通过 `自定义JS片段 ` 或者 直接添加 `挂件` 来使用的,现在还需要下载该插件吗?

A4:**可选。** 但是我们强烈推荐您删除 JS 片段和挂件,下载插件版使用。

如果您不想使用插件版,那么您无需下载,使用原有 `自定义 JS 片段`​​ 或者 添加 `挂件`​​ 继续使用即可。
如果您不想使用插件版,那么您无需下载,使用原有 `自定义 JS 片段` 或者 添加 `挂件` 继续使用即可。

如果您想使用插件版,那么我们强烈建议您删除之前添加的 `自定义JS片段`​​`挂件`​​,直接下载插件版,启用即可。无需其他额外操作。
如果您想使用插件版,那么我们强烈建议您删除之前添加的 `自定义JS片段``挂件`,直接下载插件版,启用即可。无需其他额外操作。

* Q5:我的历史配置数据项迁移到插件,可以吗?
* A5:**可以。**
Expand All @@ -88,9 +88,7 @@
注意:挂件版配置数据导入仅支持 `sy-p-cfg-v0.8.0.json``picgo.json`

* Q6:我需要发布的平台,发布工具没有提供怎么办?
*
A6:参考:[平台适配计划](https://github.com/terwer/siyuan-plugin-publisher/blob/main/README_zh_CN.md#平台适配计划 "平台适配计划")
* A6:参考:[平台适配计划](https://github.com/terwer/siyuan-plugin-publisher/blob/main/README_zh_CN.md#平台适配计划 "平台适配计划")

## 捐赠

Expand Down
40 changes: 40 additions & 0 deletions apps/publisher-main/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:svelte/recommended",
"turbo",
"prettier",
],

parser: "@typescript-eslint/parser",

overrides: [
{
files: ["*.svelte"],
parser: "svelte-eslint-parser",
// Parse the script in `.svelte` as TypeScript by adding the following configuration.
parserOptions: {
parser: "@typescript-eslint/parser",
},
},
],

plugins: ["@typescript-eslint", "prettier"],

rules: {
// Note: you must disable the base rule as it can report incorrect errors
semi: "off",
quotes: "off",
"no-undef": "off",
"no-async-promise-executor": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-explicit-any": "off",
"turbo/no-undeclared-env-vars": "off",
"prettier/prettier": "error",
},
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions apps/publisher-main/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea
.DS_Store
node_modules
dist
build
11 changes: 11 additions & 0 deletions apps/publisher-main/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# platform

# Ignore artifacts:
dist
node_modules

# Ignore all dts files:
*.d.ts

# lib
/pnpm-lock.yaml
31 changes: 31 additions & 0 deletions apps/publisher-main/.prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* 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.
*/

module.exports = {
semi: false,
singleQuote: false,
printWidth: 120,
plugins: ["prettier-plugin-svelte"]
}
21 changes: 21 additions & 0 deletions apps/publisher-main/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Terwer

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.
5 changes: 5 additions & 0 deletions apps/publisher-main/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[中文](README_zh_CN.md)

# publisher-main

Publishing articles from siyuan-note to platforms such as Yuque, Cnblogs, WordPress, Typecho, Hexo, Hugo and more
5 changes: 5 additions & 0 deletions apps/publisher-main/README_zh_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[English](README.md)

# {{name}}

{{description}}
Binary file added apps/publisher-main/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
44 changes: 44 additions & 0 deletions apps/publisher-main/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "siyuan-plugin-random-doc",
"version": "1.0.1",
"type": "module",
"description": "Document is like a box of chocolates. You never know what you're going to get",
"repository": "terwer/siyuan-plugin-random-doc",
"homepage": "https://github.com/terwer/siyuan-plugin-random-doc",
"author": "terwer",
"license": "MIT",
"scripts": {
"serve": "vite",
"dev": "vite build --watch",
"build": "vite build",
"start": "vite preview",
"test": "vitest --watch",
"syncVersion": "python scripts/version.py",
"parseChangelog": "python scripts/parse_changelog.py",
"prepareRelease": "pnpm syncVersion && pnpm parseChangelog",
"package": "python scripts/package.py"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^2.4.1",
"@terwer/eslint-config-custom": "^1.3.4",
"@tsconfig/svelte": "^4.0.1",
"@types/minimist": "1.2.2",
"fast-glob": "^3.2.12",
"jsdom": "^22.0.0",
"minimist": "^1.2.8",
"rollup-plugin-livereload": "^2.0.5",
"siyuan": "^0.7.2",
"stylus": "^0.59.0",
"svelte": "^3.59.1",
"typescript": "^5.0.4",
"vite": "^4.3.5",
"vite-plugin-dts": "^2.3.0",
"vite-plugin-node-polyfills": "^0.8.2",
"vite-plugin-static-copy": "^0.16.0",
"vite-tsconfig-paths": "^4.2.0",
"vitest": "^0.32.0"
},
"dependencies": {
"zhi-lib-base": "^0.2.4"
}
}
27 changes: 27 additions & 0 deletions apps/publisher-main/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "demo",
"author": "terwer",
"url": "https://github.com/terwer/siyuan-plugin-demo",
"version": "0.0.1",
"displayName": {
"default": "Demo",
"zh_CN": "示例"
},
"description": {
"default": "This a demo plugin project",
"zh_CN": "这是一个示例插件项目"
},
"readme": {
"default": "README.md",
"zh_CN": "README_zh_CN.md"
},
"i18n": [
"en_US",
"zh_CN"
],
"funding": {
"custom": [
"https://afdian.net/a/terwer"
]
}
}
Binary file added apps/publisher-main/preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions scripts/package.py → apps/publisher-main/scripts/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
v = data["version"]

src_folder = dist_folder
tmp_folder_name = "./siyuan-plugin-publisher"
tmp_folder_name = "./siyuan-plugin-demo"
build_zip_path = "./build"
build_zip_name = "siyuan-plugin-publisher-" + v + ".zip"
build_zip_name = "siyuan-plugin-demo-" + v + ".zip"

try:
# 压缩dist为zip
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/index.ts → apps/publisher-main/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ export default class ImporterPlugin extends Plugin {
constructor(options: { app: App; id: string; name: string; i18n: IObject }) {
super(options)

this.logger = simpleLogger("index", "publisher", isDev)
this.logger = simpleLogger("index", "demo", isDev)
}

onload() {
this.logger.info("Publisher loaded")
this.logger.info("Demo loaded")
}

onunload() {
this.logger.info("Publisher unloaded")
this.logger.info("Demo loaded")
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 5e6ad90

Please sign in to comment.