Skip to content

Commit

Permalink
Dependency maintenance:
Browse files Browse the repository at this point in the history
- Upgrading packages, most notably `rxjs` to v7
- Removing unused packages: `tsdx`, `@vue/reactivity`, `@types/webpack`
- Replacing compromised `faker` package with `@faker-js/faker` fork
  • Loading branch information
andersstorhaug committed Feb 4, 2022
1 parent 55ac595 commit 805fcb6
Show file tree
Hide file tree
Showing 10 changed files with 15,301 additions and 12,824 deletions.
10 changes: 7 additions & 3 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
queue_rules:
- name: default
method: squash
conditions: []

pull_request_rules:
- name: automatic merge when GitHub branch protection passes (others)
conditions:
- base=master
- -author~=^dependabot(|-preview)\[bot\]$
- 'label=:shipit: merge'
actions:
merge:
method: squash
strict: smart+fasttrack
queue:
name: default
- name: auto merge github-actions
conditions:
- 'label=github-actions'
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
globals: {
'ts-jest': {
compiler: 'typescript',
tsConfig: {
tsconfig: {
importHelpers: true,
target: 'ES6',
module: 'commonjs',
Expand Down
28,009 changes: 15,242 additions & 12,767 deletions package-lock.json

Large diffs are not rendered by default.

63 changes: 29 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,48 +33,43 @@
},
"homepage": "https://github.com/david-driscoll/DynamicDataJs#readme",
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/plugin-transform-for-of": "^7.10.4",
"@babel/preset-env": "^7.11.5",
"@babel/preset-typescript": "^7.10.4",
"@types/faker": "^5.1.0",
"@types/jest": "^26.0.13",
"@types/node": "^14.10.1",
"@types/webpack": "^4.41.22",
"@typescript-eslint/eslint-plugin": "^4.1.0",
"@typescript-eslint/parser": "^4.1.0",
"@vue/reactivity": "^3.0.0-rc.10",
"babel-jest": "^26.3.0",
"cross-env": "^7.0.2",
"eslint": "^7.9.0",
"eslint-config-prettier": "^6.11.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.22.0",
"@babel/core": "^7.17.0",
"@babel/plugin-transform-for-of": "^7.16.7",
"@babel/preset-env": "^7.16.11",
"@babel/preset-typescript": "^7.16.7",
"@faker-js/faker": "^6.0.0-alpha.5",
"@types/jest": "^27.4.0",
"@types/node": "^17.0.14",
"@typescript-eslint/eslint-plugin": "^5.10.2",
"@typescript-eslint/parser": "^5.10.2",
"babel-jest": "^27.4.6",
"cross-env": "^7.0.3",
"eslint": "^8.8.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-standard": "^17.0.0-1",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-unicorn": "^21.0.0",
"faker": "^5.1.0",
"husky": "^4.3.0",
"ix": "^4.0.0",
"jest": "^26.4.2",
"lint-staged": "^10.3.0",
"prettier": "^2.1.1",
"rxjs": "^6.6.3",
"ts-jest": "^26.3.0",
"ts-node": "^9.0.0",
"tsdx": "^0.13.3",
"typedoc": "^0.19.1",
"typescript": "^4.0.2"
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-unicorn": "^40.1.0",
"husky": "^7.0.4",
"ix": "^4.5.2",
"jest": "^27.4.7",
"lint-staged": "^12.3.3",
"prettier": "^2.5.1",
"rxjs": "^7.5.2",
"ts-jest": "^27.1.3",
"ts-node": "^10.4.0",
"typedoc": "^0.22.11",
"typescript": "^4.5.5"
},
"dependencies": {
"binary-search": "^1.3.6",
"fast-deep-equal": "^3.1.3"
},
"peerDependencies": {
"ix": "^4.0.0",
"rxjs": "^6.0.0"
"rxjs": "^7.0.0"
},
"lint-staged": {
"*.{ts}": [
Expand Down
2 changes: 1 addition & 1 deletion src/cache/DynamicDataError.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export type DynamicDataError<TObject, TKey> = { key: TKey; value: TObject; error: Error };
export type DynamicDataError<TObject, TKey> = { key: TKey; value: TObject; error: unknown };
5 changes: 4 additions & 1 deletion src/cache/operators/expireAfter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { Disposable } from '../../util';
import { NotifyPropertyChangedType } from '../../notify/notifyPropertyChangedSymbol';
import { ISourceCache, isSourceCache } from '../ISourceCache';
import { isObservableCache } from '../IObservableCache';
import { isScheduler } from 'rxjs/internal-compatibility';
import { MonoTypeChangeSetOperatorFunction } from '../ChangeSetOperatorFunction';

/**
Expand Down Expand Up @@ -139,4 +138,8 @@ export function expireAfter<TObject, TKey>(
});
});
};

function isScheduler(value: any): value is SchedulerLike {
return value && typeof value.schedule === 'function';
}
}
22 changes: 11 additions & 11 deletions src/cache/operators/transformPromise.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { merge, Observable, OperatorFunction } from 'rxjs';
import { merge, Observable, lastValueFrom } from 'rxjs';
import { IChangeSet } from '../IChangeSet';
import { ChangeAwareCache } from '../ChangeAwareCache';
import { DynamicDataError } from '../DynamicDataError';
Expand Down Expand Up @@ -44,7 +44,7 @@ export function transformPromise<TSource, TKey, TDestination>(
}
| {
change: Change<TSource, TKey>;
error: Error;
error: unknown;
success: false;
key: TKey;
};
Expand Down Expand Up @@ -82,25 +82,25 @@ export function transformPromise<TSource, TKey, TDestination>(
ixMap(([key, value]) => Change.update(key, value.source, value.source)),
);

const transformed = await from(toTransform)
.pipe(
const transformed = await lastValueFrom(
from(toTransform).pipe(
map(z => transform(z)),
mergeAll(maximumConcurrency),
toArray(),
)
.toPromise();
),
);

return processUpdates(cache, transformed);
}

async function doTransformChanges(cache: ChangeAwareCache<TransformedItemContainer, TKey>, changes: IChangeSet<TSource, TKey>): Promise<IChangeSet<TDestination, TKey>> {
const transformed = await from(changes)
.pipe(
const transformed = await lastValueFrom(
from(changes).pipe(
map(z => transform(z)),
mergeAll(maximumConcurrency),
toArray(),
)
.toPromise();
),
);
return processUpdates(cache, transformed);
}

Expand Down Expand Up @@ -177,7 +177,7 @@ export function transformPromise<TSource, TKey, TDestination>(
};
}

function createTransformError(change: Change<TSource, TKey>, error: Error) {
function createTransformError(change: Change<TSource, TKey>, error: unknown) {
return {
success: false as const,
error,
Expand Down
4 changes: 2 additions & 2 deletions test/cache/GroupFromDistinctFixture.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { PersonEmpKey, PersonEmployment } from '../domain/PersonEmployment';
import { Person } from '../domain/Person';
import { count, every, from, range, toArray } from 'ix/iterable';
import { map, flatMap } from 'ix/iterable/operators';
import faker from 'faker';
import faker from '@faker-js/faker';
import { PersonWithEmployment } from '../domain/PersonWithEmployment';
import { groupOn } from '../../src/cache/operators/groupOn';
import { distinctValues } from '../../src/cache/operators/distinctValues';
Expand Down Expand Up @@ -39,7 +39,7 @@ describe('GroupFromDistinctFixture', () => {
const emphistory = toArray(
range(1, numberOfPeople).pipe(
flatMap(i => {
const companiestogenrate = faker.random.number({ min: 0, max: 4 });
const companiestogenrate = faker.datatype.number({ min: 0, max: 4 });
return range(0, companiestogenrate).pipe(map(c => new PersonEmployment(`Person${i}`, companies[c])));
}),
),
Expand Down
2 changes: 1 addition & 1 deletion test/cache/SortObservableFixtureFixture.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { randomPersonGenerator } from '../domain/RandomPersonGenerator';
import { ISortedChangeSet } from '../../src/cache/ISortedChangeSet';
import { toArray, range, from, last } from 'ix/iterable';
import { map, orderBy, orderByDescending, take } from 'ix/iterable/operators';
import faker from 'faker';
import faker from '@faker-js/faker';

describe('SortObservableFixture', () => {
let _cache: ISourceCache<Person, string> & ISourceUpdater<Person, string>;
Expand Down
6 changes: 3 additions & 3 deletions test/domain/RandomPersonGenerator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { range } from 'ix/iterable';
import { map } from 'ix/iterable/operators';
import faker from 'faker';
import faker from '@faker-js/faker';
import { Person } from './Person';

export function randomPersonGenerator(number = 10000, seed?: number) {
Expand All @@ -9,8 +9,8 @@ export function randomPersonGenerator(number = 10000, seed?: number) {
}
return range(0, number).pipe(
map(() => {
const gender = faker.random.number(1);
return new Person(faker.name.firstName() + ' ' + faker.name.lastName(), faker.random.number({ min: 1, max: 100 }), gender ? 'F' : 'M');
const gender = faker.datatype.number(1);
return new Person(faker.name.firstName() + ' ' + faker.name.lastName(), faker.datatype.number({ min: 1, max: 100 }), gender ? 'F' : 'M');
}),
);
}

0 comments on commit 805fcb6

Please sign in to comment.