Skip to content

Commit 48bd362

Browse files
committed
Merge branch 'develop'
2 parents ea0d99c + 1cf59b8 commit 48bd362

33 files changed

+19632
-25802
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ root = true
33

44
[*]
55
charset = utf-8
6+
end_of_line = lf
67
insert_final_newline = true
78
indent_style = space
89
indent_size = 2

.eslintignore

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

.eslintrc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"root": true,
33
"parser": "@typescript-eslint/parser",
4+
"env": { "node": true },
45
"plugins": [
5-
"@typescript-eslint"
6+
"@typescript-eslint", "node"
67
],
78
"extends": [
89
"eslint:recommended",
@@ -17,6 +18,9 @@
1718
"@typescript-eslint/no-unused-vars": ["error", { "args": "none" }],
1819
"@typescript-eslint/ban-ts-comment": "off",
1920
"no-prototype-builtins": "off",
20-
"@typescript-eslint/no-empty-function": "off"
21+
"@typescript-eslint/no-empty-function": "off",
22+
"node/no-unsupported-features/es-builtins": ["error", { "version": ">=16.0.0", "ignores": [] }],
23+
// "node/no-unsupported-features/es-syntax": ["error", { "version": ">=16.0.0", "ignores": [] }],
24+
"node/no-unsupported-features/node-builtins": ["error", { "version": ">=16.0.0", "ignores": [] }]
2125
}
2226
}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,8 @@ dist
109109
# Compiled files
110110
dist/
111111

112-
# User data file
112+
# They should be uploaded to GitHub releases instead.
113+
main.js
114+
115+
# obsidian
113116
data.json

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
registry=https://registry.npmjs.org
2+
tag-version-prefix=""

esbuild.config.mjs

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import esbuild from "esbuild";
22
import process from "process";
3-
import builtins from 'builtin-modules'
3+
import builtins from "builtin-modules";
44

55
const banner =
66
`/*
@@ -9,20 +9,40 @@ if you want to view the source, please visit the github repository of this plugi
99
*/
1010
`;
1111

12-
const prod = (process.argv[2] === 'production');
12+
const prod = (process.argv[2] === "production");
1313

14-
esbuild.build({
14+
const context = await esbuild.context({
1515
banner: {
1616
js: banner,
1717
},
18-
entryPoints: ['src/main.ts'],
18+
entryPoints: ["src/main.ts"],
1919
bundle: true,
20-
external: ['obsidian', 'electron', ...builtins],
21-
format: 'cjs',
22-
watch: !prod,
23-
target: 'es2016',
20+
external: [
21+
"obsidian",
22+
"electron",
23+
"@codemirror/autocomplete",
24+
"@codemirror/collab",
25+
"@codemirror/commands",
26+
"@codemirror/language",
27+
"@codemirror/lint",
28+
"@codemirror/search",
29+
"@codemirror/state",
30+
"@codemirror/view",
31+
"@lezer/common",
32+
"@lezer/highlight",
33+
"@lezer/lr",
34+
...builtins],
35+
format: "cjs",
36+
target: "es2018",
2437
logLevel: "info",
25-
sourcemap: prod ? false : 'inline',
38+
sourcemap: prod ? false : "inline",
2639
treeShaking: true,
27-
outfile: 'main.js',
28-
}).catch(() => process.exit(1));
40+
outfile: "main.js",
41+
});
42+
43+
if (prod) {
44+
await context.rebuild();
45+
process.exit(0);
46+
} else {
47+
await context.watch();
48+
}

main.js

Lines changed: 17118 additions & 23919 deletions
Large diffs are not rendered by default.

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"description": "A plugin for publishing Obsidian documents to WordPress.",
77
"author": "devbean",
88
"isDesktopOnly": false
9-
}
9+
}

0 commit comments

Comments
 (0)