Skip to content

Commit c8cbae8

Browse files
author
test
committed
docs(pdk-migration): update guide for @aws/nx-plugin 1.0.0-rc.33
- Bump the pinned version from 1.0.0-rc.10 to 1.0.0-rc.33 - Drop the manual tsx install step: ts#smithy-api vends tsx as a dev dependency since #786 - Rename the serve-local target to dev following #806 - Pass ux=cloudscape to ts#website since the default changed to shadcn in #854 (the shopping list app uses CloudScape components) - Fix the vite.config.mts outDir shown in the ace-builds diff context to match the generated config (bundle subdirectory) Validated by running the full migration end-to-end on a fresh 1.0.0-rc.33 workspace, including a live AWS deploy, authenticated GET/POST/DELETE API tests and teardown.
1 parent 314ee90 commit c8cbae8

2 files changed

Lines changed: 8 additions & 12 deletions

File tree

docs/src/content/docs/en/blog/migrating-from-aws-pdk.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Note also that some features of PDK don't have exact equivalents. Refer to the [
3636
:::
3737

3838
:::caution[Point-in-Time Guide]
39-
This is written as a point-of-time guide and will most likely not be updated as the Nx Plugin for AWS evolves. To compensate for this, the guide pins the version of `@aws/nx-plugin` to `1.0.0-rc.10`. You can try with the latest version if following along, but there may be some deviations from the guide.
39+
This is written as a point-of-time guide and will most likely not be updated as the Nx Plugin for AWS evolves. To compensate for this, the guide pins the version of `@aws/nx-plugin` to `1.0.0-rc.33`. You can try with the latest version if following along, but there may be some deviations from the guide.
4040
:::
4141

4242
## Example Migration: Shopping List Application
@@ -54,7 +54,7 @@ The shopping list application consists of the following PDK project types:
5454

5555
To start, we'll create a new workspace for our new project. While more extreme than an in-place migration, this approach gives us the cleanest end result. Creating an Nx workspace is equivalent to using PDK's `MonorepoTsProject`:
5656

57-
<CreateNxWorkspaceCommand workspace="shopping-list" iac="cdk" tag="1.0.0-rc.10" />
57+
<CreateNxWorkspaceCommand workspace="shopping-list" iac="cdk" tag="1.0.0-rc.33" />
5858

5959
Open up the `shopping-list` directory this command creates in your favourite IDE.
6060

docs/src/content/docs/en/snippets/pdk-migration/example/02-migrate-website.mdx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ As part of the migration, we will also move from PDK's configured React Router t
1717

1818
#### Generate a React Website
1919

20-
Run the <Link path="/guides/react-website">`ts#website` generator</Link> with `framework` set to `react` to set up your website project in `packages/website`:
20+
Run the <Link path="/guides/react-website">`ts#website` generator</Link> with `framework` set to `react` to set up your website project in `packages/website`. Since the shopping list application is built with CloudScape components, we also set `ux` to `cloudscape` (the default is `shadcn`):
2121

22-
<RunGenerator generator="ts#website" noInteractive requiredParameters={{ name: 'website', framework: 'react' }} />
22+
<RunGenerator generator="ts#website" noInteractive requiredParameters={{ name: 'website', framework: 'react', ux: 'cloudscape' }} />
2323

2424
#### Add Cognito Authentication
2525

@@ -66,7 +66,7 @@ The `CloudscapeReactTsWebsiteProject` automatically included a dependency on `@a
6666
```diff lang="ts"
6767
// packages/website/vite.config.mts
6868
build: {
69-
outDir: '../../dist/packages/website',
69+
outDir: '../../dist/packages/website/bundle',
7070
emptyOutDir: true,
7171
reportCompressedSize: true,
7272
commonjsOptions: {
@@ -98,16 +98,12 @@ Note that you'll now have some build errors visible in your IDE, we'll need to m
9898

9999
Since we're using [file-based routing](https://tanstack.com/router/latest/docs/framework/react/routing/file-based-routing), we can use the website local development server to manage automatically generating route configuration.
100100

101-
The Smithy API's local server runs with [`tsx`](https://github.com/privatenumber/tsx), so let's add it as a development dependency before starting the local servers:
101+
Let's start the local website server:
102102

103-
<InstallCommand dev pkg="tsx" />
104-
105-
Now let's start the local website server:
106-
107-
<NxCommands commands={["serve-local website"]} />
103+
<NxCommands commands={["dev website"]} />
108104

109105
:::tip
110-
We're using the `serve-local` target here, which also starts local servers for any APIs which have been connected with `connection`, and hot-reloads if your website, model, or backend changes! This allows us to test our API and website locally before we've even written any CDK code.
106+
We're using the `dev` target here, which also starts local servers for any APIs which have been connected with `connection`, and hot-reloads if your website, model, or backend changes! This allows us to test our API and website locally before we've even written any CDK code.
111107
:::
112108

113109
You'll see some errors, but the local website server should start on port `4200`, as well as the local Smithy API server on port `3001`.

0 commit comments

Comments
 (0)