Skip to content

Commit 4248486

Browse files
committed
chore: install svelte
1 parent ad67184 commit 4248486

21 files changed

Lines changed: 7638 additions & 221 deletions

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
node_modules/
2-
2+
temp/
33
main.js

.eslintrc

Lines changed: 50 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,51 @@
11
{
2-
"root": true,
3-
"parser": "@typescript-eslint/parser",
4-
"env": { "node": true },
5-
"plugins": [
6-
"@typescript-eslint"
7-
],
8-
"extends": [
9-
"eslint:recommended",
10-
"plugin:@typescript-eslint/eslint-recommended",
11-
"plugin:@typescript-eslint/recommended"
12-
],
13-
"parserOptions": {
14-
"sourceType": "module"
15-
},
16-
"rules": {
17-
"no-unused-vars": "off",
18-
"@typescript-eslint/no-unused-vars": ["error", { "args": "none" }],
19-
"@typescript-eslint/ban-ts-comment": "off",
20-
"no-prototype-builtins": "off",
21-
"@typescript-eslint/no-empty-function": "off"
22-
}
23-
}
2+
"root": true,
3+
// ...
4+
"parserOptions": {
5+
// ...
6+
7+
"extraFileExtensions": [
8+
".svelte"
9+
],
10+
// This is a required setting in `@typescript-eslint/parser` v4.24.0.
11+
"sourceType": "module"
12+
},
13+
"overrides": [
14+
{
15+
"files": [
16+
"*.svelte"
17+
],
18+
"parser": "svelte-eslint-parser",
19+
// Parse the `<script>` in `.svelte` as TypeScript by adding the following configuration.
20+
"parserOptions": {
21+
"parser": "@typescript-eslint/parser"
22+
}
23+
}
24+
// ...
25+
],
26+
"parser": "@typescript-eslint/parser",
27+
"env": {
28+
"node": true
29+
},
30+
"plugins": [
31+
"@typescript-eslint"
32+
],
33+
"extends": [
34+
"eslint:recommended",
35+
"plugin:@typescript-eslint/eslint-recommended",
36+
"plugin:@typescript-eslint/recommended",
37+
"plugin:svelte/recommended"
38+
],
39+
"rules": {
40+
"no-unused-vars": "off",
41+
"@typescript-eslint/no-unused-vars": [
42+
"error",
43+
{
44+
"args": "none"
45+
}
46+
],
47+
"@typescript-eslint/ban-ts-comment": "off",
48+
"no-prototype-builtins": "off",
49+
"@typescript-eslint/no-empty-function": "off"
50+
}
51+
}

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release Obsidian plugin
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Use Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: "18.x"
19+
20+
- name: Build plugin
21+
run: |
22+
npm install
23+
npm run build
24+
25+
- name: Create release
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
run: |
29+
tag="${GITHUB_REF#refs/tags/}"
30+
31+
gh release create "$tag" \
32+
--title="$tag" \
33+
--draft \
34+
manifest.json temp/vault/.obsidian/plugins/tree-edit/main.js temp/vault/.obsidian/plugins/tree-edit/styles.css

.gitignore

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
1-
# vscode
2-
.vscode
3-
4-
# Intellij
5-
*.iml
6-
.idea
7-
8-
# npm
9-
node_modules
10-
11-
# Don't include the compiled main.js file in the repo.
12-
# They should be uploaded to GitHub releases instead.
13-
main.js
14-
15-
# Exclude sourcemaps
16-
*.map
17-
18-
# obsidian
19-
data.json
20-
21-
# Exclude macOS Finder (System Explorer) View States
22-
.DS_Store
1+
# vscode
2+
.vscode
3+
4+
# Intellij
5+
*.iml
6+
.idea
7+
8+
# npm
9+
node_modules
10+
11+
# Don't include the compiled main.js file in the repo.
12+
# They should be uploaded to GitHub releases instead.
13+
main.js
14+
15+
# Exclude sourcemaps
16+
*.map
17+
18+
# obsidian
19+
data.json
20+
21+
# Exclude macOS Finder (System Explorer) View States
22+
.DS_Store
23+
temp
24+
.idea

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx --no -- commitlint --edit ${1}

.husky/pre-commit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run build
5+
npm test
6+
npx lint-staged

.lintstagedrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"*.{js,jsx,ts,tsx, svelte}": [
3+
"prettier --write",
4+
"eslint --fix"
5+
]
6+
}

.prettierrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"endOfLine": "lf",
3+
"singleQuote": true,
4+
"useTabs": false,
5+
"tabWidth": 4,
6+
"indent": 4,
7+
"semi": true,
8+
"printWidth": 80,
9+
"plugins": [
10+
"prettier-plugin-svelte"
11+
],
12+
"overrides": [
13+
{
14+
"files": "*.svelte",
15+
"options": {
16+
"parser": "svelte"
17+
}
18+
}
19+
]
20+
}

LICENCE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 ycnmhd
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: ['@commitlint/config-conventional'] };

0 commit comments

Comments
 (0)