🎉 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/docs/index.d.ts
generated
vendored
Normal file
6
node_modules/astro/dist/cli/docs/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
import type yargs from 'yargs-parser';
|
||||
interface DocsOptions {
|
||||
flags: yargs.Arguments;
|
||||
}
|
||||
export declare function docs({ flags }: DocsOptions): Promise<import("execa").ExecaReturnValue<string> | undefined>;
|
||||
export {};
|
18
node_modules/astro/dist/cli/docs/index.js
generated
vendored
Normal file
18
node_modules/astro/dist/cli/docs/index.js
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { printHelp } from "../../core/messages.js";
|
||||
import { openInBrowser } from "./open.js";
|
||||
async function docs({ flags }) {
|
||||
if (flags.help || flags.h) {
|
||||
printHelp({
|
||||
commandName: "astro docs",
|
||||
tables: {
|
||||
Flags: [["--help (-h)", "See all available flags."]]
|
||||
},
|
||||
description: `Launches the Astro Docs website directly from the terminal.`
|
||||
});
|
||||
return;
|
||||
}
|
||||
return await openInBrowser("https://docs.astro.build/");
|
||||
}
|
||||
export {
|
||||
docs
|
||||
};
|
2
node_modules/astro/dist/cli/docs/open.d.ts
generated
vendored
Normal file
2
node_modules/astro/dist/cli/docs/open.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
import type { ExecaChildProcess } from 'execa';
|
||||
export declare function openInBrowser(url: string): Promise<ExecaChildProcess>;
|
28
node_modules/astro/dist/cli/docs/open.js
generated
vendored
Normal file
28
node_modules/astro/dist/cli/docs/open.js
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
import { execa } from "execa";
|
||||
const getPlatformSpecificCommand = () => {
|
||||
const isGitPod = Boolean(process.env.GITPOD_REPO_ROOT);
|
||||
const platform = isGitPod ? "gitpod" : process.platform;
|
||||
switch (platform) {
|
||||
case "android":
|
||||
case "linux":
|
||||
return ["xdg-open"];
|
||||
case "darwin":
|
||||
return ["open"];
|
||||
case "win32":
|
||||
return ["cmd", ["/c", "start"]];
|
||||
case "gitpod":
|
||||
return ["/ide/bin/remote-cli/gitpod-code", ["--openExternal"]];
|
||||
default:
|
||||
throw new Error(
|
||||
`It looks like your platform ("${platform}") isn't supported!
|
||||
To view Astro's docs, please visit https://docs.astro.build`
|
||||
);
|
||||
}
|
||||
};
|
||||
async function openInBrowser(url) {
|
||||
const [command, args = []] = getPlatformSpecificCommand();
|
||||
return execa(command, [...args, encodeURI(url)]);
|
||||
}
|
||||
export {
|
||||
openInBrowser
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue