Skip to content

Commit 4d49d19

Browse files
committed
first setup
1 parent 186b131 commit 4d49d19

28 files changed

+3306
-219
lines changed

.editorconfig

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ root = true
33

44
[*]
55
charset = utf-8
6-
end_of_line = lf
76
insert_final_newline = true
87
indent_style = tab
98
indent_size = 4

.eslintignore

-2
This file was deleted.

.eslintrc

-23
This file was deleted.

.github/FUNDING.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
github: Ellpeck
2+
ko_fi: Ellpeck
3+
patreon: Ellpeck

.gitignore

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# vscode
2-
.vscode
2+
.vscode
33

44
# Intellij
55
*.iml
@@ -10,13 +10,14 @@ node_modules
1010

1111
# Don't include the compiled main.js file in the repo.
1212
# They should be uploaded to GitHub releases instead.
13-
main.js
13+
/main.js
1414

1515
# Exclude sourcemaps
1616
*.map
1717

1818
# obsidian
19-
data.json
19+
workspace
20+
workspace.json
2021

2122
# Exclude macOS Finder (System Explorer) View States
2223
.DS_Store

.npmrc

-1
This file was deleted.

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Ellpeck
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.

esbuild.config.mjs

+29-11
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,58 @@
11
import esbuild from "esbuild";
22
import process from "process";
3-
import builtins from 'builtin-modules'
3+
import builtins from 'builtin-modules';
4+
import { copy } from 'esbuild-plugin-copy';
45

5-
const banner =
6-
`/*
6+
const banner = `/*
77
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
88
if you want to view the source, please visit the github repository of this plugin
9-
*/
10-
`;
9+
*/`;
1110

1211
const prod = (process.argv[2] === 'production');
1312

1413
esbuild.build({
1514
banner: {
1615
js: banner,
1716
},
18-
entryPoints: ['main.ts'],
17+
entryPoints: ['src/main.ts'],
1918
bundle: true,
2019
external: [
2120
'obsidian',
2221
'electron',
2322
'@codemirror/autocomplete',
23+
'@codemirror/closebrackets',
2424
'@codemirror/collab',
2525
'@codemirror/commands',
26+
'@codemirror/comment',
27+
'@codemirror/fold',
28+
'@codemirror/gutter',
29+
'@codemirror/highlight',
30+
'@codemirror/history',
2631
'@codemirror/language',
2732
'@codemirror/lint',
33+
'@codemirror/matchbrackets',
34+
'@codemirror/panel',
35+
'@codemirror/rangeset',
36+
'@codemirror/rectangular-selection',
2837
'@codemirror/search',
2938
'@codemirror/state',
39+
'@codemirror/stream-parser',
40+
'@codemirror/text',
41+
'@codemirror/tooltip',
3042
'@codemirror/view',
31-
'@lezer/common',
32-
'@lezer/highlight',
33-
'@lezer/lr',
34-
...builtins],
43+
...builtins
44+
],
45+
plugins: [
46+
copy({
47+
assets: [{
48+
from: ["./manifest.json", "./main.js", "./styles.css"],
49+
to: ["./test-vault/.obsidian/plugins/obsidian-simple-time-tracker/."]
50+
}]
51+
}),
52+
],
3553
format: 'cjs',
3654
watch: !prod,
37-
target: 'es2018',
55+
target: 'es2016',
3856
logLevel: "info",
3957
sourcemap: prod ? false : 'inline',
4058
treeShaking: true,

main.ts

-137
This file was deleted.

manifest.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"id": "obsidian-sample-plugin",
3-
"name": "Sample Plugin",
4-
"version": "1.0.0",
2+
"id": "obsidian-simple-time-tracker",
3+
"name": "Simple Time Tracker",
4+
"version": "0.0.1",
55
"minAppVersion": "0.15.0",
6-
"description": "This is a sample plugin for Obsidian. This plugin demonstrates some of the capabilities of the Obsidian API.",
7-
"author": "Obsidian",
8-
"authorUrl": "https://obsidian.md",
6+
"description": "Simple time tracker plugin for Obsidian.",
7+
"author": "Ellpeck",
8+
"authorUrl": "https://ellpeck.de",
99
"isDesktopOnly": false
1010
}

0 commit comments

Comments
 (0)