Skip to content

Commit 240d88a

Browse files
authored
fix format (#2736)
1 parent 0ae96bb commit 240d88a

File tree

19 files changed

+1869
-1921
lines changed

19 files changed

+1869
-1921
lines changed

.github/workflows/format.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ jobs:
1313
uses: actions/checkout@v2
1414
with:
1515
ref: ${{ github.head_ref }}
16+
- name: Setup PNPM
17+
uses: pnpm/action-setup@v2.0.1
18+
with:
19+
version: 6.23.6
20+
- name: Setup Node
21+
uses: actions/setup-node@v2
22+
with:
23+
node-version: 16
24+
cache: 'pnpm'
1625
- name: Install NPM Dependencies
1726
run: pnpm install
1827
env:

.prettierignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Also, be sure to remove "pluginSearchDirs" from config
33
**/*.astro
44

5-
# Config
5+
# Deep Directories
66
**/dist
77
**/smoke
88
**/node_modules
@@ -11,6 +11,11 @@
1111
**/.vercel
1212
examples/docs/**/*.md
1313
examples/blog/**/*.md
14+
15+
# Directories
1416
.github
1517
.changeset
18+
19+
# Files
1620
README.md
21+
packages/webapi/mod.d.ts
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
packages:
2-
- "packages/**/*"
3-
- "demo"
2+
- 'packages/**/*'
3+
- 'demo'

examples/starter/astro.config.mjs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
// You can disable this by removing "@ts-check" and `@type` comments below.
88

99
// @ts-check
10-
export default /** @type {import('astro').AstroUserConfig} */ (
11-
{
12-
// Set "renderers" to "[]" to disable all default, builtin component support.
13-
renderers: [],
14-
}
15-
);
10+
export default /** @type {import('astro').AstroUserConfig} */ ({
11+
// Set "renderers" to "[]" to disable all default, builtin component support.
12+
renderers: [],
13+
});

examples/with-markdown/astro.config.mjs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@
77
// You can disable this by removing "@ts-check" and `@type` comments below.
88

99
// @ts-check
10-
export default /** @type {import('astro').AstroUserConfig} */ (
11-
{
12-
renderers: [
13-
"@astrojs/renderer-preact",
14-
"@astrojs/renderer-react",
15-
"@astrojs/renderer-svelte",
16-
"@astrojs/renderer-vue",
17-
],
18-
}
19-
);
10+
export default /** @type {import('astro').AstroUserConfig} */ ({
11+
renderers: ['@astrojs/renderer-preact', '@astrojs/renderer-react', '@astrojs/renderer-svelte', '@astrojs/renderer-vue'],
12+
});

packages/astro/src/core/dev/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,14 @@ export default async function dev(config: AstroConfig, options: DevOptions = { l
3838
const viteServer = await vite.createServer(viteConfig);
3939
await viteServer.listen(config.devOptions.port);
4040
const address = viteServer.httpServer!.address() as AddressInfo;
41-
const localAddress = getLocalAddress(address.address, config.devOptions.hostname)
41+
const localAddress = getLocalAddress(address.address, config.devOptions.hostname);
4242
// Log to console
4343
const site = config.buildOptions.site ? new URL(config.buildOptions.site) : undefined;
44-
info(options.logging, null, msg.devStart({ startupTime: performance.now() - devStart, port: address.port, localAddress, networkAddress: address.address, site, https: !!viteUserConfig.server?.https }));
44+
info(
45+
options.logging,
46+
null,
47+
msg.devStart({ startupTime: performance.now() - devStart, port: address.port, localAddress, networkAddress: address.address, site, https: !!viteUserConfig.server?.https })
48+
);
4549

4650
return {
4751
address,

packages/astro/src/core/dev/util.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export function emoji(char: string, fallback: string) {
1313

1414
export function getLocalAddress(serverAddress: string, configHostname: string): string {
1515
if (configHostname === 'localhost' || serverAddress === '127.0.0.1' || serverAddress === '0.0.0.0') {
16-
return 'localhost'
16+
return 'localhost';
1717
} else {
18-
return serverAddress
18+
return serverAddress;
1919
}
20-
}
20+
}

packages/astro/src/core/logger.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export const defaultLogDestination = new Writable({
3535
dest = process.stdout;
3636
}
3737

38-
3938
let type = event.type;
4039
if (type) {
4140
// hide timestamp when type is undefined

packages/astro/src/core/messages.ts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,35 @@ export function reload({ url, reqTime }: { url: string; reqTime: number }): stri
2323
}
2424

2525
/** Display dev server host and startup time */
26-
export function devStart({ startupTime, port, localAddress, networkAddress, https, site }: { startupTime: number; port: number; localAddress: string; networkAddress: string; https: boolean; site: URL | undefined }): string {
26+
export function devStart({
27+
startupTime,
28+
port,
29+
localAddress,
30+
networkAddress,
31+
https,
32+
site,
33+
}: {
34+
startupTime: number;
35+
port: number;
36+
localAddress: string;
37+
networkAddress: string;
38+
https: boolean;
39+
site: URL | undefined;
40+
}): string {
2741
// PACAKGE_VERSION is injected at build-time
2842
const pkgVersion = process.env.PACKAGE_VERSION;
2943

3044
const rootPath = site ? site.pathname : '/';
31-
const toDisplayUrl = (hostname: string) => `${https ? 'https' : 'http'}://${hostname}:${port}${rootPath}`
45+
const toDisplayUrl = (hostname: string) => `${https ? 'https' : 'http'}://${hostname}:${port}${rootPath}`;
3246
const messages = [
3347
``,
3448
`${emoji('🚀 ', '')}${magenta(`astro ${pkgVersion}`)} ${dim(`started in ${Math.round(startupTime)}ms`)}`,
3549
``,
3650
`Local: ${bold(cyan(toDisplayUrl(localAddress)))}`,
3751
`Network: ${bold(cyan(toDisplayUrl(networkAddress)))}`,
3852
``,
39-
]
40-
return messages.join('\n')
53+
];
54+
return messages.join('\n');
4155
}
4256

4357
/** Display dev server host */

packages/astro/src/core/preview/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export default async function preview(config: AstroConfig, { logging }: PreviewO
128128
httpServer = server.listen(port, hostname, async () => {
129129
if (!showedListenMsg) {
130130
const { address: networkAddress } = server.address() as AddressInfo;
131-
const localAddress = getLocalAddress(networkAddress, hostname)
131+
const localAddress = getLocalAddress(networkAddress, hostname);
132132

133133
info(logging, null, msg.devStart({ startupTime: performance.now() - timerStart, port, localAddress, networkAddress, https: false, site: baseURL }));
134134
}

0 commit comments

Comments
 (0)