Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: show meta framework name on server build success #1955

Merged
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
parseNodeModulePath,
resolvePath,
} from "mlly";
import { upperFirst } from "scule";
import { version as nitroVersion } from "../package.json";
import { generateFSTree } from "./utils/tree";
import { getRollupConfig, RollupConfig } from "./rollup/config";
Expand Down Expand Up @@ -482,10 +483,19 @@ function startRollupWatcher(nitro: Nitro, rollupConfig: RollupConfig) {
// Finished building all bundles
case "END": {
nitro.hooks.callHook("compiled", nitro);
nitro.logger.success(
"Nitro built",
start ? `in ${Date.now() - start} ms` : ""
);

if (nitro.options.logging.showBuildSuccess) {
let successReport = `Nitro Server`;
if (nitro.options.framework.name !== "nitro") {
const _name = upperFirst(nitro.options.framework.name);
successReport = `${_name} ${successReport}`;
}
nitro.logger.success(
`${successReport} built`,
start ? `in ${Date.now() - start} ms` : ""
);
}

nitro.hooks.callHook("dev:reload");
return;
}
Expand Down
1 change: 1 addition & 0 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const NitroDefaults: NitroConfig = {
// Logging
logging: {
compressedSizes: true,
showBuildSuccess: true,
},

// Routing
Expand Down
1 change: 1 addition & 0 deletions src/types/nitro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ export interface NitroOptions extends PresetOptions {
// Logging
logging: {
compressedSizes: boolean;
showBuildSuccess: boolean;
};

// Routing
Expand Down