Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(astro): experimental middleware #6721

Merged
merged 55 commits into from
May 3, 2023
Merged

feat(astro): experimental middleware #6721

merged 55 commits into from
May 3, 2023

Conversation

ematipico
Copy link
Member

@ematipico ematipico commented Mar 31, 2023

Changes

  1. Create a new project
npm create astro@latest
  1. Change the "astro" package to use the preview release:
-- "astro": "latest"
++ "astro": "next--middleware"
  1. Enable the experimental flag
export default defineConfig({
	experimental: {
		middleware: true
	}
})
  1. Under the folder src/, create middleware/index.js or a file called src/middleware.js. Or .ts; it's up to you.
  2. Inside the file, you must have an exported function called onRequest
/**
 * @type import("astro").MiddlewareHanlder
 */
export function onRequest ({ locals, request }, resolve) {
	// locals = {}
};

You can manipulate the object to your heart content.

  1. Inside your .astro file (any file), access to locals
---
const data = Astro.locals;
---
  1. To join multiple middlewares, use the new sequence API provided by the astro/middleware module:
import {sequence} from "astro/middleware";

/**
 * @type import("astro").MiddlewareResponseHandler
 */
const first = (context, resolve) => {

}
/**
 * @type import("astro").MiddlewareResponseHandler
 */
const second = (context, resolve) => {

}
export const onRequest = sequence(first, second);
  1. Use the resolve function to retrieve and act on the response. When using resolve, the middleware must return the response.
export async function onRequest (context, resolve) {
	const  response = await response(context);
	// do something with the response
	return response;
};
  1. Create a middleware that shows different information based on data found in the context object (APIContext type). It can be context.request.url, context.params, etc.
  2. Try using the middleware using the node adapter:
import { defineConfig } from "astro/config";
import node from '@astrojs/node';
// https://astro.build/config


export default defineConfig({
	output: "server",
	adapter: node({
		mode: 'standalone'
	})
});

This PR implements the Astro middleware under an experimental flag. Please refer to the RFC for more information.

Testing

I created multiple test cases for development and production modes. The production tests use the preview feature and don't use an SSR adapter.

Docs

cc

cc @withastro/maintainers-docs for feedback! Here's an issue where we can collect feedback: withastro/docs#3069

@changeset-bot
Copy link

changeset-bot bot commented Mar 31, 2023

🦋 Changeset detected

Latest commit: e8e5007

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added pkg: astro Related to the core `astro` package (scope) pkg: integration Related to any renderer integration (scope) semver: minor Change triggers a `minor` release labels Mar 31, 2023
@ematipico

This comment was marked as off-topic.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 31, 2023

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

@ematipico

This comment was marked as off-topic.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 3, 2023

 > root@0.0.0 release /home/runner/work/astro/astro > pnpm run build && changeset publish "--tag" "next--middleware" > root@0.0.0 build /home/runner/work/astro/astro > turbo run build --output-logs=new-only --no-deps --filter=astro --filter=create-astro --filter="@astrojs/*" --filter="@benchmark/*" �[2m• Packages in scope: @astrojs/alpinejs, @astrojs/cloudflare, @astrojs/deno, @astrojs/image, @astrojs/lit, @astrojs/markdoc, @astrojs/markdown-component, @astrojs/markdown-remark, @astrojs/mdx, @astrojs/netlify, @astrojs/node, @astrojs/partytown, @astrojs/preact, @astrojs/prefetch, @astrojs/prism, @astrojs/react, @astrojs/rss, @astrojs/sitemap, @astrojs/solid-js, @astrojs/svelte, @astrojs/tailwind, @astrojs/telemetry, @astrojs/turbolinks, @astrojs/vercel, @astrojs/vue, @astrojs/webapi, @benchmark/timer, astro, create-astro�[0m �[2m• Running�[0m �[2m�[1mbuild�[0m�[0m �[2min 29 packages�[0m �[2m• Remote computation caching enabled (experimental)�[0m �[35m@astrojs/webapi:build: �[0mcache hit, suppressing output �[2md3462bb5b4ef38e6�[0m �[34m@astrojs/prism:build: �[0mcache hit, suppressing output �[2m49415a688c9bfc61�[0m �[35mcreate-astro:build: �[0mcache hit, suppressing output �[2md5da87b8c1277512�[0m �[33m@astrojs/telemetry:build: �[0mcache hit, suppressing output �[2mbd8baaa564376620�[0m �[36m@astrojs/markdown-remark:build: �[0mcache hit, suppressing output �[2mcecb9ee018a785bf�[0m �[32mastro:build: �[0mcache miss, executing �[2mda39c5c0e664d83c�[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> astro@0.0.0-middleware-20230403121346 build /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> pnpm run prebuild && astro-scripts build "src/**/*.{ts,js}" && tsc && pnpm run postbuild �[32mastro:build: �[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> astro@0.0.0-middleware-20230403121346 prebuild /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> astro-scripts prebuild --to-string "src/runtime/server/astro-island.ts" "src/runtime/client/{idle,load,media,only,visible}.ts" �[32mastro:build: �[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> astro@0.0.0-middleware-20230403121346 postbuild /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> astro-scripts copy "src/**/*.astro" && astro-scripts copy "src/**/*.wasm" �[32mastro:build: �[0m �[33m@astrojs/turbolinks:build: �[0mcache miss, executing �[2m87795dd644b490bd�[0m �[34m@astrojs/lit:build: �[0mcache miss, executing �[2m1d12b83dba2981f2�[0m �[36m@astrojs/markdoc:build: �[0mcache miss, executing �[2mad268ab0850adb28�[0m �[35m@astrojs/solid-js:build: �[0mcache miss, executing �[2ma58858c613bd9ccc�[0m �[35m@benchmark/timer:build: �[0mcache miss, executing �[2meefc622eb4564ddc�[0m �[32m@astrojs/image:build: �[0mcache miss, executing �[2m3b29d896800d78e2�[0m �[32m@astrojs/vercel:build: �[0mcache miss, executing �[2meeef45f224f2d08e�[0m �[33m@astrojs/prefetch:build: �[0mcache miss, executing �[2m3d02323323433531�[0m �[34m@astrojs/mdx:build: �[0mcache miss, executing �[2m6c15b15f085d5a33�[0m �[36m@astrojs/svelte:build: �[0mcache miss, executing �[2mfadedcd5bdfea446�[0m �[33m@astrojs/turbolinks:build: �[0m �[33m@astrojs/turbolinks:build: �[0m> @astrojs/turbolinks@0.2.1 build /home/runner/work/astro/astro/packages/integrations/turbolinks �[33m@astrojs/turbolinks:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/turbolinks:build: �[0m �[34m@astrojs/lit:build: �[0m �[34m@astrojs/lit:build: �[0m> @astrojs/lit@2.0.0 build /home/runner/work/astro/astro/packages/integrations/lit �[34m@astrojs/lit:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/lit:build: �[0m �[32m@astrojs/image:build: �[0m �[32m@astrojs/image:build: �[0m> @astrojs/image@0.16.4 build /home/runner/work/astro/astro/packages/integrations/image �[32m@astrojs/image:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/image:build: �[0m �[35m@astrojs/solid-js:build: �[0m �[35m@astrojs/solid-js:build: �[0m> @astrojs/solid-js@2.1.0 build /home/runner/work/astro/astro/packages/integrations/solid �[35m@astrojs/solid-js:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/solid-js:build: �[0m �[36m@astrojs/markdoc:build: �[0m �[36m@astrojs/markdoc:build: �[0m> @astrojs/markdoc@0.1.0 build /home/runner/work/astro/astro/packages/integrations/markdoc �[36m@astrojs/markdoc:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/markdoc:build: �[0m �[35m@benchmark/timer:build: �[0m �[35m@benchmark/timer:build: �[0m> @benchmark/timer@0.0.0 build /home/runner/work/astro/astro/benchmark/packages/timer �[35m@benchmark/timer:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@benchmark/timer:build: �[0m �[33m@astrojs/prefetch:build: �[0m �[33m@astrojs/prefetch:build: �[0m> @astrojs/prefetch@0.2.1 build /home/runner/work/astro/astro/packages/integrations/prefetch �[33m@astrojs/prefetch:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/prefetch:build: �[0m �[32m@astrojs/vercel:build: �[0m �[32m@astrojs/vercel:build: �[0m> @astrojs/vercel@3.2.1 build /home/runner/work/astro/astro/packages/integrations/vercel �[32m@astrojs/vercel:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/vercel:build: �[0m �[34m@astrojs/mdx:build: �[0m �[34m@astrojs/mdx:build: �[0m> @astrojs/mdx@0.18.2 build /home/runner/work/astro/astro/packages/integrations/mdx �[34m@astrojs/mdx:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/mdx:build: �[0m �[36m@astrojs/svelte:build: �[0m �[36m@astrojs/svelte:build: �[0m> @astrojs/svelte@2.1.0 build /home/runner/work/astro/astro/packages/integrations/svelte �[36m@astrojs/svelte:build: �[0m> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc �[36m@astrojs/svelte:build: �[0m �[33m@astrojs/cloudflare:build: �[0mcache miss, executing �[2m40b17c336755f335�[0m �[34m@astrojs/netlify:build: �[0mcache miss, executing �[2mb2519f28a031d2c3�[0m �[36m@astrojs/rss:build: �[0mcache miss, executing �[2me6e24dd208efa751�[0m �[35m@astrojs/react:build: �[0mcache miss, executing �[2m26fa88bec39ada59�[0m �[32m@astrojs/node:build: �[0mcache miss, executing �[2m2fcacbdd5ba55675�[0m �[34m@astrojs/preact:build: �[0mcache miss, executing �[2m6613cac9b52f1bd6�[0m �[35m@astrojs/vue:build: �[0mcache miss, executing �[2m5bea3fac15d6fea9�[0m �[36m@astrojs/sitemap:build: �[0mcache miss, executing �[2mad26af93586ddf4e�[0m �[33m@astrojs/cloudflare:build: �[0m �[33m@astrojs/cloudflare:build: �[0m> @astrojs/cloudflare@6.2.2 build /home/runner/work/astro/astro/packages/integrations/cloudflare �[33m@astrojs/cloudflare:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/cloudflare:build: �[0m �[32m@astrojs/tailwind:build: �[0mcache miss, executing �[2m69b4f9a5907398a0�[0m �[34m@astrojs/netlify:build: �[0m �[34m@astrojs/netlify:build: �[0m> @astrojs/netlify@2.2.0 build /home/runner/work/astro/astro/packages/integrations/netlify �[34m@astrojs/netlify:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/netlify:build: �[0m �[36m@astrojs/rss:build: �[0m �[36m@astrojs/rss:build: �[0m> @astrojs/rss@2.3.2 build /home/runner/work/astro/astro/packages/astro-rss �[36m@astrojs/rss:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/rss:build: �[0m �[35m@astrojs/react:build: �[0m �[35m@astrojs/react:build: �[0m> @astrojs/react@2.1.1 build /home/runner/work/astro/astro/packages/integrations/react �[35m@astrojs/react:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/react:build: �[0m �[32m@astrojs/node:build: �[0m �[32m@astrojs/node:build: �[0m> @astrojs/node@5.1.0 build /home/runner/work/astro/astro/packages/integrations/node �[32m@astrojs/node:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/node:build: �[0m �[34m@astrojs/preact:build: �[0m �[34m@astrojs/preact:build: �[0m> @astrojs/preact@2.1.0 build /home/runner/work/astro/astro/packages/integrations/preact �[34m@astrojs/preact:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/preact:build: �[0m �[35m@astrojs/vue:build: �[0m �[35m@astrojs/vue:build: �[0m> @astrojs/vue@0.0.0-middleware-20230403121346 build /home/runner/work/astro/astro/packages/integrations/vue �[35m@astrojs/vue:build: �[0m> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc �[35m@astrojs/vue:build: �[0m �[36m@astrojs/sitemap:build: �[0m �[36m@astrojs/sitemap:build: �[0m> @astrojs/sitemap@1.2.1 build /home/runner/work/astro/astro/packages/integrations/sitemap �[36m@astrojs/sitemap:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/sitemap:build: �[0m �[32m@astrojs/tailwind:build: �[0m �[32m@astrojs/tailwind:build: �[0m> @astrojs/tailwind@3.1.1 build /home/runner/work/astro/astro/packages/integrations/tailwind �[32m@astrojs/tailwind:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/tailwind:build: �[0m �[33m@astrojs/deno:build: �[0mcache miss, executing �[2md200b11b8fcefd23�[0m �[34m@astrojs/alpinejs:build: �[0mcache miss, executing �[2mc0815352d3187373�[0m �[36m@astrojs/partytown:build: �[0mcache miss, executing �[2mc04e0a62663bafdc�[0m �[33m@astrojs/deno:build: �[0m �[33m@astrojs/deno:build: �[0m> @astrojs/deno@4.1.0 build /home/runner/work/astro/astro/packages/integrations/deno �[33m@astrojs/deno:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/deno:build: �[0m �[34m@astrojs/alpinejs:build: �[0m �[34m@astrojs/alpinejs:build: �[0m> @astrojs/alpinejs@0.2.1 build /home/runner/work/astro/astro/packages/integrations/alpinejs �[34m@astrojs/alpinejs:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/alpinejs:build: �[0m �[36m@astrojs/partytown:build: �[0m �[36m@astrojs/partytown:build: �[0m> @astrojs/partytown@1.2.0 build /home/runner/work/astro/astro/packages/integrations/partytown �[36m@astrojs/partytown:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/partytown:build: �[0m Tasks: 28 successful, 28 total Cached: 5 cached, 28 total Time: 1m4.298s Package �[36m"@astrojs/markdown-remark"�[39m must depend on the current version of �[36m"astro"�[39m: �[32m"0.0.0-middleware-20230403121346"�[39m vs �[31m"^2.1.5"�[39m 🦋 �[33mwarn�[39m �[31m===============================IMPORTANT!===============================�[39m 🦋 �[33mwarn�[39m Packages will be released under the next--middleware tag 🦋 �[33mwarn�[39m �[31m----------------------------------------------------------------------�[39m 🦋 �[36minfo�[39m npm info astro 🦋 �[36minfo�[39m npm info @astrojs/prism 🦋 �[36minfo�[39m npm info @astrojs/rss 🦋 �[36minfo�[39m npm info create-astro 🦋 �[36minfo�[39m npm info @astrojs/alpinejs 🦋 �[36minfo�[39m npm info @astrojs/cloudflare 🦋 �[36minfo�[39m npm info @astrojs/deno 🦋 �[36minfo�[39m npm info @astrojs/image 🦋 �[36minfo�[39m npm info @astrojs/lit 🦋 �[36minfo�[39m npm info @astrojs/markdoc 🦋 �[36minfo�[39m npm info @astrojs/mdx 🦋 �[36minfo�[39m npm info @astrojs/netlify 🦋 �[36minfo�[39m npm info @astrojs/node 🦋 �[36minfo�[39m npm info @astrojs/partytown 🦋 �[36minfo�[39m npm info @astrojs/preact 🦋 �[36minfo�[39m npm info @astrojs/prefetch 🦋 �[36minfo�[39m npm info @astrojs/react 🦋 �[36minfo�[39m npm info @astrojs/sitemap 🦋 �[36minfo�[39m npm info @astrojs/solid-js 🦋 �[36minfo�[39m npm info @astrojs/svelte 🦋 �[36minfo�[39m npm info @astrojs/tailwind 🦋 �[36minfo�[39m npm info @astrojs/turbolinks 🦋 �[36minfo�[39m npm info @astrojs/vercel 🦋 �[36minfo�[39m npm info @astrojs/vue 🦋 �[36minfo�[39m npm info @astrojs/markdown-component 🦋 �[36minfo�[39m npm info @astrojs/markdown-remark 🦋 �[36minfo�[39m npm info @astrojs/telemetry 🦋 �[36minfo�[39m npm info @astrojs/webapi 🦋 �[36minfo�[39m astro is being published because our local version (0.0.0-middleware-20230403121346) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/prism is not being published because version 2.1.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/rss is not being published because version 2.3.2 is already published on npm 🦋 �[33mwarn�[39m create-astro is not being published because version 3.1.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/alpinejs is not being published because version 0.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/cloudflare is not being published because version 6.2.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/deno is not being published because version 4.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/image is not being published because version 0.16.4 is already published on npm 🦋 �[33mwarn�[39m @astrojs/lit is not being published because version 2.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdoc is not being published because version 0.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/mdx is not being published because version 0.18.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/netlify is not being published because version 2.2.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/node is not being published because version 5.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/partytown is not being published because version 1.2.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/preact is not being published because version 2.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/prefetch is not being published because version 0.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/react is not being published because version 2.1.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/sitemap is not being published because version 1.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/solid-js is not being published because version 2.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/svelte is not being published because version 2.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/tailwind is not being published because version 3.1.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/turbolinks is not being published because version 0.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/vercel is not being published because version 3.2.1 is already published on npm 🦋 �[36minfo�[39m @astrojs/vue is being published because our local version (0.0.0-middleware-20230403121346) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/markdown-component is not being published because version 1.0.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdown-remark is not being published because version 2.1.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/telemetry is not being published because version 2.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/webapi is not being published because version 2.1.0 is already published on npm 🦋 �[36minfo�[39m Publishing �[36m"astro"�[39m at �[32m"0.0.0-middleware-20230403121346"�[39m 🦋 �[36minfo�[39m Publishing �[36m"@astrojs/vue"�[39m at �[32m"0.0.0-middleware-20230403121346"�[39m 🦋 �[32msuccess�[39m packages published successfully: 🦋 astro@0.0.0-middleware-20230403121346 🦋 @astrojs/vue@0.0.0-middleware-20230403121346 🦋 Creating git tags... 🦋 New tag: astro@0.0.0-middleware-20230403121346 🦋 New tag: @astrojs/vue@0.0.0-middleware-20230403121346

@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2023

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

@ematipico
Copy link
Member Author

!preview middleware

@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2023

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2023

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2023

 > root@0.0.0 release /home/runner/work/astro/astro > pnpm run build && changeset publish "--tag" "next--middleware" > root@0.0.0 build /home/runner/work/astro/astro > turbo run build --output-logs=new-only --no-deps --filter=astro --filter=create-astro --filter="@astrojs/*" --filter="@benchmark/*" �[2m• Packages in scope: @astrojs/alpinejs, @astrojs/cloudflare, @astrojs/deno, @astrojs/image, @astrojs/lit, @astrojs/markdoc, @astrojs/markdown-component, @astrojs/markdown-remark, @astrojs/mdx, @astrojs/netlify, @astrojs/node, @astrojs/partytown, @astrojs/preact, @astrojs/prefetch, @astrojs/prism, @astrojs/react, @astrojs/rss, @astrojs/sitemap, @astrojs/solid-js, @astrojs/svelte, @astrojs/tailwind, @astrojs/telemetry, @astrojs/turbolinks, @astrojs/vercel, @astrojs/vue, @astrojs/webapi, @benchmark/timer, astro, create-astro�[0m �[2m• Running�[0m �[2m�[1mbuild�[0m�[0m �[2min 29 packages�[0m �[2m• Remote computation caching enabled (experimental)�[0m �[35m@astrojs/webapi:build: �[0mcache hit, suppressing output �[2m73678b2855f0f47e�[0m �[34mcreate-astro:build: �[0mcache hit, suppressing output �[2m8ec6b99999cbc9c7�[0m �[33m@astrojs/telemetry:build: �[0mcache hit, suppressing output �[2m5c0c7945f1745ff8�[0m �[36m@astrojs/prism:build: �[0mcache hit, suppressing output �[2m65ccd3f6ff4c5ce8�[0m �[35m@astrojs/markdown-remark:build: �[0mcache miss, executing �[2m7075079b7557458b�[0m �[35m@astrojs/markdown-remark:build: �[0m �[35m@astrojs/markdown-remark:build: �[0m> @astrojs/markdown-remark@0.0.0-middleware-20230405160200 build /home/runner/work/astro/astro/packages/markdown/remark �[35m@astrojs/markdown-remark:build: �[0m> astro-scripts build "src/**/*.ts" && tsc -p tsconfig.json �[35m@astrojs/markdown-remark:build: �[0m �[32mastro:build: �[0mcache miss, executing �[2m222e8d2cc6dea042�[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> astro@0.0.0-middleware-20230405160200 build /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> pnpm run prebuild && astro-scripts build "src/**/*.{ts,js}" && tsc && pnpm run postbuild �[32mastro:build: �[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> astro@0.0.0-middleware-20230405160200 prebuild /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> astro-scripts prebuild --to-string "src/runtime/server/astro-island.ts" "src/runtime/client/{idle,load,media,only,visible}.ts" �[32mastro:build: �[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> astro@0.0.0-middleware-20230405160200 postbuild /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> astro-scripts copy "src/**/*.astro" && astro-scripts copy "src/**/*.wasm" �[32mastro:build: �[0m �[35m@astrojs/node:build: �[0mcache miss, executing �[2mc0ca6f6be2f0357c�[0m �[33m@astrojs/alpinejs:build: �[0mcache miss, executing �[2m01b7a0f493dfaadf�[0m �[32m@astrojs/turbolinks:build: �[0mcache miss, executing �[2m3c966ce604415fdb�[0m �[36m@astrojs/preact:build: �[0mcache miss, executing �[2mc5812430eff6261e�[0m �[34m@astrojs/tailwind:build: �[0mcache miss, executing �[2meabe86ffc086368c�[0m �[35m@astrojs/rss:build: �[0mcache miss, executing �[2m1f1bf49e69a93e20�[0m �[34m@astrojs/cloudflare:build: �[0mcache miss, executing �[2md599d3f744bfea2c�[0m �[33m@astrojs/image:build: �[0mcache miss, executing �[2m4d9d47db9b1ac745�[0m �[32m@astrojs/vercel:build: �[0mcache miss, executing �[2mdf0f74792f9b642b�[0m �[36m@astrojs/prefetch:build: �[0mcache miss, executing �[2m9896ac9ada409732�[0m �[35m@astrojs/node:build: �[0m �[35m@astrojs/node:build: �[0m> @astrojs/node@0.0.0-middleware-20230405160200 build /home/runner/work/astro/astro/packages/integrations/node �[35m@astrojs/node:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/node:build: �[0m �[33m@astrojs/alpinejs:build: �[0m �[33m@astrojs/alpinejs:build: �[0m> @astrojs/alpinejs@0.2.1 build /home/runner/work/astro/astro/packages/integrations/alpinejs �[33m@astrojs/alpinejs:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/alpinejs:build: �[0m �[32m@astrojs/turbolinks:build: �[0m �[32m@astrojs/turbolinks:build: �[0m> @astrojs/turbolinks@0.2.1 build /home/runner/work/astro/astro/packages/integrations/turbolinks �[32m@astrojs/turbolinks:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/turbolinks:build: �[0m �[34m@astrojs/tailwind:build: �[0m �[34m@astrojs/tailwind:build: �[0m> @astrojs/tailwind@3.1.1 build /home/runner/work/astro/astro/packages/integrations/tailwind �[34m@astrojs/tailwind:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/tailwind:build: �[0m �[33m@astrojs/image:build: �[0m �[33m@astrojs/image:build: �[0m> @astrojs/image@0.16.4 build /home/runner/work/astro/astro/packages/integrations/image �[33m@astrojs/image:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/image:build: �[0m �[34m@astrojs/cloudflare:build: �[0m �[34m@astrojs/cloudflare:build: �[0m> @astrojs/cloudflare@6.2.2 build /home/runner/work/astro/astro/packages/integrations/cloudflare �[34m@astrojs/cloudflare:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/cloudflare:build: �[0m �[35m@astrojs/rss:build: �[0m �[35m@astrojs/rss:build: �[0m> @astrojs/rss@2.3.2 build /home/runner/work/astro/astro/packages/astro-rss �[35m@astrojs/rss:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/rss:build: �[0m �[36m@astrojs/preact:build: �[0m �[36m@astrojs/preact:build: �[0m> @astrojs/preact@2.1.0 build /home/runner/work/astro/astro/packages/integrations/preact �[36m@astrojs/preact:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/preact:build: �[0m �[32m@astrojs/vercel:build: �[0m �[32m@astrojs/vercel:build: �[0m> @astrojs/vercel@3.2.1 build /home/runner/work/astro/astro/packages/integrations/vercel �[32m@astrojs/vercel:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/vercel:build: �[0m �[36m@astrojs/prefetch:build: �[0m �[36m@astrojs/prefetch:build: �[0m> @astrojs/prefetch@0.2.1 build /home/runner/work/astro/astro/packages/integrations/prefetch �[36m@astrojs/prefetch:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/prefetch:build: �[0m �[33m@astrojs/react:build: �[0mcache miss, executing �[2m822987be1affce8a�[0m �[34m@astrojs/solid-js:build: �[0mcache miss, executing �[2m8575df6dd97b5359�[0m �[36m@astrojs/sitemap:build: �[0mcache miss, executing �[2m38c23638ca5cea31�[0m �[35m@benchmark/timer:build: �[0mcache miss, executing �[2m1add3828dde614bb�[0m �[32m@astrojs/vue:build: �[0mcache miss, executing �[2m01e93c05707c7f28�[0m �[33m@astrojs/react:build: �[0m �[33m@astrojs/react:build: �[0m> @astrojs/react@2.1.1 build /home/runner/work/astro/astro/packages/integrations/react �[33m@astrojs/react:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/react:build: �[0m �[34m@astrojs/solid-js:build: �[0m �[34m@astrojs/solid-js:build: �[0m> @astrojs/solid-js@2.1.0 build /home/runner/work/astro/astro/packages/integrations/solid �[34m@astrojs/solid-js:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/solid-js:build: �[0m �[33m@astrojs/svelte:build: �[0mcache miss, executing �[2mcb1df9ad8569fc02�[0m �[34m@astrojs/deno:build: �[0mcache miss, executing �[2m55c207b27e375fd1�[0m �[36m@astrojs/partytown:build: �[0mcache miss, executing �[2m596d73d768e076e4�[0m �[36m@astrojs/sitemap:build: �[0m �[36m@astrojs/sitemap:build: �[0m> @astrojs/sitemap@0.0.0-middleware-20230405160200 build /home/runner/work/astro/astro/packages/integrations/sitemap �[36m@astrojs/sitemap:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/sitemap:build: �[0m �[35m@benchmark/timer:build: �[0m �[35m@benchmark/timer:build: �[0m> @benchmark/timer@0.0.0 build /home/runner/work/astro/astro/benchmark/packages/timer �[35m@benchmark/timer:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@benchmark/timer:build: �[0m �[32m@astrojs/vue:build: �[0m �[32m@astrojs/vue:build: �[0m> @astrojs/vue@0.0.0-middleware-20230405160200 build /home/runner/work/astro/astro/packages/integrations/vue �[32m@astrojs/vue:build: �[0m> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc �[32m@astrojs/vue:build: �[0m �[32m@astrojs/markdoc:build: �[0mcache miss, executing �[2m21de4ffc99a467d7�[0m �[33m@astrojs/svelte:build: �[0m �[33m@astrojs/svelte:build: �[0m> @astrojs/svelte@2.1.0 build /home/runner/work/astro/astro/packages/integrations/svelte �[33m@astrojs/svelte:build: �[0m> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc �[33m@astrojs/svelte:build: �[0m �[34m@astrojs/deno:build: �[0m �[34m@astrojs/deno:build: �[0m> @astrojs/deno@4.1.0 build /home/runner/work/astro/astro/packages/integrations/deno �[34m@astrojs/deno:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/deno:build: �[0m �[36m@astrojs/partytown:build: �[0m �[36m@astrojs/partytown:build: �[0m> @astrojs/partytown@1.2.0 build /home/runner/work/astro/astro/packages/integrations/partytown �[36m@astrojs/partytown:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/partytown:build: �[0m �[32m@astrojs/markdoc:build: �[0m �[32m@astrojs/markdoc:build: �[0m> @astrojs/markdoc@0.0.0-middleware-20230405160200 build /home/runner/work/astro/astro/packages/integrations/markdoc �[32m@astrojs/markdoc:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/markdoc:build: �[0m �[33m@astrojs/lit:build: �[0mcache miss, executing �[2med4a769104495b18�[0m �[34m@astrojs/mdx:build: �[0mcache miss, executing �[2ma3c879b2e7a859e4�[0m �[36m@astrojs/netlify:build: �[0mcache miss, executing �[2mcbdf1dbfee96bc57�[0m �[33m@astrojs/lit:build: �[0m �[33m@astrojs/lit:build: �[0m> @astrojs/lit@2.0.0 build /home/runner/work/astro/astro/packages/integrations/lit �[33m@astrojs/lit:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/lit:build: �[0m �[34m@astrojs/mdx:build: �[0m �[34m@astrojs/mdx:build: �[0m> @astrojs/mdx@0.18.2 build /home/runner/work/astro/astro/packages/integrations/mdx �[34m@astrojs/mdx:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/mdx:build: �[0m �[36m@astrojs/netlify:build: �[0m �[36m@astrojs/netlify:build: �[0m> @astrojs/netlify@2.2.0 build /home/runner/work/astro/astro/packages/integrations/netlify �[36m@astrojs/netlify:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/netlify:build: �[0m Tasks: 28 successful, 28 total Cached: 4 cached, 28 total Time: 1m9.585s 🦋 �[33mwarn�[39m �[31m===============================IMPORTANT!===============================�[39m 🦋 �[33mwarn�[39m Packages will be released under the next--middleware tag 🦋 �[33mwarn�[39m �[31m----------------------------------------------------------------------�[39m 🦋 �[36minfo�[39m npm info astro 🦋 �[36minfo�[39m npm info @astrojs/prism 🦋 �[36minfo�[39m npm info @astrojs/rss 🦋 �[36minfo�[39m npm info create-astro 🦋 �[36minfo�[39m npm info @astrojs/alpinejs 🦋 �[36minfo�[39m npm info @astrojs/cloudflare 🦋 �[36minfo�[39m npm info @astrojs/deno 🦋 �[36minfo�[39m npm info @astrojs/image 🦋 �[36minfo�[39m npm info @astrojs/lit 🦋 �[36minfo�[39m npm info @astrojs/markdoc 🦋 �[36minfo�[39m npm info @astrojs/mdx 🦋 �[36minfo�[39m npm info @astrojs/netlify 🦋 �[36minfo�[39m npm info @astrojs/node 🦋 �[36minfo�[39m npm info @astrojs/partytown 🦋 �[36minfo�[39m npm info @astrojs/preact 🦋 �[36minfo�[39m npm info @astrojs/prefetch 🦋 �[36minfo�[39m npm info @astrojs/react 🦋 �[36minfo�[39m npm info @astrojs/sitemap 🦋 �[36minfo�[39m npm info @astrojs/solid-js 🦋 �[36minfo�[39m npm info @astrojs/svelte 🦋 �[36minfo�[39m npm info @astrojs/tailwind 🦋 �[36minfo�[39m npm info @astrojs/turbolinks 🦋 �[36minfo�[39m npm info @astrojs/vercel 🦋 �[36minfo�[39m npm info @astrojs/vue 🦋 �[36minfo�[39m npm info @astrojs/markdown-component 🦋 �[36minfo�[39m npm info @astrojs/markdown-remark 🦋 �[36minfo�[39m npm info @astrojs/telemetry 🦋 �[36minfo�[39m npm info @astrojs/webapi 🦋 �[36minfo�[39m astro is being published because our local version (0.0.0-middleware-20230405160200) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/prism is not being published because version 2.1.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/rss is not being published because version 2.3.2 is already published on npm 🦋 �[33mwarn�[39m create-astro is not being published because version 3.1.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/alpinejs is not being published because version 0.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/cloudflare is not being published because version 6.2.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/deno is not being published because version 4.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/image is not being published because version 0.16.4 is already published on npm 🦋 �[33mwarn�[39m @astrojs/lit is not being published because version 2.0.0 is already published on npm 🦋 �[36minfo�[39m @astrojs/markdoc is being published because our local version (0.0.0-middleware-20230405160200) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/mdx is not being published because version 0.18.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/netlify is not being published because version 2.2.0 is already published on npm 🦋 �[36minfo�[39m @astrojs/node is being published because our local version (0.0.0-middleware-20230405160200) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/partytown is not being published because version 1.2.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/preact is not being published because version 2.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/prefetch is not being published because version 0.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/react is not being published because version 2.1.1 is already published on npm 🦋 �[36minfo�[39m @astrojs/sitemap is being published because our local version (0.0.0-middleware-20230405160200) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/solid-js is not being published because version 2.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/svelte is not being published because version 2.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/tailwind is not being published because version 3.1.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/turbolinks is not being published because version 0.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/vercel is not being published because version 3.2.1 is already published on npm 🦋 �[36minfo�[39m @astrojs/vue is being published because our local version (0.0.0-middleware-20230405160200) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/markdown-component is not being published because version 1.0.3 is already published on npm 🦋 �[36minfo�[39m @astrojs/markdown-remark is being published because our local version (0.0.0-middleware-20230405160200) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/telemetry is not being published because version 2.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/webapi is not being published because version 2.1.0 is already published on npm 🦋 �[36minfo�[39m Publishing �[36m"astro"�[39m at �[32m"0.0.0-middleware-20230405160200"�[39m 🦋 �[36minfo�[39m Publishing �[36m"@astrojs/markdoc"�[39m at �[32m"0.0.0-middleware-20230405160200"�[39m 🦋 �[36minfo�[39m Publishing �[36m"@astrojs/node"�[39m at �[32m"0.0.0-middleware-20230405160200"�[39m 🦋 �[36minfo�[39m Publishing �[36m"@astrojs/sitemap"�[39m at �[32m"0.0.0-middleware-20230405160200"�[39m 🦋 �[36minfo�[39m Publishing �[36m"@astrojs/vue"�[39m at �[32m"0.0.0-middleware-20230405160200"�[39m 🦋 �[36minfo�[39m Publishing �[36m"@astrojs/markdown-remark"�[39m at �[32m"0.0.0-middleware-20230405160200"�[39m 🦋 �[32msuccess�[39m packages published successfully: 🦋 astro@0.0.0-middleware-20230405160200 🦋 @astrojs/markdoc@0.0.0-middleware-20230405160200 🦋 @astrojs/node@0.0.0-middleware-20230405160200 🦋 @astrojs/sitemap@0.0.0-middleware-20230405160200 🦋 @astrojs/vue@0.0.0-middleware-20230405160200 🦋 @astrojs/markdown-remark@0.0.0-middleware-20230405160200 🦋 Creating git tags... 🦋 New tag: astro@0.0.0-middleware-20230405160200 🦋 New tag: @astrojs/markdoc@0.0.0-middleware-20230405160200 🦋 New tag: @astrojs/node@0.0.0-middleware-20230405160200 🦋 New tag: @astrojs/sitemap@0.0.0-middleware-20230405160200 🦋 New tag: @astrojs/vue@0.0.0-middleware-20230405160200 🦋 New tag: @astrojs/markdown-remark@0.0.0-middleware-20230405160200

@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2023

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2023

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

@ematipico
Copy link
Member Author

!preview middleware

@ematipico ematipico force-pushed the feat/middleware-api branch 3 times, most recently from 4e5a017 to f844c7c Compare April 11, 2023 15:02
@github-actions
Copy link
Contributor

 > root@0.0.0 release /home/runner/work/astro/astro > pnpm run build && changeset publish "--tag" "next--middleware" > root@0.0.0 build /home/runner/work/astro/astro > turbo run build --output-logs=new-only --no-deps --filter=astro --filter=create-astro --filter="@astrojs/*" --filter="@benchmark/*" �[2m• Packages in scope: @astrojs/alpinejs, @astrojs/cloudflare, @astrojs/deno, @astrojs/image, @astrojs/lit, @astrojs/markdoc, @astrojs/markdown-component, @astrojs/markdown-remark, @astrojs/mdx, @astrojs/netlify, @astrojs/node, @astrojs/partytown, @astrojs/preact, @astrojs/prefetch, @astrojs/prism, @astrojs/react, @astrojs/rss, @astrojs/sitemap, @astrojs/solid-js, @astrojs/svelte, @astrojs/tailwind, @astrojs/telemetry, @astrojs/turbolinks, @astrojs/vercel, @astrojs/vue, @astrojs/webapi, @benchmark/timer, astro, create-astro�[0m �[2m• Running�[0m �[2m�[1mbuild�[0m�[0m �[2min 29 packages�[0m �[2m• Remote computation caching enabled (experimental)�[0m �[35m@astrojs/webapi:build: �[0mcache hit, suppressing output �[2md01b8a1013c6b024�[0m �[33mcreate-astro:build: �[0mcache hit, suppressing output �[2me2f1bcfe57688bf1�[0m �[34m@astrojs/prism:build: �[0mcache hit, suppressing output �[2mafbc1078ac750b55�[0m �[36m@astrojs/telemetry:build: �[0mcache hit, suppressing output �[2m09001ff73966393e�[0m �[35m@astrojs/markdown-remark:build: �[0mcache hit, suppressing output �[2m955e38d0eabc3da4�[0m �[32mastro:build: �[0mcache miss, executing �[2m4fd5a61c3b74807f�[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> astro@0.0.0-middleware-20230411150403 build /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> pnpm run prebuild && astro-scripts build "src/**/*.{ts,js}" && tsc && pnpm run postbuild �[32mastro:build: �[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> astro@0.0.0-middleware-20230411150403 prebuild /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> astro-scripts prebuild --to-string "src/runtime/server/astro-island.ts" "src/runtime/client/{idle,load,media,only,visible}.ts" �[32mastro:build: �[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> astro@0.0.0-middleware-20230411150403 postbuild /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> astro-scripts copy "src/**/*.astro" && astro-scripts copy "src/**/*.wasm" �[32mastro:build: �[0m �[35m@astrojs/turbolinks:build: �[0mcache miss, executing �[2mdc8949580b6fc01b�[0m �[36m@astrojs/partytown:build: �[0mcache miss, executing �[2m621741276c77551b�[0m �[34m@astrojs/sitemap:build: �[0mcache miss, executing �[2m0c80f9295f7600f8�[0m �[34m@astrojs/mdx:build: �[0mcache miss, executing �[2m23483c5dfca3d00c�[0m �[36m@astrojs/tailwind:build: �[0mcache miss, executing �[2mb45a07bf5993dfe9�[0m �[33m@astrojs/prefetch:build: �[0mcache miss, executing �[2ma4ebb68206a34407�[0m �[32m@astrojs/react:build: �[0mcache miss, executing �[2mb56c92d31b5041fe�[0m �[32m@astrojs/vue:build: �[0mcache miss, executing �[2m09b28e2f963827b8�[0m �[33m@astrojs/lit:build: �[0mcache miss, executing �[2maea6013afb507df8�[0m �[35m@astrojs/image:build: �[0mcache miss, executing �[2m25802770139bfaba�[0m �[35m@astrojs/turbolinks:build: �[0m �[35m@astrojs/turbolinks:build: �[0m> @astrojs/turbolinks@0.2.1 build /home/runner/work/astro/astro/packages/integrations/turbolinks �[35m@astrojs/turbolinks:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/turbolinks:build: �[0m �[34m@astrojs/mdx:build: �[0m �[34m@astrojs/mdx:build: �[0m> @astrojs/mdx@0.18.3 build /home/runner/work/astro/astro/packages/integrations/mdx �[34m@astrojs/mdx:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/mdx:build: �[0m �[36m@astrojs/partytown:build: �[0m �[36m@astrojs/partytown:build: �[0m> @astrojs/partytown@1.2.0 build /home/runner/work/astro/astro/packages/integrations/partytown �[36m@astrojs/partytown:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/partytown:build: �[0m �[32m@astrojs/react:build: �[0m �[32m@astrojs/react:build: �[0m> @astrojs/react@2.1.1 build /home/runner/work/astro/astro/packages/integrations/react �[32m@astrojs/react:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/react:build: �[0m �[34m@astrojs/sitemap:build: �[0m �[34m@astrojs/sitemap:build: �[0m> @astrojs/sitemap@1.2.2 build /home/runner/work/astro/astro/packages/integrations/sitemap �[34m@astrojs/sitemap:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/sitemap:build: �[0m �[33m@astrojs/prefetch:build: �[0m �[33m@astrojs/prefetch:build: �[0m> @astrojs/prefetch@0.2.1 build /home/runner/work/astro/astro/packages/integrations/prefetch �[33m@astrojs/prefetch:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/prefetch:build: �[0m �[36m@astrojs/tailwind:build: �[0m �[36m@astrojs/tailwind:build: �[0m> @astrojs/tailwind@3.1.1 build /home/runner/work/astro/astro/packages/integrations/tailwind �[36m@astrojs/tailwind:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/tailwind:build: �[0m �[32m@astrojs/vue:build: �[0m �[32m@astrojs/vue:build: �[0m> @astrojs/vue@2.1.1 build /home/runner/work/astro/astro/packages/integrations/vue �[32m@astrojs/vue:build: �[0m> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc �[32m@astrojs/vue:build: �[0m �[33m@astrojs/lit:build: �[0m �[33m@astrojs/lit:build: �[0m> @astrojs/lit@2.0.1 build /home/runner/work/astro/astro/packages/integrations/lit �[33m@astrojs/lit:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/lit:build: �[0m �[35m@astrojs/image:build: �[0m �[35m@astrojs/image:build: �[0m> @astrojs/image@0.0.0-middleware-20230411150403 build /home/runner/work/astro/astro/packages/integrations/image �[35m@astrojs/image:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/image:build: �[0m �[33m@astrojs/markdoc:build: �[0mcache miss, executing �[2m0ddd150d1f066f61�[0m �[34m@astrojs/alpinejs:build: �[0mcache miss, executing �[2m2a051b8256b0edc1�[0m �[36m@astrojs/svelte:build: �[0mcache miss, executing �[2m2792907334e98d4c�[0m �[35m@astrojs/vercel:build: �[0mcache miss, executing �[2m0df7bbb5c9b0a508�[0m �[33m@astrojs/deno:build: �[0mcache miss, executing �[2ma69a7c3f94b66af0�[0m �[32m@astrojs/netlify:build: �[0mcache miss, executing �[2mcc7972dabcca07c5�[0m �[33m@astrojs/markdoc:build: �[0m �[33m@astrojs/markdoc:build: �[0m> @astrojs/markdoc@0.1.1 build /home/runner/work/astro/astro/packages/integrations/markdoc �[33m@astrojs/markdoc:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/markdoc:build: �[0m �[34m@astrojs/node:build: �[0mcache miss, executing �[2m23702fdfdae03d9b�[0m �[35m@astrojs/cloudflare:build: �[0mcache miss, executing �[2mf762a8db2d542df5�[0m �[34m@astrojs/alpinejs:build: �[0m �[34m@astrojs/alpinejs:build: �[0m> @astrojs/alpinejs@0.2.1 build /home/runner/work/astro/astro/packages/integrations/alpinejs �[34m@astrojs/alpinejs:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/alpinejs:build: �[0m �[36m@astrojs/svelte:build: �[0m �[36m@astrojs/svelte:build: �[0m> @astrojs/svelte@2.1.0 build /home/runner/work/astro/astro/packages/integrations/svelte �[36m@astrojs/svelte:build: �[0m> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc �[36m@astrojs/svelte:build: �[0m �[32m@astrojs/netlify:build: �[0m �[32m@astrojs/netlify:build: �[0m> @astrojs/netlify@2.2.2 build /home/runner/work/astro/astro/packages/integrations/netlify �[32m@astrojs/netlify:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/netlify:build: �[0m �[33m@astrojs/deno:build: �[0m �[33m@astrojs/deno:build: �[0m> @astrojs/deno@4.1.0 build /home/runner/work/astro/astro/packages/integrations/deno �[33m@astrojs/deno:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/deno:build: �[0m �[35m@astrojs/vercel:build: �[0m �[35m@astrojs/vercel:build: �[0m> @astrojs/vercel@3.2.3 build /home/runner/work/astro/astro/packages/integrations/vercel �[35m@astrojs/vercel:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/vercel:build: �[0m �[34m@astrojs/node:build: �[0m �[34m@astrojs/node:build: �[0m> @astrojs/node@5.1.1 build /home/runner/work/astro/astro/packages/integrations/node �[34m@astrojs/node:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/node:build: �[0m �[35m@astrojs/cloudflare:build: �[0m �[35m@astrojs/cloudflare:build: �[0m> @astrojs/cloudflare@6.2.2 build /home/runner/work/astro/astro/packages/integrations/cloudflare �[35m@astrojs/cloudflare:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/cloudflare:build: �[0m �[32m@astrojs/solid-js:build: �[0mcache miss, executing �[2m4c701cb693aa388e�[0m �[32m@astrojs/solid-js:build: �[0m �[32m@astrojs/solid-js:build: �[0m> @astrojs/solid-js@2.1.0 build /home/runner/work/astro/astro/packages/integrations/solid �[32m@astrojs/solid-js:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/solid-js:build: �[0m �[33m@astrojs/preact:build: �[0mcache miss, executing �[2m2f05f6e9211e564f�[0m �[34m@benchmark/timer:build: �[0mcache miss, executing �[2m6d252be1892e8443�[0m �[36m@astrojs/rss:build: �[0mcache miss, executing �[2mb5bc50f887a81a9a�[0m �[33m@astrojs/preact:build: �[0m �[33m@astrojs/preact:build: �[0m> @astrojs/preact@2.1.0 build /home/runner/work/astro/astro/packages/integrations/preact �[33m@astrojs/preact:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/preact:build: �[0m �[34m@benchmark/timer:build: �[0m �[34m@benchmark/timer:build: �[0m> @benchmark/timer@0.0.0 build /home/runner/work/astro/astro/benchmark/packages/timer �[34m@benchmark/timer:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@benchmark/timer:build: �[0m �[36m@astrojs/rss:build: �[0m �[36m@astrojs/rss:build: �[0m> @astrojs/rss@2.3.2 build /home/runner/work/astro/astro/packages/astro-rss �[36m@astrojs/rss:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/rss:build: �[0m Tasks: 28 successful, 28 total Cached: 5 cached, 28 total Time: 1m8.61s Package �[36m"@astrojs/markdown-remark"�[39m must depend on the current version of �[36m"astro"�[39m: �[32m"0.0.0-middleware-20230411150403"�[39m vs �[31m"^2.2.0"�[39m 🦋 �[33mwarn�[39m �[31m===============================IMPORTANT!===============================�[39m 🦋 �[33mwarn�[39m Packages will be released under the next--middleware tag 🦋 �[33mwarn�[39m �[31m----------------------------------------------------------------------�[39m 🦋 �[36minfo�[39m npm info astro 🦋 �[36minfo�[39m npm info @astrojs/prism 🦋 �[36minfo�[39m npm info @astrojs/rss 🦋 �[36minfo�[39m npm info create-astro 🦋 �[36minfo�[39m npm info @astrojs/alpinejs 🦋 �[36minfo�[39m npm info @astrojs/cloudflare 🦋 �[36minfo�[39m npm info @astrojs/deno 🦋 �[36minfo�[39m npm info @astrojs/image 🦋 �[36minfo�[39m npm info @astrojs/lit 🦋 �[36minfo�[39m npm info @astrojs/markdoc 🦋 �[36minfo�[39m npm info @astrojs/mdx 🦋 �[36minfo�[39m npm info @astrojs/netlify 🦋 �[36minfo�[39m npm info @astrojs/node 🦋 �[36minfo�[39m npm info @astrojs/partytown 🦋 �[36minfo�[39m npm info @astrojs/preact 🦋 �[36minfo�[39m npm info @astrojs/prefetch 🦋 �[36minfo�[39m npm info @astrojs/react 🦋 �[36minfo�[39m npm info @astrojs/sitemap 🦋 �[36minfo�[39m npm info @astrojs/solid-js 🦋 �[36minfo�[39m npm info @astrojs/svelte 🦋 �[36minfo�[39m npm info @astrojs/tailwind 🦋 �[36minfo�[39m npm info @astrojs/turbolinks 🦋 �[36minfo�[39m npm info @astrojs/vercel 🦋 �[36minfo�[39m npm info @astrojs/vue 🦋 �[36minfo�[39m npm info @astrojs/markdown-component 🦋 �[36minfo�[39m npm info @astrojs/markdown-remark 🦋 �[36minfo�[39m npm info @astrojs/telemetry 🦋 �[36minfo�[39m npm info @astrojs/webapi 🦋 �[36minfo�[39m astro is being published because our local version (0.0.0-middleware-20230411150403) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/prism is not being published because version 2.1.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/rss is not being published because version 2.3.2 is already published on npm 🦋 �[33mwarn�[39m create-astro is not being published because version 3.1.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/alpinejs is not being published because version 0.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/cloudflare is not being published because version 6.2.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/deno is not being published because version 4.1.0 is already published on npm 🦋 �[36minfo�[39m @astrojs/image is being published because our local version (0.0.0-middleware-20230411150403) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/lit is not being published because version 2.0.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdoc is not being published because version 0.1.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/mdx is not being published because version 0.18.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/netlify is not being published because version 2.2.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/node is not being published because version 5.1.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/partytown is not being published because version 1.2.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/preact is not being published because version 2.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/prefetch is not being published because version 0.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/react is not being published because version 2.1.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/sitemap is not being published because version 1.2.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/solid-js is not being published because version 2.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/svelte is not being published because version 2.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/tailwind is not being published because version 3.1.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/turbolinks is not being published because version 0.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/vercel is not being published because version 3.2.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/vue is not being published because version 2.1.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdown-component is not being published because version 1.0.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdown-remark is not being published because version 2.1.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/telemetry is not being published because version 2.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/webapi is not being published because version 2.1.0 is already published on npm 🦋 �[36minfo�[39m Publishing �[36m"astro"�[39m at �[32m"0.0.0-middleware-20230411150403"�[39m 🦋 �[36minfo�[39m Publishing �[36m"@astrojs/image"�[39m at �[32m"0.0.0-middleware-20230411150403"�[39m 🦋 �[32msuccess�[39m packages published successfully: 🦋 astro@0.0.0-middleware-20230411150403 🦋 @astrojs/image@0.0.0-middleware-20230411150403 🦋 Creating git tags... 🦋 New tag: astro@0.0.0-middleware-20230411150403 🦋 New tag: @astrojs/image@0.0.0-middleware-20230411150403

@ematipico
Copy link
Member Author

!preview middleware

@github-actions
Copy link
Contributor

 > root@0.0.0 release /home/runner/work/astro/astro > pnpm run build && changeset publish "--tag" "next--middleware" > root@0.0.0 build /home/runner/work/astro/astro > turbo run build --output-logs=new-only --no-deps --filter=astro --filter=create-astro --filter="@astrojs/*" --filter="@benchmark/*" �[2m• Packages in scope: @astrojs/alpinejs, @astrojs/cloudflare, @astrojs/deno, @astrojs/image, @astrojs/lit, @astrojs/markdoc, @astrojs/markdown-component, @astrojs/markdown-remark, @astrojs/mdx, @astrojs/netlify, @astrojs/node, @astrojs/partytown, @astrojs/preact, @astrojs/prefetch, @astrojs/prism, @astrojs/react, @astrojs/rss, @astrojs/sitemap, @astrojs/solid-js, @astrojs/svelte, @astrojs/tailwind, @astrojs/telemetry, @astrojs/turbolinks, @astrojs/vercel, @astrojs/vue, @astrojs/webapi, @benchmark/timer, astro, create-astro�[0m �[2m• Running�[0m �[2m�[1mbuild�[0m�[0m �[2min 29 packages�[0m �[2m• Remote computation caching enabled (experimental)�[0m �[35m@astrojs/webapi:build: �[0mcache hit, suppressing output �[2md01b8a1013c6b024�[0m �[33mcreate-astro:build: �[0mcache hit, suppressing output �[2me2f1bcfe57688bf1�[0m �[34m@astrojs/prism:build: �[0mcache hit, suppressing output �[2mafbc1078ac750b55�[0m �[36m@astrojs/telemetry:build: �[0mcache hit, suppressing output �[2m09001ff73966393e�[0m �[35m@astrojs/markdown-remark:build: �[0mcache hit, suppressing output �[2m955e38d0eabc3da4�[0m �[32mastro:build: �[0mcache miss, executing �[2md21460b4ba614f8e�[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> astro@0.0.0-middleware-20230412124602 build /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> pnpm run prebuild && astro-scripts build "src/**/*.{ts,js}" && tsc && pnpm run postbuild �[32mastro:build: �[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> astro@0.0.0-middleware-20230412124602 prebuild /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> astro-scripts prebuild --to-string "src/runtime/server/astro-island.ts" "src/runtime/client/{idle,load,media,only,visible}.ts" �[32mastro:build: �[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> astro@0.0.0-middleware-20230412124602 postbuild /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> astro-scripts copy "src/**/*.astro" && astro-scripts copy "src/**/*.wasm" �[32mastro:build: �[0m �[36m@astrojs/react:build: �[0mcache miss, executing �[2m06bc33b55799e57f�[0m �[33m@astrojs/vue:build: �[0mcache miss, executing �[2mc2191126761af2d1�[0m �[35m@astrojs/preact:build: �[0mcache miss, executing �[2m3331fd7e7975c18c�[0m �[35m@astrojs/vercel:build: �[0mcache miss, executing �[2m954117edf9e910f8�[0m �[33m@astrojs/svelte:build: �[0mcache miss, executing �[2me66a79e1dfc438bd�[0m �[34m@astrojs/mdx:build: �[0mcache miss, executing �[2m6073563eabd47c7d�[0m �[34m@astrojs/lit:build: �[0mcache miss, executing �[2m9dd85d738857251b�[0m �[32m@astrojs/deno:build: �[0mcache miss, executing �[2m4c4b05208b34bdd2�[0m �[32m@astrojs/sitemap:build: �[0mcache miss, executing �[2m80483a8e77508345�[0m �[36m@astrojs/prefetch:build: �[0mcache miss, executing �[2m8d066266176d8c36�[0m �[36m@astrojs/react:build: �[0m �[36m@astrojs/react:build: �[0m> @astrojs/react@2.1.1 build /home/runner/work/astro/astro/packages/integrations/react �[36m@astrojs/react:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/react:build: �[0m �[33m@astrojs/vue:build: �[0m �[33m@astrojs/vue:build: �[0m> @astrojs/vue@2.1.1 build /home/runner/work/astro/astro/packages/integrations/vue �[33m@astrojs/vue:build: �[0m> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc �[33m@astrojs/vue:build: �[0m �[34m@astrojs/lit:build: �[0m �[34m@astrojs/lit:build: �[0m> @astrojs/lit@2.0.1 build /home/runner/work/astro/astro/packages/integrations/lit �[34m@astrojs/lit:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/lit:build: �[0m �[35m@astrojs/preact:build: �[0m �[35m@astrojs/preact:build: �[0m> @astrojs/preact@2.1.0 build /home/runner/work/astro/astro/packages/integrations/preact �[35m@astrojs/preact:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/preact:build: �[0m �[34m@astrojs/mdx:build: �[0m �[34m@astrojs/mdx:build: �[0m> @astrojs/mdx@0.18.3 build /home/runner/work/astro/astro/packages/integrations/mdx �[34m@astrojs/mdx:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/mdx:build: �[0m �[35m@astrojs/vercel:build: �[0m �[35m@astrojs/vercel:build: �[0m> @astrojs/vercel@3.2.3 build /home/runner/work/astro/astro/packages/integrations/vercel �[35m@astrojs/vercel:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/vercel:build: �[0m �[33m@astrojs/svelte:build: �[0m �[33m@astrojs/svelte:build: �[0m> @astrojs/svelte@2.1.0 build /home/runner/work/astro/astro/packages/integrations/svelte �[33m@astrojs/svelte:build: �[0m> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc �[33m@astrojs/svelte:build: �[0m �[32m@astrojs/deno:build: �[0m �[32m@astrojs/deno:build: �[0m> @astrojs/deno@4.1.0 build /home/runner/work/astro/astro/packages/integrations/deno �[32m@astrojs/deno:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/deno:build: �[0m �[32m@astrojs/sitemap:build: �[0m �[32m@astrojs/sitemap:build: �[0m> @astrojs/sitemap@1.2.2 build /home/runner/work/astro/astro/packages/integrations/sitemap �[32m@astrojs/sitemap:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/sitemap:build: �[0m �[36m@astrojs/prefetch:build: �[0m �[36m@astrojs/prefetch:build: �[0m> @astrojs/prefetch@0.2.1 build /home/runner/work/astro/astro/packages/integrations/prefetch �[36m@astrojs/prefetch:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/prefetch:build: �[0m �[34m@astrojs/netlify:build: �[0mcache miss, executing �[2mbb346d61ec54f90c�[0m �[33m@astrojs/markdoc:build: �[0mcache miss, executing �[2m559ed016c4b0b39e�[0m �[36m@astrojs/node:build: �[0mcache miss, executing �[2mbcaf29c462b468d5�[0m �[32m@astrojs/solid-js:build: �[0mcache miss, executing �[2m990230dcbf32459a�[0m �[35m@astrojs/alpinejs:build: �[0mcache miss, executing �[2md4d5d245070fc425�[0m �[33m@astrojs/rss:build: �[0mcache miss, executing �[2m448b98db34a91d1d�[0m �[34m@astrojs/turbolinks:build: �[0mcache miss, executing �[2m4927e757d5bdaf39�[0m �[36m@astrojs/partytown:build: �[0mcache miss, executing �[2mdbad493a18ddd3cc�[0m �[35m@astrojs/image:build: �[0mcache miss, executing �[2m249321b54eadc7fa�[0m �[33m@astrojs/markdoc:build: �[0m �[33m@astrojs/markdoc:build: �[0m> @astrojs/markdoc@0.1.1 build /home/runner/work/astro/astro/packages/integrations/markdoc �[33m@astrojs/markdoc:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/markdoc:build: �[0m �[34m@astrojs/netlify:build: �[0m �[34m@astrojs/netlify:build: �[0m> @astrojs/netlify@2.2.2 build /home/runner/work/astro/astro/packages/integrations/netlify �[34m@astrojs/netlify:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/netlify:build: �[0m �[35m@astrojs/alpinejs:build: �[0m �[35m@astrojs/alpinejs:build: �[0m> @astrojs/alpinejs@0.2.1 build /home/runner/work/astro/astro/packages/integrations/alpinejs �[35m@astrojs/alpinejs:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/alpinejs:build: �[0m �[36m@astrojs/node:build: �[0m �[36m@astrojs/node:build: �[0m> @astrojs/node@5.1.1 build /home/runner/work/astro/astro/packages/integrations/node �[36m@astrojs/node:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/node:build: �[0m �[32m@astrojs/solid-js:build: �[0m �[32m@astrojs/solid-js:build: �[0m> @astrojs/solid-js@2.1.0 build /home/runner/work/astro/astro/packages/integrations/solid �[32m@astrojs/solid-js:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/solid-js:build: �[0m �[33m@astrojs/rss:build: �[0m �[33m@astrojs/rss:build: �[0m> @astrojs/rss@2.3.2 build /home/runner/work/astro/astro/packages/astro-rss �[33m@astrojs/rss:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/rss:build: �[0m �[36m@astrojs/partytown:build: �[0m �[36m@astrojs/partytown:build: �[0m> @astrojs/partytown@1.2.0 build /home/runner/work/astro/astro/packages/integrations/partytown �[36m@astrojs/partytown:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/partytown:build: �[0m �[35m@astrojs/image:build: �[0m �[35m@astrojs/image:build: �[0m> @astrojs/image@0.0.0-middleware-20230412124602 build /home/runner/work/astro/astro/packages/integrations/image �[35m@astrojs/image:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/image:build: �[0m �[34m@astrojs/turbolinks:build: �[0m �[34m@astrojs/turbolinks:build: �[0m> @astrojs/turbolinks@0.2.1 build /home/runner/work/astro/astro/packages/integrations/turbolinks �[34m@astrojs/turbolinks:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/turbolinks:build: �[0m �[32m@astrojs/tailwind:build: �[0mcache miss, executing �[2md6455c50a768dc70�[0m �[32m@astrojs/tailwind:build: �[0m �[32m@astrojs/tailwind:build: �[0m> @astrojs/tailwind@3.1.1 build /home/runner/work/astro/astro/packages/integrations/tailwind �[32m@astrojs/tailwind:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/tailwind:build: �[0m �[33m@benchmark/timer:build: �[0mcache miss, executing �[2m0535af81c3fe59a4�[0m �[36m@astrojs/cloudflare:build: �[0mcache miss, executing �[2m56a8ef3e38cb166b�[0m �[33m@benchmark/timer:build: �[0m �[33m@benchmark/timer:build: �[0m> @benchmark/timer@0.0.0 build /home/runner/work/astro/astro/benchmark/packages/timer �[33m@benchmark/timer:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@benchmark/timer:build: �[0m �[36m@astrojs/cloudflare:build: �[0m �[36m@astrojs/cloudflare:build: �[0m> @astrojs/cloudflare@6.2.2 build /home/runner/work/astro/astro/packages/integrations/cloudflare �[36m@astrojs/cloudflare:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/cloudflare:build: �[0m Tasks: 28 successful, 28 total Cached: 5 cached, 28 total Time: 1m32.828s Package �[36m"@astrojs/markdown-remark"�[39m must depend on the current version of �[36m"astro"�[39m: �[32m"0.0.0-middleware-20230412124602"�[39m vs �[31m"^2.2.0"�[39m 🦋 �[33mwarn�[39m �[31m===============================IMPORTANT!===============================�[39m 🦋 �[33mwarn�[39m Packages will be released under the next--middleware tag 🦋 �[33mwarn�[39m �[31m----------------------------------------------------------------------�[39m 🦋 �[36minfo�[39m npm info astro 🦋 �[36minfo�[39m npm info @astrojs/prism 🦋 �[36minfo�[39m npm info @astrojs/rss 🦋 �[36minfo�[39m npm info create-astro 🦋 �[36minfo�[39m npm info @astrojs/alpinejs 🦋 �[36minfo�[39m npm info @astrojs/cloudflare 🦋 �[36minfo�[39m npm info @astrojs/deno 🦋 �[36minfo�[39m npm info @astrojs/image 🦋 �[36minfo�[39m npm info @astrojs/lit 🦋 �[36minfo�[39m npm info @astrojs/markdoc 🦋 �[36minfo�[39m npm info @astrojs/mdx 🦋 �[36minfo�[39m npm info @astrojs/netlify 🦋 �[36minfo�[39m npm info @astrojs/node 🦋 �[36minfo�[39m npm info @astrojs/partytown 🦋 �[36minfo�[39m npm info @astrojs/preact 🦋 �[36minfo�[39m npm info @astrojs/prefetch 🦋 �[36minfo�[39m npm info @astrojs/react 🦋 �[36minfo�[39m npm info @astrojs/sitemap 🦋 �[36minfo�[39m npm info @astrojs/solid-js 🦋 �[36minfo�[39m npm info @astrojs/svelte 🦋 �[36minfo�[39m npm info @astrojs/tailwind 🦋 �[36minfo�[39m npm info @astrojs/turbolinks 🦋 �[36minfo�[39m npm info @astrojs/vercel 🦋 �[36minfo�[39m npm info @astrojs/vue 🦋 �[36minfo�[39m npm info @astrojs/markdown-component 🦋 �[36minfo�[39m npm info @astrojs/markdown-remark 🦋 �[36minfo�[39m npm info @astrojs/telemetry 🦋 �[36minfo�[39m npm info @astrojs/webapi 🦋 �[36minfo�[39m astro is being published because our local version (0.0.0-middleware-20230412124602) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/prism is not being published because version 2.1.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/rss is not being published because version 2.3.2 is already published on npm 🦋 �[33mwarn�[39m create-astro is not being published because version 3.1.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/alpinejs is not being published because version 0.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/cloudflare is not being published because version 6.2.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/deno is not being published because version 4.1.0 is already published on npm 🦋 �[36minfo�[39m @astrojs/image is being published because our local version (0.0.0-middleware-20230412124602) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/lit is not being published because version 2.0.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdoc is not being published because version 0.1.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/mdx is not being published because version 0.18.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/netlify is not being published because version 2.2.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/node is not being published because version 5.1.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/partytown is not being published because version 1.2.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/preact is not being published because version 2.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/prefetch is not being published because version 0.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/react is not being published because version 2.1.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/sitemap is not being published because version 1.2.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/solid-js is not being published because version 2.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/svelte is not being published because version 2.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/tailwind is not being published because version 3.1.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/turbolinks is not being published because version 0.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/vercel is not being published because version 3.2.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/vue is not being published because version 2.1.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdown-component is not being published because version 1.0.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdown-remark is not being published because version 2.1.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/telemetry is not being published because version 2.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/webapi is not being published because version 2.1.0 is already published on npm 🦋 �[36minfo�[39m Publishing �[36m"astro"�[39m at �[32m"0.0.0-middleware-20230412124602"�[39m 🦋 �[36minfo�[39m Publishing �[36m"@astrojs/image"�[39m at �[32m"0.0.0-middleware-20230412124602"�[39m 🦋 �[32msuccess�[39m packages published successfully: 🦋 astro@0.0.0-middleware-20230412124602 🦋 @astrojs/image@0.0.0-middleware-20230412124602 🦋 Creating git tags... 🦋 New tag: astro@0.0.0-middleware-20230412124602 🦋 New tag: @astrojs/image@0.0.0-middleware-20230412124602

@ematipico ematipico force-pushed the feat/middleware-api branch 2 times, most recently from fb79199 to a724a92 Compare April 13, 2023 13:45
@ematipico ematipico requested review from sarah11918 and bluwy May 3, 2023 12:51
@ematipico
Copy link
Member Author

@sarah11918 could you double-check again if the docs are correct, please?

packages/astro/package.json Outdated Show resolved Hide resolved
packages/astro/src/core/middleware/sequence.ts Outdated Show resolved Hide resolved
packages/astro/src/core/build/static-build.ts Outdated Show resolved Hide resolved
packages/astro/src/core/errors/errors-data.ts Outdated Show resolved Hide resolved
@ematipico ematipico requested a review from bluwy May 3, 2023 14:15
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
@ematipico ematipico requested a review from sarah11918 May 3, 2023 14:52
Comment on lines 676 to 692
* Thrown in development mode, when `locals` are overridden with something that is not an object
*
* For example:
* ```ts
* import {defineMiddleware} from "astro/middleware";
* export const onRequest = defineMiddleware((context, next) => {
* context.locals = 1541;
* return next();
* });
* ```
*/
LocalsNotAnObject: {
title: 'Value assigned to `locals` is not accepted.',
code: 3033,
message: `The \`locals\` can only be assigned to an object. Other values like numbers, strings, etc. are not accepted.`,
hint: 'If you tried to remove some information from the `locals` object, try to use `delete` or set the property to `undefined`.',
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Thrown in development mode, when `locals` are overridden with something that is not an object
*
* For example:
* ```ts
* import {defineMiddleware} from "astro/middleware";
* export const onRequest = defineMiddleware((context, next) => {
* context.locals = 1541;
* return next();
* });
* ```
*/
LocalsNotAnObject: {
title: 'Value assigned to `locals` is not accepted.',
code: 3033,
message: `The \`locals\` can only be assigned to an object. Other values like numbers, strings, etc. are not accepted.`,
hint: 'If you tried to remove some information from the `locals` object, try to use `delete` or set the property to `undefined`.',
},
* Thrown in development mode when `locals` is overwritten with something that is not an object
*
* For example:
* ```ts
* import {defineMiddleware} from "astro/middleware";
* export const onRequest = defineMiddleware((context, next) => {
* context.locals = 1541;
* return next();
* });
* ```
*/
LocalsNotAnObject: {
title: 'Value assigned to `locals` is not accepted',
code: 3033,
message: '`\locals\` can only be assigned to an object. Other values like numbers, strings, etc. are not accepted.',
hint: 'If you tried to remove some information from the `locals` object, try to use `delete` or set the property to `undefined`.',
},

Lots of things I'm unsure of! 😅 So these are just things I'll point out that might need a closer look to make sure it's what you mean/want:

  • I might consider locals singular, even though the word is plural? If it's one locals object, then I think singular fits? So I'd say "locals is..."
  • locals could be "overriden" or could be "overwritten" depending on what's actually happening. I just want to make sure that "override" is what you're going for, and you didn't actually prefer or mean "overWRITE". (I think of override in the sense of controls, or what's going to take precedence. But, I would probably think "overwrite" if the object contents are in fact being changed/rewritten.)
  • I'm not sure about the backtick symbols being used in the message above. I changed the outer ones to single quotes, but I'm not sure exactly what you want within code ticks around locals. So just check on that and make it wahtever it should be. 😄
  • the other titles did not have periods at the end, so I removed this one, but whatever you want for titles is fine. Just pick a style!

Copy link
Member Author

@ematipico ematipico May 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might consider locals singular, even though the word is plural? If it's one locals object, then I think singular fits? So I'd say "locals is..."

Yes, I would consider locals like a name, other than something we quantify.

locals could be "overriden" or could be "overwritten" depending on what's actually happening. I just want to make sure that "override" is what you're going for, and you didn't actually prefer or mean "overWRITE". (I think of override in the sense of controls, or what's going to take precedence. But, I would probably think "overwrite" if the object contents are in fact being changed/rewritten.)

I mean "override". The user can overwrite the contents of locals as they want. The user is free. But they can't do something like locals = "new string" (override). That is forbidden and will throw this very error.

ematipico and others added 2 commits May 3, 2023 16:03
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
title: '`Astro.locals` are not serializable.',
code: 3034,
message: (href: string) => {
return `The information stored in \`Astro.locals\` are not serializable when visiting "${href}" path.\nMake sure you store only data that are serializable.`;
Copy link
Member

@sarah11918 sarah11918 May 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return `The information stored in \`Astro.locals\` are not serializable when visiting "${href}" path.\nMake sure you store only data that are serializable.`;
return `The information stored in \`Astro.locals\` is not serializable when visiting "${href}" path.\nMake sure you store only serializable data.`;

Information is singular, and I'm not sure about "when visiting... path" If that renders to e.g. "when visiting /about/ path" then that sentence wouldn't read very well in English.

What exactly is the signifiance of including the part about the path? Would the warning work without it, or is the message depending on knowing which path is causing the error? In that case, instead of "when visiting the path" what is the actual problem? The route can't be created? The path doesn't exist?

The information stored in Astro.locals for the path "${href} is not serializable. Make sure...

Would something closer to that be possible?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly is the signifiance of including the part about the path?

The logic of the middleware can change based on the page the user is visiting. So having a path can help the developer understand the issue.

The information stored in Astro.locals for the path "${href} is not serializable. Make sure...

Would something closer to that be possible?

That's perfect!

@ematipico ematipico merged commit 831b67c into main May 3, 2023
@ematipico ematipico deleted the feat/middleware-api branch May 3, 2023 16:40
@astrobot-houston astrobot-houston mentioned this pull request May 3, 2023
@JLarky
Copy link
Contributor

JLarky commented May 11, 2023

@ematipico you have a typo in description MiddlewareHanlder instead of MiddlewareHandler (that's why we use TS BTW 😅)

also it looks like MiddlewareHandler requires generic type passed to it

ArmandPhilippot added a commit to ArmandPhilippot/astro-docs that referenced this pull request Jul 29, 2024
* See withastro/astro#4986 for `site`, `generator`, `url`, `clientAddress`, `props` and `redirect`
* See withastro/astro#6721 for `locals`
* See withastro/astro#9021 for `preferredLocale` and `preferredLocaleList`
* See withastro/astro#9101 for `currentLocale`
ArmandPhilippot added a commit to ArmandPhilippot/astro-docs that referenced this pull request Jul 29, 2024
* See withastro/astro#4986 for `site`, `generator`, `url`, `clientAddress`, `props` and `redirect`
* See withastro/astro#6721 for `locals`
* See withastro/astro#9021 for `preferredLocale` and `preferredLocaleList`
* See withastro/astro#9101 for `currentLocale`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) pkg: example Related to an example package (scope) pkg: integration Related to any renderer integration (scope) semver: minor Change triggers a `minor` release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants