![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@hapiness/config
Advanced tools
Configuration module based on node-config & js-yaml libraries.
yarn
or npm
it in your package.json
$ npm install --save @h@hapiness/config
or
$ yarn add @hapiness/config
"dependencies": {
"@hapiness/config": "^1.2.1",
//...
}
//...
./config/default.yml
:
my:
config: test
Node.js Script
:
import { Config } from '@hapiness/config';
if (Config.has('my.config')) {
console.log(Config.get('my.config')); // output: 'test'
}
./config/default.yml
:
external_service:
baseUrl: 'test'
mymodule_database:
provider: postgresql
hostname: localhost
user: pguser
password: keyboard cat
Hapiness module
:
// external-module.ts
import {
HapinessModule,
CoreModuleWithProviders,
InjectionToken,
Inject,
Optional,
} from '@hapiness/core';
import { ConfigHelper, ConfigInterface } from '@hapiness/config';
@HapinessModule({
...
})
export class ExternalModule {
static setConfig(config: ConfigInterface): CoreModuleWithProviders {
return {
module: ExternalModule,
providers: [ConfigHelpers.getProvider('mymodule_database', config)]
};
}
}
export class Service {
constructor(@Optional() @Inject(ConfigHelper.getInjectionToken('mymodule_database')) config) { // @Optional to not throw errors if config is not passed
...
}
}
// main-module.ts
import {
HapinessModule,
} from '@hapiness/core';
import { ExternalModule } from 'external-module';
import { Config } from '@hapiness/config';
@HapinessModule({
...
imports: [ ExternalModule.setConfig(Config.get('mymodule_database')) ]
})
...
Hapiness service
:
// main-module.ts
import {
HapinessModule,
} from '@hapiness/core';
import { ConfigHelper, Config } from '@hapiness/config';
import { MyCustomService } from './services';
@HapinessModule({
...
providers: [
ConfigHelper.getProvider('external_service'),
MyCustomService,
...
]
})
...
import { Injectable } from '@hapiness/core';
import { ConfigInterface } from '@hapiness/config';
// my-custom-service.ts
@Injectable()
class MyCustomService {
private _baseUrl: string;
constrcutor(
@Inject(ConfigHelper.getInjectionToken('external_service'))
private _config: ConfigInterface
) {}
connect() {
this._baseUrl = this._config.get<string>('baseUrl');
}
}
...
get()
was a falsy value and wrongly interpreted as undefinedpeerDependencies
config
Config
module.Julien Fauville | Antoine Gomez | Sébastien Ritz | Nicolas Jessel |
Copyright (c) 2018 Hapiness Licensed under the MIT license.
FAQs
Configuration Library to use it inside Hapiness framework
The npm package @hapiness/config receives a total of 0 weekly downloads. As such, @hapiness/config popularity was classified as not popular.
We found that @hapiness/config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.