Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: Fix the sb-bench CI step #19029

Merged
merged 12 commits into from
Aug 30, 2022
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ executors:
default: 'medium'
working_directory: /tmp/storybook
docker:
- image: mcr.microsoft.com/playwright:v1.24.0-focal
- image: mcr.microsoft.com/playwright:v1.25.1-focal
environment:
NODE_OPTIONS: --max_old_space_size=3076
resource_class: <<parameters.class>>
Expand Down Expand Up @@ -317,7 +317,7 @@ jobs:
name: Run @storybook/bench on repro
command: |
cd ./cra-bench
npx @storybook/bench@1.0.0--canary.11.52d1ee7.1 'echo noop' --label cra
npx -p @storybook/bench@1.0.0--canary.12.3afe824.0 sb-bench 'echo noop' --label cra
e2e-tests-pnp:
executor:
class: medium
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ export default async (
{
message: /export '\S+' was not found in 'global'/,
},
{
message:
/require function is used in a way in which dependencies cannot be statically extracted/,
},
],
plugins: [
Object.keys(virtualModuleMapping).length > 0
Expand Down
19 changes: 18 additions & 1 deletion code/lib/theming/scripts/fix-theme-type-export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { readFile, writeFile } from 'fs-extra';
import { dedent } from 'ts-dedent';
import { join } from 'path';

const run = async () => {
async function editIndexTypeDefinitionsFile() {
const target = join(process.cwd(), 'dist', 'index.d.ts');
const contents = await readFile(target, 'utf8');

Expand All @@ -20,6 +20,23 @@ const run = async () => {
`;

await writeFile(target, newContents);
}

async function editIndexESMFile() {
const target = join(process.cwd(), 'dist', 'index.mjs');
const contents = await readFile(target, 'utf8');

const newContents = contents.replace(
new RegExp('.useInsertionEffect', 'g'),
`['useInsertion'+'Effect']`
);

await writeFile(target, newContents);
}

const run = async () => {
await editIndexTypeDefinitionsFile();
await editIndexESMFile();
};

run().catch((e) => {
Expand Down