@dotenvx/dotenvx 3.0.0-beta.1 → 3.0.0-rc0

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 (3) hide show
  1. package/README.md +66 -42
  2. package/index.cjs +2 -0
  3. package/package.json +9 -9
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
- # dotenvx Node.js SDK — 3.0 beta prototype
1
+ # dotenvx Node.js SDK
2
2
 
3
3
  The Node.js adapter for Forge's shared Rust `dotenvx-sdk`. Parsing, expansion,
4
- decryption, source selection, custody delegation, and Dotenvx.toml policy use
4
+ decryption, source selection, custody delegation, and Dotenv.toml policy use
5
5
  the same engine as Ruby and Python. JavaScript owns the public API, environment
6
6
  updates, diagnostics, and output interception.
7
7
 
@@ -17,7 +17,10 @@ npm run test:dotenvx-nodejs
17
17
  To install the local prototype in another project, pack and install the main
18
18
  and matching platform packages together as described below.
19
19
 
20
- The package keeps the `@dotenvx/dotenvx` name and starts at `3.0.0-beta.0`.
20
+ The package keeps the `@dotenvx/dotenvx` name and uses normal `0.4.x` versions
21
+ published under `next`. Install a specific version with
22
+ `npm install @dotenvx/dotenvx@0.4.11`, or follow Forge releases with
23
+ `npm install @dotenvx/dotenvx@next`. Unqualified installs continue to use `latest`.
21
24
  There are no install-time downloads or compilation hooks. A local build writes
22
25
  the current platform’s addon and default CLI to `native/` and prepares its npm
23
26
  package under `dist/npm/`. The main npm package contains JavaScript only; native
@@ -79,7 +82,7 @@ in the internal keyring and are not injected into the application's environment.
79
82
  When using a custom `processEnv`, include the PATH and provider settings it needs.
80
83
  Secret reference resolution is opt-in with `resolveReferences: true`.
81
84
 
82
- Dotenvx.toml redaction is installed before diagnostics and injection. Console
85
+ Dotenv.toml redaction is installed before diagnostics and injection. Console
83
86
  output and stream writes are protected, including secrets split between writes.
84
87
 
85
88
  ## npm CLI
@@ -113,8 +116,15 @@ runs, even if the npm dependency is pinned.
113
116
 
114
117
  Optionally, `DOTENVX_CLI` selects an explicit executable path ahead of PATH
115
118
  discovery. No override is needed for Armor or custom builds on PATH. This setting
116
- selects the npm CLI executable only; SDK custody resolution still uses its
117
- existing PATH lookup.
119
+ selects both the npm CLI executable and the SDK's delegated custody executable.
120
+ SDK custody uses the same standalone-binary discovery and packaged fallback as
121
+ the launcher, so it also works without a global CLI on PATH.
122
+
123
+ Decryption first checks matching environment private keys, then configured local
124
+ key files (including `.env.keys`), then the custodian named in the public-key
125
+ header. `armor pull` leaves the Armor custody metadata in place, but the pulled
126
+ matching local key can decrypt without a remote lookup. `armor down` additionally
127
+ removes remote custody and updates the header; local fallback does neither.
118
128
 
119
129
  ## Migrating from 2.x
120
130
 
@@ -156,44 +166,55 @@ can be skipped with npm's `--offline` flag:
156
166
  npm run build:dotenvx-nodejs
157
167
  npm pack ./dotenvx-nodejs/dist/npm/dotenvx-darwin-arm64 --ignore-scripts
158
168
  npm pack ./dotenvx-nodejs --ignore-scripts
159
- npm install --offline ./dotenvx-dotenvx-3.0.0-beta.0.tgz ./dotenvx-dotenvx-darwin-arm64-3.0.0-beta.0.tgz
169
+ npm install --offline ./dotenvx-dotenvx-0.4.11.tgz ./dotenvx-dotenvx-darwin-arm64-0.4.11.tgz
160
170
  ```
161
171
 
162
172
  Substitute the current platform package and version. A direct local directory
163
173
  install alone does not assemble optional packages for the consuming project.
164
174
 
165
175
  `.github/workflows/nodejs.yml` builds and tests all eight native targets.
166
- **This release path publishes only the eight platform packages, always under
167
- `next`. It never packs or publishes the core `@dotenvx/dotenvx` package.** The
168
- core package is marked private. The publisher enforces a fixed platform-package
169
- allowlist and rejects stable, RC, or other non-beta versions.
176
+ Pushing a matching `nodejs-v<version>` tag publishes the eight platform packages
177
+ under `next`, waits for npm to serve all eight exact versions, then prepares and
178
+ tests the core `@dotenvx/dotenvx` wrapper across all eight platforms before
179
+ publishing it under `next`. **Existing `latest` tags stay unchanged.** The source
180
+ core package stays private; only the validated staged wrapper is publishable.
181
+ Releases accept exact SemVer versions, including `3.0.0-rc0`. Prereleases use
182
+ `next` and leave `latest` untouched.
170
183
 
171
- From a clean working tree, prepare the next platform beta with:
184
+ From a clean working tree, prepare a Node.js release with:
172
185
 
173
186
  ```sh
174
187
  npm run version:nodejs patch
188
+ # Or prepare an explicit release candidate:
189
+ npm run version:nodejs 3.0.0-rc0
175
190
  ```
176
191
 
177
- Here `patch` advances the beta counter: `3.0.0-beta.0` becomes
178
- `3.0.0-beta.1`, retaining the `3.0.0` release target. The helper synchronizes the
192
+ `patch`, `minor`, and `major` perform normal version bumps. The helper synchronizes
179
193
  npm/platform dependency versions, lockfile, and adapter Cargo versions, then
180
194
  creates a local commit and `nodejs-v<version>` tag. It does not publish or push.
181
195
  You can also include `nodejs` in `npm run version:batch -- cli,nodejs patch`
182
- (with optional `--push`). The batch rejects `minor` and `major` up front whenever
183
- `nodejs` is selected; `patch` still advances only the beta counter.
184
- It prints the exact atomic push command for that commit and tag, for example:
196
+ (with optional `--push`). It prints the exact atomic push command, for example:
197
+
198
+ ```sh
199
+ git push --atomic origin HEAD refs/tags/nodejs-v0.4.12
200
+ ```
201
+
202
+ Pushing the matching tag triggers the full platform-and-core release under `next`.
203
+ To backfill or retry an existing release, dispatch the workflow
204
+ from `main`, enter the exact version (for example `0.4.11`), choose
205
+ `target=platforms`, and enable `publish`. Every job checks out the corresponding
206
+ `nodejs-v0.4.11` tag, whose package version must match. The tag must exist;
207
+ CLI-only `cli-v*` tags cannot be used for this flow. The matching Node.js tag
208
+ must contain these release scripts and guards.
185
209
 
186
210
  ```sh
187
- git push --atomic origin HEAD refs/tags/nodejs-v3.0.0-beta.1
211
+ gh workflow run nodejs.yml --ref main -f target=platforms -f version=0.4.11 -f publish=true
188
212
  ```
189
213
 
190
- Pushing the commit alone does not release anything; pushing the matching tag
191
- triggers the platform-only beta release. Manual workflow runs build only unless
192
- `publish` is enabled, and publication requires running from the matching beta
193
- tag. Existing `latest` tags remain untouched. To retry a release, run the
194
- workflow from its tag with `publish` enabled. Already published versions are
195
- reused only when tarball integrity matches. Tag-triggered releases always remain
196
- platform-only. Stable and RC publication are disabled.
214
+ Manual runs default to `publish=false` for build and test checks. Existing
215
+ `latest` tags remain untouched. Already published versions are reused only when
216
+ tarball integrity matches. A platform publication or core test failure stops the
217
+ release before core publication. Published npm versions cannot be overwritten.
197
218
 
198
219
  Before the first release, configure npm trusted publishing for
199
220
  every platform package: repository `dotenvx/forge`, workflow `nodejs.yml`,
@@ -206,16 +227,18 @@ workflow now uses trusted publishing only and does not read an `NPM_TOKEN`
206
227
  secret. No credentials are needed for build-only runs. Platform manifests also
207
228
  set `publishConfig.tag` to `next`, and artifact validation rejects any other tag.
208
229
 
209
- Forge owns the new 3.x beta platform-package contents and releases. The core
210
- `@dotenvx/dotenvx` package is excluded from this release path. Existing 2.x versions
211
- remain unchanged.
230
+ Forge owns the new `0.4.x` platform packages and core wrapper releases.
231
+ Existing 2.x versions remain unchanged.
212
232
 
213
233
 
214
- ## Core beta publication from Forge
234
+ ## Core publication from Forge
215
235
 
216
- Core publication is a separate, explicit manual mode of the existing `nodejs.yml`
217
- workflow. It uses the already-published, exact-version platform packages. It
218
- never rebuilds or republishes the CLI or native addons and never copies code to
236
+ Core publication follows successful platform publication automatically in
237
+ `nodejs.yml` tag releases. Preparation waits for npm's processing delay, then the
238
+ core test matrix must pass on all eight platforms. A separate `core` manual
239
+ mode remains available to test or retry only the wrapper. It uses the
240
+ already-published, exact-version platform packages. It never rebuilds or
241
+ republishes the CLI or native addons and never copies code to
219
242
  the legacy dotenvx repository.
220
243
 
221
244
  The source `package.json` stays private. Preparation creates a staged tarball
@@ -234,18 +257,19 @@ To exercise the staged wrapper against the published native dependencies on all
234
257
  eight targets, after committing and pushing the workflow changes, dispatch:
235
258
 
236
259
  ```sh
237
- gh workflow run nodejs.yml --ref main -f target=core-beta -f publish=false
260
+ gh workflow run nodejs.yml --ref main -f target=core -f version=0.4.11 -f publish=false
238
261
  ```
239
262
 
240
263
  The core test matrix installs the existing npm binaries and tests the actual
241
264
  staged tarball, SDK imports, preload entry points, CLI dispatch, encryption, and
242
265
  decryption. No Rust toolchain or native rebuild is used in core mode.
243
266
 
244
- When publication is explicitly authorized, manually dispatch `nodejs.yml` from
245
- `main`, choose `target=core-beta`, enable `publish`, and enter the exact version
246
- from `dotenvx-nodejs/package.json` in the `version` input. Missing or mismatched
247
- versions are rejected. Publication waits for the full core test matrix and uses
248
- the `release` environment and GitHub OIDC; the core package must trust
267
+ To publish or retry only the core release, manually dispatch `nodejs.yml` from
268
+ `main`, choose `target=core`, enable `publish`, and enter the exact version
269
+ in the `version` input. All jobs check out its matching `nodejs-v<version>` tag.
270
+ Missing tags or mismatched package versions are rejected. Publication waits for the full core test matrix and uses
271
+ the `release` environment and GitHub OIDC, as do automatic tag releases.
272
+ The core package must trust
249
273
  `dotenvx/forge`, workflow `nodejs.yml`, environment `release` on npm.
250
274
 
251
275
  Only the validated `@dotenvx/dotenvx` tarball is published, with an explicit
@@ -253,9 +277,9 @@ Only the validated `@dotenvx/dotenvx` tarball is published, with an explicit
253
277
  provenance for this private repository. The publisher snapshots core/platform
254
278
  tags, rechecks them before publication, and verifies them afterward. Only core's
255
279
  `next` tag may change; `latest` and all platform tags must remain unchanged.
256
- There is no stable-publish option, platform-publish command, or dist-tag mutation
257
- command in the core publisher. Existing versions are never overwritten. An
280
+ There is no `latest` publication option, platform-publish command, or dist-tag
281
+ mutation command in the core publisher. Existing versions are never overwritten. An
258
282
  identical retry is accepted only if the published integrity and `next` tag match.
259
283
 
260
- Both manual modes default to `publish=false`. A core beta can never be published
261
- by pushing a branch or a `nodejs-v*` tag.
284
+ Both manual modes default to `publish=false`. Branch pushes do not publish;
285
+ matching `nodejs-v*` tag pushes publish platforms and core automatically.
package/index.cjs CHANGED
@@ -3,6 +3,7 @@ const { fileURLToPath } = require('node:url')
3
3
  const native = require('./native.cjs')
4
4
  const { applyRedaction } = require('./lib/redaction.cjs')
5
5
  const { validateOptions } = require('./lib/validateOptions.cjs')
6
+ const { resolveCli } = require('./lib/cli.cjs')
6
7
 
7
8
  function environment (value) {
8
9
  const result = Object.create(null)
@@ -59,6 +60,7 @@ function optionsFor (options = {}, method = 'config') {
59
60
  no_bitwarden: options.noBitwarden === true
60
61
  }
61
62
  if (keyFiles !== undefined) input.key_files = (Array.isArray(keyFiles) ? keyFiles : [keyFiles]).map(filePath)
63
+ if (method !== 'parse') input.custody_cli = resolveCli({ env })
62
64
  return { input, options, target, env }
63
65
  }
64
66
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotenvx/dotenvx",
3
- "version": "3.0.0-beta.1",
3
+ "version": "3.0.0-rc0",
4
4
  "description": "a secure dotenv—from the creator of dotenv",
5
5
  "license": "BSD-3-Clause",
6
6
  "homepage": "https://dotenvx.com",
@@ -60,14 +60,14 @@
60
60
  "provenance": false
61
61
  },
62
62
  "optionalDependencies": {
63
- "@dotenvx/dotenvx-darwin-arm64": "3.0.0-beta.1",
64
- "@dotenvx/dotenvx-darwin-x86_64": "3.0.0-beta.1",
65
- "@dotenvx/dotenvx-linux-x86_64": "3.0.0-beta.1",
66
- "@dotenvx/dotenvx-linux-arm64": "3.0.0-beta.1",
67
- "@dotenvx/dotenvx-linux-x86_64-musl": "3.0.0-beta.1",
68
- "@dotenvx/dotenvx-linux-arm64-musl": "3.0.0-beta.1",
69
- "@dotenvx/dotenvx-windows-x86_64": "3.0.0-beta.1",
70
- "@dotenvx/dotenvx-windows-arm64": "3.0.0-beta.1"
63
+ "@dotenvx/dotenvx-darwin-arm64": "3.0.0-rc0",
64
+ "@dotenvx/dotenvx-darwin-x86_64": "3.0.0-rc0",
65
+ "@dotenvx/dotenvx-linux-x86_64": "3.0.0-rc0",
66
+ "@dotenvx/dotenvx-linux-arm64": "3.0.0-rc0",
67
+ "@dotenvx/dotenvx-linux-x86_64-musl": "3.0.0-rc0",
68
+ "@dotenvx/dotenvx-linux-arm64-musl": "3.0.0-rc0",
69
+ "@dotenvx/dotenvx-windows-x86_64": "3.0.0-rc0",
70
+ "@dotenvx/dotenvx-windows-arm64": "3.0.0-rc0"
71
71
  },
72
72
  "private": false
73
73
  }