Skip to content

Commit

Permalink
Merge branch 'next' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
chocoscoding authored Sep 19, 2023
2 parents 8beddfa + 960154a commit 04a5b3e
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 47 deletions.
6 changes: 3 additions & 3 deletions code/lib/cli/src/generators/configure.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ describe('configurePreview', () => {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
date: /Date$/i,
},
},
},
Expand Down Expand Up @@ -162,7 +162,7 @@ describe('configurePreview', () => {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
date: /Date$/i,
},
},
},
Expand Down Expand Up @@ -213,7 +213,7 @@ describe('configurePreview', () => {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
date: /Date$/i,
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion code/lib/cli/src/generators/configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export async function configurePreview(options: ConfigurePreviewOptions) {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
date: /Date$/i,
},
},
},
Expand Down
10 changes: 8 additions & 2 deletions code/lib/cli/src/js-package-manager/PNPMProxy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,14 @@ describe('PNPM Proxy', () => {
.spyOn(pnpmProxy, 'writePackageJson')
.mockImplementation(jest.fn());

const basePackageAttributes = {
dependencies: {},
devDependencies: {},
};

jest.spyOn(pnpmProxy, 'retrievePackageJson').mockImplementation(
// @ts-expect-error (not strict)
jest.fn(() => ({
jest.fn(async () => ({
...basePackageAttributes,
overrides: {
bar: 'x.x.x',
},
Expand All @@ -228,6 +233,7 @@ describe('PNPM Proxy', () => {
await pnpmProxy.addPackageResolutions(versions);

expect(writePackageSpy).toHaveBeenCalledWith({
...basePackageAttributes,
overrides: {
...versions,
bar: 'x.x.x',
Expand Down
56 changes: 19 additions & 37 deletions code/renderers/react/src/docs/typeScript/handleProp.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function extractPropDef(component: Component, rawDefaultProp?: any): PropDef {
describe('enhanceTypeScriptProp', () => {
describe('defaultValue', () => {
function createTestComponent(
defaultValue: DocgenPropDefaultValue,
defaultValue: DocgenPropDefaultValue | undefined,
typeName = 'anything-is-fine'
): Component {
return createComponent({
Expand Down Expand Up @@ -295,8 +295,7 @@ describe('enhanceTypeScriptProp', () => {
});

it('should support strings', () => {
// @ts-expect-error (not strict)
const component = createTestComponent(null);
const component = createTestComponent(undefined);

const { defaultValue } = extractPropDef(component, 'foo');

Expand All @@ -305,8 +304,7 @@ describe('enhanceTypeScriptProp', () => {
});

it('should support array of primitives', () => {
// @ts-expect-error (not strict)
const component = createTestComponent(null);
const component = createTestComponent(undefined);

const { defaultValue } = extractPropDef(component, [1, 2, 3]);

Expand All @@ -315,8 +313,7 @@ describe('enhanceTypeScriptProp', () => {
});

it('should support array of short object', () => {
// @ts-expect-error (not strict)
const component = createTestComponent(null);
const component = createTestComponent(undefined);

const { defaultValue } = extractPropDef(component, [{ foo: 'bar' }]);

Expand All @@ -325,8 +322,7 @@ describe('enhanceTypeScriptProp', () => {
});

it('should support array of long object', () => {
// @ts-expect-error (not strict)
const component = createTestComponent(null);
const component = createTestComponent(undefined);

const { defaultValue } = extractPropDef(component, [{ foo: 'bar', bar: 'foo', hey: 'ho' }]);

Expand All @@ -342,8 +338,7 @@ describe('enhanceTypeScriptProp', () => {
});

it('should support short object', () => {
// @ts-expect-error (not strict)
const component = createTestComponent(null);
const component = createTestComponent(undefined);

const { defaultValue } = extractPropDef(component, { foo: 'bar' });

Expand All @@ -352,8 +347,7 @@ describe('enhanceTypeScriptProp', () => {
});

it('should support long object', () => {
// @ts-expect-error (not strict)
const component = createTestComponent(null);
const component = createTestComponent(undefined);

const { defaultValue } = extractPropDef(component, { foo: 'bar', bar: 'foo', hey: 'ho' });

Expand All @@ -369,8 +363,7 @@ describe('enhanceTypeScriptProp', () => {
});

it('should support anonymous function', () => {
// @ts-expect-error (not strict)
const component = createTestComponent(null);
const component = createTestComponent(undefined);

const { defaultValue } = extractPropDef(component, () => 'hey!');

Expand All @@ -379,8 +372,7 @@ describe('enhanceTypeScriptProp', () => {
});

it('should support named function', () => {
// @ts-expect-error (not strict)
const component = createTestComponent(null);
const component = createTestComponent(undefined);

const { defaultValue } = extractPropDef(component, function hello() {
return 'world!';
Expand All @@ -391,8 +383,7 @@ describe('enhanceTypeScriptProp', () => {
});

it('should support named function with params', () => {
// @ts-expect-error (not strict)
const component = createTestComponent(null);
const component = createTestComponent(undefined);

const { defaultValue } = extractPropDef(component, function add(a: number, b: number) {
return a + b;
Expand All @@ -403,8 +394,7 @@ describe('enhanceTypeScriptProp', () => {
});

it('should support React element', () => {
// @ts-expect-error (not strict)
const component = createTestComponent(null);
const component = createTestComponent(undefined);

const defaultProp = <ReactComponent />;
// Simulate babel-plugin-add-react-displayname.
Expand All @@ -417,8 +407,7 @@ describe('enhanceTypeScriptProp', () => {
});

it('should support React element with props', () => {
// @ts-expect-error (not strict)
const component = createTestComponent(null);
const component = createTestComponent(undefined);

// @ts-expect-error (Converted from ts-ignore)
const defaultProp = <ReactComponent className="toto" />;
Expand All @@ -432,8 +421,7 @@ describe('enhanceTypeScriptProp', () => {
});

it('should support short HTML element', () => {
// @ts-expect-error (not strict)
const component = createTestComponent(null);
const component = createTestComponent(undefined);

const { defaultValue } = extractPropDef(component, <div>HTML element</div>);

Expand All @@ -442,8 +430,7 @@ describe('enhanceTypeScriptProp', () => {
});

it('should support long HTML element', () => {
// @ts-expect-error (not strict)
const component = createTestComponent(null);
const component = createTestComponent(undefined);

const { defaultValue } = extractPropDef(
component,
Expand All @@ -461,8 +448,7 @@ describe('enhanceTypeScriptProp', () => {

['element', 'elementType'].forEach((x) => {
it(`should support inlined React class component for ${x}`, () => {
// @ts-expect-error (not strict)
const component = createTestComponent(null, x);
const component = createTestComponent(undefined, x);

const { defaultValue } = extractPropDef(
component,
Expand All @@ -478,8 +464,7 @@ describe('enhanceTypeScriptProp', () => {
});

it(`should support inlined anonymous React functional component for ${x}`, () => {
// @ts-expect-error (not strict)
const component = createTestComponent(null, x);
const component = createTestComponent(undefined, x);

const { defaultValue } = extractPropDef(component, () => {
return <div>Inlined FunctionalComponent!</div>;
Expand All @@ -490,8 +475,7 @@ describe('enhanceTypeScriptProp', () => {
});

it(`should support inlined anonymous React functional component with props for ${x}`, () => {
// @ts-expect-error (not strict)
const component = createTestComponent(null, x);
const component = createTestComponent(undefined, x);

const { defaultValue } = extractPropDef(component, ({ foo }: { foo: string }) => {
return <div>{foo}</div>;
Expand All @@ -502,8 +486,7 @@ describe('enhanceTypeScriptProp', () => {
});

it(`should support inlined named React functional component for ${x}`, () => {
// @ts-expect-error (not strict)
const component = createTestComponent(null, x);
const component = createTestComponent(undefined, x);

const { defaultValue } = extractPropDef(component, function InlinedFunctionalComponent() {
return <div>Inlined FunctionalComponent!</div>;
Expand All @@ -514,8 +497,7 @@ describe('enhanceTypeScriptProp', () => {
});

it(`should support inlined named React functional component with props for ${x}`, () => {
// @ts-expect-error (not strict)
const component = createTestComponent(null, x);
const component = createTestComponent(undefined, x);

const { defaultValue } = extractPropDef(
component,
Expand Down
2 changes: 1 addition & 1 deletion code/ui/manager/src/components/sidebar/Tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export const LeafNodeStyleWrapper = styled.div(({ theme }) => ({
background: 'transparent',
'&:hover, &:focus': {
outline: 'none',
background: theme.background.hoverable,
background: transparentize(0.93, theme.color.secondary),
},
'&[data-selected="true"]': {
color: theme.color.lightest,
Expand Down
2 changes: 1 addition & 1 deletion code/ui/manager/src/components/sidebar/TreeNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const BranchNode = styled.button<{
fontSize: `${theme.typography.size.s2 - 1}px`,
background: 'transparent',
'&:hover, &:focus': {
background: theme.background.hoverable,
background: transparentize(0.93, theme.color.secondary),
outline: 'none',
},
}));
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/pick-patches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import program from 'commander';
import chalk from 'chalk';
import ora from 'ora';
import { setOutput } from '@actions/core';
import invariant from 'tiny-invariant';
import { git } from './utils/git-client';
import { getUnpickedPRs } from './utils/github-client';
import invariant from 'tiny-invariant';

program.name('pick-patches').description('Cherry pick patch PRs back to main');

Expand Down
2 changes: 1 addition & 1 deletion scripts/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { join, resolve } from 'path';
import { prompt } from 'prompts';
import { dedent } from 'ts-dedent';

import invariant from 'tiny-invariant';
import { CODE_DIRECTORY, JUNIT_DIRECTORY, SANDBOX_DIRECTORY } from './utils/constants';
import type { OptionValues } from './utils/options';
import { createOptions, getCommand, getOptionsOrPrompt } from './utils/options';
Expand Down Expand Up @@ -35,7 +36,6 @@ import {
} from '../code/lib/cli/src/sandbox-templates';

import { version } from '../code/package.json';
import invariant from 'tiny-invariant';

const sandboxDir = process.env.SANDBOX_ROOT || SANDBOX_DIRECTORY;

Expand Down

0 comments on commit 04a5b3e

Please sign in to comment.