Skip to content

Commit 8657624

Browse files
committed
Rename lib files to kebab-case per contributing guidelines
product-filters.ts (was productFilters.ts) product-sort.ts (was productSort.ts)
1 parent 709f380 commit 8657624

File tree

8 files changed

+11
-15
lines changed

8 files changed

+11
-15
lines changed

templates/skeleton/app/components/CollectionFilters.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {useNavigate, useLocation} from 'react-router';
2-
import {applyFilter, removeFilter} from '~/lib/productFilters';
2+
import {applyFilter, removeFilter} from '~/lib/product-filters';
33
import type {ProductFilter} from '@shopify/hydrogen/storefront-api-types';
44
import {PriceRangeFilter} from './PriceRangeFilter';
55
import type {CollectionQuery} from 'storefrontapi.generated';

templates/skeleton/app/components/CollectionSort.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {useNavigate, useLocation} from 'react-router';
2-
import {applySortParam, type SortOption} from '~/lib/productSort';
2+
import {applySortParam, type SortOption} from '~/lib/product-sort';
33

44
export function CollectionSort({
55
sortOptions,

templates/skeleton/app/components/PriceRangeFilter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {useState, useEffect} from 'react';
22
import {useNavigate, useLocation} from 'react-router';
3-
import {applyFilter, removeFilter} from '~/lib/productFilters';
3+
import {applyFilter, removeFilter} from '~/lib/product-filters';
44
import type {ProductFilter} from '@shopify/hydrogen/storefront-api-types';
55

66
/**
File renamed without changes.
File renamed without changes.

templates/skeleton/app/routes/collections.$handle.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import {PaginatedResourceSection} from '~/components/PaginatedResourceSection';
55
import {redirectIfHandleIsLocalized} from '~/lib/redirect';
66
import {ProductItem} from '~/components/ProductItem';
77
import type {ProductItemFragment} from 'storefrontapi.generated';
8-
import {parseFiltersFromParams} from '~/lib/productFilters';
9-
import {parseSortParam, COLLECTION_SORT_OPTIONS} from '~/lib/productSort';
8+
import {parseFiltersFromParams} from '~/lib/product-filters';
9+
import {parseSortParam, COLLECTION_SORT_OPTIONS} from '~/lib/product-sort';
1010
import {CollectionFilters} from '~/components/CollectionFilters';
1111
import {CollectionSort} from '~/components/CollectionSort';
1212

templates/skeleton/app/routes/search.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import type {
1212
RegularSearchQuery,
1313
PredictiveSearchQuery,
1414
} from 'storefrontapi.generated';
15-
import {parseFiltersFromParams} from '~/lib/productFilters';
16-
import {parseSortParam, SEARCH_SORT_OPTIONS} from '~/lib/productSort';
15+
import {parseFiltersFromParams} from '~/lib/product-filters';
16+
import {parseSortParam, SEARCH_SORT_OPTIONS} from '~/lib/product-sort';
1717
import {CollectionFilters} from '~/components/CollectionFilters';
1818
import {CollectionSort} from '~/components/CollectionSort';
1919

templates/skeleton/storefrontapi.generated.d.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,9 +1103,7 @@ export type SearchPageFragment = {__typename: 'Page'} & Pick<
11031103
export type SearchArticleFragment = {__typename: 'Article'} & Pick<
11041104
StorefrontAPI.Article,
11051105
'handle' | 'id' | 'title' | 'trackingParameters'
1106-
> & {
1107-
blog: Pick<StorefrontAPI.Blog, 'handle'>;
1108-
};
1106+
> & {blog: Pick<StorefrontAPI.Blog, 'handle'>};
11091107

11101108
export type PageInfoFragmentFragment = Pick<
11111109
StorefrontAPI.PageInfo,
@@ -1137,9 +1135,7 @@ export type RegularSearchQuery = {
11371135
{__typename: 'Article'} & Pick<
11381136
StorefrontAPI.Article,
11391137
'handle' | 'id' | 'title' | 'trackingParameters'
1140-
> & {
1141-
blog: Pick<StorefrontAPI.Blog, 'handle'>;
1142-
}
1138+
> & {blog: Pick<StorefrontAPI.Blog, 'handle'>}
11431139
>;
11441140
};
11451141
pages: {
@@ -1350,7 +1346,7 @@ interface GeneratedQueryTypes {
13501346
return: BlogsQuery;
13511347
variables: BlogsQueryVariables;
13521348
};
1353-
'#graphql\n #graphql\n fragment MoneyProductItem on MoneyV2 {\n amount\n currencyCode\n }\n fragment ProductItem on Product {\n id\n handle\n title\n featuredImage {\n id\n altText\n url\n width\n height\n }\n priceRange {\n minVariantPrice {\n ...MoneyProductItem\n }\n maxVariantPrice {\n ...MoneyProductItem\n }\n }\n }\n\n query Collection(\n $handle: String!\n $country: CountryCode\n $language: LanguageCode\n $first: Int\n $last: Int\n $startCursor: String\n $endCursor: String\n ) @inContext(country: $country, language: $language) {\n collection(handle: $handle) {\n id\n handle\n title\n description\n products(\n first: $first,\n last: $last,\n before: $startCursor,\n after: $endCursor\n ) {\n nodes {\n ...ProductItem\n }\n pageInfo {\n hasPreviousPage\n hasNextPage\n endCursor\n startCursor\n }\n }\n }\n }\n': {
1349+
'#graphql\n #graphql\n fragment MoneyProductItem on MoneyV2 {\n amount\n currencyCode\n }\n fragment ProductItem on Product {\n id\n handle\n title\n featuredImage {\n id\n altText\n url\n width\n height\n }\n priceRange {\n minVariantPrice {\n ...MoneyProductItem\n }\n maxVariantPrice {\n ...MoneyProductItem\n }\n }\n }\n\n query Collection(\n $handle: String!\n $country: CountryCode\n $language: LanguageCode\n $first: Int\n $last: Int\n $startCursor: String\n $endCursor: String\n $filters: [ProductFilter!]\n $sortKey: ProductCollectionSortKeys\n $reverse: Boolean\n ) @inContext(country: $country, language: $language) {\n collection(handle: $handle) {\n id\n handle\n title\n description\n products(\n first: $first,\n last: $last,\n before: $startCursor,\n after: $endCursor,\n filters: $filters,\n sortKey: $sortKey,\n reverse: $reverse\n ) {\n filters {\n id\n label\n type\n values {\n id\n label\n count\n input\n swatch {\n color\n image {\n previewImage {\n url\n }\n }\n }\n }\n }\n nodes {\n ...ProductItem\n }\n pageInfo {\n hasPreviousPage\n hasNextPage\n endCursor\n startCursor\n }\n }\n }\n }\n': {
13541350
return: CollectionQuery;
13551351
variables: CollectionQueryVariables;
13561352
};
@@ -1378,7 +1374,7 @@ interface GeneratedQueryTypes {
13781374
return: ProductQuery;
13791375
variables: ProductQueryVariables;
13801376
};
1381-
'#graphql\n query RegularSearch(\n $country: CountryCode\n $endCursor: String\n $first: Int\n $language: LanguageCode\n $last: Int\n $term: String!\n $startCursor: String\n ) @inContext(country: $country, language: $language) {\n articles: search(\n query: $term,\n types: [ARTICLE],\n first: $first,\n ) {\n nodes {\n ...on Article {\n ...SearchArticle\n }\n }\n }\n pages: search(\n query: $term,\n types: [PAGE],\n first: $first,\n ) {\n nodes {\n ...on Page {\n ...SearchPage\n }\n }\n }\n products: search(\n after: $endCursor,\n before: $startCursor,\n first: $first,\n last: $last,\n query: $term,\n sortKey: RELEVANCE,\n types: [PRODUCT],\n unavailableProducts: HIDE,\n ) {\n nodes {\n ...on Product {\n ...SearchProduct\n }\n }\n pageInfo {\n ...PageInfoFragment\n }\n }\n }\n #graphql\n fragment SearchProduct on Product {\n __typename\n handle\n id\n publishedAt\n title\n trackingParameters\n vendor\n selectedOrFirstAvailableVariant(\n selectedOptions: []\n ignoreUnknownOptions: true\n caseInsensitiveMatch: true\n ) {\n id\n image {\n url\n altText\n width\n height\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n selectedOptions {\n name\n value\n }\n product {\n handle\n title\n }\n }\n }\n\n #graphql\n fragment SearchPage on Page {\n __typename\n handle\n id\n title\n trackingParameters\n }\n\n #graphql\n fragment SearchArticle on Article {\n __typename\n handle\n id\n title\n trackingParameters\n }\n\n #graphql\n fragment PageInfoFragment on PageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n\n': {
1377+
'#graphql\n query RegularSearch(\n $country: CountryCode\n $endCursor: String\n $first: Int\n $language: LanguageCode\n $last: Int\n $term: String!\n $startCursor: String\n $productFilters: [ProductFilter!]\n $sortKey: SearchSortKeys\n $reverse: Boolean\n ) @inContext(country: $country, language: $language) {\n articles: search(\n query: $term,\n types: [ARTICLE],\n first: $first,\n ) {\n nodes {\n ...on Article {\n ...SearchArticle\n }\n }\n }\n pages: search(\n query: $term,\n types: [PAGE],\n first: $first,\n ) {\n nodes {\n ...on Page {\n ...SearchPage\n }\n }\n }\n products: search(\n after: $endCursor,\n before: $startCursor,\n first: $first,\n last: $last,\n query: $term,\n productFilters: $productFilters,\n sortKey: $sortKey,\n reverse: $reverse,\n types: [PRODUCT],\n unavailableProducts: HIDE,\n ) {\n nodes {\n ...on Product {\n ...SearchProduct\n }\n }\n productFilters {\n id\n label\n type\n values {\n id\n label\n count\n input\n swatch {\n color\n image {\n previewImage {\n url\n }\n }\n }\n }\n }\n pageInfo {\n ...PageInfoFragment\n }\n }\n }\n #graphql\n fragment SearchProduct on Product {\n __typename\n handle\n id\n publishedAt\n title\n trackingParameters\n vendor\n selectedOrFirstAvailableVariant(\n selectedOptions: []\n ignoreUnknownOptions: true\n caseInsensitiveMatch: true\n ) {\n id\n image {\n url\n altText\n width\n height\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n selectedOptions {\n name\n value\n }\n product {\n handle\n title\n }\n }\n }\n\n #graphql\n fragment SearchPage on Page {\n __typename\n handle\n id\n title\n trackingParameters\n }\n\n #graphql\n fragment SearchArticle on Article {\n __typename\n handle\n id\n title\n trackingParameters\n blog {\n handle\n }\n }\n\n #graphql\n fragment PageInfoFragment on PageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n\n': {
13821378
return: RegularSearchQuery;
13831379
variables: RegularSearchQueryVariables;
13841380
};

0 commit comments

Comments
 (0)