@mnaoumov/obsidian-dev-toolkit 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -1
- package/dist/demo-vault-helper/main.js +499 -17
- package/dist/integration-test-plugin/main.js +11251 -2472
- package/dist/lib/cjs/bundlers/esbuild-impl/copy-to-obsidian-plugins-folder-plugin.cjs +9 -22
- package/dist/lib/cjs/bundlers/esbuild-impl/dependency.cjs +9 -22
- package/dist/lib/cjs/bundlers/esbuild-impl/fix-source-maps-plugin.cjs +9 -22
- package/dist/lib/cjs/bundlers/esbuild-impl/index.cjs +9 -22
- package/dist/lib/cjs/bundlers/esbuild-impl/obsidian-plugin-builder.cjs +9 -22
- package/dist/lib/cjs/bundlers/esbuild-impl/preprocess-plugin.cjs +9 -22
- package/dist/lib/cjs/bundlers/esbuild-impl/rename-css-plugin.cjs +9 -22
- package/dist/lib/cjs/bundlers/esbuild.cjs +9 -22
- package/dist/lib/cjs/bundlers/index.cjs +9 -22
- package/dist/lib/cjs/demo-vault-app-json.cjs +9 -22
- package/dist/lib/cjs/demo-vault-buttons.cjs +9 -22
- package/dist/lib/cjs/demo-vault-buttons.d.cts +7 -7
- package/dist/lib/cjs/demo-vault-coverage.cjs +11 -23
- package/dist/lib/cjs/demo-vault.cjs +9 -22
- package/dist/lib/cjs/formatters/dprint.cjs +9 -22
- package/dist/lib/cjs/formatters/index.cjs +9 -22
- package/dist/lib/cjs/index.cjs +9 -22
- package/dist/lib/cjs/integration-test-setup.cjs +9 -22
- package/dist/lib/cjs/integration-test-vitest-global-setup.cjs +9 -22
- package/dist/lib/cjs/jest-setup.cjs +9 -22
- package/dist/lib/cjs/linters/eslint-config.cjs +60 -22
- package/dist/lib/cjs/linters/eslint-rules/index.cjs +23 -24
- package/dist/lib/cjs/linters/eslint-rules/index.d.cts +4 -0
- package/dist/lib/cjs/linters/eslint-rules/manifest-description.cjs +9 -22
- package/dist/lib/cjs/linters/eslint-rules/manifest-helpers.cjs +9 -22
- package/dist/lib/cjs/linters/eslint-rules/manifest-id.cjs +9 -22
- package/dist/lib/cjs/linters/eslint-rules/manifest-name.cjs +9 -22
- package/dist/lib/cjs/linters/eslint-rules/manifest-schema.cjs +9 -22
- package/dist/lib/cjs/linters/eslint-rules/no-local-obsidian-internals.cjs +259 -0
- package/dist/lib/cjs/linters/eslint-rules/no-local-obsidian-internals.d.cts +10 -0
- package/dist/lib/cjs/linters/eslint-rules/no-over-cap-wait-in-eval-in-obsidian.cjs +9 -22
- package/dist/lib/cjs/linters/eslint-rules/no-untrusted-input-events.cjs +9 -22
- package/dist/lib/cjs/linters/eslint-rules/obsidian-dev-utils-plugin.cjs +18 -23
- package/dist/lib/cjs/linters/eslint-rules/plugin-name-as-code-in-ui.cjs +263 -0
- package/dist/lib/cjs/linters/eslint-rules/plugin-name-as-code-in-ui.d.cts +30 -0
- package/dist/lib/cjs/linters/eslint-rules/plugin-name-as-code.cjs +215 -0
- package/dist/lib/cjs/linters/eslint-rules/plugin-name-as-code.d.cts +29 -0
- package/dist/lib/cjs/linters/eslint-rules/require-component-suffix.cjs +9 -22
- package/dist/lib/cjs/linters/eslint-rules/require-plugin-api-contract-schemas.cjs +306 -0
- package/dist/lib/cjs/linters/eslint-rules/require-plugin-api-contract-schemas.d.cts +10 -0
- package/dist/lib/cjs/linters/eslint.cjs +9 -22
- package/dist/lib/cjs/linters/index.cjs +20 -24
- package/dist/lib/cjs/linters/index.d.cts +3 -0
- package/dist/lib/cjs/linters/markdownlint-cli2-config.cjs +171 -0
- package/dist/lib/cjs/linters/markdownlint-cli2-config.d.cts +12 -0
- package/dist/lib/cjs/linters/markdownlint-rules/index.cjs +164 -0
- package/dist/lib/cjs/linters/markdownlint-rules/index.d.cts +2 -0
- package/dist/lib/cjs/linters/markdownlint-rules/plugin-name-as-code.cjs +246 -0
- package/dist/lib/cjs/linters/markdownlint-rules/plugin-name-as-code.d.cts +32 -0
- package/dist/lib/cjs/linters/markdownlint.cjs +9 -22
- package/dist/lib/cjs/linters/obsidianmd-rule-custom-message.cjs +9 -22
- package/dist/lib/cjs/linters/plugin-names.cjs +249 -0
- package/dist/lib/cjs/linters/plugin-names.d.cts +81 -0
- package/dist/lib/cjs/obsidian-plugin-repo-paths.cjs +9 -22
- package/dist/lib/cjs/setup.cjs +9 -22
- package/dist/lib/cjs/templates.cjs +9 -22
- package/dist/lib/cjs/test-runners/index.cjs +9 -22
- package/dist/lib/cjs/test-runners/integration-test-plugin.cjs +9 -22
- package/dist/lib/cjs/test-runners/performance-eval-cap.cjs +9 -22
- package/dist/lib/cjs/test-runners/stale-build-global-setup.cjs +9 -22
- package/dist/lib/cjs/test-runners/vitest-config.cjs +9 -22
- package/dist/lib/cjs/version.cjs +9 -22
- package/dist/lib/cjs/vitest-setup.cjs +9 -22
- package/dist/lib/esm/bundlers/esbuild-impl/copy-to-obsidian-plugins-folder-plugin.mjs +6 -14
- package/dist/lib/esm/bundlers/esbuild-impl/dependency.mjs +6 -14
- package/dist/lib/esm/bundlers/esbuild-impl/fix-source-maps-plugin.mjs +6 -14
- package/dist/lib/esm/bundlers/esbuild-impl/index.mjs +6 -14
- package/dist/lib/esm/bundlers/esbuild-impl/obsidian-plugin-builder.mjs +6 -14
- package/dist/lib/esm/bundlers/esbuild-impl/preprocess-plugin.mjs +6 -14
- package/dist/lib/esm/bundlers/esbuild-impl/rename-css-plugin.mjs +6 -14
- package/dist/lib/esm/bundlers/esbuild.mjs +6 -14
- package/dist/lib/esm/bundlers/index.mjs +6 -14
- package/dist/lib/esm/demo-vault-app-json.mjs +6 -14
- package/dist/lib/esm/demo-vault-buttons.d.mts +7 -7
- package/dist/lib/esm/demo-vault-buttons.mjs +6 -14
- package/dist/lib/esm/demo-vault-coverage.mjs +8 -15
- package/dist/lib/esm/demo-vault.mjs +6 -14
- package/dist/lib/esm/formatters/dprint.mjs +6 -14
- package/dist/lib/esm/formatters/index.mjs +6 -14
- package/dist/lib/esm/index.mjs +6 -14
- package/dist/lib/esm/integration-test-setup.mjs +6 -14
- package/dist/lib/esm/integration-test-vitest-global-setup.mjs +6 -14
- package/dist/lib/esm/jest-setup.mjs +6 -14
- package/dist/lib/esm/linters/eslint-config.mjs +57 -14
- package/dist/lib/esm/linters/eslint-rules/index.d.mts +4 -0
- package/dist/lib/esm/linters/eslint-rules/index.mjs +15 -15
- package/dist/lib/esm/linters/eslint-rules/manifest-description.mjs +6 -14
- package/dist/lib/esm/linters/eslint-rules/manifest-helpers.mjs +6 -14
- package/dist/lib/esm/linters/eslint-rules/manifest-id.mjs +6 -14
- package/dist/lib/esm/linters/eslint-rules/manifest-name.mjs +6 -14
- package/dist/lib/esm/linters/eslint-rules/manifest-schema.mjs +6 -14
- package/dist/lib/esm/linters/eslint-rules/no-local-obsidian-internals.d.mts +10 -0
- package/dist/lib/esm/linters/eslint-rules/no-local-obsidian-internals.mjs +150 -0
- package/dist/lib/esm/linters/eslint-rules/no-over-cap-wait-in-eval-in-obsidian.mjs +6 -14
- package/dist/lib/esm/linters/eslint-rules/no-untrusted-input-events.mjs +6 -14
- package/dist/lib/esm/linters/eslint-rules/obsidian-dev-utils-plugin.mjs +15 -15
- package/dist/lib/esm/linters/eslint-rules/plugin-name-as-code-in-ui.d.mts +30 -0
- package/dist/lib/esm/linters/eslint-rules/plugin-name-as-code-in-ui.mjs +157 -0
- package/dist/lib/esm/linters/eslint-rules/plugin-name-as-code.d.mts +29 -0
- package/dist/lib/esm/linters/eslint-rules/plugin-name-as-code.mjs +108 -0
- package/dist/lib/esm/linters/eslint-rules/require-component-suffix.mjs +6 -14
- package/dist/lib/esm/linters/eslint-rules/require-plugin-api-contract-schemas.d.mts +10 -0
- package/dist/lib/esm/linters/eslint-rules/require-plugin-api-contract-schemas.mjs +197 -0
- package/dist/lib/esm/linters/eslint.mjs +6 -14
- package/dist/lib/esm/linters/index.d.mts +3 -0
- package/dist/lib/esm/linters/index.mjs +13 -15
- package/dist/lib/esm/linters/markdownlint-cli2-config.d.mts +12 -0
- package/dist/lib/esm/linters/markdownlint-cli2-config.mjs +66 -0
- package/dist/lib/esm/linters/markdownlint-rules/index.d.mts +2 -0
- package/dist/lib/esm/linters/markdownlint-rules/index.mjs +46 -0
- package/dist/lib/esm/linters/markdownlint-rules/plugin-name-as-code.d.mts +32 -0
- package/dist/lib/esm/linters/markdownlint-rules/plugin-name-as-code.mjs +130 -0
- package/dist/lib/esm/linters/markdownlint.mjs +6 -14
- package/dist/lib/esm/linters/obsidianmd-rule-custom-message.mjs +6 -14
- package/dist/lib/esm/linters/plugin-names.d.mts +81 -0
- package/dist/lib/esm/linters/plugin-names.mjs +141 -0
- package/dist/lib/esm/obsidian-plugin-repo-paths.mjs +6 -14
- package/dist/lib/esm/setup.mjs +6 -14
- package/dist/lib/esm/templates.mjs +6 -14
- package/dist/lib/esm/test-runners/index.mjs +6 -14
- package/dist/lib/esm/test-runners/integration-test-plugin.mjs +6 -14
- package/dist/lib/esm/test-runners/performance-eval-cap.mjs +6 -14
- package/dist/lib/esm/test-runners/stale-build-global-setup.mjs +6 -14
- package/dist/lib/esm/test-runners/vitest-config.mjs +6 -14
- package/dist/lib/esm/version.mjs +6 -14
- package/dist/lib/esm/vitest-setup.mjs +6 -14
- package/dist/templates/scripts/markdownlint-cli2-config.ts +2 -2
- package/linters/eslint-rules/no-local-obsidian-internals/package.json +6 -0
- package/linters/eslint-rules/plugin-name-as-code/package.json +6 -0
- package/linters/eslint-rules/plugin-name-as-code-in-ui/package.json +6 -0
- package/linters/eslint-rules/require-plugin-api-contract-schemas/package.json +6 -0
- package/linters/markdownlint-cli2-config/package.json +6 -0
- package/linters/markdownlint-rules/index/package.json +6 -0
- package/linters/markdownlint-rules/package.json +6 -0
- package/linters/markdownlint-rules/plugin-name-as-code/package.json +6 -0
- package/linters/plugin-names/package.json +6 -0
- package/package.json +84 -23
package/README.md
CHANGED
|
@@ -2,7 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Tooling for Obsidian plugins: the esbuild plugin builder, the shared ESLint and Vitest configurations, demo vaults, the plugin release script, the per-test setup for plugin tests, and the consumer templates. It continues the tooling half of `obsidian-dev-utils`. Install it as a dev dependency.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install --save-dev @mnaoumov/obsidian-dev-toolkit
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Where it fits
|
|
12
|
+
|
|
13
|
+
It is one of five packages that replace [`obsidian-dev-utils`](https://github.com/mnaoumov/obsidian-dev-utils): [`@mnaoumov/typescript-lib`](https://github.com/mnaoumov/typescript-lib), [`@mnaoumov/typescript-test-toolkit`](https://github.com/mnaoumov/typescript-test-toolkit), [`@mnaoumov/typescript-dev-toolkit`](https://github.com/mnaoumov/typescript-dev-toolkit), [`@mnaoumov/obsidian-lib`](https://github.com/mnaoumov/obsidian-lib) and [`@mnaoumov/obsidian-dev-toolkit`](https://github.com/mnaoumov/obsidian-dev-toolkit). It depends on [`@mnaoumov/typescript-lib`](https://github.com/mnaoumov/typescript-lib), [`@mnaoumov/typescript-dev-toolkit`](https://github.com/mnaoumov/typescript-dev-toolkit) and [`@mnaoumov/obsidian-lib`](https://github.com/mnaoumov/obsidian-lib). It moved here from that repository with its history.
|
|
6
14
|
|
|
7
15
|
## License
|
|
8
16
|
|
|
@@ -34,9 +34,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
34
34
|
));
|
|
35
35
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
36
|
|
|
37
|
-
//
|
|
37
|
+
// node_modules/path-browserify/index.js
|
|
38
38
|
var require_path_browserify = __commonJS({
|
|
39
|
-
"
|
|
39
|
+
"node_modules/path-browserify/index.js"(exports2, module2) {
|
|
40
40
|
"use strict";
|
|
41
41
|
function assertPath(path) {
|
|
42
42
|
if (typeof path !== "string") {
|
|
@@ -449,15 +449,186 @@ __export(main_exports, {
|
|
|
449
449
|
module.exports = __toCommonJS(main_exports);
|
|
450
450
|
var import_obsidian3 = require("obsidian");
|
|
451
451
|
|
|
452
|
-
//
|
|
452
|
+
// node_modules/@mnaoumov/typescript-lib/dist/lib/esm/path.mjs
|
|
453
453
|
var import_path_browserify = __toESM(require_path_browserify(), 1);
|
|
454
454
|
|
|
455
|
-
//
|
|
455
|
+
// node_modules/@mnaoumov/typescript-lib/dist/lib/esm/aggregate-error.mjs
|
|
456
|
+
(function() {
|
|
457
|
+
function ensureDisposeSymbols(symbolConstructor = Symbol) {
|
|
458
|
+
symbolConstructor.asyncDispose ??= symbolConstructor.for("Symbol.asyncDispose");
|
|
459
|
+
symbolConstructor.dispose ??= symbolConstructor.for("Symbol.dispose");
|
|
460
|
+
}
|
|
461
|
+
function ensureBrowserProcess() {
|
|
462
|
+
const browserProcess = {
|
|
463
|
+
browser: true,
|
|
464
|
+
cwd() {
|
|
465
|
+
return "/";
|
|
466
|
+
},
|
|
467
|
+
env: {},
|
|
468
|
+
platform: "android"
|
|
469
|
+
};
|
|
470
|
+
const existingProcess = globalThis.process;
|
|
471
|
+
if (!existingProcess) {
|
|
472
|
+
globalThis.process = browserProcess;
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
if (existingProcess.versions?.node) {
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
const existingProcessRecord = existingProcess;
|
|
479
|
+
for (const [key, value] of Object.entries(browserProcess)) {
|
|
480
|
+
existingProcessRecord[key] ??= value;
|
|
481
|
+
}
|
|
482
|
+
existingProcessRecord["browser"] = true;
|
|
483
|
+
}
|
|
484
|
+
(function initEsm() {
|
|
485
|
+
ensureDisposeSymbols();
|
|
486
|
+
ensureBrowserProcess();
|
|
487
|
+
})();
|
|
488
|
+
})();
|
|
489
|
+
|
|
490
|
+
// node_modules/@mnaoumov/typescript-lib/dist/lib/esm/function.mjs
|
|
491
|
+
(function() {
|
|
492
|
+
function ensureDisposeSymbols(symbolConstructor = Symbol) {
|
|
493
|
+
symbolConstructor.asyncDispose ??= symbolConstructor.for("Symbol.asyncDispose");
|
|
494
|
+
symbolConstructor.dispose ??= symbolConstructor.for("Symbol.dispose");
|
|
495
|
+
}
|
|
496
|
+
function ensureBrowserProcess() {
|
|
497
|
+
const browserProcess = {
|
|
498
|
+
browser: true,
|
|
499
|
+
cwd() {
|
|
500
|
+
return "/";
|
|
501
|
+
},
|
|
502
|
+
env: {},
|
|
503
|
+
platform: "android"
|
|
504
|
+
};
|
|
505
|
+
const existingProcess = globalThis.process;
|
|
506
|
+
if (!existingProcess) {
|
|
507
|
+
globalThis.process = browserProcess;
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
if (existingProcess.versions?.node) {
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
const existingProcessRecord = existingProcess;
|
|
514
|
+
for (const [key, value] of Object.entries(browserProcess)) {
|
|
515
|
+
existingProcessRecord[key] ??= value;
|
|
516
|
+
}
|
|
517
|
+
existingProcessRecord["browser"] = true;
|
|
518
|
+
}
|
|
519
|
+
(function initEsm() {
|
|
520
|
+
ensureDisposeSymbols();
|
|
521
|
+
ensureBrowserProcess();
|
|
522
|
+
})();
|
|
523
|
+
})();
|
|
456
524
|
function noop() {
|
|
457
525
|
}
|
|
458
526
|
var noopAsyncSingletonPromise = Promise.resolve();
|
|
459
527
|
|
|
460
|
-
//
|
|
528
|
+
// node_modules/@mnaoumov/typescript-lib/dist/lib/esm/type-guards.mjs
|
|
529
|
+
(function() {
|
|
530
|
+
function ensureDisposeSymbols(symbolConstructor = Symbol) {
|
|
531
|
+
symbolConstructor.asyncDispose ??= symbolConstructor.for("Symbol.asyncDispose");
|
|
532
|
+
symbolConstructor.dispose ??= symbolConstructor.for("Symbol.dispose");
|
|
533
|
+
}
|
|
534
|
+
function ensureBrowserProcess() {
|
|
535
|
+
const browserProcess = {
|
|
536
|
+
browser: true,
|
|
537
|
+
cwd() {
|
|
538
|
+
return "/";
|
|
539
|
+
},
|
|
540
|
+
env: {},
|
|
541
|
+
platform: "android"
|
|
542
|
+
};
|
|
543
|
+
const existingProcess = globalThis.process;
|
|
544
|
+
if (!existingProcess) {
|
|
545
|
+
globalThis.process = browserProcess;
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
if (existingProcess.versions?.node) {
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
const existingProcessRecord = existingProcess;
|
|
552
|
+
for (const [key, value] of Object.entries(browserProcess)) {
|
|
553
|
+
existingProcessRecord[key] ??= value;
|
|
554
|
+
}
|
|
555
|
+
existingProcessRecord["browser"] = true;
|
|
556
|
+
}
|
|
557
|
+
(function initEsm() {
|
|
558
|
+
ensureDisposeSymbols();
|
|
559
|
+
ensureBrowserProcess();
|
|
560
|
+
})();
|
|
561
|
+
})();
|
|
562
|
+
|
|
563
|
+
// node_modules/@mnaoumov/typescript-lib/dist/lib/esm/disposable.mjs
|
|
564
|
+
(function() {
|
|
565
|
+
function ensureDisposeSymbols(symbolConstructor = Symbol) {
|
|
566
|
+
symbolConstructor.asyncDispose ??= symbolConstructor.for("Symbol.asyncDispose");
|
|
567
|
+
symbolConstructor.dispose ??= symbolConstructor.for("Symbol.dispose");
|
|
568
|
+
}
|
|
569
|
+
function ensureBrowserProcess() {
|
|
570
|
+
const browserProcess = {
|
|
571
|
+
browser: true,
|
|
572
|
+
cwd() {
|
|
573
|
+
return "/";
|
|
574
|
+
},
|
|
575
|
+
env: {},
|
|
576
|
+
platform: "android"
|
|
577
|
+
};
|
|
578
|
+
const existingProcess = globalThis.process;
|
|
579
|
+
if (!existingProcess) {
|
|
580
|
+
globalThis.process = browserProcess;
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
if (existingProcess.versions?.node) {
|
|
584
|
+
return;
|
|
585
|
+
}
|
|
586
|
+
const existingProcessRecord = existingProcess;
|
|
587
|
+
for (const [key, value] of Object.entries(browserProcess)) {
|
|
588
|
+
existingProcessRecord[key] ??= value;
|
|
589
|
+
}
|
|
590
|
+
existingProcessRecord["browser"] = true;
|
|
591
|
+
}
|
|
592
|
+
(function initEsm() {
|
|
593
|
+
ensureDisposeSymbols();
|
|
594
|
+
ensureBrowserProcess();
|
|
595
|
+
})();
|
|
596
|
+
})();
|
|
597
|
+
|
|
598
|
+
// node_modules/@mnaoumov/typescript-lib/dist/lib/esm/value-wrapper.mjs
|
|
599
|
+
(function() {
|
|
600
|
+
function ensureDisposeSymbols(symbolConstructor = Symbol) {
|
|
601
|
+
symbolConstructor.asyncDispose ??= symbolConstructor.for("Symbol.asyncDispose");
|
|
602
|
+
symbolConstructor.dispose ??= symbolConstructor.for("Symbol.dispose");
|
|
603
|
+
}
|
|
604
|
+
function ensureBrowserProcess() {
|
|
605
|
+
const browserProcess = {
|
|
606
|
+
browser: true,
|
|
607
|
+
cwd() {
|
|
608
|
+
return "/";
|
|
609
|
+
},
|
|
610
|
+
env: {},
|
|
611
|
+
platform: "android"
|
|
612
|
+
};
|
|
613
|
+
const existingProcess = globalThis.process;
|
|
614
|
+
if (!existingProcess) {
|
|
615
|
+
globalThis.process = browserProcess;
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
if (existingProcess.versions?.node) {
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
const existingProcessRecord = existingProcess;
|
|
622
|
+
for (const [key, value] of Object.entries(browserProcess)) {
|
|
623
|
+
existingProcessRecord[key] ??= value;
|
|
624
|
+
}
|
|
625
|
+
existingProcessRecord["browser"] = true;
|
|
626
|
+
}
|
|
627
|
+
(function initEsm() {
|
|
628
|
+
ensureDisposeSymbols();
|
|
629
|
+
ensureBrowserProcess();
|
|
630
|
+
})();
|
|
631
|
+
})();
|
|
461
632
|
var ValueWrapper = class _ValueWrapper {
|
|
462
633
|
/**
|
|
463
634
|
* Gets the wrapped value.
|
|
@@ -511,7 +682,180 @@ var ValueWrapper = class _ValueWrapper {
|
|
|
511
682
|
}
|
|
512
683
|
};
|
|
513
684
|
|
|
514
|
-
//
|
|
685
|
+
// node_modules/@mnaoumov/typescript-lib/dist/lib/esm/typescript-lib-state.mjs
|
|
686
|
+
(function() {
|
|
687
|
+
function ensureDisposeSymbols(symbolConstructor = Symbol) {
|
|
688
|
+
symbolConstructor.asyncDispose ??= symbolConstructor.for("Symbol.asyncDispose");
|
|
689
|
+
symbolConstructor.dispose ??= symbolConstructor.for("Symbol.dispose");
|
|
690
|
+
}
|
|
691
|
+
function ensureBrowserProcess() {
|
|
692
|
+
const browserProcess = {
|
|
693
|
+
browser: true,
|
|
694
|
+
cwd() {
|
|
695
|
+
return "/";
|
|
696
|
+
},
|
|
697
|
+
env: {},
|
|
698
|
+
platform: "android"
|
|
699
|
+
};
|
|
700
|
+
const existingProcess = globalThis.process;
|
|
701
|
+
if (!existingProcess) {
|
|
702
|
+
globalThis.process = browserProcess;
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
if (existingProcess.versions?.node) {
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
708
|
+
const existingProcessRecord = existingProcess;
|
|
709
|
+
for (const [key, value] of Object.entries(browserProcess)) {
|
|
710
|
+
existingProcessRecord[key] ??= value;
|
|
711
|
+
}
|
|
712
|
+
existingProcessRecord["browser"] = true;
|
|
713
|
+
}
|
|
714
|
+
(function initEsm() {
|
|
715
|
+
ensureDisposeSymbols();
|
|
716
|
+
ensureBrowserProcess();
|
|
717
|
+
})();
|
|
718
|
+
})();
|
|
719
|
+
|
|
720
|
+
// node_modules/@mnaoumov/typescript-lib/dist/lib/esm/abort-controller.mjs
|
|
721
|
+
(function() {
|
|
722
|
+
function ensureDisposeSymbols(symbolConstructor = Symbol) {
|
|
723
|
+
symbolConstructor.asyncDispose ??= symbolConstructor.for("Symbol.asyncDispose");
|
|
724
|
+
symbolConstructor.dispose ??= symbolConstructor.for("Symbol.dispose");
|
|
725
|
+
}
|
|
726
|
+
function ensureBrowserProcess() {
|
|
727
|
+
const browserProcess = {
|
|
728
|
+
browser: true,
|
|
729
|
+
cwd() {
|
|
730
|
+
return "/";
|
|
731
|
+
},
|
|
732
|
+
env: {},
|
|
733
|
+
platform: "android"
|
|
734
|
+
};
|
|
735
|
+
const existingProcess = globalThis.process;
|
|
736
|
+
if (!existingProcess) {
|
|
737
|
+
globalThis.process = browserProcess;
|
|
738
|
+
return;
|
|
739
|
+
}
|
|
740
|
+
if (existingProcess.versions?.node) {
|
|
741
|
+
return;
|
|
742
|
+
}
|
|
743
|
+
const existingProcessRecord = existingProcess;
|
|
744
|
+
for (const [key, value] of Object.entries(browserProcess)) {
|
|
745
|
+
existingProcessRecord[key] ??= value;
|
|
746
|
+
}
|
|
747
|
+
existingProcessRecord["browser"] = true;
|
|
748
|
+
}
|
|
749
|
+
(function initEsm() {
|
|
750
|
+
ensureDisposeSymbols();
|
|
751
|
+
ensureBrowserProcess();
|
|
752
|
+
})();
|
|
753
|
+
})();
|
|
754
|
+
|
|
755
|
+
// node_modules/@mnaoumov/typescript-lib/dist/lib/esm/reg-exp.mjs
|
|
756
|
+
(function() {
|
|
757
|
+
function ensureDisposeSymbols(symbolConstructor = Symbol) {
|
|
758
|
+
symbolConstructor.asyncDispose ??= symbolConstructor.for("Symbol.asyncDispose");
|
|
759
|
+
symbolConstructor.dispose ??= symbolConstructor.for("Symbol.dispose");
|
|
760
|
+
}
|
|
761
|
+
function ensureBrowserProcess() {
|
|
762
|
+
const browserProcess = {
|
|
763
|
+
browser: true,
|
|
764
|
+
cwd() {
|
|
765
|
+
return "/";
|
|
766
|
+
},
|
|
767
|
+
env: {},
|
|
768
|
+
platform: "android"
|
|
769
|
+
};
|
|
770
|
+
const existingProcess = globalThis.process;
|
|
771
|
+
if (!existingProcess) {
|
|
772
|
+
globalThis.process = browserProcess;
|
|
773
|
+
return;
|
|
774
|
+
}
|
|
775
|
+
if (existingProcess.versions?.node) {
|
|
776
|
+
return;
|
|
777
|
+
}
|
|
778
|
+
const existingProcessRecord = existingProcess;
|
|
779
|
+
for (const [key, value] of Object.entries(browserProcess)) {
|
|
780
|
+
existingProcessRecord[key] ??= value;
|
|
781
|
+
}
|
|
782
|
+
existingProcessRecord["browser"] = true;
|
|
783
|
+
}
|
|
784
|
+
(function initEsm() {
|
|
785
|
+
ensureDisposeSymbols();
|
|
786
|
+
ensureBrowserProcess();
|
|
787
|
+
})();
|
|
788
|
+
})();
|
|
789
|
+
|
|
790
|
+
// node_modules/@mnaoumov/typescript-lib/dist/lib/esm/value-provider.mjs
|
|
791
|
+
(function() {
|
|
792
|
+
function ensureDisposeSymbols(symbolConstructor = Symbol) {
|
|
793
|
+
symbolConstructor.asyncDispose ??= symbolConstructor.for("Symbol.asyncDispose");
|
|
794
|
+
symbolConstructor.dispose ??= symbolConstructor.for("Symbol.dispose");
|
|
795
|
+
}
|
|
796
|
+
function ensureBrowserProcess() {
|
|
797
|
+
const browserProcess = {
|
|
798
|
+
browser: true,
|
|
799
|
+
cwd() {
|
|
800
|
+
return "/";
|
|
801
|
+
},
|
|
802
|
+
env: {},
|
|
803
|
+
platform: "android"
|
|
804
|
+
};
|
|
805
|
+
const existingProcess = globalThis.process;
|
|
806
|
+
if (!existingProcess) {
|
|
807
|
+
globalThis.process = browserProcess;
|
|
808
|
+
return;
|
|
809
|
+
}
|
|
810
|
+
if (existingProcess.versions?.node) {
|
|
811
|
+
return;
|
|
812
|
+
}
|
|
813
|
+
const existingProcessRecord = existingProcess;
|
|
814
|
+
for (const [key, value] of Object.entries(browserProcess)) {
|
|
815
|
+
existingProcessRecord[key] ??= value;
|
|
816
|
+
}
|
|
817
|
+
existingProcessRecord["browser"] = true;
|
|
818
|
+
}
|
|
819
|
+
(function initEsm() {
|
|
820
|
+
ensureDisposeSymbols();
|
|
821
|
+
ensureBrowserProcess();
|
|
822
|
+
})();
|
|
823
|
+
})();
|
|
824
|
+
|
|
825
|
+
// node_modules/@mnaoumov/typescript-lib/dist/lib/esm/string.mjs
|
|
826
|
+
(function() {
|
|
827
|
+
function ensureDisposeSymbols(symbolConstructor = Symbol) {
|
|
828
|
+
symbolConstructor.asyncDispose ??= symbolConstructor.for("Symbol.asyncDispose");
|
|
829
|
+
symbolConstructor.dispose ??= symbolConstructor.for("Symbol.dispose");
|
|
830
|
+
}
|
|
831
|
+
function ensureBrowserProcess() {
|
|
832
|
+
const browserProcess = {
|
|
833
|
+
browser: true,
|
|
834
|
+
cwd() {
|
|
835
|
+
return "/";
|
|
836
|
+
},
|
|
837
|
+
env: {},
|
|
838
|
+
platform: "android"
|
|
839
|
+
};
|
|
840
|
+
const existingProcess = globalThis.process;
|
|
841
|
+
if (!existingProcess) {
|
|
842
|
+
globalThis.process = browserProcess;
|
|
843
|
+
return;
|
|
844
|
+
}
|
|
845
|
+
if (existingProcess.versions?.node) {
|
|
846
|
+
return;
|
|
847
|
+
}
|
|
848
|
+
const existingProcessRecord = existingProcess;
|
|
849
|
+
for (const [key, value] of Object.entries(browserProcess)) {
|
|
850
|
+
existingProcessRecord[key] ??= value;
|
|
851
|
+
}
|
|
852
|
+
existingProcessRecord["browser"] = true;
|
|
853
|
+
}
|
|
854
|
+
(function initEsm() {
|
|
855
|
+
ensureDisposeSymbols();
|
|
856
|
+
ensureBrowserProcess();
|
|
857
|
+
})();
|
|
858
|
+
})();
|
|
515
859
|
var EMPTY = "";
|
|
516
860
|
var ESCAPE_MAP = {
|
|
517
861
|
"\n": String.raw`\n`,
|
|
@@ -528,7 +872,40 @@ for (const [key, value] of Object.entries(ESCAPE_MAP)) {
|
|
|
528
872
|
UNESCAPE_MAP[value] = key;
|
|
529
873
|
}
|
|
530
874
|
|
|
531
|
-
//
|
|
875
|
+
// node_modules/@mnaoumov/typescript-lib/dist/lib/esm/path.mjs
|
|
876
|
+
(function() {
|
|
877
|
+
function ensureDisposeSymbols(symbolConstructor = Symbol) {
|
|
878
|
+
symbolConstructor.asyncDispose ??= symbolConstructor.for("Symbol.asyncDispose");
|
|
879
|
+
symbolConstructor.dispose ??= symbolConstructor.for("Symbol.dispose");
|
|
880
|
+
}
|
|
881
|
+
function ensureBrowserProcess() {
|
|
882
|
+
const browserProcess = {
|
|
883
|
+
browser: true,
|
|
884
|
+
cwd() {
|
|
885
|
+
return "/";
|
|
886
|
+
},
|
|
887
|
+
env: {},
|
|
888
|
+
platform: "android"
|
|
889
|
+
};
|
|
890
|
+
const existingProcess = globalThis.process;
|
|
891
|
+
if (!existingProcess) {
|
|
892
|
+
globalThis.process = browserProcess;
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
895
|
+
if (existingProcess.versions?.node) {
|
|
896
|
+
return;
|
|
897
|
+
}
|
|
898
|
+
const existingProcessRecord = existingProcess;
|
|
899
|
+
for (const [key, value] of Object.entries(browserProcess)) {
|
|
900
|
+
existingProcessRecord[key] ??= value;
|
|
901
|
+
}
|
|
902
|
+
existingProcessRecord["browser"] = true;
|
|
903
|
+
}
|
|
904
|
+
(function initEsm() {
|
|
905
|
+
ensureDisposeSymbols();
|
|
906
|
+
ensureBrowserProcess();
|
|
907
|
+
})();
|
|
908
|
+
})();
|
|
532
909
|
var posix = import_path_browserify.default.posix;
|
|
533
910
|
var delimiter = posix.delimiter;
|
|
534
911
|
var separator = import_path_browserify.default.posix.sep;
|
|
@@ -540,13 +917,46 @@ var join = posix.join;
|
|
|
540
917
|
var normalizePath = posix.normalize;
|
|
541
918
|
var parse = posix.parse;
|
|
542
919
|
|
|
543
|
-
//
|
|
920
|
+
// node_modules/@mnaoumov/obsidian-lib/dist/lib/esm/demo-vault-helper.mjs
|
|
544
921
|
var import_obsidian2 = require("obsidian");
|
|
545
922
|
|
|
546
|
-
//
|
|
923
|
+
// node_modules/@mnaoumov/obsidian-lib/dist/lib/esm/community-plugins.mjs
|
|
547
924
|
var import_obsidian = require("obsidian");
|
|
548
925
|
|
|
549
|
-
//
|
|
926
|
+
// node_modules/@mnaoumov/obsidian-lib/dist/lib/esm/obsidian-dev-utils-state.mjs
|
|
927
|
+
(function() {
|
|
928
|
+
function ensureDisposeSymbols(symbolConstructor = Symbol) {
|
|
929
|
+
symbolConstructor.asyncDispose ??= symbolConstructor.for("Symbol.asyncDispose");
|
|
930
|
+
symbolConstructor.dispose ??= symbolConstructor.for("Symbol.dispose");
|
|
931
|
+
}
|
|
932
|
+
function ensureBrowserProcess() {
|
|
933
|
+
const browserProcess = {
|
|
934
|
+
browser: true,
|
|
935
|
+
cwd() {
|
|
936
|
+
return "/";
|
|
937
|
+
},
|
|
938
|
+
env: {},
|
|
939
|
+
platform: "android"
|
|
940
|
+
};
|
|
941
|
+
const existingProcess = globalThis.process;
|
|
942
|
+
if (!existingProcess) {
|
|
943
|
+
globalThis.process = browserProcess;
|
|
944
|
+
return;
|
|
945
|
+
}
|
|
946
|
+
if (existingProcess.versions?.node) {
|
|
947
|
+
return;
|
|
948
|
+
}
|
|
949
|
+
const existingProcessRecord = existingProcess;
|
|
950
|
+
for (const [key, value] of Object.entries(browserProcess)) {
|
|
951
|
+
existingProcessRecord[key] ??= value;
|
|
952
|
+
}
|
|
953
|
+
existingProcessRecord["browser"] = true;
|
|
954
|
+
}
|
|
955
|
+
(function initEsm() {
|
|
956
|
+
ensureDisposeSymbols();
|
|
957
|
+
ensureBrowserProcess();
|
|
958
|
+
})();
|
|
959
|
+
})();
|
|
550
960
|
function getObsidianDevUtilsState(key, defaultValue) {
|
|
551
961
|
return getObsidianDevUtilsBag()[key] ??= ValueWrapper.of(defaultValue);
|
|
552
962
|
}
|
|
@@ -556,10 +966,49 @@ function getObsidianDevUtilsBag() {
|
|
|
556
966
|
return wrapper.__obsidianDevUtils;
|
|
557
967
|
}
|
|
558
968
|
|
|
559
|
-
//
|
|
969
|
+
// node_modules/@mnaoumov/obsidian-lib/dist/lib/esm/community-plugins.mjs
|
|
970
|
+
(function() {
|
|
971
|
+
function ensureDisposeSymbols(symbolConstructor = Symbol) {
|
|
972
|
+
symbolConstructor.asyncDispose ??= symbolConstructor.for("Symbol.asyncDispose");
|
|
973
|
+
symbolConstructor.dispose ??= symbolConstructor.for("Symbol.dispose");
|
|
974
|
+
}
|
|
975
|
+
function ensureBrowserProcess() {
|
|
976
|
+
const browserProcess = {
|
|
977
|
+
browser: true,
|
|
978
|
+
cwd() {
|
|
979
|
+
return "/";
|
|
980
|
+
},
|
|
981
|
+
env: {},
|
|
982
|
+
platform: "android"
|
|
983
|
+
};
|
|
984
|
+
const existingProcess = globalThis.process;
|
|
985
|
+
if (!existingProcess) {
|
|
986
|
+
globalThis.process = browserProcess;
|
|
987
|
+
return;
|
|
988
|
+
}
|
|
989
|
+
if (existingProcess.versions?.node) {
|
|
990
|
+
return;
|
|
991
|
+
}
|
|
992
|
+
const existingProcessRecord = existingProcess;
|
|
993
|
+
for (const [key, value] of Object.entries(browserProcess)) {
|
|
994
|
+
existingProcessRecord[key] ??= value;
|
|
995
|
+
}
|
|
996
|
+
existingProcessRecord["browser"] = true;
|
|
997
|
+
}
|
|
998
|
+
(function initEsm() {
|
|
999
|
+
ensureDisposeSymbols();
|
|
1000
|
+
ensureBrowserProcess();
|
|
1001
|
+
})();
|
|
1002
|
+
})();
|
|
560
1003
|
var COMMUNITY_PLUGINS_STATE_KEY = "communityPluginEntriesPromise";
|
|
561
1004
|
var COMMUNITY_PLUGINS_URL = "https://raw.githubusercontent.com/obsidianmd/obsidian-releases/HEAD/community-plugins.json";
|
|
562
1005
|
var DATA_JSON_INDENT = 2;
|
|
1006
|
+
var ConfigureCommunityPluginResult = /* @__PURE__ */ ((ConfigureCommunityPluginResult2) => {
|
|
1007
|
+
ConfigureCommunityPluginResult2["AppliedLive"] = "appliedLive";
|
|
1008
|
+
ConfigureCommunityPluginResult2["Skipped"] = "skipped";
|
|
1009
|
+
ConfigureCommunityPluginResult2["Success"] = "success";
|
|
1010
|
+
return ConfigureCommunityPluginResult2;
|
|
1011
|
+
})(ConfigureCommunityPluginResult || {});
|
|
563
1012
|
async function configureCommunityPlugin(params) {
|
|
564
1013
|
const { app, settings } = params;
|
|
565
1014
|
const pluginId = await resolveCommunityPluginId(params);
|
|
@@ -568,7 +1017,7 @@ async function configureCommunityPlugin(params) {
|
|
|
568
1017
|
await settingsComponent.editAndSave((pluginSettings) => {
|
|
569
1018
|
Object.assign(pluginSettings, settings);
|
|
570
1019
|
});
|
|
571
|
-
return "appliedLive"
|
|
1020
|
+
return "appliedLive";
|
|
572
1021
|
}
|
|
573
1022
|
const dataPath = `${app.vault.configDir}/plugins/${pluginId}/data.json`;
|
|
574
1023
|
let data = {};
|
|
@@ -581,12 +1030,12 @@ async function configureCommunityPlugin(params) {
|
|
|
581
1030
|
const serializedBefore = JSON.stringify(data);
|
|
582
1031
|
Object.assign(data, settings);
|
|
583
1032
|
if (JSON.stringify(data) === serializedBefore) {
|
|
584
|
-
return "skipped"
|
|
1033
|
+
return "skipped";
|
|
585
1034
|
}
|
|
586
1035
|
const serialized = String(JSON.stringify(data, null, DATA_JSON_INDENT));
|
|
587
1036
|
await app.vault.adapter.write(dataPath, `${serialized}
|
|
588
1037
|
`);
|
|
589
|
-
return "success"
|
|
1038
|
+
return "success";
|
|
590
1039
|
}
|
|
591
1040
|
async function disableCommunityPlugin(params) {
|
|
592
1041
|
const { app } = params;
|
|
@@ -631,7 +1080,7 @@ async function installCommunityPlugin(params) {
|
|
|
631
1080
|
async function installConfigureEnableCommunityPlugin(params) {
|
|
632
1081
|
const { app, settings } = params;
|
|
633
1082
|
await installCommunityPlugin(params);
|
|
634
|
-
const didSettingsChange = settings ? await configureCommunityPlugin({ ...params, settings }) === "success"
|
|
1083
|
+
const didSettingsChange = settings ? await configureCommunityPlugin({ ...params, settings }) === "success" : false;
|
|
635
1084
|
const pluginId = await resolveCommunityPluginId(params);
|
|
636
1085
|
if (!app.plugins.enabledPlugins.has(pluginId)) {
|
|
637
1086
|
await enableCommunityPlugin(params);
|
|
@@ -676,7 +1125,40 @@ async function resolveCommunityPluginId(reference) {
|
|
|
676
1125
|
return entry.id;
|
|
677
1126
|
}
|
|
678
1127
|
|
|
679
|
-
//
|
|
1128
|
+
// node_modules/@mnaoumov/obsidian-lib/dist/lib/esm/demo-vault-helper.mjs
|
|
1129
|
+
(function() {
|
|
1130
|
+
function ensureDisposeSymbols(symbolConstructor = Symbol) {
|
|
1131
|
+
symbolConstructor.asyncDispose ??= symbolConstructor.for("Symbol.asyncDispose");
|
|
1132
|
+
symbolConstructor.dispose ??= symbolConstructor.for("Symbol.dispose");
|
|
1133
|
+
}
|
|
1134
|
+
function ensureBrowserProcess() {
|
|
1135
|
+
const browserProcess = {
|
|
1136
|
+
browser: true,
|
|
1137
|
+
cwd() {
|
|
1138
|
+
return "/";
|
|
1139
|
+
},
|
|
1140
|
+
env: {},
|
|
1141
|
+
platform: "android"
|
|
1142
|
+
};
|
|
1143
|
+
const existingProcess = globalThis.process;
|
|
1144
|
+
if (!existingProcess) {
|
|
1145
|
+
globalThis.process = browserProcess;
|
|
1146
|
+
return;
|
|
1147
|
+
}
|
|
1148
|
+
if (existingProcess.versions?.node) {
|
|
1149
|
+
return;
|
|
1150
|
+
}
|
|
1151
|
+
const existingProcessRecord = existingProcess;
|
|
1152
|
+
for (const [key, value] of Object.entries(browserProcess)) {
|
|
1153
|
+
existingProcessRecord[key] ??= value;
|
|
1154
|
+
}
|
|
1155
|
+
existingProcessRecord["browser"] = true;
|
|
1156
|
+
}
|
|
1157
|
+
(function initEsm() {
|
|
1158
|
+
ensureDisposeSymbols();
|
|
1159
|
+
ensureBrowserProcess();
|
|
1160
|
+
})();
|
|
1161
|
+
})();
|
|
680
1162
|
var CODE_SCRIPT_TOOLKIT_PLUGIN_ID = "fix-require-modules";
|
|
681
1163
|
var CODE_SCRIPT_TOOLKIT_MODULES_ROOT = "_assets/CodeScriptToolkit";
|
|
682
1164
|
var CODE_SCRIPT_TOOLKIT_SETTINGS = {
|
|
@@ -710,7 +1192,7 @@ async function bootstrapDemoVault(params) {
|
|
|
710
1192
|
await ensureInvocableScriptsFolder(app);
|
|
711
1193
|
if (!app.plugins.enabledPlugins.has(CODE_SCRIPT_TOOLKIT_PLUGIN_ID)) {
|
|
712
1194
|
await enableCommunityPlugin({ app, pluginId: CODE_SCRIPT_TOOLKIT_PLUGIN_ID });
|
|
713
|
-
} else if (result ===
|
|
1195
|
+
} else if (result === ConfigureCommunityPluginResult.Success) {
|
|
714
1196
|
await disableCommunityPlugin({ app, pluginId: CODE_SCRIPT_TOOLKIT_PLUGIN_ID });
|
|
715
1197
|
await enableCommunityPlugin({ app, pluginId: CODE_SCRIPT_TOOLKIT_PLUGIN_ID });
|
|
716
1198
|
}
|