Commit graph

114 commits

Author SHA1 Message Date
Chris Swithinbank
e2b3f8a3f4
integrations: update recommended method for running astro add (#4340) 2022-08-16 10:31:14 +02:00
mundry
2bb4e3b812
add missing word in image integration-guide (#4303)
Co-authored-by: mundry <mundry@users.noreply.github.com>
2022-08-13 13:41:15 -03:00
Fred K. Bot
bb3d7d4f39
[ci] release (#4249)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-11 16:50:59 -07:00
FredKSchott
be6470688f [ci] format 2022-08-11 23:26:19 +00:00
Fred K. Schott
42fd6936cd
fix astro image bad imports (#4279) 2022-08-11 16:24:17 -07:00
Caleb Jasik
5afb5ef7af
Fix spelling mistake in @astrojs/image docs (#4256)
`intergration` -> `integration`
2022-08-11 11:07:11 -05:00
Fred K. Bot
74528a1973
[ci] release (#4224)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-09 17:31:06 -07:00
Alexandre Desroches
92aa6a75ea
Updated @astrojs/image README.md missing formats prop as subtitle (#4221)
* Update README.md

Added missing subtitle for `formats` prop of the <Picture> component

* Create fast-drinks-visit.md

Co-authored-by: Fred K. Schott <fkschott@gmail.com>
2022-08-09 16:29:07 -07:00
Sarah Rainsberger
63d43e1754
remove errant remaining details tags (#4212) 2022-08-09 09:09:16 -05:00
Erika
36cb503c8a
Update @astrojs/image README with mention of the new env.d.ts file (#4206) 2022-08-08 17:27:48 -04:00
Sarah Rainsberger
9894b3dcde
remove details tags from integration READMEs (#4198) 2022-08-08 12:07:38 -05:00
Fred K. Bot
4e4061f485
[ci] release (#4159)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-05 21:48:35 -07:00
FredKSchott
4de35f3b70 [ci] format 2022-08-06 04:39:26 +00:00
Corbin Crutchley
97cf0cd893
fix: export all of @astrojs/image dist (#4146)
* fix: export all of @astrojs/image dist

* chore: add changeset

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-08-05 19:00:35 -05:00
Corbin Crutchley
c039ea93a1
Fix external astro image usage (#4147)
* fix: enable @astrojs/image to be used inside of non-vite contexts

* chore: add changeset

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-08-05 18:56:12 -05:00
Jack Merrill
4678a3f358
feat(image): Add GIF -> WEBP support (#4139) (#4140)
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-08-05 17:32:45 -05:00
tony-sull
14d27c1d6f [ci] format 2022-08-05 20:38:06 +00:00
Tony Sullivan
5811208182
Fixes local image resolution in SSR builds on Windows (#4173)
* fixing SSR local file resolution path on windows

* chore: add changeset

* nit: fixing typo in image README file

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-08-05 20:36:30 +00:00
Fred K. Bot
7300f094fd
[ci] release (#4133)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-03 23:14:04 -07:00
Fred K. Schott
65f2d3b4b1
fix windows package export (#4141)
* fix windows package export

* Create neat-badgers-bow.md
2022-08-03 23:11:37 -07:00
Erika
ac6ffdb310
Audit dependencies (#4096)
* Remove some unused dependencies

* Update lockfile

* Add util

* Remove util
2022-08-02 16:08:21 -04:00
Sarah Rainsberger
76ec35ff30
[docs content] Image README formatting (#4082)
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
2022-07-30 09:29:03 -03:00
Fred K. Bot
6d103ddceb
[ci] release (#4056)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-28 08:17:45 -04:00
tony-sull
57770bbae2 [ci] format 2022-07-27 15:41:22 +00:00
Tony Sullivan
a397b981f5
Fixes type definitions @astrojs/image and adds more documentation to the README (#4045)
* WIP: moving to a static .d.ts types file

* fixing named exports for getImage and getPicture

* removing the exports.astro map for now

* WIP: adding readme docs for component attributes

* Adding docs for getImage and getPicture

* leaning fully on TSC to build .d.ts files

* finally found the solution for proper ESM import types

* adding a note to the README for tsconfig updates

* chore: add changesets

* typo

* docs: removing the "Images in Markdown" example

* removing the need for publishing src to NPM

* fix: make type re-export explicit

* updating image module defs to match InputFormat

* using astro syntax highlighting for README code blocks

* nit: missing backtick in README

* make sure Astro component directives aren't recommended twice
2022-07-27 15:39:05 +00:00
Fred K. Bot
d790eabd98
[ci] release (#3972)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-26 09:58:38 -04:00
tony-sull
2a13e430b1 [ci] format 2022-07-25 21:16:11 +00:00
Tony Sullivan
e60d6d9c1d
Removes fileURLToPath dependency from @astrojs/image SSR production endpoint (#4048)
* removing fileURLToPath dependency from SSR production endpoint

* chore: add changeset
2022-07-25 21:14:03 +00:00
Matthew Phillips
6fd161d769
Add the output option (#4015)
* Start of work on astroConfig.mode === 'server'

* Add tests and more

* adapter -> deploy in some places

* Add fallback for `adapter` config

* Update more tests

* Update image tests

* Fix clientAddress test

* Updates based on PR review

* Add a changeset

* Update integrations tests + readme

* Oops

* Remove old option

* Rename `mode` to `output`

* Update Node adapter test

* Update test

* fred pass

* fred pass

* fred pass

* fix test

Co-authored-by: Fred K. Schott <fkschott@gmail.com>
2022-07-25 00:18:02 -04:00
tony-sull
cb1db133ba [ci] format 2022-07-22 23:04:01 +00:00
Tony Sullivan
ef9345767b
WIP: [image] Fixing SSR support and improving error validation (#4013)
* fix: SSR builds were hitting an undefined error and skipping the step for copying original assets

* chore: update lockfile

* chore: adding better error validation to getImage and getPicture

* refactor: cleaning up index.ts

* refactor: moving SSG build generation logic out of the integration

* splitting build to ssg & ssr helpers, re-enabling SSR image build tests

* sharp should automatically rotate based on EXIF

* cleaning up how static images are tracked for SSG builds

* undo unrelated mod.d.ts change

* chore: add changeset
2022-07-22 23:01:56 +00:00
Chris Swithinbank
9aecf7c7c7
Handle EXIF orientation flag (#4021)
* Handle EXIF orientation flag

* Create gentle-mails-mate.md
2022-07-22 19:14:00 +00:00
Sarah Rainsberger
ef9c4152b2
[READMEs] removed "experimental" from astro add instructions (#4004) 2022-07-21 14:33:59 -03:00
Tony Sullivan
eaf187f2c4
Fixing TypeScript type definitions for image components (#3980)
* moving back to importing from components directory

* exporting components with a .ts file instead of .js

* chore: changeset
2022-07-20 00:33:11 +00:00
Tony Sullivan
d73c04a9e5
<Picture> component should pass all unknown attributes to the <img> element (#3961)
* <Picture /> should pass all unrecognized props down to the <img> element

* chore: add changeset

* Adding test coverage for custom <img> attributes

* chore: adding a README note for passing attributes to the picture's img

* Revert "<Picture /> should pass all unrecognized props down to the <img> element"

This reverts commit ce3e33930f.

* Picture should pass alt text to the img
2022-07-19 19:21:58 +00:00
Matthew Phillips
04070c0c12
Migrate to Vite 3 ️ (#3570)
* Vite 3 test

* deps: bump to Vite beta.1

* refactor: move to use optimizeDeps.force option

* refactor: stub out new updateModuleInfo params

* nit: remove comment on deprecated Vite feature

* nit: remove comment on deprecated vite feature

* hail mary: destroy all ssr external / noexternal!

* fix: use new middlewareMode config settings

* fix: resolve npm package paths for rollup input

* wip: revert to unresolved. Issue reported!

* sad refactor: use legacy devDepsScanner for component HMR

* fix: add astro/components to noExternal for Code component

* refactor: use ALWAYS_NOEXTERNAL array

* refactor: add package.json to all test runners for noExternal error

* deps: bump to latest vite 3 beta

* wip: add package.json to smoke

* fix: remove accidental "force true" on create-vite

* refactor: write smoke package.json programmatically

* refactor: add fontsource to noExternal

* fix: only add to ssr.noExternal if present in project

* wip: what if we just... didn't have a memory test

* deps: bump to latest vite beta

* Revert "wip: what if we just... didn't have a memory test"

This reverts commit 173729dbdc685e52881fc3333487b8f744add55f.

* fix: add type check for plugin.name

* feat: remove legacy.devDepsScanner. Vite 3 strat is now Vite 2.x strat!

* fix: add ssr.noExternal to components ex

* wip: ignore with-mdx starter

* fix: add serviceEntryPoint to ssr.noExternal

* temp: reset NODE_ENV on prod builds

* fix: missing async tag

* VITE 3 IS STABLE BABY

* deps: bump svelte to vite 3

* deps: bump vue to vite 3

* fix: resolve plugins for proper sorting

* sad fix: regex "export default" out of CSS ssr

* chore: add TODO to understand sad fix

* Revert "fix: resolve plugins for proper sorting"

This reverts commit e67c194d3a8e11070487ed325947e7c59e8d69cd.

* Revert "sad fix: regex "export default" out of CSS ssr"

This reverts commit 721d40b62b61440dc9e488787901c915579659db.

* fix: sort plugins WITHOUT resolveConfig

* Revert "wip: ignore with-mdx starter"

This reverts commit 7d4f7338e6.

* chore: revert memory test changes

* chore: add nanostores/preact ot noexternal

* chore: changeset

* chore: changeset

* deps: use Vite ^3.0.0

* fix: add back third party astro pkg scanner

Co-authored-by: bholmesdev <hey@bholmes.dev>
2022-07-18 22:19:23 -07:00
Fred K. Bot
37534004f0
[ci] release (#3939)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-18 21:54:25 -07:00
FredKSchott
167ed5486a [ci] format 2022-07-19 04:50:06 +00:00
Tony Sullivan
299b4afcab
Feat/image url hash (#3965)
* Including a hash of the full remote URL when building for SSG

* chore: add changeset
2022-07-18 21:48:22 -07:00
Juan Martín Seery
60e38f6eb4
ci: fix eslint issues (#3969) 2022-07-18 19:59:53 -03:00
tony-sull
f6d61e6e72 [ci] format 2022-07-18 19:45:31 +00:00
Tony Sullivan
2a7dd040e8
Improving support for third-party hosted image services (#3957)
* WIP: always use the built-in sharp service for local images in `dev`

* adding type definitions for the integration's use of globalThis

* simplifying the globalThis type checking

* chore: adding changeset

* removing temp hosted service used for testing
2022-07-18 19:43:40 +00:00
Fred K. Bot
c2b14d5253
[ci] release (#3894)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-12 09:08:15 -04:00
Chris Swithinbank
bf5d1cc1e7
More integration README fixes (#3885)
* Integration README fixes

* More tweaks (mostly code backticks for filenames)

* Update changeset

* Few more tweaks

* Make sure code blocks all have a code language

* Use URLs of new docs pages for package homepage

* One more stray `<br>` 👢

* Standardise to `sh` instead of `shell`
2022-07-11 21:10:34 +02:00
Fred K. Bot
16fdc01322
[ci] release (#3877)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-09 19:03:22 +00:00
Tony Sullivan
f961412862
Updating the <Picture /> component to default to async image decoding (#3876)
* defaulting pictures to use decoding=async

* chore: add changeset
2022-07-09 18:44:31 +00:00
Fred K. Bot
1785e568a0
[ci] release (#3850)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-08 20:54:39 -04:00
tony-sull
d2f68345f9 [ci] format 2022-07-08 21:40:22 +00:00
Tony Sullivan
89d76753a0
Adds a new <Picture> component to the image integration (#3866)
* moving all normalization logic out of the Image component

* refactor: only require loaders to provide the image src

* Adding a `<Picture />` component

* fixing types.ts imports

* refactor: moving getImage to it's own file

* updating component types to use astroHTML.JSX

* Revert "updating component types to use astroHTML.JSX"

This reverts commit 6e5f578da8.

* going back to letting loaders add extra HTML attributes

* Always use lazy loading and async decoding

* Cleaning up the Picture component

* Adding test coverage for <Picture>

* updating the README

* using JSX types for the Image and Picture elements

* chore: adding changeset

* Update packages/integrations/image/src/get-image.ts

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>

* allow users to override loading and async on the <img>

* renaming config to constants, exporting getPicture()

* found the right syntax to import astro-jsx

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-07-08 21:37:55 +00:00
Ben Holmes
b012ee55b1
[astro add] Support adapters and third party packages (#3854)
* feat: support adapters and third part integrations by keywords

* refactor: add keywords to all official integrations

* docs: add adapter ex to astro add help

* nit: clarify astro add usage

* nit: highlight link

* fix: use process.exit(1) on error

* chore: changeset

* nit: bold integration name

* fix: log install instructions for adapters instead

* nit: change to logAdapterConfigInstructions

* Revert "fix: log install instructions for adapters instead"

This reverts commit 1a459f152b.

* feat: add hardcoded adapter export map

* refactor: inline adapter config log
2022-07-08 16:55:33 -04:00
tony-sull
9300af9bc2 [ci] format 2022-07-08 20:20:57 +00:00
Tony Sullivan
0aaef1c48b
fix: Always add @astrojs/image to vite.ssr.noExternal (#3869)
* fix: always add @astrojs/image to vite.ssr.noExternal

* chore: add changeset
2022-07-08 20:19:27 +00:00
Chris Swithinbank
1f9e4857ff
Integration README fixes (#3865)
* Remove stray XML tag in sitemap integration README

* Fix link errors

* Add changeset
2022-07-08 21:56:24 +02:00
Joaquín Sánchez
c6ba6ec4d9
fix: lint failing on astro and some integrations (#3794)
* fix: lint failing on astro and some integrations

* chore: fix telemetry lint

* chore: fix turbo cache (thx nate)

* chore: fix runtime server
2022-07-07 16:06:44 -05:00
matthewp
9f54fa3cd9 [ci] format 2022-07-07 17:51:24 +00:00
Matthew Phillips
502f063131
Allow importing Image component from @astrojs/image (#3848)
* Allow importing Image component from @astrojs/image

* Adds a changeset

* Export the Image type
2022-07-07 13:49:46 -04:00
Fred K. Bot
822befc59b
[ci] release (#3813)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-04 15:22:09 +00:00
Tony Sullivan
5ccccace0c
Updates how the new Image component is exported to support older versions of Astro (#3812)
* don't use typescript for the components named export file

* Adding a readme example for images in markdown

* chore: add changeset
2022-07-04 14:52:32 +00:00
Tony Sullivan
b9d26f39e2
manually correcting import ordering to unblock CI (#3798) 2022-07-01 20:24:45 +00:00
Fred K. Bot
5953a6ca0d
[ci] release (#3797)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-01 20:13:33 +00:00
tony-sull
88dad63322 [ci] format 2022-07-01 20:06:01 +00:00
Tony Sullivan
d143d24c72
Updates the images integration to automatically mark optimizeDeps for sharp (#3795)
* including src in npm publish

* bugfix: always round dimensions before passing to sharp.resize

* automatically add optimizeDeps vite config

* chore: changeset
2022-07-01 19:56:43 +00:00
Fred K. Bot
94143fcdba
[ci] release (#3789)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-01 17:43:26 +00:00
Tony Sullivan
e8593e7ead
Adds an @astrojs/image integration for optimizing images (#3694)
* initial commit

* WIP: starting to define interfaces for images and transformers

* WIP: basic sharp service to test out the API setup

* adding a few tests for sharp.toImageSrc

* Adding tests for sharp.parseImageSrc

* hooking up basic SSR support

* updating image services to return width/height

* simplifying config setup for v1

* hooking up basic SSR + SSG support (dev & build)

* refactor: a bit of code cleanup and commenting

* WIP: migrating local files to ESM + vite plugin

* WIP: starting to hook up user-provided loaderEntryPoints

* chore: update lock file

* chore: update merged lockfile

* refactor: code cleanup and type docs

* pulling over the README template for first-party integrations

* moving metadata out to the loader

* updating the test for the refactored import

* revert: remove unrelated webapi formatting

* revert: remove unrelated change

* fixing up the existing sharp tests

* fix: vite plugin wasn't dynamically loading the image service properly

* refactor: minor API renaming, removing last hard-coded use of sharp loader

* don't manipulate src for hosted image services

* Adding support for automatically calculating dimensions by aspect ratio, if needed

* a few bug fixes + renaming the aspect ratio search param to "ar"

* Adding ETag support, removing need for loaders to parse file metadata

* using the battle tested `etag` package

* Adding support for dynamically calculating partial sizes

* refactor: moving to the packages/integrations dir, Astro Labs TBD later

* refactor: renaming parse/serialize functions

* Adding tests for SSG image optimizations

* refactor: clean up outdated names related to ImageProps

* nit: reusing cached SSG filename

* chore: update pnpm lock file

* handling file URLs when resolving local image imports

* updating image file resolution to use file URLs

* increasing test timeout for image build tests

* fixing eslint error in sharp test

* adding slash for windows compat in src URLs

* chore: update lockfile after merge

* Adding README content

* adding a readme call to action for configuration options

* review: A few of the quick updates from the PR review

* hack: adds a one-off check to allow query params for the _image route

* Adds support for src={import("...")}, and named component exports

* adding SSR tests

* nit: adding a bit more comments

* limiting the query params in SSG dev to the images integration
2022-07-01 15:47:48 +00:00