Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .boilerplate-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e6bdb64df32660638bc0fafbfec97f6365a03b63
81018841961fa40b00651c15444d45d4ca1018ce
13 changes: 0 additions & 13 deletions .github/workflows/resolve-yarn-lock-caller.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/resolve-yarn-lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
resolve-yarn-lock-on-comment:
name: '/'
name: 'Resolve yarn.lock'
if: contains(github.event.comment.body, '/resolve yarn.lock')
uses: technology-studio/github-workflows/.github/workflows/_resolve-yarn-lock.yml@main
secrets: inherit
Expand Down
3 changes: 1 addition & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
yarn git-hook

yarn -s lint-staged
1 change: 0 additions & 1 deletion .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
yarn commitlint --edit || exec < /dev/tty && yarn txo-cz --hook > /dev/null 2>&1 || true

12 changes: 11 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@
"name": "Debug Jest Tests",
"type": "node",
"request": "launch",
"runtimeArgs": ["--inspect-brk", "${workspaceRoot}/node_modules/.bin/jest", "--runInBand", "--coverage", "false"],
"runtimeArgs": ["--inspect-brk", "${workspaceRoot}/node_modules/.bin/jest", "--runInBand", "--coverage", "false", "${file}"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
{
"name": "Debug Jest Tests with yarn",
"type": "node",
"request": "launch",
"runtimeExecutable": "yarn",
"args": ["test", "--runInBand", "--coverage=false", "${file}"],
"runtimeArgs": ["--inspect-brk"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
Expand Down
2 changes: 1 addition & 1 deletion __tests__/Setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @Copyright: Technology Studio
**/

import './Config/LogConfig'
import 'Config/LogConfig'

// Mock your external modules here if needed
// jest
Expand Down
9 changes: 9 additions & 0 deletions __tests__/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
{
"extends": "../tsconfig-base.json",
"compilerOptions": {
"rootDir": "../",
"baseUrl": "../",
"paths": {
"Config/*": ["./__tests__/Config/*"],
"Data/*": ["./__tests__/Data/*"],
"Utils/*": ["./__tests__/Utils/*"],
"src": ["./src"],
"src/*": ["./src/*"]
}
},
"include": [
"./**/*.ts"
Expand Down
11 changes: 11 additions & 0 deletions eslint-ci-rules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
"@typescript-eslint/no-magic-numbers",
"eslint-comments/require-description",
"@typescript-eslint/consistent-indexed-object-style",
"@stylistic/space-before-function-paren",
"@typescript-eslint/prefer-destructuring",
"complexity",
"@stylistic/operator-linebreak",
"@typescript-eslint/no-unnecessary-condition",
"@typescript-eslint/consistent-type-exports"
]
13 changes: 13 additions & 0 deletions eslint-ci.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const ciRules = require('./eslint-ci-rules.json')

module.exports = (async function config() {
const { default: defaultConfigPromise } = await import('./eslint.config.js')
const defaultConfig = await defaultConfigPromise
return [
...defaultConfig,
{
files: ['**/*.ts', '**/*.tsx'],
rules: ciRules.reduce((acc, rule) => ({ ...acc, [rule]: 'warn' }), {}),
},
]
})()
12 changes: 4 additions & 8 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
const txoConfig = require('eslint-config-txo-typescript-react')

/** @type {import('eslint').Linter.FlatConfig[]} */
const config = [
...txoConfig.default,
]

module.exports = config
module.exports = (async function config() {
const txoPackageConfigList = await import('eslint-config-txo-package-react')
return txoPackageConfigList.configList
})()
9 changes: 4 additions & 5 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@
**/

const { pathsToModuleNameMapper } = require('ts-jest')
const { compilerOptions } = require('./tsconfig.json');
const { compilerOptions } = require('./__tests__/tsconfig.json');

const { defaults } = require('jest-config');

module.exports = {
preset: 'ts-jest',
cache: true,
cacheDirectory: '<rootDir>/node_modules/.cache/jest',
testEnvironment: 'node',
testMatch: [
'<rootDir>/__tests__/Tests/**/?(*.)(spec|test).ts'
],
transformIgnorePatterns: [
'/node_modules/(?!@txo).+\\.js$'
],
testPathIgnorePatterns: [
'/node_modules/'
],
Expand All @@ -29,7 +28,7 @@ module.exports = {
],
transform: {
'^.+\\.tsx?$': ['ts-jest', {
tsconfig: './__tests__/tsconfig.json'
tsconfig: '<rootDir>/__tests__/tsconfig.json'
}]
},
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths , { prefix: '<rootDir>/' } ),
Expand Down
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,23 @@
"license": "UNLICENSED",
"private": false,
"scripts": {
"build": "yarn build:clean && yarn build:lib",
"build:clean": "yarn rimraf lib",
"build:lib": "yarn tsc",
"build:watch": "yarn tsc --watch",
"test": "jest",
"test:watch": "concurrently \"yarn build:watch\" \"jest --watch\"",
"coverage": "jest --coverage && open coverage/lcov-report/index.html || xdg-open coverage/lcov-report/index.html",
"build": "yarn build:clean && yarn build:lib",
"compare-boilerplate-version": "./scripts/compare-boilerplate-version.sh",
"coverage": "jest --coverage && open coverage/lcov-report/index.html || xdg-open coverage/lcov-report/index.html",
"lint:ci": "yarn eslint -c eslint-ci.config.js --cache . && yarn txo-eslint ccr --cache",
"lint:fix": "eslint . --fix",
"lint": "eslint --max-warnings 0 .",
"fixcode": "eslint . --fix",
"git-hook": "yarn -s lint-staged",
"prepare": "husky && yarn build",
"print-txo-packages": "yarn list 2> /dev/null|grep @txo|sed 's/.*\\(@txo[^@]*\\)@^*\\([^ ]*\\).*/\\1@\\2/g'|sort|uniq",
"sanity": "yarn lint:ci && yarn build && tsc --noEmit && yarn test --coverage && yarn compare-boilerplate-version && echo 'success'",
"semantic-release": "semantic-release",
"update-boilerplate-version": "./scripts/update-boilerplate-version.sh",
"lint:ci": "yarn lint",
"type-check": "tsc --noEmit"
"test:watch": "concurrently \"yarn build:watch\" \"yarn test --watch\"",
"test": "jest",
"type-check": "tsc --noEmit",
"update-boilerplate-version": "./scripts/update-boilerplate-version.sh"
},
"engines": {
"node": ">=18.0.0"
Expand Down Expand Up @@ -64,7 +63,7 @@
"@types/react-native": "^0.73.0",
"@types/url-parse": "^1.4.11",
"concurrently": "^9.1.2",
"eslint-config-txo-typescript-react": "^2.0.82",
"eslint-config-txo-package-react": "^1.0.26",
"husky": "^9.1.7",
"jest": "^29.7.0",
"lint-staged": "^15.4.3",
Expand Down
Loading
Loading