@abapify/adt-config 0.0.0 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +82 -1
  2. package/package.json +26 -3
package/README.md CHANGED
@@ -1,3 +1,84 @@
1
1
  # @abapify/adt-config
2
2
 
3
- Placeholder. The real release is published via CI/CD.
3
+ [![version](https://img.shields.io/github/package-json/v/abapify/adt-cli?filename=packages/adt-config/package.json)](https://github.com/abapify/adt-cli/pkgs/npm/%40abapify%2Fadt-config)
4
+
5
+ Configuration loader for ADT CLI. Loads destinations from `adt.config.ts/json` files.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @abapify/adt-config
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ### Configuration File
16
+
17
+ Create `adt.config.ts` in your project root:
18
+
19
+ ```typescript
20
+ import { defineConfig } from '@abapify/adt-config';
21
+
22
+ export default defineConfig({
23
+ destinations: {
24
+ DEV: {
25
+ type: 'puppeteer',
26
+ options: {
27
+ url: 'https://dev.sap.example.com',
28
+ client: '100',
29
+ },
30
+ },
31
+ QAS: {
32
+ type: 'basic',
33
+ options: {
34
+ url: 'https://qas.sap.example.com',
35
+ client: '100',
36
+ },
37
+ },
38
+ },
39
+ });
40
+ ```
41
+
42
+ ### Loading Config
43
+
44
+ ```typescript
45
+ import { loadConfig } from '@abapify/adt-config';
46
+
47
+ const config = await loadConfig();
48
+
49
+ // Get specific destination
50
+ const dest = config.getDestination('DEV');
51
+
52
+ // List all destination names
53
+ const names = config.listDestinations(); // ['DEV', 'QAS']
54
+
55
+ // Check if destination exists
56
+ if (config.hasDestination('DEV')) {
57
+ // ...
58
+ }
59
+
60
+ // Access raw config (for future extensions)
61
+ console.log(config.raw);
62
+ ```
63
+
64
+ ## Architecture
65
+
66
+ ```
67
+ CLI (adt-cli)
68
+ │
69
+ ├── @abapify/adt-config (this package)
70
+ │ └── loads destinations from adt.config.ts/json
71
+ │
72
+ ├── @abapify/adt-auth
73
+ │ ├── auth methods (basic, slc, oauth, puppeteer)
74
+ │ └── session management (~/.adt/sessions/)
75
+ │
76
+ └── @abapify/adt-client
77
+ └── HTTP client (receives session at runtime)
78
+ ```
79
+
80
+ ## Config Precedence
81
+
82
+ 1. `adt.config.ts` (project - TypeScript)
83
+ 2. `adt.config.json` (project - JSON)
84
+ 3. `~/.adt/config.json` (global defaults)
package/package.json CHANGED
@@ -1,5 +1,28 @@
1
1
  {
2
2
  "name": "@abapify/adt-config",
3
- "version": "0.0.0",
4
- "description": "Placeholder — real package is published via CI/CD (trusted publishing)."
5
- }
3
+ "version": "0.3.4",
4
+ "description": "Configuration loader for ADT CLI",
5
+ "license": "MIT",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "type": "module",
10
+ "types": "./dist/index.d.mts",
11
+ "exports": {
12
+ ".": "./dist/index.mjs",
13
+ "./package.json": "./package.json"
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "README.md"
18
+ ],
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/abapify/adt-cli.git",
22
+ "directory": "packages/adt-config"
23
+ },
24
+ "homepage": "https://github.com/abapify/adt-cli/tree/main/packages/adt-config#readme",
25
+ "bugs": {
26
+ "url": "https://github.com/abapify/adt-cli/issues"
27
+ }
28
+ }