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

step 4 for middleware architecture #565

Merged
merged 4 commits into from
Mar 5, 2024
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ Adding the `--with-vercel-static` flag to the build script will produce static s
```
{
"scripts": {
"build": "waku build --with-ssr --with-vercel-static"
"build": "waku build --with-vercel-static"
}
}
```
Expand All @@ -665,7 +665,7 @@ Adding the `--with-netlify-static` flag to the build script will produce static
```
{
"scripts": {
"build": "waku build --with-ssr --with-netlify-static"
"build": "waku build --with-netlify-static"
}
}
```
Expand Down
4 changes: 2 additions & 2 deletions docs/builder/aws-lambda.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ custom:
# add custom hooks
hooks:
before:package:createDeploymentArtifacts:
- pnpm waku build --with-ssr --with-aws-lambda
- pnpm waku build --with-aws-lambda
```

This configuration will include all files from the `./private` directory in the final deployment.
Expand Down Expand Up @@ -196,7 +196,7 @@ export class WakuStack extends cdk.Stack {
tryBundle(outputDir) {
spawnSync(
'pnpm',
['exec', 'waku', 'build', '--with-ssr', '--with-aws-lambda'],
['exec', 'waku', 'build', '--with-aws-lambda'],
{ stdio: 'inherit' },
);
cpSync('dist', outputDir, { recursive: true, dereference: true });
Expand Down
6 changes: 3 additions & 3 deletions e2e/07_router_standalone.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { debugChildProcess, getFreePort, terminate, test } from './utils.js';

Check failure on line 1 in e2e/07_router_standalone.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 18) - (2/4)

Child Process Error

stderr: WebSocket server error: Port is already in use

Check failure on line 1 in e2e/07_router_standalone.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 20) - (2/4)

Child Process Error

stderr: WebSocket server error: Port is already in use

Check failure on line 1 in e2e/07_router_standalone.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 20) - (3/4)

Child Process Error

stderr: WebSocket server error: Port is already in use

Check failure on line 1 in e2e/07_router_standalone.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on ubuntu-latest (Node 18) - (3/4)

Child Process Error

stderr: WebSocket server error: Port is already in use

Check failure on line 1 in e2e/07_router_standalone.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on windows-latest (Node 18) - (2/4)

Child Process Error

stderr: WebSocket server error: Port is already in use

Check failure on line 1 in e2e/07_router_standalone.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on windows-latest (Node 20) - (3/4)

Child Process Error

stderr: WebSocket server error: Port is already in use

Check failure on line 1 in e2e/07_router_standalone.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on windows-latest (Node 20) - (2/4)

Child Process Error

stderr: WebSocket server error: Port is already in use

Check failure on line 1 in e2e/07_router_standalone.spec.ts

View workflow job for this annotation

GitHub Actions / E2E on windows-latest (Node 18) - (3/4)

Child Process Error

stderr: WebSocket server error: Port is already in use
import { fileURLToPath } from 'node:url';
import { cp, mkdtemp } from 'node:fs/promises';
import { exec, execSync } from 'node:child_process';
Expand Down Expand Up @@ -69,15 +69,15 @@
test(`should prod work ${withSSR ? 'with SSR' : ''}`, async ({ page }) => {
test.fixme(withSSR, 'SSR is not working in standalone');
execSync(
`node ${join(standaloneDir, './node_modules/waku/dist/cli.js')} build${withSSR ? ' --with-ssr' : ''}`,
`node ${join(standaloneDir, './node_modules/waku/dist/cli.js')} build`,
{
cwd: standaloneDir,
stdio: 'inherit',
},
);
const port = await getFreePort();
const cp = exec(
`node ${join(standaloneDir, './node_modules/waku/dist/cli.js')} start${withSSR ? ' --with-ssr' : ''}`,
`node ${join(standaloneDir, './node_modules/waku/dist/cli.js')} start`,
{
cwd: standaloneDir,
env: {
Expand All @@ -95,7 +95,7 @@
test.fixme(withSSR, 'SSR is not working in standalone');
const port = await getFreePort();
const cp = exec(
`node ${join(standaloneDir, './node_modules/waku/dist/cli.js')} dev${withSSR ? ' --with-ssr' : ''}`,
`node ${join(standaloneDir, './node_modules/waku/dist/cli.js')} dev`,
{
cwd: standaloneDir,
env: {
Expand Down
14 changes: 0 additions & 14 deletions e2e/examples-smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,19 @@ const commands = [
{
command: 'dev',
},
{
command: 'dev --with-ssr',
},
{
build: 'build',
command: 'start',
},
{
build: 'build --with-ssr',
command: 'start --with-ssr',
},
];

const specialExamples = [
{
name: '08_cookies',
commands: [
{
command: 'node dev.js --with-ssr',
},
{
command: 'node dev.js',
},
{
build: 'waku build --with-ssr',
command: 'node start.js --with-ssr',
},
{
build: 'waku build',
command: 'node start.js',
Expand Down
6 changes: 3 additions & 3 deletions e2e/fixtures/ssr-basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"type": "module",
"private": true,
"scripts": {
"dev": "waku dev --with-ssr",
"build": "waku build --with-ssr",
"start": "waku start --with-ssr"
"dev": "waku dev",
"build": "waku build",
"start": "waku start"
},
"dependencies": {
"react": "18.3.0-canary-6c3b8dbfe-20240226",
Expand Down
6 changes: 3 additions & 3 deletions e2e/fixtures/ssr-swr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"type": "module",
"private": true,
"scripts": {
"dev": "waku dev --with-ssr",
"build": "waku build --with-ssr",
"start": "waku start --with-ssr"
"dev": "waku dev",
"build": "waku build",
"start": "waku start"
},
"dependencies": {
"react": "18.3.0-canary-6c3b8dbfe-20240226",
Expand Down
6 changes: 3 additions & 3 deletions e2e/fixtures/ssr-target-bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"type": "module",
"private": true,
"scripts": {
"dev": "waku dev --with-ssr",
"build": "waku build --with-ssr",
"start": "waku start --with-ssr"
"dev": "waku dev",
"build": "waku build",
"start": "waku start"
},
"dependencies": {
"react": "18.3.0-canary-6c3b8dbfe-20240226",
Expand Down
6 changes: 3 additions & 3 deletions e2e/ssr-basic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ const waku = fileURLToPath(

const commands = [
{
command: 'dev --with-ssr',
command: 'dev',
},
{
build: 'build --with-ssr',
command: 'start --with-ssr',
build: 'build',
command: 'start',
},
];

Expand Down
6 changes: 3 additions & 3 deletions e2e/ssr-swr.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ const waku = fileURLToPath(

const commands = [
{
command: 'dev --with-ssr',
command: 'dev',
},
{
build: 'build --with-ssr',
command: 'start --with-ssr',
build: 'build',
command: 'start',
},
];

Expand Down
12 changes: 6 additions & 6 deletions e2e/ssr-target-bundle.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ const waku = fileURLToPath(

const commands = [
{
command: 'dev --with-ssr',
command: 'dev',
},
{
build: 'build --with-ssr',
command: 'start --with-ssr',
build: 'build',
command: 'start',
},
];

Expand Down Expand Up @@ -65,7 +65,7 @@ for (const { build, command } of commands) {
});

test('image exists in folder public/assets', async () => {
test.skip(command.startsWith('dev '));
test.skip(command.startsWith('dev'));
const imagePath = path.join(cwd, 'dist', 'public', 'assets');
const files = await readdir(imagePath);
const imageExists = files.some((file) =>
Expand All @@ -75,7 +75,7 @@ for (const { build, command } of commands) {
});

test('json public linked exists in folder public/assets', async () => {
test.skip(command.startsWith('dev '));
test.skip(command.startsWith('dev'));
const imagePath = path.join(cwd, 'dist', 'public', 'assets');
const files = await readdir(imagePath);
const imageExists = files.some((file) =>
Expand All @@ -85,7 +85,7 @@ for (const { build, command } of commands) {
});

test('json private NOT exists in folder public/assets', async () => {
test.skip(command.startsWith('dev '));
test.skip(command.startsWith('dev'));
const imagePath = path.join(cwd, 'dist', 'public', 'assets');
const files = await readdir(imagePath);
const imageExists = files.some((file) =>
Expand Down
6 changes: 3 additions & 3 deletions examples/01_template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"type": "module",
"private": true,
"scripts": {
"dev": "waku dev --with-ssr",
"build": "waku build --with-ssr",
"start": "waku start --with-ssr"
"dev": "waku dev",
"build": "waku build",
"start": "waku start"
},
"dependencies": {
"react": "18.3.0-canary-6c3b8dbfe-20240226",
Expand Down
6 changes: 3 additions & 3 deletions examples/02_demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"type": "module",
"private": true,
"scripts": {
"dev": "waku dev --with-ssr",
"build": "waku build --with-ssr",
"start": "waku start --with-ssr"
"dev": "waku dev",
"build": "waku build",
"start": "waku start"
},
"dependencies": {
"react": "18.3.0-canary-6c3b8dbfe-20240226",
Expand Down
6 changes: 3 additions & 3 deletions examples/03_minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"type": "module",
"private": true,
"scripts": {
"dev": "waku dev --with-ssr",
"build": "waku build --with-ssr",
"start": "waku start --with-ssr"
"dev": "waku dev",
"build": "waku build",
"start": "waku start"
},
"dependencies": {
"react": "18.3.0-canary-6c3b8dbfe-20240226",
Expand Down
6 changes: 3 additions & 3 deletions examples/04_promise/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"type": "module",
"private": true,
"scripts": {
"dev": "waku dev --with-ssr",
"build": "waku build --with-ssr",
"start": "waku start --with-ssr"
"dev": "waku dev",
"build": "waku build",
"start": "waku start"
},
"dependencies": {
"react": "18.3.0-canary-6c3b8dbfe-20240226",
Expand Down
6 changes: 3 additions & 3 deletions examples/05_actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"type": "module",
"private": true,
"scripts": {
"dev": "waku dev --with-ssr",
"build": "waku build --with-ssr",
"start": "waku start --with-ssr"
"dev": "waku dev",
"build": "waku build",
"start": "waku start"
},
"dependencies": {
"react": "18.3.0-canary-6c3b8dbfe-20240226",
Expand Down
6 changes: 3 additions & 3 deletions examples/06_nesting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"type": "module",
"private": true,
"scripts": {
"dev": "waku dev --with-ssr",
"build": "waku build --with-ssr",
"start": "waku start --with-ssr"
"dev": "waku dev",
"build": "waku build",
"start": "waku start"
},
"dependencies": {
"react": "18.3.0-canary-6c3b8dbfe-20240226",
Expand Down
6 changes: 3 additions & 3 deletions examples/07_router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"type": "module",
"private": true,
"scripts": {
"dev": "waku dev --with-ssr",
"build": "waku build --with-ssr",
"start": "waku start --with-ssr"
"dev": "waku dev",
"build": "waku build",
"start": "waku start"
},
"dependencies": {
"react": "18.3.0-canary-6c3b8dbfe-20240226",
Expand Down
6 changes: 3 additions & 3 deletions examples/08_cookies/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"type": "module",
"private": true,
"scripts": {
"dev": "waku dev --with-ssr",
"build": "waku build --with-ssr",
"start": "waku start --with-ssr"
"dev": "waku dev",
"build": "waku build",
"start": "waku start"
},
"dependencies": {
"cookie": "0.6.0",
Expand Down
6 changes: 3 additions & 3 deletions examples/09_cssmodules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"type": "module",
"private": true,
"scripts": {
"dev": "waku dev --with-ssr",
"build": "waku build --with-ssr",
"start": "waku start --with-ssr"
"dev": "waku dev",
"build": "waku build",
"start": "waku start"
},
"dependencies": {
"react": "18.3.0-canary-6c3b8dbfe-20240226",
Expand Down
6 changes: 3 additions & 3 deletions examples/10_fs-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"type": "module",
"private": true,
"scripts": {
"dev": "waku dev --with-ssr",
"build": "waku build --with-ssr",
"start": "waku start --with-ssr"
"dev": "waku dev",
"build": "waku build",
"start": "waku start"
},
"dependencies": {
"glob": "10.3.10",
Expand Down
6 changes: 3 additions & 3 deletions examples/11_form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"type": "module",
"private": true,
"scripts": {
"dev": "waku dev --with-ssr",
"build": "waku build --with-ssr",
"start": "waku start --with-ssr"
"dev": "waku dev",
"build": "waku build",
"start": "waku start"
},
"dependencies": {
"react": "18.3.0-canary-6c3b8dbfe-20240226",
Expand Down
6 changes: 3 additions & 3 deletions examples/12_css/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"type": "module",
"private": true,
"scripts": {
"dev": "waku dev --with-ssr",
"build": "waku build --with-ssr",
"start": "waku start --with-ssr"
"dev": "waku dev",
"build": "waku build",
"start": "waku start"
},
"dependencies": {
"@stylexjs/stylex": "0.5.1",
Expand Down
6 changes: 3 additions & 3 deletions examples/13_path-alias/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"type": "module",
"private": true,
"scripts": {
"dev": "waku dev --with-ssr",
"build": "waku build --with-ssr",
"start": "waku start --with-ssr"
"dev": "waku dev",
"build": "waku build",
"start": "waku start"
},
"dependencies": {
"react": "18.3.0-canary-6c3b8dbfe-20240226",
Expand Down
6 changes: 3 additions & 3 deletions examples/14_react-tweet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"type": "module",
"private": true,
"scripts": {
"dev": "waku dev --with-ssr",
"build": "waku build --with-ssr",
"start": "waku start --with-ssr"
"dev": "waku dev",
"build": "waku build",
"start": "waku start"
},
"dependencies": {
"react": "18.3.0-canary-6c3b8dbfe-20240226",
Expand Down
Loading
Loading