Skip to content

Commit

Permalink
Update build message
Browse files Browse the repository at this point in the history
  • Loading branch information
cezaraugusto committed Aug 20, 2024
1 parent 2faa773 commit e87e6bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 32 deletions.
27 changes: 0 additions & 27 deletions programs/develop/__spec__/build.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,6 @@ import {
} from '../../../examples/data'
import {removeAllTemplateDistFolders} from './helpers'
import {extensionBuild} from '../dist/module'
import {exec} from 'child_process'

function runYarnInTopLevelFolders(templatePath: string): void {
// Read the contents of the templatePath directory
const folders = fs
.readdirSync(templatePath, {withFileTypes: true})
.filter((dirent) => dirent.isDirectory()) // Filter only directories
.map((dirent) => dirent.name) // Map to the directory names

folders.forEach((folder) => {
const folderPath = path.join(templatePath, folder)

console.log(`Running yarn in ${folderPath}...`)

// Run the yarn command in each top-level folder
exec('yarn', {cwd: folderPath}, (error, stdout, stderr) => {
if (error) {
console.error(`Error running yarn in ${folderPath}:`, error)
return
}
if (stderr) {
console.error(`Yarn stderr in ${folderPath}:`, stderr)
}
console.log(`Yarn output in ${folderPath}:\n${stdout}`)
})
})
}

function distFileExists(
templateName: string,
Expand Down
10 changes: 5 additions & 5 deletions programs/develop/commands/commands-lib/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ export function treeWithSourceAndDistFiles(
`${'πŸ“¦ Package name:'} ${brightYellow(
`${name}`
)}, ${'Target Browser:'} ${`${capitalizedBrowserName(browser)}`}` +
`\n ${'└─'} ${underline(`${sourceZip}`)} (source)` +
`\n ${'└─'} ${underline(`${destZip}`)} (distribution)`
`\n ${gray('└─')} ${underline(`${sourceZip}`)} (source)` +
`\n ${gray('└─')} ${underline(`${destZip}`)} (distribution)`
)
}

Expand All @@ -210,7 +210,7 @@ export function treeWithDistFilesbrowser(
return (
`${'πŸ“¦ Package name:'} ${brightYellow(`${name}.${ext}`)}, ` +
`${'Target Browser:'} ${`${capitalizedBrowserName(browser)}`}` +
`\n ${'└─'} ${underline(`${zipPath}`)} (distribution)`
`\n ${gray('└─')} ${underline(`${zipPath}`)} (distribution)`
)
}

Expand All @@ -223,7 +223,7 @@ export function treeWithSourceFiles(
return (
`${'πŸ“¦ Package name:'} ${brightYellow(`${name}-source.${ext}`)}, ` +
`${'Target Browser:'} ${`${capitalizedBrowserName(browser)}`}` +
`\n ${'└─'} ${underline(`${zipPath}`)} (source)`
`\n ${gray('└─')} ${underline(`${zipPath}`)} (source)`
)
}

Expand Down Expand Up @@ -352,7 +352,7 @@ function printTree(node: Record<string, any>, prefix = ''): string {
: ''
output += `${gray(prefix)}${gray(connector)} ${key}${gray(sizeInKB)}\n`
if (typeof node[key] === 'object' && !node[key].size) {
output += printTree(node[key], `${prefix}${isLast ? ' ' : gray('| ')}`)
output += printTree(node[key], `${prefix}${isLast ? ' ' : gray('β”‚ ')}`)
}
})

Expand Down

0 comments on commit e87e6bb

Please sign in to comment.