🎉 initiate project *astro_rewrite*
This commit is contained in:
parent
ffd4d5e86c
commit
2ba37bfbe3
8658 changed files with 2268794 additions and 2538 deletions
6
node_modules/astro/dist/cli/info/index.d.ts
generated
vendored
Normal file
6
node_modules/astro/dist/cli/info/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
import type yargs from 'yargs-parser';
|
||||
interface InfoOptions {
|
||||
flags: yargs.Arguments;
|
||||
}
|
||||
export declare function printInfo({ flags }: InfoOptions): Promise<void>;
|
||||
export {};
|
45
node_modules/astro/dist/cli/info/index.js
generated
vendored
Normal file
45
node_modules/astro/dist/cli/info/index.js
generated
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
import * as colors from "kleur/colors";
|
||||
import { arch, platform } from "node:os";
|
||||
import whichPm from "which-pm";
|
||||
import { openConfig } from "../../core/config/index.js";
|
||||
import { ASTRO_VERSION } from "../../core/constants.js";
|
||||
async function printInfo({ flags }) {
|
||||
var _a;
|
||||
const packageManager = await whichPm(process.cwd());
|
||||
let adapter = "Couldn't determine.";
|
||||
let integrations = [];
|
||||
const MAX_PADDING = 25;
|
||||
function printRow(label, value) {
|
||||
const padding = MAX_PADDING - label.length;
|
||||
console.log(`${colors.bold(label)}` + " ".repeat(padding) + `${colors.green(value)}`);
|
||||
}
|
||||
try {
|
||||
const { userConfig } = await openConfig({
|
||||
cwd: flags.root,
|
||||
flags,
|
||||
cmd: "info"
|
||||
});
|
||||
if ((_a = userConfig.adapter) == null ? void 0 : _a.name) {
|
||||
adapter = userConfig.adapter.name;
|
||||
}
|
||||
if (userConfig.integrations) {
|
||||
integrations = ((userConfig == null ? void 0 : userConfig.integrations) ?? []).filter(Boolean).flat().map((i) => i == null ? void 0 : i.name);
|
||||
}
|
||||
} catch (_e) {
|
||||
}
|
||||
console.log();
|
||||
const packageManagerName = (packageManager == null ? void 0 : packageManager.name) ?? "Couldn't determine.";
|
||||
printRow("Astro version", `v${ASTRO_VERSION}`);
|
||||
printRow("Package manager", packageManagerName);
|
||||
printRow("Platform", platform());
|
||||
printRow("Architecture", arch());
|
||||
printRow("Adapter", adapter);
|
||||
let integrationsString = "None or couldn't determine.";
|
||||
if (integrations.length > 0) {
|
||||
integrationsString = integrations.join(", ");
|
||||
}
|
||||
printRow("Integrations", integrationsString);
|
||||
}
|
||||
export {
|
||||
printInfo
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue