Skip to content

Commit 3143b2a

Browse files
committed
merge main
2 parents 8e2fa6f + f5cec10 commit 3143b2a

File tree

74 files changed

+10487
-10628
lines changed

Some content is hidden

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

74 files changed

+10487
-10628
lines changed

.eslintcache

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

.github/actions/create-venv-for-tests/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ runs:
1616
using: 'composite'
1717
steps:
1818
- name: Install uv
19-
uses: astral-sh/setup-uv@v6
19+
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6
2020

2121
# Used by tests for installation of ipykernel.
2222
# Create a venv & register it as a kernel.

.github/workflows/ci.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ jobs:
2626
timeout-minutes: 15
2727
steps:
2828
- name: Checkout
29-
uses: actions/checkout@v5
29+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
3030

3131
- name: Setup Node.js
32-
uses: actions/setup-node@v5
32+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
3333
with:
3434
cache: 'npm'
3535
node-version: ${{ env.NODE_VERSION }}
@@ -53,10 +53,10 @@ jobs:
5353
timeout-minutes: 15
5454
steps:
5555
- name: Checkout
56-
uses: actions/checkout@v5
56+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
5757

5858
- name: Setup Node.js
59-
uses: actions/setup-node@v5
59+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
6060
with:
6161
cache: 'npm'
6262
node-version: ${{ env.NODE_VERSION }}
@@ -78,10 +78,10 @@ jobs:
7878

7979
steps:
8080
- name: Checkout code
81-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
81+
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493
8282

8383
- name: Install qlty
84-
uses: qltysh/qlty-action/install@a2277a908db90c4c868832fb9204521fb940fdb4
84+
uses: qltysh/qlty-action/install@a19242102d17e497f437d7466aa01b528537e899
8585

8686
- name: Run qlty check
8787
run: qlty check
@@ -96,12 +96,13 @@ jobs:
9696
permissions:
9797
id-token: write
9898
contents: read
99+
packages: read
99100
steps:
100101
- name: Checkout
101-
uses: actions/checkout@v5
102+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
102103

103104
- name: Setup Node.js
104-
uses: actions/setup-node@v5
105+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
105106
with:
106107
cache: 'npm'
107108
node-version: ${{ env.NODE_VERSION }}
@@ -122,15 +123,15 @@ jobs:
122123
VSC_JUPYTER_INSTRUMENT_CODE_FOR_COVERAGE: true
123124

124125
- name: Upload coverage to Codecov
125-
uses: codecov/codecov-action@v5
126+
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5
126127
with:
127128
use_oidc: true
128129
files: coverage/lcov.info
129130
fail_ci_if_error: true
130131

131132
- name: Upload test results to Codecov
132133
if: '!cancelled()'
133-
uses: codecov/test-results-action@v1
134+
uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # v1
134135
with:
135136
use_oidc: true
136137
files: test-results.xml
@@ -148,10 +149,10 @@ jobs:
148149
runs-on: ubuntu-latest
149150
steps:
150151
- name: Checkout
151-
uses: actions/checkout@v5
152+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
152153

153154
- name: Setup Node.js
154-
uses: actions/setup-node@v5
155+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
155156
with:
156157
cache: 'npm'
157158
node-version: ${{ env.NODE_VERSION }}
@@ -172,10 +173,10 @@ jobs:
172173
timeout-minutes: 15
173174
steps:
174175
- name: Checkout
175-
uses: actions/checkout@v5
176+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
176177

177178
- name: Setup Node.js
178-
uses: actions/setup-node@v5
179+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
179180
with:
180181
cache: 'npm'
181182
node-version: ${{ env.NODE_VERSION }}
@@ -196,10 +197,10 @@ jobs:
196197
timeout-minutes: 15
197198
steps:
198199
- name: Checkout
199-
uses: actions/checkout@v5
200+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
200201

201202
- name: Setup Node.js
202-
uses: actions/setup-node@v5
203+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
203204
with:
204205
cache: 'npm'
205206
node-version: ${{ env.NODE_VERSION }}

.github/workflows/copilot-setup-steps.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@ jobs:
3737
# If you do not check out your code, Copilot will do this for you.
3838
steps:
3939
- name: Checkout code
40-
uses: actions/checkout@v5
40+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
4141

4242
- name: Use Node ${{env.NODE_VERSION}}
43-
uses: actions/setup-node@v5
43+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
4444
with:
4545
node-version: ${{env.NODE_VERSION}}
4646
registry-url: 'https://npm.pkg.github.com'
4747
scope: '@deepnote'
4848

4949
- name: Cache npm files
50-
uses: actions/cache@v4
50+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
5151
with:
5252
path: ~/.npm
5353
key: ${{runner.os}}-${{env.CACHE_NPM_DEPS}}-${{hashFiles('package-lock.json')}}
5454

5555
- name: Cache the out/ directory
56-
uses: actions/cache@v4
56+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
5757
with:
5858
path: ./out
5959
key: ${{runner.os}}-${{env.CACHE_OUT_DIRECTORY}}-${{hashFiles('src/**')}}
@@ -79,7 +79,7 @@ jobs:
7979
continue-on-error: true
8080

8181
- name: Install uv
82-
uses: astral-sh/setup-uv@v7
82+
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7
8383

8484
- name: Setup Venv
8585
run: |

.github/workflows/deps.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@v5
27+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2828

2929
- name: Setup Node.js
30-
uses: actions/setup-node@v5
30+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
3131
with:
3232
cache: 'npm'
3333
node-version: ${{ env.NODE_VERSION }}
@@ -44,7 +44,7 @@ jobs:
4444

4545
- name: Upload audit report
4646
if: always()
47-
uses: actions/upload-artifact@v4
47+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
4848
with:
4949
name: npm-audit-report
5050
path: audit-report.json
@@ -57,10 +57,10 @@ jobs:
5757
runs-on: ubuntu-latest
5858
steps:
5959
- name: Checkout
60-
uses: actions/checkout@v5
60+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
6161

6262
- name: Setup Node.js
63-
uses: actions/setup-node@v5
63+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
6464
with:
6565
node-version: ${{ env.NODE_VERSION }}
6666
cache: 'npm'

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)