summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.changeset/green-buttons-reflect.md5
-rw-r--r--docs/package.json1
-rw-r--r--docs/src/pages/fi/installation.md3
-rw-r--r--docs/src/pages/fr/installation.md3
-rw-r--r--docs/src/pages/guides/deploy.md3
-rw-r--r--docs/src/pages/installation.md3
-rw-r--r--docs/src/pages/reference/cli-reference.md6
-rw-r--r--docs/src/pages/zh-CN/installation.md3
-rw-r--r--docs/src/pages/zh-TW/installation.md3
-rw-r--r--examples/blog-multiple-authors/package.json3
-rw-r--r--examples/blog/package.json3
-rw-r--r--examples/docs/package.json3
-rw-r--r--examples/docs/src/pages/index.md3
-rw-r--r--examples/framework-lit/package.json3
-rw-r--r--examples/framework-multiple/package.json3
-rw-r--r--examples/framework-preact/package.json3
-rw-r--r--examples/framework-react/package.json3
-rw-r--r--examples/framework-solid/package.json3
-rw-r--r--examples/framework-svelte/package.json3
-rw-r--r--examples/framework-vue/package.json3
-rw-r--r--examples/minimal/package.json3
-rw-r--r--examples/portfolio/package.json3
-rw-r--r--examples/snowpack/package.json1
-rw-r--r--examples/starter/package.json3
-rw-r--r--examples/with-markdown-plugins/package.json3
-rw-r--r--examples/with-markdown/package.json3
-rw-r--r--examples/with-nanostores/package.json3
-rw-r--r--examples/with-tailwindcss/package.json3
-rw-r--r--packages/astro/package.json2
-rw-r--r--packages/astro/src/cli.ts11
-rw-r--r--packages/astro/src/preview.ts38
-rw-r--r--packages/astro/test/astro-basic.test.js19
-rw-r--r--packages/astro/test/helpers.js54
-rw-r--r--www/package.json3
-rw-r--r--yarn.lock72
35 files changed, 240 insertions, 44 deletions
diff --git a/.changeset/green-buttons-reflect.md b/.changeset/green-buttons-reflect.md
new file mode 100644
index 000000000..572de22ce
--- /dev/null
+++ b/.changeset/green-buttons-reflect.md
@@ -0,0 +1,5 @@
+---
+'astro': patch
+---
+
+Add a new "astro preview" command
diff --git a/docs/package.json b/docs/package.json
index 74f312810..724adede2 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -6,6 +6,7 @@
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
+ "preview": "astro preview",
"lint": "run-p --aggregate-output lint:linkcheck",
"lint:a11y": "start-test 'yarn dev --silent' 3000 'yarn lint:a11y:local'",
"lint:a11y:local": "pa11y-ci --sitemap 'http://localhost:3000/sitemap.xml' --sitemap-find 'https://docs.astro.build' --sitemap-replace 'http://localhost:3000'",
diff --git a/docs/src/pages/fi/installation.md b/docs/src/pages/fi/installation.md
index f6e630daf..26f2e3884 100644
--- a/docs/src/pages/fi/installation.md
+++ b/docs/src/pages/fi/installation.md
@@ -61,7 +61,8 @@ Voit nyt vaihtaa oletuksena toimivan "scripts"-osion `npm init`in luomassa `pack
"scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
+ "dev": "astro dev",
-+ "build": "astro build"
++ "build": "astro build",
++ "preview": "astro preview"
},
}
```
diff --git a/docs/src/pages/fr/installation.md b/docs/src/pages/fr/installation.md
index 8fa439c96..96c7b8f39 100644
--- a/docs/src/pages/fr/installation.md
+++ b/docs/src/pages/fr/installation.md
@@ -86,7 +86,8 @@ Vous pouvez aussi remplacer la section "scripts" du fichier `package.json` avec
"scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
+ "dev": "astro dev",
-+ "build": "astro build"
++ "build": "astro build",
++ "preview": "astro preview"
},
}
```
diff --git a/docs/src/pages/guides/deploy.md b/docs/src/pages/guides/deploy.md
index de8aa69b6..ff0c30d95 100644
--- a/docs/src/pages/guides/deploy.md
+++ b/docs/src/pages/guides/deploy.md
@@ -13,7 +13,8 @@ The following guides are based on some shared assumptions:
{
"scripts": {
"start": "astro dev",
- "build": "astro build"
+ "build": "astro build",
+ "preview": "astro preview"
}
}
```
diff --git a/docs/src/pages/installation.md b/docs/src/pages/installation.md
index ea6ff9d12..e5e0586e4 100644
--- a/docs/src/pages/installation.md
+++ b/docs/src/pages/installation.md
@@ -87,7 +87,8 @@ You can now replace the placeholder "scripts" section of your `package.json` fil
"scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
+ "dev": "astro dev",
-+ "build": "astro build"
++ "build": "astro build",
++ "preview": "astro preview"
},
}
```
diff --git a/docs/src/pages/reference/cli-reference.md b/docs/src/pages/reference/cli-reference.md
index 98957c328..06180d812 100644
--- a/docs/src/pages/reference/cli-reference.md
+++ b/docs/src/pages/reference/cli-reference.md
@@ -19,6 +19,12 @@ Specifies should port to run on. Defaults to `3000`.
Builds your site for production.
+### `astro preview`
+
+Start a local static file server to serve your built `dist/` directory. Useful for previewing your static build locally, before deploying it.
+
+This command is meant for local testing only, and is not designed to be run in production. For help with production hosting, check out our guide on [Deploying an Astro Website](/guides/deploy).
+
## Global Flags
### `--config path`
diff --git a/docs/src/pages/zh-CN/installation.md b/docs/src/pages/zh-CN/installation.md
index b340edf8c..5512a6e18 100644
--- a/docs/src/pages/zh-CN/installation.md
+++ b/docs/src/pages/zh-CN/installation.md
@@ -92,7 +92,8 @@ npm install astro
"scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
+ "dev": "astro dev",
-+ "build": "astro build"
++ "build": "astro build",
++ "preview": "astro preview"
},
}
```
diff --git a/docs/src/pages/zh-TW/installation.md b/docs/src/pages/zh-TW/installation.md
index aa2270ea9..bf1ea4a1b 100644
--- a/docs/src/pages/zh-TW/installation.md
+++ b/docs/src/pages/zh-TW/installation.md
@@ -88,7 +88,8 @@ npm install astro
"scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
+ "dev": "astro dev",
-+ "build": "astro build"
++ "build": "astro build",
++ "preview": "astro preview"
},
}
```
diff --git a/examples/blog-multiple-authors/package.json b/examples/blog-multiple-authors/package.json
index a14dd21da..0ec55c3dd 100644
--- a/examples/blog-multiple-authors/package.json
+++ b/examples/blog-multiple-authors/package.json
@@ -5,7 +5,8 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
- "build": "astro build"
+ "build": "astro build",
+ "preview": "astro preview"
},
"devDependencies": {
"astro": "^0.20.0"
diff --git a/examples/blog/package.json b/examples/blog/package.json
index 0e911f5a6..6ea001c84 100644
--- a/examples/blog/package.json
+++ b/examples/blog/package.json
@@ -5,7 +5,8 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
- "build": "astro build"
+ "build": "astro build",
+ "preview": "astro preview"
},
"devDependencies": {
"astro": "^0.20.0"
diff --git a/examples/docs/package.json b/examples/docs/package.json
index 641209868..cfaa832ac 100644
--- a/examples/docs/package.json
+++ b/examples/docs/package.json
@@ -5,7 +5,8 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
- "build": "astro build"
+ "build": "astro build",
+ "preview": "astro preview"
},
"devDependencies": {
"astro": "^0.20.0"
diff --git a/examples/docs/src/pages/index.md b/examples/docs/src/pages/index.md
index 93d75c113..cd5ce6454 100644
--- a/examples/docs/src/pages/index.md
+++ b/examples/docs/src/pages/index.md
@@ -40,7 +40,8 @@ The default Astro project has the following `scripts` in the `/package.json` fil
{
"scripts": {
"dev": "astro dev",
- "build": "astro build"
+ "build": "astro build",
+ "preview": "astro preview"
}
}
```
diff --git a/examples/framework-lit/package.json b/examples/framework-lit/package.json
index 55c3ab491..2101546f8 100644
--- a/examples/framework-lit/package.json
+++ b/examples/framework-lit/package.json
@@ -5,7 +5,8 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
- "build": "astro build"
+ "build": "astro build",
+ "preview": "astro preview"
},
"devDependencies": {
"@astrojs/renderer-lit": "^0.1.0",
diff --git a/examples/framework-multiple/package.json b/examples/framework-multiple/package.json
index 9fb2cadaa..53184d927 100644
--- a/examples/framework-multiple/package.json
+++ b/examples/framework-multiple/package.json
@@ -5,7 +5,8 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
- "build": "astro build"
+ "build": "astro build",
+ "preview": "astro preview"
},
"devDependencies": {
"astro": "^0.20.0"
diff --git a/examples/framework-preact/package.json b/examples/framework-preact/package.json
index a3d3366a0..96a002616 100644
--- a/examples/framework-preact/package.json
+++ b/examples/framework-preact/package.json
@@ -5,7 +5,8 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
- "build": "astro build"
+ "build": "astro build",
+ "preview": "astro preview"
},
"devDependencies": {
"astro": "^0.20.0"
diff --git a/examples/framework-react/package.json b/examples/framework-react/package.json
index 7b49040d5..ba75403e2 100644
--- a/examples/framework-react/package.json
+++ b/examples/framework-react/package.json
@@ -5,7 +5,8 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
- "build": "astro build"
+ "build": "astro build",
+ "preview": "astro preview"
},
"devDependencies": {
"astro": "^0.20.0"
diff --git a/examples/framework-solid/package.json b/examples/framework-solid/package.json
index 7aa34e937..a230f0093 100644
--- a/examples/framework-solid/package.json
+++ b/examples/framework-solid/package.json
@@ -5,7 +5,8 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
- "build": "astro build"
+ "build": "astro build",
+ "preview": "astro preview"
},
"devDependencies": {
"astro": "^0.20.0",
diff --git a/examples/framework-svelte/package.json b/examples/framework-svelte/package.json
index a2e0613d6..1c3721a7d 100644
--- a/examples/framework-svelte/package.json
+++ b/examples/framework-svelte/package.json
@@ -5,7 +5,8 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
- "build": "astro build"
+ "build": "astro build",
+ "preview": "astro preview"
},
"devDependencies": {
"astro": "^0.20.0"
diff --git a/examples/framework-vue/package.json b/examples/framework-vue/package.json
index d0077fce0..6f72e13eb 100644
--- a/examples/framework-vue/package.json
+++ b/examples/framework-vue/package.json
@@ -5,7 +5,8 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
- "build": "astro build"
+ "build": "astro build",
+ "preview": "astro preview"
},
"devDependencies": {
"astro": "^0.20.0"
diff --git a/examples/minimal/package.json b/examples/minimal/package.json
index f8e1b5e36..cd72cf7ab 100644
--- a/examples/minimal/package.json
+++ b/examples/minimal/package.json
@@ -5,7 +5,8 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
- "build": "astro build"
+ "build": "astro build",
+ "preview": "astro preview"
},
"devDependencies": {
"astro": "^0.20.0"
diff --git a/examples/portfolio/package.json b/examples/portfolio/package.json
index e82794b60..8408c6e7a 100644
--- a/examples/portfolio/package.json
+++ b/examples/portfolio/package.json
@@ -5,7 +5,8 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
- "build": "astro build"
+ "build": "astro build",
+ "preview": "astro preview"
},
"devDependencies": {
"astro": "^0.20.0"
diff --git a/examples/snowpack/package.json b/examples/snowpack/package.json
index a5549ac8d..753b251dd 100644
--- a/examples/snowpack/package.json
+++ b/examples/snowpack/package.json
@@ -5,6 +5,7 @@
"scripts": {
"start": "astro dev",
"build": "astro build",
+ "preview": "astro preview",
"test": "jest /__test__/",
"format": "prettier --write \"src/**/*.js\" && yarn format:css",
"lint": "prettier --check \"src/**/*.js\""
diff --git a/examples/starter/package.json b/examples/starter/package.json
index 782f7aa1f..8e06ade93 100644
--- a/examples/starter/package.json
+++ b/examples/starter/package.json
@@ -5,7 +5,8 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
- "build": "astro build"
+ "build": "astro build",
+ "preview": "astro preview"
},
"devDependencies": {
"astro": "^0.20.0"
diff --git a/examples/with-markdown-plugins/package.json b/examples/with-markdown-plugins/package.json
index 3beb797a9..deaba2ed2 100644
--- a/examples/with-markdown-plugins/package.json
+++ b/examples/with-markdown-plugins/package.json
@@ -5,7 +5,8 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
- "build": "astro build"
+ "build": "astro build",
+ "preview": "astro preview"
},
"devDependencies": {
"astro": "^0.20.0",
diff --git a/examples/with-markdown/package.json b/examples/with-markdown/package.json
index 4a3933d1e..a85d43181 100644
--- a/examples/with-markdown/package.json
+++ b/examples/with-markdown/package.json
@@ -5,7 +5,8 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
- "build": "astro build"
+ "build": "astro build",
+ "preview": "astro preview"
},
"devDependencies": {
"astro": "^0.20.0"
diff --git a/examples/with-nanostores/package.json b/examples/with-nanostores/package.json
index 453922de5..f2fe149fb 100644
--- a/examples/with-nanostores/package.json
+++ b/examples/with-nanostores/package.json
@@ -5,7 +5,8 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
- "build": "astro build"
+ "build": "astro build",
+ "preview": "astro preview"
},
"devDependencies": {
"astro": "^0.20.0"
diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json
index 74516021f..e2703508c 100644
--- a/examples/with-tailwindcss/package.json
+++ b/examples/with-tailwindcss/package.json
@@ -5,7 +5,8 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
- "build": "astro build"
+ "build": "astro build",
+ "preview": "astro preview"
},
"devDependencies": {
"tailwindcss": "^2.1.2",
diff --git a/packages/astro/package.json b/packages/astro/package.json
index 7e09e0a7a..6678e51c8 100644
--- a/packages/astro/package.json
+++ b/packages/astro/package.json
@@ -58,6 +58,7 @@
"@babel/traverse": "^7.13.15",
"@snowpack/plugin-postcss": "^1.4.3",
"@snowpack/plugin-sass": "^1.4.0",
+ "@types/send": "^0.17.1",
"acorn": "^7.4.0",
"astring": "^1.7.4",
"autoprefixer": "^10.2.5",
@@ -90,6 +91,7 @@
"rollup-plugin-terser": "^7.0.2",
"sass": "^1.32.13",
"semver": "^7.3.5",
+ "send": "^0.17.1",
"shorthash": "^0.0.2",
"slash": "^4.0.0",
"snowpack": "^3.8.6",
diff --git a/packages/astro/src/cli.ts b/packages/astro/src/cli.ts
index 6f81cfcb0..17dfea668 100644
--- a/packages/astro/src/cli.ts
+++ b/packages/astro/src/cli.ts
@@ -8,6 +8,7 @@ import yargs from 'yargs-parser';
import { loadConfig } from './config.js';
import { build } from './build.js';
import devServer from './dev.js';
+import { preview } from './preview.js';
import { reload } from './reload.js';
const { readFile } = fsPromises;
@@ -21,7 +22,7 @@ const reloadAndExit = async () => {
};
type Arguments = yargs.Arguments;
-type cliCommand = 'help' | 'version' | 'dev' | 'build' | 'reload';
+type cliCommand = 'help' | 'version' | 'dev' | 'build' | 'preview' | 'reload';
interface CLIState {
cmd: cliCommand;
options: {
@@ -57,6 +58,8 @@ function resolveArgs(flags: Arguments): CLIState {
return { cmd: 'dev', options };
case 'build':
return { cmd: 'build', options };
+ case 'preview':
+ return { cmd: 'preview', options };
default:
if (flags.reload) {
return { cmd: 'reload', options };
@@ -73,6 +76,7 @@ function printHelp() {
${colors.bold('Commands:')}
astro dev Run Astro in development mode.
astro build Build a pre-compiled production version of your site.
+ astro preview Preview your build locally before deploying.
${colors.bold('Flags:')}
--config <path> Specify the path to the Astro config file.
@@ -114,9 +118,10 @@ async function runCommand(rawRoot: string, cmd: (a: AstroConfig, opts: any) => P
}
}
-const cmdMap = new Map<string, (a: AstroConfig, opts?: any) => Promise<void>>([
+const cmdMap = new Map<string, (a: AstroConfig, opts?: any) => Promise<any>>([
['build', buildAndExit],
['dev', devServer],
+ ['preview', preview],
['reload', reloadAndExit],
]);
@@ -124,7 +129,6 @@ const cmdMap = new Map<string, (a: AstroConfig, opts?: any) => Promise<void>>([
export async function cli(args: string[]) {
const flags = yargs(args);
const state = resolveArgs(flags);
-
switch (state.cmd) {
case 'help': {
printHelp();
@@ -141,6 +145,7 @@ export async function cli(args: string[]) {
break;
}
case 'build':
+ case 'preview':
case 'dev': {
if (flags.reload) {
await reload();
diff --git a/packages/astro/src/preview.ts b/packages/astro/src/preview.ts
new file mode 100644
index 000000000..eacd37983
--- /dev/null
+++ b/packages/astro/src/preview.ts
@@ -0,0 +1,38 @@
+import http from 'http';
+import { green } from 'kleur/colors';
+import { performance } from 'perf_hooks';
+import send from 'send';
+import { fileURLToPath } from 'url';
+import type { AstroConfig } from './@types/astro';
+import type { LogOptions } from './logger.js';
+import { defaultLogDestination, defaultLogLevel, error, info } from './logger.js';
+
+const logging: LogOptions = {
+ level: defaultLogLevel,
+ dest: defaultLogDestination,
+};
+
+/** The primary dev action */
+export async function preview(astroConfig: AstroConfig) {
+ const startServerTime = performance.now();
+ const { hostname, port } = astroConfig.devOptions;
+ // Create the preview server, send static files out of the `dist/` directory.
+ const server = http.createServer((req, res) => {
+ send(req, req.url!, { root: fileURLToPath(astroConfig.dist) }).pipe(res);
+ });
+ // Start listening on `hostname:port`.
+ return server
+ .listen(port, hostname, () => {
+ const endServerTime = performance.now();
+ info(logging, 'preview', green(`Preview server started in ${Math.floor(endServerTime - startServerTime)}ms.`));
+ info(logging, 'preview', `${green('Local:')} http://${hostname}:${port}/`);
+ })
+ .on('error', (err: NodeJS.ErrnoException) => {
+ if (err.code && err.code === 'EADDRINUSE') {
+ error(logging, 'preview', `Address ${hostname}:${port} already in use. Try changing devOptions.port in your config file`);
+ } else {
+ error(logging, 'preview', err.stack);
+ }
+ process.exit(1);
+ });
+}
diff --git a/packages/astro/test/astro-basic.test.js b/packages/astro/test/astro-basic.test.js
index ad52bb48b..164db697b 100644
--- a/packages/astro/test/astro-basic.test.js
+++ b/packages/astro/test/astro-basic.test.js
@@ -1,7 +1,9 @@
import { suite } from 'uvu';
+import http from 'http';
+import { promisify } from 'util';
import * as assert from 'uvu/assert';
import { doc } from './test-utils.js';
-import { setup, setupBuild } from './helpers.js';
+import { setup, setupBuild, setupPreview } from './helpers.js';
const Basics = suite('Basic test');
@@ -11,6 +13,7 @@ setup(Basics, './fixtures/astro-basic', {
},
});
setupBuild(Basics, './fixtures/astro-basic');
+setupPreview(Basics, './fixtures/astro-basic');
Basics('Can load page', async ({ runtime }) => {
const result = await runtime.load('/');
@@ -58,6 +61,20 @@ Basics('Build does not include HMR client', async ({ build, readFile }) => {
assert.equal(hmrPortScript.length, 0, 'No script setting the websocket port');
});
+Basics('Preview server works as expected', async ({ build, previewServer }) => {
+ await build().catch((err) => {
+ assert.ok(!err, 'Error during the build');
+ });
+ {
+ const resultOrError = await promisify(http.get)(`http://localhost:${previewServer.address().port}/`).catch((err) => err);
+ assert.equal(resultOrError.statusCode, 200);
+ }
+ {
+ const resultOrError = await promisify(http.get)(`http://localhost:${previewServer.address().port}/bad-url`).catch((err) => err);
+ assert.equal(resultOrError.statusCode, 404);
+ }
+});
+
Basics('Allows forward-slashes in mustache tags (#407)', async ({ runtime }) => {
const result = await runtime.load('/forward-slash');
const html = result.contents;
diff --git a/packages/astro/test/helpers.js b/packages/astro/test/helpers.js
index e579c5ed3..569a254cc 100644
--- a/packages/astro/test/helpers.js
+++ b/packages/astro/test/helpers.js
@@ -1,5 +1,6 @@
import { fileURLToPath } from 'url';
import { build as astroBuild } from '#astro/build';
+import { preview as astroPreview } from '#astro/preview';
import { readFileSync } from 'fs';
import { createRuntime } from '#astro/runtime';
import { loadConfig } from '#astro/config';
@@ -73,6 +74,59 @@ export function setup(Suite, fixturePath, { runtimeOptions = {} } = {}) {
});
}
+/**
+ * @param {{}} Suite
+ * @param {string} fixturePath
+ * @param {SetupOptions} setupOptions
+ */
+export function setupPreview(Suite, fixturePath, { runtimeOptions = {} } = {}) {
+ let server, createRuntimeError;
+ const timers = {};
+
+ Suite.before(async (context) => {
+ let timeout = setTimeout(() => {
+ throw new Error('Startup did not complete within allowed time');
+ }, MAX_STARTUP_TIME);
+
+ const astroConfig = await loadConfig(fileURLToPath(new URL(fixturePath, import.meta.url)));
+
+ server = await astroPreview(astroConfig).catch((err) => {
+ createRuntimeError = err;
+ });
+
+ if (createRuntimeError) {
+ setTimeout(() => {
+ throw createRuntimeError;
+ });
+ }
+
+ context.previewServer = server;
+
+ clearTimeout(timeout);
+ });
+
+ Suite.before.each(({ __test__ }) => {
+ if (timers[__test__]) throw new Error(`Test "${__test__}" already declared`);
+ timers[__test__] = setTimeout(() => {
+ throw new Error(`"${__test__}" did not finish within allowed time`);
+ }, MAX_TEST_TIME);
+ });
+
+ Suite.after(async () => {
+ let timeout = setTimeout(() => {
+ throw new Error('Shutdown did not complete within allowed time');
+ }, MAX_SHUTDOWN_TIME);
+
+ server && server.close();
+
+ clearTimeout(timeout);
+ });
+
+ Suite.after.each(({ __test__ }) => {
+ clearTimeout(timers[__test__]);
+ });
+}
+
export function setupBuild(Suite, fixturePath) {
const timers = {};
diff --git a/www/package.json b/www/package.json
index 468e7d7a2..f3ceecb4a 100644
--- a/www/package.json
+++ b/www/package.json
@@ -5,7 +5,8 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
- "build": "astro build"
+ "build": "astro build",
+ "preview": "astro preview"
},
"devDependencies": {
"astro": "^0.20.0"
diff --git a/yarn.lock b/yarn.lock
index 9678c0fcf..02edf0ac1 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1899,6 +1899,11 @@
resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-1.0.2.tgz#e2ce9d83a613bacf284c7be7d491945e39e1f8e9"
integrity sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==
+"@types/mime@^1":
+ version "1.3.2"
+ resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a"
+ integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==
+
"@types/mime@^2.0.3":
version "2.0.3"
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-2.0.3.tgz#c893b73721db73699943bfc3653b1deb7faa4a3a"
@@ -2000,6 +2005,14 @@
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-6.2.3.tgz#5798ecf1bec94eaa64db39ee52808ec0693315aa"
integrity sha512-KQf+QAMWKMrtBMsB8/24w53tEsxllMj6TuA80TT/5igJalLI/zm0L3oXRbIAl4Ohfc85gyHX/jhMwsVkmhLU4A==
+"@types/send@^0.17.1":
+ version "0.17.1"
+ resolved "https://registry.yarnpkg.com/@types/send/-/send-0.17.1.tgz#ed4932b8a2a805f1fe362a70f4e62d0ac994e301"
+ integrity sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==
+ dependencies:
+ "@types/mime" "^1"
+ "@types/node" "*"
+
"@types/trusted-types@^1.0.1":
version "1.0.6"
resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-1.0.6.tgz#569b8a08121d3203398290d602d84d73c8dcf5da"
@@ -3668,6 +3681,13 @@ dateformat@^3.0.0:
resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae"
integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==
+debug@2.6.9, debug@^2.1.1, debug@^2.6.0, debug@^2.6.9:
+ version "2.6.9"
+ resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
+ integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
+ dependencies:
+ ms "2.0.0"
+
debug@4, debug@4.3.2, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1:
version "4.3.2"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b"
@@ -3675,13 +3695,6 @@ debug@4, debug@4.3.2, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, de
dependencies:
ms "2.1.2"
-debug@^2.1.1, debug@^2.6.0, debug@^2.6.9:
- version "2.6.9"
- resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
- integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
- dependencies:
- ms "2.0.0"
-
debug@^3.1.0:
version "3.2.7"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a"
@@ -3840,7 +3853,7 @@ dequal@^2.0.0:
resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.2.tgz#85ca22025e3a87e65ef75a7a437b35284a7e319d"
integrity sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug==
-destroy@^1.0.4:
+destroy@^1.0.4, destroy@~1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80"
integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=
@@ -4037,7 +4050,7 @@ emojis-list@^3.0.0:
resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78"
integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==
-encodeurl@^1.0.2:
+encodeurl@^1.0.2, encodeurl@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59"
integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=
@@ -4194,7 +4207,7 @@ escalade@^3.1.1:
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==
-escape-html@^1.0.3:
+escape-html@^1.0.3, escape-html@~1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=
@@ -4413,7 +4426,7 @@ esutils@^2.0.2:
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==
-etag@^1.8.1:
+etag@^1.8.1, etag@~1.8.1:
version "1.8.1"
resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887"
integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=
@@ -4738,7 +4751,7 @@ fraction.js@^4.1.1:
resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.1.1.tgz#ac4e520473dae67012d618aab91eda09bcb400ff"
integrity sha512-MHOhvvxHTfRFpF1geTK9czMIZ6xclsEor2wkIGYYq+PxcQqT7vStJqjhe6S1TenZrMZzo+wlqOufBDVepUEgPg==
-fresh@~0.5.2:
+fresh@0.5.2, fresh@~0.5.2:
version "0.5.2"
resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7"
integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=
@@ -7209,7 +7222,7 @@ mime-types@^2.1.12, mime-types@^2.1.18, mime-types@^2.1.26, mime-types@~2.1.19,
dependencies:
mime-db "1.49.0"
-mime@^1.3.4:
+mime@1.6.0, mime@^1.3.4:
version "1.6.0"
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==
@@ -7403,6 +7416,11 @@ ms@2.0.0:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
+ms@2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"
+ integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==
+
ms@2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
@@ -7813,7 +7831,7 @@ object.getownpropertydescriptors@^2.0.3:
define-properties "^1.1.3"
es-abstract "^1.18.0-next.2"
-on-finished@^2.3.0:
+on-finished@^2.3.0, on-finished@~2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947"
integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=
@@ -8745,6 +8763,11 @@ randombytes@^2.1.0:
dependencies:
safe-buffer "^5.1.0"
+range-parser@~1.2.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031"
+ integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==
+
react-dom@^17.0.2:
version "17.0.2"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23"
@@ -9378,6 +9401,25 @@ semver@^7.1.1, semver@^7.1.3, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semve
dependencies:
lru-cache "^6.0.0"
+send@^0.17.1:
+ version "0.17.1"
+ resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8"
+ integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==
+ dependencies:
+ debug "2.6.9"
+ depd "~1.1.2"
+ destroy "~1.0.4"
+ encodeurl "~1.0.2"
+ escape-html "~1.0.3"
+ etag "~1.8.1"
+ fresh "0.5.2"
+ http-errors "~1.7.2"
+ mime "1.6.0"
+ ms "2.1.1"
+ on-finished "~2.3.0"
+ range-parser "~1.2.1"
+ statuses "~1.5.0"
+
serialize-javascript@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa"
@@ -9788,7 +9830,7 @@ start-server-and-test@^1.12.6:
ps-tree "1.2.0"
wait-on "6.0.0"
-"statuses@>= 1.4.0 < 2", "statuses@>= 1.5.0 < 2", statuses@^1.5.0:
+"statuses@>= 1.4.0 < 2", "statuses@>= 1.5.0 < 2", statuses@^1.5.0, statuses@~1.5.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=