From 0de08773f30cef0e131e42f2068ff56f826b41c0 Mon Sep 17 00:00:00 2001 From: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com> Date: Thu, 9 Mar 2023 19:55:49 -0300 Subject: [PATCH 1/4] Make Tailwind & Turbolinks integration descriptions more consistent (#6419) * Fix npm description for Tailwind & Turbolinks * Change order so all start with Astro * More descriptive descriptions! Co-authored-by: Chris Swithinbank * Add changeset --------- Co-authored-by: Chris Swithinbank --- .changeset/sweet-zoos-serve.md | 6 ++++++ packages/integrations/tailwind/package.json | 2 +- packages/integrations/turbolinks/package.json | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/sweet-zoos-serve.md diff --git a/.changeset/sweet-zoos-serve.md b/.changeset/sweet-zoos-serve.md new file mode 100644 index 0000000000000..72fb9d6a6c890 --- /dev/null +++ b/.changeset/sweet-zoos-serve.md @@ -0,0 +1,6 @@ +--- +"@astrojs/tailwind": patch +"@astrojs/turbolinks": patch +--- + +Make Tailwind & Turbolinks integration descriptions more consistent diff --git a/packages/integrations/tailwind/package.json b/packages/integrations/tailwind/package.json index 8801c41093cd1..497d0864087fc 100644 --- a/packages/integrations/tailwind/package.json +++ b/packages/integrations/tailwind/package.json @@ -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", diff --git a/packages/integrations/turbolinks/package.json b/packages/integrations/turbolinks/package.json index 3d48348b2e428..5ed79680d2ce8 100644 --- a/packages/integrations/turbolinks/package.json +++ b/packages/integrations/turbolinks/package.json @@ -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", From abaf860af739c5e087eafed337105a89d29bc3e9 Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Fri, 10 Mar 2023 17:32:35 +0800 Subject: [PATCH 2/4] Add postbuild to build:ci command (#6498) --- packages/astro/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/astro/package.json b/packages/astro/package.json index 07c621d7b3814..23410941c7d27 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -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", From 09813f1610dff4cf4806b7b048b5fa090780e542 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Fri, 10 Mar 2023 07:35:40 -0600 Subject: [PATCH 3/4] fix: prefer dynamic import for `image-size` (#6495) --- packages/astro/src/assets/utils/metadata.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/astro/src/assets/utils/metadata.ts b/packages/astro/src/assets/utils/metadata.ts index 8cf0cc4708920..710e758d967b1 100644 --- a/packages/astro/src/assets/utils/metadata.ts +++ b/packages/astro/src/assets/utils/metadata.ts @@ -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'; @@ -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 { + if (!sizeOf) { + sizeOf = await import('image-size').then(mod => mod.default); + } let file = data; if (!file) { try { @@ -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) { From d37dc7c71a688fe25cfdd7cfa3594ffe1e0a6d6e Mon Sep 17 00:00:00 2001 From: natemoo-re Date: Fri, 10 Mar 2023 13:38:14 +0000 Subject: [PATCH 4/4] [ci] format --- packages/astro/src/assets/utils/metadata.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/astro/src/assets/utils/metadata.ts b/packages/astro/src/assets/utils/metadata.ts index 710e758d967b1..fa6bb9e10f945 100644 --- a/packages/astro/src/assets/utils/metadata.ts +++ b/packages/astro/src/assets/utils/metadata.ts @@ -12,7 +12,7 @@ export async function imageMetadata( data?: Buffer ): Promise { if (!sizeOf) { - sizeOf = await import('image-size').then(mod => mod.default); + sizeOf = await import('image-size').then((mod) => mod.default); } let file = data; if (!file) {