Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
MrWolfZ committed Nov 18, 2021
1 parent 9a315b3 commit ae3fc10
Show file tree
Hide file tree
Showing 109 changed files with 206,154 additions and 137,312 deletions.
9 changes: 1 addition & 8 deletions jest.transform.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,8 @@ const crypto = require('crypto')
const fs = require('fs')
const tsJest = require('ts-jest')

function removeJs(code) {
return code
.split('\n')
.map((line) => line.replace(/([}*] from '[^']+)\.js/g, '$1'))
.join('\n')
}

exports.process = (first, ...rest) =>
tsJest.createTransformer().process(removeJs(first), ...rest)
tsJest.default.createTransformer().process(first, ...rest)

exports.getCacheKey = () =>
crypto.createHash('sha256').update(fs.readFileSync(__filename)).digest('hex')
111,880 changes: 78,167 additions & 33,713 deletions package-lock.json

Large diffs are not rendered by default.

80 changes: 42 additions & 38 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,70 +39,74 @@
"author": "Jonathan Ziller <[email protected]> (https://www.github.com/MrWolfZ)",
"license": "MIT",
"devDependencies": {
"@angular-devkit/build-angular": "~0.1001.7",
"@angular/cli": "^10.2.1",
"@angular/common": "^10.2.4",
"@angular/compiler": "^10.2.4",
"@angular/compiler-cli": "^10.2.4",
"@angular/core": "^10.2.4",
"@angular/language-service": "^10.2.4",
"@angular/platform-browser": "^10.2.4",
"@angular/platform-browser-dynamic": "^10.2.4",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@angular-devkit/build-angular": "^12.0.0",
"@angular/cli": "^12.0.0",
"@angular/common": "^12.0.0",
"@angular/compiler": "^12.0.0",
"@angular/compiler-cli": "^12.0.0",
"@angular/core": "^12.0.0",
"@angular/language-service": "^12.0.0",
"@angular/platform-browser": "^12.0.0",
"@angular/platform-browser-dynamic": "^12.0.0",
"@commitlint/cli": "^15.0.0",
"@commitlint/config-conventional": "^15.0.0",
"@hot-loader/react-dom": "^16.14.0",
"@microsoft/api-extractor": "^7.13.0",
"@rollup/plugin-replace": "^2.3.4",
"@testing-library/react": "^11.2.3",
"@testing-library/react-hooks": "^3.7.0",
"@types/jest": "^26.0.20",
"@microsoft/api-extractor": "^7.18.19",
"@rollup/plugin-replace": "^3.0.0",
"@testing-library/react": "^12.1.2",
"@testing-library/react-hooks": "^7.0.2",
"@types/enzyme": "^3.9.3",
"@types/enzyme-adapter-react-16": "^1.0.6",
"@types/jasmine": "^3.10.2",
"@types/jasminewd2": "^2.0.10",
"@types/jest": "^27.0.2",
"@types/node": "^14.14.21",
"@types/pretty-time": "^1.1.0",
"@types/pretty-time": "^1.1.1",
"@types/react": "^16.14.2",
"@types/react-dom": "^16.9.10",
"@types/react-hot-loader": "^4.1.1",
"@types/react-redux": "^7.1.15",
"@types/react-router-dom": "^4.3.5",
"@types/react-router-dom": "^5.3.2",
"@types/react-test-renderer": "^16.9.4",
"@types/shelljs": "^0.8.8",
"@types/shelljs": "^0.8.9",
"@types/webpack-chain": "^5.2.0",
"@types/webpack-env": "^1.16.0",
"acorn": "^8.0.4",
"codecov": "^3.8.1",
"core-js": "^3.8.2",
"glob": "^7.1.6",
"@types/webpack-env": "^1.16.3",
"acorn": "^8.6.0",
"codecov": "^3.8.3",
"core-js": "^3.19.1",
"glob": "^7.2.0",
"husky": "^4.3.8",
"immer": "^7.0.15",
"jest": "^26.6.3",
"jest-silent-reporter": "^0.4.0",
"immer": "^9.0.6",
"jest": "^27.3.1",
"jest-silent-reporter": "^0.5.0",
"jest-transform-stub": "^2.0.0",
"lerna": "^3.22.1",
"npm-run-all": "^4.1.5",
"prettier": "^2.2.1",
"prettier": "^2.4.1",
"pretty-time": "^1.1.0",
"react": "^16.14.0",
"react-app-rewire-hot-loader": "^2.0.1",
"react-app-rewired": "^2.1.8",
"react-dom": "^16.14.0",
"react-hot-loader": "^4.13.0",
"react-scripts": "^3.4.4",
"react-scripts": "^4.0.3",
"react-test-renderer": "^16.14.0",
"redux": "^4.0.5",
"rollup": "^2.36.2",
"redux": "^4.1.2",
"redux-devtools-extension": "^2.13.9",
"rollup": "^2.60.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rxjs": "^6.6.3",
"shelljs": "^0.8.4",
"sorcery": "^0.10.0",
"staged-git-files": "^1.2.0",
"ts-jest": "^26.4.4",
"ts-node": "^9.1.1",
"tsd": "^0.14.0",
"tslib": "^2.1.0",
"ts-jest": "^27.0.7",
"ts-node": "^10.4.0",
"tsd": "^0.18.0",
"tslib": "^2.3.1",
"tslint": "^6.1.3",
"tslint-react": "^5.0.0",
"typescript": "^4.1.3",
"typescript": "~4.2.3",
"uglifyjs": "^2.4.11",
"yargs": "^16.2.0",
"zone.js": "~0.10.3"
"zone.js": "~0.11.4"
}
}
4 changes: 3 additions & 1 deletion packages/angular/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@ module.exports = {
moduleNameMapper: {
'^@simplux/core$': '<rootDir>/../core/index.ts',
'^@simplux/angular$': '<rootDir>/index.ts',
'^(.*)\\.js$': '$1',
},
modulePathIgnorePatterns: [
'<rootDir>/node_modules',
'<rootDir>/test-d',
'<rootDir>/dist',
],
transform: {
'\\.tsx?$': '../../jest.transform.cjs',
'\\.tsx?$': 'ts-jest',
},
testMatch: ['<rootDir>/src/**/*.spec.ts?(x)', '<rootDir>/e2e.spec.ts?(x)'],
reporters: [
'@jest/reporters/build/SummaryReporter.js',
['jest-silent-reporter', { useDots: true, showWarnings: true }],
],
testEnvironment: 'jsdom',
}
8 changes: 4 additions & 4 deletions packages/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
"@simplux/core": "0.18.0-alpha.12"
},
"devDependencies": {
"jest": "^26.6.3",
"jest": "^27.3.1",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.2",
"rollup": "^2.35.1",
"tsd": "^0.14.0",
"rollup": "^2.60.0",
"tsd": "^0.18.0",
"tslint": "^6.1.3",
"typescript": "^4.1.3"
"typescript": "~4.2.3"
},
"peerDependencies": {
"rxjs": ">=6.0.0"
Expand Down
4 changes: 3 additions & 1 deletion packages/browser-router/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@ module.exports = {
'^@simplux/core$': '<rootDir>/../core/index.ts',
'^@simplux/router$': '<rootDir>/../router/index.ts',
'^@simplux/browser-router$': '<rootDir>/index.ts',
'^(.*)\\.js$': '$1',
},
modulePathIgnorePatterns: [
'<rootDir>/node_modules',
'<rootDir>/test-d',
'<rootDir>/dist',
],
transform: {
'\\.tsx?$': '../../jest.transform.cjs',
'\\.tsx?$': 'ts-jest',
},
testMatch: ['<rootDir>/src/**/*.spec.ts?(x)', '<rootDir>/e2e.spec.ts'],
reporters: [
'@jest/reporters/build/SummaryReporter.js',
['jest-silent-reporter', { useDots: true, showWarnings: true }],
],
setupFilesAfterEnv: ['../../jest.setup.js'],
testEnvironment: 'jsdom',
}
8 changes: 4 additions & 4 deletions packages/browser-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@
},
"devDependencies": {
"@simplux/testing": "0.18.0-alpha.12",
"jest": "^26.6.3",
"jest": "^27.3.1",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.2",
"rollup": "^2.35.1",
"tsd": "^0.14.0",
"rollup": "^2.60.0",
"tsd": "^0.18.0",
"tslint": "^6.1.3",
"typescript": "^4.1.3"
"typescript": "~4.2.3"
},
"tsd": {
"compilerOptions": {
Expand Down
3 changes: 2 additions & 1 deletion packages/core/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ module.exports = {
moduleFileExtensions: ['ts', 'tsx', 'js'],
moduleNameMapper: {
'^@simplux/core$': '<rootDir>index.ts',
'^(.*)\\.js$': '$1',
},
modulePathIgnorePatterns: [
'<rootDir>/node_modules',
'<rootDir>/test-d',
'<rootDir>/dist',
],
transform: {
'\\.tsx?$': '../../jest.transform.cjs',
'\\.tsx?$': 'ts-jest',
},
testMatch: ['<rootDir>/src/**/*.spec.ts?(x)', '<rootDir>/e2e.spec.ts?(x)'],
reporters: [
Expand Down
12 changes: 6 additions & 6 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@
"license": "MIT",
"private": false,
"dependencies": {
"immer": "^7.0.15",
"redux": "^4.0.5"
"immer": "^9.0.6",
"redux": "^4.1.2"
},
"devDependencies": {
"jest": "^26.6.3",
"jest": "^27.3.1",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.2",
"rollup": "^2.35.1",
"tsd": "^0.14.0",
"rollup": "^2.60.0",
"tsd": "^0.18.0",
"tslint": "^6.1.3",
"typescript": "^4.1.3"
"typescript": "~4.2.3"
},
"tsd": {
"compilerOptions": {
Expand Down
9 changes: 5 additions & 4 deletions packages/core/src/immer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { produce } from 'immer'
import { Draft, produce } from 'immer'
import type { Reducer } from 'redux'

/**
Expand All @@ -18,9 +18,10 @@ export function createImmerReducer<TState>(
}

if (reducerActivationSemaphore === 1) {
state = produce(state, (draft) =>
wrappedMutatingReducer(draft as TState, action),
) as TState
state = produce<TState>(state, (draft) => {
const result = wrappedMutatingReducer(draft as TState, action)
return result as Draft<TState>
}) as TState
} else {
state = wrappedMutatingReducer(state, action)
}
Expand Down
20 changes: 19 additions & 1 deletion packages/core/src/mutations.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* @jest-environment jsdom
*/

import { createImmerReducer } from './immer.js'
import { SimpluxModule, SIMPLUX_MODULE } from './module.js'
import {
Expand Down Expand Up @@ -168,7 +172,7 @@ describe('mutations', () => {
moduleState = objectState as any

const { update } = createMutations(
(moduleMock as any) as SimpluxModule<typeof objectState>,
moduleMock as any as SimpluxModule<typeof objectState>,
{
// tslint:disable-next-line: no-unnecessary-callback-wrapper variable-name
update: (state, _arg1: string, _arg2: { nestedArg: boolean }) => {
Expand Down Expand Up @@ -311,6 +315,20 @@ describe('mutations', () => {
})
})

it('can take undefined as an argument with multiple arguments', () => {
const { increment } = createMutations(moduleMock, {
increment: (c, _: undefined, _2: number) => c + 1,
})

increment(undefined, 1)

expect(dispatchMock).toHaveBeenCalledWith({
type: '@simplux/test/mutation/increment',
mutationName: 'increment',
args: [undefined, 1],
})
})

it('can take nothing as an argument', () => {
const { increment } = createMutations(moduleMock, {
increment: (c) => c + 1,
Expand Down
4 changes: 3 additions & 1 deletion packages/react/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ module.exports = {
'^@simplux/core$': '<rootDir>/../core/index.ts',
'^@simplux/testing$': '<rootDir>/../testing/index.ts',
'^@simplux/react$': '<rootDir>/index.ts',
'^(.*)\\.js$': '$1',
},
modulePathIgnorePatterns: [
'<rootDir>/node_modules',
'<rootDir>/test-d',
'<rootDir>/dist',
],
transform: {
'\\.tsx?$': '../../jest.transform.cjs',
'\\.tsx?$': 'ts-jest',
},
testMatch: ['<rootDir>/src/**/*.spec.ts?(x)', '<rootDir>/e2e.spec.ts?(x)'],
reporters: [
'@jest/reporters/build/SummaryReporter.js',
['jest-silent-reporter', { useDots: true, showWarnings: true }],
],
testEnvironment: 'jsdom',
}
12 changes: 6 additions & 6 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@
},
"devDependencies": {
"@simplux/testing": "0.18.0-alpha.12",
"jest": "^26.6.3",
"jest": "^27.3.1",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.2",
"rollup": "^2.35.1",
"tsd": "^0.14.0",
"rollup": "^2.60.0",
"tsd": "^0.18.0",
"tslint": "^6.1.3",
"typescript": "^4.1.3"
"typescript": "~4.2.3"
},
"peerDependencies": {
"react": "^16.14.0",
"react-dom": "^16.14.0"
"react": ">=16.14.0",
"react-dom": ">=16.14.0"
},
"tsd": {
"compilerOptions": {
Expand Down
3 changes: 2 additions & 1 deletion packages/router/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ module.exports = {
moduleNameMapper: {
'^@simplux/core$': '<rootDir>/../core/index.ts',
'^@simplux/router$': '<rootDir>/index.ts',
'^(.*)\\.js$': '$1',
},
modulePathIgnorePatterns: [
'<rootDir>/node_modules',
'<rootDir>/test-d',
'<rootDir>/dist',
],
transform: {
'\\.tsx?$': '../../jest.transform.cjs',
'\\.tsx?$': 'ts-jest',
},
testMatch: ['<rootDir>/src/**/*.spec.ts?(x)', '<rootDir>/e2e.spec.ts'],
reporters: [
Expand Down
8 changes: 4 additions & 4 deletions packages/router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
},
"devDependencies": {
"@simplux/testing": "0.18.0-alpha.12",
"jest": "^26.6.3",
"jest": "^27.3.1",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.2",
"rollup": "^2.35.1",
"tsd": "^0.14.0",
"rollup": "^2.60.0",
"tsd": "^0.18.0",
"tslint": "^6.1.3",
"typescript": "^4.1.3"
"typescript": "~4.2.3"
},
"tsd": {
"compilerOptions": {
Expand Down
Loading

0 comments on commit ae3fc10

Please sign in to comment.