dagger-env 0.2.1 → 0.4.0
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.
- package/README.md +109 -8
- package/dist/dagger-env.d.ts +6 -6
- package/dist/dagger-env.d.ts.map +1 -1
- package/dist/dagger-env.js +6 -1
- package/dist/dagger-env.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/op.d.ts +90 -0
- package/dist/op.d.ts.map +1 -0
- package/dist/op.js +34 -0
- package/dist/op.js.map +1 -0
- package/dist/run-dagger-cmd.d.ts +39 -0
- package/dist/run-dagger-cmd.d.ts.map +1 -0
- package/dist/run-dagger-cmd.js +82 -0
- package/dist/run-dagger-cmd.js.map +1 -0
- package/package.json +23 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# dagger-env
|
|
2
2
|
|
|
3
|
-
A type-safe, reusable environment configuration abstraction for Dagger modules with full Zod v4 validation.
|
|
3
|
+
A type-safe, reusable environment configuration abstraction for Dagger modules with full Zod v4 validation and 1Password integration.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -9,6 +9,7 @@ A type-safe, reusable environment configuration abstraction for Dagger modules w
|
|
|
9
9
|
- 🎯 **Consistent**: Standardized API across all Dagger modules
|
|
10
10
|
- 🛡️ **Validated**: Runtime validation of arguments, environment variables, and secrets
|
|
11
11
|
- 📦 **Modular**: Secret presets and derived environment variables
|
|
12
|
+
- 🔐 **1Password Integration**: Built-in command runner with `op run` support
|
|
12
13
|
- 🚀 **Easy to use**: Simple configuration-based setup
|
|
13
14
|
|
|
14
15
|
## Installation
|
|
@@ -17,6 +18,8 @@ A type-safe, reusable environment configuration abstraction for Dagger modules w
|
|
|
17
18
|
npm install dagger-env zod
|
|
18
19
|
```
|
|
19
20
|
|
|
21
|
+
**Note:** The command runner functionality (`dagger-env/run`) requires the 1Password CLI (`op`) to be installed.
|
|
22
|
+
|
|
20
23
|
## Quick Start
|
|
21
24
|
|
|
22
25
|
```typescript
|
|
@@ -68,6 +71,75 @@ export class MyModule {
|
|
|
68
71
|
}
|
|
69
72
|
```
|
|
70
73
|
|
|
74
|
+
## Command Runner (1Password Integration)
|
|
75
|
+
|
|
76
|
+
For projects using 1Password for secret management, `dagger-env` provides a convenient command runner that integrates with `op run`:
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
import { createDaggerEnv } from 'dagger-env'
|
|
80
|
+
import { createDaggerCommandRunner } from 'dagger-env/run'
|
|
81
|
+
import { z } from 'zod/v4'
|
|
82
|
+
|
|
83
|
+
// Create your DaggerEnv configuration
|
|
84
|
+
const myDaggerEnv = createDaggerEnv({
|
|
85
|
+
args: z.object({
|
|
86
|
+
environment: z.enum(['dev', 'staging', 'prod']).optional(),
|
|
87
|
+
}),
|
|
88
|
+
env: z.object({
|
|
89
|
+
CI: z.string().optional(),
|
|
90
|
+
NODE_ENV: z.string().optional(),
|
|
91
|
+
}),
|
|
92
|
+
secrets: z.object({
|
|
93
|
+
API_TOKEN: z.string(),
|
|
94
|
+
}),
|
|
95
|
+
secretPresets: {
|
|
96
|
+
api: ['API_TOKEN'],
|
|
97
|
+
} as const,
|
|
98
|
+
derivedEnvVars: {} as const,
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
// Create a command runner - simply pass your DaggerEnv instance
|
|
102
|
+
const runDaggerCommand = createDaggerCommandRunner({
|
|
103
|
+
opVault: 'your-vault-id',
|
|
104
|
+
opItem: 'your-item-id',
|
|
105
|
+
opSections: [
|
|
106
|
+
{
|
|
107
|
+
id: 'your-section-id',
|
|
108
|
+
label: 'Shared',
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
dockerCommands: ['build', 'deploy', 'test'],
|
|
112
|
+
daggerEnv: myDaggerEnv,
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
// Run a Dagger command
|
|
116
|
+
await runDaggerCommand('test', {
|
|
117
|
+
args: { environment: 'dev' },
|
|
118
|
+
env: { NODE_ENV: 'development' },
|
|
119
|
+
})
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Advanced Configuration
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
// Advanced configuration with multiple sections and pre-command setup
|
|
126
|
+
const runDaggerCommand = createDaggerCommandRunner({
|
|
127
|
+
opVault: 'your-vault-id',
|
|
128
|
+
opItem: 'your-item-id',
|
|
129
|
+
opSections: [
|
|
130
|
+
{ id: 'shared-section-id', label: 'Shared' },
|
|
131
|
+
{ id: 'project-section-id', label: 'Project Specific' },
|
|
132
|
+
],
|
|
133
|
+
dockerCommands: ['build', 'deploy', 'test'],
|
|
134
|
+
beforeCommand: async () => {
|
|
135
|
+
// Setup vendor files, modules, etc.
|
|
136
|
+
console.log('Setting up environment...')
|
|
137
|
+
// await setupDaggerVendorFiles()
|
|
138
|
+
},
|
|
139
|
+
daggerEnv: myDaggerEnv,
|
|
140
|
+
})
|
|
141
|
+
```
|
|
142
|
+
|
|
71
143
|
## API Reference
|
|
72
144
|
|
|
73
145
|
### Environment Configuration
|
|
@@ -110,7 +182,7 @@ Creates a function that applies environment variables and secrets to a container
|
|
|
110
182
|
|
|
111
183
|
### `daggerEnv.getOptionsSchema()`
|
|
112
184
|
|
|
113
|
-
Returns the Zod schema for the complete options object.
|
|
185
|
+
Returns the Zod schema for the complete options object. Primarily used internally by the command runner, but available for advanced use cases.
|
|
114
186
|
|
|
115
187
|
**Returns:** `ZodObject` - The combined schema for args, env, and secrets
|
|
116
188
|
|
|
@@ -130,6 +202,31 @@ Returns array of secret names for a specific preset.
|
|
|
130
202
|
|
|
131
203
|
**Returns:** `readonly string[]` - Secret names in the preset
|
|
132
204
|
|
|
205
|
+
### Command Runner
|
|
206
|
+
|
|
207
|
+
#### `createDaggerCommandRunner(config)`
|
|
208
|
+
|
|
209
|
+
Creates a function to run Dagger commands with 1Password integration.
|
|
210
|
+
|
|
211
|
+
**Parameters:**
|
|
212
|
+
|
|
213
|
+
- `config.opVault`: 1Password vault ID
|
|
214
|
+
- `config.opItem`: 1Password item ID
|
|
215
|
+
- `config.opSections`: Array of 1Password sections to include for secrets
|
|
216
|
+
- `config.dockerCommands`: Optional array of command names that should include Docker socket
|
|
217
|
+
- `config.beforeCommand`: Optional async function to run before executing the command
|
|
218
|
+
- `config.daggerEnv`: DaggerEnv instance for schema validation and type safety
|
|
219
|
+
|
|
220
|
+
**Returns:** `(commandName: string, options?: RunDaggerCommandOptions) => Promise<void>` - Function to execute Dagger commands
|
|
221
|
+
|
|
222
|
+
#### `RunDaggerCommandOptions`
|
|
223
|
+
|
|
224
|
+
Options for individual command execution:
|
|
225
|
+
|
|
226
|
+
- `args`: Optional record of arguments to pass to the Dagger command
|
|
227
|
+
- `env`: Optional record of additional environment variables
|
|
228
|
+
- `extraArgs`: Optional array of additional command-line arguments
|
|
229
|
+
|
|
133
230
|
## Configuration Examples
|
|
134
231
|
|
|
135
232
|
### Simple API Service
|
|
@@ -188,16 +285,20 @@ const multiEnvDaggerEnv = createDaggerEnv({
|
|
|
188
285
|
|
|
189
286
|
## Type Extraction
|
|
190
287
|
|
|
191
|
-
|
|
288
|
+
For advanced use cases where you need to extract TypeScript types:
|
|
192
289
|
|
|
193
290
|
```typescript
|
|
194
|
-
import { z } from 'zod'
|
|
291
|
+
import { z } from 'zod/v4'
|
|
292
|
+
|
|
293
|
+
import type { DaggerOptionsFromConfig } from 'dagger-env'
|
|
195
294
|
|
|
196
|
-
// Extract
|
|
197
|
-
type
|
|
295
|
+
// Extract the options type from your DaggerEnv configuration
|
|
296
|
+
type MyDaggerEnvConfig = typeof myDaggerEnv extends DaggerEnv<infer T> ? T : never
|
|
297
|
+
type MyOptions = DaggerOptionsFromConfig<MyDaggerEnvConfig>
|
|
198
298
|
|
|
199
|
-
//
|
|
200
|
-
|
|
299
|
+
// Access the schema if needed for validation or type extraction
|
|
300
|
+
const schema = myDaggerEnv.getOptionsSchema()
|
|
301
|
+
type SchemaOutput = z.output<typeof schema>
|
|
201
302
|
```
|
|
202
303
|
|
|
203
304
|
## Best Practices
|
package/dist/dagger-env.d.ts
CHANGED
|
@@ -18,11 +18,11 @@ export type DaggerEnvConfig = {
|
|
|
18
18
|
/**
|
|
19
19
|
* Inferred options type from config
|
|
20
20
|
*/
|
|
21
|
-
export type DaggerOptionsFromConfig<T extends DaggerEnvConfig> =
|
|
22
|
-
args: T['args']
|
|
23
|
-
env: T['env']
|
|
24
|
-
secrets: T['secrets']
|
|
25
|
-
}
|
|
21
|
+
export type DaggerOptionsFromConfig<T extends DaggerEnvConfig> = {
|
|
22
|
+
args: z.infer<T['args']>;
|
|
23
|
+
env: z.infer<T['env']>;
|
|
24
|
+
secrets: z.infer<T['secrets']>;
|
|
25
|
+
};
|
|
26
26
|
/**
|
|
27
27
|
* Reusable Dagger environment abstraction
|
|
28
28
|
*/
|
|
@@ -46,7 +46,7 @@ export declare class DaggerEnv<T extends DaggerEnvConfig> {
|
|
|
46
46
|
args: T["args"];
|
|
47
47
|
env: T["env"];
|
|
48
48
|
secrets: T["secrets"];
|
|
49
|
-
}, z.core.$
|
|
49
|
+
}, z.core.$strip>;
|
|
50
50
|
/**
|
|
51
51
|
* Get available secret presets
|
|
52
52
|
*/
|
package/dist/dagger-env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dagger-env.d.ts","sourceRoot":"","sources":["../src/dagger-env.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE1D;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC7B,uBAAuB;IACvB,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;IACtB,mCAAmC;IACnC,GAAG,EAAE,CAAC,CAAC,SAAS,CAA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C,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;IACtB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;CAC9B,CAAA;AAED;;GAEG;AACH,qBAAa,SAAS,CAAC,CAAC,SAAS,eAAe;IAOnC,OAAO,CAAC,QAAQ,CAAC,MAAM;IANnC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAI5B;gBAE2B,MAAM,EAAE,CAAC;IAQtC;;OAEG;IACG,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC;IAM9E;;;OAGG;IACG,UAAU,CACf,aAAa,EAAE,MAAM,GAAG,uBAAuB,CAAC,CAAC,CAAC,EAClD,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC,EAC9C,WAAW,CAAC,EAAE,MAAM,EAAE,GACpB,OAAO,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,SAAS,CAAC;IAoEzC;;OAEG;IACH,gBAAgB;cArGT,CAAC,CAAC,MAAM,CAAC;aACV,CAAC,CAAC,KAAK,CAAC;iBACJ,CAAC,CAAC,SAAS,CAAC;;IAuGtB;;OAEG;IACH,gBAAgB,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC;IAInD;;OAEG;IACH,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,eAAe,CAAC,GAAG,SAAS,MAAM,EAAE;CAOrE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,eAAe,EAAE,MAAM,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAElF"}
|
package/dist/dagger-env.js
CHANGED
|
@@ -25,7 +25,12 @@ export class DaggerEnv {
|
|
|
25
25
|
* based on the provided Dagger options, secret presets, and additional secret names.
|
|
26
26
|
*/
|
|
27
27
|
async getWithEnv(daggerOptions, secretPresets, secretNames) {
|
|
28
|
-
const isSecret = (obj) => obj &&
|
|
28
|
+
const isSecret = (obj) => obj &&
|
|
29
|
+
typeof obj === 'object' &&
|
|
30
|
+
'id' in obj &&
|
|
31
|
+
'plaintext' in obj &&
|
|
32
|
+
typeof obj.id === 'function' &&
|
|
33
|
+
typeof obj.plaintext === 'function';
|
|
29
34
|
const opts = isSecret(daggerOptions)
|
|
30
35
|
? await this.parseDaggerOptions(daggerOptions)
|
|
31
36
|
: daggerOptions;
|
package/dist/dagger-env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dagger-env.js","sourceRoot":"","sources":["../src/dagger-env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AACvC,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"dagger-env.js","sourceRoot":"","sources":["../src/dagger-env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AACvC,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AA6B1B;;GAEG;AACH,MAAM,OAAO,SAAS;IAOQ;IANZ,aAAa,CAI5B;IAEF,YAA6B,MAAS;QAAT,WAAM,GAAN,MAAM,CAAG;QACrC,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;YAC7B,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,GAAG,EAAE,MAAM,CAAC,GAAG;YACf,OAAO,EAAE,MAAM,CAAC,OAAO;SACvB,CAAC,CAAA;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,kBAAkB,CAAC,OAAe;QACvC,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAC9B,IAAI,CAAC,KAAK,CAAC,MAAM,OAAO,CAAC,SAAS,EAAE,CAAC,CACP,CAAA;IAChC,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,U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';
|
|
1
|
+
export * from './dagger-env.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './dagger-env';
|
|
1
|
+
export * from './dagger-env.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
|
package/dist/op.d.ts
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
/**
|
|
3
|
+
* 1Password vault information
|
|
4
|
+
*/
|
|
5
|
+
export type OPVault = z.infer<typeof OPVault>;
|
|
6
|
+
export declare const OPVault: z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
/**
|
|
11
|
+
* 1Password item section information
|
|
12
|
+
*/
|
|
13
|
+
export type OPSection = z.infer<typeof OPSection>;
|
|
14
|
+
export declare const OPSection: z.ZodObject<{
|
|
15
|
+
id: z.ZodString;
|
|
16
|
+
label: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
/**
|
|
19
|
+
* 1Password item field
|
|
20
|
+
*/
|
|
21
|
+
export type OPField = z.infer<typeof OPField>;
|
|
22
|
+
export declare const OPField: z.ZodObject<{
|
|
23
|
+
id: z.ZodString;
|
|
24
|
+
section: z.ZodOptional<z.ZodObject<{
|
|
25
|
+
id: z.ZodString;
|
|
26
|
+
label: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
type: z.ZodEnum<{
|
|
29
|
+
STRING: "STRING";
|
|
30
|
+
CONCEALED: "CONCEALED";
|
|
31
|
+
MONTH_YEAR: "MONTH_YEAR";
|
|
32
|
+
}>;
|
|
33
|
+
purpose: z.ZodOptional<z.ZodEnum<{
|
|
34
|
+
NOTES: "NOTES";
|
|
35
|
+
}>>;
|
|
36
|
+
label: z.ZodString;
|
|
37
|
+
value: z.ZodString;
|
|
38
|
+
reference: z.ZodString;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
/**
|
|
41
|
+
* 1Password item category
|
|
42
|
+
*/
|
|
43
|
+
export type OPCategory = z.infer<typeof OPCategory>;
|
|
44
|
+
export declare const OPCategory: z.ZodEnum<{
|
|
45
|
+
SECURE_NOTE: "SECURE_NOTE";
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* Complete 1Password item structure
|
|
49
|
+
*/
|
|
50
|
+
export type OPItem = z.infer<typeof OPItem>;
|
|
51
|
+
export declare const OPItem: z.ZodObject<{
|
|
52
|
+
id: z.ZodString;
|
|
53
|
+
title: z.ZodString;
|
|
54
|
+
favorite: z.ZodBoolean;
|
|
55
|
+
version: z.ZodInt;
|
|
56
|
+
vault: z.ZodObject<{
|
|
57
|
+
id: z.ZodString;
|
|
58
|
+
name: z.ZodString;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
category: z.ZodEnum<{
|
|
61
|
+
SECURE_NOTE: "SECURE_NOTE";
|
|
62
|
+
}>;
|
|
63
|
+
last_edited_by: z.ZodString;
|
|
64
|
+
created_at: z.ZodISODateTime;
|
|
65
|
+
updated_at: z.ZodISODateTime;
|
|
66
|
+
additional_information: z.ZodString;
|
|
67
|
+
sections: z.ZodArray<z.ZodObject<{
|
|
68
|
+
id: z.ZodString;
|
|
69
|
+
label: z.ZodOptional<z.ZodString>;
|
|
70
|
+
}, z.core.$strip>>;
|
|
71
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
72
|
+
id: z.ZodString;
|
|
73
|
+
section: z.ZodOptional<z.ZodObject<{
|
|
74
|
+
id: z.ZodString;
|
|
75
|
+
label: z.ZodOptional<z.ZodString>;
|
|
76
|
+
}, z.core.$strip>>;
|
|
77
|
+
type: z.ZodEnum<{
|
|
78
|
+
STRING: "STRING";
|
|
79
|
+
CONCEALED: "CONCEALED";
|
|
80
|
+
MONTH_YEAR: "MONTH_YEAR";
|
|
81
|
+
}>;
|
|
82
|
+
purpose: z.ZodOptional<z.ZodEnum<{
|
|
83
|
+
NOTES: "NOTES";
|
|
84
|
+
}>>;
|
|
85
|
+
label: z.ZodString;
|
|
86
|
+
value: z.ZodString;
|
|
87
|
+
reference: z.ZodString;
|
|
88
|
+
}, z.core.$strip>>;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
//# sourceMappingURL=op.d.ts.map
|
package/dist/op.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"op.d.ts","sourceRoot":"","sources":["../src/op.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE1B;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAA;AAC7C,eAAO,MAAM,OAAO;;;iBAGlB,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA;AACjD,eAAO,MAAM,SAAS;;;iBAGpB,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAA;AAC7C,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;iBAQlB,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAA;AACnD,eAAO,MAAM,UAAU;;EAA0B,CAAA;AAEjD;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAA;AAC3C,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAajB,CAAA"}
|
package/dist/op.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
export const OPVault = z.object({
|
|
3
|
+
id: z.string(),
|
|
4
|
+
name: z.string(),
|
|
5
|
+
});
|
|
6
|
+
export const OPSection = z.object({
|
|
7
|
+
id: z.string(),
|
|
8
|
+
label: z.string().optional(),
|
|
9
|
+
});
|
|
10
|
+
export const OPField = z.object({
|
|
11
|
+
id: z.string(),
|
|
12
|
+
section: OPSection.optional(),
|
|
13
|
+
type: z.enum(['STRING', 'CONCEALED', 'MONTH_YEAR']),
|
|
14
|
+
purpose: z.enum(['NOTES']).optional(),
|
|
15
|
+
label: z.string(),
|
|
16
|
+
value: z.string(),
|
|
17
|
+
reference: z.string(),
|
|
18
|
+
});
|
|
19
|
+
export const OPCategory = z.enum(['SECURE_NOTE']);
|
|
20
|
+
export const OPItem = z.object({
|
|
21
|
+
id: z.string(),
|
|
22
|
+
title: z.string(),
|
|
23
|
+
favorite: z.boolean(),
|
|
24
|
+
version: z.int(),
|
|
25
|
+
vault: OPVault,
|
|
26
|
+
category: OPCategory,
|
|
27
|
+
last_edited_by: z.string(),
|
|
28
|
+
created_at: z.iso.datetime(),
|
|
29
|
+
updated_at: z.iso.datetime(),
|
|
30
|
+
additional_information: z.string(),
|
|
31
|
+
sections: z.array(OPSection),
|
|
32
|
+
fields: z.array(OPField),
|
|
33
|
+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C,MAAM,EAAE;IACjB,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE;IAChB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,UAAU,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE;IAC5B,UAAU,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE;IAC5B,sBAAsB,EAAE,CAAC,CAAC,MAAM,EAAE;IAClC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC;IAC5B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;CACxB,CAAC,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { DaggerEnv, DaggerEnvConfig } from './dagger-env.js';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for running Dagger commands with 1Password integration
|
|
4
|
+
*/
|
|
5
|
+
export interface RunDaggerCommandConfig<T extends DaggerEnvConfig = DaggerEnvConfig> {
|
|
6
|
+
/** 1Password vault ID */
|
|
7
|
+
opVault: string;
|
|
8
|
+
/** 1Password item ID */
|
|
9
|
+
opItem: string;
|
|
10
|
+
/** 1Password sections to include for secrets */
|
|
11
|
+
opSections: Array<{
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
}>;
|
|
15
|
+
/** Commands that should include Docker socket if available */
|
|
16
|
+
dockerCommands?: string[];
|
|
17
|
+
/** Hook to run before executing the command (e.g., vendor file setup) */
|
|
18
|
+
beforeCommand?: () => Promise<void>;
|
|
19
|
+
/** DaggerEnv instance for schema validation and type safety */
|
|
20
|
+
daggerEnv: DaggerEnv<T>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Options for individual command execution
|
|
24
|
+
*/
|
|
25
|
+
export interface RunDaggerCommandOptions {
|
|
26
|
+
/** Arguments to pass to the Dagger command */
|
|
27
|
+
args?: Record<string, any>;
|
|
28
|
+
/** Additional environment variables */
|
|
29
|
+
env?: Record<string, string>;
|
|
30
|
+
/** Additional command-line arguments */
|
|
31
|
+
extraArgs?: string[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Creates a function to run Dagger commands with 1Password integration
|
|
35
|
+
* @param config Configuration for the command runner
|
|
36
|
+
* @returns Function to execute Dagger commands
|
|
37
|
+
*/
|
|
38
|
+
export declare function createDaggerCommandRunner<T extends DaggerEnvConfig>(config: RunDaggerCommandConfig<T>): (commandName: string, options?: RunDaggerCommandOptions) => Promise<void>;
|
|
39
|
+
//# sourceMappingURL=run-dagger-cmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-dagger-cmd.d.ts","sourceRoot":"","sources":["../src/run-dagger-cmd.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjE;;GAEG;AACH,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe;IAClF,yBAAyB;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,gDAAgD;IAChD,UAAU,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAChD,8DAA8D;IAC9D,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,yEAAyE;IACzE,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACnC,+DAA+D;IAC/D,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,uCAAuC;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;CACpB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,eAAe,EAClE,MAAM,EAAE,sBAAsB,CAAC,CAAC,CAAC,iBAKnB,MAAM,YACT,uBAAuB,KAC/B,OAAO,CAAC,IAAI,CAAC,CAuFhB"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { $, fs } from 'zx';
|
|
2
|
+
import { OPItem, OPSection } from './op.js';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a function to run Dagger commands with 1Password integration
|
|
5
|
+
* @param config Configuration for the command runner
|
|
6
|
+
* @returns Function to execute Dagger commands
|
|
7
|
+
*/
|
|
8
|
+
export function createDaggerCommandRunner(config) {
|
|
9
|
+
const opItemUri = `op://${config.opVault}/${config.opItem}`;
|
|
10
|
+
return async function runDaggerCommand(commandName, options) {
|
|
11
|
+
const { args = {}, env = {}, extraArgs = [] } = options ?? {};
|
|
12
|
+
// Run any pre-command setup
|
|
13
|
+
if (config.beforeCommand) {
|
|
14
|
+
await config.beforeCommand();
|
|
15
|
+
}
|
|
16
|
+
// Environment variables to pass to the `op run` command
|
|
17
|
+
const envVars = {};
|
|
18
|
+
// Pass dagger cloud token in CI because we don't have user auth
|
|
19
|
+
if (process.env.CI !== undefined) {
|
|
20
|
+
envVars.DAGGER_CLOUD_TOKEN = `${opItemUri}/DAGGER_CLOUD_TOKEN`;
|
|
21
|
+
}
|
|
22
|
+
const commandArgs = [...extraArgs];
|
|
23
|
+
// Add Docker socket for specific commands if available
|
|
24
|
+
if (config.dockerCommands?.includes(commandName)) {
|
|
25
|
+
try {
|
|
26
|
+
if (await fs.exists('/var/run/docker.sock')) {
|
|
27
|
+
commandArgs.push('--docker-socket=/var/run/docker.sock');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
// Ignore if fs is not available or docker socket doesn't exist
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
// Fetch 1Password item
|
|
35
|
+
const opItem = OPItem.parse(await $ `op item get ${config.opItem} --vault ${config.opVault} --format json`.json());
|
|
36
|
+
// Parse sections to include
|
|
37
|
+
const sectionsToInclude = OPSection.array().parse(config.opSections);
|
|
38
|
+
// Extract secrets from specified sections
|
|
39
|
+
const secrets = opItem.fields
|
|
40
|
+
.filter((f) => sectionsToInclude.some((s) => s.id === f.section?.id))
|
|
41
|
+
.reduce((acc, f) => {
|
|
42
|
+
acc[f.label] = f.value;
|
|
43
|
+
return acc;
|
|
44
|
+
}, {});
|
|
45
|
+
// Build environment variables for Dagger
|
|
46
|
+
const daggerEnv = { ...env };
|
|
47
|
+
if (process.env.CI !== undefined) {
|
|
48
|
+
daggerEnv.CI = process.env.CI;
|
|
49
|
+
}
|
|
50
|
+
if (process.env.GITHUB_ACTIONS !== undefined) {
|
|
51
|
+
daggerEnv.GITHUB_ACTIONS = process.env.GITHUB_ACTIONS;
|
|
52
|
+
}
|
|
53
|
+
// Validate and serialize dagger options
|
|
54
|
+
const daggerOptions = config.daggerEnv.getOptionsSchema().parse({
|
|
55
|
+
args,
|
|
56
|
+
env: daggerEnv,
|
|
57
|
+
secrets,
|
|
58
|
+
});
|
|
59
|
+
envVars.DAGGER_OPTIONS = JSON.stringify(daggerOptions);
|
|
60
|
+
// Construct the command
|
|
61
|
+
const cmd = [
|
|
62
|
+
'op',
|
|
63
|
+
'run',
|
|
64
|
+
'--no-masking',
|
|
65
|
+
'--',
|
|
66
|
+
'dagger',
|
|
67
|
+
'call',
|
|
68
|
+
commandName,
|
|
69
|
+
...commandArgs,
|
|
70
|
+
'--options=env://DAGGER_OPTIONS',
|
|
71
|
+
];
|
|
72
|
+
// Execute the command
|
|
73
|
+
await $({
|
|
74
|
+
env: {
|
|
75
|
+
...process.env,
|
|
76
|
+
...envVars,
|
|
77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AAM,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC;YAC/D,IAAI;YACJ,GAAG,EAAE,SAAS;YACd,OAAO;SACP,CAAC,CAAA;QACF,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;QAEtD,wBAAwB;QACxB,MAAM,GAAG,GAAa;YACrB,IAAI;YACJ,KAAK;YACL,cAAc;YACd,IAAI;YACJ,QAAQ;YACR,MAAM;YACN,WAAW;YACX,GAAG,WAAW;YACd,gCAAgC;SAChC,CAAA;QAED,sBAAsB;QACtB,MAAM,CAAC,CAAC;YACP,GAAG,EAAE;gBACJ,GAAG,OAAO,CAAC,GAAG;gBACd,GAAG,OAAO;aACV;YACD,KAAK,EAAE,SAAS;SAChB,CAAC,CAAA,GAAG,GAAG,EAAE,CAAA;IACX,CAAC,CAAA;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dagger-env",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A type-safe, reusable environment configuration abstraction for Dagger modules.",
|
|
6
6
|
"keywords": [
|
|
@@ -26,6 +26,18 @@
|
|
|
26
26
|
"types": "./dist/index.d.ts",
|
|
27
27
|
"default": "./dist/index.js"
|
|
28
28
|
}
|
|
29
|
+
},
|
|
30
|
+
"./op": {
|
|
31
|
+
"import": {
|
|
32
|
+
"types": "./dist/op.d.ts",
|
|
33
|
+
"default": "./dist/op.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"./run": {
|
|
37
|
+
"import": {
|
|
38
|
+
"types": "./dist/run-dagger-cmd.d.ts",
|
|
39
|
+
"default": "./dist/run-dagger-cmd.js"
|
|
40
|
+
}
|
|
29
41
|
}
|
|
30
42
|
},
|
|
31
43
|
"main": "./dist/index.js",
|
|
@@ -33,17 +45,22 @@
|
|
|
33
45
|
"files": [
|
|
34
46
|
"dist"
|
|
35
47
|
],
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"zx": "8.5.4"
|
|
50
|
+
},
|
|
36
51
|
"devDependencies": {
|
|
37
52
|
"@dagger.io/dagger": "0.18.9",
|
|
38
53
|
"typescript": "5.5.4",
|
|
39
54
|
"vitest": "3.1.4",
|
|
40
|
-
"zod": "3.25.
|
|
41
|
-
"
|
|
42
|
-
"@repo/tools": "0.
|
|
43
|
-
|
|
55
|
+
"zod": "3.25.67",
|
|
56
|
+
"@repo/typescript-config": "0.1.2",
|
|
57
|
+
"@repo/tools": "0.3.1"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"zod": "3.25.67"
|
|
44
61
|
},
|
|
45
62
|
"scripts": {
|
|
46
|
-
"build": "runx build tsc ./src/index.ts",
|
|
63
|
+
"build": "runx build tsc ./src/index.ts ./src/op.ts ./src/run-dagger-cmd.ts",
|
|
47
64
|
"check:exports": "runx check --exports",
|
|
48
65
|
"check:lint": "run-eslint",
|
|
49
66
|
"check:types": "run-tsc",
|