[cli][fs-detectors][frameworks] Revert Storybook support (#9890)

This commit is contained in:
Chris Barber
2023-05-02 10:03:28 -05:00
committed by GitHub
parent ac2457494a
commit 678e13af53
75 changed files with 3 additions and 2674 deletions

View File

@@ -6,9 +6,8 @@ import { client } from '../../../mocks/client';
import { defaultProject, useProject } from '../../../mocks/project';
import { useTeams } from '../../../mocks/team';
import { useUser } from '../../../mocks/user';
import { execSync } from 'child_process';
jest.setTimeout(6 * 60 * 1000);
jest.setTimeout(2 * 60 * 1000);
const fixture = (name: string) =>
join(__dirname, '../../../fixtures/unit/commands/build', name);
@@ -1304,42 +1303,4 @@ describe('build', () => {
delete process.env.__VERCEL_BUILD_RUNNING;
}
});
it('should build Storybook project and ignore middleware', async () => {
const cwd = fixture('storybook-with-middleware');
const output = join(cwd, '.vercel/output');
try {
client.stdout.pipe(process.stdout);
client.stderr.pipe(process.stderr);
process.chdir(cwd);
process.env.STORYBOOK_DISABLE_TELEMETRY = '1';
execSync('yarn');
const exitCode = await build(client);
expect(exitCode).toEqual(0);
// `builds.json` says that "@vercel/static" was run
const builds = await fs.readJSON(join(output, 'builds.json'));
expect(builds).toMatchObject({
target: 'preview',
builds: [
{
require: '@vercel/static-build',
apiVersion: 2,
src: 'package.json',
use: '@vercel/static-build',
},
],
});
const files = await fs.readdir(output);
// we should NOT see `functions` because that means `middleware.ts` was processed
expect(files.sort()).toEqual(['builds.json', 'config.json', 'static']);
} finally {
process.chdir(originalCwd);
delete process.env.__VERCEL_BUILD_RUNNING;
delete process.env.STORYBOOK_DISABLE_TELEMETRY;
}
});
});