Skip to content

Commit

Permalink
refactor: shorten imports
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Jan 4, 2024
1 parent 72ab545 commit ccc9bfd
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion apps/delivery-options/src/composables/useActiveCarrier.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {type Ref} from 'vue';
import {asyncComputed, useMemoize} from '@vueuse/core';
import {type CarrierIdentifier} from '@myparcel-do/shared';
import {getResolvedCarrier} from '../utils/getResolvedCarrier';
import {getResolvedCarrier} from '../utils';
import {type ResolvedCarrier} from '../types';

export const useActiveCarrier = useMemoize((carrier: CarrierIdentifier): Ref<ResolvedCarrier> => {
Expand Down
2 changes: 1 addition & 1 deletion apps/sandbox/src/components/AutoAnchor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<script lang="ts" setup>
import {toRefs} from 'vue';
import {useAnchorLink} from '../composables/useAnchorLink';
import {useAnchorLink} from '../composables';
const props = defineProps<{name: string; label?: string}>();
const propRefs = toRefs(props);
Expand Down
2 changes: 1 addition & 1 deletion libs/shared/src/sdk/useCarrierRequest.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {type EndpointResponse, type GetCarrier} from '@myparcel/sdk';
import {resolveCarrierName} from '../utils';
import {type CarrierIdentifier, type RequestHandler} from '../types';
import {REQUEST_KEY_CARRIERS} from '../data/constants';
import {REQUEST_KEY_CARRIERS} from '../data';
import {useSdk} from '../composables';
import {useRequest} from './useRequest';

Expand Down
3 changes: 1 addition & 2 deletions libs/shared/src/sdk/useCarriersRequest.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import {describe, expect, it} from 'vitest';
import {get} from '@vueuse/core';
import {type Carrier} from '@myparcel/sdk';
import {REQUEST_KEY_CARRIERS} from '../data/constants';
import {fakeCarriersResponse} from '../__tests__';
import {REQUEST_KEY_CARRIERS} from '../data';
import {useRequestClient} from './useRequestClient';
import {useCarriersRequest} from './useCarriersRequest';

Expand Down
2 changes: 1 addition & 1 deletion libs/shared/src/sdk/useCarriersRequest.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {type EndpointResponse, type GetCarriers} from '@myparcel/sdk';
import {type RequestHandler} from '../types';
import {REQUEST_KEY_CARRIERS} from '../data/constants';
import {REQUEST_KEY_CARRIERS} from '../data';
import {useSdk} from '../composables';
import {useRequestClient} from './useRequestClient';
import {useRequest} from './useRequest';
Expand Down
2 changes: 1 addition & 1 deletion libs/shared/src/sdk/useDeliveryOptionsRequest.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {type EndpointParameters, type EndpointResponse, type GetDeliveryOptions} from '@myparcel/sdk';
import {type RequestHandler} from '../types';
import {REQUEST_KEY_DELIVERY_OPTIONS} from '../data/constants';
import {REQUEST_KEY_DELIVERY_OPTIONS} from '../data';
import {useSdk} from '../composables';
import {useRequest} from './useRequest';

Expand Down
2 changes: 1 addition & 1 deletion libs/shared/src/sdk/usePickupLocationsRequest.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {type EndpointParameters, type EndpointResponse, type GetPickupLocations} from '@myparcel/sdk';
import {type RequestHandler} from '../types';
import {REQUEST_KEY_PICKUP_LOCATIONS} from '../data/constants';
import {REQUEST_KEY_PICKUP_LOCATIONS} from '../data';
import {useSdk} from '../composables';
import {useRequest} from './useRequest';

Expand Down
4 changes: 2 additions & 2 deletions libs/shared/src/types/platform.types.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {type CarrierName} from '@myparcel/constants';
import {type SubscriptionType} from '../data/enums';
import {
type SubscriptionType,
type SUPPORTED_DELIVERY_TYPES,
type SUPPORTED_PACKAGE_TYPES,
type SUPPORTED_PLATFORMS,
type SUPPORTED_SHIPMENT_OPTIONS,
} from '../data/constants';
} from '../data';
import {type ConfigKey} from './config.types';

export type SupportedPlatformName = (typeof SUPPORTED_PLATFORMS)[number];
Expand Down
2 changes: 1 addition & 1 deletion libs/shared/src/utils/getCarrierConfiguration.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {describe, expect, it} from 'vitest';
import {CarrierName, PlatformName} from '@myparcel/constants';
import {type CarrierIdentifier, type SupportedPlatformName} from '../types';
import {SUPPORTED_PLATFORMS} from '../data/constants';
import {SUPPORTED_PLATFORMS} from '../data';
import {getCarrierConfiguration} from './getCarrierConfiguration';

describe('getCarrierConfiguration', () => {
Expand Down
2 changes: 1 addition & 1 deletion libs/shared/src/utils/getFullCarrier.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {describe, expect, it} from 'vitest';
import {get, useMemoize} from '@vueuse/core';
import {type CarrierIdentifier, type FullCarrier, type SupportedPlatformName} from '../types';
import {useCarrierRequest} from '../sdk';
import {SUPPORTED_PLATFORMS} from '../data/constants';
import {SUPPORTED_PLATFORMS} from '../data';
import {useFullCarrier} from '../composables';
import {resolveCarrierName} from './resolveCarrierName';
import {getCarrierConfiguration} from './getCarrierConfiguration';
Expand Down
2 changes: 1 addition & 1 deletion libs/shared/src/utils/getPlatformConfig.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {describe, expect, it} from 'vitest';
import {type SupportedPlatformName} from '../types';
import {SUPPORTED_PLATFORMS} from '../data/constants';
import {SUPPORTED_PLATFORMS} from '../data';
import {getPlatformConfig} from './getPlatformConfig';

describe('getPlatformConfig', () => {
Expand Down
4 changes: 2 additions & 2 deletions libs/shared/src/validator/validateDropOffDays.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import {isNumber} from 'radash';
import {isOfType} from '@myparcel/ts-utils';
import {type DropOffEntryObject} from '../types';
import {
CarrierSetting,
DAY_SATURDAY,
DAY_SUNDAY,
DROP_OFF_CUTOFF_TIME,
DROP_OFF_SAME_DAY_CUTOFF_TIME,
DROP_OFF_WEEKDAY,
} from '../data/constants';
import {CarrierSetting} from '../data';
} from '../data';
import {validateIsTime} from './validateIsTime';
import {validateIsInRange} from './validateIsInRange';
import {createValueMustBe} from './strings';
Expand Down

0 comments on commit ccc9bfd

Please sign in to comment.