Skip to content

Commit c0b8e3c

Browse files
authored
Merge pull request #7301 from diberry/diberry/0519-tsp-js-2
JS TypeSpec quickstart for a scaffolded server 2
2 parents c193bff + 033d650 commit c0b8e3c

File tree

6 files changed

+1028
-9
lines changed

6 files changed

+1028
-9
lines changed

articles/typespec/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
items:
99
- name: .NET
1010
href: quickstart-scaffold-dotnet.md
11+
- name: TypeScript
12+
href: quickstart-scaffold-typescript.md
1113
- name: Resources
1214
items:
1315
- name: Getting started

articles/typespec/includes/quickstart/file-structure-typescript.md

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,45 @@ ms.custom: devx-track-ts, devx-track-typespec
33
ms.topic: include
44
ms.date: 04/23/2025
55
---
6-
The project structure for the generated server includes the Express.js server, the package.json, and the middleware for your Azure integration.
6+
The Express.js project structure found at `tsp-output/server/` includes the generated server, the package.json, and the middleware for your Azure integration.
77

88
```console
9-
├── docs
10-
├── generated
11-
├── mocks
12-
├── server.ts
13-
├── README.md
9+
server
1410
├── package.json
15-
├── openapi3.json
11+
├── package-lock.json
12+
├── src
13+
│ ├── controllers
14+
│ │ └── widgets.ts
15+
│ ├── generated
16+
│ │ ├── helpers
17+
│ │ │ ├── datetime.ts
18+
│ │ │ ├── header.ts
19+
│ │ │ ├── http.ts
20+
│ │ │ ├── multipart.ts
21+
│ │ │ ├── router.ts
22+
│ │ │ └── temporal
23+
│ │ │ ├── native.ts
24+
│ │ │ └── polyfill.ts
25+
│ │ ├── http
26+
│ │ │ ├── openapi3.ts
27+
│ │ │ ├── operations
28+
│ │ │ │ └── server-raw.ts
29+
│ │ │ └── router.ts
30+
│ │ └── models
31+
│ │ └── all
32+
│ │ ├── demo-service.ts
33+
│ │ └── typespec.ts
34+
│ ├── index.ts
35+
│ └── swagger-ui.ts
36+
```
37+
38+
The file structure for the parent TypeSpec project includes this Express.js project in `tsp-output`:
39+
40+
```console
41+
├── tsp-output
42+
├── .gitignore
43+
├── main.tsp
44+
├── package-lock.json
45+
├── package.json
46+
├── tspconfig.yaml
1647
```

articles/typespec/includes/quickstart/prereqs-typescript.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.date: 04/23/2025
66
* An active Azure account. [Create an account for free](https://azure.microsoft.com/free) if you don't have one.
77
* [Node.js LTS](https://nodejs.org/) installed on your system.
88
* [TypeScript](https://www.typescriptlang.org/) for writing and compiling TypeScript code.
9-
9+
* [Docker](https://www.docker.com/)
1010
* [Visual Studio Code](https://code.visualstudio.com/)
1111
* [TypeSpec extension](https://marketplace.visualstudio.com/items?itemName=typespec.typespec-vscode)
12-
* Optional: Deployment with [Azure Developer CLI](azure/developer/azure-developer-cli/)
12+
* Optional: Deployment with [Azure Developer CLI](/azure/developer/azure-developer-cli/)

articles/typespec/index.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ landingContent:
2525
url: https://typespec.io/docs/
2626
- text: .NET Quickstart
2727
url: quickstart-scaffold-dotnet.md
28+
- text: TypeScript Quickstart
29+
url: quickstart-scaffold-typescript.md
2830

2931
- title: API language
3032
linkLists:

articles/typespec/quickstart-scaffold-dotnet.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,27 @@ Create the files needed to have a repeatable deployment with [Azure Developer CL
10121012
...bicep..
10131013
```
10141014

1015+
## Project structure
1016+
1017+
The final project structure includes the TypeSpec API files, the Express.js server, and the Azure deployment files:
1018+
1019+
```console
1020+
├── infra
1021+
├── tsp-output
1022+
├── .gitignore
1023+
├── .azure.yaml
1024+
├── Dockerfile
1025+
├── main.tsp
1026+
├── package-lock.json
1027+
├── package.json
1028+
├── tspconfig.yaml
1029+
```
1030+
1031+
| Area | Files/Directories |
1032+
|--------------------------|-----------------------------------------------------------------------------------|
1033+
| **TypeSpec** | `main.tsp`, `tspconfig.yaml` |
1034+
| **Express.js server** | `./tsp-output/server/` (includes generated files like `controllers/`, `models/`, `ServiceProject.csproj`) |
1035+
| **Azure Developer CLI deployment** | `./azure.yaml`,`./infra/` |
10151036

10161037
## Deploy application to Azure
10171038

0 commit comments

Comments
 (0)