0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

refactor: upgrade toolkit and update test config

This commit is contained in:
Gao Sun 2022-11-22 16:47:17 +08:00
parent e7b0de43b7
commit b48bfd3762
No known key found for this signature in database
GPG key ID: 13EBE123E4773688
17 changed files with 1001 additions and 1022 deletions

1
.npmrc
View file

@ -3,3 +3,4 @@ public-hoist-pattern[]=@parcel/*
public-hoist-pattern[]=postcss
public-hoist-pattern[]=process
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=buffer

View file

@ -1,23 +1,16 @@
import type { Config } from '@silverhand/jest-config';
import { merge } from '@silverhand/jest-config';
const config: Config.InitialOptions = merge({
// Preset: 'ts-jest/presets/default-esm',
// TransformIgnorePatterns: ['schemas'],
setupFilesAfterEnv: ['./jest.setup.ts'],
roots: ['./src'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
globals: {
'ts-jest': {
useESM: true,
diagnostics: {
ignoreCodes: [1343],
},
const config: Config.InitialOptions = {
...merge({
setupFilesAfterEnv: ['./jest.setup.ts'],
roots: ['./src'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
},
// ExtensionsToTreatAsEsm: ['.ts', '.tsx'],
});
}),
// Will update common config soon
transformIgnorePatterns: ['node_modules/(?!(.*(nanoid|jose|ky|@logto))/)'],
};
export default config;

View file

@ -19,17 +19,17 @@
},
"devDependencies": {
"@fontsource/roboto-mono": "^4.5.7",
"@logto/core-kit": "1.0.0-beta.21",
"@logto/language-kit": "1.0.0-beta.21",
"@logto/core-kit": "1.0.0-beta.25",
"@logto/language-kit": "1.0.0-beta.24",
"@logto/phrases": "workspace:^",
"@logto/phrases-ui": "workspace:^",
"@logto/react": "1.0.0-beta.13",
"@logto/schemas": "workspace:^",
"@mdx-js/react": "^1.6.22",
"@parcel/core": "2.7.0",
"@parcel/transformer-mdx": "2.7.0",
"@parcel/transformer-sass": "2.7.0",
"@parcel/transformer-svg-react": "2.7.0",
"@parcel/core": "2.8.0",
"@parcel/transformer-mdx": "2.8.0",
"@parcel/transformer-sass": "2.8.0",
"@parcel/transformer-svg-react": "2.8.0",
"@silverhand/eslint-config": "1.3.0",
"@silverhand/eslint-config-react": "1.3.0",
"@silverhand/essentials": "^1.3.0",
@ -49,9 +49,9 @@
"clean-deep": "^3.4.0",
"cross-env": "^7.0.3",
"csstype": "^3.0.11",
"date-fns": "^2.29.3",
"dayjs": "^1.10.5",
"deep-object-diff": "^1.1.7",
"date-fns": "^2.29.3",
"deepmerge": "^4.2.2",
"dnd-core": "^16.0.0",
"eslint": "^8.21.0",
@ -63,7 +63,7 @@
"lodash.get": "^4.4.2",
"lodash.kebabcase": "^4.1.1",
"nanoid": "^3.1.23",
"parcel": "2.7.0",
"parcel": "2.8.0",
"postcss": "^8.4.6",
"postcss-modules": "^4.3.0",
"prettier": "^2.7.1",

View file

@ -1,13 +1,17 @@
import type { Config } from '@silverhand/jest-config';
import { merge } from '@silverhand/jest-config';
const config: Config.InitialOptions = merge({
testPathIgnorePatterns: ['/core/connectors/'],
setupFilesAfterEnv: ['jest-matcher-specific-error', './jest.setup.ts'],
moduleNameMapper: {
'^#src/(.*)\\.js(x)?$': '<rootDir>/src/$1',
'^(\\.{1,2}/.*)\\.js$': '$1',
},
});
const config: Config.InitialOptions = {
...merge({
testPathIgnorePatterns: ['/core/connectors/'],
setupFilesAfterEnv: ['jest-matcher-specific-error', './jest.setup.ts'],
moduleNameMapper: {
'^#src/(.*)\\.js(x)?$': '<rootDir>/src/$1',
'^(\\.{1,2}/.*)\\.js$': '$1',
},
}),
// Will update common config soon
transformIgnorePatterns: ['node_modules/(?!(.*(nanoid|jose|ky|@logto))/)'],
};
export default config;

View file

@ -24,9 +24,9 @@
},
"dependencies": {
"@logto/cli": "workspace:^",
"@logto/connector-kit": "1.0.0-beta.23",
"@logto/core-kit": "^1.0.0-beta.18",
"@logto/language-kit": "1.0.0-beta.21",
"@logto/connector-kit": "1.0.0-beta.25",
"@logto/core-kit": "1.0.0-beta.25",
"@logto/language-kit": "1.0.0-beta.24",
"@logto/phrases": "workspace:^",
"@logto/phrases-ui": "workspace:^",
"@logto/schemas": "workspace:^",

View file

@ -4,6 +4,7 @@ import { createMockPool, createMockQueryResult, sql } from 'slonik';
import { mockConnector } from '#src/__mocks__/index.js';
import envSet from '#src/env-set/index.js';
import { DeletionError } from '#src/errors/SlonikError/index.js';
import type { QueryType } from '#src/utils/test-utils.js';
import { expectSqlAssert } from '#src/utils/test-utils.js';

View file

@ -16,13 +16,13 @@
"stylelint": "stylelint \"src/**/*.scss\""
},
"devDependencies": {
"@logto/core-kit": "1.0.0-beta.21",
"@logto/language-kit": "1.0.0-beta.21",
"@logto/core-kit": "1.0.0-beta.25",
"@logto/language-kit": "1.0.0-beta.24",
"@logto/phrases": "workspace:^",
"@logto/react": "1.0.0-beta.13",
"@logto/schemas": "workspace:^",
"@parcel/core": "2.7.0",
"@parcel/transformer-sass": "2.7.0",
"@parcel/core": "2.8.0",
"@parcel/transformer-sass": "2.8.0",
"@silverhand/eslint-config": "1.3.0",
"@silverhand/eslint-config-react": "1.3.0",
"@silverhand/ts-config": "1.2.1",
@ -34,14 +34,15 @@
"i18next": "^21.8.16",
"i18next-browser-languagedetector": "^6.1.4",
"lint-staged": "^13.0.0",
"parcel": "2.7.0",
"parcel": "2.8.0",
"postcss": "^8.4.6",
"prettier": "^2.7.1",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-i18next": "^11.18.3",
"stylelint": "^14.9.1",
"typescript": "^4.7.4"
"typescript": "^4.7.4",
"zod": "^3.19.1"
},
"engines": {
"node": "^16.13.0 || ^18.12.0"

View file

@ -1,8 +1,12 @@
import type { Config } from '@silverhand/jest-config';
import { merge } from '@silverhand/jest-config';
const config: Config.InitialOptions = merge({
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
});
const config: Config.InitialOptions = {
...merge({
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
}),
// Will update common config soon
transformIgnorePatterns: ['node_modules/(?!(.*(nanoid|jose|ky|@logto))/)'],
};
export default config;

View file

@ -1,4 +1,5 @@
import { merge, Config } from '@silverhand/jest-config';
import type { Config } from '@silverhand/jest-config';
import { merge } from '@silverhand/jest-config';
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires, unicorn/prefer-module
const config: Config.InitialOptions = merge(require('jest-puppeteer/jest-preset'));

View file

@ -32,8 +32,8 @@
"url": "https://github.com/logto-io/logto/issues"
},
"dependencies": {
"@logto/core-kit": "1.0.0-beta.21",
"@logto/language-kit": "1.0.0-beta.21",
"@logto/core-kit": "1.0.0-beta.25",
"@logto/language-kit": "1.0.0-beta.24",
"@silverhand/essentials": "^1.3.0",
"zod": "^3.19.1"
},

View file

@ -32,8 +32,8 @@
"url": "https://github.com/logto-io/logto/issues"
},
"dependencies": {
"@logto/core-kit": "1.0.0-beta.21",
"@logto/language-kit": "1.0.0-beta.21",
"@logto/core-kit": "1.0.0-beta.25",
"@logto/language-kit": "1.0.0-beta.24",
"@silverhand/essentials": "^1.3.0",
"zod": "^3.19.1"
},

View file

@ -1,10 +1,16 @@
import type { Config } from '@silverhand/jest-config';
import { merge } from '@silverhand/jest-config';
const config: Config.InitialOptions = merge({
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
});
const config: Config.InitialOptions = {
...merge({
// Will update common config soon
transformIgnorePatterns: ['node_modules/(?!(.*(nanoid|jose|ky|@logto))/)'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
}),
// Will update common config soon
transformIgnorePatterns: ['node_modules/(?!(.*(nanoid|jose|ky|@logto))/)'],
};
export default config;

View file

@ -68,9 +68,9 @@
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"dependencies": {
"@logto/connector-kit": "1.0.0-beta.23",
"@logto/core-kit": "1.0.0-beta.21",
"@logto/language-kit": "1.0.0-beta.21",
"@logto/connector-kit": "1.0.0-beta.25",
"@logto/core-kit": "1.0.0-beta.25",
"@logto/language-kit": "1.0.0-beta.24",
"@logto/phrases": "workspace:^",
"@logto/phrases-ui": "workspace:^",
"zod": "^3.19.1"

View file

@ -1,11 +1,15 @@
import type { Config } from '@silverhand/jest-config';
import { merge } from '@silverhand/jest-config';
const config: Config.InitialOptions = merge({
roots: ['./src'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
});
const config: Config.InitialOptions = {
...merge({
roots: ['./src'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
}),
// Will update common config soon
transformIgnorePatterns: ['node_modules/(?!(.*(nanoid|jose|ky|@logto))/)'],
};
export default config;

View file

@ -1,11 +1,16 @@
import { merge, Config } from '@silverhand/jest-config';
import type { Config } from '@silverhand/jest-config';
import { merge } from '@silverhand/jest-config';
const config: Config.InitialOptions = merge({
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/src/jest.setup.ts'],
transform: {
'\\.(svg)$': 'jest-transformer-svg',
},
});
const config: Config.InitialOptions = {
...merge({
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/src/jest.setup.ts'],
transform: {
'\\.(svg)$': 'jest-transformer-svg',
},
}),
// Will update common config soon
transformIgnorePatterns: ['node_modules/(?!(.*(nanoid|jose|ky|@logto))/)'],
};
export default config;

View file

@ -17,14 +17,14 @@
"test": "jest"
},
"devDependencies": {
"@logto/core-kit": "1.0.0-beta.21",
"@logto/language-kit": "1.0.0-beta.21",
"@logto/core-kit": "1.0.0-beta.25",
"@logto/language-kit": "1.0.0-beta.24",
"@logto/phrases": "workspace:^",
"@logto/phrases-ui": "workspace:^",
"@logto/schemas": "workspace:^",
"@parcel/core": "2.7.0",
"@parcel/transformer-sass": "2.7.0",
"@parcel/transformer-svg-react": "2.7.0",
"@parcel/core": "2.8.0",
"@parcel/transformer-sass": "2.8.0",
"@parcel/transformer-svg-react": "2.8.0",
"@peculiar/webcrypto": "^1.3.3",
"@silverhand/eslint-config": "1.3.0",
"@silverhand/eslint-config-react": "1.3.0",
@ -53,7 +53,7 @@
"ky": "^0.31.0",
"libphonenumber-js": "^1.9.49",
"lint-staged": "^13.0.0",
"parcel": "2.7.0",
"parcel": "2.8.0",
"postcss": "^8.4.6",
"postcss-modules": "^4.3.0",
"prettier": "^2.7.1",
@ -68,7 +68,8 @@
"stylelint": "^14.9.1",
"superstruct": "^0.16.0",
"typescript": "^4.7.4",
"use-debounced-loader": "^0.1.1"
"use-debounced-loader": "^0.1.1",
"zod": "^3.19.1"
},
"engines": {
"node": "^16.13.0 || ^18.12.0"

File diff suppressed because it is too large Load diff