* feat: allow type `unknown` on `isInputError`
* chore: move ErrorInferenceObject to internal utils
* chore: changeset
* deps: expect-type
* feat: first types test
* chore: add types test to general test command
* refactor: use describe and it for organization
* fix(rewrite): purge old data when rewriting
* remove logs
* Update .changeset/fuzzy-eggs-kneel.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* feat(container): provide a virtual module to load renderers
* address feedback
* chore: restore some default to allow to have PHP prototype working
* Thread through renderers and manifest
* Pass manifest too
* update changeset
* add diff
* Apply suggestions from code review
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* fix diff
* rebase and update lock
---------
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* feat: container APIs
* chore: handle runtime mode
* chore: render slots
* more prototyping
* Adding a changeset
* fix some weirdness around types
* feat: allow to inject the manifest
* feat: accept a manifest
* more APIs
* add `route` to the options
* chore
* fix component instance
* chore: document stuff
* remove commented code
* chore: add test for renderers and fixed its types
* fix: update name of the example
* fix regression inside tests
* use `experimental_`
* remove errors
* need to understand the types here
* remove some options that I don't deem necessary for this phase
* remove superfluous comments
* chore: remove useless `@ts-ignore` directive
* chore: address feedback
* fix regression and remove astro config
* chore: fix regression
* Apply suggestions from code review
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* ooops
* restore changes
---------
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* feat: add an internal for now studio package
* fix: remove test commands
* fix: use getenvs from studio package
* fix: packagejson
* chore: changeset
* fix: remove unused error
* fix: of course Bjorn was right all along
* fix(mdx): convert remark-images-to-component plugin to a rehype plugin (#10697)
* Remove fs read for MDX transform (#10866)
* Tag MDX component for faster checks when rendering (#10864)
* Use unified plugin only for MDX transform (#10869)
* Only traverse children and handle mdxJsxTextElement when optimizing (#10885)
* Rename to `optimize.ignoreComponentNames` in MDX (#10884)
* Allow remark/rehype plugins added after mdx to work (#10877)
* Improve MDX optimize with sibling nodes (#10887)
* Improve types in rehype-optimize-static.ts
* Rename `ignoreComponentNames` to `ignoreElementNames`
I think this better reflects what it's actually doing
* Simplify plain MDX nodes in optimize option (#10934)
* Format code
* Minimize diff changes
* Update .changeset/slimy-cobras-end.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Armand Philippot <59021693+ArmandPhilippot@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Improve content collection styles and scripts build perf
* Update test
It was actually a bug. There was an empty module script injected.
* Skip test
* Fix test not matching non-ccc behaviour
* Workaround bug to make test pass
* Update .changeset/grumpy-pillows-develop.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Wait until after build to preserve content modules
* Properly build hoisted scripts
* Add changeset
* Fix tests hitting each other
* Global state, the shame
* Move the file copying over to earlier in the process
* feat(toolbar): Add a `astro:toolbar` module
* fix: use entrypoint
* feat: add new shape for defining toolbar apps
* fix: types
* feat(toolbar): Add helpers features (#10667)
* feat(toolbar): Add helpers features
* fix: consistent payloads and naming
* chore: changeset
* nit: rename eventTarget to app
* feat: add server-side helpers
* test: update test to use new APIs
* fix: types
* nit: erikaaaaa
* feat: add new event
* Update .changeset/khaki-pianos-burn.md
* test: use data to create text
* Apply suggestions from code review
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
* nit: use diff
* nit: documentation effort
* test: fix
---------
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
* nit: small changes to helpers
* nit: update changeset
* fix: move to astro/toolbar for building purposes
* feat(toolbar): Add a toolbar example (#10793)
* feat: add a toolbar starter
* test: skip examples that are not Astro projects
* nit: small changes
* feat: setup for build step
* fix: add to devdep
* docs: add commands to README
* fix: reorder classes to make more sense
* fix: add improvements from recipe
* Apply suggestions from code review
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update sharp to 0.33 to fix issue with Alpine Linux
It was impossible for me to use the Astro image service in an Alpine Linux docker container. Even though I would install sharp `0.33.3` in my app, pnpm would download version `0.32.6`, which doesn't work in Alpine Linux container.
Currently, I have to override the downloaded version in my package.json. For more details see:
- https://github.com/lovell/sharp/issues/4054
- https://discord.com/channels/830184174198718474/1224861729792458803/1224861729792458803
This PR updates the version of the `sharp` dependency to `^0.33` and thus makes Astro compatible with Alpine Linux.
* update lock file
* add changelog
* Update packages/astro/package.json
* Update pnpm-lock.yaml
* ci: update check-merge.yml action (#10690)
* test(@astrojs/node) listen for server setup errors in test-utils (#10692)
* Add disableremoteplayback attribute to VideoHTMLAttributes interface (#10693)
* Add disableremoteplayback attribute to VideoHTMLAttributes interface
* Move disableremoteplayback from VideoHTMLAttributes to MediaHTMLAttributes
* Create olive-camels-greet.md
* Update packages/astro/astro-jsx.d.ts
---------
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
* test(@astrojs/node) wait for server listening in trailing-slash tests (#10694)
* test(@astrojs/node) wait for server listening in trailing-slash tests
* fix missing waitServerListen
* fix import statement
---------
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
* chore: add `test:citgm` command that would run tests without caching and `build:ci:no-cache` to skip caching for build as well (#10696)
* chore: add test:citgm command that would run tests without caching
* adding build ci with no cache
* chore: fix build:ci:no-cache test:citgm (#10698)
* Improve dev toolbar notification contrast on hover (#10657)
* fix(#10399, PLT-1786): improve notification contrast on hover
* chore: add changeset
* fix test:citgm --force flag not passed correctly (#10706)
* Skip prerender chunk in static output (#10695)
* Remove unused config in Vue JSX integration (#10687)
* Refactor MDX transformJSX handling (#10688)
* Fix vue-jsx change (#10716)
* Fix script inline with directRenderScript (#10686)
* Provide better messaging when renaming a table (#10600)
* Provide better messaging when renaming a table
* Update based on review
* [ci] format
* [ci] update lockfile (#10718)
Co-authored-by: matthewp <matthewp@users.noreply.github.com>
* Increase log severity when a page's `getStaticPaths` fails (#10707)
* [ci] release (#10680)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* fix: use just pnpm to run the build and tests in citgm (#10727)
* fix(devtool): do not trigger interaction check for `div` and `span` (#10719)
* fix(devtool): do not trigger interaction check for `div` and `span`
* add test
* add tests
* Rephrase changeset
* remove log
* add reference link
* Update .changeset/swift-coats-teach.md
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
---------
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
* fix: regression for astro attributes escaping (#10728)
* Fix db seeding when srcDir is root (#10720)
* ci: add ref when checking out the repository (#10733)
* fix(dev): break implicit rerouting loop (#10737)
* fix(dev): infinite implicit rerouting
* test adapter
* changeset
* [ci] format
* [ci] release (#10729)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* fix: Fixed errorOverlay theme toggle bug. (#10661)
* fix: save `localStorage.astroErrorOverlayTheme` when detected dark mode
* add changeset
* Fix theme toggle in ErrorOverlay
* update changeset
* [ci] format
* feat: add origin check for CSRF protection (#10678)
* feat: add origin check for CSRF protection
* add tests
* chore: documentation
* changeset and grammar
* chore: add casing check
* split function
* better naming
* make the whole object experimental
* remove unused type
* update changeset
* manually apply Sarah's suggestions
* Apply suggestions from code review
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* feat: upgrade the minimum Node.js maintainance LTS version (#10689)
* feat: upgrade the minimum Node.js maintainance LTS version
* chore: update minimum npm version
* chore: revert npm change
* chore: address Erika's feedback
* chore: apply further suggestions
* Update .changeset/empty-rules-type.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* [ci] format
* Accept common cookie attributes when deleting a cookie (#10671)
* Accept common cookie attributes when deleting a cookie
* Fix AstroCookieSetOptions IDE annotations
* Use AstroCookieSetOptions to construct AstroCookieDeleteOptions
* Update .changeset/shaggy-cats-film.md
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
---------
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
* feat(i18n): manual routing (#10193)
* feat(i18n): manual routing
* one more function
* different typing
* tests
* fix merge
* throw error for missing middleware
* rename function
* fix conflicts
* lock file update
* fix options, error thrown and added tests
* rebase
* add tests
* docs
* lock file black magic
* increase timeout?
* fix regression
* merge conflict
* add changeset
* chore: apply suggestions
* apply suggestion
* Update .changeset/little-hornets-give.md
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
* chore: address feedback
* fix regression of last commit
* update name
* add comments
* fix regression
* remove unused code
* Apply suggestions from code review
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* chore: update reference
* Update packages/astro/src/@types/astro.ts
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* chore: improve types
* fix regression in tests
* apply Sarah's suggestion
---------
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* [ci] format
* feat(toolbar): allow the user to change the placement (#10591)
* feat(toolbar): add `placement` to settings
* feat(toolbar): update `settings.placement` with `<select>`
* feat(toolbar): adjust position based on `settings.placement`
* test(toolbar): add a test case for `settings.placement`
* refactor(toolbar): extract select element from settings app
* feat(toolbar): allow select element to have colors
* test(toolbar): fix failed test case
* refactor(toolbar): add `placement` property to window element
* refactor(toolbar): notify apps when placement changes
* test(toolbar): fix failed test case
* refactor(toolbar): extract `synchronizePlacementOnUpdate` function
* chore: add changeset
* chore: update changeset
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Adds dataLanguage property to the replacement <pre> element. (#10538)
* Update highlight.ts
* Create cold-snakes-train.md
* Update Code.astro
Solution for use-case described in withastro/roadmap#276 (https://github.com/withastro/roadmap/discussions/276)
* roll-back initial fix
* new fix
* update changeset
* Update packages/markdown/remark/src/rehype-prism.ts
* Update .changeset/cold-snakes-train.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update .changeset/cold-snakes-train.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update .changeset/cold-snakes-train.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update .changeset/cold-snakes-train.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Matthew Phillips <matthew@matthewphillips.info>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* [ci] format
* fix some i18n config docs (#10746)
* fix some i18n config docs
* Move manual option to last position
---------
Co-authored-by: = <otterlord.dev@gmail.com>
* [ci] format
* fix(rendering): remove render instructions from slot expressions (#10747)
* [ci] format
* Update a11y-no-noninteractive-tabindex rule for dev tool bar (#10750)
* fix: a11y-no-noninteractive-tabindex
* add changeset
* Update utils.ts: Optimize and simplify code (#10749)
Update utils.ts: Optimize and simplify code
* fix(cli): call path.replace only if it is a function (#10745)
* fix(cli): call `path.replace` only if it is a function
* add changeset
* fix: rewrite Node.js changeset (#10753)
* fix: rewrite Node.js changeset
* Update .changeset/empty-rules-type.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* [ci] release (#10739)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* fix(i18n): fallback SSR (#10755)
* fix(i18n): fallback SSR
* Update .changeset/old-pugs-jog.md
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
---------
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
* [docs] config reference link fix (#10758)
* Limit imports in flight for `getCollection` (#10708)
* [ci] format
* Add useful links to `@astrojs/db` package.json (#10764)
Co-authored-by: Reuben Tier <64310361+TheOtterlord@users.noreply.github.com>
* Performance improvement in createAstro function (#10765)
* Fix typo in error message for IncorrectStrategyForI18n (#10768)
* fix(vercel): Fix srcset generation not working on Vercel (#10756)
* fix(vercel): Fix `srcset` generation not working on Vercel
* chore: changeset
* fix: remove densities and widths from the HTML attributes
* nit: better changeset
* nit: add formats
* [ci] format
* [ci] release (#10757)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* fix(add): Fixes astro add modifying baseUrl by accident (#10774)
* fix(add): Fixes `astro add` modifying `baseUrl` by accident
* chore: changeset
* test: add test
* fix: tsconfig not being a json maybe is a mistake, I don't know!
* test: fix
* Update packages/astro/test/fixtures/tsconfig-handling/baseUrl/tsconfig.json
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
---------
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
* [ci] format
* Remove MDX processor on buildEnd (#10770)
* lint: upgrade eslint to version 9 (#10730)
* [ci] format
* fix: picture fallback check (#10783)
* Fix @types/cookie dependency (#10776)
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
* Make viewTransition.finished wait for animations triggered by viewTransition.ready (#10787)
* [ci] format
* fix(assets): Forward headers from the original request to the internal request to the image (#10775)
* [ci] format
* astro/cli/install-package.ts: whichPm may return null if ran in an empty directory (#10782)
* [ci] update lockfile (#10791)
Co-authored-by: matthewp <matthewp@users.noreply.github.com>
* Improve sitemap generate performance (#10795)
* Disable streaming for SSG (#10796)
* fix: use assetsDir in creating vite config (#10732)
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
* fix: MDX cannot find relative image path without leading ./ (#10754)
Co-authored-by: Oliver Speir <115520730+OliverSpeir@users.noreply.github.com>
* [ci] release (#10777)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* db: export 'alias' from drizzle-orm/sqlite-core (#10789)
* db: export 'alias' from drizzle-orm/sqlite-core
* chore: changeset
* fix: changeset target
---------
Co-authored-by: Ben Holmes <hey@bholmes.dev>
* chore: use Biome to format JS files (#10788)
* chore: configuration
* chore: update main commands
* chore: revert formatting package.json
* chore: rebase
* [ci] format
* Fixes an issue with persisted non-text input fields that have the focus during view transition navigation. (#10799)
* Fixes an issue with persisted non-text input fields that have the focus during view transition navigation.
* better check
* [ci] format
* test: fix regression upon import sorting (#10802)
* fix(sitemap): Trailing slashes on root url (#10772)
* add tests that reveal issue
* fix trailing slash root page issue
* add changeset
* [ci] format
* optimization(runtime): create smaller objects for each Astro global (#10773)
* optimization(runtime): create smaller objects for each Astro global
* add changeset
* Make slots lazy
---------
Co-authored-by: bluwy <bjornlu.dev@gmail.com>
* add/cli: update list of integrations (#10811)
* Invalidate CC cache manifest when lockfile or config changes (#10763)
* Invalidate CC cache manifest when lockfile or config changes
* Close the handle and increment manifest version
* debug info
* Provide a reason for cache busting
* Handle compile metadata missing
* Try it this way
* Copy over cached assets as well
* Only restore chunks when cache is valid
* Better handle invalid caches
* Explain when there is no content manifest
* Add tests
* debugging
* Remove debugging
* Update packages/astro/src/core/build/plugins/plugin-content.ts
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
* Update packages/astro/src/core/build/plugins/plugin-content.ts
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
* Review comments
* Add chunks path constant
---------
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
* [ci] format
* [ci] release (#10798)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* fixed the path to checkout existing blog posts on the home page of the blog starter template (#10814)
Currently the 4th point on home page says: "Check out the included blog posts in src/pages/blog/". It the path here should be "src/content/blog/".
* Update packages/astro/package.json
* Update pnpm-lock.yaml
* update sharp version in examples/starlog and update pnpm-lock.yaml
---------
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Raz Luvaton <16746759+rluvaton@users.noreply.github.com>
Co-authored-by: apetta <akshaypetta@gmail.com>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: Matthew Phillips <matthewp@users.noreply.github.com>
Co-authored-by: Houston (Bot) <108291165+astrobot-houston@users.noreply.github.com>
Co-authored-by: horo <143025439+horo-fox@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
Co-authored-by: Arsh <69170106+lilnasy@users.noreply.github.com>
Co-authored-by: Arsh <lilnasy@users.noreply.github.com>
Co-authored-by: liruifengv <liruifeng1024@gmail.com>
Co-authored-by: liruifengv <ematipico@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Farzad <frzd.shafiee@gmail.com>
Co-authored-by: Ming-jun Lu <40516784+mingjunlu@users.noreply.github.com>
Co-authored-by: 604qgc <130194823+604qgc@users.noreply.github.com>
Co-authored-by: Matthew Phillips <matthew@matthewphillips.info>
Co-authored-by: = <otterlord.dev@gmail.com>
Co-authored-by: Sarah Rainsberger <TheOtterlord@users.noreply.github.com>
Co-authored-by: Oliver Speir <115520730+OliverSpeir@users.noreply.github.com>
Co-authored-by: aswind7 <854413241@qq.com>
Co-authored-by: horo <bluwy@users.noreply.github.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Reuben Tier <64310361+TheOtterlord@users.noreply.github.com>
Co-authored-by: Leander Gilles <leander.gilles@pm.me>
Co-authored-by: Erika <Princesseuh@users.noreply.github.com>
Co-authored-by: Jason <m.jason.liu@outlook.com>
Co-authored-by: Juraj Kapsz <github@jurajkapsz.sk>
Co-authored-by: Martin Trapp <94928215+martrapp@users.noreply.github.com>
Co-authored-by: Meghan Denny <hello@nektro.net>
Co-authored-by: Rishi Raj Jain <rishi18304@iiitd.ac.in>
Co-authored-by: Nick Dubelman <ndubelman@gmail.com>
Co-authored-by: Ben Holmes <hey@bholmes.dev>
Co-authored-by: Robin Gisler <63500142+gislerro@users.noreply.github.com>
Co-authored-by: Avinash Reddy <avinashreddy3108+github@gmail.com>
Co-authored-by: Damanjeet Singh <49544630+DamanjeetSingh1@users.noreply.github.com>
* Invalidate CC cache manifest when lockfile or config changes
* Close the handle and increment manifest version
* debug info
* Provide a reason for cache busting
* Handle compile metadata missing
* Try it this way
* Copy over cached assets as well
* Only restore chunks when cache is valid
* Better handle invalid caches
* Explain when there is no content manifest
* Add tests
* debugging
* Remove debugging
* Update packages/astro/src/core/build/plugins/plugin-content.ts
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
* Update packages/astro/src/core/build/plugins/plugin-content.ts
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
* Review comments
* Add chunks path constant
---------
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
* fix(assets): Fixes assets generation when using custom paths and configs
* fix: tests
* fix: make sure remote files don't end up in nested folders by accident
* test: add a whole bunch of tests
* chore: changeset
* Add fixture and tests for integration with no user db config
* Create database tables when integration seed files load
* Defer running seed function until all modules are loaded
* Update package name
* Add test & fixture for a project with no seed file
* `recreateTables()` from `seedLocal()` (and move it out of main runtime module)
* Fix typo after rebase
* FREEZE DON’T MOVE
* Move `seedLocal` export back to runtime
* Simplify seed file normalization
* Clean up test files
* Add build tests for no-seed and integration-only fixtures
* Add changeset
* Fix use of db.batch in Stackblitz
* Update .changeset/rare-items-protect.md
---------
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
* feat(audits): Add selected style for audits
* feat(audits): Fully add new style
* feat: new iteration
* chore: changeset
* feat: separate audits by category
* fred pass
* feat: new UI
* refactor: fix everything
* fix: recreate UI on further lints
* fix: remove unnecessary changes
* chore: lockfile
* fix: tryout for descriptions
* fix: remove change, will do in other PR
* Apply suggestions from code review
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* test: fix
* nit: format styles
---------
Co-authored-by: Fred K. Schott <fkschott@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Allow islands to be re-rendered with new props on page transition
* Adjust the expected styles
* Restore test expectation
* Add changeset and final change
* linting
* Implement transition:persist-props behavior
* Fix lockfile
* Fix expectations
* App is hyrid
* Update .changeset/lovely-nails-cough.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update .changeset/lovely-nails-cough.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update .changeset/lovely-nails-cough.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* fix(markdown): don’t generate mdast html nodes
`html` nodes from mdast are converted to `raw` hast nodes. These nodes
are then not processed by proper rehype plugins. Typically if a remark
plugin generates `html` nodes, this indicates it should have actually
been a rehype plugin.
This changes the remark plugins that generate `html` nodes into rehype
nodes. These were `remarkPrism` and `remarkShiki`.
Closes#9909
* Apply suggestions from code review
* refactor(mdx): move user defined rehype plugins after syntax highlighting
* fix(mdx): fix issue in mdx rehype plugin ordering
* docs: explain why html/raw nodes are avoided in changeset
This also includes some hints on what users could do to upgrade of they
rely on these nodes.
* Fix MDX rehype plugin ordering
* refactor(remark): restore remarkPrism and remarkShiki
They aren’t used anymore, but removing would be a breaking change.
* chore: mark deprecated
* Apply suggestions from code review
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update .changeset/thirty-beds-smoke.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* deps: drizzle preview
* feat: db.batch and method run handling
* refactor: use db.batch in test fixture
* deps: bump to drizzle 0.29.5
* chore: changeset
* fix: unpin drizzle version
* fix: db execute should uh... execute
* Add integrations API for adding db config/seed files
* Fix seeding when user seed file is present
* Add basic test and fixture for integrations API
* Freeze that lockfile
* Test to see if this is a Windows fix
* Don’t import.meta.glob integration seed files
* Make integration seed files export a default function
* style: rejiggle
* Fix temporary file conflicts
* Remove changes to Astro’s core types, type utility method instead
* Use `astro:db` instead of `@astrojs/db`
* Revert unnecessarily cautious temporary path name
This reverts commit ef2156e41b.
* Add changeset
* Fix entrypoints and `asDrizzleTable` usage in changeset
* Getting Nate in on the co-author action
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
* Fix user seed file in integrations fixture
* Update `seedLocal()` after merge
* Provide empty `seedFiles` array in `db execute`
---------
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
* fix(node): add user specified headers to preview server responses
* docs: clarify comment
* style: new line
* test: remove test
* chore: add changeset
* Initial DB migration code
* chore: update package.json
* chore: update lockfile
* feat: add db as top-level config value
* Small package change
* Add a very basic test
* deps: remove unused
* chore: astro/db scripts, exports, deps
* chore: set tsconfig to monorepo defaults
* feat: MVP to use libsql in dev
* fix: test fixture paths
* fix: test file paths
* chore: remove CLI tests
* fix: add astro-scripts to db
* fix: package.json merge
* fix: load seed file separately for build
* feat: create db on filesystem for build
* fix: ul test. It passes now!
* Squashed commit of the following:
commit acdddd728c56f25e42975db7f367ab8a998e8c41
Author: Princesseuh <3019731+Princesseuh@users.noreply.github.com>
Date: Wed Jan 10 14:06:16 2024 -0500
fix: proper type augment for the config
commit b41ca9aacf291d1e5f0a27b6d6339ce4fc608ec3
Author: Nate Moore <nate@astro.build>
Date: Tue Jan 9 14:33:42 2024 -0600
wip: type augmentation
* feat: data() fn with basic type safety
* wip: update from seed file to data()
* fix: bad collectionSchema data type
* refactor: move dev to use filesystem to run seed at right time
* chore: remove seed file logic
* docs: add basic README
* CLI sync command
* Runtime checking of writable
* docs: add join example
* Implement defineWritableCollection
* feat: use studio connection for studio builds
* fix: add defineWritableCollection export
* refactor: use getTableName() util
* feat(db): add support for pass-through `astro db` command
* chore: add error map
* fix: add drizzle import
* refactor: studio -> db cli
* feat: add ticketing example
* fix: bad types in astro config
* fix: remove invalid `data()` on writable collection
* fix: vite warning on load-astro-config
* wip: add seeding for readable collections (nonstable ids!)
* merge migration work into branch
* cleanup migration commands
* migrate seed data to new db push command
* add migrations table to db
* fix remote db bugs
* fix: warn writable collections when studio false
* chore: delete README contents (now on Notion)
* chore: remove blank README
* chore: add dev dependency on db
* Removed unused deps
* 0.1.0
* Add config-augment.d.ts to published artifacts"
* Fixes merge issues with main
* fix: support promise response from data()
* feat: basic glob fixture
* Add a main field
* Give a help message when no db command is provided
* feat: `db push --token` for GitHub CI secrets
* fix getPackage for db package
* 0.1.2
* wip: build a table type
* chore: update lockfile
* chore: temporarily remove `Table` type
* feat: better Table object for type inference
* format
* add primaryKey support
* improve snapshot parsing support
* cleanup primary key support, db push
* add simple db shell
* cleanup old copy paste code
* feat: scrappy global data() prototype
* feat(test): recipes example
* fix: use Extract to narrow keyof to strings
* 0.1.3
* Create a runtime version of createRemoteDatabaseClient
* 0.1.4
* Grab the dbUrl from the environment
* 0.1.5
* Expose the database to the build output
* 0.1.6
* 0.1.7
* 0.1.15
* wip: data() -> set() concept
* fix: just infer insert keys for now
* refactor: rewrite to injected set() function
* deps: chokidar, drizzle
* feat: glob support with { db, table } signature
* chore: move basics to new data set
* refactor: set -> seed
* feat: expose Model.table
* refactor: clean up types
* feat: migrations now working!
* upgrade @libsql/client
* format
* expose relevant types
* 0.1.16
* feat: config design
* feat: add indexes from collectionToTable
* feat: add indexes to setupDbTables
* fix: remove unique constraint on recipeId
* Use an import statement to grab the database file
* 0.1.17
* Remove unused import
* Rename to ?fileurl
* 0.1.18
* feat: index migrations
* move migration logic to turso, add back sync support
* feat: add queries unit tests and fix related bugs
* refactor: move field queries to field-queries.test
* feat: index query tests
* refactor: reorganize the rats nest of files
* Make the DB_URL be root relative
* Upgrade to latest libsql
* 0.1.19
* 0.1.20
* Make work in webcontainer
* 0.1.22
* Remove content database from the static build
* 0.1.23
* chore: remove `optional: true` from pk
* chore: disable console linting for CLI
* fix: remove `id` column from Table type
* chore: remove `AstroId` type
* fix(ex): add `id` col to ticketing
* 0.2.0
* 0.2.1
* add keywords
* 0.2.2
* feat: API shape
* feat: FINALLY collection and name attached
* refactor: move to arrow function signature
* fix: foreignKeys references signature
* chore: unused imports
* feat: add foreignkeys to create table
* chore: lint
* chore: enable foreign keys in local mode only
* refactor: objShallowEqual -> deep diff
* fix: correct `hasDefault` inference
* fix: correct type Config reference
* fix: respect primaryKey from hasDefault
* fix: mark data keys as optional until we have type inference
* improve conflict and dataloss handling
- moved prompts to db push
- moved prompt logic out of lower-level functions
- improved logic overall
- improved user-facing prompt messages
* improve error messaging around studio config missing
* make it more clear when remove vs. local db is in use
* fix bug in prompt logic
* feat: better field.x() types
* feat: better seed() types
* chore: remove `as any` on seed values
* feat: good enough return type on seed :)
* feat: defineData()
* fix: add back promptResponse injection
* fix: use schema.parse to resolve dates
* fix: correctly respect primary key on INSERT INTO
* add short-lived db tokens
* add help output
* add better token error logging
* fix studio tests
* add shortcut link command from studio web ui
* Add support for SQL defaults
You can now use sql`CURRENT_TIMESTAMP`, `NOW`, and a couple of other
helpers, to set defaults.
* chore: todo
* feat: ignore `optional` and `default` when pk is present
* refactor: type `false` instead of type `never`
* feat: prevent `optional` on text pk
* fix db URL import for windows
* fix: add back textField multiline
* fix: remove explicit AUTOINCREMENT on int pk
* feat(db-cli): clean up CLI logging, support --json flag for `astro db verify`, extract shared logic to a utility
* prepare to run seed on all db push commands
* chore: expose setMeta for unit testing
* feat(test): reference add and remove tests
* feat: add references checks to migratiosn
* feat: remove useForeignKey checks
* feat: add pragma when pushing migrations
* feat(test): foreignKeys
* fix: transform collection config to be JSON serializable
* refactor: _setMeta -> preprocess for `table`
* refactor: reference tests
* chore: remove console log
* fix: handle serialized SQL object correctly
* refactor: store raw sql instead
* seed on every push
* Move field schema only a `schema` object
* Fix references test
* 0.3.0
* add default URLs to db package
* 0.3.1
* Fix input types
* fix: primaryKey type check
* 0.3.2
* fix: respect default in table types
* fix: avoid dropping tables on production seed
* fix: escape name on drop table
* feat: allow verify to mock migration file
* Handle unauthorized linking
* Fix verbiage of unauthorized link warning
* Add some color to the unauthorized message
* 0.3.3
* Improve the unauthorized error output
* 0.3.4
* fix: better error message
* Seed the Themes in build too
* Push skipped test
* chore: remove dead isJsonSerializable check
* fix: use `dateType` for dates (oops)
* refactor: clarify date coerce comment
* refactor: remove unused coerce
* chore: unskip date test
* feat: seed -> seedReturning
* refactor: throw when seeding writable in prod
* Add unsafeWritable option
* refactor: use FieldsConfig for Table generic
* chore: lint
* fix: use z.input for AstroConfigWithDB type
* fix: add defaults for boolean config options
* Support new CLI command structure
* Allow writable in the tests
* fix: handle defaults for safe type changes
* refactor: avoid selecting ['schema'] on input types
* 0.3.5
* Rename field->column, collection->table
* Rename collections->tables
* rename to defineReadableTable
* deps: upgrade ticketing-example
* fix: stray console.log
* deps: bump preact again
* chore: preact->react
* fix: parse params.event as number
* fix: correct event references
* Allow integrations to define schema
* fix: file-url plugin failure on repeated generateBundle() runs
* update url
* Cleanup
* Linting
* fix windows file permission issue
When runnng `astro dev`, the watcher would close trying to delete the `content.db` file due to a file permission error. This change makes the local DB client a disposable to allow cleanup after usage.
* Formatting
* "fix" Symbol.dispose usage
---------
Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: bholmesdev <hey@bholmes.dev>
Co-authored-by: Fred K. Schott <fkschott@gmail.com>
Co-authored-by: itsMapleLeaf <19603573+itsMapleLeaf@users.noreply.github.com>
* chore: use biome to sort imports
* do the sorting
* Update package.json
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
---------
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
* add remote image dimension probing, and param for getImage options, and new astro error
* add inferSize parameter to getImage, which probes remote image size, and respective types to picture and image component
* add fixture and tests
* add changeset
* attempt to fix pnpm-lock.yaml
* fix pnpm-lock.yaml again
* pnpm-lock spacing
* fix pnpm-lock AGAIN
* better description of error for docgen
* improve failed to probe error message and correct required dimensions error
* increase timeout for mdx tests
* increasing mdx timeout to 2min to see if it passes, will reduce if it does
* setting mdx timeout to 70 seconds
* Update packages/astro/src/assets/services/service.ts
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
* refactor to move logic to getImage instead of validateOptions and to not add a third type to image and picture
* fix broken link created by docs PR
* remove the probe-image-size library due to its use of node APIs
* undo all changes to service.ts that were left after moving inferSize logic to getImage
* update error message
* remove probe-image-size library all together, update error message, add vendored version of complete image-size library instead of refactored version
* Update .changeset/tame-cameras-change.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update .changeset/tame-cameras-change.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* reword the error message based on Sarah's previous review
* remove probe-image-size from pnpmlock
* fix lockfile?
* update error message name
* move image-size into vendor folder
* add eslint ignore to a line in image-size
* test if change to mdx test timeout was needed
* Update .changeset/tame-cameras-change.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* update changset syntax
* patch parse heif to account for filetype block being out of order
---------
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
* Revert "fix(compiler): Support dynamic slot names (#9605)"
This reverts commit 8ce40a417c.
* chore: changeset
* Update .changeset/weak-pans-sit.md
* chore: bump compiler version
* fix failing test
We were expecting the source code to produce an error, but in
2.4.0 of the compiler, that generates valid code
---------
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
* Progressively add new tests (remove old later)
* Finalize tests
* Remove unused comments
* Assert that errors are not present and add jsdocs to util function
* Fix
* Remove mocha deps
* fix: fix `transition:name` can be unicode
* delete prefix -
* use for func
* add changeset
* Update .changeset/cold-bobcats-shave.md
Co-authored-by: Martin Trapp <94928215+martrapp@users.noreply.github.com>
* fix review issue
* fix review issue
* add comment
* add \ to regex
* fix some issue
* delete unused import
* remove a rule
* remove valid rule --
* Update transition.ts
Co-authored-by: Martin Trapp <94928215+martrapp@users.noreply.github.com>
* Update transition.ts
Co-authored-by: Martin Trapp <94928215+martrapp@users.noreply.github.com>
* Update transition.ts
Co-authored-by: Martin Trapp <94928215+martrapp@users.noreply.github.com>
* Update transition.ts
Co-authored-by: Martin Trapp <94928215+martrapp@users.noreply.github.com>
* Update transition.ts
Co-authored-by: Martin Trapp <94928215+martrapp@users.noreply.github.com>
* Update transition.ts
Co-authored-by: Martin Trapp <94928215+martrapp@users.noreply.github.com>
* Update transition.ts
Co-authored-by: Martin Trapp <94928215+martrapp@users.noreply.github.com>
* format
* use cssesc to escape name
* test: add e2e test
* add charset for layout
* use the raw value for e2e test
* use cssesc instead of toValidIdent
* uncomment
---------
Co-authored-by: Martin Trapp <94928215+martrapp@users.noreply.github.com>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
* chore(@astrojs/node): use Node.js for testing
* revert file
* address feedback
* feedback
* Run tests in a single process (#9823)
* Run tests in a single process
* Make test less flaky
* chore: remove module
---------
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
* feat(node): add trailing slash support
* add changeset
* test(node): add base route test in trailing-slash.js
detected an infinite loop in base path when trailingSlash: never
* fix(node): avoid infinite redirect when trailingSlash: never
* address test failures after rebase pt.1
* address test failures after rebase pt.2
---------
Co-authored-by: lilnasy <69170106+lilnasy@users.noreply.github.com>
* rearrange plugins and add props to Image component
* add tests and update lockfile
* add changeset
* re-rearrange plugin order, gfm/smartypants then user defined then image related then shiki/prism
* make more generic
* add more/better tests
* remove unused logger
---------
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>