Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/remove-dotenv-cli-kit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@shopify/cli-kit": patch
---

Remove `dotenv` dependency; parse .env files using Node's native `util.parseEnv` instead.
1 change: 0 additions & 1 deletion packages/cli-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@
"color-json": "3.0.5",
"conf": "11.0.2",
"deepmerge": "4.3.1",
"dotenv": "16.4.7",
"env-paths": "3.0.0",
"execa": "7.2.0",
"fast-glob": "3.3.3",
Expand Down
6 changes: 4 additions & 2 deletions packages/cli-kit/src/public/node/dot-env.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import {outputDebug, outputContent, outputToken} from './output.js'
import {AbortError} from './error.js'
import {fileExists, readFile, writeFile} from './fs.js'
import {parse} from 'dotenv'
import * as util from 'node:util'

const parseEnv = (util as unknown as {parseEnv(s: string): Record<string, string>}).parseEnv

/**
* This interface represents a .env file.
Expand Down Expand Up @@ -30,7 +32,7 @@ export async function readAndParseDotEnv(path: string): Promise<DotEnvFile> {
const content = await readFile(path)
return {
path,
variables: parse(content),
variables: parseEnv(content),
}
}

Expand Down
Loading
Loading