Repository navigation
Add typed JSON output to app env pull - #8608
Conversation
f2ff2ea to
b98a439
Compare
|
/snapit |
b98a439 to
33107c9
Compare
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/node/context/local.d.ts@@ -11,6 +11,12 @@ export declare function isTerminalInteractive(): boolean;
* @returns The path to the user's home directory.
*/
export declare function homeDirectory(): string;
+/**
+ * Clears the memoized result of isUnitTest so the environment variable is re-read.
+ *
+ * Only intended for test helpers that temporarily toggle unit-test detection.
+ */
+export declare function resetMemoizedIsUnitTest(): void;
/**
* Returns true if the CLI is running in debug mode.
*
packages/cli-kit/dist/public/node/testing/output.d.ts@@ -8,6 +8,36 @@ interface OutputMock {
error: () => string;
clear: () => void;
}
+interface StandardStreamsMock {
+ stdout: () => string;
+ stderr: () => string;
+ restore: () => void;
+}
+export interface CapturedStandardStreams {
+ stdout: () => string;
+ stderr: () => string;
+}
+/**
+ * Runs a callback with process stdout/stderr captured and unit-test output suppression disabled,
+ * so tests can assert on what a command actually writes to the standard streams.
+ *
+ * The callback receives accessors instead of the function returning captured output so that
+ * assertions remain possible when the callback throws (for example commands that abort).
+ * Streams, console.warn and unit-test detection are restored afterwards.
+ * Not safe for concurrent tests.
+ *
+ * @param run - Callback receiving accessors for the captured stdout and stderr.
+ * @returns The value returned by the callback.
+ */
+export declare function withCapturedStandardStreams<T>(run: (streams: CapturedStandardStreams) => T | Promise<T>): Promise<T>;
+/**
+ * Captures writes to stdout and stderr, including console warnings intercepted by Vitest.
+ * Call restore in a finally block. This replaces process globals and must not be used in concurrent tests.
+ * Prefer withCapturedStandardStreams, which also disables unit-test output suppression while it runs.
+ *
+ * @returns Captured output and a function to restore the original writers.
+ */
+export declare function mockAndCaptureStandardStreams(): StandardStreamsMock;
/**
* Returns a set of functions to get the outputs ocurred during a test run.
*
|
16e0f18 to
3fbe817
Compare
9c942a1 to
c3be51e
Compare
|
/snapit |
|
🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm. Built from Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261008125329Caution After installing, validate the version by running |
c3be51e to
7b19678
Compare
d8d4197 to
22d5ee9
Compare
22d5ee9 to
a4e46dc
Compare
|
/snapit |
|
🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm. Built from Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261014123050Caution After installing, validate the version by running |
a4e46dc to
3b41ebd
Compare
|
/snapit |
|
🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm. Built from Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261014134214Caution After installing, validate the version by running |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3b41ebd to
93c66f3
Compare
WHY are these changes introduced?
Related to https://github.com/shop/issues-develop/issues/23667
Scripts cannot inspect the result of updating an app dotenv file.
WHAT is this pull request doing?
Return the absolute dotenv path, success status, changed flag, variables array and native file content. Preserve comments and local variables, and keep the existing text diff.
How to manually test your changes?
Checklist