summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Bjorn Lu <bjornlu.dev@gmail.com> 2023-03-07 10:52:47 +0800
committerGravatar GitHub <noreply@github.com> 2023-03-07 10:52:47 +0800
commit00a0af7ed44f5bb275f570ca38bbd0b798ce84ad (patch)
tree4c15d9223bffbcd4999a1950580cbd3a02a8ae5f
parentaf05a4fa4637bad9b20b9928e6d2c2f894aa9139 (diff)
downloadastro-00a0af7ed44f5bb275f570ca38bbd0b798ce84ad.tar.gz
astro-00a0af7ed44f5bb275f570ca38bbd0b798ce84ad.tar.zst
astro-00a0af7ed44f5bb275f570ca38bbd0b798ce84ad.zip
Move benchmark package and update changeset config (#6433)
-rw-r--r--.changeset/config.json2
-rw-r--r--benchmark/bench/render.js2
-rw-r--r--benchmark/make-project/render-default.js2
-rw-r--r--benchmark/package.json2
-rw-r--r--benchmark/packages/timer/README.md (renamed from packages/integrations/timer/README.md)2
-rw-r--r--benchmark/packages/timer/package.json (renamed from packages/integrations/timer/package.json)10
-rw-r--r--benchmark/packages/timer/src/index.ts (renamed from packages/integrations/timer/src/index.ts)13
-rw-r--r--benchmark/packages/timer/src/preview.ts (renamed from packages/integrations/timer/src/preview.ts)0
-rw-r--r--benchmark/packages/timer/src/server.ts (renamed from packages/integrations/timer/src/server.ts)0
-rw-r--r--benchmark/packages/timer/tsconfig.json (renamed from packages/integrations/timer/tsconfig.json)0
-rw-r--r--package.json6
-rw-r--r--packages/integrations/timer/CHANGELOG.md9
-rw-r--r--pnpm-lock.yaml34
-rw-r--r--pnpm-workspace.yaml1
14 files changed, 35 insertions, 48 deletions
diff --git a/.changeset/config.json b/.changeset/config.json
index 6099b9f61..f28b8bdcc 100644
--- a/.changeset/config.json
+++ b/.changeset/config.json
@@ -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
}
diff --git a/benchmark/bench/render.js b/benchmark/bench/render.js
index 59214b788..449a1056f 100644
--- a/benchmark/bench/render.js
+++ b/benchmark/bench/render.js
@@ -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>}
*/
diff --git a/benchmark/make-project/render-default.js b/benchmark/make-project/render-default.js
index 9dfe88609..38a06364d 100644
--- a/benchmark/make-project/render-default.js
+++ b/benchmark/make-project/render-default.js
@@ -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({
diff --git a/benchmark/package.json b/benchmark/package.json
index 85ba91e87..0edcbc905 100644
--- a/benchmark/package.json
+++ b/benchmark/package.json
@@ -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",
diff --git a/packages/integrations/timer/README.md b/benchmark/packages/timer/README.md
index 81124745d..5b8e33ed4 100644
--- a/packages/integrations/timer/README.md
+++ b/benchmark/packages/timer/README.md
@@ -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.
diff --git a/packages/integrations/timer/package.json b/benchmark/packages/timer/package.json
index 6d1b40287..6b38571a0 100644
--- a/packages/integrations/timer/package.json
+++ b/benchmark/packages/timer/package.json
@@ -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",
diff --git a/packages/integrations/timer/src/index.ts b/benchmark/packages/timer/src/index.ts
index feeaa2122..49edcb5e8 100644
--- a/packages/integrations/timer/src/index.ts
+++ b/benchmark/packages/timer/src/index.ts
@@ -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'],
},
},
});
@@ -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.`);
}
},
},
diff --git a/packages/integrations/timer/src/preview.ts b/benchmark/packages/timer/src/preview.ts
index 1208830dd..1208830dd 100644
--- a/packages/integrations/timer/src/preview.ts
+++ b/benchmark/packages/timer/src/preview.ts
diff --git a/packages/integrations/timer/src/server.ts b/benchmark/packages/timer/src/server.ts
index 5cfa4ad76..5cfa4ad76 100644
--- a/packages/integrations/timer/src/server.ts
+++ b/benchmark/packages/timer/src/server.ts
diff --git a/packages/integrations/timer/tsconfig.json b/benchmark/packages/timer/tsconfig.json
index 44baf375c..44baf375c 100644
--- a/packages/integrations/timer/tsconfig.json
+++ b/benchmark/packages/timer/tsconfig.json
diff --git a/package.json b/package.json
index d40062f8f..d956b27b8 100644
--- a/package.json
+++ b/package.json
@@ -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=.",
diff --git a/packages/integrations/timer/CHANGELOG.md b/packages/integrations/timer/CHANGELOG.md
deleted file mode 100644
index 504735660..000000000
--- a/packages/integrations/timer/CHANGELOG.md
+++ /dev/null
@@ -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
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 9f21215fb..e5385ccf3 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -67,7 +67,7 @@ importers:
specifiers:
'@astrojs/mdx': workspace:*
'@astrojs/node': workspace:*
- '@astrojs/timer': workspace:*
+ '@benchmark/timer': workspace:*
astro: workspace:*
autocannon: ^7.10.0
execa: ^6.1.0
@@ -78,7 +78,7 @@ importers:
dependencies:
'@astrojs/mdx': link:../packages/integrations/mdx
'@astrojs/node': link:../packages/integrations/node
- '@astrojs/timer': link:../packages/integrations/timer
+ '@benchmark/timer': link:packages/timer
astro: link:../packages/astro
autocannon: 7.10.0
execa: 6.1.0
@@ -87,6 +87,21 @@ importers:
port-authority: 2.0.1
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:
specifiers:
astro: ^2.0.18
@@ -3379,21 +3394,6 @@ importers:
tailwindcss: 3.2.6_postcss@8.4.21
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:
specifiers:
astro: workspace:*
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index fb7deebf6..e40ca6514 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -4,3 +4,4 @@ packages:
- 'smoke/**/*'
- 'scripts'
- 'benchmark'
+ - 'benchmark/packages/*'