Skip to content

Commit a0b9284

Browse files
Merge pull request #7142 from Shopify/04-01-fix_route_include-assets_debug_logs_through_verbose_output
Cleanup some unnecessary logs during dev
2 parents 4e033a7 + bc25d3a commit a0b9284

File tree

6 files changed

+6
-18
lines changed

6 files changed

+6
-18
lines changed

packages/app/src/cli/services/build/client-steps.test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,6 @@ describe('executeStep', () => {
4141
if (result.success) expect(result.output).toEqual({filesCopied: 3})
4242
expect(result.duration).toBeGreaterThanOrEqual(0)
4343
})
44-
45-
test('logs step execution to stdout', async () => {
46-
vi.mocked(stepsIndex.executeStepByType).mockResolvedValue({})
47-
48-
await executeStep(step, mockContext)
49-
50-
expect(mockContext.options.stdout.write).toHaveBeenCalledWith('Executing step: Test Step\n')
51-
})
5244
})
5345

5446
describe('failure', () => {

packages/app/src/cli/services/build/client-steps.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ export async function executeStep(step: LifecycleStep, context: BuildContext): P
8888
const startTime = Date.now()
8989

9090
try {
91-
context.options.stdout.write(`Executing step: ${step.name}\n`)
9291
const output = await executeStepByType(step, context)
9392

9493
return {

packages/app/src/cli/services/build/steps/include-assets-step.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ describe('executeIncludeAssetsStep', () => {
257257
// Then — no error, no copies
258258
expect(result.filesCopied).toBe(0)
259259
expect(fs.copyDirectoryContents).not.toHaveBeenCalled()
260-
expect(mockStdout.write).toHaveBeenCalledWith(expect.stringContaining("No value for configKey 'static_root'"))
261260
})
262261

263262
test('skips path that does not exist on disk but logs a warning', async () => {

packages/app/src/cli/services/build/steps/include-assets/copy-config-key-entry.test.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ describe('copyConfigKeyEntry', () => {
8787
})
8888
})
8989

90-
test('skips with log message when configKey is absent from configuration', async () => {
90+
test('skips when configKey is absent from configuration', async () => {
9191
await inTemporaryDirectory(async (tmpDir) => {
9292
const outDir = joinPath(tmpDir, 'out')
9393
await mkdir(outDir)
@@ -100,7 +100,6 @@ describe('copyConfigKeyEntry', () => {
100100

101101
expect(result.filesCopied).toBe(0)
102102
expect(result.pathMap.size).toBe(0)
103-
expect(mockStdout.write).toHaveBeenCalledWith("No value for configKey 'static_root', skipping\n")
104103
})
105104
})
106105

@@ -199,7 +198,7 @@ describe('copyConfigKeyEntry', () => {
199198
})
200199
})
201200

202-
test('skips with no-value log when [] flatten resolves to a non-array (contract violated)', async () => {
201+
test('skips when [] flatten resolves to a non-array (contract violated)', async () => {
203202
await inTemporaryDirectory(async (tmpDir) => {
204203
const outDir = joinPath(tmpDir, 'out')
205204
await mkdir(outDir)
@@ -215,9 +214,6 @@ describe('copyConfigKeyEntry', () => {
215214

216215
expect(result.filesCopied).toBe(0)
217216
expect(result.pathMap.size).toBe(0)
218-
expect(mockStdout.write).toHaveBeenCalledWith(
219-
expect.stringContaining("No value for configKey 'extensions[].targeting[].schema'"),
220-
)
221217
})
222218
})
223219

packages/app/src/cli/services/build/steps/include-assets/copy-config-key-entry.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {joinPath, basename, relativePath, extname} from '@shopify/cli-kit/node/path'
22
import {glob, copyFile, copyDirectoryContents, fileExists, mkdir, isDirectory} from '@shopify/cli-kit/node/fs'
3+
import {outputDebug} from '@shopify/cli-kit/node/output'
34
import type {BuildContext} from '../../client-steps.js'
45

56
/**
@@ -41,7 +42,7 @@ export async function copyConfigKeyEntry(
4142
}
4243

4344
if (paths.length === 0) {
44-
options.stdout.write(`No value for configKey '${key}', skipping\n`)
45+
outputDebug(`No value for configKey '${key}', skipping\n`, context.options.stdout)
4546
return {filesCopied: 0, pathMap: new Map()}
4647
}
4748

packages/app/src/cli/services/build/steps/include-assets/generate-manifest.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {getNestedValue, tokenizePath} from './copy-config-key-entry.js'
22
import {joinPath} from '@shopify/cli-kit/node/path'
33
import {fileExists, mkdir, writeFile} from '@shopify/cli-kit/node/fs'
4+
import {outputDebug} from '@shopify/cli-kit/node/output'
45
import type {BuildContext} from '../../client-steps.js'
56

67
interface ConfigKeyManifestEntry {
@@ -120,7 +121,7 @@ export async function generateManifestFile(
120121
}
121122
await mkdir(outputDir)
122123
await writeFile(manifestPath, JSON.stringify(manifest, null, 2))
123-
options.stdout.write(`Generated manifest.json in ${outputDir}\n`)
124+
outputDebug(`Generated manifest.json in ${outputDir}\n`, options.stdout)
124125
}
125126

126127
/**

0 commit comments

Comments
 (0)