Skip to content

Commit

Permalink
feat: 1.move obsidian manager
Browse files Browse the repository at this point in the history
  • Loading branch information
JuckZ committed Feb 10, 2023
0 parents commit f76d411
Show file tree
Hide file tree
Showing 119 changed files with 24,059 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# top-most EditorConfig file
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = tab
indent_size = 4
tab_width = 4
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
npm node_modules
build
main.js
lib
57 changes: 57 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
module.exports = {
env: {
es6: true,
node: true,
browser: true,
},
extends: [
'plugin:vue/base',
'eslint:recommended',
'plugin:vue/vue3-recommended',
'plugin:vue/essential',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'eslint-config-prettier',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:import/typescript',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
modules: true,
},
},
plugins: ['@typescript-eslint', 'import'],
rules: {
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single', { avoidEscape: true }],
'@typescript-eslint/no-unused-vars': 0, // Configured in tsconfig instead.
'no-unused-vars': 0, // Configured in tsconfig instead.
'prettier/prettier': [
'error',
{
trailingComma: 'all',
printWidth: 120,
tabWidth: 4,
useTabs: false,
singleQuote: true,
bracketSpacing: true,
},
],
semi: ['error', 'always'],
'import/order': 'error',
'sort-imports': [
'error',
{
ignoreDeclarationSort: true,
},
],
},
};
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Bug Report
description: File a bug report
labels: ['bug']
title: '[Bug]: <TITLE>'
body:
- type: markdown
attributes:
value: '**Please make sure you are on the latest version.**'
- type: textarea
id: what-happened
attributes:
label: Describe the bug
description: What's happening and when does it happen?
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected Behavior
description: What SHOULD happen?
- type: textarea
id: reproduce
attributes:
label: Steps to reproduce
description: The more detail you provide, the easier it will be to narrow down and fix the bug
validations:
required: true
- type: dropdown
id: os
attributes:
label: Operating system
description: Which OS are you using?
options:
- Windows
- Linux
- macOS
- iOS
- Android
validations:
required: true
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Feature Request
description: Suggest a Feature
labels: ['enhancement']
title: '[Feature]: <TITLE>'
body:
- type: markdown
attributes:
value: Before getting started, please check the [GitHub Issues](https://github.com/uphy/obsidian-reminder/issues?q=is%3Aissue+sort%3Aupdated-desc+label%3Aenhancement+) (open or closed) for similar issues.
- type: textarea
validations:
required: true
attributes:
label: Goal or desired outcome of this feature
description: Before describing your requested feature, please describe more generally the problem, pain-point, or use case you'd like to solve for.
- type: textarea
validations:
required: true
attributes:
label: Describe the feature
description: Please describe the desired feature in as much detail as you are able.
- type: textarea
attributes:
label: Screenshots, mockups, or videos
description: |
If applicable, add screenshots, mockups, or videos to help demonstrate your feature request.
25 changes: 25 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/plugin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# I am submitting a new Community Plugin

## Repo URL

<!--- Paste a link to your repo here for easy access -->
Link to my plugin:

## Release Checklist
- [ ] I have tested the plugin on
- [ ] Windows
- [ ] macOS
- [ ] Linux
- [ ] Android _(if applicable)_
- [ ] iOS _(if applicable)_
- [ ] My GitHub release contains all required files
- [ ] `main.js`
- [ ] `manifest.json`
- [ ] `styles.css` _(optional)_
- [ ] GitHub release name matches the exact version number specified in my manifest.json (_**Note:** Use the exact version number, don't include a prefix `v`_)
- [ ] The `id` in my `manifest.json` matches the `id` in the `community-plugins.json` file.
- [ ] My README.md describes the plugin's purpose and provides clear usage instructions.
- [ ] I have read the tips in https://github.com/obsidianmd/obsidian-releases/blob/master/plugin-review.md and have self-reviewed my plugin to avoid these common pitfalls.
- [ ] I have added a license in the LICENSE file.
- [ ] My project respects and is compatible with the original license of any code from other plugins that I'm using.
I have given proper attribution to these other projects in my `README.md`.
19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/theme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!--- Delete this section if submitting a plugin -->
# I am submitting a new Community Theme

## Repo URL

<!--- Paste a link to your repo here for easy access -->
Link to my theme:


## Theme checklist

<!--- Confirm that you have done the following before submitting your theme -->
- [ ] My repo contains all required files (please *do not* add them to this `obsidian-releases` repo).
- [ ] `obsidian.css`
- [ ] The screenshot file.
- [ ] I have indicated which modes (dark, light, or both) are compatible with my theme.
- [ ] I have added a license in the LICENSE file.
- [ ] My project respects and is compatible with the original license of any code from other themes that I'm using.
I have given proper attribution to these other themes in my `README.md`.
4 changes: 4 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Please switch to **Preview** and select one of the following links:

* [Community Plugin](?template=plugin.md)
* [Community Theme](?template=theme.md)
19 changes: 19 additions & 0 deletions .github/workflows-backup/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# name: CI

# on:
# push:
# branches:
# - "master"
# pull_request:
# branches:
# - "master"

# jobs:
# lint-json:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Install modules
# run: npm install
# - name: Lint
# run: yarn run lint
30 changes: 30 additions & 0 deletions .github/workflows-backup/plugin-stat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# name: Pull plugin stats

# on:
# schedule:
# - cron: "0 0 * * *"
# workflow_dispatch: # Put here!!

# # run it on closing PR to test the workflow, will remove once it works
# # on:
# # pull_request:
# # types: [opened, closed, synchronize]

# jobs:
# pull-stats:
# if: github.repository == 'obsidianmd/obsidian-releases'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v2
# with:
# node-version: 16.x
# - run: |
# git config --local user.name 'Obsidian Bot'
# git config --local user.email '[email protected]'
# node update-stats.js
# git add .
# git commit -m "chore: Update plugin stats"
# git push
# env:
# gh_token: ${{ secrets.GH_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows-backup/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# name: CI

# on:
# - pull_request

# jobs:
# test:
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v2

# - name: Setup Node
# uses: actions/setup-node@v2
# with:
# node-version: "16"

# - name: Cache dependencies
# uses: actions/cache@v2
# with:
# path: ~/.npm
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-node-

# - name: Test
# run: |
# npm ci
# npm run lint
# npm run test
106 changes: 106 additions & 0 deletions .github/workflows-backup/validate-plugin-entry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# name: Validate Plugin Entry

# on:
# pull_request_target:
# branches:
# - master
# paths:
# - community-plugins.json

# jobs:
# plugin-validation:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# with:
# ref: "refs/pull/${{ github.event.number }}/merge"
# - uses: actions/setup-node@v2
# - uses: actions/github-script@v6
# with:
# script: |
# const fs = require('fs');
# const author = context.payload.pull_request.user.login;
# const plugins = JSON.parse(fs.readFileSync('community-plugins.json', 'utf8'));
# const plugin = plugins[plugins.length - 1];
# const escapeHtml = (unsafe) => unsafe.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#039;');
# const errors = [];
# const addError = (error) => {
# errors.push(`:x: ${error}`);
# console.log('Found issue: ' + error);
# };
# if (context.payload.pull_request.additions <= context.payload.pull_request.deletions) {
# // Don't run any validation checks if the user is just modifying existing plugin config
# return;
# }
# if (context.payload.pull_request.changed_files > 1) {
# addError('You modified files other than `community-plugins.json`.');
# }
# // Validate plugin repo
# let repoInfo = plugin.repo.split('/');
# if (repoInfo.length !== 2) {
# addError(`It seems like you made a typo in the repository field ${plugin.repo}`);
# }
# let [owner, repo] = repoInfo;
# let manifest = {};
# console.log(`Repo info: ${owner}/${repo}`);
# if (owner.toLowerCase() !== author.toLowerCase()) {
# addError(`The newly added entry is not at the end, or you are submitting on someone else's behalf. Last plugin in the list is: ${plugin.repo}`);
# } else {
# try {
# await github.rest.repos.get({ owner, repo });
# } catch (e) {
# addError(`It seems like you made a typo in the repository field ${plugin.repo}`);
# }
# try {
# let manifestFile = await github.rest.repos.getContent({
# owner,
# repo,
# path: 'manifest.json',
# });
# manifest = JSON.parse(Buffer.from(manifestFile.data.content, 'base64').toString('utf-8'));
# if (manifest.id != plugin.id) {
# addError('Plugin ID mismatch, the ID in this repo is not the same as the one in your repo.');
# }
# } catch (e) {
# addError(`You don't have a \`manifest.json\` at the root of your repo.`);
# }
# try {
# let release = await github.rest.repos.getReleaseByTag({
# owner,
# repo,
# tag: manifest.version,
# });
# const assets = release.data.assets || [];
# if (!assets.find(p => p.name === 'main.js')) {
# addError('Your latest Release is missing the `main.js` file.');
# }
# if (!assets.find(p => p.name === 'manifest.json')) {
# addError('Your latest Release is missing the `manifest.json` file.');
# }
# } catch (e) {
# addError(`Unable to find a release with the tag "${manifest.version}". Make sure that the manifest.json file in your repo points to the correct Github Release\n<details><summary>Log</summary><pre>${escapeHtml(e.toString())}</pre></details>`);
# }
# }
# if (errors.length > 0) {
# let message = `#### Hello ${author}! <a href="https://obsidian.md"><img align="right" height="30px" src="https://user-images.githubusercontent.com/59741989/139557624-63e6e31f-e617-4041-89ae-78b534a8de5c.png"/></a>\n**I found the following errors in your plugin, ${plugin.name}:**\n\n${errors.join('\n')}\n\n---\n<sup>This check was done automatically.`;
# await github.rest.issues.createComment({
# issue_number: context.issue.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# body: message
# });
# core.setFailed("Failed to validate plugin");
# } else {
# if (context.payload.pull_request.labels.indexOf('Changes requested') === -1) {
# await github.rest.issues.addLabels({
# issue_number: context.issue.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# labels: ['Ready for review']
# });
# }
# }
# permissions:
# contents: write
# issues: write
# pull-requests: write
Loading

0 comments on commit f76d411

Please sign in to comment.