Skip to content

Commit

Permalink
Update the tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed May 26, 2021
1 parent 0316b00 commit f65b8dc
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 19 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
registry-url: "https://registry.npmjs.org/"

- run: npm install
- run: npm run update --workspaces --if-present
- run: npm run build
- run: npm run test

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
packages/.cache
packages/*/index.d.ts
*.log
*.log
packages/shiki-twoslash/TypeScript-website/
105 changes: 105 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/gatsby-remark-shiki-twoslash/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
],
"scripts": {
"start": "tsdx watch",
"bootstrap": "yarn build",
"prepublishOnly": "yarn build",
"bootstrap": "npm run build",
"prepublishOnly": "npm run build",
"build": "tsdx build",
"test": "tsdx test",
"lint": "tsdx lint"
Expand Down
9 changes: 3 additions & 6 deletions packages/markdown-it-shiki-twoslash/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"bugs": {
"url": "https://github.com/microsoft/TypeScript-Website/issues"
},
"description": "A markdown-it plugin for Shiki with Wwoslash code samples",
"description": "A markdown-it plugin for Shiki with Twoslash code samples",
"author": "Orta Therox",
"main": "./dist/index.js",
"module": "./dist/markdown-it-shiki-twoslash.esm.js",
Expand All @@ -21,8 +21,8 @@
],
"scripts": {
"start": "tsdx watch",
"bootstrap": "yarn build",
"prepublishOnly": "yarn build",
"bootstrap": "npm run build",
"prepublishOnly": "npm run build",
"build": "tsdx build",
"test": "tsdx test",
"lint": "tsdx lint"
Expand All @@ -42,8 +42,5 @@
"tslib": "^1.10.0",
"typescript": "*",
"unified": "^8.4.2"
},
"jest": {
"testEnvironment": "node"
}
}
4 changes: 2 additions & 2 deletions packages/remark-shiki-twoslash/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
],
"scripts": {
"start": "tsdx watch",
"bootstrap": "yarn build",
"prepublishOnly": "yarn build",
"bootstrap": "npm run build",
"prepublishOnly": "npm run build",
"build": "tsdx build",
"test": "tsdx test",
"lint": "tsdx lint"
Expand Down
9 changes: 5 additions & 4 deletions packages/shiki-twoslash/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
],
"scripts": {
"start": "tsdx watch",
"prepublishOnly": "yarn build",
"bootstrap": "node scripts/generateTSConfigOneliners.js && yarn build",
"build": "tsdx build && yarn tsc src/dom.ts --outDir dist",
"prepublishOnly": "npm run ",
"update": "node scripts/generateTSConfigOneliners.js",
"build": "tsdx build && npx tsc src/dom.ts --outDir dist",
"test": "tsdx test",
"lint": "tsdx lint"
},
Expand All @@ -41,6 +41,7 @@
"tslib": "^1.10.0",
"typescript": "*",
"unified": "^8.4.2",
"unist-util-visit": "^2.0.0"
"unist-util-visit": "^2.0.0",
"gray-matter": "^4.0.3"
}
}
7 changes: 4 additions & 3 deletions packages/shiki-twoslash/scripts/generateTSConfigOneliners.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
/**
* Loops through the tsconfig markdown docs and generates a .ts files
* with the one-liners so they can show up in the rendered output for tsconfig JSONs
yarn workspace shiki-twoslash bootstrap
*/

const { readdirSync, writeFileSync } = require("fs")
const { join } = require("path")
const { read } = require("gray-matter")
const { format } = require("prettier")

const englishRoot = join(__dirname, "..", "..", "tsconfig-reference", "copy", "en", "options")
const exec = require("child_process").execSync
exec("git clone https://github.com/microsoft/TypeScript-website", { stdio: "inherit" })

const englishRoot = join("TypeScript-website", "packages", "tsconfig-reference", "copy", "en", "options")
const options = readdirSync(englishRoot).filter(p => !p.startsWith(".") && p.endsWith(".md"))

const lines = ["compilerOptions: `The set of compiler options for your project`,"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,5 @@ export const tsconfig = {
useDefineForClassFields: `Emit ECMAScript-standard-compliant class fields.`,
verbose: `Enable verbose logging`,
watchDirectory: `Specify how directories are watched on systems that lack recursive file-watching functionality.`,
watchFile: `Specify how the TypeScript watch mode works.`,
watchFile: `Specify how the TypeScript watch mode works.`
};

0 comments on commit f65b8dc

Please sign in to comment.