@@ -10,8 +10,6 @@ import path from 'path'
1010import { spawn } from 'cross-spawn'
1111import { zodToJsonSchema } from 'zod-to-json-schema'
1212import { z } from 'zod'
13- import os from 'os'
14- import { exec } from 'child_process'
1513
1614// CONSTANTS
1715const CREATE_APP_VERSION = 'latest'
@@ -156,46 +154,6 @@ export const getCreateAppCommand = () => {
156154 : `@salesforce/pwa-kit-create-app@${ CREATE_APP_VERSION } `
157155}
158156
159- /**
160- * Runs an NPX command and captures its output.
161- *
162- * @returns {Promise<string> } - Resolves with the command output.
163- */
164- export async function runNpxCommand ( NPX_COMMAND , CREATE_APP_COMMAND , DISPLAY_PROGRAM_COMMAND ) {
165- return new Promise ( ( resolve , reject ) => {
166- const tempDir = os . tmpdir ( )
167- const outputFilePath = path . join ( tempDir , 'npx-output.json' )
168- const errorFilePath = path . join ( tempDir , 'npx-error.log' )
169- const command = `${ NPX_COMMAND } ${ CREATE_APP_COMMAND } ${ DISPLAY_PROGRAM_COMMAND } > ${ outputFilePath } 2> ${ errorFilePath } `
170-
171- exec ( command , ( error ) => {
172- if ( error ) {
173- reject ( error )
174- return
175- }
176-
177- fsPromises . promises
178- . readFile ( outputFilePath , 'utf-8' )
179- . then ( ( data ) => resolve ( data ) )
180- . catch ( ( err ) => reject ( err ) )
181- } )
182- } )
183- }
184-
185- /**
186- * Returns the copyright header with the current year
187- * @returns {string } The copyright header text
188- */
189- export const getCopyrightHeader = ( ) => {
190- const year = new Date ( ) . getFullYear ( )
191- return `/*
192- * Copyright (c) ${ year } , Salesforce, Inc.
193- * All rights reserved.
194- * SPDX-License-Identifier: BSD-3-Clause
195- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
196- */`
197- }
198-
199157/**
200158 * Converts a string to kebab-case (e.g., ProductCard -> product-card)
201159 */
@@ -214,7 +172,7 @@ export async function logMCPMessage(message) {
214172 if ( process . env . DEBUG ) {
215173 // Check if DEBUG mode is enabled
216174 const logFilePath = path . join ( __dirname , 'mcp-debug.log' )
217- const timestamp = new Date ( ) . toLocaleString ( 'en-US' , { timeZone : 'America/New_York ' } )
175+ const timestamp = new Date ( ) . toLocaleString ( 'en-US' , { timeZone : 'GMT ' } )
218176 const logMessage = `[${ timestamp } ] ${ message } \n`
219177 try {
220178 // Ensure the log file exists, create it if it doesn't
0 commit comments