Skip to content

Commit a6e961c

Browse files
authored
VSCode Datalayer: Implement new lexical editor and update datalayer notebook (#405)
* Implement login and logout functionality * Add tree view support to browse datalayer spaces * Add documentation and typedoc and update runtime handling * Add support for lexical documents! * Improve handling of remote lexicals * WIP: Current state before collaboration branch * Reorganize code and add support for using datalayer runtimes with native notebooks * Reorganize code and add support for using datalayer runtimes with native notebooks * Enable collaboration on Lexicals * Improve UI for lexicals * Test notebook * Testing * Update spaces operations * Enable saving and loading for datalayer notebooks * Add vscode theme handling * More theming and resizing fixes! * More theme and notebook fixes! * Add CI workflows * Fixes for win ci and license headers * License headers * Update documentation and checks * fix: webpack build errors on Windows for .whl files - Add specific webpack rule for .whl (Python wheel) files - Ensures wheel files are handled as asset/resource type - Fixes build errors on Windows CI for pyodide kernel dependencies - Maintains compatibility with existing pypi resource handling * Add runtime selector
1 parent 8034171 commit a6e961c

Some content is hidden

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

69 files changed

+18129
-895
lines changed
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: VSCode - Code Quality
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'packages/vscode/**'
8+
- '.github/workflows/vscode-code-quality.yml'
9+
pull_request:
10+
branches: [main]
11+
paths:
12+
- 'packages/vscode/**'
13+
- '.github/workflows/vscode-code-quality.yml'
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
code-quality:
21+
name: Code Quality Checks
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '20'
34+
35+
- name: Install dependencies
36+
run: npm install
37+
38+
- name: Check code formatting with Prettier
39+
run: |
40+
echo "🎨 Checking code formatting with Prettier..."
41+
npx prettier --check "packages/vscode/**/*.{ts,tsx,js,jsx,json,md,css}" \
42+
--ignore-path .gitignore \
43+
--config .prettierrc.json 2>/dev/null || \
44+
npx prettier --check "packages/vscode/**/*.{ts,tsx,js,jsx,json,md,css}" \
45+
--ignore-path .gitignore
46+
47+
- name: Run ESLint
48+
run: |
49+
echo "🔍 Running ESLint checks..."
50+
npm run lint
51+
working-directory: packages/vscode
52+
53+
- name: Check for ESLint warnings
54+
run: |
55+
echo "⚠️ Checking for ESLint warnings (non-blocking)..."
56+
npx eslint src --max-warnings 0 || echo "::warning::ESLint warnings detected. Please review."
57+
working-directory: packages/vscode
58+
continue-on-error: true
59+
60+
- name: Verify package.json formatting
61+
run: |
62+
echo "📦 Verifying package.json formatting..."
63+
npx prettier --check package.json
64+
working-directory: packages/vscode
65+
66+
- name: Check for console.log statements
67+
run: |
68+
echo "🔎 Checking for console.log statements (excluding webview debug)..."
69+
if grep -r "console\.log" --include="*.ts" --include="*.tsx" \
70+
--exclude-dir="node_modules" --exclude-dir="dist" \
71+
--exclude-dir="out" --exclude-dir="webview" \
72+
packages/vscode/src; then
73+
echo "::warning::Found console.log statements in source code. Consider using VS Code's output channel instead."
74+
exit 1
75+
else
76+
echo "✅ No console.log statements found in source code"
77+
fi
78+
continue-on-error: true
79+
80+
- name: Check for TODO comments
81+
run: |
82+
echo "📝 Checking for TODO comments..."
83+
if grep -r "TODO\|FIXME\|HACK" --include="*.ts" --include="*.tsx" \
84+
--exclude-dir="node_modules" --exclude-dir="dist" \
85+
--exclude-dir="out" \
86+
packages/vscode; then
87+
echo "::notice::Found TODO/FIXME/HACK comments. Please review and address if needed."
88+
else
89+
echo "✅ No TODO/FIXME/HACK comments found"
90+
fi
91+
continue-on-error: true
92+
93+
- name: Verify import ordering
94+
run: |
95+
echo "📚 Checking import statement ordering..."
96+
npx eslint src --rule 'import/order: error' --max-warnings 0 || \
97+
echo "::warning::Import ordering issues detected. Consider organizing imports."
98+
working-directory: packages/vscode
99+
continue-on-error: true
100+
101+
- name: Generate code quality report
102+
if: always()
103+
run: |
104+
echo "## 📊 Code Quality Report" >> $GITHUB_STEP_SUMMARY
105+
echo "" >> $GITHUB_STEP_SUMMARY
106+
echo "### Checks Performed" >> $GITHUB_STEP_SUMMARY
107+
echo "- ✅ Prettier formatting" >> $GITHUB_STEP_SUMMARY
108+
echo "- ✅ ESLint rules" >> $GITHUB_STEP_SUMMARY
109+
echo "- ✅ Package.json formatting" >> $GITHUB_STEP_SUMMARY
110+
echo "- ⚠️ Console.log detection (warning)" >> $GITHUB_STEP_SUMMARY
111+
echo "- ℹ️ TODO/FIXME comments (informational)" >> $GITHUB_STEP_SUMMARY
112+
echo "- ⚠️ Import ordering (warning)" >> $GITHUB_STEP_SUMMARY
113+
echo "" >> $GITHUB_STEP_SUMMARY
114+
echo "### Next Steps" >> $GITHUB_STEP_SUMMARY
115+
echo "Run \`npm run lint:fix\` locally to automatically fix most issues" >> $GITHUB_STEP_SUMMARY
Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
name: VSCode - Documentation
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'packages/vscode/**'
8+
- '.github/workflows/vscode-documentation.yml'
9+
pull_request:
10+
branches: [main]
11+
paths:
12+
- 'packages/vscode/**'
13+
- '.github/workflows/vscode-documentation.yml'
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
build-docs:
21+
name: Build Documentation
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '20'
34+
35+
- name: Install dependencies
36+
run: npm install
37+
38+
- name: Build React package (required for type dependencies)
39+
run: |
40+
echo "📦 Building React package for type dependencies..."
41+
npm run build
42+
working-directory: packages/react
43+
44+
- name: Check TypeDoc documentation coverage
45+
run: |
46+
echo "🔍 Checking documentation coverage with TypeDoc..."
47+
npm run doc:coverage || true
48+
working-directory: packages/vscode
49+
continue-on-error: true
50+
51+
- name: Generate TypeDoc HTML documentation
52+
run: |
53+
echo "📚 Generating TypeDoc HTML documentation with coverage..."
54+
npm run doc
55+
56+
# Display coverage if available
57+
if [ -f "docs/coverage.json" ]; then
58+
echo "📊 TypeDoc Coverage Report:"
59+
cat docs/coverage.json | python3 -m json.tool
60+
61+
# Extract coverage percentage
62+
COVERAGE=$(cat docs/coverage.json | python3 -c "import json, sys; data = json.load(sys.stdin); print(data.get('percent', 0))")
63+
echo "Documentation Coverage: ${COVERAGE}%"
64+
fi
65+
working-directory: packages/vscode
66+
67+
- name: Generate TypeDoc Markdown documentation
68+
run: |
69+
echo "📝 Generating TypeDoc Markdown documentation..."
70+
npm run doc:markdown
71+
working-directory: packages/vscode
72+
73+
- name: Verify documentation output
74+
run: |
75+
echo "🔍 Verifying documentation was generated..."
76+
if [ -d "packages/vscode/docs" ]; then
77+
echo "✅ HTML documentation generated successfully"
78+
echo "Files generated: $(find packages/vscode/docs -type f | wc -l)"
79+
else
80+
echo "❌ HTML documentation generation failed"
81+
exit 1
82+
fi
83+
84+
if [ -d "packages/vscode/docs-markdown" ]; then
85+
echo "✅ Markdown documentation generated successfully"
86+
echo "Files generated: $(find packages/vscode/docs-markdown -type f | wc -l)"
87+
else
88+
echo "❌ Markdown documentation generation failed"
89+
exit 1
90+
fi
91+
92+
- name: Upload HTML documentation artifact
93+
uses: actions/upload-artifact@v4
94+
with:
95+
name: vscode-docs-html
96+
path: packages/vscode/docs/
97+
retention-days: 30
98+
if-no-files-found: error
99+
100+
- name: Upload Markdown documentation artifact
101+
uses: actions/upload-artifact@v4
102+
with:
103+
name: vscode-docs-markdown
104+
path: packages/vscode/docs-markdown/
105+
retention-days: 30
106+
if-no-files-found: error
107+
108+
- name: Generate documentation coverage report
109+
run: |
110+
echo "📊 Analyzing documentation coverage..."
111+
112+
# Get TypeDoc coverage data if available
113+
if [ -f "packages/vscode/docs/coverage.json" ]; then
114+
echo "Using TypeDoc coverage data..."
115+
COVERAGE=$(cat packages/vscode/docs/coverage.json | python3 -c "import json, sys; data = json.load(sys.stdin); print(int(data.get('percent', 0)))")
116+
EXPECTED=$(cat packages/vscode/docs/coverage.json | python3 -c "import json, sys; data = json.load(sys.stdin); print(data.get('expected', 0))")
117+
ACTUAL=$(cat packages/vscode/docs/coverage.json | python3 -c "import json, sys; data = json.load(sys.stdin); print(data.get('actual', 0))")
118+
NOT_DOCUMENTED=$(cat packages/vscode/docs/coverage.json | python3 -c "import json, sys; data = json.load(sys.stdin); print(len(data.get('notDocumented', [])))")
119+
else
120+
# Fallback to file counting
121+
TS_FILES=$(find packages/vscode/src -name "*.ts" -o -name "*.tsx" | wc -l)
122+
DOCUMENTED_FILES=$(grep -l "@module\|@description" --include="*.ts" --include="*.tsx" -r packages/vscode/src | wc -l || echo "0")
123+
124+
if [ $TS_FILES -gt 0 ]; then
125+
COVERAGE=$((DOCUMENTED_FILES * 100 / TS_FILES))
126+
else
127+
COVERAGE=0
128+
fi
129+
EXPECTED=$TS_FILES
130+
ACTUAL=$DOCUMENTED_FILES
131+
NOT_DOCUMENTED=$((TS_FILES - DOCUMENTED_FILES))
132+
fi
133+
134+
echo "Documentation coverage: ${COVERAGE}%"
135+
echo "Expected items: $EXPECTED"
136+
echo "Documented items: $ACTUAL"
137+
echo "Missing documentation: $NOT_DOCUMENTED"
138+
139+
# Add to GitHub Step Summary
140+
echo "## 📚 Documentation Build Report" >> $GITHUB_STEP_SUMMARY
141+
echo "" >> $GITHUB_STEP_SUMMARY
142+
echo "### Coverage Statistics (TypeDoc)" >> $GITHUB_STEP_SUMMARY
143+
echo "- **Coverage**: ${COVERAGE}%" >> $GITHUB_STEP_SUMMARY
144+
echo "- **Documented Items**: $ACTUAL / $EXPECTED" >> $GITHUB_STEP_SUMMARY
145+
echo "- **Missing Documentation**: $NOT_DOCUMENTED items" >> $GITHUB_STEP_SUMMARY
146+
echo "" >> $GITHUB_STEP_SUMMARY
147+
148+
if [ $COVERAGE -eq 100 ]; then
149+
echo "🎉 **Perfect**: 100% documentation coverage!" >> $GITHUB_STEP_SUMMARY
150+
elif [ $COVERAGE -ge 90 ]; then
151+
echo "✅ **Excellent**: Documentation coverage is above 90%" >> $GITHUB_STEP_SUMMARY
152+
elif [ $COVERAGE -ge 80 ]; then
153+
echo "✅ **Good**: Documentation coverage is above 80%" >> $GITHUB_STEP_SUMMARY
154+
elif [ $COVERAGE -ge 70 ]; then
155+
echo "📈 **Fair**: Consider improving documentation coverage to reach 80%" >> $GITHUB_STEP_SUMMARY
156+
else
157+
echo "⚠️ **Warning**: Documentation coverage is below 70%" >> $GITHUB_STEP_SUMMARY
158+
fi
159+
160+
# Add coverage badge info if available
161+
if [ -f "packages/vscode/docs/coverage.svg" ]; then
162+
echo "" >> $GITHUB_STEP_SUMMARY
163+
echo "### Coverage Badge" >> $GITHUB_STEP_SUMMARY
164+
echo "A coverage badge has been generated and is available in the artifacts." >> $GITHUB_STEP_SUMMARY
165+
fi
166+
continue-on-error: true
167+
168+
- name: Check for missing JSDoc comments
169+
run: |
170+
echo "🔎 Checking for exported functions without JSDoc..."
171+
172+
# Find exported functions without preceding JSDoc
173+
MISSING_DOCS=$(grep -B2 "^export.*function\|^export.*class\|^export.*interface" --include="*.ts" --include="*.tsx" -r packages/vscode/src | \
174+
grep -v "/\*\*" | \
175+
grep "export" | \
176+
head -10 || true)
177+
178+
if [ -n "$MISSING_DOCS" ]; then
179+
echo "⚠️ Found exports potentially missing JSDoc comments:"
180+
echo "$MISSING_DOCS"
181+
echo "" >> $GITHUB_STEP_SUMMARY
182+
echo "### ⚠️ Exports Missing Documentation" >> $GITHUB_STEP_SUMMARY
183+
echo "Some exported items may be missing JSDoc comments. Run \`npm run doc\` locally to verify." >> $GITHUB_STEP_SUMMARY
184+
else
185+
echo "✅ All exports appear to have documentation"
186+
fi
187+
continue-on-error: true
188+
189+
- name: Generate documentation summary
190+
if: always()
191+
run: |
192+
echo "" >> $GITHUB_STEP_SUMMARY
193+
echo "### 📦 Documentation Artifacts" >> $GITHUB_STEP_SUMMARY
194+
echo "- **HTML Documentation**: Available as \`vscode-docs-html\` artifact" >> $GITHUB_STEP_SUMMARY
195+
echo "- **Markdown Documentation**: Available as \`vscode-docs-markdown\` artifact" >> $GITHUB_STEP_SUMMARY
196+
echo "" >> $GITHUB_STEP_SUMMARY
197+
echo "### 💡 Next Steps" >> $GITHUB_STEP_SUMMARY
198+
echo "1. Download the documentation artifacts from this workflow run" >> $GITHUB_STEP_SUMMARY
199+
echo "2. Review the HTML docs by opening \`index.html\` in a browser" >> $GITHUB_STEP_SUMMARY
200+
echo "3. Use the Markdown docs for integration with other documentation systems" >> $GITHUB_STEP_SUMMARY
201+
echo "" >> $GITHUB_STEP_SUMMARY
202+
echo "### 🔧 Local Documentation" >> $GITHUB_STEP_SUMMARY
203+
echo "To generate documentation locally:" >> $GITHUB_STEP_SUMMARY
204+
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
205+
echo "cd packages/vscode" >> $GITHUB_STEP_SUMMARY
206+
echo "npm run doc # HTML docs with coverage" >> $GITHUB_STEP_SUMMARY
207+
echo "npm run doc:markdown # Markdown docs" >> $GITHUB_STEP_SUMMARY
208+
echo "npm run doc:coverage # Check coverage only" >> $GITHUB_STEP_SUMMARY
209+
echo "npm run doc:watch # Watch mode" >> $GITHUB_STEP_SUMMARY
210+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)