6.031TS
6.031TS — Software Construction
TypeScript Pilot — Spring 2021

Getting Started

6.031 requires you to get up to speed quickly. You need to:

  • set up your software development environment,
  • learn the basics of programming in TypeScript, and
  • learn basic version control with Git.

To learn TypeScript, you will start with Reading 2 and complete the reading exercises on that page. Over the next few weeks, you will do TypeScript Tutor exercises to practice writing code.

If you have any questions, or any trouble following the instructions below, please visit lab hours to ask questions and get help from TAs and LAs.

Lab hours and deadlines in the 1st week

Wednesday, Feb 17

Thursday, Feb 18

Friday, Feb 19

Saturday, Feb 20

Sunday, Feb 21

First class at 11am

 

Lab hours
TBD

10pm: Reading 1 and Reading 2 reading exercises and TypeScript Tutor exercises due

11am before class: Problem Set 0 Part I due, including all steps and GitStream exercises on this page. You must have Node, TypeScript, Visual Studio Code, and Git set up and working on your laptop.

 

Lab hours
TBD

 

Lab hours
TBD

See the course calendar for the full schedule of office and lab hours. Lab hours may change depending on deadlines, so always check the calendar to see when lab hours are scheduled.

Step 0: TypeScript Setup

0.1 Install Node

Go to the Node.js Downloads page, and then:

  • for Windows or MacOS: use the Windows or MacOS installer

  • for Linux: click on “Installing Node.js via package manager” at the bottom of the page, and find the appropriate package for your Linux flavor

    • for Arch Linux: the nodejs package recommended by the Downloads page is likely to be the “Current” version of Node, which is not what you want. Try nodejs-lts-fermium instead so that you get the LTS version.

Make sure you install the LTS version of Node, version 14.x.x. (Do not install the “Current” version 16; that is the bleeding-edge development version.) If you already had an older version of Node installed, the installer will replace it with Node 14.

If the installer asks questions during installation, you can accept the default choices and just click Next.

After installing Node, confirm the installation and version by opening a terminal or command prompt and running:

node --version

It should report that you have version 14 (14.x.y for some x, y).

If you are using Windows, run the following command so that your npm command will be able to build problem sets:

npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"

If you are using MacOS or Linux, do not run this command.

0.2 Install TypeScript

After installing Node, open your terminal or command prompt, and run:

  • for MacOS or Linux:

    sudo -H npm install -g typescript ts-node
  • for Windows:

    npm install -g typescript ts-node

Confirm that your installation was successful by running the TypeScript compiler:

tsc --version

It should report that you have TypeScript version 4.

0.3: Install Visual Studio Code

Go to the Visual Studio Code download page, and download and install the appropriate installer for your platform. If you already have Visual Studio Code installed, you don’t need to reinstall it, just make sure it’s up to date by following the instructions below.

If the installer asks questions during installation, you can accept the default choices and just click Next.

Make sure that you have the latest version installed. Run Visual Studio Code, and either:

  • MacOS: CodeCheck for Updates…
  • Windows/Linux: HelpCheck for Updates…

It should either say “No updates available”, or help you update to the latest version.

Finally, confirm the version you are running:

  • MacOS: CodeAbout Visual Studio Code
  • Windows/Linux: HelpAbout

The first line of the dialog box should be version 1.52.x (or higher).

0.4: Install TypeScript Tutor

  1. Download the TypeScript Tutor plugin, which will save to your laptop as a file called praxis.vsix.

  2. Run Visual Studio Code, and go to View → Extensions.

  3. In the upper right corner of the Extensions pane that appears, click on ..., then Install from VSIX…, then find and install the praxis.vsix file you just downloaded.

  4. Close Visual Studio Code and restart it.

  5. From the menubar, choose View → Explorer. Then look at the bottom of the lefthand pane for the TYPESCRIPT TUTOR heading. Click on that heading to make it visible. The TypeScript Tutor pane may say something like “Oops. The Java Tutor doesn’t know who you are,” which means you still have to configure it using the next few steps.
    (TypeScript Tutor is hosted on the Java Tutor server, so it may mention “Java” in its error messages. That’s okay.)

  6. Open the settings panel:

    • Windows/Linux: File → Preferences → Settings

    • macOS: Code → Preferences → Settings

  7. At the bottom of the settings list on the left, open Extensions, and scroll down to click on TypeScript Tutor.

  8. Click here to get your personal start URL.
    (TypeScript Tutor is hosted on the Java Tutor server, so the URL will still include “Java” in several places. That’s okay.)

  9. In the box labeled Location: Personal Link, copy and paste your personal start URL.
    You should see the TypeScript Tutor immediately reload and show a page with “Basic TypeScript” at the top, which means it’s ready for use.

Steps 1-7: Java Setup

You will also need to do the Getting Started instructions for the 6.031 Java class.