Skip to content

Commit

Permalink
Upload styles.css
Browse files Browse the repository at this point in the history
  • Loading branch information
catacgc committed Sep 28, 2024
1 parent d83c830 commit eafb7cc
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,13 @@ jobs:
asset_path: ./manifest.json
asset_name: manifest.json
asset_content_type: application/json
- name: Upload styles.css
id: styles
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./styles.css
asset_name: styles.css
asset_content_type: text/css
11 changes: 11 additions & 0 deletions manifest-beta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"id": "tree-search",
"name": "Tree Search",
"version": "0.0.12",
"minAppVersion": "0.15.0",
"description": "Quickly search hierarchical line trees in Obsidian",
"author": "Catalin Costache",
"authorUrl": "https://github.com/catacgc",
"fundingUrl": "https://github.com/sponsors/catacgc",
"isDesktopOnly": false
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-tree-search",
"version": "0.0.12",
"version": "0.0.14",
"description": "Quickly search trees of lines in Obsidian",
"main": "main.js",
"scripts": {
Expand All @@ -11,6 +11,8 @@
"build:esbuild": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
"build": "npm run build:css && npm run build:esbuild",
"version": "node version-bump.mjs && git add manifest.json versions.json",
"version:beta": "node version-bump.mjs && git add manifest.json versions.json",
"release:beta": "npm run version:beta && git commit -m 'release:beta' && git push origin main:main && git tag -a $npm_package_version -m \"$npm_package_version\" && git push --tags",
"test": "jest",
"test:watch": "jest --watch"
},
Expand Down
3 changes: 2 additions & 1 deletion src/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ export class NotesGraph {
}

private pruneDanglingNodes(node: string) {
if (this.graph.inDegree(node) == 0) {
const attributes = this.graph.getNodeAttributes(node)
if (this.graph.inDegree(node) == 0 && attributes.nodeType != "page") {
const outgoingRefs = this.graph.outNeighbors(node)
this.graph.dropNode(node)
for (const ref of outgoingRefs) {
Expand Down
19 changes: 19 additions & 0 deletions tests/edit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,23 @@ describe('edit capabilities, graph updates', () => {
[[Node1]]
`)
})

it('should not delete nodes from parent', () => {
const graph = fixture(`
File.md
- [[Node]]`,`
Child.md,{"parent": ["[[File]]"]}
- [[Node2]]`,`
Child.md,{"parent": ["[[File]]"]}
- [[Node3]]`
);

testSearchEquals(graph, 'File', `
[[File]]
[[Node]]
[[Child]]
[[Node3]]
`)
})

});
14 changes: 14 additions & 0 deletions version-bump-beta.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { readFileSync, writeFileSync } from "fs";

const targetVersion = process.env.npm_package_version;

// read minAppVersion from manifest-beta.json and bump version to target version
let manifest = JSON.parse(readFileSync("manifest-beta.json", "utf8"));
const { minAppVersion } = manifest;
manifest.version = targetVersion;
writeFileSync("manifest-beta.json", JSON.stringify(manifest, null, "\t"));

// update versions.json with target version and minAppVersion from manifest-beta.json
let versions = JSON.parse(readFileSync("versions.json", "utf8"));
versions[targetVersion] = minAppVersion;
writeFileSync("versions.json", JSON.stringify(versions, null, "\t"));

0 comments on commit eafb7cc

Please sign in to comment.