Currently, @astrojs/image allows *importing* images from srcDir
only. Importing images from outside srcDir fails miserably *in dev
mode* and produces incorrect src.
This happens because `path.relative(fileURLToPath(config.srcDir), id)`
resolves to "../something" and when joined with '/@astroimage' cancels
it out (`join('/@astroimage', '../../something')` => `'/something'`).
Rework /@astroimage URL scheme to be similar to "/@fs/" scheme—always
export absolute path to the target file.
* fix: add error handling for invalid arguments
* chore: add changeset
* Update packages/astro/src/core/errors/errors-data.ts
Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
---------
Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
* chore: script, rename delayed -> propagated
* fix: consistent propagatedAssets flag
* feat: inject those scripts in dev!
* test: scripts included in dev and build
* chore: add TODO for prod build fix
* chore: changeset
* Allow passing `undefined` to transform options
This fixes#6001, allowing undefined passed as a variable in addition to not passing the property at all
* Create strange-olives-rest.md
* Improve error message for missing `widths` prop
* Add changeset
* Add a check for existing .git directory (and skip if one is found).
* Changeset attempt :-)
* Update .changeset/try-button-rumor.md
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
* Update vite-plugin-content-assets.ts
* Add changeset for #5927
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Co-authored-by: Anders Kaseorg <andersk@mit.edu>
* Updated according to new configuration
Astro imports the `defineConfig` function from `astro/config`. The `integrations` key needs to be passed into the `defineConfig` function, but it is not shown in the README. Updated the README according to the CLI example.
* update alpine
* update image
* update lit
* update mdx
* update preact
* update prefetch
* update react
* update sitemap
* update solid
* update svelte
* update tailwind
* update turbolinks
* update vue
* chore: add changeset
* update image
* update svelte readme
Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
* Astro <Code> component is not able to use a custom theme anymore
* Astro <Code> component is not able to use a custom theme anymore
* Astro <Code> component is not able to use a custom theme anymore
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
* fix
* add test
* use `fileURLToPath` instead
* chore: changeset
* remove useless config file
* revert back to using `decodeURIComponent`
* test: better test
* re-revert back to using `fileURLToPath`
* [ci] release
* Update changelogs (#5955)
* [ci] release
* Wrap astro 2.0 beta logs in `<details>`
* Add link to docs upgrade guide
* First pass cleaning up 2.0 release notes
* mdx changes from Sarah
* combine 5584 and 5842 in deno, image, netlify
* markdown/remark incl (5684 & 5769) to match mdx
* Tweak markdown/remark formatting
* Format astro-prism
* Format astro-rss
* Format create-astro
* Format cloudflare
* Format lit
* Format partytown
* Format node
* Format preact
* Format react
* Format solid
* Format svelte
* Format tailwind
* Format vercel
* Format vue
* Format telemetry
* Format webapi
* Format scripts
* Reinstate h3s for headings
Co-authored-by: Ben Holmes <hey@bholmes.dev>
* Reformat mdx
* astro & markdown/remark: Combine #5679 & #5684 changelogs
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Ben Holmes <hey@bholmes.dev>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Ben Holmes <hey@bholmes.dev>
* feat: respect `slug` frontmatter prop
* chore: replace `slug` check with proper types
* fix: regen types on `slug` change
* chore: add TODO on slug gen
* tests: update to use `slug` frontmatter prop
* chore: add error message on `slug` inside object schema
* lint
* chore: add note on frontmatter parse
* refactor: move content errors to new heading
* chore: ContentSchemaContainsSlugError
* chore: changeset
* docs: be 10% less gentle
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* fix: avoid parsing slug on unlink
* docs: clarify old API is for beta users
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* First stylistic pass
* Rework for x/o instead of and
* fix typo
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Add changeset
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Rename getEntry to getEntryBySchema
* Improve entrySlug types and return undefined
* Add changeset
* Update packages/astro/src/content/template/types.d.ts
Co-authored-by: Ben Holmes <hey@bholmes.dev>
* Update the types to accept both raw string and known value
* Add comment on the implementation not currently being O(1)
Co-authored-by: Ben Holmes <hey@bholmes.dev>
* fix(image): Remove unnecessary polyfill now that we dropped Node 14
* fix(squoosh): Remove fetch of local wasm binary since undici doesn't support that
* chore: changeset
* Simplify HMR handling
* Try skip test to reveal other test result
* Support virtual files
* Fix head injection
* Revert CI changes
* Bring back normalizeFilename
* Refactor
* Add changeset
* refactor: remove experimental.cc from core
* chore: remove experimental flag from tests
* fix: mock contentDir in remark tests
* fix: check vfile.path in rel-image-error plugin
* fix: move .astro/ excludes to all test/fixtures
* fix: include test/**/fixtures in ignore
* chore: changeset
* fix: always generate types on init
* fix: skip type generation when no content dir found
* fix: avoid stripping `.ts` for existsSync check
* chore: changeset
* fix: run type gen when content/ dir added in dev
* feat(webapi): Remove unnecessary polyfills now that we dropped support for Node 14
* feat(webapi): Removed more unnecessary polyfills for Node 16
* chore: changeset
* chore: Update engines field
* fix(deps): Remove node-fetch
* feat(polyfills): Remove node-fetch for undici
* feat(webapi): Remove node-fetch from the webapis polyfills for undici
* feat(core): Remove node-fetch for undici in Astro core
* feat(telemetry): Remove node-fetch for undici
* feat(node): Remove node-fetch for undici in node integration
* feat(vercel): Remove node-fetch for undici in Vercel integration
* chore: update lockfile
* chore: update lockfile
* chore: changeset
* fix(set): Fix set directives not streaming correctly on Node 16
* Try another approach
* Debugging
* Debug fetch
* Use global fetch if there is one
* changeset for lit
* Remove web-streams-polyfill
* Remove web-streams-polyfill license note
* Update .changeset/stupid-wolves-explain.md
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
* Initial refactor
* Extract as vite plugin
* Cleanup vite plugin
* Reduce option passing
* Use localhost as preview default host
* Simplify base handling
* Fix host handling
* Add changeset
* Remove unused imports
* Remove unused sirv dep
* Try pin playwright to 1.28.1
* Update playwright
* Try this
* Speed up CI
* Try fix page off
* Refactor networkidle
* Ensure open connections are destroyed when the preview server is closed
* Revert debug code
Co-authored-by: Matthew Phillips <matthew@matthewphillips.info>
* [markdown-remark] Remove unused dependency
Follow up to #5785. Missed one dependency that is no longer used and can be removed.
* [markdown-remark] Remove unused dependency
* Lockfile fix
* Update lockfile [again]
* Add Astro as a peerDependency
* Add changeset
* Update .changeset/thin-seahorses-worry.md
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
* ci(node): Move CI to Node 16 and add Node 18 to the matrix
* fix(netlify): Fix set-cookie not working on Node 18
* fix(netlify): Handle if `set-cookie` is already somehow an array (apparently it can?)
* test(node): Fix `toPromise` to match Astro's
* fix(tests): Use the actual underlying ArrayBuffer instance to create the buffer in toPromise
* chore: changeset
* feat: add smartypants flag
* test: smartypants in markdown and mdx
* docs: Smartypants -> SmartyPants
* chore: changeset
* chore: update changeset with 1.0 -> 2.0 in mind
* chore: bump to minor change