Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
sudo apt-get update
sudo apt-get install --yes libx11-dev libxkbfile-dev

- uses: voidzero-dev/setup-vp@v1
- uses: voidzero-dev/setup-vp@v1.21.1
with:
node-version: 24
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install --yes libx11-dev libxkbfile-dev
- uses: voidzero-dev/setup-vp@v1
- uses: voidzero-dev/setup-vp@v1.21.1
with:
node-version: ${{ matrix.node-version }}
cache: true
Expand Down
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# vite-plus preview build registry bridge (auto-added by vp)
registry=https://registry-bridge.viteplus.dev/
57 changes: 29 additions & 28 deletions core/__tests__/ReviewCodeView-scroll.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,35 @@ const createLoadedMarkdownFile = (contents: string, fingerprint: string) => {
};
};

const createCombinedFile = (contents: string, fingerprint: string) => {
const file = createLoadedMarkdownFile(contents, fingerprint);
const section = file.sections[0]!;
return {
...file,
sections: [
{
...section,
id: 'plan.md:commit',
kind: 'commit' as const,
newFile: {
contents: '# Committed\n',
name: file.path,
},
patch: 'diff --git a/plan.md b/plan.md\n@@ -1 +1 @@\n-# Original\n+# Committed\n',
},
{
...section,
id: 'plan.md:unstaged',
kind: 'unstaged' as const,
oldFile: {
contents: '# Committed\n',
name: file.path,
},
},
],
} satisfies ChangedFile;
};

test('generated files are collapsed by default and can be explicitly expanded per review', async () => {
const file = createChangedFile('src/__generated__/api.ts');
const reviewKey = 'walkthrough:generated-api';
Expand Down Expand Up @@ -283,34 +312,6 @@ test('switching edited Markdown back to a diff flushes and refreshes it first',

test('combined branch Markdown edits only the final working-tree section', async () => {
const order: Array<string> = [];
const createCombinedFile = (contents: string, fingerprint: string) => {
const file = createLoadedMarkdownFile(contents, fingerprint);
const section = file.sections[0]!;
return {
...file,
sections: [
{
...section,
id: 'plan.md:commit',
kind: 'commit' as const,
newFile: {
contents: '# Committed\n',
name: file.path,
},
patch: 'diff --git a/plan.md b/plan.md\n@@ -1 +1 @@\n-# Original\n+# Committed\n',
},
{
...section,
id: 'plan.md:unstaged',
kind: 'unstaged' as const,
oldFile: {
contents: '# Committed\n',
name: file.path,
},
},
],
} satisfies ChangedFile;
};
const initialFile = createCombinedFile('# Edited\n', 'plan.md:combined-initial');
const refreshedFile = createCombinedFile('# Saved\n', 'plan.md:combined-refreshed');
const combinedSource = {
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,10 @@
"react-dom": "^19.3.0",
"typescript": "^7.0.2",
"vite": "catalog:",
"vite-plus": "catalog:",
"vitest": "catalog:"
"vite-plus": "catalog:"
},
"engines": {
"node": ">=23.0.0",
"node": "^24.11.0 || >=26.0.0",
"pnpm": ">=12.0.0"
},
"packageManager": "pnpm@12.3.4",
Expand Down
3,394 changes: 1,704 additions & 1,690 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

62 changes: 58 additions & 4 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,62 @@ allowBuilds:
blockExoticSubdeps: false
minimumReleaseAgeExclude:
- '@nkzw/*'
- '@oxc-project/runtime@0.151.0'
- '@oxc-project/types@0.151.0'
- '@oxfmt/binding-android-arm-eabi@0.70.0'
- '@oxfmt/binding-android-arm64@0.70.0'
- '@oxfmt/binding-darwin-arm64@0.70.0'
- '@oxfmt/binding-darwin-x64@0.70.0'
- '@oxfmt/binding-freebsd-x64@0.70.0'
- '@oxfmt/binding-linux-arm-gnueabihf@0.70.0'
- '@oxfmt/binding-linux-arm-musleabihf@0.70.0'
- '@oxfmt/binding-linux-arm64-gnu@0.70.0'
- '@oxfmt/binding-linux-arm64-musl@0.70.0'
- '@oxfmt/binding-linux-ppc64-gnu@0.70.0'
- '@oxfmt/binding-linux-riscv64-gnu@0.70.0'
- '@oxfmt/binding-linux-riscv64-musl@0.70.0'
- '@oxfmt/binding-linux-s390x-gnu@0.70.0'
- '@oxfmt/binding-linux-x64-gnu@0.70.0'
- '@oxfmt/binding-linux-x64-musl@0.70.0'
- '@oxfmt/binding-openharmony-arm64@0.70.0'
- '@oxfmt/binding-win32-arm64-msvc@0.70.0'
- '@oxfmt/binding-win32-ia32-msvc@0.70.0'
- '@oxfmt/binding-win32-x64-msvc@0.70.0'
- '@oxlint/binding-android-arm-eabi@1.85.0'
- '@oxlint/binding-android-arm64@1.85.0'
- '@oxlint/binding-darwin-arm64@1.85.0'
- '@oxlint/binding-darwin-x64@1.85.0'
- '@oxlint/binding-freebsd-x64@1.85.0'
- '@oxlint/binding-linux-arm-gnueabihf@1.85.0'
- '@oxlint/binding-linux-arm-musleabihf@1.85.0'
- '@oxlint/binding-linux-arm64-gnu@1.85.0'
- '@oxlint/binding-linux-arm64-musl@1.85.0'
- '@oxlint/binding-linux-ppc64-gnu@1.85.0'
- '@oxlint/binding-linux-riscv64-gnu@1.85.0'
- '@oxlint/binding-linux-riscv64-musl@1.85.0'
- '@oxlint/binding-linux-s390x-gnu@1.85.0'
- '@oxlint/binding-linux-x64-gnu@1.85.0'
- '@oxlint/binding-linux-x64-musl@1.85.0'
- '@oxlint/binding-openharmony-arm64@1.85.0'
- '@oxlint/binding-win32-arm64-msvc@1.85.0'
- '@oxlint/binding-win32-ia32-msvc@1.85.0'
- '@oxlint/binding-win32-x64-msvc@1.85.0'
- '@voidzero-dev/vite-plus-core@0.0.0-commit.e0f77ee2353b38c77d7165d3305f9f6d705b4d62'
- '@voidzero-dev/vite-plus-darwin-arm64@0.0.0-commit.e0f77ee2353b38c77d7165d3305f9f6d705b4d62'
- '@voidzero-dev/vite-plus-darwin-x64@0.0.0-commit.e0f77ee2353b38c77d7165d3305f9f6d705b4d62'
- '@voidzero-dev/vite-plus-linux-arm64-gnu@0.0.0-commit.e0f77ee2353b38c77d7165d3305f9f6d705b4d62'
- '@voidzero-dev/vite-plus-linux-arm64-musl@0.0.0-commit.e0f77ee2353b38c77d7165d3305f9f6d705b4d62'
- '@voidzero-dev/vite-plus-linux-x64-gnu@0.0.0-commit.e0f77ee2353b38c77d7165d3305f9f6d705b4d62'
- '@voidzero-dev/vite-plus-linux-x64-musl@0.0.0-commit.e0f77ee2353b38c77d7165d3305f9f6d705b4d62'
- '@voidzero-dev/vite-plus-win32-arm64-msvc@0.0.0-commit.e0f77ee2353b38c77d7165d3305f9f6d705b4d62'
- '@voidzero-dev/vite-plus-win32-x64-msvc@0.0.0-commit.e0f77ee2353b38c77d7165d3305f9f6d705b4d62'
- oxfmt@0.70.0
- oxlint@1.85.0
- vite-plus@0.0.0-commit.e0f77ee2353b38c77d7165d3305f9f6d705b4d62
catalog:
vite: npm:@voidzero-dev/vite-plus-core@^0.3.1
vite-plus: ^0.3.2
vitest: 5.0.0
vite: npm:@voidzero-dev/vite-plus-core@0.0.0-commit.e0f77ee2353b38c77d7165d3305f9f6d705b4d62
vite-plus: 0.0.0-commit.e0f77ee2353b38c77d7165d3305f9f6d705b4d62
vitest: 5.0.1
nodeLinker: hoisted
onlyBuiltDependencies:
- '@nkzw/mdx-editor'
Expand All @@ -33,9 +85,11 @@ onlyBuiltDependencies:
- unrs-resolver
overrides:
extract-zip>yauzl: ^3.4.0
vite: 'catalog:'
# Keep Vite+ on the main suite's Vitest version without overriding the Workers suite.
vite-plus>vitest: 'catalog:'
vite@*: 'catalog:'
vitest@4.1.11: 4.1.11
vitest@*: 'catalog:'
patchedDependencies:
native-keymap@3.3.9: patches/native-keymap@3.3.9.patch
peerDependencyRules:
Expand Down
2 changes: 1 addition & 1 deletion service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"type": "module",
"main": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"types": "./index.ts",
"exports": {
".": {
"types": "./index.ts",
Expand Down
24 changes: 12 additions & 12 deletions test/sharing.integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,18 @@ const fateOperation = async (
}),
);

const queryShare = (name: 'planBySlug' | 'walkthroughBySlug', slug: string, cookie?: string) =>
fateOperation(
{
args: { slug },
id: `${name}-delete-capability`,
kind: 'query',
name,
select: ['canDelete', 'commentThreads.id', 'id'],
},
{ cookie },
);

const claimIntent = async (intent: UploadIntent, cookie: string) => {
const result = await fateOperation(
{
Expand Down Expand Up @@ -929,18 +941,6 @@ test('allows only share owners to delete plans and walkthroughs', async () => {
const sharedPlan = await createAndUpload(ownerCookie, 'plan');
const sharedWalkthrough = await createAndUpload(ownerCookie, 'walkthrough');

const queryShare = (name: 'planBySlug' | 'walkthroughBySlug', slug: string, cookie?: string) =>
fateOperation(
{
args: { slug },
id: `${name}-delete-capability`,
kind: 'query',
name,
select: ['canDelete', 'commentThreads.id', 'id'],
},
{ cookie },
);

expect((await queryShare('planBySlug', sharedPlan.slug)).results[0]).toMatchObject({
data: { canDelete: false },
ok: true,
Expand Down
3 changes: 2 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import babel from '@rolldown/plugin-babel';
import react, { reactCompilerPreset } from '@vitejs/plugin-react';
import { defineConfig } from 'vite-plus';

const testWorkers = Math.max(1, Math.min(4, Math.floor(availableParallelism() / 6)));
// Node PTY process tests need room to spawn child processes during the full suite.
const testWorkers = Math.max(1, Math.min(2, Math.floor(availableParallelism() / 6)));

export default defineConfig({
base: './',
Expand Down
9 changes: 8 additions & 1 deletion web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import babel from '@rolldown/plugin-babel';
import { reactCompilerPreset } from '@vitejs/plugin-react';
import { voidReact } from '@void/react/plugin';
import { fate } from 'react-fate/vite';
import type { Plugin } from 'vite';
import type { Plugin } from 'vite-plus';
import { defineConfig, lazyPlugins } from 'vite-plus';
import { voidPlugin } from 'void';

Expand Down Expand Up @@ -54,4 +54,11 @@ export default defineConfig({
dedupe: ['react', 'react-dom'],
},
server: { port: 6002 },
test: {
// Vitest v4 compatibility: preserve mock call history.
// Remove after tests no longer rely on calls from setup or earlier tests.
// https://release-v1-0-0-rc-0-viteplus-dev.voidzero-docs.workers.dev/guide/vitest-v5#remove-unneeded-compatibility-settings
// https://vitest.dev/guide/migration/#clearmocks-is-enabled-by-default
clearMocks: false,
},
});
Loading