Skip to content

Commit

Permalink
apply format
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Apr 13, 2024
1 parent 551a7fc commit f0ac14c
Show file tree
Hide file tree
Showing 38 changed files with 120 additions and 261 deletions.
5 changes: 1 addition & 4 deletions benchmark/packages/timer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
"types": "./dist/index.d.ts",
"author": "withastro",
"license": "MIT",
"keywords": [
"withastro",
"astro-adapter"
],
"keywords": ["withastro", "astro-adapter"],
"exports": {
".": "./dist/index.js",
"./server.js": "./dist/server.js",
Expand Down
56 changes: 28 additions & 28 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"$schema": "https://biomejs.dev/schemas/1.6.4/schema.json",
"files": {
"ignore": ["vendor", "dist/**"],
"include": ["test/**", "e2e/**", "packages/**"]
},
"formatter": {
"indentStyle": "tab",
"indentWidth": 2,
"lineWidth": 100,
"ignore": [
"benchmark/projects/",
"benchmark/results/",
"**/dist/**",
"**/smoke/**",
"**/fixtures/**",
"**/vendor/**",
"**/.vercel/**",
".changeset",
"pnpm-lock.yaml"
]
},
"organizeImports": { "enabled": true },
"linter": { "enabled": false },
"javascript": {
"formatter": {
"trailingComma": "es5",
"quoteStyle": "single",
"$schema": "https://biomejs.dev/schemas/1.6.4/schema.json",
"files": {
"ignore": ["vendor", "dist/**"],
"include": ["test/**", "e2e/**", "packages/**"]
},
"formatter": {
"indentStyle": "tab",
"indentWidth": 2,
"lineWidth": 100,
"ignore": [
"benchmark/projects/",
"benchmark/results/",
"**/dist/**",
"**/smoke/**",
"**/fixtures/**",
"**/vendor/**",
"**/.vercel/**",
".changeset",
"pnpm-lock.yaml"
]
},
"organizeImports": { "enabled": true },
"linter": { "enabled": false },
"javascript": {
"formatter": {
"trailingComma": "es5",
"quoteStyle": "single",
"semicolons": "always"
}
},
},
"json": {
"parser": {
"allowComments": true,
Expand Down
10 changes: 2 additions & 8 deletions packages/astro-prism/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,8 @@
"./Prism.astro": "./Prism.astro",
"./dist/highlighter": "./dist/highlighter.js"
},
"files": [
"dist",
"Prism.astro"
],
"keywords": [
"astro",
"astro-component"
],
"files": ["dist", "Prism.astro"],
"keywords": ["astro", "astro-component"],
"dependencies": {
"prismjs": "^1.29.0"
},
Expand Down
4 changes: 1 addition & 3 deletions packages/astro-rss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
".": "./dist/index.js",
"./package.json": "./package.json"
},
"files": [
"dist"
],
"files": ["dist"],
"scripts": {
"build": "astro-scripts build \"src/**/*.ts\" && tsc",
"build:ci": "astro-scripts build \"src/**/*.ts\"",
Expand Down
12 changes: 3 additions & 9 deletions packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,9 @@
"types": "./index.d.ts",
"typesVersions": {
"*": {
"app": [
"./dist/core/app/index"
],
"app/*": [
"./dist/core/app/*"
],
"middleware": [
"./dist/virtual-modules/middleware.d.ts"
]
"app": ["./dist/core/app/index"],
"app/*": ["./dist/core/app/*"],
"middleware": ["./dist/virtual-modules/middleware.d.ts"]
}
},
"exports": {
Expand Down
4 changes: 3 additions & 1 deletion packages/astro/src/assets/vite-plugin-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ export default function assets({
: settings.config.outDir
)
)});
export const assetsDir = /* #__PURE__ */ new URL(${JSON.stringify(settings.config.build.assets)}, outDir);
export const assetsDir = /* #__PURE__ */ new URL(${JSON.stringify(
settings.config.build.assets
)}, outDir);
export const getImage = async (options) => await getImageInternal(options, imageConfig);
`;
}
Expand Down
4 changes: 3 additions & 1 deletion packages/astro/src/cli/install-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export async function getPackage<T>(
return packageImport as T;
} catch (e) {
if (options.optional) return undefined;
let message = `To continue, Astro requires the following dependency to be installed: ${bold(packageName)}.`;
let message = `To continue, Astro requires the following dependency to be installed: ${bold(
packageName
)}.`;

if (ci.isCI) {
message += ` Packages cannot be installed automatically in CI environments.`;
Expand Down
4 changes: 3 additions & 1 deletion packages/astro/src/core/errors/dev/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ function collectInfoFromStacktrace(error: SSRError & { stack: string }): StackIn
error.pluginCode ||
error.id ||
// TODO: this could be better, `src` might be something else
stackText.split('\n').find((ln) => ln.includes('src') || ln.includes('node_modules'));
stackText
.split('\n')
.find((ln) => ln.includes('src') || ln.includes('node_modules'));
// Disable eslint as we're not sure how to improve this regex yet
// eslint-disable-next-line regexp/no-super-linear-backtracking
const source = possibleFilePath?.replace?.(/^[^(]+\(([^)]+).*$/, '$1').replace(/^\s+at\s+/, '');
Expand Down
4 changes: 1 addition & 3 deletions packages/astro/src/core/errors/errors-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,7 @@ export const NoMatchingRenderer = {
${
validRenderersCount > 0
? `There ${plural ? 'are' : 'is'} ${validRenderersCount} renderer${
plural ? 's' : ''
} configured in your \`astro.config.mjs\` file,
? `There ${plural ? 'are' : 'is'} ${validRenderersCount} renderer${plural ? 's' : ''} configured in your \`astro.config.mjs\` file,
but ${plural ? 'none were' : 'it was not'} able to server-side render \`${componentName}\`.`
: `No valid renderer was found ${
componentExtension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,9 @@ export default {
if (placement === settings.config[setting.settingKey]) {
option.selected = true;
}
option.textContent =
`${placement.slice(0, 1).toUpperCase()}${placement.slice(1)}`.replace('-', ' ');
option.textContent = `${placement.slice(0, 1).toUpperCase()}${placement.slice(
1
)}`.replace('-', ' ');
astroSelect.append(option);
});
astroSelect.element.addEventListener('change', setting.changeEvent);
Expand Down
8 changes: 6 additions & 2 deletions packages/astro/src/runtime/client/dev-toolbar/toolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ export class AstroDevToolbar extends HTMLElement {
width: 1px;
}
</style>
<div id="dev-toolbar-root" data-hidden ${settings.config.disableAppNotification ? 'data-no-notification' : ''} data-placement="${settings.config.placement}">
<div id="dev-toolbar-root" data-hidden ${
settings.config.disableAppNotification ? 'data-no-notification' : ''
} data-placement="${settings.config.placement}">
<div id="dev-bar-hitbox-above"></div>
<div id="dev-bar">
<div id="bar-container">
Expand All @@ -281,7 +283,9 @@ export class AstroDevToolbar extends HTMLElement {
: ''
}
<div class="separator"></div>
${this.getAppTemplate(this.apps.find((app) => app.builtIn && app.id === 'astro:settings')!)}
${this.getAppTemplate(
this.apps.find((app) => app.builtIn && app.id === 'astro:settings')!
)}
</div>
</div>
<div id="dev-bar-hitbox-below"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ export class DevToolbarTooltip extends HTMLElement {
: ''
}
${section.content ? `<div class="section-content">${section.content}</div>` : ''}
${section.clickDescription ? `<span class="modal-cta">${section.clickDescription}</span>` : ''}
${
section.clickDescription
? `<span class="modal-cta">${section.clickDescription}</span>`
: ''
}
`;
fragment.append(sectionElement);

Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/transitions/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ async function transition(
preparationEvent.sourceElement instanceof HTMLFormElement
? preparationEvent.sourceElement
: preparationEvent.sourceElement instanceof HTMLElement &&
'form' in preparationEvent.sourceElement
'form' in preparationEvent.sourceElement
? (preparationEvent.sourceElement.form as HTMLFormElement)
: preparationEvent.sourceElement?.closest('form');
// Form elements without enctype explicitly set default to application/x-www-form-urlencoded.
Expand Down
6 changes: 5 additions & 1 deletion packages/astro/test/test-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ export default function (
return new Response(data);
}
${provideAddress ? `request[Symbol.for('astro.clientAddress')] = '0.0.0.0';` : ''}
${
provideAddress
? `request[Symbol.for('astro.clientAddress')] = '0.0.0.0';`
: ''
}
return super.render(request, routeData, locals);
}
}
Expand Down
5 changes: 1 addition & 4 deletions packages/create-astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
"dev": "astro-scripts dev \"src/**/*.ts\"",
"test": "astro-scripts test \"test/**/*.test.js\""
},
"files": [
"dist",
"create-astro.js"
],
"files": ["dist", "create-astro.js"],
"//a": "MOST PACKAGES SHOULD GO IN DEV_DEPENDENCIES! THEY WILL BE BUNDLED.",
"//b": "DEPENDENCIES IS FOR UNBUNDLED PACKAGES",
"dependencies": {
Expand Down
27 changes: 6 additions & 21 deletions packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,14 @@
},
"typesVersions": {
"*": {
".": [
"./index.d.ts"
],
"types": [
"./dist/types.d.ts"
],
"utils": [
"./dist/utils.d.ts"
],
"runtime": [
"./dist/runtime/index.d.ts"
]
".": ["./index.d.ts"],
"types": ["./dist/types.d.ts"],
"utils": ["./dist/utils.d.ts"],
"runtime": ["./dist/runtime/index.d.ts"]
}
},
"files": [
"index.d.ts",
"virtual.d.ts",
"dist"
],
"keywords": [
"withastro",
"astro-integration"
],
"files": ["index.d.ts", "virtual.d.ts", "dist"],
"keywords": ["withastro", "astro-integration"],
"scripts": {
"types:virtual": "tsc -p ./tsconfig.virtual.json",
"build": "astro-scripts build \"src/**/*.ts\" && tsc && pnpm types:virtual",
Expand Down
3 changes: 1 addition & 2 deletions packages/db/src/core/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ export const RENAME_COLUMN_ERROR = (oldSelector: string, newSelector: string) =>
);
};

export const FILE_NOT_FOUND_ERROR = (path: string) =>
`${red('▶ File not found:')} ${bold(path)}\n`;
export const FILE_NOT_FOUND_ERROR = (path: string) => `${red('▶ File not found:')} ${bold(path)}\n`;

export const SHELL_QUERY_MISSING_ERROR = `${red(
'▶ Please provide a query to execute using the --query flag.'
Expand Down
4 changes: 3 additions & 1 deletion packages/db/src/core/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ export const dateColumnSchema = z.object({
.union([
sqlSchema,
// transform to ISO string for serialization
z.date().transform((d) => d.toISOString()),
z
.date()
.transform((d) => d.toISOString()),
])
.optional(),
}),
Expand Down
12 changes: 2 additions & 10 deletions packages/integrations/alpinejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,14 @@
"url": "https://github.com/withastro/astro.git",
"directory": "packages/integrations/alpinejs"
},
"keywords": [
"astro-integration",
"astro-component",
"renderer",
"alpinejs",
"performance"
],
"keywords": ["astro-integration", "astro-component", "renderer", "alpinejs", "performance"],
"bugs": "https://github.com/withastro/astro/issues",
"homepage": "https://docs.astro.build/en/guides/integrations-guide/alpinejs",
"exports": {
".": "./dist/index.js",
"./package.json": "./package.json"
},
"files": [
"dist"
],
"files": ["dist"],
"scripts": {
"build": "astro-scripts build \"src/**/*.ts\" && tsc",
"build:ci": "astro-scripts build \"src/**/*.ts\"",
Expand Down
7 changes: 1 addition & 6 deletions packages/integrations/lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@
"url": "https://github.com/withastro/astro.git",
"directory": "packages/integrations/lit"
},
"keywords": [
"astro-integration",
"astro-component",
"renderer",
"lit"
],
"keywords": ["astro-integration", "astro-component", "renderer", "lit"],
"bugs": "https://github.com/withastro/astro/issues",
"homepage": "https://docs.astro.build/en/guides/integrations-guide/lit/",
"exports": {
Expand Down
24 changes: 5 additions & 19 deletions packages/integrations/markdoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
"url": "https://github.com/withastro/astro.git",
"directory": "packages/integrations/markdoc"
},
"keywords": [
"astro-integration",
"astro-component",
"markdoc"
],
"keywords": ["astro-integration", "astro-component", "markdoc"],
"bugs": "https://github.com/withastro/astro/issues",
"homepage": "https://docs.astro.build/en/guides/integrations-guide/markdoc/",
"exports": {
Expand All @@ -39,22 +35,12 @@
},
"typesVersions": {
"*": {
"config": [
"./dist/config.d.ts"
],
"prism": [
"./dist/extensions/prism.d.ts"
],
"shiki": [
"./dist/extensions/shiki.d.ts"
]
"config": ["./dist/config.d.ts"],
"prism": ["./dist/extensions/prism.d.ts"],
"shiki": ["./dist/extensions/shiki.d.ts"]
}
},
"files": [
"components",
"dist",
"template"
],
"files": ["components", "dist", "template"],
"scripts": {
"build": "astro-scripts build \"src/**/*.ts\" && tsc",
"build:ci": "astro-scripts build \"src/**/*.ts\"",
Expand Down
Loading

0 comments on commit f0ac14c

Please sign in to comment.