Skip to content

Commit

Permalink
chore(npm): update @effect/* packages
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieMason committed Jul 31, 2023
1 parent ea6cacf commit 3db1bc4
Show file tree
Hide file tree
Showing 27 changed files with 308 additions and 276 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
"Tom Fletcher (https://github.com/tom-fletcher)"
],
"dependencies": {
"@effect/data": "0.12.9",
"@effect/io": "0.27.0",
"@effect/match": "0.24.5",
"@effect/schema": "0.21.0",
"@effect/data": "0.17.1",
"@effect/io": "0.37.1",
"@effect/match": "0.31.0",
"@effect/schema": "0.32.0",
"chalk": "4.1.2",
"commander": "11.0.0",
"cosmiconfig": "8.2.0",
Expand Down
6 changes: 3 additions & 3 deletions src/bin-fix-mismatches/effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import { logGroupHeader } from '../lib/log-group-header';

export const fixMismatchesEffects: VersionEffects<void> = {
onFilteredOut() {
return Effect.unit();
return Effect.unit;
},
onIgnored() {
return Effect.unit();
return Effect.unit;
},
onValid() {
return Effect.unit();
return Effect.unit;
},
onBanned(input) {
return Effect.sync(() => removeVersions(input));
Expand Down
8 changes: 4 additions & 4 deletions src/bin-lint-semver-ranges/effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import { logGroupHeader } from '../lib/log-group-header';

export const lintSemverRangesEffects: SemverRangeEffects<void> = {
onFilteredOut() {
return Effect.unit();
return Effect.unit;
},
onIgnored() {
return Effect.unit();
return Effect.unit;
},
onValid() {
return Effect.unit();
return Effect.unit;
},
onSemverRangeMismatch(input) {
return Effect.sync(() => pipe(input, logHeader, logRangeMismatch));
Expand All @@ -29,7 +29,7 @@ export const lintSemverRangesEffects: SemverRangeEffects<void> = {
return Effect.sync(() => pipe(input, logHeader, logRangeMismatch));
},
onComplete() {
return Effect.unit();
return Effect.unit;
},
};

Expand Down
8 changes: 4 additions & 4 deletions src/bin-list-mismatches/effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import { logGroupHeader } from '../lib/log-group-header';

export const listMismatchesEffects: VersionEffects<void> = {
onFilteredOut() {
return Effect.unit();
return Effect.unit;
},
onIgnored() {
return Effect.unit();
return Effect.unit;
},
onValid() {
return Effect.unit();
return Effect.unit;
},
onBanned(input) {
return Effect.sync(() => pipe(input, logHeader, logBanned));
Expand All @@ -42,7 +42,7 @@ export const listMismatchesEffects: VersionEffects<void> = {
return Effect.sync(() => pipe(input, logHeader, logLocalPackageMismatch));
},
onComplete() {
return Effect.unit();
return Effect.unit;
},
};

Expand Down
4 changes: 2 additions & 2 deletions src/bin-list/effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { logGroupHeader } from '../lib/log-group-header';

export const listEffects: VersionEffects<void> = {
onFilteredOut() {
return Effect.unit();
return Effect.unit;
},
onIgnored(input) {
return Effect.sync(() => pipe(input, logHeader, logIgnored));
Expand Down Expand Up @@ -44,7 +44,7 @@ export const listEffects: VersionEffects<void> = {
return Effect.sync(() => pipe(input, logHeader, logFixableMismatch));
},
onComplete() {
return Effect.unit();
return Effect.unit;
},
};

Expand Down
20 changes: 10 additions & 10 deletions src/bin-prompt/effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@ import { logGroupHeader } from '../lib/log-group-header';

export const promptEffects: VersionEffects<void> = {
onFilteredOut() {
return Effect.unit();
return Effect.unit;
},
onIgnored() {
return Effect.unit();
return Effect.unit;
},
onValid() {
return Effect.unit();
return Effect.unit;
},
onBanned() {
return Effect.unit();
return Effect.unit;
},
onHighestSemverMismatch() {
return Effect.unit();
return Effect.unit;
},
onLowestSemverMismatch() {
return Effect.unit();
return Effect.unit;
},
onPinnedMismatch() {
return Effect.unit();
return Effect.unit;
},
onSameRangeMismatch(input) {
return pipe(
Expand All @@ -37,7 +37,7 @@ export const promptEffects: VersionEffects<void> = {
);
},
onSnappedToMismatch() {
return Effect.unit();
return Effect.unit;
},
onNonSemverMismatch(input) {
return pipe(
Expand All @@ -46,10 +46,10 @@ export const promptEffects: VersionEffects<void> = {
);
},
onLocalPackageMismatch() {
return Effect.unit();
return Effect.unit;
},
onComplete() {
return Effect.unit();
return Effect.unit;
},
};

Expand Down
8 changes: 4 additions & 4 deletions src/bin-set-semver-ranges/effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import type { SemverGroupReport } from '../get-semver-groups';

export const setSemverRangesEffects: SemverRangeEffects<void> = {
onFilteredOut() {
return Effect.unit();
return Effect.unit;
},
onIgnored() {
return Effect.unit();
return Effect.unit;
},
onValid() {
return Effect.unit();
return Effect.unit;
},
onSemverRangeMismatch(input) {
return Effect.sync(() => setVersions(input));
Expand All @@ -27,7 +27,7 @@ export const setSemverRangesEffects: SemverRangeEffects<void> = {
return Effect.sync(() => setVersions(input));
},
onComplete() {
return Effect.unit();
return Effect.unit;
},
};

Expand Down
36 changes: 18 additions & 18 deletions src/bin-update/effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,37 +31,37 @@ let fetchCount = 0;

export const updateEffects: VersionEffects<InputWithVersions | void> = {
onFilteredOut() {
return Effect.unit();
return Effect.unit;
},
onIgnored() {
return Effect.unit();
return Effect.unit;
},
onValid(input) {
return fetchPackageVersions(input);
},
onBanned() {
return Effect.unit();
return Effect.unit;
},
onHighestSemverMismatch(input) {
return fetchPackageVersions(input);
},
onLowestSemverMismatch() {
return Effect.unit();
return Effect.unit;
},
onPinnedMismatch() {
return Effect.unit();
return Effect.unit;
},
onSameRangeMismatch(input) {
return fetchPackageVersions(input);
},
onSnappedToMismatch() {
return Effect.unit();
return Effect.unit;
},
onNonSemverMismatch() {
return Effect.unit();
return Effect.unit;
},
onLocalPackageMismatch() {
return Effect.unit();
return Effect.unit;
},
onComplete(ctx, results) {
return promptForUpdates(results);
Expand Down Expand Up @@ -122,7 +122,7 @@ function fetchPackageVersions<T extends VersionGroupReport.Any>(input: Input<T>)
function promptForUpdates(results: Array<InputWithVersions | void>) {
spinner.stop();
return pipe(
Effect.Do(),
Effect.Do,
Effect.bind('choices', () =>
Effect.sync(() =>
results.reduce((arr: ChoiceAndResult[], result): ChoiceAndResult[] => {
Expand Down Expand Up @@ -157,8 +157,8 @@ function promptForUpdates(results: Array<InputWithVersions | void>) {
),
),
Effect.bind('chosenUpdates', ({ choices }) =>
Effect.tryCatchPromise(
() =>
Effect.tryPromise({
try: () =>
prompts([
{
name: 'indexes',
Expand All @@ -172,8 +172,8 @@ function promptForUpdates(results: Array<InputWithVersions | void>) {
])
.then(({ indexes = [] }: { indexes: number[] }) => ({ choices, indexes }))
.then(({ choices, indexes }) => indexes.map((i) => choices[i]!.result)),
() => new Error('Prompt failed'),
),
catch: () => new Error('Prompt failed'),
}),
),
Effect.flatMap(({ chosenUpdates }) =>
Effect.sync(() => {
Expand All @@ -186,7 +186,7 @@ function promptForUpdates(results: Array<InputWithVersions | void>) {
});
}),
),
Effect.catchAll(() => Effect.unit()),
Effect.catchAll(() => Effect.unit),
);
}

Expand All @@ -210,10 +210,10 @@ function fetchUrl(url: string): Effect.Effect<never, HttpError | JsonParseError,
});
}),
Effect.flatMap((body) =>
Effect.tryCatch(
() => JSON.parse(body),
(err) => new JsonParseError({ error: String(err) }),
),
Effect.try({
try: () => JSON.parse(body),
catch: (err) => new JsonParseError({ error: String(err) }),
}),
),
);
}
2 changes: 1 addition & 1 deletion src/bin-update/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function update(cli: Partial<CliConfig>, env: DefaultEnv) {
Effect.flatMap(writeIfChanged),
Effect.flatMap(exitIfInvalid),
Effect.catchTags(createErrorHandlers(defaultErrorHandlers)),
Effect.withParallelism(10),
Effect.withConcurrency(10),
Effect.provideContext(
pipe(Context.empty(), Context.add(CliConfigTag, cli), Context.add(EnvTag, createEnv(env))),
),
Expand Down
3 changes: 2 additions & 1 deletion src/create-program/semver-ranges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function createSemverRangesProgram<T extends SemverRangeEffects<any>>(
return pipe(
getSemverGroups(ctx),
Effect.flatMap((semverGroups) =>
Effect.allPar(
Effect.all(
semverGroups.flatMap((group) =>
group.inspect().map((reportEffect, index) =>
pipe(
Expand Down Expand Up @@ -51,6 +51,7 @@ export function createSemverRangesProgram<T extends SemverRangeEffects<any>>(
),
),
),
{ concurrency: 'inherit' },
),
),
Effect.flatMap((results) => effects.onComplete(ctx, results)),
Expand Down
3 changes: 2 additions & 1 deletion src/create-program/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function createVersionsProgram<T extends VersionEffects<any>>(
return pipe(
getVersionGroups(ctx),
Effect.flatMap((versionGroups) =>
Effect.allPar(
Effect.all(
versionGroups.flatMap((group) =>
group.inspect().map((reportEffect, index) =>
pipe(
Expand Down Expand Up @@ -66,6 +66,7 @@ export function createVersionsProgram<T extends VersionEffects<any>>(
),
),
),
{ concurrency: 'inherit' },
),
),
Effect.flatMap((results) => effects.onComplete(ctx, results)),
Expand Down

0 comments on commit 3db1bc4

Please sign in to comment.