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

Move benchmark package and update changeset config #6433

Merged
merged 1 commit into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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/*'