Move benchmark package and update changeset config (#6433)

This commit is contained in:
Bjorn Lu 2023-03-07 10:52:47 +08:00 committed by GitHub
parent af05a4fa46
commit 00a0af7ed4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 35 additions and 48 deletions

View file

@ -6,7 +6,7 @@
"access": "public", "access": "public",
"baseBranch": "main", "baseBranch": "main",
"updateInternalDependencies": "patch", "updateInternalDependencies": "patch",
"ignore": ["@example/*", "@test/*"], "ignore": ["@example/*", "@test/*", "@benchmark/*", "astro-scripts", "astro-benchmark"],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": { "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true "onlyUpdatePeerDependentsWhenOutOfRange": true
} }

View file

@ -103,7 +103,7 @@ function printResult(result) {
} }
/** /**
* Simple fetch utility to get the render time sent by `@astrojs/timer` in plain text * Simple fetch utility to get the render time sent by `@benchmark/timer` in plain text
* @param {string} url * @param {string} url
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */

View file

@ -74,7 +74,7 @@ export async function run(projectDir) {
new URL('./astro.config.js', projectDir), new URL('./astro.config.js', projectDir),
`\ `\
import { defineConfig } from 'astro/config'; import { defineConfig } from 'astro/config';
import timer from '@astrojs/timer'; import timer from '@benchmark/timer';
import mdx from '@astrojs/mdx'; import mdx from '@astrojs/mdx';
export default defineConfig({ export default defineConfig({

View file

@ -9,7 +9,7 @@
"dependencies": { "dependencies": {
"@astrojs/mdx": "workspace:*", "@astrojs/mdx": "workspace:*",
"@astrojs/node": "workspace:*", "@astrojs/node": "workspace:*",
"@astrojs/timer": "workspace:*", "@benchmark/timer": "workspace:*",
"astro": "workspace:*", "astro": "workspace:*",
"autocannon": "^7.10.0", "autocannon": "^7.10.0",
"execa": "^6.1.0", "execa": "^6.1.0",

View file

@ -1,3 +1,3 @@
# @astrojs/timer # @benchmark/timer
Like `@astrojs/node`, but returns the rendered time in milliseconds for the page instead of the page content itself. This is used for internal benchmarks only. Like `@astrojs/node`, but returns the rendered time in milliseconds for the page instead of the page content itself. This is used for internal benchmarks only.

View file

@ -1,22 +1,16 @@
{ {
"name": "@astrojs/timer", "name": "@benchmark/timer",
"description": "Preview server for benchmark", "description": "Preview server for benchmark",
"private": true, "private": true,
"version": "0.0.1", "version": "0.0.0",
"type": "module", "type": "module",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
"author": "withastro", "author": "withastro",
"license": "MIT", "license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/withastro/astro.git",
"directory": "packages/integrations/timer"
},
"keywords": [ "keywords": [
"withastro", "withastro",
"astro-adapter" "astro-adapter"
], ],
"bugs": "https://github.com/withastro/astro/issues",
"exports": { "exports": {
".": "./dist/index.js", ".": "./dist/index.js",
"./server.js": "./dist/server.js", "./server.js": "./dist/server.js",

View file

@ -2,22 +2,22 @@ import type { AstroAdapter, AstroIntegration } from 'astro';
export function getAdapter(): AstroAdapter { export function getAdapter(): AstroAdapter {
return { return {
name: '@astrojs/timer', name: '@benchmark/timer',
serverEntrypoint: '@astrojs/timer/server.js', serverEntrypoint: '@benchmark/timer/server.js',
previewEntrypoint: '@astrojs/timer/preview.js', previewEntrypoint: '@benchmark/timer/preview.js',
exports: ['handler'], exports: ['handler'],
}; };
} }
export default function createIntegration(): AstroIntegration { export default function createIntegration(): AstroIntegration {
return { return {
name: '@astrojs/timer', name: '@benchmark/timer',
hooks: { hooks: {
'astro:config:setup': ({ updateConfig }) => { 'astro:config:setup': ({ updateConfig }) => {
updateConfig({ updateConfig({
vite: { vite: {
ssr: { ssr: {
noExternal: ['@astrojs/timer'], noExternal: ['@benchmark/timer'],
}, },
}, },
}); });
@ -26,7 +26,8 @@ export default function createIntegration(): AstroIntegration {
setAdapter(getAdapter()); setAdapter(getAdapter());
if (config.output === 'static') { if (config.output === 'static') {
console.warn(`[@astrojs/timer] \`output: "server"\` is required to use this adapter.`); // eslint-disable-next-line no-console
console.warn(`[@benchmark/timer] \`output: "server"\` is required to use this adapter.`);
} }
}, },
}, },

View file

@ -8,10 +8,10 @@
}, },
"scripts": { "scripts": {
"release": "pnpm run build && changeset publish", "release": "pnpm run build && changeset publish",
"build": "turbo run build --output-logs=new-only --no-deps --filter=astro --filter=create-astro --filter=\"@astrojs/*\"", "build": "turbo run build --output-logs=new-only --no-deps --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"",
"build:ci": "turbo run build:ci --output-logs=new-only --no-deps --filter=astro --filter=create-astro --filter=\"@astrojs/*\"", "build:ci": "turbo run build:ci --output-logs=new-only --no-deps --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"",
"build:examples": "turbo run build --filter=\"@example/*\"", "build:examples": "turbo run build --filter=\"@example/*\"",
"dev": "turbo run dev --no-deps --no-cache --parallel --filter=astro --filter=create-astro --filter=\"@astrojs/*\"", "dev": "turbo run dev --no-deps --no-cache --parallel --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"",
"format": "pnpm run format:code", "format": "pnpm run format:code",
"format:ci": "pnpm run format:imports && pnpm run format:code", "format:ci": "pnpm run format:imports && pnpm run format:code",
"format:code": "prettier -w . --cache --plugin-search-dir=.", "format:code": "prettier -w . --cache --plugin-search-dir=.",

View file

@ -1,9 +0,0 @@
# @astrojs/timer
## 0.0.1
### Patch Changes
- Updated dependencies [[`0abd1d3e4`](https://github.com/withastro/astro/commit/0abd1d3e42cf7bf5efb8c41f37e011b933fb0629), [`cd8469947`](https://github.com/withastro/astro/commit/cd8469947bb63b4233f3459614c5210feac1da96), [`e0844852d`](https://github.com/withastro/astro/commit/e0844852d31d0f5680f2710aaa84e3e808aeb88d)]:
- @astrojs/webapi@2.0.3
- astro@2.0.18

View file

@ -67,7 +67,7 @@ importers:
specifiers: specifiers:
'@astrojs/mdx': workspace:* '@astrojs/mdx': workspace:*
'@astrojs/node': workspace:* '@astrojs/node': workspace:*
'@astrojs/timer': workspace:* '@benchmark/timer': workspace:*
astro: workspace:* astro: workspace:*
autocannon: ^7.10.0 autocannon: ^7.10.0
execa: ^6.1.0 execa: ^6.1.0
@ -78,7 +78,7 @@ importers:
dependencies: dependencies:
'@astrojs/mdx': link:../packages/integrations/mdx '@astrojs/mdx': link:../packages/integrations/mdx
'@astrojs/node': link:../packages/integrations/node '@astrojs/node': link:../packages/integrations/node
'@astrojs/timer': link:../packages/integrations/timer '@benchmark/timer': link:packages/timer
astro: link:../packages/astro astro: link:../packages/astro
autocannon: 7.10.0 autocannon: 7.10.0
execa: 6.1.0 execa: 6.1.0
@ -87,6 +87,21 @@ importers:
port-authority: 2.0.1 port-authority: 2.0.1
pretty-bytes: 6.1.0 pretty-bytes: 6.1.0
benchmark/packages/timer:
specifiers:
'@astrojs/webapi': workspace:*
'@types/server-destroy': ^1.0.1
astro: workspace:*
astro-scripts: workspace:*
server-destroy: ^1.0.1
dependencies:
'@astrojs/webapi': link:../../../packages/webapi
server-destroy: 1.0.1
devDependencies:
'@types/server-destroy': 1.0.1
astro: link:../../../packages/astro
astro-scripts: link:../../../scripts
examples/basics: examples/basics:
specifiers: specifiers:
astro: ^2.0.18 astro: ^2.0.18
@ -3379,21 +3394,6 @@ importers:
tailwindcss: 3.2.6_postcss@8.4.21 tailwindcss: 3.2.6_postcss@8.4.21
vite: 4.1.2 vite: 4.1.2
packages/integrations/timer:
specifiers:
'@astrojs/webapi': workspace:*
'@types/server-destroy': ^1.0.1
astro: workspace:*
astro-scripts: workspace:*
server-destroy: ^1.0.1
dependencies:
'@astrojs/webapi': link:../../webapi
server-destroy: 1.0.1
devDependencies:
'@types/server-destroy': 1.0.1
astro: link:../../astro
astro-scripts: link:../../../scripts
packages/integrations/turbolinks: packages/integrations/turbolinks:
specifiers: specifiers:
astro: workspace:* astro: workspace:*

View file

@ -4,3 +4,4 @@ packages:
- 'smoke/**/*' - 'smoke/**/*'
- 'scripts' - 'scripts'
- 'benchmark' - 'benchmark'
- 'benchmark/packages/*'