@mintlify/previewing 4.0.1561 → 4.0.1562

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -75,6 +75,12 @@ describe('dev', () => {
75
75
  expect(seedPreviewFromSharedMock).not.toHaveBeenCalled();
76
76
  expect(silentUpdateClientMock).toHaveBeenCalled();
77
77
  });
78
+ it('downloads the vite client without seeding it from the next workspace', async () => {
79
+ await dev({ ...defaultYargs, beta: true });
80
+ expect(seedPreviewFromSharedMock).not.toHaveBeenCalled();
81
+ expect(silentUpdateClientMock).toHaveBeenCalled();
82
+ expect(runMock).toHaveBeenCalled();
83
+ });
78
84
  it('prebuild fails', async () => {
79
85
  const errorText = 'Some OpenAPI or docs.json schema error';
80
86
  prebuildMock.mockRejectedValueOnce(new Error(errorText));
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ import { configurePreviewPath, configureSharedPreviewPath } from '../constants.js';
2
+ import { getTarUrl } from '../util.js';
3
+ describe('getTarUrl', () => {
4
+ afterEach(() => {
5
+ configureSharedPreviewPath();
6
+ });
7
+ it('points the next client at its release tarball', () => {
8
+ configurePreviewPath(3000);
9
+ expect(getTarUrl('1.2.3')).toBe('https://releases.mintlify.com/mint-1.2.3.tar.gz');
10
+ });
11
+ it('points the vite client at its v2 tarball for the same version', () => {
12
+ configurePreviewPath(3000, 'vite');
13
+ expect(getTarUrl('1.2.3')).toBe('https://releases.mintlify.com/v2/mint-1.2.3.tar.gz');
14
+ });
15
+ });
@@ -41,14 +41,15 @@ const startDev = async (argv) => {
41
41
  const cliVersion = argv.cliVersion;
42
42
  const disableOpenApi = argv.disableOpenapi;
43
43
  const disablePrefetch = argv.disablePrefetch;
44
- if (CLIENT_FRAMEWORK === 'vite' && !localClientVersion) {
44
+ const [nodeMajor = 0, nodeMinor = 0] = process.versions.node.split('.').map(Number);
45
+ if (CLIENT_FRAMEWORK === 'vite' && (nodeMajor < 20 || (nodeMajor === 20 && nodeMinor < 11))) {
45
46
  clearLogs();
46
- addLog(_jsx(ErrorLog, { message: `${packageName} dev --beta needs --local-client-version until beta clients are released.` }));
47
+ addLog(_jsx(ErrorLog, { message: `${packageName} dev --beta needs node 20.11 or newer.` }));
47
48
  await new Promise((resolve) => setTimeout(resolve, 50));
48
49
  process.exit(1);
49
50
  }
50
51
  await timeDev('ensure preview directory', () => fse.ensureDir(PREVIEW_PATH));
51
- if (!localClientVersion && !clientVersion) {
52
+ if (!localClientVersion && !clientVersion && CLIENT_FRAMEWORK === 'next') {
52
53
  timeDevSync('seed preview from shared workspace', () => seedPreviewFromShared());
53
54
  }
54
55
  const versionString = await timeDev('read local client version', async () => {