Skip to content

Commit

Permalink
build: update hexancore (#11)
Browse files Browse the repository at this point in the history
* build: update hexancore

* chore: release 0.16.0

* fix: config provider
Mararok authored Jun 29, 2024
1 parent 1709cba commit 97e1c1c
Showing 6 changed files with 106 additions and 248 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.16.0] - 2024-06-29

### Changed

- updated @hexancore/core to ^0.16.2
- updated @hexancore/common to ^0.15.0
- updated mysql2 to ^3.10.1

## [0.15.0] - 2024-06-24

### Changed
@@ -71,7 +79,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- First release(start from 0.12 for consistency)
- Implemented generic from domain infrastructre from Hexancore

[unreleased] https://github.com/hexancore/typeorm/compare/0.15.0...HEAD
[unreleased] https://github.com/hexancore/typeorm/compare/0.16.0...HEAD
[0.16.0] https://github.com/hexancore/typeorm/compare/0.15.0...0.16.0
[0.15.0] https://github.com/hexancore/typeorm/compare/0.14.0...0.15.0
[0.14.0] https://github.com/hexancore/typeorm/compare/0.13.3...0.14.0
[0.13.3] https://github.com/hexancore/typeorm/compare/0.13.2...0.13.3
24 changes: 10 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hexancore/typeorm",
"version": "0.15.0",
"version": "0.16.0",
"type": "commonjs",
"engines": {
"node": ">=22"
@@ -32,11 +32,11 @@
}
},
"peerDependencies": {
"@hexancore/common": "^0.14.0",
"@hexancore/core": "^0.15.1",
"@hexancore/common": "^0.15.0",
"@hexancore/core": "^0.16.2",
"mariadb": "^3.3.1",
"mysql2": "^3.6.5",
"pg": "^8.11.3",
"mysql2": "^3.10.1",
"pg": "^8.12.0",
"typeorm": "^0.3.20"
},
"peerDependenciesMeta": {
@@ -57,8 +57,8 @@
"zod": "^3.23.8"
},
"devDependencies": {
"@hexancore/common": "^0.14.0",
"@hexancore/core": "^0.15.4",
"@hexancore/common": "^0.15.0",
"@hexancore/core": "^0.16.2",
"@hexancore/mocker": "^1.1.2",
"@nestjs/cli": "^10.3.2",
"@nestjs/common": "^10.3.9",
@@ -69,14 +69,10 @@
"@nestjs/swagger": "^7.1.8",
"@nestjs/testing": "^10.3.9",
"@types/jest": "29.0.*",
"@types/js-yaml": "^4.0.5",
"@types/lambda-log": "^3.0.0",
"@types/node": "^20.10.5",
"@types/pg": "^8",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"axios": "^1.5.1",
"axios-mock-adapter": "^1.22.0",
"eslint": "^8.3.0",
"eslint-plugin-unused-imports": "^3.0.0",
"jest": "29.6.*",
@@ -85,9 +81,9 @@
"jest-runner": "29.6.*",
"jest-runner-groups": "^2.2.0",
"mariadb": "^3.3.1",
"mysql2": "^3.6.5",
"mysql2": "^3.10.1",
"nestjs-cls": "^4.3.0",
"pg": "^8.11.3",
"pg": "^8.12.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
@@ -122,4 +118,4 @@
"prepublish": "yarn run build",
"deps:upgrade": "yarn add -D @hexancore/common @hexancore/core"
}
}
}
7 changes: 3 additions & 4 deletions src/HcTypeOrmModule.ts
Original file line number Diff line number Diff line change
@@ -53,10 +53,9 @@ const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN } = new ConfigurableModule
provide: DataSourceFactory,
inject: [CONFIG_TOKEN, AppConfig],
useFactory: (typeOrmConfig: any, config: AppConfig) => {
const secret = config.secrets.getAsBasicAuth(typeOrmConfig.authSecretKey);
secret.panicIfError();
typeOrmConfig.commonDataSourceConfig.username = secret.v.username;
typeOrmConfig.commonDataSourceConfig.password = secret.v.password;
const auth = config.getSecretAsBasicAuth(typeOrmConfig.authSecretKey);
typeOrmConfig.commonDataSourceConfig.username = auth.username;
typeOrmConfig.commonDataSourceConfig.password = auth.password;

return new DataSourceFactory({
common: typeOrmConfig.commonDataSourceConfig,
2 changes: 1 addition & 1 deletion src/HcTypeOrmModuleConfigProvider.ts
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ export const HcTypeOrmModuleConfigProvider = (moduleOptionsToken: string | symbo
inject: [AppConfig, moduleOptionsToken],
useFactory: (config: AppConfig, options: HcTypeOrmModuleOptions) => {
const configPath = options.configPath ?? 'core.typeorm';
const c = config.config.get(configPath);
const c = config.getOrPanic(configPath);
const parsedConfig = parseConfig(c);

const isProd = AppMeta.get().isProd();
3 changes: 1 addition & 2 deletions test/config.ts
Original file line number Diff line number Diff line change
@@ -2,11 +2,10 @@ import 'reflect-metadata';
import { AppMeta, EnvAppMetaProvider } from '@hexancore/common';
import path from 'path';
import { existsSync, mkdirSync } from 'fs';
import '@hexancore/common/testutil';
import '@hexancore/common/testing/jest';

process.env['APP_ENV'] = 'test';
process.env['APP_ID'] = 'core';
AppMeta.setProvider(EnvAppMetaProvider);

process.env['TEST_TMP_DIR'] = path.join(__dirname, 'tmp');
if (!existsSync(process.env['TEST_TMP_DIR'])) {
307 changes: 81 additions & 226 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 97e1c1c

Please sign in to comment.