mirror of
https://github.com/mnaoumov/obsidian-backlink-full-path.git
synced 2026-07-22 05:41:39 +00:00
refactor: migrate to @obsidian-typings/obsidian-public-latest
- Replace obsidian-typings with @obsidian-typings/obsidian-public-latest - Update vitest config: replace ssr.noExternal with server.deps.inline - Add DOM.Iterable to tsconfig lib - Remove obsolete overrides (@antfu/utils, boolean, dompurify) - Upgrade dependencies via npm-check-updates
This commit is contained in:
parent
c0abac4352
commit
e63ca64041
16 changed files with 11310 additions and 4389 deletions
24
.github/workflows/attest-release-assets.yml
vendored
Normal file
24
.github/workflows/attest-release-assets.yml
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
name: Attest Release Assets
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
attestations: write
|
||||
|
||||
jobs:
|
||||
attest:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download release assets
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: gh release download "${{ github.event.release.tag_name }}" --repo "${{ github.repository }}" --dir assets
|
||||
|
||||
- name: Generate artifact attestation
|
||||
uses: actions/attest@v4
|
||||
with:
|
||||
subject-path: assets/*
|
||||
72
CONTRIBUTING.md
Normal file
72
CONTRIBUTING.md
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
# Contributing
|
||||
|
||||
Contributions are welcome! Here's how to get started.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- [Node.js](https://nodejs.org/) (latest LTS recommended)
|
||||
- npm (comes with Node.js)
|
||||
|
||||
## Setup
|
||||
|
||||
```bash
|
||||
git clone https://github.com/mnaoumov/obsidian-backlink-full-path.git
|
||||
cd obsidian-backlink-full-path
|
||||
npm install
|
||||
```
|
||||
|
||||
## Development Workflow
|
||||
|
||||
### Build
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
### Dev Mode
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### Commit
|
||||
|
||||
This project uses [Conventional Commits](https://www.conventionalcommits.org/). Use the interactive commit prompt:
|
||||
|
||||
```bash
|
||||
npm run commit
|
||||
```
|
||||
|
||||
### Lint
|
||||
|
||||
```bash
|
||||
npm run lint
|
||||
npm run lint:fix
|
||||
```
|
||||
|
||||
### Format
|
||||
|
||||
```bash
|
||||
npm run format:check
|
||||
npm run format
|
||||
```
|
||||
|
||||
### Spellcheck
|
||||
|
||||
```bash
|
||||
npm run spellcheck
|
||||
```
|
||||
|
||||
### Test
|
||||
|
||||
```bash
|
||||
npm run test
|
||||
npm run test:coverage
|
||||
```
|
||||
|
||||
## Pull Requests
|
||||
|
||||
- Base your PR on the `master` branch.
|
||||
- Ensure all checks pass (`lint`, `format:check`, `spellcheck`, `test`).
|
||||
- Use [Conventional Commits](https://www.conventionalcommits.org/) for your commit messages.
|
||||
|
||||
15457
package-lock.json
generated
15457
package-lock.json
generated
File diff suppressed because it is too large
Load diff
58
package.json
58
package.json
|
|
@ -3,9 +3,13 @@
|
|||
"version": "1.6.2",
|
||||
"description": "Shows the backlink's full path in the backlinks panel.",
|
||||
"keywords": [],
|
||||
"homepage": "https://github.com/mnaoumov/obsidian-backlink-full-path#readme",
|
||||
"bugs": "https://github.com/mnaoumov/obsidian-backlink-full-path/issues",
|
||||
"repository": "git+https://github.com/mnaoumov/obsidian-backlink-full-path.git",
|
||||
"license": "MIT",
|
||||
"author": "mnaoumov",
|
||||
"type": "module",
|
||||
"main": "src/main.ts",
|
||||
"scripts": {
|
||||
"build": "jiti scripts/build.ts",
|
||||
"build:clean": "jiti scripts/build-clean.ts",
|
||||
|
|
@ -25,35 +29,31 @@
|
|||
"test:coverage": "jiti scripts/test-coverage.ts",
|
||||
"version": "jiti scripts/version.ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "latest",
|
||||
"@commitlint/config-conventional": "latest",
|
||||
"@commitlint/types": "latest",
|
||||
"@total-typescript/ts-reset": "latest",
|
||||
"@tsconfig/strictest": "latest",
|
||||
"@types/node": "25.0.3",
|
||||
"@vitest/coverage-v8": "latest",
|
||||
"better-typescript-lib": "latest",
|
||||
"commitizen": "latest",
|
||||
"cz-conventional-changelog": "latest",
|
||||
"eslint": "latest",
|
||||
"husky": "latest",
|
||||
"jiti": "latest",
|
||||
"jsdom": "latest",
|
||||
"nano-staged": "latest",
|
||||
"obsidian": "latest",
|
||||
"obsidian-dev-utils": "file:F:/tmp/obsidian-dev-utils-v2",
|
||||
"obsidian-test-mocks": "latest",
|
||||
"obsidian-typings": "obsidian-public-latest",
|
||||
"sass-embedded": "latest",
|
||||
"vitest": "latest"
|
||||
},
|
||||
"overrides": {
|
||||
"@antfu/utils": "9.2.0",
|
||||
"boolean": "npm:dry-uninstall",
|
||||
"dompurify": "3.0.1",
|
||||
"eslint": "latest",
|
||||
"type-fest": "latest",
|
||||
"typescript": "latest"
|
||||
"eslint": "^10.4.0",
|
||||
"type-fest": "^5.6.0",
|
||||
"typescript": "^6.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^21.0.1",
|
||||
"@commitlint/config-conventional": "^21.0.1",
|
||||
"@commitlint/types": "^21.0.1",
|
||||
"@obsidian-typings/obsidian-public-latest": "^6.3.0",
|
||||
"@total-typescript/ts-reset": "^0.6.1",
|
||||
"@tsconfig/strictest": "^2.0.8",
|
||||
"@types/node": "^25.8.0",
|
||||
"@vitest/coverage-v8": "^4.1.6",
|
||||
"better-typescript-lib": "^2.12.0",
|
||||
"czg": "^1.13.1",
|
||||
"eslint": "^10.4.0",
|
||||
"husky": "^9.1.7",
|
||||
"jiti": "^2.7.0",
|
||||
"jsdom": "^29.1.1",
|
||||
"nano-staged": "^1.0.2",
|
||||
"obsidian": "^1.12.3",
|
||||
"obsidian-dev-utils": "^65.0.1",
|
||||
"obsidian-test-mocks": "^2.0.3",
|
||||
"sass-embedded": "^1.99.0",
|
||||
"vitest": "^4.1.6"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import { exec } from 'obsidian-dev-utils/script-utils/exec';
|
||||
|
||||
await exec('cz');
|
||||
await exec('czg');
|
||||
|
|
|
|||
8
scripts/test-integration-android.ts
Normal file
8
scripts/test-integration-android.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import { wrapCliTask } from 'obsidian-dev-utils/script-utils/cli-utils';
|
||||
import { test } from 'obsidian-dev-utils/script-utils/test-runners/vitest';
|
||||
|
||||
await wrapCliTask(() =>
|
||||
test({
|
||||
projects: ['integration-tests:android']
|
||||
})
|
||||
);
|
||||
8
scripts/test-integration-desktop.ts
Normal file
8
scripts/test-integration-desktop.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import { wrapCliTask } from 'obsidian-dev-utils/script-utils/cli-utils';
|
||||
import { test } from 'obsidian-dev-utils/script-utils/test-runners/vitest';
|
||||
|
||||
await wrapCliTask(() =>
|
||||
test({
|
||||
projects: ['integration-tests:desktop']
|
||||
})
|
||||
);
|
||||
8
scripts/test-integration-no-app.ts
Normal file
8
scripts/test-integration-no-app.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import { wrapCliTask } from 'obsidian-dev-utils/script-utils/cli-utils';
|
||||
import { test } from 'obsidian-dev-utils/script-utils/test-runners/vitest';
|
||||
|
||||
await wrapCliTask(() =>
|
||||
test({
|
||||
projects: ['integration-tests:no-app']
|
||||
})
|
||||
);
|
||||
14
scripts/test-integration.ts
Normal file
14
scripts/test-integration.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { wrapCliTask } from 'obsidian-dev-utils/script-utils/cli-utils';
|
||||
import { test } from 'obsidian-dev-utils/script-utils/test-runners/vitest';
|
||||
|
||||
await wrapCliTask(async () => {
|
||||
await test({
|
||||
projects: ['integration-tests:no-app']
|
||||
});
|
||||
await test({
|
||||
projects: ['integration-tests:android']
|
||||
});
|
||||
await test({
|
||||
projects: ['integration-tests:desktop']
|
||||
});
|
||||
});
|
||||
8
scripts/test-watch.ts
Normal file
8
scripts/test-watch.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import { wrapCliTask } from 'obsidian-dev-utils/script-utils/cli-utils';
|
||||
import { testWatch } from 'obsidian-dev-utils/script-utils/test-runners/vitest';
|
||||
|
||||
await wrapCliTask(() =>
|
||||
testWatch({
|
||||
projects: ['unit-tests']
|
||||
})
|
||||
);
|
||||
|
|
@ -22,7 +22,7 @@ export const config = defineConfig({
|
|||
onConsoleLog: (): false => false,
|
||||
server: {
|
||||
deps: {
|
||||
inline: ['obsidian-typings']
|
||||
inline: ['@obsidian-typings', 'obsidian-dev-utils']
|
||||
}
|
||||
},
|
||||
setupFiles: ['obsidian-test-mocks/setup']
|
||||
|
|
|
|||
13
src/plugin.android.integration.test.ts
Normal file
13
src/plugin.android.integration.test.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { getTempVault } from 'obsidian-integration-testing/vitest-global-setup';
|
||||
import {
|
||||
describe,
|
||||
expect,
|
||||
it
|
||||
} from 'vitest';
|
||||
|
||||
describe('Smoke test', () => {
|
||||
it('should load plugin on Android', () => {
|
||||
const vault = getTempVault();
|
||||
expect(vault.path).toBeTruthy();
|
||||
});
|
||||
});
|
||||
13
src/plugin.desktop.integration.test.ts
Normal file
13
src/plugin.desktop.integration.test.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { getTempVault } from 'obsidian-integration-testing/vitest-global-setup';
|
||||
import {
|
||||
describe,
|
||||
expect,
|
||||
it
|
||||
} from 'vitest';
|
||||
|
||||
describe('Smoke test', () => {
|
||||
it('should load plugin on Desktop', () => {
|
||||
const vault = getTempVault();
|
||||
expect(vault.path).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -15,7 +15,7 @@ import type {
|
|||
ResultDom,
|
||||
ResultDomItem,
|
||||
ResultDomResult
|
||||
} from 'obsidian-typings';
|
||||
} from '@obsidian-typings/obsidian-public-latest';
|
||||
|
||||
import {
|
||||
MarkdownView,
|
||||
|
|
@ -26,10 +26,11 @@ import { getPrototypeOf } from 'obsidian-dev-utils/object-utils';
|
|||
import { registerPatch } from 'obsidian-dev-utils/obsidian/monkey-around';
|
||||
import { PluginSettingsTabComponent } from 'obsidian-dev-utils/obsidian/plugin/components/plugin-settings-tab-component';
|
||||
import { PluginBase } from 'obsidian-dev-utils/obsidian/plugin/plugin';
|
||||
import { PluginDataHandler } from 'obsidian-dev-utils/obsidian/data-handler';
|
||||
import {
|
||||
InternalPluginName,
|
||||
ViewType
|
||||
} from 'obsidian-typings/implementations';
|
||||
} from '@obsidian-typings/obsidian-public-latest/implementations';
|
||||
|
||||
import { PluginSettingsComponent } from './plugin-settings-component.ts';
|
||||
import { PluginSettingsTab } from './plugin-settings-tab.ts';
|
||||
|
|
@ -54,20 +55,15 @@ export class Plugin extends PluginBase {
|
|||
public constructor(app: App, manifest: PluginManifest) {
|
||||
super(app, manifest);
|
||||
|
||||
this.pluginSettingsComponent = this.registerComponent({
|
||||
component: new PluginSettingsComponent(this),
|
||||
shouldPreload: true
|
||||
});
|
||||
this.pluginSettingsComponent = this.addChild(new PluginSettingsComponent(new PluginDataHandler(this)));
|
||||
|
||||
this.registerComponent({
|
||||
component: new PluginSettingsTabComponent(
|
||||
this,
|
||||
new PluginSettingsTab({
|
||||
this.addChild(new PluginSettingsTabComponent({
|
||||
plugin: this,
|
||||
pluginSettingsTab: new PluginSettingsTab({
|
||||
plugin: this,
|
||||
settingsComponent: this.pluginSettingsComponent
|
||||
})
|
||||
)
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
1
src/styles/scss.d.ts
vendored
Normal file
1
src/styles/scss.d.ts
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
declare module '*.scss';
|
||||
|
|
@ -10,6 +10,7 @@
|
|||
"inlineSources": true,
|
||||
"lib": [
|
||||
"DOM",
|
||||
"DOM.Iterable",
|
||||
"ES2024"
|
||||
],
|
||||
"libReplacement": true,
|
||||
|
|
@ -21,7 +22,7 @@
|
|||
"types": [
|
||||
"@total-typescript/ts-reset",
|
||||
"node",
|
||||
"obsidian-typings"
|
||||
"@obsidian-typings/obsidian-public-latest"
|
||||
],
|
||||
"verbatimModuleSyntax": true
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue