Skip to content

Commit fca8c00

Browse files
fix: logging
1 parent 09c7cd7 commit fca8c00

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

packages/create-webpack-app/src/utils/logger.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,21 @@ const typeDisplay: Record<string, Color | string> = {
2828
};
2929

3030
function onSuccessHandler(change: PlopActionHooksChanges): void {
31-
change.path.split("\n").forEach((line) => {
32-
const [operationType = "", renderPath = ""] = line.split("|") as [string, string];
33-
console.log(
34-
`\t${typeDisplay[operationType]} ${normalize(relative(process.cwd(), renderPath))}`,
35-
);
36-
});
31+
switch (change.type) {
32+
case "fileGenerator": {
33+
change.path.split("\n").forEach((line) => {
34+
const [operationType = "", renderPath = ""] = line.split("|");
35+
console.log(
36+
`\t${typeDisplay[operationType]} ${normalize(relative(process.cwd(), renderPath))}`,
37+
);
38+
});
39+
break;
40+
}
41+
case "pkgInstall": {
42+
logger.success(change.path);
43+
break;
44+
}
45+
}
3746
}
3847

3948
function onFailureHandler(failure: PlopActionHooksFailures): void {

packages/create-webpack-app/src/utils/pkgInstallAction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default async function (plop: NodePlopAPI) {
3030

3131
// promise to complete subprocess of installing packages and return a message
3232
const returnPromise: Promise<string> = new Promise((resolve, reject) => {
33-
const returnMessage = `Project Dependencies installed successfully`;
33+
const returnMessage = `Project dependencies installed successfully!`;
3434
const packageManager = answers.packageManager;
3535
const packages = config.packages.length == 1 ? [config.packages[0]] : config.packages;
3636
const installOptions: Record<string, Array<string>> = {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy