Skip to content

Commit

Permalink
step 4 for middleware architecture (#565)
Browse files Browse the repository at this point in the history
* remove old cli and with-ssr option

* overlooked

* fix tests

* clean up unused code
  • Loading branch information
dai-shi authored Mar 5, 2024
1 parent f9111ed commit ad84f50
Show file tree
Hide file tree
Showing 41 changed files with 82 additions and 744 deletions.
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
Expand Up @@ -69,15 +69,15 @@ test.describe('07_router standalone', () => {
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.describe('07_router standalone', () => {
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

0 comments on commit ad84f50

Please sign in to comment.