0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-17 22:31:28 -05:00

refactor: misc. issue fix

This commit is contained in:
Gao Sun 2022-12-12 21:52:17 +08:00
parent 0558195a90
commit a805124437
No known key found for this signature in database
GPG key ID: 13EBE123E4773688
20 changed files with 29 additions and 23 deletions

View file

@ -61,8 +61,8 @@ jobs:
with:
node-version: ${{ matrix.node_version }}
- name: Prepack
run: pnpm prepack
- name: Build for test
run: pnpm -r build:test
- name: Test
run: pnpm ci:test

View file

@ -1,3 +1,4 @@
/** @type {import('jest').Config} */
const config = {
coveragePathIgnorePatterns: ['/node_modules/', '/src/__mocks__/'],
coverageReporters: ['text-summary', 'lcov'],

View file

@ -25,7 +25,7 @@
"precommit": "lint-staged",
"prepare:package-json": "node -p \"'export const packageJson = ' + JSON.stringify(require('./package.json'), undefined, 2) + ';'\" > src/package-json.ts",
"build": "rimraf lib && pnpm prepare:package-json && tsc -p tsconfig.build.json",
"build:test": "rm -rf lib/ && tsc -p tsconfig.test.json --sourcemap",
"build:test": "rimraf lib/ && pnpm prepare:package-json && tsc -p tsconfig.test.json --sourcemap",
"dev": "tsc -p tsconfig.build.json --watch --preserveWatchOutput --incremental",
"start": "node .",
"start:dev": "pnpm build && node .",
@ -33,7 +33,7 @@
"lint:report": "pnpm lint --format json --output-file report.json",
"test:only": "NODE_OPTIONS=--experimental-vm-modules jest",
"test": "pnpm build:test && pnpm test:only",
"test:ci": "pnpm run test",
"test:ci": "pnpm run test:only",
"prepack": "pnpm build"
},
"engines": {

View file

@ -4,7 +4,7 @@
"outDir": "lib",
"declaration": true,
"moduleResolution": "nodenext",
"module": "es2022",
"module": "esnext",
"target": "es2022",
"types": ["node", "jest"]
},

View file

@ -21,7 +21,7 @@
"start": "NODE_ENV=production node build/index.js",
"test:only": "NODE_OPTIONS=--experimental-vm-modules jest",
"test": "pnpm build:test && pnpm test:only",
"test:ci": "pnpm run test --coverage --silent",
"test:ci": "pnpm run test:only --coverage --silent",
"test:report": "codecov -F core"
},
"dependencies": {

View file

@ -2,7 +2,7 @@
"extends": "@silverhand/ts-config/tsconfig.base",
"compilerOptions": {
"moduleResolution": "nodenext",
"module": "es2022",
"module": "esnext",
"declaration": false,
"outDir": "build",
"baseUrl": ".",

View file

@ -15,7 +15,7 @@
"test": "pnpm build && pnpm test:api && pnpm test:ui",
"test:api": "pnpm test:only -i ./lib/tests/api",
"test:ui": "pnpm test:only -i --config=jest.config.ui.js ./lib/tests/ui",
"lint": "eslint --ext .ts src tests",
"lint": "eslint --ext .ts src",
"lint:report": "pnpm lint --format json --output-file report.json",
"start": "pnpm test"
},
@ -27,7 +27,6 @@
"@peculiar/webcrypto": "^1.3.3",
"@silverhand/eslint-config": "1.3.0",
"@silverhand/essentials": "^1.3.0",
"@silverhand/jest-config": "1.2.2",
"@silverhand/ts-config": "1.2.1",
"@types/jest": "^29.1.2",
"@types/jest-environment-puppeteer": "^5.0.2",
@ -43,7 +42,6 @@
"prettier": "^2.7.1",
"puppeteer": "^19.0.0",
"text-encoder": "^0.0.4",
"ts-node": "^10.9.1",
"typescript": "^4.9.4"
},
"engines": {

View file

@ -2,7 +2,12 @@ import { ApplicationType } from '@logto/schemas';
import { demoAppApplicationId } from '@logto/schemas/lib/seeds';
import { HTTPError } from 'got';
import { createApplication, getApplication, updateApplication, deleteApplication } from '#src/api/index.js';
import {
createApplication,
getApplication,
updateApplication,
deleteApplication,
} from '#src/api/index.js';
describe('admin console application', () => {
it('should get demo app details successfully', async () => {

View file

@ -23,6 +23,7 @@
"scripts": {
"precommit": "lint-staged",
"build": "rm -rf lib/ && tsc",
"build:test": "pnpm build",
"dev": "tsc --watch --preserveWatchOutput --incremental",
"lint": "eslint --ext .ts src",
"lint:report": "pnpm lint --format json --output-file report.json",

View file

@ -4,7 +4,7 @@
"outDir": "lib",
"declaration": true,
"moduleResolution": "nodenext",
"module": "es2022"
"module": "esnext"
},
"include": ["src"]
}

View file

@ -20,6 +20,7 @@
"scripts": {
"precommit": "lint-staged",
"build": "rm -rf lib/ && tsc",
"build:test": "pnpm build",
"dev": "tsc --watch --preserveWatchOutput --incremental",
"lint": "eslint --ext .ts src",
"lint:report": "pnpm lint --format json --output-file report.json",

View file

@ -4,7 +4,7 @@
"outDir": "lib",
"declaration": true,
"moduleResolution": "nodenext",
"module": "es2022"
"module": "esnext"
},
"include": [
"src"

View file

@ -1,3 +1,4 @@
/** @type {import('jest').Config} */
const config = {
coveragePathIgnorePatterns: ['/node_modules/', '/src/__mocks__/'],
coverageReporters: ['text-summary', 'lcov'],

View file

@ -20,14 +20,14 @@
"generate": "./generate.sh",
"build:alterations": "rm -rf alterations-js && tsc -p tsconfig.build.alterations.json",
"build": "pnpm generate && rm -rf lib/ && tsc -p tsconfig.build.json && pnpm build:alterations",
"build:test": "rm -rf lib/ && tsc -p tsconfig.test.json --sourcemap",
"build:test": "pnpm generate && rm -rf lib/ && tsc -p tsconfig.test.json --sourcemap",
"dev": "tsc -p tsconfig.build.json --watch --preserveWatchOutput --incremental",
"lint": "eslint --ext .ts src",
"lint:report": "pnpm lint --format json --output-file report.json",
"prepack": "pnpm build",
"test:only": "NODE_OPTIONS=--experimental-vm-modules jest",
"test": "pnpm build:test && pnpm test:only",
"test:ci": "pnpm run test"
"test:ci": "pnpm run test:only"
},
"engines": {
"node": "^16.13.0 || ^18.12.0"

View file

@ -4,7 +4,7 @@
"outDir": "lib",
"declaration": true,
"moduleResolution": "nodenext",
"module": "es2022"
"module": "esnext"
},
"include": [
"src",

View file

@ -1,3 +1,4 @@
/** @type {import('jest').Config} */
const config = {
coveragePathIgnorePatterns: ['/node_modules/', '/src/__mocks__/'],
coverageReporters: ['text-summary', 'lcov'],

View file

@ -29,7 +29,7 @@
"prepack": "pnpm build",
"test:only": "NODE_OPTIONS=--experimental-vm-modules jest",
"test": "pnpm build:test && pnpm test:only",
"test:ci": "pnpm run test"
"test:ci": "pnpm run test:only"
},
"devDependencies": {
"@silverhand/eslint-config": "1.3.0",

View file

@ -11,6 +11,8 @@ import {
conditionalSql,
} from './utils.js';
const { jest } = import.meta;
describe('conditionalSql()', () => {
it('returns empty sql when value is falsy', () => {
expect(conditionalSql(false, () => sql`select 1`)).toEqual({

View file

@ -5,7 +5,7 @@
"declaration": true,
"types": ["node", "jest"],
"moduleResolution": "nodenext",
"module": "es2022"
"module": "esnext"
},
"include": [
"src"

6
pnpm-lock.yaml generated
View file

@ -476,7 +476,6 @@ importers:
'@peculiar/webcrypto': ^1.3.3
'@silverhand/eslint-config': 1.3.0
'@silverhand/essentials': ^1.3.0
'@silverhand/jest-config': 1.2.2
'@silverhand/ts-config': 1.2.1
'@types/jest': ^29.1.2
'@types/jest-environment-puppeteer': ^5.0.2
@ -492,7 +491,6 @@ importers:
prettier: ^2.7.1
puppeteer: ^19.0.0
text-encoder: ^0.0.4
ts-node: ^10.9.1
typescript: ^4.9.4
devDependencies:
'@jest/types': 29.1.2
@ -502,7 +500,6 @@ importers:
'@peculiar/webcrypto': 1.3.3
'@silverhand/eslint-config': 1.3.0_eu7dlo3qq5moigliolva3udaxa
'@silverhand/essentials': 1.3.0
'@silverhand/jest-config': 1.2.2_ky6c64xxalg2hsll4xx3evq2dy
'@silverhand/ts-config': 1.2.1_typescript@4.9.4
'@types/jest': 29.1.2
'@types/jest-environment-puppeteer': 5.0.2
@ -510,7 +507,7 @@ importers:
dotenv: 16.0.0
eslint: 8.21.0
got: 12.5.3
jest: 29.1.2_k5ytkvaprncdyzidqqws5bqksq
jest: 29.1.2_@types+node@16.11.12
jest-puppeteer: 6.1.1_puppeteer@19.2.2
node-fetch: 2.6.7
openapi-schema-validator: 12.0.0
@ -518,7 +515,6 @@ importers:
prettier: 2.7.1
puppeteer: 19.2.2
text-encoder: 0.0.4
ts-node: 10.9.1_ace2mtubvwruu4qt46fm3vtq3a
typescript: 4.9.4
packages/phrases: