From a1ebb68b7fa6d9cd8cca158558034819a9800bbb Mon Sep 17 00:00:00 2001 From: James Meng Date: Thu, 12 Dec 2024 16:10:09 -0800 Subject: [PATCH] [Themes] Add TODOs for template generator improvements --- packages/theme/src/cli/services/generate/sections.ts | 2 ++ packages/theme/src/cli/services/generate/templates.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/theme/src/cli/services/generate/sections.ts b/packages/theme/src/cli/services/generate/sections.ts index dba291b0e13..053435aeb10 100644 --- a/packages/theme/src/cli/services/generate/sections.ts +++ b/packages/theme/src/cli/services/generate/sections.ts @@ -19,6 +19,8 @@ export const JSON_SECTION_HEADER = `/* * ------------------------------------------------------------ */` +// TODO: move name / path resolution logic upstream +// TODO: Rather than throwing an error here we should prompt for name upstream export async function generateSection(options: SectionGeneratorOptions) { const sectionPath = joinPath(options.path, 'sections', `${options.name}.${options.fileType}`) diff --git a/packages/theme/src/cli/services/generate/templates.ts b/packages/theme/src/cli/services/generate/templates.ts index 0787e337b32..a757a3df28c 100644 --- a/packages/theme/src/cli/services/generate/templates.ts +++ b/packages/theme/src/cli/services/generate/templates.ts @@ -3,6 +3,8 @@ import {writeFile, readFile, fileExists} from '@shopify/cli-kit/node/fs' import {joinPath} from '@shopify/cli-kit/node/path' import {outputInfo} from '@shopify/cli-kit/node/output' +// TODO: move name / path resolution logic upstream +// TODO: add type flag export interface TemplateGeneratorOptions { name: string | undefined path: string