fix(config): rename project config file from smartconfig.json to .smartconfig.json
This commit is contained in:
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"json.schemas": [
|
||||
{
|
||||
"fileMatch": ["/smartconfig.json"],
|
||||
"fileMatch": ["/.smartconfig.json"],
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
"dist_ts_web/**/*",
|
||||
"assets/**/*",
|
||||
"cli.js",
|
||||
"smartconfig.json",
|
||||
".smartconfig.json",
|
||||
"readme.md"
|
||||
],
|
||||
"browserslist": [
|
||||
|
||||
@@ -18,7 +18,7 @@ pnpm add @push.rocks/smartconfig
|
||||
|
||||
### Why smartconfig?
|
||||
|
||||
- **🎛️ Centralized Configuration**: Manage all your tool configs in one `smartconfig.json` file
|
||||
- **🎛️ Centralized Configuration**: Manage all your tool configs in one `.smartconfig.json` file
|
||||
- **💾 Persistent Storage**: Smart key-value store with multiple storage strategies
|
||||
- **🔐 Environment Mapping**: Sophisticated env var handling with automatic type conversion
|
||||
- **🏗️ TypeScript First**: Full type safety and IntelliSense support
|
||||
@@ -29,7 +29,7 @@ pnpm add @push.rocks/smartconfig
|
||||
|
||||
### 1. Smartconfig Configuration Management
|
||||
|
||||
Stop scattering configuration across dozens of files. Centralize everything in `smartconfig.json`:
|
||||
Stop scattering configuration across dozens of files. Centralize everything in `.smartconfig.json`:
|
||||
|
||||
```typescript
|
||||
import { Smartconfig } from '@push.rocks/smartconfig';
|
||||
@@ -42,13 +42,13 @@ const smartconfig = new Smartconfig('/path/to/project');
|
||||
|
||||
// Get merged configuration for any tool
|
||||
const eslintConfig = smartconfig.dataFor<EslintConfig>('eslint', {
|
||||
// Default values if not in smartconfig.json
|
||||
// Default values if not in .smartconfig.json
|
||||
extends: 'standard',
|
||||
rules: {}
|
||||
});
|
||||
```
|
||||
|
||||
**smartconfig.json example:**
|
||||
**.smartconfig.json example:**
|
||||
```json
|
||||
{
|
||||
"eslint": {
|
||||
|
||||
@@ -58,7 +58,7 @@ export class Smartconfig {
|
||||
*/
|
||||
private checkLookupPath() {
|
||||
if (this.cwd) {
|
||||
this.lookupPath = plugins.path.join(this.cwd, 'smartconfig.json');
|
||||
this.lookupPath = plugins.path.join(this.cwd, '.smartconfig.json');
|
||||
} else {
|
||||
this.lookupPath = paths.configFile;
|
||||
}
|
||||
|
||||
@@ -19,4 +19,4 @@ export let home = plugins.smartpath.get.home();
|
||||
export let kvUserHomeDirBase = plugins.path.join(home, '.smartconfig/kv');
|
||||
|
||||
// files
|
||||
export let configFile = plugins.path.join(cwd, 'smartconfig.json');
|
||||
export let configFile = plugins.path.join(cwd, '.smartconfig.json');
|
||||
|
||||
Reference in New Issue
Block a user