Skip to content

Commit d35f475

Browse files
committed
Extracts core logic to @envguard/core and renames Node.js package
Moves shared business logic, including keychain, config, and manifest management, into a new internal `packages/core` monorepo package. This enhances reusability and establishes a clear separation of concerns. The `@envguard/core` package is not published to npm but is bundled into the CLI and Node.js runtime packages, allowing them to be standalone. Updates `@envguard/cli` and `@envguard/node` to depend on the new core package, streamlining their internal structure. Renames the `packages/runner-node` directory and `@envguard/runner-node` package to `packages/node` for brevity and simplified naming. Adjusts documentation and CI configuration to reflect these structural changes.
1 parent 1d4d636 commit d35f475

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+373
-434
lines changed

.github/workflows/publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ jobs:
4040
- name: Install dependencies
4141
run: pnpm install --frozen-lockfile
4242

43+
# Build all packages (core + cli + node)
44+
# Note: @envguard/core is bundled into cli and node, not published separately
4345
- name: Build packages
4446
run: pnpm build
4547

CLAUDE.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,24 @@ EnvGuard is a **local-first secret management tool for developers** that stores
1010

1111
### Monorepo Structure
1212

13-
This is a **pnpm workspace monorepo** with three main packages:
13+
This is a **pnpm workspace monorepo** with four main packages:
14+
15+
- **`packages/core/`** - Core business logic (`@envguard/core`) **[INTERNAL - NOT PUBLISHED]**
16+
- Shared keychain integration, secret storage, validation logic
17+
- Bundled into CLI and Node runtime packages
18+
- Not published to npm (private package)
1419

1520
- **`packages/cli/`** - Main EnvGuard CLI application (`@envguard/cli`)
16-
- Contains the command-line interface and core logic
17-
- Binary entry point: `envguard` command
18-
- Core modules for keychain integration, secret storage, validation, and Git integration
21+
- Command-line interface for managing secrets
22+
- Binary entry point: `envg` command
23+
- Bundles `@envguard/core` for standalone use
1924

2025
- **`packages/node/`** - Node.js runtime integration (`@envguard/node`)
2126
- Provides runtime secret injection for Node.js applications
22-
- Used as `envguard-node app.js` or via Node.js preload module
27+
- Bundles `@envguard/core` for standalone use
28+
- Used via `import` or `--require` flag
2329

24-
- **`packages/runner-python/`** - Python runtime integration (planned)
25-
- Python package for secret injection in Python applications
30+
- **Future:** Python/Go/Rust runtime integrations (separate repositories)
2631

2732
### Core Concepts
2833

config-tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"**/*.config.mjs",
77
"vitest.config.ts",
88
"vitest.workspace.ts",
9+
"packages/core/tsup.config.ts",
910
"packages/cli/tsup.config.ts",
10-
"packages/runner-node/tsup.config.ts"
11+
"packages/node/tsup.config.ts"
1112
]
1213
}

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"pack:check": "npm pack --dry-run"
6666
},
6767
"dependencies": {
68-
"@napi-rs/keyring": "1.1.0",
68+
"@envguard/core": "workspace:*",
6969
"chalk": "^5.3.0",
7070
"commander": "^11.1.0",
7171
"conf": "^12.0.0",

packages/cli/src/commands/check.action.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
import fs from 'fs/promises';
88
import path from 'path';
9-
import { SystemKeychain } from '../core';
10-
import { ConfigManager } from '../core/config/config.manager';
11-
import { ManifestManager } from '../core/manifest/manifest.manager';
9+
import { SystemKeychain } from '@envguard/core';
10+
import { ConfigManager } from '@envguard/core';
11+
import { ManifestManager } from '@envguard/core';
1212
import { error, success, verbose, warn, info, LogTag } from '../utils/logger';
1313

1414
interface SecurityIssue {

packages/cli/src/commands/copy.action.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
*/
66

77
import inquirer from 'inquirer';
8-
import { SystemKeychain } from '../core';
9-
import { ConfigManager } from '../core/config/config.manager';
10-
import { ManifestManager } from '../core/manifest/manifest.manager';
8+
import { SystemKeychain } from '@envguard/core';
9+
import { ConfigManager } from '@envguard/core';
10+
import { ManifestManager } from '@envguard/core';
1111
import { error, success, verbose, info, LogTag, warn } from '../utils/logger';
1212

1313
export interface CopyOptions {

packages/cli/src/commands/del.action.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* @description Implementation of the del command
55
*/
66

7-
import { SystemKeychain } from '../core';
8-
import { ConfigManager } from '../core/config/config.manager';
7+
import { SystemKeychain } from '@envguard/core';
8+
import { ConfigManager } from '@envguard/core';
99
import { error, success, verbose, LogTag } from '../utils/logger';
1010

1111
/**

packages/cli/src/commands/edit.action.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
*/
66

77
import inquirer from 'inquirer';
8-
import { SystemKeychain } from '../core';
9-
import { ConfigManager } from '../core/config/config.manager';
10-
import { ManifestManager } from '../core/manifest/manifest.manager';
8+
import { SystemKeychain } from '@envguard/core';
9+
import { ConfigManager } from '@envguard/core';
10+
import { ManifestManager } from '@envguard/core';
1111
import { error, success, verbose, info, LogTag, warn } from '../utils/logger';
1212

1313
export interface EditOptions {

packages/cli/src/commands/export.action.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
import fs from 'fs/promises';
88
import path from 'path';
9-
import { SystemKeychain } from '../core';
10-
import { ConfigManager } from '../core/config/config.manager';
11-
import { ManifestManager } from '../core/manifest/manifest.manager';
9+
import { SystemKeychain } from '@envguard/core';
10+
import { ConfigManager } from '@envguard/core';
11+
import { ManifestManager } from '@envguard/core';
1212
import { error, success, verbose, warn, info, LogTag } from '../utils/logger';
1313

1414
export interface ExportOptions {

packages/cli/src/commands/get.action.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* @description Implementation of the get command
55
*/
66

7-
import { SystemKeychain } from '../core';
8-
import { ConfigManager } from '../core/config/config.manager';
7+
import { SystemKeychain } from '@envguard/core';
8+
import { ConfigManager } from '@envguard/core';
99
import { error, log, verbose, warn, LogTag } from '../utils/logger';
1010

1111
/**

0 commit comments

Comments
 (0)