Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored Mar 10, 2023
2 parents e51d87c + d37dc7c commit 0c1d38b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .changeset/sweet-zoos-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@astrojs/tailwind": patch
"@astrojs/turbolinks": patch
---

Make Tailwind & Turbolinks integration descriptions more consistent
2 changes: 1 addition & 1 deletion packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"scripts": {
"prebuild": "astro-scripts prebuild --to-string \"src/runtime/server/astro-island.ts\" \"src/runtime/client/{idle,load,media,only,visible}.ts\"",
"build": "pnpm run prebuild && astro-scripts build \"src/**/*.ts\" && tsc && pnpm run postbuild",
"build:ci": "pnpm run prebuild && astro-scripts build \"src/**/*.ts\"",
"build:ci": "pnpm run prebuild && astro-scripts build \"src/**/*.ts\" && pnpm run postbuild",
"dev": "astro-scripts dev --copy-wasm --prebuild \"src/runtime/server/astro-island.ts\" --prebuild \"src/runtime/client/{idle,load,media,only,visible}.ts\" \"src/**/*.ts\"",
"postbuild": "astro-scripts copy \"src/**/*.astro\" && astro-scripts copy \"src/**/*.wasm\"",
"test:unit": "mocha --exit --timeout 30000 ./test/units/**/*.test.js",
Expand Down
7 changes: 5 additions & 2 deletions packages/astro/src/assets/utils/metadata.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sizeOf from 'image-size';
import fs from 'node:fs/promises';
import { fileURLToPath } from 'node:url';
import { ImageMetadata, InputFormat } from '../types.js';
Expand All @@ -7,10 +6,14 @@ export interface Metadata extends ImageMetadata {
orientation?: number;
}

let sizeOf: typeof import('image-size').default | undefined;
export async function imageMetadata(
src: URL | string,
data?: Buffer
): Promise<Metadata | undefined> {
if (!sizeOf) {
sizeOf = await import('image-size').then((mod) => mod.default);
}
let file = data;
if (!file) {
try {
Expand All @@ -20,7 +23,7 @@ export async function imageMetadata(
}
}

const { width, height, type, orientation } = await sizeOf(file);
const { width, height, type, orientation } = await sizeOf!(file);
const isPortrait = (orientation || 0) >= 5;

if (!width || !height || !type) {
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/tailwind/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@astrojs/tailwind",
"description": "Tailwind + Astro Integrations",
"description": "Use Tailwind CSS to style your Astro site",
"version": "3.1.0",
"type": "module",
"types": "./dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/turbolinks/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@astrojs/turbolinks",
"description": "Turbolinks + Astro Integrations",
"description": "Deprecated — Use Turbolinks to speed up page navigation in your Astro site",
"version": "0.2.0",
"type": "module",
"types": "./dist/index.d.ts",
Expand Down

0 comments on commit 0c1d38b

Please sign in to comment.