Skip to content

Commit bdf574d

Browse files
trangdoan982mdroidian
authored andcommitted
parent 6080afb
author Trang Doan <[email protected]> 1744314525 -0400 committer Michael Gartner <[email protected]> 1747354088 -0600 ENG-96 Create new relationship between nodes (#115) * instantiate new relationship worked * fix * address PR comments * fix bi-directional update issues * show only compatible node type options * small fix * breakdown the components. use datacore * working * address PR comments * improve search by only allowing compatible node results * . * rm dataview --------- Co-authored-by: Michael Gartner <[email protected]> Move llm-api endpoints to vercel serverless (#102) * testing gemini * move endgoint to website * open ai endpoint * added anthropic endpoint * pass env vars * add cors handdling and options * . * using centralised cors middleware * only adding bypass cookie * use right key * remove the bypass token requirement * sanitize, fix routes * remove server action config * DRY * remove unused * address review * adress review Roam: Add feedback toggle (#118) * add settings to hide or show button, also works when disabled or enabled midway * review * . --------- Co-authored-by: Michael Gartner <[email protected]> [ENG-197] Fix creating link with invalid chars (#121) * fix creating link with invalid chars * placeholder update --------- Co-authored-by: Michael Gartner <[email protected]> Roam: Add feedback button to settings menu - ENG-147 (#122) * add button to bottom right, don't hide sdk css, tested * remove intent not working git * remove ts-ignore and use a better type def * remove styling Update NodeConfig to use new UIDs for DiscourseNodeIndex and DiscourseNodeSpecification components (#126) Roam: Add PostHog user identification for enhanced analytics tracking using user's roam UID as the unique identifier - ENG-177 (#123) * add posthog identify * remove username and email to keep it anonymus * double userUid and best practice for js Roam: Discourse Context Overlay - remove queue and arbitrary delay (#127) * Refactor getOverlayInfo to use async/await and improve error handling. Update cache key from title to tag and remove overlayQueue logic for cleaner implementation. * Remove experimental getOverlayInfo function * Remove unused refreshUi logic [ENG-44] Display relations (#116) * instantiate new relationship worked * add display relations * remove dv * sm fix [ENG-198] Filtered out related file in search (#125) * filtered out related file * fix some naming [ENG-97] Use TailwindCSS in obsidian app (#128) * Update Obsidian app to integrate Tailwind CSS with PostCSS and Autoprefixer support - Added Tailwind CSS, PostCSS, and Autoprefixer to package dependencies - Configured styles.css to include Tailwind directives - Enhanced compile script to process styles using PostCSS with Tailwind and Autoprefixer * delete irrelevant package [ENG-192] Change all existing styles to using tw (#129) * Update Obsidian app to integrate Tailwind CSS with PostCSS and Autoprefixer support - Added Tailwind CSS, PostCSS, and Autoprefixer to package dependencies - Configured styles.css to include Tailwind directives - Enhanced compile script to process styles using PostCSS with Tailwind and Autoprefixer * delete irrelevant package * changing all styles to tailwindcss * Update Obsidian app to integrate Tailwind CSS with PostCSS and Autoprefixer support - Added Tailwind CSS, PostCSS, and Autoprefixer to package dependencies - Configured styles.css to include Tailwind directives - Enhanced compile script to process styles using PostCSS with Tailwind and Autoprefixer * delete irrelevant package * changing all styles to tailwindcss --------- Co-authored-by: Michael Gartner <[email protected]> Roam: Bug-fix: Don't let user create discourse nodes with empty text using node context menu - ENG-171 (#130) * functional covering all three cases tested locally * apply coderabbit review suggestion * better approach one that I understand and can reason about * accidental removal of onClose Update Roam app version to 0.13.0 in package.json and package-lock.json (#134) [ENG-204] Move from localStorage to extensionAPI.settings (#133) * cur progress * address PR comments * kinda works. need to test more * small fix * address PR comments . Create publish-obsidian.yml Update publish-obsidian.yml Update publish-obsidian.yml Update publish-obsidian.yml Enhance DiscourseContextOverlay: Update button styles to include loading state and improve score/ref display during loading. Use placeholders for score and refs when loading. (#136) . Update publish-obsidian.yml Update publish-obsidian.yml Update publish-obsidian.yml Update publish-obsidian.yml Refactor ExportDialog: Remove discourseGraphEnabled state and simplify FormGroup visibility logic. Set includeDiscourseContext to false by default. (#139) Enhance LabelDialog: Add confirmText to return object for improved button text handling based on action type. (#141) Additional styles / cursor rules (#142) * Update STYLE_GUIDE.md and main.mdc: Add guideline for utilizing utility functions for reusable logic and common operations. * Update STYLE_GUIDE.md and main.mdc: Add guideline to prefer arrow functions over regular function declarations. * Update main.mdc: Add guideline to prefer Tailwind classes when refactoring inline styles. * Update STYLE_GUIDE.md and main.mdc: Add guideline to prefer early returns over nested conditionals for improved readability. Roam: When a user deletes a node also delete all the corresponding relations to the node - ENG-26 (#149) * ask user for confirmation, delete corresponding relations * address review * address review * address comments [ENG-301] Create node in right-click menu (#152) * create node in right-click menu * small fix * address PR comments * address PR comments add readme and remove sample commands remove sample editor command rm space minor fixes Roam: Bug fix - Insert Discourse Node after creation (#154) * remove focus after menu select to allow updateBlock to work * add clarifying comment [ENG-308] Add command to open DG settings (#158) * add command to open DG settings * edit comment ENG-322 - Switch from MIT to Apache 2.0 license (#156) * Switch from MIT to Apache 2.0 license * copyright discourse graphs * rm liscense from apps/roam --------- Co-authored-by: Michael Gartner <[email protected]> initial port [ENG-207] Move Github sync setting to individual nodes (#124) * current progress * improve in UI: if sync is turned off then also turn off the comments configuration * address PR comments * revert graphOverviewUid bug * revert graphOverviewUid bug - getDiscourseNodes * avoid racing conditions for github sync * nested settings * temp fix to race condition * remove unecessary DOM and match existing styles --------- Co-authored-by: Michael Gartner <[email protected]> Eng 286 show when GitHub sync is disabled globally (#143) * Refactor GitHub Sync settings in NodeConfig and GeneralSettings components - Updated the onChange handler for GitHub Sync to use async/await and added a timeout for refreshing the config tree. - Introduced a global settings check in NodeConfig to conditionally render the GitHub Sync checkbox and comments configuration. - Passed setMainTab prop to NodeConfig for better navigation control. This improves the user experience by ensuring that settings are updated correctly and provides clear feedback when global settings are disabled. * matchingNode fix . Refactor Export components to use getSetting for consistent settings retrieval - Updated ExportDialog and ExportGithub components to replace localStorageGet with getSetting for fetching GitHub OAuth and repository settings. - Modified extensionSettings utility functions to use arrow functions and provide a default value for getSetting. - Improved code readability and maintainability by standardizing the method of accessing settings. Eng 286 show when GitHub sync is disabled globally (#143) * Refactor GitHub Sync settings in NodeConfig and GeneralSettings components - Updated the onChange handler for GitHub Sync to use async/await and added a timeout for refreshing the config tree. - Introduced a global settings check in NodeConfig to conditionally render the GitHub Sync checkbox and comments configuration. - Passed setMainTab prop to NodeConfig for better navigation control. This improves the user experience by ensuring that settings are updated correctly and provides clear feedback when global settings are disabled. * matchingNode fix .
1 parent 6080afb commit bdf574d

File tree

79 files changed

+2643
-679
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+2643
-679
lines changed

.cursor/rules/main.mdc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ description:
33
globs:
44
alwaysApply: true
55
---
6-
76
You are an expert senior software engineer specializing in modern web development, with deep expertise in TypeScript, React, Next.js (App Router), and Tailwind CSS. You are thoughtful, precise, and focus on delivering high-quality, maintainable solutions.
87

98
This repository uses Turborepo.
@@ -28,6 +27,7 @@ This repository uses Turborepo.
2827
### UI Guidelines
2928

3029
- Use Tailwind CSS for styling where possible
30+
- When refactoring inline styles, use tailwind classes
3131
- Use platform-native UI components (see below) first with shadcn/ui as a fallback
3232
- Maintain visual consistency with the host application's design system
3333
- Follow responsive design principles
@@ -37,6 +37,7 @@ This repository uses Turborepo.
3737
- Prefer `type` over `interface`
3838
- Use explicit return types for functions
3939
- Avoid `any` types when possible
40+
- Prefer arrow functions over regular function declarations
4041

4142
### Code Formatting
4243

@@ -50,6 +51,8 @@ This repository uses Turborepo.
5051

5152
- Prefer small, focused functions over inline code
5253
- Extract complex logic into well-named functions
53-
- Function names should describe their purpose clearly:
54-
- Choose descriptive function names that make comments unnecessary:
55-
- Break down complex operations into smaller, meaningful functions:
54+
- Function names should describe their purpose clearly
55+
- Choose descriptive function names that make comments unnecessary
56+
- Break down complex operations into smaller, meaningful functions
57+
- Prefer early returns over nested conditionals for better readability
58+
- Prefer util functions for reusable logic and common operations
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
name: Publish Obsidian Plugin
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version to publish (e.g., 0.1.0-beta.1)'
8+
required: true
9+
create_release:
10+
description: 'Create a GitHub release'
11+
type: boolean
12+
default: true
13+
is_prerelease:
14+
description: 'Mark as pre-release'
15+
type: boolean
16+
default: true
17+
env:
18+
OBSIDIAN_PLUGIN_REPO_TOKEN: ${{ secrets.OBSIDIAN_PLUGIN_REPO_TOKEN }}
19+
20+
jobs:
21+
build-and-publish:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout monorepo
25+
uses: actions/checkout@v3
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v3
29+
with:
30+
node-version: 18
31+
cache: 'npm'
32+
33+
- name: Install dependencies
34+
run: npm install
35+
36+
- name: Build Obsidian plugin
37+
run: |
38+
# Run the build using turbo
39+
echo "Running Obsidian build with Turborepo..."
40+
npx turbo run build --filter=@discourse-graphs/obsidian
41+
42+
# Debug the current directory structure
43+
echo "Current workspace directory: $(pwd)"
44+
echo "Directory structure after build:"
45+
find . -type d -name "dist" | sort
46+
47+
# Find all main.js files to understand possible build outputs
48+
echo "Finding potential build artifacts:"
49+
find . -name "main.js" | sort
50+
find . -name "styles.css" | sort
51+
find . -name "manifest.json" | sort
52+
53+
- name: Prepare repository content
54+
run: |
55+
# Create temporary directory
56+
mkdir -p temp-repo
57+
58+
# Based on examining compile.ts, the build outputs should be in:
59+
# - apps/obsidian/dist/main.js
60+
# - apps/obsidian/dist/styles.css
61+
# - apps/obsidian/dist/manifest.json
62+
63+
# Debug the build output locations
64+
echo "Build output locations:"
65+
for file in main.js styles.css manifest.json; do
66+
echo "Looking for $file in dist directories:"
67+
find . -path "*/dist/$file" | sort
68+
done
69+
70+
# Find the most likely build output directory
71+
BUILD_DIR=$(find . -path "*/dist/main.js" -exec dirname {} \; | head -n 1)
72+
if [ -n "$BUILD_DIR" ]; then
73+
echo "Found build directory: $BUILD_DIR"
74+
echo "Contents of $BUILD_DIR:"
75+
ls -la "$BUILD_DIR"
76+
77+
# Copy files from the build directory
78+
echo "Copying build files to temp-repo..."
79+
cp "$BUILD_DIR"/main.js temp-repo/ || echo "Error copying main.js"
80+
cp "$BUILD_DIR"/styles.css temp-repo/ || echo "Error copying styles.css (might not exist if no styles)"
81+
cp "$BUILD_DIR"/manifest.json temp-repo/ || echo "Error copying manifest.json"
82+
else
83+
echo "No build directory with main.js found! Detailed search results:"
84+
find . -name "main.js" -ls
85+
86+
# Try to find the files individually as a fallback
87+
echo "Attempting to locate files individually as fallback..."
88+
MAIN_JS=$(find . -name "main.js" | grep -v "node_modules" | head -n 1)
89+
STYLES_CSS=$(find . -name "styles.css" | grep -v "node_modules" | head -n 1)
90+
MANIFEST_JSON=$(find . -name "manifest.json" | grep -v "node_modules" | head -n 1)
91+
92+
if [ -n "$MAIN_JS" ]; then
93+
echo "Found main.js at: $MAIN_JS"
94+
cp "$MAIN_JS" temp-repo/
95+
else
96+
echo "ERROR: Could not find main.js!"
97+
exit 1
98+
fi
99+
100+
if [ -n "$STYLES_CSS" ]; then
101+
echo "Found styles.css at: $STYLES_CSS"
102+
cp "$STYLES_CSS" temp-repo/
103+
else
104+
echo "Warning: Could not find styles.css (this might be ok if the plugin has no styles)"
105+
fi
106+
107+
if [ -n "$MANIFEST_JSON" ]; then
108+
echo "Found manifest.json at: $MANIFEST_JSON"
109+
cp "$MANIFEST_JSON" temp-repo/
110+
else
111+
echo "ERROR: Could not find manifest.json!"
112+
exit 1
113+
fi
114+
fi
115+
116+
echo "Copying Obsidian files"
117+
cp -r apps/obsidian/* temp-repo/ || echo "Warning: Some files could not be copied"
118+
119+
echo "Removing node_modules and dist directories from temp-repo..."
120+
rm -rf temp-repo/node_modules temp-repo/dist
121+
122+
# Display the directory structure after cleaning
123+
echo "Directory structure in temp-repo after cleaning:"
124+
find temp-repo -type d | sort
125+
126+
127+
# Update version in manifest.json
128+
if [ -f "temp-repo/manifest.json" ]; then
129+
jq '.version = "${{ github.event.inputs.version }}"' temp-repo/manifest.json > temp.json && mv temp.json temp-repo/manifest.json
130+
echo "Updated manifest.json with version ${{ github.event.inputs.version }}"
131+
else
132+
echo "ERROR: manifest.json not found in temp-repo!"
133+
exit 1
134+
fi
135+
136+
# Verify the final content
137+
echo "Final contents of temp-repo:"
138+
ls -la temp-repo
139+
140+
- name: Push to Obsidian plugin repository
141+
uses: cpina/github-action-push-to-another-repository@main
142+
env:
143+
API_TOKEN_GITHUB: ${{ secrets.OBSIDIAN_PLUGIN_REPO_TOKEN }}
144+
with:
145+
source-directory: 'temp-repo'
146+
destination-github-username: 'DiscourseGraphs'
147+
destination-repository-name: 'discourse-graph-obsidian'
148+
user-email: '[email protected]'
149+
target-branch: main
150+
151+
- name: Create Release
152+
if: ${{ github.event.inputs.create_release == 'true' }}
153+
uses: softprops/action-gh-release@v1
154+
with:
155+
repository: 'DiscourseGraphs/discourse-graph-obsidian'
156+
token: ${{ secrets.OBSIDIAN_PLUGIN_REPO_TOKEN }}
157+
tag_name: v${{ github.event.inputs.version }}
158+
name: Discourse Graph v${{ github.event.inputs.version }}
159+
draft: false
160+
prerelease: ${{ github.event.inputs.is_prerelease }}
161+
files: |
162+
temp-repo/main.js
163+
temp-repo/manifest.json
164+
temp-repo/styles.css
165+
166+
- name: Update version in manifest.json
167+
run: |
168+
jq '.version = "${{ github.event.inputs.version }}"' apps/obsidian/manifest.json > temp.json && mv temp.json apps/obsidian/manifest.json
169+
echo "Updated manifest.json with version ${{ github.event.inputs.version }}"

0 commit comments

Comments
 (0)