├── ts └── .gitkeep ├── index.js ├── fixtures └── ts.mjs ├── CONTRIBUTING.md ├── prettier.config.js ├── tsconfig.json ├── README.md ├── .github ├── workflows │ ├── release-as-latest-tag.yml │ ├── publish-by-version.yml │ ├── publish.yml │ └── build.yml └── actions │ └── publish-npm │ └── action.yml ├── package.json ├── LICENSE ├── .gitignore ├── src ├── v4 │ ├── rewrite.ts │ ├── wrap.ts │ ├── convert.ts │ └── version.ts ├── wrap.mjs ├── rewrite.mjs ├── convert.mjs └── version.mjs └── yarn.lock /ts/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // nothing 3 | } 4 | -------------------------------------------------------------------------------- /fixtures/ts.mjs: -------------------------------------------------------------------------------- 1 | import _ts from "typescript"; 2 | 3 | const ts = { 4 | ..._ts, 5 | isInternalDeclaration: () => false 6 | }; 7 | 8 | export default ts; 9 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | ## Run in local 4 | 5 | ```sh 6 | rm -rf ts 7 | git clone git@github.com:microsoft/TypeScript.git --depth=1 -b v4.7.2 ts 8 | node ./src/rewrite.mjs ./ts 9 | yarn --cwd ./ts gulp local 10 | node ./src/convert.mjs ./ts/built/local -o ./libs/index.d.ts 11 | node ./src/version.mjs ./ts -o . 12 | ``` 13 | -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parser: 'typescript', 3 | semi: true, 4 | singleQuote: false, 5 | jsxSingleQuote: false, 6 | bracketSpacing: true, 7 | tabWidth: 4, 8 | useTabs: false, 9 | trailingComma: 'none', 10 | proseWrap: 'always', 11 | arrowParens: 'avoid', 12 | endOfLine: 'crlf' 13 | }; 14 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "alwaysStrict": true, 5 | "moduleResolution": "node", 6 | "target": "ES6", 7 | "module": "commonjs", 8 | "outDir": "dist", 9 | "declaration": true, 10 | "sourceMap": true 11 | }, 12 | "include": [ 13 | "src" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # open-typescript 2 | 3 | > No more typescript.d.ts ! 4 | 5 | Open-typescript is a clone of official TypeScript but expose all API definitions. 6 | It's useful to someone who often using internal APIs. We needn't copy & paste the API definition from TypeScript anymore. 7 | 8 | Happy hacking! 9 | 10 | ## Install 11 | 12 | 1. `yarn add open-typescript` or `npm i open-typescript` 13 | 2. `import 'open-typescript'` in some file. 14 | 3. Enjoy :XD 15 | -------------------------------------------------------------------------------- /.github/workflows/release-as-latest-tag.yml: -------------------------------------------------------------------------------- 1 | name: Release As Latest Tag 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | ref: 7 | description: "A valid ref(hash/tags/branch) on TypeScript, eg: v4.6.3, main" 8 | required: true 9 | default: 'main' 10 | 11 | jobs: 12 | publish: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v3 16 | - name: Publish latest tag 17 | uses: ./.github/actions/publish-npm 18 | with: 19 | distTag: "latest" 20 | ref: ${{ github.event.inputs.ref }} 21 | npmToken: ${{ secrets.NPM_TOKEN }} 22 | -------------------------------------------------------------------------------- /.github/workflows/publish-by-version.yml: -------------------------------------------------------------------------------- 1 | # Dev version will include time info 2 | # For example: 4.7.2-dev.20220812 3 | 4 | name: Publish By Input Version As dev Tag 5 | 6 | on: 7 | workflow_dispatch: 8 | inputs: 9 | ref: 10 | description: "A valid ref(hash/tags/branch) on TypeScript, eg: v4.6.3, main" 11 | required: true 12 | default: 'main' 13 | 14 | jobs: 15 | publish: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/checkout@v3 19 | - name: Publish latest tag 20 | uses: ./.github/actions/publish-npm 21 | with: 22 | distTag: "dev" 23 | npmToken: ${{ secrets.NPM_TOKEN }} 24 | ref: ${{ github.event.inputs.ref }} 25 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "open-typescript", 3 | "version": "0.0.1", 4 | "main": "./index.js", 5 | "types": "./libs/index.d.ts", 6 | "repository": "git@github.com:HearTao/open-typescript.git", 7 | "author": "kingwl ", 8 | "license": "MIT", 9 | "devDependencies": { 10 | "@ast-grep/napi": "^0.18.1", 11 | "@types/node": "^14.14.31", 12 | "@types/yargs": "^17.0.32", 13 | "magic-string": "^0.30.6", 14 | "prettier": "^2.2.1", 15 | "tsx": "^4.7.0", 16 | "typescript": "^5.3.3", 17 | "yargs": "^17.7.2" 18 | }, 19 | "scripts": { 20 | "lint": "prettier -c --config ./prettier.config.js ./src/**/*.{ts,tsx}", 21 | "prettier": "yarn lint --write" 22 | }, 23 | "files": [ 24 | "libs", 25 | "index.js" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 HearTao 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish 2 | 3 | on: 4 | push: 5 | tags: [ '*' ] 6 | 7 | jobs: 8 | publish: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | - name: Use Node.js 18.x 13 | uses: actions/setup-node@v1 14 | with: 15 | node-version: 18.x 16 | - name: Install yarn 17 | run: npm install -g yarn 18 | - name: Bootstrap Script 19 | run: yarn 20 | - uses: actions/checkout@v2 21 | with: 22 | repository: microsoft/TypeScript 23 | path: ts 24 | - name: Bootstrap TypeScript 25 | run: npm install 26 | working-directory: ./ts 27 | - name: Rewrite TypeScript Config 28 | run: node ./src/rewrite.mjs ./ts 29 | - name: Build TypeScript 30 | run: npm run build 31 | working-directory: ./ts 32 | - name: Convert libs 33 | run: node ./src/convert.mjs ./ts/built/local -o ./libs/index.d.ts 34 | - name: Rewrite version 35 | run: node ./src/version.mjs ./ts -o . 36 | - name: Publish 37 | uses: JS-DevTools/npm-publish@v1 38 | with: 39 | token: ${{ secrets.NPM_TOKEN }} 40 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | workflow_dispatch: 9 | 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: Use Node.js 18.x 17 | uses: actions/setup-node@v1 18 | with: 19 | node-version: 18.x 20 | - name: Install yarn 21 | run: npm install -g yarn 22 | - name: Bootstrap Script 23 | run: yarn 24 | - uses: actions/checkout@v2 25 | with: 26 | repository: microsoft/TypeScript 27 | path: ts 28 | - name: Bootstrap TypeScript 29 | run: npm install 30 | working-directory: ./ts 31 | - name: Rewrite TypeScript Config 32 | run: node ./src/rewrite.mjs ./ts 33 | - name: Build TypeScript 34 | run: npm run build 35 | working-directory: ./ts 36 | - name: Convert libs 37 | run: node ./src/convert.mjs ./ts/built/local -o ./libs/index.d.ts 38 | - name: Upload build 39 | uses: actions/upload-artifact@v4 40 | with: 41 | name: libs 42 | path: ./libs 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | -------------------------------------------------------------------------------- /src/v4/rewrite.ts: -------------------------------------------------------------------------------- 1 | import * as fs from "fs"; 2 | import * as path from "path"; 3 | import * as yargs from "yargs"; 4 | 5 | interface Argv { 6 | input: string; 7 | } 8 | 9 | const jsonConfigFiles = [ 10 | "src/tsconfig-library-base.json", 11 | "src/tsc/tsconfig.release.json" 12 | ]; 13 | 14 | function handler() { 15 | return function handler1(argv: yargs.Arguments): void { 16 | const inputPath = argv.input; 17 | 18 | if (!fs.statSync(inputPath).isDirectory()) { 19 | throw new Error("Input must be a directory"); 20 | } 21 | 22 | jsonConfigFiles.forEach(jsonFile => { 23 | const jsonPath = path.join(inputPath, jsonFile); 24 | if (!fs.existsSync(jsonPath)) { 25 | throw new Error(`Cannot find file: ` + jsonFile); 26 | } 27 | 28 | console.log(`Rewrite: [${jsonPath}]`); 29 | const content = fs.readFileSync(jsonPath).toString(); 30 | const packageJson = JSON.parse(content); 31 | 32 | if ( 33 | packageJson.compilerOptions && 34 | packageJson.compilerOptions.stripInternal 35 | ) { 36 | packageJson.compilerOptions.stripInternal = false; 37 | } 38 | fs.writeFileSync( 39 | jsonPath, 40 | JSON.stringify(packageJson, undefined, 4) 41 | ); 42 | }); 43 | console.log(`Rewrite done`); 44 | }; 45 | } 46 | 47 | function main() { 48 | yargs 49 | .strict() 50 | .command({ 51 | command: `$0 `, 52 | handler: handler(), 53 | builder: (yargs: yargs.Argv): yargs.Argv => { 54 | return yargs.positional("input", { 55 | describe: "TypeScript repo path", 56 | type: "string", 57 | normalize: true 58 | }); 59 | } 60 | }) 61 | .version() 62 | .alias("v", "version") 63 | .showHelpOnFail(true, "Specify --help for available options") 64 | .help("h") 65 | .alias("h", "help").argv; 66 | } 67 | 68 | main(); 69 | -------------------------------------------------------------------------------- /.github/actions/publish-npm/action.yml: -------------------------------------------------------------------------------- 1 | name: "Publish By Input Version" 2 | description: Publish By Input Version 3 | 4 | inputs: 5 | ref: 6 | description: "A valid ref(hash/tags/branch) on TypeScript, eg: v4.6.3, main" 7 | required: true 8 | default: 'main' 9 | npmToken: 10 | description: "NPM Token" 11 | required: true 12 | distTag: 13 | description: "distTag" 14 | required: true 15 | default: 'dev' 16 | 17 | runs: 18 | using: "composite" 19 | steps: 20 | - uses: actions/checkout@v2 21 | - name: Use Node.js 18.x 22 | uses: actions/setup-node@v1 23 | with: 24 | node-version: 18.x 25 | - name: Install yarn 26 | run: npm install -g yarn 27 | shell: bash 28 | - name: Bootstrap Script 29 | run: yarn 30 | shell: bash 31 | - uses: actions/checkout@v2 32 | with: 33 | repository: microsoft/TypeScript 34 | ref: ${{ inputs.ref }} 35 | path: ts 36 | - name: Bootstrap TypeScript 37 | run: npm install 38 | working-directory: ./ts 39 | shell: bash 40 | - name: Rewrite TypeScript Config 41 | shell: bash 42 | run: node ./src/rewrite.mjs ./ts 43 | - name: Build TypeScript 44 | shell: bash 45 | run: npm run build 46 | working-directory: ./ts 47 | - name: Convert libs 48 | shell: bash 49 | run: node ./src/convert.mjs ./ts/built/local -o ./libs/index.d.ts 50 | - name: Rewrite version 51 | shell: bash 52 | run: node ./src/version.mjs ./ts -o . --dist-tag ${{ inputs.distTag }} 53 | - name: Publish 54 | uses: JS-DevTools/npm-publish@v1 55 | with: 56 | token: ${{ inputs.npmToken }} 57 | tag: ${{ inputs.distTag }} 58 | - name: Adding GITHUB_STEP_SUMMARY 59 | shell: bash 60 | if: success() 61 | run: | 62 | CURRENT_VERSION=$(node -p 'require("./package.json").version') 63 | echo '### Released :rocket:' $CURRENT_VERSION >> $GITHUB_STEP_SUMMARY 64 | echo '```' >> $GITHUB_STEP_SUMMARY 65 | echo $CURRENT_VERSION >> $GITHUB_STEP_SUMMARY 66 | echo '```' >> $GITHUB_STEP_SUMMARY 67 | echo 'user input ref:' $INPUT_REF >> $GITHUB_STEP_SUMMARY 68 | echo '```log' >> $GITHUB_STEP_SUMMARY 69 | git log --oneline -1 >> $GITHUB_STEP_SUMMARY 70 | echo '```' >> $GITHUB_STEP_SUMMARY 71 | env: 72 | INPUT_REF: ${{ inputs.ref }} 73 | -------------------------------------------------------------------------------- /src/wrap.mjs: -------------------------------------------------------------------------------- 1 | import ts from "typescript"; 2 | 3 | function isDef(v) { 4 | return v !== undefined && v !== null; 5 | } 6 | 7 | export function wrapDtsIntoDeclareModule(filename, content, moduleName) { 8 | const sourceFile = ts.createSourceFile( 9 | filename, 10 | content, 11 | ts.ScriptTarget.Latest 12 | ); 13 | const filterOutDeclarationKeyword = modifier => 14 | modifier.kind !== ts.SyntaxKind.DeclareKeyword; 15 | 16 | const stmts = sourceFile.statements 17 | .map(stmt => { 18 | if ( 19 | ts.isModuleDeclaration(stmt) && 20 | stmt.flags & ts.NodeFlags.Namespace 21 | ) { 22 | return ts.factory.updateModuleDeclaration( 23 | stmt, 24 | stmt.modifiers?.filter(filterOutDeclarationKeyword), 25 | stmt.name, 26 | stmt.body 27 | ); 28 | } else if (ts.isFunctionDeclaration(stmt)) { 29 | return ts.factory.updateFunctionDeclaration( 30 | stmt, 31 | stmt.modifiers?.filter(filterOutDeclarationKeyword), 32 | stmt.asteriskToken, 33 | stmt.name, 34 | stmt.typeParameters, 35 | stmt.parameters, 36 | stmt.type, 37 | stmt.body 38 | ); 39 | } else if (ts.isNamespaceExportDeclaration(stmt)) { 40 | return undefined; 41 | } else if (ts.isVariableStatement(stmt)) { 42 | return ts.factory.updateVariableStatement( 43 | stmt, 44 | stmt.modifiers?.filter(filterOutDeclarationKeyword), 45 | stmt.declarationList 46 | ); 47 | } 48 | return stmt; 49 | }) 50 | .filter(isDef); 51 | 52 | const newSourceFile = ts.factory.createSourceFile( 53 | [ 54 | ts.factory.createModuleDeclaration( 55 | [ts.factory.createModifier(ts.SyntaxKind.DeclareKeyword)], 56 | ts.factory.createStringLiteral(moduleName), 57 | ts.factory.createModuleBlock(stmts), 58 | sourceFile.flags 59 | ) 60 | ], 61 | ts.factory.createToken(ts.SyntaxKind.EndOfFileToken), 62 | ts.NodeFlags.None 63 | ); 64 | 65 | const printer = ts.createPrinter(); 66 | return printer.printFile(newSourceFile); 67 | } 68 | -------------------------------------------------------------------------------- /src/rewrite.mjs: -------------------------------------------------------------------------------- 1 | import { js } from "@ast-grep/napi"; 2 | import fs from "fs"; 3 | import path from "path"; 4 | import yargs from "yargs/yargs"; 5 | import { hideBin } from "yargs/helpers"; 6 | import MagicString from "magic-string"; 7 | import url from "url"; 8 | 9 | const dtsBundlerPath = "scripts/dtsBundler.mjs"; 10 | 11 | const __filename = url.fileURLToPath(new URL(import.meta.url)); 12 | const __dirname = path.dirname(__filename); 13 | 14 | /** 15 | * Replace the local variable name of the import statement 16 | */ 17 | const replaceImportTypeScript = source => { 18 | const magic = new MagicString(source); 19 | 20 | const ast = js.parse(source); // 1. parse the source 21 | const root = ast.root(); // 2. get the root 22 | const node = root.find({ 23 | rule: { 24 | pattern: `import ts from "$TS";` 25 | } 26 | }); 27 | 28 | // 3. find the node 29 | const localNode = node.getMatch("TS"); 30 | const localNodeText = localNode.text(); 31 | 32 | const range = localNode.range(); 33 | magic.overwrite(range.start.index, range.end.index, "./ts.mjs"); 34 | 35 | const result = magic.toString(); 36 | return result; 37 | }; 38 | 39 | function handler() { 40 | return function handler1(argv) { 41 | const inputPath = argv.input; 42 | 43 | if (!fs.statSync(inputPath).isDirectory()) { 44 | throw new Error("Input must be a directory"); 45 | } 46 | 47 | const hackedTsPath = path.join(__dirname, "../fixtures/ts.mjs"); 48 | const targetPath = path.join(inputPath, "scripts/ts.mjs"); 49 | const bundlerPath = path.join(inputPath, dtsBundlerPath); 50 | fs.copyFileSync(hackedTsPath, targetPath); 51 | 52 | let fileContent = fs.readFileSync(bundlerPath, "utf-8"); 53 | fileContent = replaceImportTypeScript(fileContent); 54 | 55 | fs.writeFileSync(bundlerPath, fileContent); 56 | 57 | console.log(`Rewrite done`); 58 | }; 59 | } 60 | 61 | function main() { 62 | yargs(hideBin(process.argv)) 63 | .strict() 64 | .command({ 65 | command: `$0 `, 66 | handler: handler(), 67 | builder: yargs => { 68 | return yargs.positional("input", { 69 | describe: "TypeScript repo path", 70 | type: "string", 71 | normalize: true 72 | }); 73 | } 74 | }) 75 | .version() 76 | .alias("v", "version") 77 | .showHelpOnFail(true, "Specify --help for available options") 78 | .help("h") 79 | .alias("h", "help").argv; 80 | } 81 | 82 | main(); 83 | -------------------------------------------------------------------------------- /src/v4/wrap.ts: -------------------------------------------------------------------------------- 1 | import * as ts from "typescript"; 2 | 3 | function isDef(v: T | undefined | null): v is T { 4 | return v !== undefined && v !== null; 5 | } 6 | 7 | export function wrapDtsIntoDeclareModule( 8 | filename: string, 9 | content: string, 10 | moduleName: string 11 | ) { 12 | const sourceFile = ts.createSourceFile( 13 | filename, 14 | content, 15 | ts.ScriptTarget.Latest 16 | ); 17 | const filterOutDeclarationKeyword = (modifier: ts.Modifier) => 18 | modifier.kind !== ts.SyntaxKind.DeclareKeyword; 19 | 20 | const stmts = sourceFile.statements 21 | .map(stmt => { 22 | if ( 23 | ts.isModuleDeclaration(stmt) && 24 | stmt.flags & ts.NodeFlags.Namespace 25 | ) { 26 | return ts.factory.updateModuleDeclaration( 27 | stmt, 28 | stmt.decorators, 29 | stmt.modifiers?.filter(filterOutDeclarationKeyword), 30 | stmt.name, 31 | stmt.body 32 | ); 33 | } else if (ts.isFunctionDeclaration(stmt)) { 34 | return ts.factory.updateFunctionDeclaration( 35 | stmt, 36 | stmt.decorators, 37 | stmt.modifiers?.filter(filterOutDeclarationKeyword), 38 | stmt.asteriskToken, 39 | stmt.name, 40 | stmt.typeParameters, 41 | stmt.parameters, 42 | stmt.type, 43 | stmt.body 44 | ); 45 | } else if (ts.isNamespaceExportDeclaration(stmt)) { 46 | return undefined; 47 | } else if (ts.isVariableStatement(stmt)) { 48 | return ts.factory.updateVariableStatement( 49 | stmt, 50 | stmt.modifiers?.filter(filterOutDeclarationKeyword), 51 | stmt.declarationList 52 | ); 53 | } 54 | return stmt; 55 | }) 56 | .filter(isDef); 57 | 58 | const newSourceFile = ts.factory.createSourceFile( 59 | [ 60 | ts.factory.createModuleDeclaration( 61 | undefined, 62 | [ts.factory.createModifier(ts.SyntaxKind.DeclareKeyword)], 63 | ts.factory.createStringLiteral(moduleName), 64 | ts.factory.createModuleBlock(stmts), 65 | sourceFile.flags 66 | ) 67 | ], 68 | ts.factory.createToken(ts.SyntaxKind.EndOfFileToken), 69 | ts.NodeFlags.None 70 | ); 71 | 72 | const printer = ts.createPrinter(); 73 | return printer.printFile(newSourceFile); 74 | } 75 | -------------------------------------------------------------------------------- /src/v4/convert.ts: -------------------------------------------------------------------------------- 1 | import * as fs from "fs"; 2 | import * as path from "path"; 3 | import * as yargs from "yargs"; 4 | import { wrapDtsIntoDeclareModule } from "./wrap"; 5 | 6 | interface Argv { 7 | input: string; 8 | output: string; 9 | } 10 | 11 | const declarationFiles = [ 12 | "typescriptServices.d.ts", 13 | "typescript.d.ts", 14 | "tsserverlibrary.d.ts" 15 | ]; 16 | 17 | const modulePrefix = "typescript/lib/"; 18 | 19 | function resolveModuleName(basename: string) { 20 | if (basename === "typescript") { 21 | return basename; 22 | } 23 | return modulePrefix + basename; 24 | } 25 | 26 | function handler() { 27 | return function handler1(argv: yargs.Arguments): void { 28 | const inputPath = argv.input; 29 | const outputPath = argv.output; 30 | 31 | if (!fs.statSync(inputPath).isDirectory()) { 32 | throw new Error("Input must be a directory"); 33 | } 34 | 35 | const results = declarationFiles.map(file => { 36 | const filePath = path.join(inputPath, file); 37 | if (!fs.existsSync(filePath)) { 38 | throw new Error(`Cannot find file: ` + file); 39 | } 40 | 41 | console.log(`Started: [${filePath}]`); 42 | const content = fs.readFileSync(filePath).toString(); 43 | const result = wrapDtsIntoDeclareModule( 44 | file, 45 | content, 46 | resolveModuleName(path.basename(file, ".d.ts")) 47 | ); 48 | console.log(`Finished: [${filePath}]`); 49 | return result; 50 | }); 51 | 52 | const outputDir = path.dirname(outputPath); 53 | if (!fs.existsSync(outputDir)) { 54 | fs.mkdirSync(outputDir); 55 | } 56 | 57 | fs.writeFileSync(outputPath, results.join("\n")); 58 | console.log(`Combined: [${outputPath}]`); 59 | }; 60 | } 61 | 62 | function main() { 63 | yargs 64 | .strict() 65 | .command({ 66 | command: `$0 [options]`, 67 | handler: handler(), 68 | builder: (yargs: yargs.Argv): yargs.Argv => { 69 | return yargs.positional("input", { 70 | describe: "TypeScript Declaration files path", 71 | type: "string", 72 | normalize: true 73 | }); 74 | } 75 | }) 76 | .option("o", { 77 | alias: "output", 78 | describe: "Output file path", 79 | type: "string", 80 | requiresArg: true 81 | }) 82 | .version() 83 | .alias("v", "version") 84 | .showHelpOnFail(true, "Specify --help for available options") 85 | .help("h") 86 | .alias("h", "help").argv; 87 | } 88 | 89 | main(); 90 | -------------------------------------------------------------------------------- /src/convert.mjs: -------------------------------------------------------------------------------- 1 | import * as fs from "fs"; 2 | import * as path from "path"; 3 | import { wrapDtsIntoDeclareModule } from "./wrap.mjs"; 4 | import yargs from "yargs/yargs"; 5 | import { hideBin } from "yargs/helpers"; 6 | import url from "url"; 7 | 8 | const declarationFiles = ["typescript.d.ts", "tsserverlibrary.d.ts"]; 9 | 10 | const __filename = url.fileURLToPath(new URL(import.meta.url)); 11 | const __dirname = path.dirname(__filename); 12 | 13 | const modulePrefix = "typescript/lib/"; 14 | 15 | function resolveModuleName(basename) { 16 | if (basename === "typescript") { 17 | return basename; 18 | } 19 | return modulePrefix + basename; 20 | } 21 | 22 | function handler() { 23 | return function handler1(argv) { 24 | const inputPath = argv.input; 25 | const outputPath = argv.output; 26 | 27 | if (!fs.statSync(inputPath).isDirectory()) { 28 | throw new Error("Input must be a directory"); 29 | } 30 | 31 | const results = declarationFiles.map(file => { 32 | const filePath = path.join(inputPath, file); 33 | if (!fs.existsSync(filePath)) { 34 | throw new Error(`Cannot find file: ` + file); 35 | } 36 | 37 | console.log(`Started: [${filePath}]`); 38 | const content = fs.readFileSync(filePath).toString(); 39 | const result = wrapDtsIntoDeclareModule( 40 | file, 41 | content, 42 | resolveModuleName(path.basename(file, ".d.ts")) 43 | ); 44 | console.log(`Finished: [${filePath}]`); 45 | return result; 46 | }); 47 | 48 | const outputDir = path.dirname(outputPath); 49 | if (!fs.existsSync(outputDir)) { 50 | fs.mkdirSync(outputDir); 51 | } 52 | 53 | fs.writeFileSync(outputPath, results.join("\n")); 54 | console.log(`Combined: [${outputPath}]`); 55 | }; 56 | } 57 | 58 | function main() { 59 | yargs(hideBin(process.argv)) 60 | .strict() 61 | .command({ 62 | command: `$0 [options]`, 63 | handler: handler(), 64 | builder: yargs => { 65 | return yargs.positional("input", { 66 | describe: "TypeScript Declaration files path", 67 | type: "string", 68 | normalize: true 69 | }); 70 | } 71 | }) 72 | .option("o", { 73 | alias: "output", 74 | describe: "Output file path", 75 | type: "string", 76 | requiresArg: true 77 | }) 78 | .version() 79 | .alias("v", "version") 80 | .showHelpOnFail(true, "Specify --help for available options") 81 | .help("h") 82 | .alias("h", "help").argv; 83 | } 84 | 85 | main(); 86 | -------------------------------------------------------------------------------- /src/version.mjs: -------------------------------------------------------------------------------- 1 | import fs from "fs"; 2 | import path from "path"; 3 | import yargs from "yargs/yargs"; 4 | import { hideBin } from "yargs/helpers"; 5 | function handler() { 6 | return function handler1(argv) { 7 | const inputPath = argv.input; 8 | const outputPath = argv.output; 9 | const distTag = argv.distTag; 10 | 11 | const inputPackageJsonPath = path.join(inputPath, "package.json"); 12 | if (!fs.existsSync(inputPackageJsonPath)) { 13 | throw new Error("Input must have package.json"); 14 | } 15 | 16 | const outputPackageJsonPath = path.join(outputPath, "package.json"); 17 | if (!fs.existsSync(outputPackageJsonPath)) { 18 | throw new Error("Output must have package.json"); 19 | } 20 | 21 | const inputContent = fs.readFileSync(inputPackageJsonPath).toString(); 22 | const inputPackageJson = JSON.parse(inputContent); 23 | console.log( 24 | `Read version: [${inputPackageJsonPath}]: ${inputPackageJson.version}` 25 | ); 26 | 27 | console.log(`Write version: [${outputPackageJsonPath}]`); 28 | const outputContent = fs.readFileSync(outputPackageJsonPath).toString(); 29 | const outputPackageJson = JSON.parse(outputContent); 30 | let version = inputPackageJson.version; 31 | if (distTag === "dev") { 32 | const now = new Date(); 33 | const localeDateString = now.toLocaleDateString("en-US", { 34 | year: "numeric", 35 | month: "2-digit", 36 | day: "2-digit" 37 | }); 38 | const [month, date, year] = localeDateString.split("/"); 39 | version = `${inputPackageJson.version}-dev.${year}${month}${date}`; 40 | } 41 | 42 | outputPackageJson.version = version; 43 | console.log(`target version: ${version}`); 44 | 45 | fs.writeFileSync( 46 | outputPackageJsonPath, 47 | JSON.stringify(outputPackageJson, undefined, 4) 48 | ); 49 | console.log(`Write version done`); 50 | }; 51 | } 52 | 53 | function main() { 54 | yargs(hideBin(process.argv)) 55 | .strict() 56 | .command({ 57 | command: `$0 [options]`, 58 | handler: handler(), 59 | builder: yargs => { 60 | return yargs.positional("input", { 61 | describe: "TypeScript repo path", 62 | type: "string", 63 | normalize: true 64 | }); 65 | } 66 | }) 67 | .option("o", { 68 | alias: "output", 69 | describe: "Output directory", 70 | type: "string", 71 | requiresArg: true 72 | }) 73 | .option("dist-tag", { 74 | describe: 75 | "dev or latest, version of dist-tag will has current date information", 76 | type: "string", 77 | default: "dev" 78 | }) 79 | .version() 80 | .alias("v", "version") 81 | .showHelpOnFail(true, "Specify --help for available options") 82 | .help("h") 83 | .alias("h", "help").argv; 84 | } 85 | 86 | main(); 87 | -------------------------------------------------------------------------------- /src/v4/version.ts: -------------------------------------------------------------------------------- 1 | import * as fs from "fs"; 2 | import * as path from "path"; 3 | import * as yargs from "yargs"; 4 | 5 | interface Argv { 6 | input: string; 7 | output: string; 8 | distTag: "dev" | "latest"; 9 | } 10 | 11 | function handler() { 12 | return function handler1(argv: yargs.Arguments): void { 13 | const inputPath = argv.input; 14 | const outputPath = argv.output; 15 | const distTag = argv.distTag; 16 | 17 | const inputPackageJsonPath = path.join(inputPath, "package.json"); 18 | if (!fs.existsSync(inputPackageJsonPath)) { 19 | throw new Error("Input must have package.json"); 20 | } 21 | 22 | const outputPackageJsonPath = path.join(outputPath, "package.json"); 23 | if (!fs.existsSync(outputPackageJsonPath)) { 24 | throw new Error("Output must have package.json"); 25 | } 26 | 27 | const inputContent = fs.readFileSync(inputPackageJsonPath).toString(); 28 | const inputPackageJson = JSON.parse(inputContent); 29 | console.log(`Read version: [${inputPackageJsonPath}]: ${inputPackageJson.version}`); 30 | 31 | console.log(`Write version: [${outputPackageJsonPath}]`); 32 | const outputContent = fs.readFileSync(outputPackageJsonPath).toString(); 33 | const outputPackageJson = JSON.parse(outputContent); 34 | let version = inputPackageJson.version; 35 | if (distTag === "dev") { 36 | const now = new Date(); 37 | const localeDateString = now.toLocaleDateString("en-US", { 38 | year: "numeric", 39 | month: "2-digit", 40 | day: "2-digit" 41 | }); 42 | const [month, date, year] = localeDateString.split("/"); 43 | version = `${inputPackageJson.version}-dev.${year}${month}${date}`; 44 | } 45 | 46 | outputPackageJson.version = version; 47 | console.log(`target version: ${version}`); 48 | 49 | fs.writeFileSync( 50 | outputPackageJsonPath, 51 | JSON.stringify(outputPackageJson, undefined, 4) 52 | ); 53 | console.log(`Write version done`); 54 | }; 55 | } 56 | 57 | function main() { 58 | yargs 59 | .strict() 60 | .command({ 61 | command: `$0 [options]`, 62 | handler: handler(), 63 | builder: (yargs: yargs.Argv): yargs.Argv => { 64 | return yargs.positional("input", { 65 | describe: "TypeScript repo path", 66 | type: "string", 67 | normalize: true 68 | }); 69 | } 70 | }) 71 | .option("o", { 72 | alias: "output", 73 | describe: "Output directory", 74 | type: "string", 75 | requiresArg: true 76 | }) 77 | .option("dist-tag", { 78 | describe: 79 | "dev or latest, version of dist-tag will has current date information", 80 | type: "string", 81 | default: "dev" 82 | }) 83 | .version() 84 | .alias("v", "version") 85 | .showHelpOnFail(true, "Specify --help for available options") 86 | .help("h") 87 | .alias("h", "help").argv; 88 | } 89 | 90 | main(); 91 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@ast-grep/napi-darwin-arm64@0.18.1": 6 | version "0.18.1" 7 | resolved "https://registry.yarnpkg.com/@ast-grep/napi-darwin-arm64/-/napi-darwin-arm64-0.18.1.tgz#fe359e38a7e294b16ce9bfe4e0585a6c60979a99" 8 | integrity sha512-s7UVJrCPAyinlyvBea9+0LecnfxNJEjiUQYUqoNOt2OgDCsfSiSdsKfeouOsyyPKeE0qUh5ApXLbh2swkS47xw== 9 | 10 | "@ast-grep/napi-darwin-x64@0.18.1": 11 | version "0.18.1" 12 | resolved "https://registry.yarnpkg.com/@ast-grep/napi-darwin-x64/-/napi-darwin-x64-0.18.1.tgz#3aa454eab924581b918362fefb368dbd0d86a68a" 13 | integrity sha512-5wmPPdEnNpZdkDH6SBfjiUvHvQfMCbJ//OuFKCGK3sbt2/KHO+qE9O/s+PnHvre7Jq37ILPYJdjlCFkZW0aDoA== 14 | 15 | "@ast-grep/napi-linux-arm64-gnu@0.18.1": 16 | version "0.18.1" 17 | resolved "https://registry.yarnpkg.com/@ast-grep/napi-linux-arm64-gnu/-/napi-linux-arm64-gnu-0.18.1.tgz#a88e86f1d8d3ff4f669a9715b4a803692c617ed8" 18 | integrity sha512-Nsca7vGZCAElw9mAJyiudbh32mQx+O7YToibI4omw+Flo6CLONW4ks/6v+6USlKxO3zhHsyQr2EGWO4MAFekdg== 19 | 20 | "@ast-grep/napi-linux-x64-gnu@0.18.1": 21 | version "0.18.1" 22 | resolved "https://registry.yarnpkg.com/@ast-grep/napi-linux-x64-gnu/-/napi-linux-x64-gnu-0.18.1.tgz#edd78a7b55c0c06254416bb041e8f490230defc9" 23 | integrity sha512-xUxN7SLtCjibq1tm8ZeSFshgQjuw9RQQp8GGEc3awQiSlezGXo1mWNPFOXWoVfw1goT7zwzBGZRRmLTyXxb2Ug== 24 | 25 | "@ast-grep/napi-win32-arm64-msvc@0.18.1": 26 | version "0.18.1" 27 | resolved "https://registry.yarnpkg.com/@ast-grep/napi-win32-arm64-msvc/-/napi-win32-arm64-msvc-0.18.1.tgz#cb2abab818a9cb7e4f380c065c79a5ce10bb7ea3" 28 | integrity sha512-i88Id7CNnh8TFYBGhcreozZO81c1QpLHXuhoGjaLfhqr7SozAl4tDKmMXJL2OQw5NCt7cqzfVXgrEzdxRToOFQ== 29 | 30 | "@ast-grep/napi-win32-ia32-msvc@0.18.1": 31 | version "0.18.1" 32 | resolved "https://registry.yarnpkg.com/@ast-grep/napi-win32-ia32-msvc/-/napi-win32-ia32-msvc-0.18.1.tgz#e2f7bb3ea873201621e066cac54743445f407f92" 33 | integrity sha512-jl9GODdH83ap6jVsKXEFyCKMFSqyNHSINvt1Z7DdyXmWy+rfUS9650zxBbdY9VN7vhgQCrNDDsLr5XZY+tXZcg== 34 | 35 | "@ast-grep/napi-win32-x64-msvc@0.18.1": 36 | version "0.18.1" 37 | resolved "https://registry.yarnpkg.com/@ast-grep/napi-win32-x64-msvc/-/napi-win32-x64-msvc-0.18.1.tgz#f69323ce006270f7e3e2af80e1e2cd64112c6be6" 38 | integrity sha512-YaNi8hoXVgzuQtiJboH6YlLc+XVRHDJV8YorkXoB0EkEYhOHYW1pHQGLUmEulfHRhNtlLffv9ucEqwAG6HK3Zg== 39 | 40 | "@ast-grep/napi@^0.18.1": 41 | version "0.18.1" 42 | resolved "https://registry.yarnpkg.com/@ast-grep/napi/-/napi-0.18.1.tgz#6287f881546204ad43caa3939a6a990aff764ffd" 43 | integrity sha512-iIi/tkXixSzsdNlaswWPOY4RGzROcU65hKT0aScdM5MjkpTY3dJcXcVs4TPGfFaZD0wXiiLP7mI4jeNfuiC/Lg== 44 | optionalDependencies: 45 | "@ast-grep/napi-darwin-arm64" "0.18.1" 46 | "@ast-grep/napi-darwin-x64" "0.18.1" 47 | "@ast-grep/napi-linux-arm64-gnu" "0.18.1" 48 | "@ast-grep/napi-linux-x64-gnu" "0.18.1" 49 | "@ast-grep/napi-win32-arm64-msvc" "0.18.1" 50 | "@ast-grep/napi-win32-ia32-msvc" "0.18.1" 51 | "@ast-grep/napi-win32-x64-msvc" "0.18.1" 52 | 53 | "@esbuild/aix-ppc64@0.19.12": 54 | version "0.19.12" 55 | resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz#d1bc06aedb6936b3b6d313bf809a5a40387d2b7f" 56 | integrity sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA== 57 | 58 | "@esbuild/android-arm64@0.19.12": 59 | version "0.19.12" 60 | resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz#7ad65a36cfdb7e0d429c353e00f680d737c2aed4" 61 | integrity sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA== 62 | 63 | "@esbuild/android-arm@0.19.12": 64 | version "0.19.12" 65 | resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.19.12.tgz#b0c26536f37776162ca8bde25e42040c203f2824" 66 | integrity sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w== 67 | 68 | "@esbuild/android-x64@0.19.12": 69 | version "0.19.12" 70 | resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.19.12.tgz#cb13e2211282012194d89bf3bfe7721273473b3d" 71 | integrity sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew== 72 | 73 | "@esbuild/darwin-arm64@0.19.12": 74 | version "0.19.12" 75 | resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz#cbee41e988020d4b516e9d9e44dd29200996275e" 76 | integrity sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g== 77 | 78 | "@esbuild/darwin-x64@0.19.12": 79 | version "0.19.12" 80 | resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz#e37d9633246d52aecf491ee916ece709f9d5f4cd" 81 | integrity sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A== 82 | 83 | "@esbuild/freebsd-arm64@0.19.12": 84 | version "0.19.12" 85 | resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz#1ee4d8b682ed363b08af74d1ea2b2b4dbba76487" 86 | integrity sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA== 87 | 88 | "@esbuild/freebsd-x64@0.19.12": 89 | version "0.19.12" 90 | resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz#37a693553d42ff77cd7126764b535fb6cc28a11c" 91 | integrity sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg== 92 | 93 | "@esbuild/linux-arm64@0.19.12": 94 | version "0.19.12" 95 | resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz#be9b145985ec6c57470e0e051d887b09dddb2d4b" 96 | integrity sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA== 97 | 98 | "@esbuild/linux-arm@0.19.12": 99 | version "0.19.12" 100 | resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz#207ecd982a8db95f7b5279207d0ff2331acf5eef" 101 | integrity sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w== 102 | 103 | "@esbuild/linux-ia32@0.19.12": 104 | version "0.19.12" 105 | resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz#d0d86b5ca1562523dc284a6723293a52d5860601" 106 | integrity sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA== 107 | 108 | "@esbuild/linux-loong64@0.19.12": 109 | version "0.19.12" 110 | resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz#9a37f87fec4b8408e682b528391fa22afd952299" 111 | integrity sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA== 112 | 113 | "@esbuild/linux-mips64el@0.19.12": 114 | version "0.19.12" 115 | resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz#4ddebd4e6eeba20b509d8e74c8e30d8ace0b89ec" 116 | integrity sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w== 117 | 118 | "@esbuild/linux-ppc64@0.19.12": 119 | version "0.19.12" 120 | resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz#adb67dadb73656849f63cd522f5ecb351dd8dee8" 121 | integrity sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg== 122 | 123 | "@esbuild/linux-riscv64@0.19.12": 124 | version "0.19.12" 125 | resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz#11bc0698bf0a2abf8727f1c7ace2112612c15adf" 126 | integrity sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg== 127 | 128 | "@esbuild/linux-s390x@0.19.12": 129 | version "0.19.12" 130 | resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz#e86fb8ffba7c5c92ba91fc3b27ed5a70196c3cc8" 131 | integrity sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg== 132 | 133 | "@esbuild/linux-x64@0.19.12": 134 | version "0.19.12" 135 | resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz#5f37cfdc705aea687dfe5dfbec086a05acfe9c78" 136 | integrity sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg== 137 | 138 | "@esbuild/netbsd-x64@0.19.12": 139 | version "0.19.12" 140 | resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz#29da566a75324e0d0dd7e47519ba2f7ef168657b" 141 | integrity sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA== 142 | 143 | "@esbuild/openbsd-x64@0.19.12": 144 | version "0.19.12" 145 | resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz#306c0acbdb5a99c95be98bdd1d47c916e7dc3ff0" 146 | integrity sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw== 147 | 148 | "@esbuild/sunos-x64@0.19.12": 149 | version "0.19.12" 150 | resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz#0933eaab9af8b9b2c930236f62aae3fc593faf30" 151 | integrity sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA== 152 | 153 | "@esbuild/win32-arm64@0.19.12": 154 | version "0.19.12" 155 | resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz#773bdbaa1971b36db2f6560088639ccd1e6773ae" 156 | integrity sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A== 157 | 158 | "@esbuild/win32-ia32@0.19.12": 159 | version "0.19.12" 160 | resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz#000516cad06354cc84a73f0943a4aa690ef6fd67" 161 | integrity sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ== 162 | 163 | "@esbuild/win32-x64@0.19.12": 164 | version "0.19.12" 165 | resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz#c57c8afbb4054a3ab8317591a0b7320360b444ae" 166 | integrity sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA== 167 | 168 | "@jridgewell/sourcemap-codec@^1.4.15": 169 | version "1.4.15" 170 | resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" 171 | integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== 172 | 173 | "@types/node@^14.14.31": 174 | version "14.14.31" 175 | resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.31.tgz#72286bd33d137aa0d152d47ec7c1762563d34055" 176 | integrity sha512-vFHy/ezP5qI0rFgJ7aQnjDXwAMrG0KqqIH7tQG5PPv3BWBayOPIQNBjVc/P6hhdZfMx51REc6tfDNXHUio893g== 177 | 178 | "@types/yargs-parser@*": 179 | version "20.2.0" 180 | resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.0.tgz#dd3e6699ba3237f0348cd085e4698780204842f9" 181 | integrity sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA== 182 | 183 | "@types/yargs@^17.0.32": 184 | version "17.0.32" 185 | resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.32.tgz#030774723a2f7faafebf645f4e5a48371dca6229" 186 | integrity sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog== 187 | dependencies: 188 | "@types/yargs-parser" "*" 189 | 190 | ansi-regex@^5.0.0: 191 | version "5.0.0" 192 | resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" 193 | integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== 194 | 195 | ansi-regex@^5.0.1: 196 | version "5.0.1" 197 | resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" 198 | integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== 199 | 200 | ansi-styles@^4.0.0: 201 | version "4.3.0" 202 | resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" 203 | integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== 204 | dependencies: 205 | color-convert "^2.0.1" 206 | 207 | cliui@^8.0.1: 208 | version "8.0.1" 209 | resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" 210 | integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== 211 | dependencies: 212 | string-width "^4.2.0" 213 | strip-ansi "^6.0.1" 214 | wrap-ansi "^7.0.0" 215 | 216 | color-convert@^2.0.1: 217 | version "2.0.1" 218 | resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" 219 | integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== 220 | dependencies: 221 | color-name "~1.1.4" 222 | 223 | color-name@~1.1.4: 224 | version "1.1.4" 225 | resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" 226 | integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== 227 | 228 | emoji-regex@^8.0.0: 229 | version "8.0.0" 230 | resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" 231 | integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== 232 | 233 | esbuild@~0.19.10: 234 | version "0.19.12" 235 | resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.19.12.tgz#dc82ee5dc79e82f5a5c3b4323a2a641827db3e04" 236 | integrity sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg== 237 | optionalDependencies: 238 | "@esbuild/aix-ppc64" "0.19.12" 239 | "@esbuild/android-arm" "0.19.12" 240 | "@esbuild/android-arm64" "0.19.12" 241 | "@esbuild/android-x64" "0.19.12" 242 | "@esbuild/darwin-arm64" "0.19.12" 243 | "@esbuild/darwin-x64" "0.19.12" 244 | "@esbuild/freebsd-arm64" "0.19.12" 245 | "@esbuild/freebsd-x64" "0.19.12" 246 | "@esbuild/linux-arm" "0.19.12" 247 | "@esbuild/linux-arm64" "0.19.12" 248 | "@esbuild/linux-ia32" "0.19.12" 249 | "@esbuild/linux-loong64" "0.19.12" 250 | "@esbuild/linux-mips64el" "0.19.12" 251 | "@esbuild/linux-ppc64" "0.19.12" 252 | "@esbuild/linux-riscv64" "0.19.12" 253 | "@esbuild/linux-s390x" "0.19.12" 254 | "@esbuild/linux-x64" "0.19.12" 255 | "@esbuild/netbsd-x64" "0.19.12" 256 | "@esbuild/openbsd-x64" "0.19.12" 257 | "@esbuild/sunos-x64" "0.19.12" 258 | "@esbuild/win32-arm64" "0.19.12" 259 | "@esbuild/win32-ia32" "0.19.12" 260 | "@esbuild/win32-x64" "0.19.12" 261 | 262 | escalade@^3.1.1: 263 | version "3.1.1" 264 | resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" 265 | integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== 266 | 267 | fsevents@~2.3.3: 268 | version "2.3.3" 269 | resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" 270 | integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== 271 | 272 | get-caller-file@^2.0.5: 273 | version "2.0.5" 274 | resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" 275 | integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== 276 | 277 | get-tsconfig@^4.7.2: 278 | version "4.7.2" 279 | resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.7.2.tgz#0dcd6fb330391d46332f4c6c1bf89a6514c2ddce" 280 | integrity sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A== 281 | dependencies: 282 | resolve-pkg-maps "^1.0.0" 283 | 284 | is-fullwidth-code-point@^3.0.0: 285 | version "3.0.0" 286 | resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" 287 | integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== 288 | 289 | magic-string@^0.30.6: 290 | version "0.30.6" 291 | resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.6.tgz#996e21b42f944e45591a68f0905d6a740a12506c" 292 | integrity sha512-n62qCLbPjNjyo+owKtveQxZFZTBm+Ms6YoGD23Wew6Vw337PElFNifQpknPruVRQV57kVShPnLGo9vWxVhpPvA== 293 | dependencies: 294 | "@jridgewell/sourcemap-codec" "^1.4.15" 295 | 296 | prettier@^2.2.1: 297 | version "2.2.1" 298 | resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" 299 | integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== 300 | 301 | require-directory@^2.1.1: 302 | version "2.1.1" 303 | resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" 304 | integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= 305 | 306 | resolve-pkg-maps@^1.0.0: 307 | version "1.0.0" 308 | resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f" 309 | integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw== 310 | 311 | string-width@^4.1.0, string-width@^4.2.0: 312 | version "4.2.2" 313 | resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" 314 | integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== 315 | dependencies: 316 | emoji-regex "^8.0.0" 317 | is-fullwidth-code-point "^3.0.0" 318 | strip-ansi "^6.0.0" 319 | 320 | string-width@^4.2.3: 321 | version "4.2.3" 322 | resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" 323 | integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== 324 | dependencies: 325 | emoji-regex "^8.0.0" 326 | is-fullwidth-code-point "^3.0.0" 327 | strip-ansi "^6.0.1" 328 | 329 | strip-ansi@^6.0.0: 330 | version "6.0.0" 331 | resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" 332 | integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== 333 | dependencies: 334 | ansi-regex "^5.0.0" 335 | 336 | strip-ansi@^6.0.1: 337 | version "6.0.1" 338 | resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" 339 | integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== 340 | dependencies: 341 | ansi-regex "^5.0.1" 342 | 343 | tsx@^4.7.0: 344 | version "4.7.0" 345 | resolved "https://registry.yarnpkg.com/tsx/-/tsx-4.7.0.tgz#1689cfe7dda495ca1f9a66d4cad79cb57b9f6f4a" 346 | integrity sha512-I+t79RYPlEYlHn9a+KzwrvEwhJg35h/1zHsLC2JXvhC2mdynMv6Zxzvhv5EMV6VF5qJlLlkSnMVvdZV3PSIGcg== 347 | dependencies: 348 | esbuild "~0.19.10" 349 | get-tsconfig "^4.7.2" 350 | optionalDependencies: 351 | fsevents "~2.3.3" 352 | 353 | typescript@^5.3.3: 354 | version "5.3.3" 355 | resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37" 356 | integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw== 357 | 358 | wrap-ansi@^7.0.0: 359 | version "7.0.0" 360 | resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" 361 | integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== 362 | dependencies: 363 | ansi-styles "^4.0.0" 364 | string-width "^4.1.0" 365 | strip-ansi "^6.0.0" 366 | 367 | y18n@^5.0.5: 368 | version "5.0.5" 369 | resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.5.tgz#8769ec08d03b1ea2df2500acef561743bbb9ab18" 370 | integrity sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg== 371 | 372 | yargs-parser@^21.1.1: 373 | version "21.1.1" 374 | resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" 375 | integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== 376 | 377 | yargs@^17.7.2: 378 | version "17.7.2" 379 | resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" 380 | integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== 381 | dependencies: 382 | cliui "^8.0.1" 383 | escalade "^3.1.1" 384 | get-caller-file "^2.0.5" 385 | require-directory "^2.1.1" 386 | string-width "^4.2.3" 387 | y18n "^5.0.5" 388 | yargs-parser "^21.1.1" 389 | --------------------------------------------------------------------------------