Skip to content

Why don't you use "honkit" #654

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -12,17 +12,17 @@ jobs:
SHA: ${{ github.sha }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: '12.18.2'
cache: 'npm'
- run: sudo apt update
- run: sudo apt install calibre-bin
- run: sudo npm install -g gitbook-cli
- run: gitbook install
- run: npm install
- run: mkdir output
- run: gitbook pdf . ./output/typescript-book-${SHA}.pdf
- run: gitbook epub . ./output/typescript-book-${SHA}.epub
- run: gitbook mobi . ./output/typescript-book-${SHA}.mobi
- run: npx honkit pdf . ./output/typescript-book-${SHA}.pdf
- run: npx honkit epub . ./output/typescript-book-${SHA}.epub
- run: npx honkit mobi . ./output/typescript-book-${SHA}.mobi
- name: upload pdf artifact
uses: actions/upload-artifact@v1
with:
12 changes: 6 additions & 6 deletions docs/compiler/overview.md
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ It is split into the follow key parts:
* Checker (`checker.ts`)
* Emitter (`emitter.ts`)

Each of these get their own unique files in the source. These parts will be explained later on in this chapter.
Each of these get their own unique files in the source. These parts will be explained later on in this chapter.

## Syntax vs. Semantics
Just because something is *syntactically* correct doesn't mean it is *semantically* correct. Consider the following piece of TypeScript code which although *syntactically* valid is *semantically* wrong
@@ -22,26 +22,26 @@ var foo: number = "not a number";
## Processing Overview
The following is a quick review of how these key parts of the TypeScript compiler compose:

```code
```
SourceCode ~~ scanner ~~> Token Stream
```

```code
```
Token Stream ~~ parser ~~> AST
```

```code
```
AST ~~ binder ~~> Symbols
```
`Symbol` is the primary building block of the TypeScript *semantic* system. As shown the symbols are created as a result of binding. Symbols connect declaration nodes in the AST to other declarations contributing to the same entity.

Symbols + AST are what is used by the checker to *semantically* validate the source code
```code
```
AST + Symbols ~~ checker ~~> Type Validation
```

Finally When a JS output is requested:
```code
```
AST + Checker ~~ emitter ~~> JS
```

2,705 changes: 2,705 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "typescript-book",
"description": "TypeScript Deep Dive",
"version": "1.0.0",
"repository": {
"type": "git",
"url": "git+https://github.com/basarat/typescript-book.git"
},
"author": "Basarat Ali Syed",
"license": "cc by",
"dependencies": {},
"devDependencies": {
"gitbook-plugin-adsense": "^1.0.3",
"gitbook-plugin-code": "^0.1.0",
"gitbook-plugin-edit-link": "^2.0.2",
"gitbook-plugin-github": "^3.0.0",
"gitbook-plugin-header": "^0.1.0",
"gitbook-plugin-layout": "0.0.1",
"gitbook-plugin-lunr": "^1.2.0",
"highlight.js": "^10.7.1",
"honkit": "^3.6.20"
}
}