Skip to content

Commit

Permalink
fix line break formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
maddsua committed Sep 12, 2024
1 parent 03d5460 commit a11711d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
4 changes: 3 additions & 1 deletion cli/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ const main = async () => {
for (const item of assets.skipped) {
console.log(chalk.green(`>> Skipped`), item.slug);
}

console.log('\r');
}

if (config.clearDist && existsSync(config.outputDir)) {
Expand Down Expand Up @@ -126,7 +128,7 @@ const main = async () => {

const elapsed = formatTime(new Date().getTime() - transformStarted);

console.log('\n', chalk.green('✅ Completed in'), elapsed.value, chalk.green(elapsed.suffix), '\n');
console.log(chalk.green('✅ Completed in'), elapsed.value, chalk.green(elapsed.suffix), '\n');

for (const key in invocStats) {

Expand Down
13 changes: 11 additions & 2 deletions cli/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const copyStaticAssets = async (entries: AssetFile[], stats: InvocationSt
}

if (cfg.verbose) {
console.log('\nCopying static assets...');
console.log('Copying static assets...');
}

for (const item of entries) {
Expand All @@ -59,6 +59,10 @@ export const copyStaticAssets = async (entries: AssetFile[], stats: InvocationSt
printStatus(progress, 'Copied', slug);
stats.copied++;
}

if (cfg.verbose) {
console.log('\r');
}
};

export const transformImageAssets = async (entries: AssetEntry[], stats: InvocationStats, progress: ProgressMetrics, cacheIndex: CacheIndex, cfg: RuntimeConfig) => {
Expand All @@ -68,7 +72,7 @@ export const transformImageAssets = async (entries: AssetEntry[], stats: Invocat
}

if (cfg.verbose) {
console.log('\nTransforming images...');
console.log('Transforming images...');
}

const batches = splitChunks(entries, cfg.concurrency);
Expand Down Expand Up @@ -115,6 +119,10 @@ export const transformImageAssets = async (entries: AssetEntry[], stats: Invocat

}));
}

if (cfg.verbose) {
console.log('\r');
}
};

export const clearUnusedCache = async (cacheIndex: CacheIndex, cfg: RuntimeConfig) => {
Expand All @@ -125,6 +133,7 @@ export const clearUnusedCache = async (cacheIndex: CacheIndex, cfg: RuntimeConfi

if (cfg.verbose) {
console.log('\nCleaning up', cacheIndex.size, 'unused cache entries');
console.log('\r');
}

for (const [_, value] of cacheIndex) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": false,
"name": "@maddsua/ssg-assets",
"version": "4.0.2",
"version": "4.0.3",
"type": "module",
"engines": {
"node": ">=16.4.0"
Expand Down Expand Up @@ -67,7 +67,7 @@
"build": "run-s typecheck bundle",
"dev": "esbuild cli/main.ts --outfile=bin/main.js --bundle --platform=node --format=esm --external:sharp --external:chalk --external:minimatch --external:esbuild --watch",
"test:cli": "run-s bundle test:cli:run",
"test:cli:run": "node bin/main.js --verbose --configFile=./tests/convert/ssgassets.config.json"
"test:cli:run": "node bin/main.js --configFile=./tests/convert/ssgassets.config.json"
},
"dependencies": {
"chalk": "^5.3.0",
Expand Down

0 comments on commit a11711d

Please sign in to comment.