Skip to content

Commit

Permalink
Move benchmark package and update changeset config (withastro#6433)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Mar 7, 2023
1 parent af05a4f commit 00a0af7
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["@example/*", "@test/*"],
"ignore": ["@example/*", "@test/*", "@benchmark/*", "astro-scripts", "astro-benchmark"],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
}
Expand Down
2 changes: 1 addition & 1 deletion benchmark/bench/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
* @returns {Promise<number>}
*/
Expand Down
2 changes: 1 addition & 1 deletion benchmark/make-project/render-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export async function run(projectDir) {
new URL('./astro.config.js', projectDir),
`\
import { defineConfig } from 'astro/config';
import timer from '@astrojs/timer';
import timer from '@benchmark/timer';
import mdx from '@astrojs/mdx';
export default defineConfig({
Expand Down
2 changes: 1 addition & 1 deletion benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"dependencies": {
"@astrojs/mdx": "workspace:*",
"@astrojs/node": "workspace:*",
"@astrojs/timer": "workspace:*",
"@benchmark/timer": "workspace:*",
"astro": "workspace:*",
"autocannon": "^7.10.0",
"execa": "^6.1.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
{
"name": "@astrojs/timer",
"name": "@benchmark/timer",
"description": "Preview server for benchmark",
"private": true,
"version": "0.0.1",
"version": "0.0.0",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/withastro/astro.git",
"directory": "packages/integrations/timer"
},
"keywords": [
"withastro",
"astro-adapter"
],
"bugs": "https://github.com/withastro/astro/issues",
"exports": {
".": "./dist/index.js",
"./server.js": "./dist/server.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ import type { AstroAdapter, AstroIntegration } from 'astro';

export function getAdapter(): AstroAdapter {
return {
name: '@astrojs/timer',
serverEntrypoint: '@astrojs/timer/server.js',
previewEntrypoint: '@astrojs/timer/preview.js',
name: '@benchmark/timer',
serverEntrypoint: '@benchmark/timer/server.js',
previewEntrypoint: '@benchmark/timer/preview.js',
exports: ['handler'],
};
}

export default function createIntegration(): AstroIntegration {
return {
name: '@astrojs/timer',
name: '@benchmark/timer',
hooks: {
'astro:config:setup': ({ updateConfig }) => {
updateConfig({
vite: {
ssr: {
noExternal: ['@astrojs/timer'],
noExternal: ['@benchmark/timer'],
},
},
});
Expand All @@ -26,7 +26,8 @@ export default function createIntegration(): AstroIntegration {
setAdapter(getAdapter());

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.`);
}
},
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
},
"scripts": {
"release": "pnpm run build && changeset publish",
"build": "turbo run build --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/*\"",
"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/*\" --filter=\"@benchmark/*\"",
"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:ci": "pnpm run format:imports && pnpm run format:code",
"format:code": "prettier -w . --cache --plugin-search-dir=.",
Expand Down
9 changes: 0 additions & 9 deletions packages/integrations/timer/CHANGELOG.md

This file was deleted.

34 changes: 17 additions & 17 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ packages:
- 'smoke/**/*'
- 'scripts'
- 'benchmark'
- 'benchmark/packages/*'

0 comments on commit 00a0af7

Please sign in to comment.