Skip to content

Commit 00a0af7

Browse files
authored
Move benchmark package and update changeset config (#6433)
1 parent af05a4f commit 00a0af7

File tree

14 files changed

+35
-48
lines changed

14 files changed

+35
-48
lines changed

.changeset/config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"access": "public",
77
"baseBranch": "main",
88
"updateInternalDependencies": "patch",
9-
"ignore": ["@example/*", "@test/*"],
9+
"ignore": ["@example/*", "@test/*", "@benchmark/*", "astro-scripts", "astro-benchmark"],
1010
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
1111
"onlyUpdatePeerDependentsWhenOutOfRange": true
1212
}

benchmark/bench/render.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function printResult(result) {
103103
}
104104

105105
/**
106-
* Simple fetch utility to get the render time sent by `@astrojs/timer` in plain text
106+
* Simple fetch utility to get the render time sent by `@benchmark/timer` in plain text
107107
* @param {string} url
108108
* @returns {Promise<number>}
109109
*/

benchmark/make-project/render-default.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export async function run(projectDir) {
7474
new URL('./astro.config.js', projectDir),
7575
`\
7676
import { defineConfig } from 'astro/config';
77-
import timer from '@astrojs/timer';
77+
import timer from '@benchmark/timer';
7878
import mdx from '@astrojs/mdx';
7979
8080
export default defineConfig({

benchmark/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"dependencies": {
1010
"@astrojs/mdx": "workspace:*",
1111
"@astrojs/node": "workspace:*",
12-
"@astrojs/timer": "workspace:*",
12+
"@benchmark/timer": "workspace:*",
1313
"astro": "workspace:*",
1414
"autocannon": "^7.10.0",
1515
"execa": "^6.1.0",
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# @astrojs/timer
1+
# @benchmark/timer
22

33
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.

packages/integrations/timer/package.json renamed to benchmark/packages/timer/package.json

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
{
2-
"name": "@astrojs/timer",
2+
"name": "@benchmark/timer",
33
"description": "Preview server for benchmark",
44
"private": true,
5-
"version": "0.0.1",
5+
"version": "0.0.0",
66
"type": "module",
77
"types": "./dist/index.d.ts",
88
"author": "withastro",
99
"license": "MIT",
10-
"repository": {
11-
"type": "git",
12-
"url": "https://github.com/withastro/astro.git",
13-
"directory": "packages/integrations/timer"
14-
},
1510
"keywords": [
1611
"withastro",
1712
"astro-adapter"
1813
],
19-
"bugs": "https://github.com/withastro/astro/issues",
2014
"exports": {
2115
".": "./dist/index.js",
2216
"./server.js": "./dist/server.js",

packages/integrations/timer/src/index.ts renamed to benchmark/packages/timer/src/index.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ import type { AstroAdapter, AstroIntegration } from 'astro';
22

33
export function getAdapter(): AstroAdapter {
44
return {
5-
name: '@astrojs/timer',
6-
serverEntrypoint: '@astrojs/timer/server.js',
7-
previewEntrypoint: '@astrojs/timer/preview.js',
5+
name: '@benchmark/timer',
6+
serverEntrypoint: '@benchmark/timer/server.js',
7+
previewEntrypoint: '@benchmark/timer/preview.js',
88
exports: ['handler'],
99
};
1010
}
1111

1212
export default function createIntegration(): AstroIntegration {
1313
return {
14-
name: '@astrojs/timer',
14+
name: '@benchmark/timer',
1515
hooks: {
1616
'astro:config:setup': ({ updateConfig }) => {
1717
updateConfig({
1818
vite: {
1919
ssr: {
20-
noExternal: ['@astrojs/timer'],
20+
noExternal: ['@benchmark/timer'],
2121
},
2222
},
2323
});
@@ -26,7 +26,8 @@ export default function createIntegration(): AstroIntegration {
2626
setAdapter(getAdapter());
2727

2828
if (config.output === 'static') {
29-
console.warn(`[@astrojs/timer] \`output: "server"\` is required to use this adapter.`);
29+
// eslint-disable-next-line no-console
30+
console.warn(`[@benchmark/timer] \`output: "server"\` is required to use this adapter.`);
3031
}
3132
},
3233
},

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
},
99
"scripts": {
1010
"release": "pnpm run build && changeset publish",
11-
"build": "turbo run build --output-logs=new-only --no-deps --filter=astro --filter=create-astro --filter=\"@astrojs/*\"",
12-
"build:ci": "turbo run build:ci --output-logs=new-only --no-deps --filter=astro --filter=create-astro --filter=\"@astrojs/*\"",
11+
"build": "turbo run build --output-logs=new-only --no-deps --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"",
12+
"build:ci": "turbo run build:ci --output-logs=new-only --no-deps --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"",
1313
"build:examples": "turbo run build --filter=\"@example/*\"",
14-
"dev": "turbo run dev --no-deps --no-cache --parallel --filter=astro --filter=create-astro --filter=\"@astrojs/*\"",
14+
"dev": "turbo run dev --no-deps --no-cache --parallel --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"",
1515
"format": "pnpm run format:code",
1616
"format:ci": "pnpm run format:imports && pnpm run format:code",
1717
"format:code": "prettier -w . --cache --plugin-search-dir=.",

packages/integrations/timer/CHANGELOG.md

-9
This file was deleted.

pnpm-lock.yaml

+17-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ packages:
44
- 'smoke/**/*'
55
- 'scripts'
66
- 'benchmark'
7+
- 'benchmark/packages/*'

0 commit comments

Comments
 (0)