Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@
"react": "^18.0.0",
"react-dom": "^18.0.0",
"unist-util-visit": "^5.0.0"
},
"overrides": {
"@mermaid-js/layout-elk": "^0.2.0",
"webpackbar": "^7.0.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@
"react": "^18.0.0",
"react-dom": "^18.0.0",
"unist-util-visit": "^5.0.0"
},
"overrides": {
"@mermaid-js/layout-elk": "^0.2.0",
"webpackbar": "^7.0.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@
"react": "^18.0.0",
"react-dom": "^18.0.0",
"unist-util-visit": "^5.0.0"
},
"overrides": {
"@mermaid-js/layout-elk": "^0.2.0",
"webpackbar": "^7.0.0"
}
}
}
34 changes: 34 additions & 0 deletions shared/src/docify/template-bundles/docusaurus/package.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { describe, it, expect, afterAll } from 'vitest';
import { copyFileSync, mkdtempSync, rmSync } from 'fs';
import { join } from 'path';
import { tmpdir } from 'os';
import { spawn } from 'child_process';

const TEMPLATE_PACKAGE_JSON = join(__dirname, 'package.json');

// The purpose of this test is to ensure that the docusaurus template bundle's dependencies can be
// resolved. This is a long-running test because it involves "npm install", which can take some time.
//
// Without this test, we might not discover peer dependency conflicts until after a release is produced
// and a user tries to use the template bundle.
describe('docusaurus template bundle dependencies', () => {
const tmpDir = mkdtempSync(join(tmpdir(), 'calm-docusaurus-'));

afterAll(() => {
rmSync(tmpDir, { recursive: true, force: true });
});

it('should resolve without peer dependency conflicts (long running test)', async () => {
copyFileSync(TEMPLATE_PACKAGE_JSON, join(tmpDir, 'package.json'));

const exitCode = await new Promise<number>((resolve, reject) => {
const stderr: string[] = [];
const proc = spawn('npm', ['install', '--package-lock-only', '--prefix', tmpDir]);
proc.stderr?.on('data', (chunk: Buffer) => stderr.push(chunk.toString()));
proc.on('close', (code) => resolve(code ?? 1));
Comment on lines +24 to +28
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test shells out to npm install, which by default may run audit/fund requests and (depending on npm behavior) lifecycle scripts, making the test slower/flakier and potentially executing third‑party scripts during CI. Consider adding --no-audit, --no-fund, and --ignore-scripts, and run the command with cwd set to tmpDir (instead of relying on --prefix) so it’s fully isolated; also consider using npm.cmd on Windows to keep the test runnable for contributors.

Copilot uses AI. Check for mistakes.
proc.on('error', reject);
});

expect(exitCode).toBe(0);
}, 120_000);
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@
"react": "^18.0.0",
"react-dom": "^18.0.0",
"unist-util-visit": "^5.0.0"
},
"overrides": {
"@mermaid-js/layout-elk": "^0.2.0",
"webpackbar": "^7.0.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@
"react": "^18.0.0",
"react-dom": "^18.0.0",
"unist-util-visit": "^5.0.0"
},
"overrides": {
"@mermaid-js/layout-elk": "^0.2.0",
"webpackbar": "^7.0.0"
}
}
}
Loading