@payfit/nx-op-env 0.2.2 → 0.2.3-ephemeral-feat-1password-cli-docs.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 +91 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -60,6 +60,96 @@ DATABASE_URL="postgresql://admin:{{ op://Dev/Postgres/password }}@localhost:5432
|
|
|
60
60
|
- `fail`: throws an error.
|
|
61
61
|
- `fallback-default`: falls back to target defaults (`defaultEnvFile` or `.env.op`).
|
|
62
62
|
|
|
63
|
+
## Behavior matrix
|
|
64
|
+
|
|
65
|
+
The table below focuses on the effective behavior combinations without duplicating equivalent cases.
|
|
66
|
+
|
|
67
|
+
| Config profile | Command shape (example) | Expected behavior |
|
|
68
|
+
| -------------- | ----------------------------------------------------------------- | --------------------------------------------------------------------------------- |
|
|
69
|
+
| Config A | `yarn nx run app:serve` and `apps/app/.env.op` exists | Loads `apps/app/.env.op` |
|
|
70
|
+
| Config A | `yarn nx run app:serve:dev` and `apps/app/.env.dev.op` exists | Loads `apps/app/.env.dev.op` |
|
|
71
|
+
| Config A | `yarn nx run app:serve:dev` and `apps/app/.env.dev.op` is missing | Loads nothing |
|
|
72
|
+
| Config B | `yarn nx run app:serve:dev` and `apps/app/.env.dev.op` is missing | Throws an error and stops execution |
|
|
73
|
+
| Config C | `yarn nx run app:serve:dev` and `apps/app/.env.dev.op` is missing | Falls back to `apps/app/.env.op` |
|
|
74
|
+
| Config A | `yarn nx run-many -t serve,test -p app` | Loads nothing (safe default for multi runs) |
|
|
75
|
+
| Config D | `yarn nx run-many -t serve,test -p app` | Loads both `apps/app/.env.op` and `apps/app/.env.test.op` into shared process env |
|
|
76
|
+
| Any config | `yarn nx affected -t serve` (without `--projects`) | Not supported for env discovery |
|
|
77
|
+
| Any config | Any Nx command while `CI=true` (or `ci=true`) | Always skips env loading |
|
|
78
|
+
|
|
79
|
+
### Config profiles used in the matrix
|
|
80
|
+
|
|
81
|
+
#### Config A
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"multiRunStrategy": "skip",
|
|
86
|
+
"missingConfiguredEnvFileStrategy": "skip",
|
|
87
|
+
"targets": [
|
|
88
|
+
{
|
|
89
|
+
"names": ["serve"]
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"names": ["test"],
|
|
93
|
+
"defaultEnvFile": ".env.test.op"
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
#### Config B
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"multiRunStrategy": "skip",
|
|
104
|
+
"missingConfiguredEnvFileStrategy": "fail",
|
|
105
|
+
"targets": [
|
|
106
|
+
{
|
|
107
|
+
"names": ["serve"]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"names": ["test"],
|
|
111
|
+
"defaultEnvFile": ".env.test.op"
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
#### Config C
|
|
118
|
+
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"multiRunStrategy": "skip",
|
|
122
|
+
"missingConfiguredEnvFileStrategy": "fallback-default",
|
|
123
|
+
"targets": [
|
|
124
|
+
{
|
|
125
|
+
"names": ["serve"]
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"names": ["test"],
|
|
129
|
+
"defaultEnvFile": ".env.test.op"
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
#### Config D
|
|
136
|
+
|
|
137
|
+
```json
|
|
138
|
+
{
|
|
139
|
+
"multiRunStrategy": "aggregate",
|
|
140
|
+
"missingConfiguredEnvFileStrategy": "skip",
|
|
141
|
+
"targets": [
|
|
142
|
+
{
|
|
143
|
+
"names": ["serve"]
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"names": ["test"],
|
|
147
|
+
"defaultEnvFile": ".env.test.op"
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
63
153
|
## Examples
|
|
64
154
|
|
|
65
155
|
```bash
|
|
@@ -101,7 +191,7 @@ Important:
|
|
|
101
191
|
|
|
102
192
|
- `defaultEnvFile` is used only when no configuration is provided.
|
|
103
193
|
- When a configuration is provided (for example `--configuration=staging`), the plugin looks only for `.env.staging.op`.
|
|
104
|
-
- If that file does not exist,
|
|
194
|
+
- If that file does not exist, behavior depends on `missingConfiguredEnvFileStrategy` (`skip`, `fail`, or `fallback-default`).
|
|
105
195
|
|
|
106
196
|
## Supported Command Shapes
|
|
107
197
|
|