Skip to content

Commit fda0a3f

Browse files
chore: merge main to sync lockfile with latest dependencies
- Resolves lockfile sync issue reported by user - Brings in new features: dataframe renderer, vega charts, SQL integration - Updates dependencies: @deepnote/blocks v1.2.0, react-vega, tailwindcss, etc.
2 parents a3c409b + 146cda4 commit fda0a3f

File tree

73 files changed

+12385
-13579
lines changed

Some content is hidden

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

73 files changed

+12385
-13579
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ jobs:
9696
permissions:
9797
id-token: write
9898
contents: read
99+
packages: read
99100
steps:
100101
- name: Checkout
101102
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5

.gitignore

Lines changed: 56 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,75 @@
1+
__pycache__
2+
!build/
3+
!src/test/pythonEnvironments/**/*.*
4+
!yarn.lock
15
.DS_Store
6+
.eslintcache
7+
.github_token
28
.huskyrc.json
3-
dist
4-
out
9+
.nyc_output
10+
.pytest_cache
11+
.python-version
12+
.qlty/cache
13+
.qlty/logs
14+
.qlty/out
15+
.qlty/plugin_cachedir
16+
.qlty/results
17+
.vs/
18+
.vscode-test
19+
.vscode-test-web
520
*.exe
6-
log.log
7-
**/node_modules
21+
*.i18n.json
22+
*.nls.*.json
23+
*.noseids
824
*.pyc
925
*.vsix
26+
*.xlf
27+
**/.mypy_cache/**
28+
**/.venv*/
29+
**/.vscode test/**
30+
**/.vscode-smoke/**
31+
**/.vscode-test/**
1032
**/.vscode/.ropeproject/**
33+
**/*.esbuild.meta.json
34+
**/node_modules
1135
**/testFiles/**/.cache/**
12-
*.noseids
13-
.nyc_output
14-
.vscode-test
15-
__pycache__
16-
npm-debug.log
17-
**/.mypy_cache/**
18-
!yarn.lock
36+
# Compilation of less to css
37+
# Esbuild files
38+
# Qlty cache directories
39+
# translation files
40+
bin/**
1941
coverage/
2042
cucumber-report.json
21-
**/.vscode-test/**
22-
**/.vscode test/**
23-
**/.vscode-smoke/**
24-
**/.venv*/
25-
port.txt
26-
precommit.hook
27-
pythonFiles/lib/**
2843
debug_coverage*/**
29-
languageServer/**
44+
debug*.log
45+
debugpy*.log
46+
dist
47+
l10n/
3048
languageServer.*/**
31-
bin/**
49+
languageServer/**
50+
log.log
3251
logs/**
52+
nodeLanguageServer.*/**
53+
nodeLanguageServer/**
54+
npm-debug.log
3355
obj/**
34-
.pytest_cache
35-
temp
36-
tmp
37-
src/test/datascience/tmp/**
38-
src/test/datascience/temp/**
39-
.python-version
40-
.vs/
41-
test-results*.xml
42-
testresults.json
43-
telemetry.json
44-
xunit-test-results.xml
45-
!build/
46-
debug*.log
47-
debugpy*.log
56+
out
57+
port.txt
58+
precommit.hook
4859
pydevd*.log
49-
vscode.d.ts
50-
vscode.proposed.*.d.ts
51-
nodeLanguageServer/**
52-
nodeLanguageServer.*/**
60+
pythonFiles/lib/**
5361
src/test/datascience/.venv*
54-
!src/test/pythonEnvironments/**/*.*
55-
.vscode-test-web
56-
.github_token
57-
# translation files
58-
*.xlf
59-
*.nls.*.json
60-
*.i18n.json
61-
l10n/
62-
# Esbuild files
63-
**/*.esbuild.meta.json
64-
# Compilation of less to css
62+
src/test/datascience/temp/**
63+
src/test/datascience/tmp/**
6564
src/webviews/webview-side/interactive-common/variableExplorerGrid.css
6665
src/webviews/webview-side/interactive-common/variableExplorerGrid.css.map
6766
src/webviews/webview-side/react-common/seti/seti.css
6867
src/webviews/webview-side/react-common/seti/seti.css.map
69-
# Qlty cache directories
70-
.qlty/cache
71-
.qlty/logs
72-
.qlty/out
73-
.qlty/plugin_cachedir
74-
.qlty/results
68+
telemetry.json
69+
temp
70+
test-results*.xml
71+
testresults.json
72+
tmp
73+
vscode.d.ts
74+
vscode.proposed.*.d.ts
75+
xunit-test-results.xml

.husky/post-checkout

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm ci

.husky/pre-commit

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1 @@
1-
#!/bin/sh
2-
if npm list prettier | grep -q prettier@ ; then
3-
echo husky - prettier is installed
4-
else
5-
echo husky - prettier is not installed, skipping format check
6-
exit 0
7-
fi
8-
9-
# run prettier on all .ts files that are in the commit
10-
changed=$(git diff --diff-filter=ACM --cached --name-only | grep .ts$ | tr '\n' ' ')
11-
12-
if [ -z "$changed" ]; then
13-
echo husky - No modified files to check
14-
exit 0
15-
fi
16-
17-
npx prettier $changed --check
1+
npm exec lint-staged

.husky/pre-push

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
branch_name="$(git symbolic-ref --short HEAD)"
2+
if [ "$branch_name" = "main" ]; then
3+
echo "Pushing directly to main is not allowed."
4+
exit 1
5+
fi

build/esbuild/build.ts

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import { lessLoader } from 'esbuild-plugin-less';
99
import fs from 'fs-extra';
1010
import { getZeroMQPreBuildsFoldersToKeep, getBundleConfiguration, bundleConfiguration } from '../webpack/common';
1111
import ImportGlobPlugin from 'esbuild-plugin-import-glob';
12+
import postcss from 'postcss';
13+
import tailwindcss from '@tailwindcss/postcss';
14+
import autoprefixer from 'autoprefixer';
1215
const plugin = require('node-stdlib-browser/helpers/esbuild/plugin');
1316
const stdLibBrowser = require('node-stdlib-browser');
1417

@@ -45,6 +48,8 @@ const commonExternals = [
4548
'vscode',
4649
'commonjs',
4750
'node:crypto',
51+
'node:fs/promises',
52+
'node:path',
4853
'vscode-jsonrpc', // Used by a few modules, might as well pull this out, instead of duplicating it in separate bundles.
4954
// Ignore telemetry specific packages that are not required.
5055
'applicationinsights-native-metrics',
@@ -86,7 +91,11 @@ const loader: { [ext: string]: Loader } = {
8691

8792
// https://github.com/evanw/esbuild/issues/20#issuecomment-802269745
8893
// https://github.com/hyrious/esbuild-plugin-style
89-
function style({ minify = true, charset = 'utf8' }: StylePluginOptions = {}): Plugin {
94+
function style({
95+
minify = true,
96+
charset = 'utf8',
97+
enableTailwind = false
98+
}: StylePluginOptions & { enableTailwind?: boolean } = {}): Plugin {
9099
return {
91100
name: 'style',
92101
setup({ onResolve, onLoad }) {
@@ -132,6 +141,32 @@ function style({ minify = true, charset = 'utf8' }: StylePluginOptions = {}): Pl
132141
}));
133142

134143
onLoad({ filter: /.*/, namespace: 'style-content' }, async (args) => {
144+
// Process with PostCSS/Tailwind if enabled and file exists
145+
if (enableTailwind && args.path.includes('tailwind.css') && fs.existsSync(args.path)) {
146+
try {
147+
const cssContent = await fs.readFile(args.path, 'utf8');
148+
const result = await postcss([tailwindcss, autoprefixer]).process(cssContent, {
149+
from: args.path,
150+
to: args.path
151+
});
152+
153+
const options = { ...opt, stdin: { contents: result.css, loader: 'css' } };
154+
options.loader = options.loader || {};
155+
// Add the same loaders we add for other places
156+
Object.keys(loader).forEach((key) => {
157+
if (options.loader && !options.loader[key]) {
158+
options.loader[key] = loader[key];
159+
}
160+
});
161+
const { errors, warnings, outputFiles } = await esbuild.build(options);
162+
return { errors, warnings, contents: outputFiles![0].text, loader: 'text' };
163+
} catch (error) {
164+
console.error(`PostCSS processing failed for ${args.path}:`, error);
165+
throw error;
166+
}
167+
}
168+
169+
// Default behavior for other CSS files
135170
const options = { entryPoints: [args.path], ...opt };
136171
options.loader = options.loader || {};
137172
// Add the same loaders we add for other places
@@ -140,7 +175,9 @@ function style({ minify = true, charset = 'utf8' }: StylePluginOptions = {}): Pl
140175
options.loader[key] = loader[key];
141176
}
142177
});
178+
143179
const { errors, warnings, outputFiles } = await esbuild.build(options);
180+
144181
return { errors, warnings, contents: outputFiles![0].text, loader: 'text' };
145182
});
146183
}
@@ -158,7 +195,9 @@ function createConfig(
158195
const plugins: Plugin[] = [];
159196
let define: SameShape<BuildOptions, BuildOptions>['define'] = undefined;
160197
if (target === 'web') {
161-
plugins.push(style());
198+
// Enable Tailwind processing for dataframe renderer
199+
const enableTailwind = source.includes(path.join('dataframe-renderer', 'index.ts'));
200+
plugins.push(style({ enableTailwind }));
162201
plugins.push(lessLoader());
163202

164203
define = {
@@ -287,6 +326,16 @@ async function buildAll() {
287326
),
288327
{ target: 'web', watch: watchAll }
289328
),
329+
build(
330+
path.join(extensionFolder, 'src', 'webviews', 'webview-side', 'dataframe-renderer', 'index.ts'),
331+
path.join(extensionFolder, 'dist', 'webviews', 'webview-side', 'dataframeRenderer', 'dataframeRenderer.js'),
332+
{ target: 'web', watch: isWatchMode }
333+
),
334+
build(
335+
path.join(extensionFolder, 'src', 'webviews', 'webview-side', 'vega-renderer', 'index.ts'),
336+
path.join(extensionFolder, 'dist', 'webviews', 'webview-side', 'vegaRenderer', 'vegaRenderer.js'),
337+
{ target: 'web', watch: isWatchMode }
338+
),
290339
build(
291340
path.join(extensionFolder, 'src', 'webviews', 'webview-side', 'variable-view', 'index.tsx'),
292341
path.join(extensionFolder, 'dist', 'webviews', 'webview-side', 'viewers', 'variableView.js'),
@@ -301,6 +350,11 @@ async function buildAll() {
301350
path.join(extensionFolder, 'src', 'webviews', 'webview-side', 'data-explorer', 'index.tsx'),
302351
path.join(extensionFolder, 'dist', 'webviews', 'webview-side', 'viewers', 'dataExplorer.js'),
303352
{ target: 'web', watch: watchAll }
353+
),
354+
build(
355+
path.join(extensionFolder, 'src', 'webviews', 'webview-side', 'integrations', 'index.tsx'),
356+
path.join(extensionFolder, 'dist', 'webviews', 'webview-side', 'integrations', 'index.js'),
357+
{ target: 'web', watch: watchAll }
304358
)
305359
);
306360

0 commit comments

Comments
 (0)