You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/typescript-on-gcp/baseline.md
+20-17Lines changed: 20 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,33 +7,33 @@ layout: learningpathall
7
7
---
8
8
9
9
## Baseline Setup for TypeScript
10
-
This guide covers the **baseline setup and testing** of TypeScript on a **Google Axion C4A virtual machine** running SUSE Linux. The objective is to ensure that the TypeScript environment is installed correctly, that basic compilation works, and that a simple TypeScript script can run on the VM.
10
+
This section walks you through the baseline setup and validation of TypeScript on a Google Cloud C4A (Axion Arm64) virtual machine running SUSE Linux.
11
+
The goal is to confirm that your TypeScript environment is functioning correctly, from initializing a project to compiling and executing a simple TypeScript file, ensuring a solid foundation before performance or benchmarking steps.
11
12
12
13
### Set Up a TypeScript Project
13
-
Before testing, we need a project folder with all necessary TypeScript dependencies.
14
+
Before running any tests, you’ll create a dedicated project directory and initialize a minimal TypeScript environment.
14
15
15
-
**1. Create project folder**
16
+
1. Create project folder
16
17
17
-
Create a dedicated folder for your TypeScript project:
18
+
Start by creating a new folder to hold your TypeScript project files:
18
19
19
20
```console
20
21
mkdir ~/typescript-benchmark
21
22
cd ~/typescript-benchmark
22
23
```
23
-
This ensures all files are organized in one place, separate from system files.
24
+
This creates a workspace named `typescript-benchmark` in your home directory, ensuring all TypeScript configuration and source files are organized separately from system files and global modules.
24
25
25
-
**2. Initialize npm project**
26
+
2. Initialize npm project
26
27
27
-
Initialize a Node.js project with default settings:
28
+
Next, initialize a new Node.js project. This creates a `package.json` file that defines your project metadata, dependencies, and scripts.
28
29
29
30
```console
30
31
npm init -y
31
32
```
32
-
The above command creates a `package.json` file, which manages your project dependencies and scripts.
33
33
34
-
**3. Install Node.js type definitions**
34
+
3. Install Node.js type definitions
35
35
36
-
These definitions allow TypeScript to understand Node.js APIs, enabling type checking and code autocompletion.
36
+
To enable TypeScript to properly recognize Node.js built-in APIs (like fs, path, and process), install the Node.js type definitions package:
37
37
38
38
```console
39
39
npm install --save-dev @types/node
@@ -56,9 +56,9 @@ You should see output similar to:
56
56
```
57
57
58
58
### Baseline Testing
59
-
After setting up the project, we perform baseline testing to verify that TypeScript is working correctly on the GCP SUSE VM.
59
+
With the TypeScript environment configured, you’ll now perform a baseline functionality test to confirm that TypeScript compilation and execution work correctly on your Google Cloud SUSE Arm64 VM.
60
60
61
-
**1. Create a Simple TypeScript File**
61
+
1. Create a Simple TypeScript File
62
62
63
63
Create a file named `hello.ts` with the following content:
0 commit comments