Skip to content

Commit 2606835

Browse files
committed
feat: initial commit
1 parent 27aecb4 commit 2606835

17 files changed

+412
-2
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
end_of_line = lf
7+
insert_final_newline = true
8+
indent_style = tab
9+
indent_size = 4
10+
tab_width = 4

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
3+
main.js

.eslintrc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
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+
}

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Use Node.js
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: "16.x"
18+
19+
- uses: oven-sh/setup-bun@v1
20+
with:
21+
bun-version: latest
22+
23+
- name: Install dependencies
24+
run: bun install
25+
26+
- name: Build
27+
id: build
28+
run: bun run build
29+
30+
# Create the release on GitHub
31+
- name: Release
32+
uses: softprops/action-gh-release@v1
33+
if: startsWith(github.ref, 'refs/tags/')
34+
with:
35+
name: ${{ github.ref_name }}
36+
tag_name: ${{ github.ref }}
37+
files: |
38+
dist/main.js
39+
dist/manifest.json
40+
dist/styles.css

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +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
23+
24+
dist/

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
1-
# obsidian-duplicate-finder
2-
Find duplicate pieces of content in your vault
1+
# Duplicate Finder
2+
3+
This plugin allows you to find duplicate content in your vault
4+
5+
## Installation
6+
7+
1. Install the [Obsidian BRAT](https://github.com/TfTHacker/obsidian42-brat) plugin from Obsidian community plugin store
8+
2. Enable the plugin
9+
3. Open the plugin settings
10+
4. Click **Add beta plugin**
11+
5. Enter the repository url: **https://github.com/decaf-dev/obsidian-duplicate-finder**
12+
6. Click **Add plugin**
13+
14+
15+
## License
16+
17+
Duplicate Finder is distributed under [MIT License](https://github.com/decaf-dev/obsidian-duplicate-finder/blob/master/LICENSE).

bun.lockb

70.9 KB
Binary file not shown.

esbuild.config.mjs

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import builtins from "builtin-modules";
2+
import esbuild from "esbuild";
3+
import esbuildSvelte from "esbuild-svelte";
4+
import fs from "fs";
5+
import path from "path";
6+
import process from "process";
7+
import { sveltePreprocess } from "svelte-preprocess";
8+
9+
const banner = `/*
10+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
11+
if you want to view the source, please visit the github repository of this plugin
12+
*/
13+
`;
14+
15+
const prod = process.argv[2] === "production";
16+
17+
const rebuildPlugin = {
18+
name: "rebuild-handler",
19+
setup(build) {
20+
build.onEnd(async () => {
21+
try {
22+
// await fs.promises.rename(
23+
// path.join(path.resolve(), "dist", "main.css"),
24+
// path.join(path.resolve(), "dist", "styles.css")
25+
// );
26+
await fs.promises.copyFile(
27+
path.join(path.resolve(), "manifest.json"),
28+
path.join(path.resolve(), "dist", "manifest.json")
29+
);
30+
} catch (err) {}
31+
});
32+
},
33+
};
34+
35+
const context = await esbuild.context({
36+
banner: {
37+
js: banner,
38+
},
39+
entryPoints: ["src/main.ts"],
40+
bundle: true,
41+
external: [
42+
"obsidian",
43+
"electron",
44+
"@codemirror/autocomplete",
45+
"@codemirror/collab",
46+
"@codemirror/commands",
47+
"@codemirror/language",
48+
"@codemirror/lint",
49+
"@codemirror/search",
50+
"@codemirror/state",
51+
"@codemirror/view",
52+
"@lezer/common",
53+
"@lezer/highlight",
54+
"@lezer/lr",
55+
...builtins,
56+
],
57+
format: "cjs",
58+
target: "es2018",
59+
logLevel: "info",
60+
sourcemap: prod ? false : "inline",
61+
treeShaking: true,
62+
outfile: "dist/main.js",
63+
plugins: [
64+
rebuildPlugin,
65+
esbuildSvelte({
66+
compilerOptions: {
67+
css: "injected",
68+
},
69+
preprocess: sveltePreprocess(),
70+
}),
71+
],
72+
});
73+
74+
if (prod) {
75+
await context.rebuild();
76+
process.exit(0);
77+
} else {
78+
await context.watch();
79+
}

manifest.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"id": "duplicate-finder",
3+
"name": "Duplicate Finder",
4+
"version": "0.0.1",
5+
"minAppVersion": "1.8.0",
6+
"description": "Find duplicate content in your vault",
7+
"author": "DecafDev",
8+
"authorUrl": "https://github.com/decaf-dev",
9+
"fundingUrl": "https://ko-fi.com/decaf_dev",
10+
"isDesktopOnly": true
11+
}

package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "obsidian-duplicate-finder",
3+
"version": "0.0.1",
4+
"description": "Search for duplicate content in your vault",
5+
"main": "main.js",
6+
"scripts": {
7+
"dev": "node esbuild.config.mjs",
8+
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
9+
"check": "svelte-check --tsconfig ./tsconfig.json"
10+
},
11+
"keywords": [],
12+
"author": "DecafDev",
13+
"license": "MIT",
14+
"devDependencies": {
15+
"@tsconfig/svelte": "^5.0.4",
16+
"@types/node": "^22.15.3",
17+
"@typescript-eslint/eslint-plugin": "8.31.1",
18+
"@typescript-eslint/parser": "8.31.1",
19+
"builtin-modules": "5.0.0",
20+
"esbuild": "0.25.3",
21+
"esbuild-svelte": "^0.9.2",
22+
"obsidian": "^1.8.7",
23+
"svelte-check": "^4.1.7",
24+
"svelte-preprocess": "^6.0.3",
25+
"tslib": "2.8.1",
26+
"typescript": "5.8.3"
27+
},
28+
"dependencies": {
29+
"svelte": "^5.28.2"
30+
}
31+
}

0 commit comments

Comments
 (0)