Skip to content

Commit 6c45f77

Browse files
committed
chore: add type-check scripts and update Turbo configuration
- Introduced a new `typecheck` script in the root `package.json` to run type checks for the `@lambdacurry/forms` package. - Updated Turbo configuration to ensure type-checking dependencies are properly managed and inputs/outputs are defined for the type-check task. - Added a `type-check` script in the `apps/docs/package.json` for local type checking during development.
1 parent 55716fd commit 6c45f77

File tree

6 files changed

+12
-8
lines changed

6 files changed

+12
-8
lines changed

apps/docs/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"storybook": "storybook dev -p 6006",
99
"serve": "http-server ./storybook-static -p 6006 -s",
1010
"test": "start-server-and-test serve http://127.0.0.1:6006 'test-storybook --url http://127.0.0.1:6006'",
11-
"test:local": "test-storybook"
11+
"test:local": "test-storybook",
12+
"type-check": "tsc -p tsconfig.json --noEmit"
1213
},
1314
"dependencies": {
1415
"@hookform/error-message": "^2.0.0",

apps/docs/src/remix-hook-form/select.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ export const CreatableOption: Story = {
517517
await userEvent.clear(input);
518518
await userEvent.type(input, 'Atlantis');
519519

520-
const createItem = await within(listbox).findByRole('option', { name: 'Create \"Atlantis\"' });
520+
const createItem = await within(listbox).findByRole('option', { name: 'Select "Atlantis"' });
521521
await userEvent.click(createItem);
522522

523523
await expect(canvas.findByRole('combobox', { name: 'Custom Region' })).resolves.toHaveTextContent('Atlantis');
@@ -538,7 +538,7 @@ export const CreatableOption: Story = {
538538
await userEvent.clear(input);
539539
await userEvent.type(input, 'California');
540540

541-
expect(within(listbox).queryByRole('option', { name: 'Create \"California\"' })).not.toBeInTheDocument();
541+
expect(within(listbox).queryByRole('option', { name: 'Select "California"' })).not.toBeInTheDocument();
542542
});
543543
},
544544
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"build": "turbo run build",
1313
"serve": "turbo run serve",
1414
"test": "turbo run test",
15+
"typecheck": "turbo run type-check --filter=@lambdacurry/forms",
1516
"clean": "find . -name '.turbo' -type d -prune -exec rm -rf {} + && find . -name 'node_modules' -type d -prune -exec rm -rf {} + && find . -name 'yarn.lock' -type f -delete",
1617
"lint": "biome check .",
1718
"lint:fix": "biome check . --write",

packages/components/src/ui/data-table-filter/core/filters.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,20 +318,20 @@ export function createColumns<TData>(
318318
): Column<TData>[] {
319319
return columnConfigs.map((columnConfig) => {
320320
const getOptions: () => ColumnOption[] = memo(
321-
() => [data, strategy, columnConfig.options],
321+
() => [data, strategy, columnConfig.options] as const,
322322
([data, strategy]) =>
323323
getColumnOptions(columnConfig as ColumnConfig<TData, ColumnDataType, unknown, string>, data, strategy),
324324
{ key: `options-${columnConfig.id}` },
325325
);
326326

327327
const getValues: () => ElementType<NonNullable<unknown>>[] = memo(
328-
() => [data, strategy],
328+
() => [data, strategy] as const,
329329
() => (strategy === 'client' ? getColumnValues(columnConfig, data) : []),
330330
{ key: `values-${columnConfig.id}` },
331331
);
332332

333333
const getUniqueValues: () => Map<string, number> | undefined = memo(
334-
() => [getValues(), strategy],
334+
() => [getValues(), strategy] as const,
335335
([values, strategy]) =>
336336
getFacetedUniqueValues(
337337
columnConfig as ColumnConfig<TData, ColumnDataType, unknown, string>,

packages/components/src/ui/select.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ export function Select({
234234
q.length > 0 &&
235235
options.some((o) => o.label.toLowerCase() === lower || o.value.toLowerCase() === lower);
236236
if (!creatable || !q || hasExactMatch) return null;
237-
const label = createOptionLabel?.(q) ?? `Create "${q}"`;
237+
const label = createOptionLabel?.(q) ?? `Select "${q}"`;
238238
return (
239239
<CommandItem
240240
key={`__create__-${q}`}

turbo.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
"cache": false
1313
},
1414
"type-check": {
15-
"outputs": ["**/*.ts", "**/*.tsx"]
15+
"dependsOn": ["^type-check"],
16+
"inputs": ["**/*.ts", "**/*.tsx", "tsconfig.json", "tsconfig.*.json"],
17+
"outputs": []
1618
},
1719
"dev": {
1820
"cache": false,

0 commit comments

Comments
 (0)