Skip to content

Commit

Permalink
perf(imports): skip barrel files where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieMason committed Feb 18, 2023
1 parent be637f0 commit 1ee2776
Show file tree
Hide file tree
Showing 19 changed files with 33 additions and 23 deletions.
3 changes: 2 additions & 1 deletion src/bin-fix-mismatches/fix-mismatches.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { isObject, isUndefined } from 'expect-more';
import { isObject } from 'expect-more/dist/is-object';
import { isUndefined } from 'expect-more/dist/is-undefined';
import type { Syncpack } from '../types';

export function fixMismatches(ctx: Syncpack.Ctx): Syncpack.Ctx {
Expand Down
4 changes: 3 additions & 1 deletion src/bin-format/format.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { isArray, isNonEmptyString, isObject } from 'expect-more';
import { isArray } from 'expect-more/dist/is-array';
import { isNonEmptyString } from 'expect-more/dist/is-non-empty-string';
import { isObject } from 'expect-more/dist/is-object';
import type { Syncpack } from '../types';

export function format(ctx: Syncpack.Ctx): Syncpack.Ctx {
Expand Down
2 changes: 1 addition & 1 deletion src/get-context/get-config/get-custom-types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isObject } from 'expect-more';
import { isObject } from 'expect-more/dist/is-object';
import type { Syncpack } from '../../types';

type Options = Pick<Partial<Syncpack.Config.Public>, 'customTypes'>;
Expand Down
8 changes: 3 additions & 5 deletions src/get-context/get-config/get-enabled-types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import {
isArrayOfStrings,
isNonEmptyArray,
isNonEmptyString,
} from 'expect-more';
import { isArrayOfStrings } from 'expect-more/dist/is-array-of-strings';
import { isNonEmptyArray } from 'expect-more/dist/is-non-empty-array';
import { isNonEmptyString } from 'expect-more/dist/is-non-empty-string';
import type { Syncpack } from '../../types';

type Options = Pick<
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { R } from '@mobily/ts-belt';
import { O, pipe } from '@mobily/ts-belt';
import { isNonEmptyString } from 'expect-more';
import { isNonEmptyString } from 'expect-more/dist/is-non-empty-string';
import { BaseError } from '../../../../lib/error';
import { props } from '../../../get-package-json-files/get-patterns/props';
import type { PackageJsonFile } from '../../../get-package-json-files/package-json-file';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { O, pipe, R } from '@mobily/ts-belt';
import { isObject } from 'expect-more';
import { isObject } from 'expect-more/dist/is-object';
import { BaseError } from '../../../lib/error';
import { props } from '../../get-package-json-files/get-patterns/props';
import { getNonEmptyStringProp } from './lib/get-non-empty-string-prop';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { O, pipe, R } from '@mobily/ts-belt';
import { isNonEmptyString, isObject } from 'expect-more';
import { isNonEmptyString } from 'expect-more/dist/is-non-empty-string';
import { isObject } from 'expect-more/dist/is-object';
import { BaseError } from '../../../lib/error';
import { props } from '../../get-package-json-files/get-patterns/props';
import { getNonEmptyStringProp } from './lib/get-non-empty-string-prop';
Expand Down
3 changes: 2 additions & 1 deletion src/get-context/get-config/path-strategy/version-string.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { O, pipe, R } from '@mobily/ts-belt';
import { isNonEmptyString, isObject } from 'expect-more';
import { isNonEmptyString } from 'expect-more/dist/is-non-empty-string';
import { isObject } from 'expect-more/dist/is-object';
import { BaseError } from '../../../lib/error';
import { props } from '../../get-package-json-files/get-patterns/props';
import { getNonEmptyStringProp } from './lib/get-non-empty-string-prop';
Expand Down
3 changes: 2 additions & 1 deletion src/get-context/get-config/path-strategy/versions-by-name.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { O, pipe, R } from '@mobily/ts-belt';
import { isNonEmptyObject, isObject } from 'expect-more';
import { isNonEmptyObject } from 'expect-more/dist/is-non-empty-object';
import { isObject } from 'expect-more/dist/is-object';
import { BaseError } from '../../../lib/error';
import { props } from '../../get-package-json-files/get-patterns/props';
import type { Strategy } from './types';
Expand Down
2 changes: 1 addition & 1 deletion src/get-context/get-groups/base-group.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isNonEmptyArray } from 'expect-more';
import { isNonEmptyArray } from 'expect-more/dist/is-non-empty-array';
import minimatch from 'minimatch';
import type { Syncpack } from '../../types';
import type { Instance } from '../get-package-json-files/package-json-file/instance';
Expand Down
2 changes: 1 addition & 1 deletion src/get-context/get-groups/version-group/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isNonEmptyString } from 'expect-more';
import { isNonEmptyString } from 'expect-more/dist/is-non-empty-string';
import type { Syncpack } from '../../../types';
import { BaseGroup } from '../base-group';
import { InstanceGroup } from './instance-group';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { coerce, eq, gt, valid } from 'semver';
import coerce from 'semver/functions/coerce';
import eq from 'semver/functions/eq';
import gt from 'semver/functions/gt';
import valid from 'semver/functions/valid';
import { RANGE } from '../../../../constants';
import { isSemver } from '../../../../lib/is-semver';

Expand Down
3 changes: 2 additions & 1 deletion src/get-context/get-package-json-files/get-file-paths.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { A, flow, pipe, R } from '@mobily/ts-belt';
import { isArrayOfStrings, isEmptyArray } from 'expect-more';
import { isArrayOfStrings } from 'expect-more/dist/is-array-of-strings';
import { isEmptyArray } from 'expect-more/dist/is-empty-array';
import { $R } from '../$R';
import type { Disk } from '../../lib/disk';
import { BaseError } from '../../lib/error';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { A, F, pipe, R } from '@mobily/ts-belt';
import { isArrayOfStrings } from 'expect-more';
import { isArrayOfStrings } from 'expect-more/dist/is-array-of-strings';
import { DEFAULT_SOURCES } from '../../../constants';
import type { Disk } from '../../../lib/disk';
import { BaseError } from '../../../lib/error';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isArrayOfStrings } from 'expect-more';
import { isArrayOfStrings } from 'expect-more/dist/is-array-of-strings';
import { props } from '../props';

// Yarn's config for this can be in more than one place
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { O } from '@mobily/ts-belt';
import { isNumber, isString, isUndefined } from 'expect-more';
import { isNumber } from 'expect-more/dist/is-number';
import { isString } from 'expect-more/dist/is-string';
import { isUndefined } from 'expect-more/dist/is-undefined';
import { props } from './props';

it('Some when value is found and passes predicate', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/disk.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cosmiconfigSync } from 'cosmiconfig';
import { isNonEmptyObject } from 'expect-more';
import { isNonEmptyObject } from 'expect-more/dist/is-non-empty-object';
import {
readFileSync,
readJsonSync,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/is-semver.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isString } from 'expect-more';
import { isString } from 'expect-more/dist/is-string';
import { RANGE } from '../constants';
import type { Syncpack } from '../types';

Expand Down
2 changes: 1 addition & 1 deletion src/lib/log.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import chalk from 'chalk';
import { isString } from 'expect-more';
import { isString } from 'expect-more/dist/is-string';
import { inspect } from 'util';
import { ICON } from '../constants';
import type { SemverGroup } from '../get-context/get-groups/semver-group';
Expand Down

0 comments on commit 1ee2776

Please sign in to comment.