Skip to content

Commit

Permalink
Update Preconstruct
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebennett88 committed Oct 21, 2022
1 parent 447f6a6 commit bae261a
Show file tree
Hide file tree
Showing 30 changed files with 89 additions and 97 deletions.
5 changes: 5 additions & 0 deletions .changeset/tall-dancers-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-select': minor
---

Move files around to as to be compatible with version 2 of `@preconstruct/cli`
2 changes: 1 addition & 1 deletion docs/PropTypes/Select.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component } from 'react';

import { Props, defaultProps } from 'react-select/src/Select';
import { Props, defaultProps } from 'react-select/src/base';
import { GroupBase } from 'react-select';

export default class Select extends Component<
Expand Down
5 changes: 1 addition & 4 deletions docs/generate-magical-types/generate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"main": "dist/generate-magical-types.cjs.js",
"preconstruct": {
"source": "../src/generate"
}
"main": "dist/react-select-generate-magical-types-generate.cjs.js"
}
4 changes: 2 additions & 2 deletions docs/generate-magical-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"preconstruct": {
"entrypoints": [
"generate",
"serialize"
"generate.ts",
"serialize.ts"
]
}
}
5 changes: 1 addition & 4 deletions docs/generate-magical-types/serialize/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"main": "dist/generate-magical-types.cjs.js",
"preconstruct": {
"source": "../src/serialize"
}
"main": "dist/react-select-generate-magical-types-serialize.cjs.js"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@emotion/babel-plugin": "^11.0.0",
"@emotion/jest": "^11.1.0",
"@manypkg/cli": "^0.19.2",
"@preconstruct/cli": "^1.0.0",
"@preconstruct/cli": "^2.2.2",
"@testing-library/dom": "7.0.4",
"@testing-library/jest-dom": "5.1.1",
"@testing-library/react": "10.0.1",
Expand Down
9 changes: 3 additions & 6 deletions packages/react-select/animated/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"main": "dist/react-select.cjs.js",
"module": "dist/react-select.esm.js",
"types": "dist/react-select.cjs.d.ts",
"preconstruct": {
"source": "../src/animated"
}
"main": "dist/react-select-animated.cjs.js",
"module": "dist/react-select-animated.esm.js",
"types": "dist/react-select-animated.cjs.d.ts"
}
9 changes: 3 additions & 6 deletions packages/react-select/async-creatable/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"main": "dist/react-select.cjs.js",
"module": "dist/react-select.esm.js",
"types": "dist/react-select.cjs.d.ts",
"preconstruct": {
"source": "../src/AsyncCreatable"
}
"main": "dist/react-select-async-creatable.cjs.js",
"module": "dist/react-select-async-creatable.esm.js",
"types": "dist/react-select-async-creatable.cjs.d.ts"
}
9 changes: 3 additions & 6 deletions packages/react-select/async/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"main": "dist/react-select.cjs.js",
"module": "dist/react-select.esm.js",
"types": "dist/react-select.cjs.d.ts",
"preconstruct": {
"source": "../src/Async"
}
"main": "dist/react-select-async.cjs.js",
"module": "dist/react-select-async.esm.js",
"types": "dist/react-select-async.cjs.d.ts"
}
9 changes: 3 additions & 6 deletions packages/react-select/base/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"main": "dist/react-select.cjs.js",
"module": "dist/react-select.esm.js",
"types": "dist/react-select.cjs.d.ts",
"preconstruct": {
"source": "../src/Select"
}
"main": "dist/react-select-base.cjs.js",
"module": "dist/react-select-base.esm.js",
"types": "dist/react-select-base.cjs.d.ts"
}
9 changes: 3 additions & 6 deletions packages/react-select/creatable/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"main": "dist/react-select.cjs.js",
"module": "dist/react-select.esm.js",
"types": "dist/react-select.cjs.d.ts",
"preconstruct": {
"source": "../src/Creatable"
}
"main": "dist/react-select-creatable.cjs.js",
"module": "dist/react-select-creatable.esm.js",
"types": "dist/react-select-creatable.cjs.d.ts"
}
12 changes: 6 additions & 6 deletions packages/react-select/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@
],
"preconstruct": {
"entrypoints": [
".",
"base",
"animated",
"async",
"creatable",
"async-creatable"
"index.ts",
"base/index.ts",
"animated/index.ts",
"async/index.ts",
"creatable/index.ts",
"async-creatable/index.ts"
]
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import AsyncCreatable from '../AsyncCreatable';
import AsyncCreatable from '../async-creatable';
import { Option, OPTIONS } from './constants';
import { render, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
Expand Down
2 changes: 1 addition & 1 deletion packages/react-select/src/__tests__/Select.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
OptionNumberValue,
OptionBooleanValue,
} from './constants';
import Select, { FormatOptionLabelMeta } from '../Select';
import Select, { FormatOptionLabelMeta } from '../base';
import { FilterOptionOption } from '../filters';

import { matchers } from '@emotion/jest';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import {
ReactElement,
RefAttributes,
} from 'react';
import Select from './Select';
import { GroupBase } from './types';
import useAsync, { AsyncAdditionalProps } from './useAsync';
import useStateManager, { StateManagerProps } from './useStateManager';
import useCreatable, { CreatableAdditionalProps } from './useCreatable';
import Select from '../base';
import { GroupBase } from '../types';
import useAsync, { AsyncAdditionalProps } from '../useAsync';
import useStateManager, { StateManagerProps } from '../useStateManager';
import useCreatable, { CreatableAdditionalProps } from '../useCreatable';

export type AsyncCreatableProps<
Option,
Expand Down
2 changes: 2 additions & 0 deletions packages/react-select/src/async-creatable/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './AsyncCreatable';
export { default } from './AsyncCreatable';
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import {
ReactElement,
RefAttributes,
} from 'react';
import Select from './Select';
import { GroupBase } from './types';
import useStateManager from './useStateManager';
import useAsync from './useAsync';
import type { AsyncProps } from './useAsync';
import Select from '../base';
import { GroupBase } from '../types';
import useStateManager from '../useStateManager';
import useAsync from '../useAsync';
import type { AsyncProps } from '../useAsync';
export type { AsyncProps };

type AsyncSelect = <
Expand Down
2 changes: 2 additions & 0 deletions packages/react-select/src/async/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './Async';
export { default } from './Async';
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import {
RefCallback,
TouchEventHandler,
} from 'react';
import { MenuPlacer } from './components/Menu';
import LiveRegion from './components/LiveRegion';
import { MenuPlacer } from '../components/Menu';
import LiveRegion from '../components/LiveRegion';

import { createFilter, FilterOptionOption } from './filters';
import { DummyInput, ScrollManager } from './internal/index';
import { AriaLiveMessages, AriaSelection } from './accessibility/index';
import { createFilter, FilterOptionOption } from '../filters';
import { DummyInput, ScrollManager } from '../internal/index';
import { AriaLiveMessages, AriaSelection } from '../accessibility/index';

import {
classNames,
Expand All @@ -29,19 +29,19 @@ import {
valueTernary,
multiValueAsValue,
singleValueAsValue,
} from './utils';
} from '../utils';

import {
formatGroupLabel as formatGroupLabelBuiltin,
getOptionLabel as getOptionLabelBuiltin,
getOptionValue as getOptionValueBuiltin,
isOptionDisabled as isOptionDisabledBuiltin,
} from './builtins';
} from '../builtins';

import { defaultComponents, SelectComponentsConfig } from './components/index';
import { defaultComponents, SelectComponentsConfig } from '../components/index';

import { defaultStyles, StylesConfig, StylesProps } from './styles';
import { defaultTheme, ThemeConfig } from './theme';
import { defaultStyles, StylesConfig, StylesProps } from '../styles';
import { defaultTheme, ThemeConfig } from '../theme';

import {
ActionMeta,
Expand All @@ -57,7 +57,7 @@ import {
OptionsOrGroups,
PropsValue,
SetValueAction,
} from './types';
} from '../types';

export type FormatOptionLabelContext = 'menu' | 'value';
export interface FormatOptionLabelMeta<Option> {
Expand Down
2 changes: 2 additions & 0 deletions packages/react-select/src/base/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './Select';
export { default } from './Select';
2 changes: 1 addition & 1 deletion packages/react-select/src/components/Group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
Options,
Theme,
} from '../types';
import { Props } from '../Select';
import { Props } from '../base';

export interface ForwardedHeadingProps<
Option,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-select/src/components/MultiValue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
CSSObjectWithLabel,
GroupBase,
} from '../types';
import { Props } from '../Select';
import { Props } from '../base';

interface MultiValueComponents<
Option,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import {
ReactElement,
RefAttributes,
} from 'react';
import Select from './Select';
import { GroupBase } from './types';
import useStateManager, { StateManagerProps } from './useStateManager';
import useCreatable, { CreatableAdditionalProps } from './useCreatable';
import Select from '../base';
import { GroupBase } from '../types';
import useStateManager, { StateManagerProps } from '../useStateManager';
import useCreatable, { CreatableAdditionalProps } from '../useCreatable';

export type CreatableProps<
Option,
Expand Down
2 changes: 2 additions & 0 deletions packages/react-select/src/creatable/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './Creatable';
export { default } from './Creatable';
4 changes: 2 additions & 2 deletions packages/react-select/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Select from './Select';
import Select from './base';
import type { GroupBase } from './types';
import useStateManager from './useStateManager';

Expand Down Expand Up @@ -56,4 +56,4 @@ export type {
AriaOnFilter,
AriaOnFocus,
} from './accessibility';
export type { FormatOptionLabelContext, FormatOptionLabelMeta } from './Select';
export type { FormatOptionLabelContext, FormatOptionLabelMeta } from './base';
2 changes: 1 addition & 1 deletion packages/react-select/src/stateManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from 'react';

import { GroupBase } from './types';
import Select from './Select';
import Select from './base';
import useStateManager from './useStateManager';
import type { StateManagerProps } from './useStateManager';
export type { StateManagerProps };
Expand Down
2 changes: 1 addition & 1 deletion packages/react-select/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CSSObject } from '@emotion/react';
import { Props } from './Select';
import { Props } from './base';
import { StylesProps } from './styles';

export interface GroupBase<Option> {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-select/src/useCreatable.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ReactNode, useCallback, useMemo } from 'react';
import { PublicBaseSelectProps } from './Select';
import { PublicBaseSelectProps } from './base';
import {
ActionMeta,
GetOptionLabel,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-select/src/useStateManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
OnChangeValue,
PropsValue,
} from './types';
import { PublicBaseSelectProps } from './Select';
import { PublicBaseSelectProps } from './base';
import { useCallback, useState } from 'react';

type StateManagedPropKeys =
Expand Down
Loading

0 comments on commit bae261a

Please sign in to comment.