diff --git a/.eslintrc.json b/.eslintrc.json index 5dad774..fef60b0 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,29 +1,28 @@ { - "root": true, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 6, - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint" - ], - "extends": [ - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@typescript-eslint/semi": "warn", - "curly": "warn", - "eqeqeq": "warn", - "no-throw-literal": "warn", - "semi": "warn", - "@typescript-eslint/no-use-before-define": "off" - }, - "ignorePatterns": [ - "test/**/index.ts", - "test/**/runTest.ts", - "node_modules", - "**/*.js", - "tools" - ] + "root": true, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ], + "extends": [ + "plugin:@typescript-eslint/recommended" + ], + "rules": { + "@typescript-eslint/semi": "warn", + "no-throw-literal": "warn", + "semi": "warn", + "@typescript-eslint/no-use-before-define": "off", + "@typescript-eslint/explicit-module-boundary-types": "off" + }, + "ignorePatterns": [ + "test/**/index.ts", + "test/**/runTest.ts", + "node_modules", + "**/*.js", + "src/test/suite/diagnose.test.ts" + ] } \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d87a8c3..7dd5326 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,17 +21,41 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: Install Node.js uses: actions/setup-node@v1 with: node-version: 14.x - - run: yarn - - run: xvfb-run -a yarn test + + - name: linux Install dosbox and dosbox-x tool + run: | + sudo apt-get update + sudo apt-get install dosbox + sudo apt install flatpak + sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + sudo flatpak install flathub com.dosbox_x.DOSBox-X -y + if: runner.os == 'Linux' + - name: macOS Install dosbox and dosbox-x tool + run: | + brew update + brew install dosbox + brew install dosbox-x + if: runner.os == 'macOS' + + - run: | + /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & + echo ">>> Started xvfb" if: runner.os == 'Linux' - - run: yarn test - if: runner.os != 'Linux' + + - name: yarn,test + run: | + yarn + yarn test + env: + DISPLAY: ":99.0" - run: yarn lint + if: runner.os == 'Linux' - name: Publish if: success() && startsWith( github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest' diff --git a/.gitignore b/.gitignore index c877853..b978c5c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,9 +3,7 @@ node_modules .vscode-test/ *.vsix -# temporary generated by Assembler -/workspace/*.* **/.DS_store -web/res/test.jsdos +**.jsdos diff --git a/.vscode/launch.json b/.vscode/launch.json index d19f1ca..0db1158 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -16,19 +16,7 @@ "outFiles": [ "${workspaceFolder}/dist/**/*.js" ], - "preLaunchTask": "npm: compile" - }, - { - "name": "Run Extension(no pretask)", - "type": "extensionHost", - "request": "launch", - "runtimeExecutable": "${execPath}", - "args": [ - "--extensionDevelopmentPath=${workspaceFolder}" - ], - "outFiles": [ - "${workspaceFolder}/dist/**/*.js" - ], + "preLaunchTask": "npm: watch" }, { "name": "Extension Tests", @@ -36,7 +24,6 @@ "request": "launch", "runtimeExecutable": "${execPath}", "args": [ - "--disable-extensions", "--extensionDevelopmentPath=${workspaceFolder}", "--extensionTestsPath=${workspaceFolder}/dist/test/suite/index", "${workspaceFolder}/samples" diff --git a/dev/downloadBundle.js b/dev/downloadBundle.js new file mode 100644 index 0000000..aed8bf6 --- /dev/null +++ b/dev/downloadBundle.js @@ -0,0 +1,25 @@ +const download = require('download'); +const { existsSync } = require('fs'); +const { resolve } = require('path'); +const pkg = require("../package.json"); + +const actions = pkg.contributes.configuration.properties['masmtasm.ASM.actions'].default +const assemblers = Object.keys(actions).map(key => actions[key].baseBundle.replace('/', "")); + +const host = "https://dosasm.github.io/dosrun/bundles/" +const dstFolder = resolve(__dirname, "..", "resources"); + +async function main() { + for (const asm of assemblers) { + const dst = resolve(dstFolder, asm); + const src = host + asm; + if (existsSync(dst)) { + console.log('already downloaded', asm) + console.log(src, dst) + } else { + await download(src, dstFolder) + } + } +} + +main() \ No newline at end of file diff --git a/package.json b/package.json index d42374e..77aec0b 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "MASM/TASM", "publisher": "xsro", "description": "run MASM/TASM assembly in DOSBox 汇编语言开发插件", - "version": "0.9.0", + "version": "1.0.0", "keywords": [ "dosbox", "16位", @@ -17,6 +17,9 @@ "engines": { "vscode": "^1.49.0" }, + "extensionDependencies": [ + "xsro.vscode-dosbox" + ], "categories": [ "Programming Languages", "Other" @@ -107,32 +110,83 @@ "type": "object", "title": "MASM/TASM", "properties": { - "masmtasm.ASM.toolspath": { - "type": "string", - "markdownDescription": "%config.toolspath.mddescription%" - }, - "masmtasm.ASM.MASMorTASM": { + "masmtasm.ASM.assembler": { "type": "string", "default": "TASM", "description": "%config.masmortasm.description%", "enum": [ "TASM", - "MASM" + "MASM", + "MASM-v5.00", + "MASM-v6.11" ], "enumDescriptions": [ "%config.masmortasm.enum1%", "%config.masmortasm.enum2%" ] }, + "masmtasm.ASM.actions": { + "type": "object", + "default": { + "TASM": { + "baseBundle": "/TASM.jsdos", + "before": [ + "set PATH=C:\\TASM" + ], + "run": [ + "TASM ${file}", + "TLINK ${filename}", + "${filename}" + ], + "debug": [ + "TASM /zi ${file}", + "TLINK /v/3 ${filename}.obj", + "TD ${filename}.exe" + ] + }, + "MASM-v6.11": { + "baseBundle": "/MASM-v6.11.jsdos", + "before": [ + "set PATH=C:\\MASM" + ], + "run": [ + "masm ${file};", + "link ${filename};", + ">${filename}" + ], + "debug": [ + "masm ${file};", + "link ${filename}.OBJ;", + ">debug ${filename}.exe" + ] + }, + "MASM-v5.00": { + "baseBundle": "/MASM-v5.00.jsdos", + "before": [ + "set PATH=C:\\MASM" + ], + "run": [ + "masm ${file};", + "link ${filename};", + ">${filename}" + ], + "debug": [ + "masm ${file};", + "link ${filename}.OBJ;", + ">debug ${filename}.exe" + ] + } + } + }, "masmtasm.ASM.emulator": { "type": "string", - "default": "dosbox", + "default": "jsdos", "description": "%config.emulator.description%", "enum": [ "jsdos", "dosbox", - "msdos player", - "auto" + "dosboxX", + "msdos player" ], "enumDescriptions": [ "%config.emulator.jsdos%", @@ -141,15 +195,10 @@ "%config.emulator.auto%" ] }, - "masmtasm.ASM.separateSpace": { - "type": "boolean", - "default": false, - "markdownDescription": "%config.separateSpace%" - }, - "masmtasm.ASM.clean": { + "masmtasm.ASM.singleFileMode": { "type": "boolean", "default": true, - "description": "%config.clean%" + "markdownDescription": "%config.singleFileMode%" }, "masmtasm.ASM.savefirst": { "type": "boolean", @@ -193,204 +242,6 @@ "SDL.output": "opengl" }, "markdownDescription": "%config.boxconfig.description%" - }, - "masmtasm.dosbox.command": { - "type": "string", - "description": "%config.boxcommand%" - }, - "masmtasm.dosbox.console": { - "type": "string", - "default": "redirect", - "description": "%config.boxconsole.description%", - "enum": [ - "min", - "normal", - "noconsole", - "redirect(show)", - "redirect" - ], - "markdownEnumDescriptions": [ - "%config.boxconsole.min%", - "%config.boxconsole.normal%", - "%config.boxconsole.noconsole%", - "%config.boxconsole.redirect-show%", - "%config.boxconsole.redirect%" - ] - }, - "masmtasm.jsdos.viewColumn": { - "markdownDescription": "%config.jsdos.viewColumn%", - "type": "string", - "default": "Beside", - "enum": [ - "Beside", - "Active" - ], - "enumDescriptions": [ - "%config.jsdos.viewColumn.Active%", - "%config.jsdos.viewColumn.Besides%" - ] - }, - "masmtasm.dosbox.more": { - "markdownDescription": "%config.dosbox.more%", - "default": { - "open": [ - "set path=c:\\masm;c:\\tasm" - ], - "masm": [ - "set path=c:\\masm", - "masm ${filename}.ASM; >X:\\ASM.LOG ", - "@type X:\\ASM.LOG", - "if exist ${filename}.OBJ link ${filename}.OBJ; >X:\\LINK.LOG ", - "@type X:\\LINK.LOG" - ], - "tasm": [ - "set path=c:\\tasm", - "tasm /zi ${filename}.ASM >X:\\ASM.LOG ", - "@type X:\\ASM.LOG", - "if exist ${filename}.OBJ tlink /v/3 ${filename}.obj >X:\\LINK.LOG ", - "@type X:\\LINK.LOG" - ], - "masm_debug": [ - "if exist ${filename}.exe c:\\masm\\debug ${filename}.exe" - ], - "tasm_debug": [ - "if exist ${filename}.exe c:\\tasm\\TD ${filename}.exe" - ], - "run": [ - "@if not exist ${filename}.exe exit ", - "${filename}.exe", - "@echo (END)Here is the end of the program's output" - ], - "after_action": [ - "@choice Do you need to keep the DOSBox", - "@IF ERRORLEVEL 2 exit", - "@IF ERRORLEVEL 1 echo on" - ] - }, - "properties": { - "open": { - "description": "command exec when open dosbox", - "type": "array" - }, - "masm": { - "description": "The commands to exec for assembling and linking in dosbox when using masm", - "type": "array" - }, - "tasm": { - "description": "The commands to exec for assembling and linking in dosbox when using tasm", - "type": "array" - }, - "tasm_debug": { - "description": "The commands to exec for debuging in dosbox when using tasm", - "type:": "array" - }, - "masm_debug": { - "description": "The commands to exec for debuging in dosbox when using masm", - "type:": "array" - }, - "run": { - "description": "The commands to run the generated file", - "type": "array" - }, - "after_action": { - "description": "The commands to exec after run or debug\n when set `masmtasm.dosbox.run` as `choose`", - "type": "array" - } - } - }, - "masmtasm.jsdos.more": { - "markdownDescription": "%config.jsdos.more%", - "default": { - "open": [ - "set path=c:\\asm\\masm;c:\\asm\\tasm", - "cd code" - ], - "masm": [ - "masm ${filename}.ASM;", - "if exist ${filename}.OBJ link ${filename}.OBJ;" - ], - "tasm": [ - "tasm /zi ${filename}.ASM", - "if exist ${filename}.OBJ tlink /v/3 ${filename}.obj" - ], - "masm_debug": [ - "if exist ${filename}.exe debug ${filename}.exe" - ], - "tasm_debug": [ - "if exist ${filename}.exe TD ${filename}.exe" - ], - "run": [ - "if exist ${filename}.exe ${filename}.exe" - ] - }, - "properties": { - "open": { - "description": "The commands to exec when open JSdos webview", - "type": "array" - }, - "masm": { - "description": "The commands to exec for assembling and linking in Wdosbox when using masm", - "type": "array" - }, - "tasm": { - "description": "The commands to exec for assembling and linking in Wdosbox when using tasm", - "type": "array" - }, - "tasm_debug": { - "description": "The commands to exec for debuging in Wdosbox when using tasm", - "type:": "array" - }, - "masm_debug": { - "description": "The commands to exec for debuging in Wdosbox when using masm", - "type:": "array" - }, - "run": { - "description": "The commands to run the generated file", - "type": "array" - } - } - }, - "masmtasm.msdos.more": { - "description": "%config.msdos.more%", - "default": { - "workspace": "c:\\.dosasm", - "path": "${toolpath}\\player;${toolpath}\\masm;${toolpath}\\tasm;c:\\.dosasm\\tasm;c:\\.dosasm\\masm;", - "masm": "player\\playerasm.bat \"${toolpath}\" MASM \"${fullname}\"", - "tasm": "player\\playerasm.bat \"${toolpath}\" TASM \"${fullname}\"", - "masm_debug": "msdos -v5.0 debug \"${filename}.exe\"", - "tasm_debug": "msdos TD \"${filename}.exe\"", - "run": "msdos \"${filename}\"" - }, - "properties": { - "workspace": { - "description": "The workspace when using separate space", - "type": "string" - }, - "path": { - "description": "The path needed to add to the environment value `PATH`", - "type": "string" - }, - "masm": { - "description": "The commands to exec for assembling and linking in cmd when using masm", - "type": "string" - }, - "tasm": { - "description": "The commands to exec for assembling and linking in cmd when using tasm", - "type": "string" - }, - "tasm_debug": { - "description": "(Currently not support)The commands to exec for debuging in cmd when using tasm", - "type:": "string" - }, - "masm_debug": { - "description": "The commands to exec for debuging in cmd when using masm", - "type:": "string" - }, - "run": { - "description": "The command to run the generated file", - "type": "string" - } - } } } }, @@ -427,12 +278,13 @@ }, "scripts": { "clean": "rimraf dist/ web/dist", + "postinstall": "node dev/downloadBundle.js", "compile": "webpack --mode production", "watch": "webpack --mode development --watch", "watch-test": "tsc -watch -p ./src", "lint": "eslint src --ext ts", "lint-fix": "eslint src --ext ts --fix", - "pretest": "yarn compile && tsc -p ./src", + "pretest": "tsc -p ./src", "test": "node ./dist/test/runTest.js", "vscode:prepublish": "yarn clean && yarn compile", "deploy": "vsce publish --yarn --baseContentUrl https://github.com/dosasm/masm-tasm/blob/main/ --baseImagesUrl https://github.com/dosasm/masm-tasm/raw/main/ ", @@ -447,6 +299,8 @@ "@typescript-eslint/eslint-plugin": "^4.29.1", "@typescript-eslint/parser": "^4.29.1", "del": "^6.0.0", + "download": "^8.0.0", + "emulators": "^0.67.0", "eslint": "^7.32.0", "glob": "^7.1.6", "js-yaml": "^4.0.0", @@ -468,9 +322,5 @@ "url": "https://github.com/dosasm/masm-tasm/issues", "email": "xsro@foxmail.com" }, - "license": "MIT", - "dependencies": { - "emulators": "^0.67.0", - "emulators-ui": "^0.68.0" - } + "license": "MIT" } \ No newline at end of file diff --git a/src/ASM/actions.ts b/src/ASM/actions.ts new file mode 100644 index 0000000..e550da7 --- /dev/null +++ b/src/ASM/actions.ts @@ -0,0 +1,25 @@ +/** + * manage commands run inside the DOS emulator + */ +import * as vscode from 'vscode'; +import * as conf from '../utils/configuration'; + +type ACTIONS = { + [id: string]: { + baseBundle: string, + before: string[], + run: string[], + debug: string[] + } +}; + +export function baseBundle() { + const actions: ACTIONS | undefined = vscode.workspace.getConfiguration('masmtasm').get('ASM.actions'); + if (actions === undefined) { + throw new Error("configurate `masmtasm.ASM.actions` first"); + } + const path = actions[conf.extConf.asmType]["baseBundle"]; + return path.replace('/', "resources/"); +} + + diff --git a/src/ASM/configration.ts b/src/ASM/configration.ts deleted file mode 100644 index c1cd73f..0000000 --- a/src/ASM/configration.ts +++ /dev/null @@ -1,261 +0,0 @@ -import { ExtensionContext, FileType, TextDocument, Uri, window, workspace } from 'vscode'; -import { Logger } from './outputChannel'; -import { inDirectory, validfy } from './util'; -import { localize } from '../i18n'; - -interface TOOLURIS { - /**the separate workspace to use*/ - workspace: Uri; - /**global storage uri */ - globalStorage: Uri; - /**the folder for dosbox */ - dosbox: Uri; - /**the folder for msdos player */ - msdos: Uri; - /**the folder for js dos */ - jsdos: Uri; - /**tools folder */ - tools: Uri; - /**folder for masm tools */ - masm?: Uri; - /**folder for tasm tools */ - tasm?: Uri; -}; - -/**use MASM or TASM - * - MASM: including masm.exe,link.exe,debug.exe - * - TASM: including tasm.exe,tlink.exe,TD.exe - */ -export enum ASMTYPE { - MASM = 'MASM', - TASM = 'TASM' -} - -/**the emulator for the 16bit DOS environment - * - `dosbox` is the most famous one - * - `msdos`( player) is designed for running in windows cmd - * - `jsdos` is designed for runing in browser - * - `auto` is a mode to partly solve the problem of TD's hardly running in msdos - */ -export enum DOSEMU { - dosbox = 'dosbox', - msdos = 'msdos player', - auto = 'auto', - jsdos = 'jsdos', -} - -const packagedTools = "./tools"; -const fs = workspace.fs; -const delExtList = [".EXE", ".OBJ", ".COM"]; -const DST_FILE_NAME = 'T'; -const allowedEMU = (): DOSEMU[] => { - const emu = [DOSEMU.dosbox, DOSEMU.jsdos]; - if (process.platform === 'win32') { - emu.push(DOSEMU.auto, DOSEMU.msdos); - } - return emu; -}; - -/**### the string replacer - * - * |string|replace to| - * |------|----------| - * |`${filename}`|the filename of the source code file like `hello`| - * |`${fullname}`|the fullname of the source code file like`c:\asm\hello.asm`| - * |`${fileFolder}`|the folder path of the source code file like `c:\asm`| - * |`${fileDisk}`|the file disk of the source code file like `c`| - * |`${toolpath}`|the folder path of the asm tools including *MASM* and *TASM* folder| - */ -export const settingsStrReplacer = (val: string, conf?: Config, src?: SRCFILE): string => { - let str: string = val; - if (src) { - str = str - .replace(/\${filename}/g, src.filename) - .replace(/\${fullname}/g, src.uri.fsPath) - .replace(/\${fileFolder}/g, src.folder.fsPath); - if (src.disk) { - str = str.replace(/\${fileDisk}/g, src.disk); - } - } - if (conf) { - str = str.replace(/\${toolpath}/g, conf.Uris.tools.fsPath); - } - return str; -}; - -/**class for configurations - * This class defines some settings from VSCode configuration id `masmtasm.ASM` - * and some uris to use - */ -export class Config { - private _target = workspace.getConfiguration('masmtasm.ASM'); - /**if true,save file before assembling*/ - public get savefirst(): boolean { - return this._target.get('savefirst') as boolean; - }; - /**use MASM or TASM */ - public get MASMorTASM(): ASMTYPE { - return this._target.get('MASMorTASM') as ASMTYPE; - }; - /**use dosbox or msdos as emulator */ - public get DOSemu(): DOSEMU { - return validfy(this._target.get('emulator'), allowedEMU()); - }; - public get toolspath(): Uri | undefined { - const val: string | undefined = this._target.get('toolspath'); - if (val) { - return Uri.file(val); - } - return; - } - //Uris and tools information - public Uris: TOOLURIS; - public get Separate(): boolean { return this._target.get('separateSpace') as boolean; } - public get Clean(): boolean { return this._target.get('clean') as boolean; } - private readonly _exturi: Uri; - private _statusBar = window.createStatusBarItem(); - public asAbsolutePath: (relativePath: string) => string; - public asAbsoluteUri(path: string): Uri { - return Uri.joinPath(this._exturi, path); - } - constructor(ctx: ExtensionContext) { - workspace.onDidChangeConfiguration((e) => { - if (e.affectsConfiguration('masmtasm.ASM')) { - this.update(); - } - }); - this.update(); - this._exturi = ctx.extensionUri; - - const globalStorageUri = ctx.globalStorageUri; - const toolsUri = this.toolspath ? this.toolspath : Uri.joinPath(this._exturi, packagedTools); - //the tools' Uri - this.Uris = { - tools: toolsUri, - workspace: Uri.joinPath(globalStorageUri, './workspace/'), - dosbox: Uri.joinPath(toolsUri, './dosbox/'), - msdos: Uri.joinPath(toolsUri, './player/'), - jsdos: Uri.joinPath(toolsUri, './js-dos/'), - globalStorage: globalStorageUri - }; - fs.createDirectory(this.Uris.workspace);//make sure the workspace uri exists - this.printToChannel(); - this.asAbsolutePath = ctx.asAbsolutePath; - } - - private update(): void { - this._target = workspace.getConfiguration('masmtasm.ASM'); - this._statusBar.text = `${this.DOSemu} ${this.MASMorTASM}`; - this._statusBar.show(); - this._statusBar.command = 'masmtasm.updateEmuASM'; - } - - public get dosboxconfuri(): Uri { - const uri = Uri.joinPath(this.Uris.globalStorage, 'VSC-ExtUse.conf'); - return uri; - } - public printToChannel(): void { - Logger.send( - { - title: localize('config.title', "[Config] {0}", new Date().toLocaleString()), - content: localize('config.content', 'default workspace:"{0}"\nuse tools from "{1}"', - this.Uris.workspace.fsPath, this.Uris.tools.fsPath) - } - ); - } -} - -/**The class for source code file - * TODO: find out the dependences of all source code files - */ -export class SRCFILE { - private _copy: Uri | undefined; - public doc: TextDocument | undefined; - constructor(private _uri: Uri) { - } - private pathinfo(): { name: string; ext: string } { - let name = "", ext = ""; - const r = /.*[\\\/](.*)\.(.*)/; - const re = r.exec(this.uri.fsPath); - if (re) { - name = re[1]; - ext = re[2]; - } - return { name, ext }; - } - public get disk(): string | undefined { - const re = this.uri.fsPath.match(/([a-zA-Z]):/); - if (re) { - return re[1]; - } - return undefined; - } - public get filename(): string { - return this.pathinfo().name; - } - public get extname(): string { - return this.pathinfo().ext; - } - public get dosboxFsReadable(): boolean { - return !!this.filename.match(/^\w{1,8}$/); - } - /**copy the source code file to another path*/ - public async copyto(uri: Uri): Promise { - if (this._copy === undefined) { - this._copy = Uri.joinPath(uri, DST_FILE_NAME + '.' + this.extname); - await fs.copy(this._uri, this._copy, { overwrite: true }); - return true; - } - return false; - } - public async cleanDir(): Promise { - const uri = this.folder; - const dirs: [string, FileType][] = await fs.readDirectory(uri); - const delList = delExtList.map((val) => this.filename + val); - for (const value of delList) { - const del = inDirectory(dirs, [value, FileType.File]); - if (del) { - await fs.delete(Uri.joinPath(uri, del[0]), { recursive: false, useTrash: false }); - } - } - return; - } - /**copy the source code file and the generated exe file to another path*/ - public async copyEXEto(uri: Uri): Promise { - const dirinfo = await fs.readDirectory(this.folder); - const related = dirinfo.filter( - (val) => val[0].includes(this.filename) && val[1] === FileType.File - ); - const srcFolder = this.folder; - const dstFolder = uri; - for (const r of related) { - const src = Uri.joinPath(srcFolder, r[0]); - const dst = Uri.joinPath(dstFolder, r[0].replace(this.filename, DST_FILE_NAME)); - await fs.copy(src, dst, { overwrite: true }); - } - await this.copyto(uri); - } - public get uri(): Uri { - if (this._copy) { - return this._copy; - } - return this._uri; - } - public get folder(): Uri { - return Uri.joinPath(this.uri, '../'); - } - public pathMessage(more?: string): string { - let str = `"${this._uri.fsPath}"`; - if (this._copy) { str += `\ncopied as "${this._copy?.fsPath}" `; } - if (more) { str += more; } - return str; - } -} - - - - - - - - diff --git a/src/ASM/main.ts b/src/ASM/main.ts index 26159e9..80d7ee7 100644 --- a/src/ASM/main.ts +++ b/src/ASM/main.ts @@ -1,61 +1,241 @@ import * as vscode from 'vscode'; -import { AsmAction, ASMCMD } from './runcode'; -import { SeeinCPPDOCS } from './diagnose/codeAction'; -import { ASMTYPE, DOSEMU } from './configration'; - -/**register commands for run and debug the code - * in dosbox or msdos-player by TASM ot MASM */ -export function AsmCommands(context: vscode.ExtensionContext): void { - const asm = new AsmAction(context); - const commands = [ - vscode.commands.registerCommand('masm-tasm.openEmulator', (uri?: vscode.Uri) => { - return asm.runcode(ASMCMD.OpenEmu, uri); - }), - vscode.commands.registerCommand('masm-tasm.runASM', (uri: vscode.Uri) => { - return asm.runcode(ASMCMD.run, uri); - }), - vscode.commands.registerCommand('masm-tasm.debugASM', (uri?: vscode.Uri) => { - return asm.runcode(ASMCMD.debug, uri); - }), - vscode.commands.registerCommand('masm-tasm.cleanalldiagnose', () => { - asm.cleanalldiagnose(); - }), - vscode.commands.registerCommand('masm-tasm.dosboxhere', (uri?: vscode.Uri, emulator?: DOSEMU) => { - return asm.BoxHere(uri, emulator); - }), - vscode.commands.registerCommand('masmtasm.updateEmuASM', async () => { - const conf = vscode.workspace.getConfiguration('masmtasm.ASM'); - const emu = [DOSEMU.jsdos, DOSEMU.dosbox]; - if (process.platform === 'win32') { - emu.push(DOSEMU.msdos, DOSEMU.auto); - } - const asm = [ASMTYPE.MASM, ASMTYPE.TASM]; - - const iterms = []; - for (const e of emu) { - for (const a of asm) { - iterms.push(e + ' ' + a); +import * as path from 'path'; +import * as nodefs from 'fs'; + +import { API } from './vscode-dosbox'; +import * as statusBar from './statusBar'; +import * as Diag from '../diagnose/main'; +import * as conf from '../utils/configuration'; +import { messageCollector } from '../diagnose/messageCollector'; + +const fs = vscode.workspace.fs; + +enum actionType { + open, + run, + debug +} + +type ACTIONS = { + [id: string]: { + baseBundle: string, + before: string[], + run: string[], + debug: string[] + } +}; + +export interface AsmResult { + message?: string, + error?: number, + warn?: number +} + +export async function activate(context: vscode.ExtensionContext) { + statusBar.activate(context); + const diag = Diag.activate(context); + + const vscode_dosbox = vscode.extensions.getExtension('xsro.vscode-dosbox'); + const api: API = await vscode_dosbox?.activate(); + + const assemblyToolsFolder = vscode.Uri.joinPath(context.globalStorageUri, conf.extConf.asmType); + const seperateSpaceFolder = vscode.Uri.joinPath(context.globalStorageUri, "workspace"); + + async function singleFileMode(type: actionType, _uri: vscode.Uri): Promise { + + if (nodefs.existsSync(seperateSpaceFolder.fsPath)) { + await fs.delete(seperateSpaceFolder, { recursive: true, useTrash: false }); + } + await fs.createDirectory(seperateSpaceFolder); + if (nodefs.existsSync(assemblyToolsFolder.fsPath)) { + await fs.delete(assemblyToolsFolder, { recursive: true, useTrash: false }); + } + await fs.createDirectory(assemblyToolsFolder); + + const actions: ACTIONS | undefined = vscode.workspace.getConfiguration('masmtasm').get('ASM.actions'); + if (actions === undefined) { + throw new Error("configurate `masmtasm.ASM.actions` first"); + } + const action = actions[conf.extConf.asmType]; + + const doc = await vscode.workspace.openTextDocument(_uri); + + const bundlePath = vscode.Uri.joinPath( + context.extensionUri, + action["baseBundle"].replace('/', "resources/") + ); + const bundle = await fs.readFile(bundlePath); + + const timeStamp = new Date().getTime().toString(); + const logFilename = timeStamp.substr(timeStamp.length - 5, 8) + '.log'.toUpperCase(); + + let result = ""; + const uri = vscode.Uri.joinPath(seperateSpaceFolder, ("test" + path.extname(_uri.fsPath)).toUpperCase()); + await fs.copy(_uri, uri); + const fileInfo = path.parse(uri.fsPath); + const folder = vscode.Uri.joinPath(uri, '..'); + + if (conf.extConf.emulator === conf.DosEmulatorType.dosbox || conf.extConf.emulator === conf.DosEmulatorType.dosboxX) { + const autoexec = [ + `mount c "${assemblyToolsFolder.fsPath}""`, + `mount d "${folder.fsPath}""`, + 'd:', + ...action.before + ]; + const logUri = vscode.Uri.joinPath(assemblyToolsFolder, logFilename); + if (nodefs.existsSync(logUri.fsPath)) { + await fs.delete(logUri); + } + function cb(val: string) { + const r = val + .replace("${file}", fileInfo.base) + .replace("${filename}", fileInfo.name); + if (val.startsWith('>')) { + return r.replace(">", ""); } + return r + " >>C:\\" + logFilename; } + if (type === actionType.run) { + autoexec.push(...action.run.map(cb)); + } + if (type === actionType.debug) { + autoexec.push(...action.debug.map(cb)); + } + + autoexec.push("exit"); - const placeHolder = 'choose DOS environment emulator and assembler'; - const Selected = await vscode.window.showQuickPick(iterms, { placeHolder }); - if (Selected) { - const [emu1, asm1] = Selected?.split(' '); - const target = vscode.ConfigurationTarget.Workspace; - await conf.update('emulator', emu1, target); - await conf.update('MASMorTASM', asm1, target); + const box = conf.extConf.emulator === conf.DosEmulatorType.dosboxX ? api.dosboxX : api.dosbox; + await box.fromBundle(bundle, assemblyToolsFolder); + box.updateAutoexec(autoexec); + + if (type !== actionType.open) { + const [hook, promise] = messageCollector(); + nodefs.watchFile(logUri.fsPath, () => { + try { + if (nodefs.existsSync(logUri.fsPath)) { + const text = nodefs.readFileSync(logUri.fsPath, { encoding: 'utf-8' }); + hook(text); + } + } + catch (e) { + console.error(e); + } + }); + promise.then(val => { + console.log(val); + }); + } + + await box.run(); + + if (result === '') { + if (nodefs.existsSync(logUri.fsPath)) { + result = nodefs.readFileSync(logUri.fsPath, { encoding: 'utf-8' }); + } } } - ) - ]; - if (asm.ASM === ASMTYPE.MASM) { - commands.push( - vscode.languages.registerCodeActionsProvider('assembly', new SeeinCPPDOCS(), { - providedCodeActionKinds: SeeinCPPDOCS.providedCodeActionKinds - }) - ); + + if (conf.extConf.emulator === conf.DosEmulatorType.jsdos) { + await api.jsdos.jszip.loadAsync(bundle); + api.jsdos.jszip.file('code/' + fileInfo.base, doc.getText()); + const autoexec = [ + `mount c .`, + `mount d ./code`, + 'd:', + ...action.before + ]; + function cb(val: string) { + const r = val + .replace("${file}", fileInfo.base) + .replace("${filename}", fileInfo.name); + if (val.startsWith('>')) { + return r.replace(">", ""); + } + return r; + } + if (type === actionType.run) { + autoexec.push(...action.run.map(cb)); + } + if (type === actionType.debug) { + autoexec.push(...action.debug.map(cb)); + } + api.jsdos.updateAutoexec(autoexec); + const webview = await api.jsdos.runInWebview(); + if (type !== actionType.open) { + const [hook, promise] = messageCollector(); + webview.onDidReceiveMessage(e => { + switch (e.command) { + case 'stdout': + hook(e.value); + break; + } + }); + result = await promise; + } + } + + if (conf.extConf.emulator === conf.DosEmulatorType.msdos) { + const terminal = api.msdosPlayer(); + + terminal.show(); + api.dosbox.fromBundle(bundle, assemblyToolsFolder); + action.before.forEach( + val => { + (terminal as vscode.Terminal).sendText(val.replace('C:', assemblyToolsFolder.fsPath)); + } + ); + if (type === actionType.open) { + terminal.sendText(`cd "${vscode.Uri.joinPath(_uri, '..').fsPath}"`); + } + else { + terminal.sendText(`cd "${folder.fsPath}"`); + function cb(val: string) { + const r = val + .replace("${file}", fileInfo.base) + .replace("${filename}", fileInfo.name); + if (val.startsWith('>')) { + return r.replace(">", ""); + } else { + return r + `>> ${logFilename} \n type ${logFilename}`; + } + } + if (type === actionType.run) { + action.run.map(cb).forEach(val => (terminal as vscode.Terminal).sendText(val)); + } + if (type === actionType.debug) { + action.debug.map(cb).forEach(val => (terminal as vscode.Terminal).sendText(val)); + } + const logUri = vscode.Uri.joinPath(folder, logFilename); + const [hook, promise] = messageCollector(); + nodefs.watchFile(logUri.fsPath, () => { + try { + if (nodefs.existsSync(logUri.fsPath)) { + const text = nodefs.readFileSync(logUri.fsPath, { encoding: 'utf-8' }); + hook(text); + } + } + catch (e) { + console.error(e); + } + }); + //terminal.sendText('exit', true); + result = await promise; + } + + } + + const diagnose = diag.process(result, doc, conf.extConf.asmType); + + return { + message: result, + error: diagnose?.error, + warn: diagnose?.warn + }; } - context.subscriptions.push(...commands); -} + context.subscriptions.push( + vscode.commands.registerCommand('masm-tasm.openEmulator', (uri: vscode.Uri) => singleFileMode(actionType.open, uri)), + vscode.commands.registerCommand('masm-tasm.runASM', (uri: vscode.Uri) => singleFileMode(actionType.run, uri)), + vscode.commands.registerCommand('masm-tasm.debugASM', (uri: vscode.Uri) => singleFileMode(actionType.debug, uri)) + ); +} \ No newline at end of file diff --git a/src/ASM/outputChannel.ts b/src/ASM/outputChannel.ts deleted file mode 100644 index 6c5897e..0000000 --- a/src/ASM/outputChannel.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { window } from "vscode"; - -export class Logger { - static OutChannel = window.createOutputChannel('Masm-Tasm'); - /**send message to channel */ - static send(info: { title: string; content: string }): void { - if (info.content.trim().length > 0) { - Logger.OutChannel.appendLine(info.title); - let msg = info.content - .replace(/\r\n/g, '\n') - .replace(/\n\n/g, '\n') - .replace(/\n/g, '\n\t') - .trim() + '\n'; - msg = "\t" + msg; - Logger.OutChannel.append(msg); - } - else { - //console.log('ignore message' + JSON.stringify(info)) - } - } - - static log(message?: unknown, ...optionalParams: unknown[]): void { - console.log(message, ...optionalParams); - } -} - diff --git a/src/ASM/runcode.ts b/src/ASM/runcode.ts deleted file mode 100644 index eeceb13..0000000 --- a/src/ASM/runcode.ts +++ /dev/null @@ -1,223 +0,0 @@ -import { Disposable, ExtensionContext, Uri, window, workspace } from 'vscode'; -import { localize } from '../i18n'; -import { ASMTYPE, Config, DOSEMU, SRCFILE } from './configration'; -import { AssemblerDiag, DIAGCODE, DIAGINFO } from './diagnose/diagnose'; -import { AutoMode } from '../emulator/auto-mode'; -import { DOSBox } from '../emulator/DOSBox'; -import { JSDos } from '../emulator/JS-Dos'; -import { MsdosPlayer } from '../emulator/msdos-player'; -import { Logger } from './outputChannel'; - -/**the commands of action*/ -export enum ASMCMD { - OpenEmu, - debug, - run -} - -export type ASSEMBLERMSG = string | { asm: string; link: string }; -/**message processor return true if no error message*/ -export type MSGProcessor = (message: ASSEMBLERMSG, opt?: { preventWarn: boolean }) => Promise | boolean; -export type ASMPREPARATION = { src: SRCFILE; act: ASMCMD }; -/**interface for emulator */ -export interface EMURUN { - /**some process needed to do before action*/ - prepare(opt?: ASMPREPARATION): Promise | boolean; - /**open dosbox need*/ - openEmu(folder: Uri): Promise | unknown; - /**run code*/ - Run(src: SRCFILE, msgprocessor: MSGProcessor): Promise; - /**debug code*/ - Debug(src: SRCFILE, msgprocessor: MSGProcessor): Promise; - /**return a uri that needed to copy the file to instead of default one in extension globalstorage*/ - copyUri?: Uri; - /**if true force to copy the sourcecode file to [workspcae](## workspace) */ - forceCopy?: boolean; -} - -export interface RUNCODEINFO { - diagCode: DIAGCODE; - message?: ASSEMBLERMSG; - diagnose?: DIAGINFO; - emulator?: unknown; -} - -/**class for actions of ASM - * including run and debug code - */ -export class AsmAction implements Disposable { - private ctx: ExtensionContext; - private _config: Config; - private landiag: AssemblerDiag; - constructor(context: ExtensionContext) { - this.ctx = context; - this._config = new Config(context); - this.landiag = new AssemblerDiag(); - } - - static getEmulator(emu: DOSEMU, conf: Config): EMURUN { - switch (emu) { - case DOSEMU.dosbox: - return new DOSBox(conf); - case DOSEMU.auto: - return new AutoMode(conf); - case DOSEMU.msdos: - return new MsdosPlayer(conf); - case DOSEMU.jsdos: - return new JSDos(conf); - default: - window.showWarningMessage('use dosbox as emulator'); - return new DOSBox(conf); - } - } - - /**open the dosbox and switch to the needed folder*/ - public async BoxHere(uri?: Uri, emulator?: DOSEMU): Promise { - //get the folder need to open - let folder: Uri | undefined = undefined; - if (uri) { - folder = uri; - } - else { - if (window.activeTextEditor?.document) { - folder = Uri.joinPath(window.activeTextEditor?.document.uri, '../'); - } - else if (workspace.workspaceFolders) { - if (workspace.workspaceFolders.length === 1) { - folder = workspace.workspaceFolders[0].uri; - } - else if (workspace.workspaceFolders.length > 1) { - const a = await window.showWorkspaceFolderPick(); - if (a) { folder = a.uri; } - } - } - } - //choose the emulator - const dosemu = emulator ? emulator : DOSEMU.dosbox; - const emu = AsmAction.getEmulator(dosemu, this._config); - //open the emulator - if (folder && await emu.prepare()) { - const output = await emu.openEmu(folder); - return output; - } - else { - window.showWarningMessage('no folder to open \nThe extension use the activeEditor file\'s folder or workspace folder'); - } - } - - /**Do the operation according to the input.*/ - public async runcode(command: ASMCMD, uri?: Uri): Promise { - const emulator = AsmAction.getEmulator(this._config.DOSemu, this._config); - const output: RUNCODEINFO = { diagCode: DIAGCODE.null }; - //get the target file - let src: SRCFILE | undefined; - if (uri) { - src = new SRCFILE(uri); - } - else if (window.activeTextEditor?.document) { - src = new SRCFILE(window.activeTextEditor.document.uri); - } - //construct the source code file class - if (!src) { - window.showErrorMessage('no source file specified'); - } - else if (!await emulator.prepare({ src: src, act: command })) { - console.warn(this._config.DOSemu + ' emulator is not ready'); - } - else { - const doc = await workspace.openTextDocument(src.uri); - if (doc.isDirty && this._config.savefirst) { - await doc.save(); - } - //output the message of the command - const msg = { title: "", content: src.pathMessage() }; - switch (command) { - case ASMCMD.OpenEmu: - msg.title = localize("openemu.msg", "\n[execute]Open emulator and prepare environment"); - break; - case ASMCMD.run: - msg.title = localize("run.msg", "\n[execute]use {0} in {1} to Run ASM code file:", this._config.MASMorTASM, this._config.DOSemu); - break; - case ASMCMD.debug: - msg.title = localize("debug.msg", "\n[execute]use {0} in {1} to Debug ASM code file:", this._config.MASMorTASM, this._config.DOSemu); - break; - } - if (this._config.Separate || emulator.forceCopy) { - const dst = emulator.copyUri === undefined ? this._config.Uris.workspace : emulator.copyUri; - await src.copyto(dst); - msg.content += localize('copy.msg', `\ncopied as "{0}"`, src.uri.fsPath); - } - if (this._config.Clean) { - await src.cleanDir(); - } - Logger.send(msg); - const msgProcessor: MSGProcessor = - (message: string | { asm: string; link: string }, opt?: { preventWarn: boolean }) => { - const msg = typeof (message) === 'string' ? message : message.asm; - output.message = message; - const diag = this.landiag.ErrMsgProcess(msg, doc, this.ASM); - output.diagnose = diag; - if (diag?.code !== undefined) { output.diagCode = diag?.code; } - if (diag) { - Logger.send({ - title: localize("diag.msg", "[assembler's message] {0} Error,{1} Warning collected", diag.error.toString(), diag.warn.toString()), - content: msg - }); - } - switch (diag?.code) { - case DIAGCODE.ok: - return true; - case DIAGCODE.hasWarn: - if (opt?.preventWarn) { - return false; - } - else { - return this.showWarnInfo(); - } - case DIAGCODE.hasError: - this.showErrorInfo(); - Logger.OutChannel.show(true); - return false; - } - return false; - }; - switch (command) { - case ASMCMD.OpenEmu: - output.emulator = emulator.openEmu(src.folder); - break; - case ASMCMD.run: - output.emulator = await emulator.Run(src, msgProcessor); - break; - case ASMCMD.debug: - output.emulator = await emulator.Debug(src, msgProcessor); - break; - }; - } - return output; - } - private async showWarnInfo(): Promise { - const warningmsgwindow = localize("runcode.warn", "{0} Warning,successfully generate .exe file,but assembler has some warning message", this.ASM); - const Continue = localize("runcode.continue", "continue"); - const Stop = localize("runcode.stop", "stop"); - const result = await window.showInformationMessage(warningmsgwindow, Continue, Stop); - if (result === Continue) { - return true; - } - return false; - } - private async showErrorInfo(): Promise { - const Errmsg = localize("runcode.error", "{0} Error,Can't generate .exe file\nSee Output panel for information", this._config.MASMorTASM); - await window.showErrorMessage(Errmsg); - } - public cleanalldiagnose(): void { - this.landiag.cleandiagnose(); - } - public dispose(): void { - Logger.OutChannel.dispose(); - this.cleanalldiagnose(); - } - public get ASM(): ASMTYPE { return this._config.MASMorTASM; } - public get emulator(): DOSEMU { return this._config.DOSemu; } -} - - diff --git a/src/ASM/statusBar.ts b/src/ASM/statusBar.ts new file mode 100644 index 0000000..93e1f24 --- /dev/null +++ b/src/ASM/statusBar.ts @@ -0,0 +1,58 @@ +import * as vscode from 'vscode'; +import * as conf from '../utils/configuration'; + +const bar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left); + +const emu = [ + conf.DosEmulatorType.jsdos, + conf.DosEmulatorType.dosbox, + conf.DosEmulatorType.dosboxX, + conf.DosEmulatorType.msdos +]; + +const asm = [ + conf.Assembler['MASM-v5.00'], + conf.Assembler['MASM-v6.11'], + conf.Assembler.TASM +]; + +const iterms: string[] = []; +for (const e of emu) { + for (const a of asm) { + if (e === conf.DosEmulatorType.msdos) { + if (a === conf.Assembler.TASM || a === conf.Assembler['MASM-v6.11']) + continue; + } + iterms.push(e + '\t' + a); + } +} + +function showStatus() { + bar.command = 'masmtasm.updateEmuASM'; + bar.text = `${conf.extConf.emulator} ${conf.extConf.asmType}`; + bar.show(); +} + +async function statusBarCommand() { + const _conf = vscode.workspace.getConfiguration('masmtasm.ASM'); + + if (process.platform === 'win32') { + emu.push(conf.DosEmulatorType.msdos); + } + + const placeHolder = 'choose DOS environment emulator and assembler'; + const Selected = await vscode.window.showQuickPick(iterms, { placeHolder }); + if (Selected) { + const [emu1, asm1] = Selected?.split('\t'); + const target = vscode.ConfigurationTarget.Global; + await _conf.update('emulator', emu1, target); + await _conf.update('assembler', asm1, target); + showStatus(); + } +} + +export function activate(context: vscode.ExtensionContext): void { + const disposable = vscode.commands.registerCommand('masmtasm.updateEmuASM', statusBarCommand); + context.subscriptions.push(disposable); + showStatus(); +} \ No newline at end of file diff --git a/src/ASM/util.ts b/src/ASM/util.ts index 6da61b0..a2a28ae 100644 --- a/src/ASM/util.ts +++ b/src/ASM/util.ts @@ -13,7 +13,7 @@ export function inDirectory(dirinfo: [string, FileType][], entry: [string, FileT } } return; -}; +} /** * make sure value in the list diff --git a/src/ASM/vscode-dosbox.ts b/src/ASM/vscode-dosbox.ts new file mode 100644 index 0000000..20c3c4f --- /dev/null +++ b/src/ASM/vscode-dosbox.ts @@ -0,0 +1,107 @@ +/** + * API from extension [vscode-dosbox](https://marketplace.visualstudio.com/items?itemName=xsro.vscode-dosbox) + * originally from https://github.com/dosasm/vscode-dosbox/blob/main/src/api.ts + */ + +import { CommandInterface, Emulators } from 'emulators'; +import * as Jszip from 'jszip'; +import * as vscode from 'vscode'; + +export interface DosboxResult { + stdout: string, + stderr: string, + exitCode: number | null; +} + +export interface Dosbox { + /** + * update the main part of the dosbox configuration file + */ + updateConf(section: string, key: string, value: string | number | boolean): boolean, + /** + * update the autoexec section of the dosbox configuration file + */ + updateAutoexec(context: string[]): void, + /** + * update the conf file from jsdos bundle + * + * @param bundle the bundle data + * @param tempFolder the destination to exact the bundle file + */ + fromBundle(bundle: Uint8Array, tempFolder: vscode.Uri): Promise + /** + * run the emulator + * + * @param params the parameter passed to dosbox via command line + */ + run(params?: string[]): Promise +} + +export interface Jsdos { + /** + * set the jsdos bundle to use + * + * @deprecated use jszip + * @param bundle the Uint8Array data of the jsdos bundle or its Uri + * @param updateConf use the conf file in the bundle + */ + setBundle(bundle: vscode.Uri | Uint8Array, updateConf?: boolean): void, + /** + * the [jszip object](https://stuk.github.io/jszip/) + * + * change this to change the bundle's data, + * the extension call it to generate bundle data + */ + jszip: Jszip; + updateConf(section: string, key: string, value: string | number | boolean): boolean, + updateAutoexec(context: string[]): void, + /** + * run jsdos in the VSCode's extension Host + * + * @todo make this also work in web extension + * @returns [CommandInterface](https://js-dos.com/v7/build/docs/command-interface) + */ + runInHost(): Promise, + /** + * run **jsdos in the webview**. This works in all platform including web + * + * @param bundle the Uint8Array data of the jsdos bundle + * @returns the vscode webview running JSDos + */ + runInWebview(): Promise, +} + +export interface API { + /** + * [jsdos](https://js-dos.com/v7/build/) emulator + * is the core of jsdos -- the simpliest API to run DOS games in browser + * + * @see https://github.com/js-dos/emulators + */ + emulators: Emulators; + /** + * run Jsdos in ExtensionHost or Webview + */ + jsdos: Jsdos; + + /** + * run DOSBox via child_process + */ + dosbox: Dosbox; + /** + * run DOSBox-x via child_process + */ + dosboxX: Dosbox; + + /** + * run msdos player via cmd.exe + * + * @returns a terminal to control + */ + msdosPlayer(msdosArgs?: string[], command?: string): vscode.Terminal; + /**path of the packed msdos player */ + msdosPath: string, + /**path of the packed command.com file */ + commandPath: string + +} \ No newline at end of file diff --git a/src/ASM/diagnose/codeAction.ts b/src/diagnose/codeAction.ts similarity index 100% rename from src/ASM/diagnose/codeAction.ts rename to src/diagnose/codeAction.ts diff --git a/src/ASM/diagnose/diagnoseMASM.ts b/src/diagnose/diagnoseMASM.ts similarity index 97% rename from src/ASM/diagnose/diagnoseMASM.ts rename to src/diagnose/diagnoseMASM.ts index 2f03973..a90e400 100644 --- a/src/ASM/diagnose/diagnoseMASM.ts +++ b/src/diagnose/diagnoseMASM.ts @@ -1,5 +1,5 @@ import { TextDocument, DiagnosticCollection, Diagnostic, DiagnosticSeverity } from "vscode"; -import { ASMdiagnostic, DIAGINFO } from './diagnose'; +import { ASMdiagnostic, DIAGINFO } from './main'; export function masmDiagnose(MASMmsg: string, doc: TextDocument, collection: DiagnosticCollection): DIAGINFO { const diagnostics: Diagnostic[] = []; let error = 0, warn = 0; diff --git a/src/ASM/diagnose/diagnoseMasm-error-list.ts b/src/diagnose/diagnoseMasm-error-list.ts similarity index 100% rename from src/ASM/diagnose/diagnoseMasm-error-list.ts rename to src/diagnose/diagnoseMasm-error-list.ts diff --git a/src/ASM/diagnose/diagnoseTASM.ts b/src/diagnose/diagnoseTASM.ts similarity index 90% rename from src/ASM/diagnose/diagnoseTASM.ts rename to src/diagnose/diagnoseTASM.ts index 43d5588..cc9c41f 100644 --- a/src/ASM/diagnose/diagnoseTASM.ts +++ b/src/diagnose/diagnoseTASM.ts @@ -1,5 +1,5 @@ import { Diagnostic, TextDocument, DiagnosticCollection, DiagnosticSeverity } from "vscode"; -import { ASMdiagnostic, DIAGINFO } from './diagnose'; +import { ASMdiagnostic, DIAGINFO } from './main'; /** * Process the output of TASM assembler * @param TASMmsg the output of TASM @@ -8,8 +8,8 @@ import { ASMdiagnostic, DIAGINFO } from './diagnose'; */ export function tasmDiagnose(TASMmsg: string, doc: TextDocument, collection: DiagnosticCollection): DIAGINFO { const diagnostics: Diagnostic[] = []; - const tasm = /\s*\*+(Error|Warning|Fatal)\*+\s+(.*.ASM)\((\d+)\)\s+(.*)/; - const tasmMacro = /\s*\*+(Error|Warning|Fatal)\*+\s+(.*.ASM)\((\d+)\) (.*)\((\d+)\)\s+(.*)/; + const tasm = /\s*\*+(Error|Warning|Fatal)\*+\s+(.*)\((\d+)\)\s+(.*)/; + const tasmMacro = /\s*\*+(Error|Warning|Fatal)\*+\s+(.*)\((\d+)\) (.*)\((\d+)\)\s+(.*)/; let error = 0, warn = 0; const severity = (str: string): DiagnosticSeverity | undefined => { switch (str) { diff --git a/src/ASM/diagnose/diagnose.ts b/src/diagnose/main.ts similarity index 78% rename from src/ASM/diagnose/diagnose.ts rename to src/diagnose/main.ts index 81303ab..7fff869 100644 --- a/src/ASM/diagnose/diagnose.ts +++ b/src/diagnose/main.ts @@ -1,8 +1,32 @@ +/** + * Process the message from Assembler + * + * @file diagnose/main.ts + */ + import { Diagnostic, DiagnosticCollection, DiagnosticRelatedInformation, DiagnosticSeverity, languages, Location, TextDocument, Uri } from 'vscode'; -import { ASMTYPE } from '../configration'; +import * as vscode from 'vscode'; +import { Assembler } from '../utils/configuration'; import { masmDiagnose } from './diagnoseMASM'; import { getInternetlink } from './diagnoseMasm-error-list'; import { tasmDiagnose } from './diagnoseTASM'; +import { SeeinCPPDOCS } from './codeAction'; + + +export function activate(context: vscode.ExtensionContext) { + if (vscode.workspace.getConfiguration('masm-tasm').get('ASM.MASMorTASM') === Assembler.MASM) { + const disposable: vscode.Disposable = vscode.languages.registerCodeActionsProvider('assembly', new SeeinCPPDOCS(), { + providedCodeActionKinds: SeeinCPPDOCS.providedCodeActionKinds + }); + context.subscriptions.push(disposable); + } + + const diag = new AssemblerMessageDiagnose(); + const disposable = vscode.commands.registerCommand('masm-tasm.cleanalldiagnose', () => diag.clean()); + context.subscriptions.push(disposable); + + return diag; +} export enum DIAGCODE { /**null*/ @@ -18,9 +42,12 @@ export enum DIAGCODE { } /** - * the class use to diagnose the information from the MASM or TASM assembler + * the class used to diagnose the information from the MASM or TASM assembler + * + * - use `process` method to process the message + * - use `clean` to clear all diagnostic information produced by this class */ -export class AssemblerDiag { +export class AssemblerMessageDiagnose { private _masmCollection: DiagnosticCollection; private _tasmCollection: DiagnosticCollection; constructor() { @@ -35,13 +62,14 @@ export class AssemblerDiag { * @param doc the document of source code * @param ASM MASM or TASM */ - public ErrMsgProcess(AsmMsg: string, doc: TextDocument, ASM: ASMTYPE): DIAGINFO | undefined { + public process(AsmMsg: string, doc: TextDocument, ASM: Assembler): DIAGINFO | undefined { let diag: DIAGINFO | undefined; switch (ASM) { - case ASMTYPE.TASM: + case Assembler.TASM: diag = tasmDiagnose(AsmMsg, doc, this._tasmCollection); break; - case ASMTYPE.MASM: + case Assembler['MASM-v5.00']: + case Assembler['MASM-v6.11']: diag = masmDiagnose(AsmMsg, doc, this._masmCollection); break; default: @@ -63,15 +91,15 @@ export class AssemblerDiag { * clean the diagnoses * @param ASM sepecify which ASM diagnositics to clear, if undefined, clear both MASM and TASM diagnositcs */ - public cleandiagnose(ASM?: ASMTYPE): void { - if (ASM === undefined || ASM === ASMTYPE.MASM) { + public clean(ASM?: Assembler): void { + if (ASM === undefined || ASM === Assembler.MASM) { this._masmCollection.clear(); } - if (ASM === undefined || ASM === ASMTYPE.TASM) { + if (ASM === undefined || ASM === Assembler.TASM) { this._tasmCollection.clear(); } } -}; +} /**the information of diagnostics */ export interface DIAGINFO { @@ -103,7 +131,7 @@ function lineMacro2DOC(text: string, macroName: string, macroLine: number, local if (local && array[index + 1].match(/LOCAL|local/)) { docMacroLine = index + 1; } - }; + } } ); if (docMacroLine) { diff --git a/src/diagnose/messageCollector.ts b/src/diagnose/messageCollector.ts new file mode 100644 index 0000000..0ec16ef --- /dev/null +++ b/src/diagnose/messageCollector.ts @@ -0,0 +1,30 @@ + + +export function messageCollector(): [(msg: string) => void, Promise] { + let allmsg = ""; + let resolve: ((value: string) => void) | undefined = undefined; + return [ + (msg: string) => { + allmsg += msg; + let re = allmsg.match(/Microsoft \(R\) MASM Compatibility Driver([\s\S]*)Microsoft \(R\) Segmented Executable Linker/); + if (re && re[1] && resolve) { + resolve(re[1]); + resolve = undefined; + } + re = allmsg.match(/Turbo Assembler Version 4.1 Copyright \(c\) 1988, 1996 Borland International([\s\S]*)Turbo Link Version 7\./); + if (re && re[1] && resolve) { + resolve(re[1]); + resolve = undefined; + } + re = allmsg.match(/Microsoft \(R\) Macro Assembler Version 5.00([\s\S]*)Microsoft \(R\) Overlay Linker Version 3.60/); + if (re && re[1] && resolve) { + resolve(re[1]); + resolve = undefined; + } + } + , + new Promise( + _resolve => resolve = _resolve + )]; + +} \ No newline at end of file diff --git a/src/emulator/DOSBox.ts b/src/emulator/DOSBox.ts deleted file mode 100644 index e297389..0000000 --- a/src/emulator/DOSBox.ts +++ /dev/null @@ -1,292 +0,0 @@ -import { TextEncoder } from "util"; -import { FileType, Uri, workspace, WorkspaceConfiguration, window } from 'vscode'; -import { localize } from '../i18n'; -import { ASMTYPE, Config, SRCFILE, settingsStrReplacer } from '../ASM/configration'; -import { Logger } from '../ASM/outputChannel'; -import { ASMPREPARATION, ASSEMBLERMSG, EMURUN, MSGProcessor } from "../ASM/runcode"; -import { inDirectory } from "../ASM/util"; -import { writeBoxconfig } from './dosbox_conf'; -import { DOSBox as dosboxCore, WINCONSOLEOPTION, DOSBoxStd } from './dosbox_core'; -const fs = workspace.fs; -/**the limit of commands can be exec in dosbox, over this limit the commands will be write to a file*/ -const DOSBOX_CMDS_LIMIT = 5; -/**the time interval between launch dosbox and read asmlog file*/ -const WAIT_AFTER_LAUNCH_DOSBOX = 8000; -/**the file name of dosbox conf file for use */ -const DOSBOX_CONF_FILENAME = 'VSC-ExtUse.conf'; -/**the file name of log of assembler */ -const ASM_LOG_FILE = 'ASM.LOG'; -/**the file name of log of linker */ -const LINK_LOG_FILE = 'LINK.LOG'; -const DELAY = (timeout: number): Promise => new Promise((resolve) => { - setTimeout(resolve, timeout); -}); - -/**interface for configurations from vscode settings */ -interface DosboxAction { - open: string[]; - masm: string[]; - tasm: string[]; - tasm_debug: string[]; - masm_debug: string[]; - run: string[]; - after_action: string[]; -} - -/**class for configurations from VSCode settings */ -class BoxVSCodeConfig { - private get _target(): WorkspaceConfiguration { - return workspace.getConfiguration('masmtasm.dosbox'); - }; - get config(): { [id: string]: string } | undefined { - return this._target.get('config'); - } - get run(): string | undefined { - return this._target.get('run'); - } - get console(): string { - return this._target.get('console') as string; - } - get command(): string | undefined { - const output = this._target.get('command'); - if (typeof output !== 'string') { - return undefined; - } - return output; - } - getAction(scope: keyof DosboxAction): string[] { - const id = 'masmtasm.dosbox.more'; - const a = this._target.get('more') as DosboxAction; - if (a === null || a === undefined) { - window.showErrorMessage(`${a} is not allowed in ${id}`); - } else { - let output = a[scope]; - if (Array.isArray(output)) { - if (this.replacer) { - output = output.map(this.replacer); - } - return output; - } - else { - window.showErrorMessage(`action ${scope} is undefined or not a array in ${id}`); - } - } - throw new Error(`no ${scope} in ${id}:${JSON.stringify(a)}`); - } - replacer?: (str: string) => string; - public runDebugCmd(runOrDebug: boolean, ASM: ASMTYPE): string[] { - if (runOrDebug) { - return this.getAction('run'); - } - else { - switch (ASM) { - case ASMTYPE.MASM: return this.getAction('masm_debug'); - case ASMTYPE.TASM: return this.getAction('tasm_debug'); - } - } - } - public AsmLinkRunDebugCmd(runOrDebug: boolean, ASM: ASMTYPE): string[] { - let asmlink: string[]; - switch (ASM) { - case ASMTYPE.MASM: asmlink = this.getAction('masm'); break; - case ASMTYPE.TASM: asmlink = this.getAction('tasm'); break; - } - return asmlink.concat(this.runDebugCmd(runOrDebug, ASM)); - } -} - -export class DOSBox extends dosboxCore implements EMURUN { - //private dosboxChannel: OutputChannel = window.createOutputChannel('DOSBox console'); - private _BOXrun: string | undefined; - private _conf: Config; - private vscConfig: BoxVSCodeConfig; - constructor(conf: Config) { - const vscConf = new BoxVSCodeConfig(); - let boxconsole: WINCONSOLEOPTION | undefined = undefined; - if (vscConf.command === undefined || vscConf.command.length === 0) { - switch (vscConf.console) { - case "min": - boxconsole = WINCONSOLEOPTION.min; - break; - case "normal": - boxconsole = WINCONSOLEOPTION.normal; - break; - case "noconsole": - case "redirect(show)": - case "redirect": - default: - boxconsole = WINCONSOLEOPTION.noconsole; - break; - } - } - super(conf.Uris.dosbox.fsPath, vscConf.command, boxconsole); - this.forceCopy = false; - this._conf = conf; - this.vscConfig = vscConf; - - this._BOXrun = vscConf.run; - - if (this.redirect) { - this.stdoutHander = (message: string, text: string, code: number): void => { - Logger.send({ - title: localize('dosbox.console.stdout', '[dosbox console stdout] No.{0}', code.toString()), - content: message - }); - if (vscConf.console === 'redirect(show)') { - Logger.OutChannel.show(true); - } - else if (vscConf.console === 'redirect(hide)') { - Logger.OutChannel.hide(); - } - }; - this.stderrHander = (message: string, _text: string, code: number): void => { - Logger.send({ - title: localize('dosbox.console.stderr', '[dosbox console stderr] No.{0}', code.toString()), - content: message - }); - }; - } - } - //implement the interface - forceCopy: boolean; - async prepare(opt?: ASMPREPARATION): Promise { - //write the config file for extension - this.confFile = Uri.joinPath(this._conf.Uris.globalStorage, DOSBOX_CONF_FILENAME); - await writeBoxconfig(this.confFile, this.vscConfig.config); - if (opt) { - this.forceCopy = !opt.src.dosboxFsReadable; - }; - this.vscConfig.replacer = (val: string): string => settingsStrReplacer(val, this._conf, opt ? opt.src : undefined); - return true; - } - openEmu(folder: Uri): Promise { - return this.runDosbox(folder, []); - } - async Run(src: SRCFILE, msgprocessor?: MSGProcessor): Promise { - const { all, race } = await this.runDebug(src, true); - const asm = await race; - if (msgprocessor) { msgprocessor(asm, { preventWarn: true }); } - await all; - } - async Debug(src: SRCFILE, msgprocessor?: MSGProcessor): Promise { - const { all, race } = await this.runDebug(src, false); - const asm = await race; - if (msgprocessor) { msgprocessor(asm, { preventWarn: true }); } - await all; - } - /** - * A function to run or debug ASM codes in DOSBox - * @param runOrDebug true for run ASM code,false for debug - * @param file the Uri of the file - * @returns the Assembler's output - */ - public async runDebug(src: SRCFILE, runOrDebug: boolean): Promise<{ all: Promise; race: Promise }> { - //clean logs file for asm and link - const dirs = await fs.readDirectory(this._conf.Uris.globalStorage); - let dir = inDirectory(dirs, [ASM_LOG_FILE, FileType.File]); - if (dir) { - const asmloguri = Uri.joinPath(this._conf.Uris.globalStorage, dir[0]); - await fs.delete(asmloguri); - } - dir = inDirectory(dirs, [LINK_LOG_FILE, FileType.File]); - if (dir) { - const asmloguri = Uri.joinPath(this._conf.Uris.globalStorage, dir[0]); - await fs.delete(asmloguri); - } - //launch dosbox and read logs - /**read logs file and make sure asm log is not empty*/ - const readMsg = async (): Promise => { - const dirs = await fs.readDirectory(this._conf.Uris.globalStorage); - const asmlog = inDirectory(dirs, [ASM_LOG_FILE, FileType.File]); - const linklog = inDirectory(dirs, [LINK_LOG_FILE, FileType.File]); - if (asmlog && linklog) { - const asmloguri = Uri.joinPath(this._conf.Uris.globalStorage, asmlog[0]); - const linkloguri = Uri.joinPath(this._conf.Uris.globalStorage, linklog[0]); - const asm = (await fs.readFile(asmloguri)).toString(); - const link = (await fs.readFile(linkloguri)).toString(); - if (asm.trim().length > 0) { - return { asm, link }; - } - } - return undefined; - }; - /**read logs after DOSBox exit*/ - const exitRead: Promise<{ asm: string; link: string } | undefined> = new Promise( - async (resolve) => { - await this.runDosbox(src.folder, this.vscConfig.AsmLinkRunDebugCmd(runOrDebug, this._conf.MASMorTASM), { exitwords: true }); - const msg = await readMsg(); - resolve(msg); - } - ); - /**read logs at two time - * 1. WAIT_AFTER_LAUNCH_DOSBOX ms after launch DOSBox - * 2. after DOSBox exit - */ - const race: Promise<{ asm: string; link: string }> = new Promise( - async (resolve, reject) => { - await DELAY(WAIT_AFTER_LAUNCH_DOSBOX); - let msg = await readMsg(); - if (msg) { - resolve(msg); - } else { - msg = await exitRead; - if (msg) { - resolve(msg); - } - else { - reject('no log readed'); - } - } - - } - ); - return { all: exitRead, race }; - } - - /**open dosbox and do things about it - * this function will mount the tools as `C:` and the workspace as `D:` - * set paths for masm and tasm and switch to the disk - * @param folder The uri of the folder needed to mount to disk `d` - * @param more The commands needed to exec in dosbox - */ - public async runDosbox(folder: Uri, more?: string[], opt?: { exitwords: boolean }): Promise { - const boxcmd: string[] = this.vscConfig.getAction('open'); - boxcmd.push( - `@mount c \\\"${this._conf.Uris.tools.fsPath}\\\"`,//mount the tools folder as disk C - `@mount d \\\"${folder.fsPath}\\\"`,//mount the folder of source file as disk D - `@mount X \\\"${this._conf.Uris.globalStorage.fsPath}\\\"`,//mount a separate space as X for the extension to read logs - "d:"//switch to the disk of source code file - ); - if (more) { boxcmd.push(...more); } - if (opt?.exitwords) { boxcmd.push(...this.boxruncmd); } - //Logger.log(boxcmd); - if (boxcmd.length > DOSBOX_CMDS_LIMIT) { - const omit = boxcmd.slice(DOSBOX_CMDS_LIMIT - 1); - const unit8 = new TextEncoder().encode(omit.join('\n')); - const dst = Uri.joinPath(this._conf.Uris.globalStorage, 'more.bat'); - await fs.writeFile(dst, unit8); - boxcmd.splice(DOSBOX_CMDS_LIMIT - 1, omit.length); - boxcmd.push('@x:\\more.bat'); - } - return this.run(boxcmd); - } - - /** the command need to run in DOSBox after run the ASM code*/ - public get boxruncmd(): string[] { - switch (this._BOXrun) { - case "keep": - return []; - case "exit": - return (['exit']); - case 'pause': - return ['pause', 'exit']; - case "choose": - default: - return this.vscConfig.getAction('after_action'); - } - } -} - - - - diff --git a/src/emulator/JS-Dos.ts b/src/emulator/JS-Dos.ts deleted file mode 100644 index fe9112c..0000000 --- a/src/emulator/JS-Dos.ts +++ /dev/null @@ -1,146 +0,0 @@ -import * as vscode from 'vscode'; -import { Uri, window } from 'vscode'; -import { ASMTYPE, Config, settingsStrReplacer, SRCFILE } from '../ASM/configration'; -import { ASMCMD, ASMPREPARATION, EMURUN, MSGProcessor } from '../ASM/runcode'; -import { JsdosPanel } from './js-dos_Panel'; -import { createBundle } from './bundle'; - -interface JsdosAsmConfig { - "open": string[]; "masm": string[]; "tasm": string[]; - "run": string[]; "masm_debug": string[]; "tasm_debug": string[]; -} - -export class JSdosVSCodeConfig { - private static get _target(): vscode.WorkspaceConfiguration { - return vscode.workspace.getConfiguration('masmtasm.jsdos'); - } - public static get viewColumn(): vscode.ViewColumn { - switch (JSdosVSCodeConfig._target.get("viewColumn")) { - case 'Beside': - return vscode.ViewColumn.Beside; - case 'Active': - return vscode.ViewColumn.Active; - - } - return vscode.ViewColumn.Beside; - } - getAction(scope: keyof JsdosAsmConfig): string[] { - const id = 'masmtasm.jsdos.more'; - const a = JSdosVSCodeConfig._target.get('more') as JsdosAsmConfig; - if (a === null || a === undefined) { - window.showErrorMessage(`${a} is not allowed in ${id}`); - } else { - let output = a[scope]; - if (Array.isArray(output)) { - if (this.replacer) { - output = output.map(this.replacer); - } - return output; - } else { - window.showErrorMessage(`action ${scope} is undefined or not a array in ${id}`); - } - } - throw new Error(`no ${scope} in ${id}:${JSON.stringify(a)}`); - } - replacer?: ((str: string) => string) | undefined; - public runDebugCmd(runOrDebug: boolean, ASM: ASMTYPE): string[] { - if (runOrDebug) { - return this.getAction('run'); - } - else { - switch (ASM) { - case ASMTYPE.MASM: return this.getAction('masm_debug'); - case ASMTYPE.TASM: return this.getAction('tasm_debug'); - } - } - } - public AsmLinkRunDebugCmd(runOrDebug: boolean, ASM: ASMTYPE): string[] { - let asmlink: string[]; - switch (ASM) { - case ASMTYPE.MASM: asmlink = this.getAction('masm'); break; - case ASMTYPE.TASM: asmlink = this.getAction('tasm'); break; - } - return asmlink.concat(this.runDebugCmd(runOrDebug, ASM)); - } -} - -export class JSDos implements EMURUN { - private _conf: Config; - private _VscConf: JSdosVSCodeConfig; - forceCopy?: boolean; - - constructor(conf: Config) { - this._conf = conf; - this._VscConf = new JSdosVSCodeConfig(); - } - - private async genBundle(folder: Uri, autoexec: string[]): Promise { - autoexec.unshift( - 'mount y ./', - 'y:', - 'mount c ./asm', - 'mount d ./codes', - 'set path=c:\;%PATH%', - "d:" - ); - await createBundle(this._conf.asAbsolutePath('web/res/test.jsdos'), - '[AUTOEXEC]\r\n' + autoexec.join('\r\n'), - [ - { - from: folder.fsPath, - to: 'codes' - }, - { - from: this._conf.asAbsolutePath('tools/' + this._conf.MASMorTASM.toLowerCase()), - to: "asm" - } - ]); - return; - } - - async prepare(opt: ASMPREPARATION): Promise { - this.forceCopy = !opt.src.dosboxFsReadable && opt.act !== ASMCMD.OpenEmu; - return true; - } - - async openEmu(folder: vscode.Uri): Promise { - await this.genBundle(folder, []); - JsdosPanel.createOrShow(this._conf); - } - - Run(src: SRCFILE, msgprocessor: MSGProcessor): Promise { - return this.runDebug(true, src, msgprocessor); - } - Debug(src: SRCFILE, msgprocessor: MSGProcessor): Promise { - return this.runDebug(false, src, msgprocessor); - } - public async runDebug(runOrDebug: boolean, src: SRCFILE, msgprocessor: MSGProcessor): Promise { - const v = Uri.joinPath(Uri.file('/codes/'), `${src.filename}.${src.extname}`); - const wsrc = new SRCFILE(v); - this._VscConf.replacer = (val: string): string => settingsStrReplacer(val, this._conf, wsrc); - const cmds = this._VscConf.AsmLinkRunDebugCmd(runOrDebug, this._conf.MASMorTASM); - await this.genBundle(src.folder, cmds); - JsdosPanel.createOrShow(this._conf); - const p = new Promise( - (resolve, reject) => { - if (JsdosPanel.currentPanel?.onWdosboxStdout) { - JsdosPanel.currentPanel.onWdosboxStdout = - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - (_, all) => { - const re = all.join('').match(/D:([\s\S]*Assembling[\s\S]*?)D:/); - if (re && re[1]) { - resolve(re[1]); - if (JsdosPanel.currentPanel?.onWdosboxStdout) { - JsdosPanel.currentPanel.onWdosboxStdout = (): undefined => undefined; - } - } - }; - } - setTimeout(reject, 10000); - } - ); - const msg = await p; - await msgprocessor(msg); - return msg; - } -} \ No newline at end of file diff --git a/src/emulator/README.md b/src/emulator/README.md deleted file mode 100644 index 015f758..0000000 --- a/src/emulator/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Emulator - -this folder's code works with DOS Emulator. They are - -- [DOSBox](www.dosbox.com) -- [MSDOS player](http://takeda-toshiya.my.coocan.jp/msdos) -- auto: try to take advantages of both dosbox and msdos-player -- [js-dos](https://js-dos.com/): trying \ No newline at end of file diff --git a/src/emulator/auto-mode.ts b/src/emulator/auto-mode.ts deleted file mode 100644 index b29c004..0000000 --- a/src/emulator/auto-mode.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { Uri } from 'vscode'; -import { ASMTYPE, Config, SRCFILE } from '../ASM/configration'; -import { ASMPREPARATION, EMURUN, MSGProcessor } from '../ASM/runcode'; -import { DOSBox } from './DOSBox'; -import { MsdosPlayer } from './msdos-player'; - -export class AutoMode implements EMURUN { - private _dosbox: DOSBox; - private _msdos: MsdosPlayer; - private _conf: Config; - copyUri?: Uri; - forceCopy?: boolean; - constructor(conf: Config) { - this._conf = conf; - this._dosbox = new DOSBox(conf); - this._msdos = new MsdosPlayer(conf); - } - async prepare(opt?: ASMPREPARATION): Promise { - this.copyUri = this._msdos.copyUri; - const box = await this._dosbox.prepare(opt); - const player = this._msdos.prepare(opt); - this.forceCopy = this._msdos.forceCopy || this._dosbox.forceCopy; - return box && player; - } - openEmu(folder: Uri): Promise { - return this._dosbox.openEmu(folder); - } - async Run(src: SRCFILE, msgprocessor: MSGProcessor): Promise { - const msg = await this._msdos.runPlayer(this._conf); - if (await msgprocessor(msg)) { - await this._dosbox.Run(src); - } - return; - } - async Debug(src: SRCFILE, msgprocessor: MSGProcessor): Promise { - if (this._conf.MASMorTASM === ASMTYPE.MASM) { - return this._msdos.Debug(src, msgprocessor); - } - else { - const msg = await this._msdos.runPlayer(this._conf); - if (await msgprocessor(msg)) { - this._dosbox.Debug(src); - } - } - - } - -} \ No newline at end of file diff --git a/src/emulator/bundle.ts b/src/emulator/bundle.ts deleted file mode 100644 index bcf1420..0000000 --- a/src/emulator/bundle.ts +++ /dev/null @@ -1,71 +0,0 @@ -//methods for manipute jsdos-bundles -import * as fs from 'fs'; -import { resolve, relative } from 'path'; -import * as JSZip from 'jszip'; -import * as path from 'path'; - -/**create a jsdos bundle file by add new files to the sample. powered by https://stuk.github.io/jszip/ - * - * @param conf: the dosbox config, the original one will be overwrited - * @param copys: the files need to be add to the bundle - * @param sample: the base jsdos bundle -*/ -export async function createBundle(dst: string, conf?: string, copys?: { from: string; to: string }[], sample?: string): Promise { - const zip = new JSZip(); - if (sample) { - const zipdata = fs.readFileSync(sample); - await zip.loadAsync(zipdata); - } - if (conf) { - const data = conf; - zip.file('.jsdos/dosbox.conf', data); - } - if (Array.isArray(copys)) { - for (const m of copys) { - if (fs.existsSync(m.from)) { - const s = fs.statSync(m.from); - if (s.isDirectory()) { - for await (const f of getFiles(m.from)) { - const rel = relative(m.from, f); - const dst = path.posix.join(m.to, rel); - //console.log(rel, dst) - const data = fs.readFileSync(f); - zip.file(dst, data); - } - } - else if (s.isFile()) { - const data = fs.readFileSync(m.from); - zip.file(m.to, data); - } - } - } - } - return new Promise( - resolve => { - zip - .generateNodeStream({ type: 'nodebuffer', streamFiles: true }) - .pipe(fs.createWriteStream(dst)) - .on('finish', function () { - // JSZip generates a readable stream with a "end" event, - // but is piped here in a writable stream which emits a "finish" event. - console.log(dst + " written."); - resolve(dst); - }); - } - ) -} - -const readdir = fs.promises.readdir; - -// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -async function* getFiles(dir: string): any { - const dirents = await readdir(dir, { withFileTypes: true }); - for (const dirent of dirents) { - const res = resolve(dir, dirent.name); - if (dirent.isDirectory()) { - yield* getFiles(res); - } else { - yield res; - } - } -} \ No newline at end of file diff --git a/src/emulator/dosbox_conf.ts b/src/emulator/dosbox_conf.ts deleted file mode 100644 index 767f460..0000000 --- a/src/emulator/dosbox_conf.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { TextEncoder } from "util"; -import { FileSystem, workspace, Uri } from "vscode"; -const fs: FileSystem = workspace.fs; - -function writefile(Uri: Uri, Content: string): Thenable { - - return fs.writeFile(Uri, new TextEncoder().encode(Content)); -} - -class BOXCONF { - config: { [id1: string]: { [id2: string]: string } }; - constructor(a: { [id: string]: string }) { - const b: { [id1: string]: { [id2: string]: string } } = {}; - for (const key in a) { - //console.log(key, a[key]); - const [id1, id2] = key.split("."); - if (b[id1]) { - b[id1][id2] = a[key]; - } - else { - b[id1] = { [id2]: a[key] }; - } - } - this.config = b; - } - toFileString(): string { - const b = this.config; - let str = ""; - for (const id1 in b) { - if (id1 === "AUTOEXEC") { - str += "[AUTOEXEC]\n"; - const execstr = b[id1].undefined; - str += execstr.replace(/\\n/g, '\n') + '\n'; - } - else { - str += `[${id1}]\n`; - for (const id2 in b[id1]) { - str += `${id2}=${b[id1][id2]}\n`; - } - } - } - return str; - } -} - -/**configuration.get('dosbox.config') - * write the DOSBox configuration file - * @param autoExec the command autoexec - */ -export async function writeBoxconfig(configUri: Uri, config?: { [id: string]: string }, autoExec?: string): Promise { - if (config) { - let content: string = new BOXCONF(config).toFileString(); - if (autoExec) { content = content + '\n[AUTOEXEC]\n' + autoExec; } - await writefile(configUri, content); - } -} - - diff --git a/src/emulator/dosbox_core.ts b/src/emulator/dosbox_core.ts deleted file mode 100644 index 7806293..0000000 --- a/src/emulator/dosbox_core.ts +++ /dev/null @@ -1,225 +0,0 @@ -import { exec } from 'child_process'; -import { FileType, Uri, window, workspace } from 'vscode'; -import { inDirectory } from '../ASM/util'; - -/**defines the option to do with dosbox's console message **in windows system**. - * - For **windows**, if in **noconsole** mode,the dosbox will redirect the console message to files in the *dosbox.exe*'s folder. - * and the extension will put them to VSCode's outputChannel - * - NOTE: the message is put after DOSBox exit in windows; - * - For **other OS**, dosbox will put it's console message in shell's stdout and stderr. - * So the extension will put them to VSCode's outputChannel - */ -export enum WINCONSOLEOPTION { - /**use the `this._core` directly use `dosbox` directly. - * For windos, dosbox will create a console window. - * For other OS, dosbox will output the console message in shell.*/ - normal, - /**for windows using `start /min dosbox` - * this will create and minimize the console window*/ - min, - /**for windows using `dosbox -nocosle` - * dosbox will redirect the console message to files - * NOTE: for the extension, it will try to redirect the message to outputchannel*/ - noconsole, -} - -export class DOSBox { - public readonly _core: string;//the core command for run dosbox - public readonly _cwd?: string;//the cwd for child_process, usually as the folder of dosbox - protected confFile: Uri | undefined = undefined; - protected console: WINCONSOLEOPTION; - public get redirect(): boolean { - if (process.platform === 'win32') { - return this.console === WINCONSOLEOPTION.noconsole; - } - return true; - } - private _stdout = ""; - private _stderr = ""; - private _count = 0; - constructor(cwd?: string, core?: string, winconsole?: WINCONSOLEOPTION) { - if (core && core.length > 0) { - this._core = core; - } - else { - this._core = OpenDosboxCmd(winconsole); - } - this._cwd = cwd; - this.console = winconsole ? winconsole : WINCONSOLEOPTION.noconsole; - } - public run(boxcmd: string[], opt?: DOSBoxOption): Promise { - const preOpen = opt?.preOpen ? opt?.preOpen : ""; - const param = []; - if (this.console === WINCONSOLEOPTION.noconsole) { - param.push('-noconsole'); - } - if ((typeof opt?.confFile) === 'string') { - param.push(`-conf "${opt?.confFile}"`); - } - else if (opt?.confFile === undefined) { - param.push(`-conf "${this.confFile?.fsPath}"`); - } - if (opt?.param && opt?.param.length > 0) { - param.push(...opt.param); - } - if (boxcmd.length > 0) { - const mapper = (val: string): string => `-c "${val}"`; - param.push(...boxcmd.map(mapper)); - } - return this.runViaChildProcess(preOpen + this._core + ' ' + param.join(" ")); - } - public stdoutHander: (message: string, text: string, No: number) => void = (message: string) => { - console.log('stdout message', message); - }; - public stderrHander: (message: string, text: string, No: number) => void = (message: string) => { - console.log('stderr message', message); - }; - private runViaChildProcess(command: string, ignoreWinStd?: boolean): Promise { - //console.log(command); - this._count++; - const output: DOSBoxStd = { - flag: BoxStdNOTE.normal, - stdout: "", - stderr: '', - exitcode: undefined - }; - return new Promise( - (resolve, reject) => { - const child = exec( - command, - { - cwd: this._cwd, - }, - (error, stdout, stderr): void => { - if (error) { - reject(error); - } - else if (process.platform === 'win32' && this.redirect && this._cwd && ignoreWinStd !== true) { - winReadConsole(this._cwd).then( - (value) => { - if (value) { - output.stderr = value.stderr; - output.stdout = value.stdout; - resolve(output); - this.stderrHander(value.stderr, value.stderr, this._count); - this.stdoutHander(value.stdout, value.stdout, this._count); - } - }); - } - else { - output.stdout = stdout; - output.stderr = stderr; - if (process.platform === 'win32') { - if (this.redirect === false) { - output.flag = BoxStdNOTE.winNonoconsole; - } - else if (this._cwd === undefined) { - output.flag = BoxStdNOTE.noCwd; - } - // else if (ignoreWinStd === false) { - // output.flag = BoxStdNOTE.winCancelled; - // } - else if (ignoreWinStd === true) { - output.flag = BoxStdNOTE.winCancelledByUser; - } - - } - resolve(output); - } - }); - - child.on('exit', (code) => { - output.exitcode = code; - if (code !== 0) { - let msg = `Open dosbox Failed with exitcode ${code} `; - msg += 'executing shell command:' + command; - window.showErrorMessage(msg); - } - }); - if (this.redirect && process.platform !== 'win32') { - child.stdout?.on('data', (data) => { - this._stdout += data; - this.stdoutHander(data, this._stdout, this._count); - }); - child.stderr?.on('data', (data) => { - this._stderr += data; - this.stderrHander(data, this._stderr, this._count); - }); - } - } - ); - } -} - -enum BoxStdNOTE { - /**no 'noconsole' parameter - * The stdout and stderr are the output of shell command and - * it is not the console info for dosbox */ - winNonoconsole, - /**Cancelled for win32 - * The stdout and stderr are the output of shell command and - * it is not the console info for dosbox */ - winCancelled, - winCancelledByUser, - /** the stdout and stderr should be right */ - noCwd, - normal -} - -/**read the dosbox's console std information for win32 - * @param folder the folder to store stdout and stderr, usually the folder of dosbox.exe - */ -async function winReadConsole(folder: string): Promise<{ stdout: string; stderr: string }> { - const cwd = Uri.file(folder); - const fs = workspace.fs; - const dirs = await fs.readDirectory(cwd); - const output = { stdout: "", stderr: "" }; - let file = inDirectory(dirs, ['stderr.txt', FileType.File]); - if (file) { - output.stderr = (await fs.readFile(Uri.joinPath(cwd, file[0]))).toString(); - } - file = inDirectory(dirs, ['stdout.txt', FileType.File]); - if (file) { - output.stdout = (await fs.readFile(Uri.joinPath(cwd, file[0]))).toString(); - } - return output; -} -interface DOSBoxOption { - /** - * the command may be need to exec before open dosbox*/ - preOpen?: string; - confFile?: string; - param?: string[]; -} - -export interface DOSBoxStd { - stdout: string; - stderr: string; - flag: BoxStdNOTE; - exitcode: number | null | undefined; -} - - -/**default command for open dosbox */ -function OpenDosboxCmd(boxconsole?: WINCONSOLEOPTION): string { - //command for open dosbox - let command = "dosbox"; - //for windows,using different command according to dosbox's path and the choice of the console window - switch (process.platform) { - case 'win32': - switch (boxconsole) { - case WINCONSOLEOPTION.min: - command = 'start/min/wait "" dosbox'; break; - case WINCONSOLEOPTION.normal: - case WINCONSOLEOPTION.noconsole: - default: command = 'dosbox'; break; - } - break; - case 'darwin': - command = "open -a DOSBox --args"; - break; - default: - command = 'dosbox'; - } - return command; -} diff --git a/src/emulator/js-dos_Panel.ts b/src/emulator/js-dos_Panel.ts deleted file mode 100644 index 2b4cb76..0000000 --- a/src/emulator/js-dos_Panel.ts +++ /dev/null @@ -1,182 +0,0 @@ -import * as vscode from 'vscode'; -import { Config } from '../ASM/configration'; -import { localize } from '../i18n'; -import { JSdosVSCodeConfig } from './JS-Dos'; - -export interface LaunchOption { - wdosboxUrl?: vscode.Uri; - cycles?: number | 'auto' | 'max'; - autolock?: boolean; - /**the file need to write */ - writes: { - path: string; - body: ArrayBuffer | Uint8Array | string; - }[]; - /**the file need to write */ - extracts: Array<[vscode.Uri, string]>; - /**the comands send to wdosbox option */ - options?: string[]; - /**the commands send to wdosbox's shell after launch*/ - shellcmds: string[]; -} - -export enum JSDosSTATUS { - preparing, - /**fs avaliable */ - fs, - main, - /**ci avaliable */ - running, - exit -} - -/** - * Manages Js-dos webview panels - */ -export class JsdosPanel { - /** - * Track the currently panel. Only allow a single panel to exist at a time. - */ - public static currentPanel: JsdosPanel | undefined; - - public static readonly viewType = 'Jsdos 7.x wdosbox'; - - public static createOrShow(conf: Config): void { - - // If we already have a panel, show it. - if (JsdosPanel.currentPanel) { - JsdosPanel.currentPanel.dispose(); - vscode.window.showWarningMessage(localize('jsdos.panel.forceUpdate', 'your former jsdos pannel has been disposed')); - } - - // Otherwise, create a new panel. - const panel = vscode.window.createWebviewPanel( - JsdosPanel.viewType, - 'jsdos wdosbox', - { - viewColumn: JSdosVSCodeConfig.viewColumn, - preserveFocus: true - }, - { - // Enable javascript in the webview - enableScripts: true, - - // And restrict the webview to only loading content from our extension's `media` directory. - localResourceRoots: [ - conf.asAbsoluteUri('node_modules/emulators/dist'), - conf.asAbsoluteUri('node_modules/emulators-ui/dist'), - conf.asAbsoluteUri('web/dist'), - conf.asAbsoluteUri('web/res/') - ] - } - ); - - JsdosPanel.currentPanel = new JsdosPanel(panel, conf); - } - - public static revive(panel: vscode.WebviewPanel, conf: Config): void { - JsdosPanel.currentPanel = new JsdosPanel(panel, conf); - } - - private readonly _panel: vscode.WebviewPanel; - private _disposables: vscode.Disposable[] = []; - - public jsdosStatus: JSDosSTATUS | boolean = false; - /**record all message from this pannel */ - public allWdosboxStdout: string[] = []; - public onWdosboxStdout: ((val: string, all: string[]) => void) = () => undefined; - - private constructor(panel: vscode.WebviewPanel, private conf: Config) { - this._panel = panel; - - // Set the webview's initial html content - this._update(); - - // Listen for when the panel is disposed - // This happens when the user closes the panel or when the panel is closed programatically - this._panel.onDidDispose(() => this.dispose(), null, this._disposables); - - // Update the content based on view changes - this._panel.onDidChangeViewState( - () => { - if (this._panel.visible) { - this._update(); - } - }, - null, - this._disposables - ); - - // Handle messages from the webview - this._panel.webview.onDidReceiveMessage( - message => { - switch (message.command) { - case 'stdout': - this.allWdosboxStdout.push(message.value); - this.onWdosboxStdout(message.value, this.allWdosboxStdout); - break; - } - }, - null, - this._disposables - ); - } - - public dispose(): void { - JsdosPanel.currentPanel = undefined; - - // Clean up our resources - this._panel.dispose(); - - while (this._disposables.length) { - const x = this._disposables.pop(); - if (x) { - x.dispose(); - } - } - } - - private _update(): void { - const webview = this._panel.webview; - this._panel.webview.html = this._getHtmlForWebview(webview); - } - - private _getHtmlForWebview(webview: vscode.Webview): string { - const asWeb = (str: string): vscode.Uri => { - const fullpath = this.conf.asAbsoluteUri(str); - return webview.asWebviewUri(fullpath); - }; - return ` - - - - - - - - - - - -
-
-
- - - - -`; - } -} diff --git a/src/emulator/msdos-player.ts b/src/emulator/msdos-player.ts deleted file mode 100644 index eb609a7..0000000 --- a/src/emulator/msdos-player.ts +++ /dev/null @@ -1,171 +0,0 @@ -import { exec } from 'child_process'; -import { Terminal, Uri, window, workspace, WorkspaceConfiguration } from 'vscode'; -import { ASMTYPE, Config, DOSEMU, settingsStrReplacer, SRCFILE } from '../ASM/configration'; -import { ASMCMD, ASMPREPARATION, ASSEMBLERMSG, EMURUN, MSGProcessor } from '../ASM/runcode'; - -/**the config from VSCode settings `masmtasm.msdos`*/ -class MsdosVSCodeConfig { - private get _target(): WorkspaceConfiguration { - return workspace.getConfiguration('masmtasm.msdos'); - }; - getAction(scope: MsdosActionKey): string { - const id = 'masmtasm.msdos.more'; - const a = this._target.get('more') as { [id: string]: string }; - if (a === null || a === undefined) { - window.showErrorMessage(`${a} is not allowed in ${id}`); - } else { - let output = a[scope]; - if (typeof (output) === 'string') { - if (this.replacer) { - output = this.replacer(output); - } - return output; - } - else { - window.showErrorMessage(`action ${scope} is undefined or not a array in ${id}`); - } - } - throw new Error(`no ${scope} in ${id}:${JSON.stringify(a)}`); - } - replacer: ((str: string) => string) | undefined = undefined; -} - -interface MsdosAction { - workspace: string; - path: string; - masm: string; - tasm: string; - masm_debug: string; - run: string; -} - -type MsdosActionKey = keyof MsdosAction; - -export class MsdosPlayer implements EMURUN { - static getASMmessage(val: string): ASSEMBLERMSG { - const asm = /\s*===ASM message===([\s\S]*?)===ASM END===\s*/; - const lnk = /\s*===LINK message===([\s\S]*?)===LINK END===\s*/; - const asmre = asm.exec(val); - const lnkre = lnk.exec(val); - if (asmre && lnkre && asmre[1] && lnkre[1]) { - return { - asm: asmre[1], - link: lnkre[1] - }; - } - console.error('no message scaned', val); - return val; - } - copyUri?: Uri; - forceCopy?: boolean; - private _conf: Config; - private _vscConf: MsdosVSCodeConfig; - static msdosTerminal: Terminal | undefined = undefined; - constructor(conf: Config) { - this._conf = conf; - this._vscConf = new MsdosVSCodeConfig(); - const ws = this._vscConf.getAction('workspace'); - this.copyUri = ws ? Uri.file(ws) : undefined; - } - - prepare(opt?: ASMPREPARATION): boolean { - if (opt) { - if (this._conf.MASMorTASM === ASMTYPE.TASM && opt.act === ASMCMD.debug && this._conf.DOSemu === DOSEMU.msdos) { - const msg = `disabled for tasm's TD is hardly runable in msdos`; - window.showErrorMessage(msg); - return false; - } - this.forceCopy = opt.src.filename.includes(' '); - } - this._vscConf.replacer = ( - (val: string): string => settingsStrReplacer(val, this._conf, opt ? opt.src : undefined) - ); - return true; - } - openEmu(folder: Uri, command?: string): boolean { - const re = folder.fsPath.match(/([a-zA-Z]):/); - const disk = re ? `${re[1]}:` : ``; - const cmd = [ - `${disk}`, - `cd ${folder.fsPath}`, - ]; - if (command) { - cmd.push(command); - } - this.outTerminal(cmd.join(' & ')); - return true; - } - async Run(src: SRCFILE, msgprocessor: MSGProcessor): Promise { - const msg = await this.runPlayer(this._conf).catch((e) => { throw new Error(e); }); - if (await msgprocessor(msg)) { - this.openEmu(src.folder, `${this._vscConf.getAction('run')}`); - return true;//'command sended to terminal' - } - return false; - } - async Debug(src: SRCFILE, msgprocessor: MSGProcessor): Promise { - const msg = await this.runPlayer(this._conf); - if (await msgprocessor(msg)) { - const act = this._vscConf.getAction('masm_debug'); - this.openEmu(src.folder, `${act}`); - return true; - } - return false; - } - - private outTerminal(command?: string): void { - const env: NodeJS.ProcessEnv = process.env; - const envPath = env.PATH + ';' + this._vscConf.getAction('path'); - if (MsdosPlayer.msdosTerminal?.exitStatus || MsdosPlayer.msdosTerminal === undefined) { - MsdosPlayer.msdosTerminal = window.createTerminal({ - env: { PATH: envPath }, - shellPath: "cmd.exe", - hideFromUser: false, - }); - } - if (MsdosPlayer.msdosTerminal) { - MsdosPlayer.msdosTerminal.show(true); - if (command) { - MsdosPlayer.msdosTerminal.sendText(command); - } - } - } - public runPlayer(conf: Config): Promise { - const command = this._vscConf.getAction(conf.MASMorTASM.toLowerCase() as 'masm' | 'tasm'); - return new Promise( - (resolve, reject) => { - const timeout = 3000; - const child = exec( - command, - { - cwd: conf.Uris.tools.fsPath, timeout - }, - (error, stdout, stderr) => { - if (stderr) { - console.warn(`stderr: ${stderr}`); - } - if (error) { - reject(error); - } - else if (stdout.length > 0) { - resolve(MsdosPlayer.getASMmessage(stdout)); - } - } - ); - child.on('exit', (code) => { - if (code === null) { - child.kill(); - window.showErrorMessage(`Run playerasm.bat timeout after ${timeout}ms\t\nCommand: ${command}`); - } - else if (code !== 0) { - const msg = `Use playerasm.bat Failed\t exitcode${code}\t\n command:${command}`; - window.showErrorMessage(msg); - } - }); - } - ); - } - static dispose(): void { - MsdosPlayer.msdosTerminal?.dispose(); - } -} \ No newline at end of file diff --git a/src/extension.ts b/src/extension.ts index ec06c99..c6d599f 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,15 +1,18 @@ import * as vscode from 'vscode'; -import { localize, loadI18n } from './i18n'; +import { localize, loadI18n } from './utils/i18n'; -import { provider } from './language/provider'; -import { AsmCommands } from './ASM/main'; +import * as lan from './language/main'; +import * as asm from './ASM/main'; export function activate(context: vscode.ExtensionContext): void { + loadI18n(context); + //provide programmaic language features like hover,references,outline(symbol) - provider(context); - //run and debug the code in dosbox or msdos-player by TASM ot MASM - AsmCommands(context); + lan.activate(context); + //provide run and debug features via DOS emulators + asm.activate(context); + console.log(localize("activate.hello", 'Congratulations, your extension "masm-tasm" is now active!')); } diff --git a/src/language/Hover.ts b/src/language/Hover.ts index 419f9bd..89a2f77 100644 --- a/src/language/Hover.ts +++ b/src/language/Hover.ts @@ -71,7 +71,7 @@ export class AsmHoverProvider implements vscode.HoverProvider { } const h = await this.getHover(wordGet, [keywordType.operator, keywordType.register, keywordType.symbol]); - if (h) { return h; }; + if (h) { return h; } } const asmsymbol = docinfo.findSymbol(wordGet); //the word is a symbol? @@ -80,7 +80,7 @@ export class AsmHoverProvider implements vscode.HoverProvider { } const h = await this.getHover(wordGet, [keywordType.other, keywordType.directive, keywordType.register]); - if (h) { return h; }; + if (h) { return h; } } return undefined; } diff --git a/src/language/provider.ts b/src/language/main.ts similarity index 96% rename from src/language/provider.ts rename to src/language/main.ts index 5b09e7e..d52bf0a 100644 --- a/src/language/provider.ts +++ b/src/language/main.ts @@ -22,12 +22,12 @@ class Asmsymbolprovider implements vscode.DocumentSymbolProvider { const sym = DocInfo.getDocInfo(document).tree; if (sym) { return sym; - }; + } return []; } } -export function provider(context: vscode.ExtensionContext): void { +export function activate(context: vscode.ExtensionContext): void { const programmaticFeatures = vscode.workspace.getConfiguration("masmtasm.language"); if (programmaticFeatures.get("Hover")) { context.subscriptions.push(vscode.languages.registerHoverProvider('assembly', new AsmHoverProvider(context))); diff --git a/src/language/wordinfo.ts b/src/language/wordinfo.ts index 0abebfb..134e496 100644 --- a/src/language/wordinfo.ts +++ b/src/language/wordinfo.ts @@ -1,4 +1,4 @@ -import { localize } from '../i18n'; +import { localize } from '../utils/i18n'; export function isNumberStr(str: string): boolean { const a = str.match(/([01]+[Bb]|[0-7]+[Qq]|[0-9][0-9A-Fa-f]*[Hh]|[0-9]+[Dd]?)/); diff --git a/src/readme.md b/src/readme.md index 3e565e1..3e5d4b0 100644 --- a/src/readme.md +++ b/src/readme.md @@ -1,4 +1,6 @@ -# source code +# Source Code Folder -- folder `ASM` is codes for action with assembler and emulator -- folder `language` is codes for Programmatic language features \ No newline at end of file +- folder `language`: provide Programmatic language features +- folder `utils`: chore like i18n +- folder `diagnose`: process the message of Assembler +- folder `ASM`: codes for action with assembler and emulator \ No newline at end of file diff --git a/src/test/runTest.ts b/src/test/runTest.ts index a4e42f9..38fef68 100644 --- a/src/test/runTest.ts +++ b/src/test/runTest.ts @@ -1,32 +1,46 @@ -import * as path from 'path'; +/** + * https://code.visualstudio.com/api/working-with-extensions/testing-extension#custom-setup-with-vscodetestelectron + */ -import { runTests } from 'vscode-test'; +import * as cp from 'child_process'; +import * as path from 'path'; +import { + downloadAndUnzipVSCode, + resolveCliPathFromVSCodeExecutablePath, + runTests +} from 'vscode-test'; -async function main(): Promise { +async function main() { try { - // The folder containing the Extension Manifest package.json - // Passed to `--extensionDevelopmentPath` - const extensionDevelopmentPath = path.resolve(__dirname, '../../'); - - // The path to test runner - // Passed to --extensionTestsPath + const extensionDevelopmentPath = path.resolve(__dirname, '../../../'); const extensionTestsPath = path.resolve(__dirname, './suite/index'); + const vscodeExecutablePath = await downloadAndUnzipVSCode('stable'); + const cliPath = resolveCliPathFromVSCodeExecutablePath(vscodeExecutablePath); + + // Use cp.spawn / cp.exec for custom setup + cp.spawnSync(cliPath, ['--install-extension', 'xsro.vscode-dosbox'], { + encoding: 'utf-8', + stdio: 'inherit' + }); const sampleFolder = path.resolve(__dirname, '../../samples'); - const launchArgs: string[] = [sampleFolder]; + const launchArgs: string[] = [ + "--disable-workspace-trust", + sampleFolder + ]; - const DELAY = (timeout: number): Promise => new Promise((resolve) => { setTimeout(resolve, timeout); }); - // Download VS Code, unzip it and run the integration test - await runTests({ extensionDevelopmentPath, extensionTestsPath, launchArgs }); - await DELAY(20000); - //test in version September 2020 (version 1.50) https://code.visualstudio.com/updates/v1_50 - await runTests({ version: '1.50.1', extensionDevelopmentPath, extensionTestsPath, launchArgs }); - await DELAY(20000); - await runTests({ version: '1.49.1', extensionDevelopmentPath, extensionTestsPath, launchArgs }); + // Run the extension test + await runTests({ + // Use the specified `code` executable + vscodeExecutablePath, + extensionDevelopmentPath, + extensionTestsPath, + launchArgs + }); } catch (err) { console.error('Failed to run tests'); process.exit(1); } } -main(); +main(); \ No newline at end of file diff --git a/src/test/suite/ASM.test.ts b/src/test/suite/ASM.test.ts new file mode 100644 index 0000000..0e5e5de --- /dev/null +++ b/src/test/suite/ASM.test.ts @@ -0,0 +1,90 @@ + +import * as assert from 'assert'; + +// You can import and use all API from the 'vscode' module +// as well as import your extension to test it +import * as vscode from 'vscode'; +import { AsmResult } from '../../ASM/main'; +import { DIAGCODE } from '../../diagnose/main'; +import { DosEmulatorType, Assembler } from '../../utils/configuration'; + +// import * as myExtension from '../../extension'; + +const samplesUri = vscode.Uri.joinPath(vscode.Uri.file(__dirname), '../../../samples/'); + +suite('Extension Test Suite', function () { + vscode.window.showInformationMessage('Start all tests.'); + const MASMorTASM = [ + Assembler['MASM-v5.00'], + Assembler['MASM-v6.11'], + Assembler.TASM, + ]; + const emulator: DosEmulatorType[] = [ + DosEmulatorType.dosbox, + DosEmulatorType.dosboxX, + DosEmulatorType.jsdos, + ]; + + const filelist: [string, number][] = [ + ['1.asm', 0], + ['3中文路径hasError.asm', 1], + // ['2.asm', DIAGCODE.ok], + ]; + + const args: [string, DIAGCODE, DosEmulatorType, Assembler][] = []; + for (const file of filelist) { + for (const emu of emulator) { + for (const asm of MASMorTASM) { + args.push([file[0], file[1], emu, asm]); + } + } + } + + this.beforeEach(async function () { + await vscode.commands.executeCommand('workbench.action.closeAllEditors'); + }); + + shuffle(args).forEach((val) => { testAsmCode(...val); }); +}); + +function testAsmCode(file: string, shouldErr: number, emu: DosEmulatorType, asm: Assembler): void { + test(`test file ${file} in ${emu} use ${asm} want should ${shouldErr} error`, + async function () { + this.timeout('60s'); + this.slow('20s'); + //skip azure pipeline test for this condition + if (file === '3中文路径hasError.asm' && emu === DosEmulatorType.msdos && asm === Assembler.MASM && !process.env.LANG?.includes('zh_CN')) { + this.skip(); + } + + //open test file. NOTE: the extension will be activated when open .asm file + const samplefile = vscode.Uri.joinPath(samplesUri, file); + + //update settings + await vscode.workspace.getConfiguration('masmtasm').update("dosbox.run", "exit"); + await vscode.workspace.getConfiguration('masmtasm').update("ASM.emulator", emu); + await vscode.workspace.getConfiguration('masmtasm').update("ASM.assembler", asm); + + //assert the extension activated and command contributed + const vscodecmds = await vscode.commands.getCommands(true); + const cmd = 'masm-tasm.runASM'; + if (!vscodecmds.includes(cmd)) { + await vscode.extensions.getExtension('xsro.masm-tasm')?.activate(); + } + const vscodecmds2 = await vscode.commands.getCommands(true); + assert.ok(vscodecmds2.includes(cmd)); + + //assert message processed + const _result = await vscode.commands.executeCommand(cmd, samplefile); + const { message, error } = _result as AsmResult; + assert.strictEqual(error, shouldErr, message); + }); +} + +function shuffle(arr: T[]): T[] { + for (let i = 1; i < arr.length; i++) { + const random = Math.floor(Math.random() * (i + 1)); + [arr[i], arr[random]] = [arr[random], arr[i]]; + } + return arr; +} \ No newline at end of file diff --git a/src/test/suite/diagnose.test.ts b/src/test/suite/diagnose.test.ts new file mode 100644 index 0000000..843ae1a --- /dev/null +++ b/src/test/suite/diagnose.test.ts @@ -0,0 +1,29 @@ +import * as assert from 'assert'; + +// You can import and use all API from the 'vscode' module +// as well as import your extension to test it +import * as vscode from 'vscode'; + +// import * as myExtension from '../../extension'; + +suite('Diagnose test', function () { + + + test('TASM Error message', function () { + this.skip(); + const message = 'Turbo Assembler Version 4.1 Copyright (c) 1988, 1996 Borland International\r\n' + + '\r\n' + + 'Assembling file: test.asm\r\n' + + '**Error** test.asm(14) Illegal instruction\r\n' + + 'Error messages: 1\r\n' + + 'Warning messages: None\r\n' + + 'Passes: 1\r\n' + + 'Remaining memory: 468k\r\n' + + '\r\n' + + 'Turbo Link Version 7.1.30.1. Copyright (c) 1987, 1996 Borland International\r\n' + + "Fatal: Unable to open file 'test.obj'\r\n" + + 'Illegal command: test.\r\n'; + + }); +}); + diff --git a/src/test/suite/extension.test.ts b/src/test/suite/extension.test.ts index b7df6f7..fceca96 100644 --- a/src/test/suite/extension.test.ts +++ b/src/test/suite/extension.test.ts @@ -1,91 +1,15 @@ - import * as assert from 'assert'; -import { execSync } from 'child_process'; // You can import and use all API from the 'vscode' module // as well as import your extension to test it import * as vscode from 'vscode'; -import { DIAGCODE } from '../../ASM/diagnose/diagnose'; -import { DOSEMU, ASMTYPE } from '../../ASM/configration'; -import { RUNCODEINFO } from '../../ASM/runcode'; // import * as myExtension from '../../extension'; -suite('Extension Test Suite', function () { - vscode.window.showInformationMessage('Start all tests.'); - const MASMorTASM = [ - ASMTYPE.MASM, - ASMTYPE.TASM, - ]; - const emulator: DOSEMU[] = [ - DOSEMU.jsdos - ]; - if (process.platform === 'win32') { - emulator.push( - DOSEMU.dosbox, - DOSEMU.msdos, - DOSEMU.auto - ); - } else { - try { - const msg = execSync('dosbox -version', { encoding: 'utf8' }); - if (msg.includes('version')) { - emulator.push(DOSEMU.dosbox); - } - } - catch (e) { - console.warn('disable dosbox test for no dosbox installed'); - } - } - const filelist: [string, DIAGCODE][] = [ - ['1.asm', DIAGCODE.ok], - ['2.asm', DIAGCODE.ok], - ['3中文路径hasError.asm', DIAGCODE.hasError] - ]; - function shuffle(arr: T[]): T[] { - for (let i = 1; i < arr.length; i++) { - const random = Math.floor(Math.random() * (i + 1)); - [arr[i], arr[random]] = [arr[random], arr[i]]; - } - return arr; - } - const args: [string, DIAGCODE, DOSEMU, ASMTYPE][] = []; - for (const file of filelist) { - for (const emu of emulator) { - for (const asm of MASMorTASM) { - args.push([file[0], file[1], emu, asm]); - } - } - } - shuffle(args).forEach((val) => { testAsmCode(...val); }); -}); - -function testAsmCode(file: string, diagcode: DIAGCODE, emu: DOSEMU, asm: ASMTYPE): void { - test(`test file ${file} in ${emu} use ${asm} want ${DIAGCODE[diagcode]} ${diagcode}`, - async function () { - this.timeout('120s'); - this.slow('10s'); - //skip azure pipeline test for this condition - if (file === '3中文路径hasError.asm' && emu === DOSEMU.msdos && asm === ASMTYPE.MASM && !process.env.LANG?.includes('zh_CN')) { - this.skip(); - } - - //open test file. NOTE: the extension will be activated when open .asm file - const samplefile = vscode.Uri.joinPath(vscode.Uri.file(__dirname), '../../../samples/' + file); - await vscode.commands.executeCommand('vscode.open', samplefile); - - //update settings - await vscode.workspace.getConfiguration('masmtasm').update("dosbox.run", "exit"); - await vscode.workspace.getConfiguration('masmtasm').update("ASM.emulator", emu); - await vscode.workspace.getConfiguration('masmtasm').update("ASM.MASMorTASM", asm); - - //assert the extension activated and command contributed - const vscodecmds = await vscode.commands.getCommands(true); - const cmd = 'masm-tasm.runASM'; - assert.ok(vscodecmds.includes(cmd)); - - //assert message processed - const result = (await vscode.commands.executeCommand(cmd) as RUNCODEINFO); - assert.strictEqual(DIAGCODE[result.diagCode], DIAGCODE[diagcode], JSON.stringify(result, null, 4)); - }); -} +suite('Extension Test Suite', () => { + vscode.window.showInformationMessage('Start all tests.'); + test('Sample test', () => { + assert.equal(-1, [1, 2, 3].indexOf(5)); + assert.equal(-1, [1, 2, 3].indexOf(0)); + }); +}); \ No newline at end of file diff --git a/src/test/suite/index.ts b/src/test/suite/index.ts index b379175..d5f49ae 100644 --- a/src/test/suite/index.ts +++ b/src/test/suite/index.ts @@ -1,6 +1,7 @@ import * as path from 'path'; import * as Mocha from 'mocha'; import * as glob from 'glob'; +import * as vscode from 'vscode'; export function run(): Promise { // Create the mocha test @@ -10,6 +11,14 @@ export function run(): Promise { timeout: 20000 }); + if (process.platform === 'linux') { + vscode.workspace.getConfiguration('vscode-dosbox').update( + "command.dosboxX", + "flatpak run com.dosbox_x.DOSBox-X -silent -nogui", + vscode.ConfigurationTarget.Global + ); + } + const testsRoot = path.resolve(__dirname, '..'); return new Promise((c, e) => { diff --git a/src/test/suite/msdos.test.ts b/src/test/suite/msdos.test.ts new file mode 100644 index 0000000..cd78f55 --- /dev/null +++ b/src/test/suite/msdos.test.ts @@ -0,0 +1,48 @@ +import * as assert from 'assert'; + +// You can import and use all API from the 'vscode' module +// as well as import your extension to test it +import * as vscode from 'vscode'; +import { AsmResult } from '../../ASM/main'; +import { DosEmulatorType, Assembler } from '../../utils/configuration'; +// import * as myExtension from '../../extension'; + +const samplesUri = vscode.Uri.joinPath(vscode.Uri.file(__dirname), '../../../samples/'); + +suite('Extension Test Suite', () => { + const file = '3中文路径hasError.asm'; + const emu = DosEmulatorType.msdos; + const asm = Assembler['MASM-v5.00']; + const shouldErr = 1; + + test(`test file ${file} in ${emu} use ${asm} want should ${shouldErr} error`, + async function () { + if (process.platform !== 'win32') { + this.skip(); + } + this.timeout('60s'); + this.slow('20s'); + + //open test file. NOTE: the extension will be activated when open .asm file + const samplefile = vscode.Uri.joinPath(samplesUri, file); + + //update settings + await vscode.workspace.getConfiguration('masmtasm').update("dosbox.run", "exit"); + await vscode.workspace.getConfiguration('masmtasm').update("ASM.emulator", emu); + await vscode.workspace.getConfiguration('masmtasm').update("ASM.assembler", asm); + + //assert the extension activated and command contributed + const vscodecmds = await vscode.commands.getCommands(true); + const cmd = 'masm-tasm.runASM'; + if (!vscodecmds.includes(cmd)) { + await vscode.extensions.getExtension('xsro.masm-tasm')?.activate(); + } + const vscodecmds2 = await vscode.commands.getCommands(true); + assert.ok(vscodecmds2.includes(cmd)); + + //assert message processed + const _result = await vscode.commands.executeCommand(cmd, samplefile); + const { message, error } = _result as AsmResult; + assert.strictEqual(error, shouldErr, message); + }); +}); \ No newline at end of file diff --git a/src/tsconfig.json b/src/tsconfig.json index 7932e4f..cb08436 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -1,23 +1,23 @@ { - "include": [ - "**/*.ts" - ], - "compilerOptions": { - "module": "commonjs", - "target": "es2017", - "outDir": "../dist", - "sourceMap": true, - "rootDir": ".", - "removeComments": true, - "resolveJsonModule": true, - "strict": true, /* enable all strict type-checking options */ - /* Additional Checks */ - //"noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - }, - "exclude": [ - "node_modules", - ".vscode-test" - ] + "include": [ + "**/*.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es2017", + "outDir": "../dist", + "sourceMap": true, + "rootDir": ".", + "removeComments": true, + "resolveJsonModule": true, + "strict": true /* enable all strict type-checking options */, + /* Additional Checks */ + //"noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + }, + "exclude": [ + "node_modules", + ".vscode-test" + ] } \ No newline at end of file diff --git a/src/utils/configuration.ts b/src/utils/configuration.ts new file mode 100644 index 0000000..4b32152 --- /dev/null +++ b/src/utils/configuration.ts @@ -0,0 +1,41 @@ +/**use MASM or TASM + * - MASM: including masm.exe,link.exe,debug.exe + * - TASM: including tasm.exe,tlink.exe,TD.exe + */ +export enum Assembler { + 'MASM-v6.11' = 'MASM-v6.11', + 'MASM-v5.00' = 'MASM-v5.00', + MASM = 'MASM', + TASM = 'TASM' +} + +/**the emulator for the 16bit DOS environment + * - `dosbox` is the most famous one + * - `msdos`( player) is designed for running in windows cmd + * - `jsdos` is designed for runing in browser + * - `auto` is a mode to partly solve the problem of TD's hardly running in msdos + */ +export enum DosEmulatorType { + dosbox = 'dosbox', + dosboxX = 'dosbox-x', + msdos = 'msdos player', + jsdos = 'jsdos', +} + +import * as vscode from 'vscode'; + +class ExtensionConfiguration { + public get asmType(): Assembler { + const asmType: Assembler | undefined = vscode.workspace.getConfiguration('masmtasm').get('ASM.assembler'); + if (asmType === 'MASM') { + return Assembler['MASM-v6.11']; + } + return asmType ? asmType : Assembler.TASM; + } + public get emulator(): DosEmulatorType { + const emu: DosEmulatorType | undefined = vscode.workspace.getConfiguration('masmtasm').get('ASM.emulator'); + return emu ? emu : DosEmulatorType.jsdos; + } +} + +export const extConf = new ExtensionConfiguration(); \ No newline at end of file diff --git a/src/i18n.ts b/src/utils/i18n.ts similarity index 100% rename from src/i18n.ts rename to src/utils/i18n.ts diff --git a/src/utils/logger.ts b/src/utils/logger.ts new file mode 100644 index 0000000..e670fb1 --- /dev/null +++ b/src/utils/logger.ts @@ -0,0 +1,14 @@ +import * as vscode from 'vscode'; + +class Logger { + outputChannel: vscode.OutputChannel = vscode.window.createOutputChannel('masm-tasm'); + log = console.log; + warn = console.warn; + error = console.error; + channel(value: string) { + this.outputChannel.append(value); + return this.outputChannel; + } +} + +export const logger = new Logger(); \ No newline at end of file diff --git a/tools/.gitignore b/tools/.gitignore deleted file mode 100644 index a17a421..0000000 --- a/tools/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -# dosbox console files generated by `dosbox -noconsole` -/dosbox/stdout.txt -/dosbox/stderr.txt -ASM.LOG -LINK.LOG -msdos.log -/js-dos/extJs-dos.js \ No newline at end of file diff --git a/tools/README.md b/tools/README.md deleted file mode 100644 index dbeaa3f..0000000 --- a/tools/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Built-in tools - -built-in tools which will be packaged in extension - -* masm - * masm.exe: 6.11 - * link.exe: 5.31.009 - * debug.exe -* tasm - * tasm.exe: 4.1 - * tlink.exe: 7.1.30.1 - * TD.exe -* dosbox: 0.74-3 -* JSDOS: npm js-dos@6.22.59 -* player: 4/10/2020 - * MS-DOS Player (i486) for Win32 console diff --git a/tools/dosbox/DOSBox.exe b/tools/dosbox/DOSBox.exe deleted file mode 100644 index 59adb23..0000000 Binary files a/tools/dosbox/DOSBox.exe and /dev/null differ diff --git a/tools/dosbox/SDL.dll b/tools/dosbox/SDL.dll deleted file mode 100644 index 37d3151..0000000 Binary files a/tools/dosbox/SDL.dll and /dev/null differ diff --git a/tools/dosbox/SDL_net.dll b/tools/dosbox/SDL_net.dll deleted file mode 100644 index 924e654..0000000 Binary files a/tools/dosbox/SDL_net.dll and /dev/null differ diff --git a/tools/dosbox/dosbox-0.74.conf b/tools/dosbox/dosbox-0.74.conf deleted file mode 100644 index 9256b26..0000000 --- a/tools/dosbox/dosbox-0.74.conf +++ /dev/null @@ -1,243 +0,0 @@ -# This is the configurationfile for DOSBox 0.74. (Please use the latest version of DOSBox) -# Lines starting with a # are commentlines and are ignored by DOSBox. -# They are used to (briefly) document the effect of each option. - -[sdl] -# fullscreen: Start dosbox directly in fullscreen. (Press ALT-Enter to go back) -# fulldouble: Use double buffering in fullscreen. It can reduce screen flickering, but it can also result in a slow DOSBox. -# fullresolution: What resolution to use for fullscreen: original or fixed size (e.g. 1024x768). -# Using your monitor's native resolution with aspect=true might give the best results. -# If you end up with small window on a large screen, try an output different from surface. -# windowresolution: Scale the window to this size IF the output device supports hardware scaling. -# (output=surface does not!) -# output: What video system to use for output. -# Possible values: surface, overlay, opengl, openglnb, ddraw. -# autolock: Mouse will automatically lock, if you click on the screen. (Press CTRL-F10 to unlock) -# sensitivity: Mouse sensitivity. -# waitonerror: Wait before closing the console if dosbox has an error. -# priority: Priority levels for dosbox. Second entry behind the comma is for when dosbox is not focused/minimized. -# pause is only valid for the second entry. -# Possible values: lowest, lower, normal, higher, highest, pause. -# mapperfile: File used to load/save the key/event mappings from. Resetmapper only works with the defaul value. -# usescancodes: Avoid usage of symkeys, might not work on all operating systems. - -fullscreen=false -fulldouble=false -fullresolution=original -windowresolution=original -output=surface -autolock=true -sensitivity=100 -waitonerror=true -priority=higher,normal -mapperfile=mapper-0.74.map -usescancodes=true - -[dosbox] -# language: Select another language file. -# machine: The type of machine tries to emulate. -# Possible values: hercules, cga, tandy, pcjr, ega, vgaonly, svga_s3, svga_et3000, svga_et4000, svga_paradise, vesa_nolfb, vesa_oldvbe. -# captures: Directory where things like wave, midi, screenshot get captured. -# memsize: Amount of memory DOSBox has in megabytes. -# This value is best left at its default to avoid problems with some games, -# though few games might require a higher value. -# There is generally no speed advantage when raising this value. - -language= -machine=svga_s3 -captures=capture -memsize=16 - -[render] -# frameskip: How many frames DOSBox skips before drawing one. -# aspect: Do aspect correction, if your output method doesn't support scaling this can slow things down!. -# scaler: Scaler used to enlarge/enhance low resolution modes. -# If 'forced' is appended, then the scaler will be used even if the result might not be desired. -# Possible values: none, normal2x, normal3x, advmame2x, advmame3x, advinterp2x, advinterp3x, hq2x, hq3x, 2xsai, super2xsai, supereagle, tv2x, tv3x, rgb2x, rgb3x, scan2x, scan3x. - -frameskip=0 -aspect=false -scaler=normal2x - -[cpu] -# core: CPU Core used in emulation. auto will switch to dynamic if available and appropriate. -# Possible values: auto, dynamic, normal, simple. -# cputype: CPU Type used in emulation. auto is the fastest choice. -# Possible values: auto, 386, 386_slow, 486_slow, pentium_slow, 386_prefetch. -# cycles: Amount of instructions DOSBox tries to emulate each millisecond. -# Setting this value too high results in sound dropouts and lags. -# Cycles can be set in 3 ways: -# 'auto' tries to guess what a game needs. -# It usually works, but can fail for certain games. -# 'fixed #number' will set a fixed amount of cycles. This is what you usually need if 'auto' fails. -# (Example: fixed 4000). -# 'max' will allocate as much cycles as your computer is able to handle. -# -# Possible values: auto, fixed, max. -# cycleup: Amount of cycles to decrease/increase with keycombo.(CTRL-F11/CTRL-F12) -# cycledown: Setting it lower than 100 will be a percentage. - -core=auto -cputype=auto -cycles=auto -cycleup=10 -cycledown=20 - -[mixer] -# nosound: Enable silent mode, sound is still emulated though. -# rate: Mixer sample rate, setting any device's rate higher than this will probably lower their sound quality. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# blocksize: Mixer block size, larger blocks might help sound stuttering but sound will also be more lagged. -# Possible values: 1024, 2048, 4096, 8192, 512, 256. -# prebuffer: How many milliseconds of data to keep on top of the blocksize. - -nosound=false -rate=44100 -blocksize=1024 -prebuffer=20 - -[midi] -# mpu401: Type of MPU-401 to emulate. -# Possible values: intelligent, uart, none. -# mididevice: Device that will receive the MIDI data from MPU-401. -# Possible values: default, win32, alsa, oss, coreaudio, coremidi, none. -# midiconfig: Special configuration options for the device driver. This is usually the id of the device you want to use. -# See the README/Manual for more details. - -mpu401=intelligent -mididevice=default -midiconfig= - -[sblaster] -# sbtype: Type of Soundblaster to emulate. gb is Gameblaster. -# Possible values: sb1, sb2, sbpro1, sbpro2, sb16, gb, none. -# sbbase: The IO address of the soundblaster. -# Possible values: 220, 240, 260, 280, 2a0, 2c0, 2e0, 300. -# irq: The IRQ number of the soundblaster. -# Possible values: 7, 5, 3, 9, 10, 11, 12. -# dma: The DMA number of the soundblaster. -# Possible values: 1, 5, 0, 3, 6, 7. -# hdma: The High DMA number of the soundblaster. -# Possible values: 1, 5, 0, 3, 6, 7. -# sbmixer: Allow the soundblaster mixer to modify the DOSBox mixer. -# oplmode: Type of OPL emulation. On 'auto' the mode is determined by sblaster type. All OPL modes are Adlib-compatible, except for 'cms'. -# Possible values: auto, cms, opl2, dualopl2, opl3, none. -# oplemu: Provider for the OPL emulation. compat might provide better quality (see oplrate as well). -# Possible values: default, compat, fast. -# oplrate: Sample rate of OPL music emulation. Use 49716 for highest quality (set the mixer rate accordingly). -# Possible values: 44100, 49716, 48000, 32000, 22050, 16000, 11025, 8000. - -sbtype=sb16 -sbbase=220 -irq=7 -dma=1 -hdma=5 -sbmixer=true -oplmode=auto -oplemu=default -oplrate=44100 - -[gus] -# gus: Enable the Gravis Ultrasound emulation. -# gusrate: Sample rate of Ultrasound emulation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# gusbase: The IO base address of the Gravis Ultrasound. -# Possible values: 240, 220, 260, 280, 2a0, 2c0, 2e0, 300. -# gusirq: The IRQ number of the Gravis Ultrasound. -# Possible values: 5, 3, 7, 9, 10, 11, 12. -# gusdma: The DMA channel of the Gravis Ultrasound. -# Possible values: 3, 0, 1, 5, 6, 7. -# ultradir: Path to Ultrasound directory. In this directory -# there should be a MIDI directory that contains -# the patch files for GUS playback. Patch sets used -# with Timidity should work fine. - -gus=false -gusrate=44100 -gusbase=240 -gusirq=5 -gusdma=3 -ultradir=C:\ULTRASND - -[speaker] -# pcspeaker: Enable PC-Speaker emulation. -# pcrate: Sample rate of the PC-Speaker sound generation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# tandy: Enable Tandy Sound System emulation. For 'auto', emulation is present only if machine is set to 'tandy'. -# Possible values: auto, on, off. -# tandyrate: Sample rate of the Tandy 3-Voice generation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# disney: Enable Disney Sound Source emulation. (Covox Voice Master and Speech Thing compatible). - -pcspeaker=true -pcrate=44100 -tandy=auto -tandyrate=44100 -disney=true - -[joystick] -# joysticktype: Type of joystick to emulate: auto (default), none, -# 2axis (supports two joysticks), -# 4axis (supports one joystick, first joystick used), -# 4axis_2 (supports one joystick, second joystick used), -# fcs (Thrustmaster), ch (CH Flightstick). -# none disables joystick emulation. -# auto chooses emulation depending on real joystick(s). -# (Remember to reset dosbox's mapperfile if you saved it earlier) -# Possible values: auto, 2axis, 4axis, 4axis_2, fcs, ch, none. -# timed: enable timed intervals for axis. Experiment with this option, if your joystick drifts (away). -# autofire: continuously fires as long as you keep the button pressed. -# swap34: swap the 3rd and the 4th axis. can be useful for certain joysticks. -# buttonwrap: enable button wrapping at the number of emulated buttons. - -joysticktype=auto -timed=true -autofire=false -swap34=false -buttonwrap=false - -[serial] -# serial1: set type of device connected to com port. -# Can be disabled, dummy, modem, nullmodem, directserial. -# Additional parameters must be in the same line in the form of -# parameter:value. Parameter for all types is irq (optional). -# for directserial: realport (required), rxdelay (optional). -# (realport:COM1 realport:ttyS0). -# for modem: listenport (optional). -# for nullmodem: server, rxdelay, txdelay, telnet, usedtr, -# transparent, port, inhsocket (all optional). -# Example: serial1=modem listenport:5000 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial2: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial3: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial4: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. - -serial1=dummy -serial2=dummy -serial3=disabled -serial4=disabled - -[dos] -# xms: Enable XMS support. -# ems: Enable EMS support. -# umb: Enable UMB support. -# keyboardlayout: Language code of the keyboard layout (or none). - -xms=true -ems=true -umb=true -keyboardlayout=auto - -[ipx] -# ipx: Enable ipx over UDP/IP emulation. - -ipx=false - -[autoexec] -# Lines in this section will be run at startup. -# You can put your MOUNT lines here. - - diff --git a/tools/masm/DOSXNT.EXE b/tools/masm/DOSXNT.EXE deleted file mode 100644 index 24edd9e..0000000 Binary files a/tools/masm/DOSXNT.EXE and /dev/null differ diff --git a/tools/masm/LINK.EXE b/tools/masm/LINK.EXE deleted file mode 100644 index 420b29d..0000000 Binary files a/tools/masm/LINK.EXE and /dev/null differ diff --git a/tools/masm/MASM.EXE b/tools/masm/MASM.EXE deleted file mode 100644 index c487faf..0000000 Binary files a/tools/masm/MASM.EXE and /dev/null differ diff --git a/tools/masm/ML.ERR b/tools/masm/ML.ERR deleted file mode 100644 index d3937bf..0000000 --- a/tools/masm/ML.ERR +++ /dev/null @@ -1,272 +0,0 @@ -FATAL -cannot open file -I/O error closing file -I/O error writing file -I/O error reading file -out of memory -assembler limit : macro parameter name table full -invalid command-line option -nesting level too deep -unmatched macro nesting -line too long -unmatched block nesting -directive must be in control block -error count exceeds 100; stopping assembly -invalid numerical command-line argument -too many arguments -statement too complex -N/A -missing source filename -COFF error writing file -invalid debug and browser data; file exceeds line limit -cannot find link.exe -cannot find cvpack.exe -SEVERE -memory operand not allowed in context -immediate operand not allowed -cannot have more than one ELSE clause per IF block -extra characters after statement -symbol type conflict -symbol redefinition -undefined symbol -non-benign record redefinition -syntax error -syntax error in expression -invalid type expression -distance invalid for word size of current segment -PROC, MACRO, or macro repeat directive must precede LOCAL -.MODEL must precede this directive -cannot define as public or external -segment attributes cannot change -expression expected -operator expected -invalid use of external symbol -operand must be RECORD type or field -identifier not a record -record constants may not span line breaks -instruction operands must be the same size -instruction operand must have size -invalid operand size for instruction -operands must be in same segment -constant expected -operand must be a memory expression -expression must be a code address -multiple base registers not allowed -multiple index registers not allowed -must be index or base register -invalid use of register -invalid INVOKE argument -must be in segment block -DUP too complex -too many initial values for structure -statement not allowed inside structure definition -missing operand for macro operator -line too long -segment register not allowed in context -string or text literal too long -statement too complex -identifier too long -invalid character in file -missing angle bracket or brace in literal -missing single or double quotation mark in string -empty (null) string -nondigit in number -syntax error in floating-point constant -real or BCD number not allowed -text item required -forced error -forced error : value equal to 0 -forced error : value not equal to 0 -forced error : symbol not defined -forced error : symbol defined -forced error : string blank -forced error : string not blank -forced error : strings equal -forced error : strings not equal -[ELSE]IF2/.ERR2 not allowed : single-pass assembler -expression too complex for .UNTILCXZ -can ALIGN only to power of 2 -structure alignment must be 1, 2, or 4 -expected -incompatible CPU mode and segment size -LOCK must be followed by a memory operation -instruction prefix not allowed -no operands allowed for this instruction -invalid instruction operands -initializer magnitude too large for specified size -cannot access symbol in given segment or group -operands have different frames -cannot access label through segment registers -jump destination too far -jump destination must specify a label -instruction does not allow NEAR indirect addressing -instruction does not allow FAR indirect addressing -instruction does not allow FAR direct addressing -jump distance not possible in current CPU mode -missing operand after unary operator -cannot mix 16- and 32-bit registers -invalid scale value -constant value too large -instruction or register not accepted in current CPU mode -reserved word expected -instruction form requires 80386/486 -END directive required at end of file -too many bits in RECORD -positive value expected -index value past end of string -count must be positive or zero -count value too large -operand must be relocatable -constant or relocatable label expected -segment, group, or segment register expected -segment expected -invalid operand for OFFSET -invalid use of external absolute -segment or group not allowed -cannot add two relocatable labels -cannot add memory expression and code label -segment exceeds 64K limit -invalid type for a data declaration -HIGH and LOW require immediate operands -N/A -cannot have implicit far jump or call to near label -use of register assumed to ERROR -only white space or comment can follow backslash -COMMENT delimiter expected -conflicting parameter definition -PROC and prototype calling conventions conflict -invalid radix tag -INVOKE argument type mismatch : argument -invalid coprocessor register -instructions and initialized data not allowed in AT segments -/AT switch requires the TINY memory model -cannot have segment address references with TINY model -language type must be specified -PROLOGUE must be macro function -EPILOGUE must be macro procedure -alternate identifier not allowed with EXTERNDEF -text macro nesting level too deep -N/A -missing macro argument -EXITM used inconsistently -macro function argument list too long -N/A -VARARG parameter must be last parameter -VARARG parameter not allowed with LOCAL -VARARG parameter requires C calling convention -ORG needs a constant or local offset -register value overwritten by INVOKE -structure too large to pass with INVOKE : argument -not overriding private proc as public -too many arguments to INVOKE -too few arguments to INVOKE -invalid data initializer -N/A -RET operand too large -too many operands to instruction -cannot have more than one .ELSE clause per .IF block -expected data label -cannot nest procedures -EXPORT must be FAR -procedure declared with two visibility attributes -macro label not defined -invalid symbol type in expression -byte register cannot be first operand -word register cannot be first operand -special register cannot be first operand -coprocessor register cannot be first operand -cannot change size of expression computations -syntax error in control-flow directive -cannot use 16-bit register with a 32-bit address -constant value out of range -missing right parenthesis -type is wrong size for register -structure cannot be instanced -non-benign structure redefinition: label incorrect -non-benign structure redefinition: too few labels -OLDSTRUCTS/NOOLDSTRUCTS state cannot be changed -non-benign structure redefinition: incorrect initializers -non-benign structure redefinition: too few initializers -non-benign structure redefinition: label has incorrect offset -structure field expected -unexpected literal found in expression -N/A -divide by zero in expression -directive must appear inside a macro -cannot expand macro function -too few bits in RECORD -macro function cannot redefine itself -N/A -invalid qualified type -floating-point initializer on an integer variable -nested structure improperly initialized -invalid use of FLAT -structure improperly initialized -improper list initialization -initializer must be a string or single item -initializer must be a single item -initializer must be a single byte -improper use of list initializer -improper literal initialization -extra characters in literal initialization -must use floating-point initializer -cannot use .EXIT for OS_OS2 with .8086 -invalid combination with segment alignment -INVOKE requires prototype for procedure -cannot include structure in self -symbol language attribute conflict -non-benign COMM redefinition -COMM variable exceeds 64K -parameter or local cannot have void type -cannot use TINY model with OS_OS2 -expression size must be 32 bits -.EXIT does not work with 32-bit segments -.STARTUP does not work with 32-bit segments -ORG directive not allowed in unions -D/T -illegal use of segment register -cannot declare scoped code label as PUBLIC -.MSFLOAT directive is obsolete : .MSFLOAT ignored -ESC instruction is obsolete : ESC ignored -missing operator in expression -missing right parenthesis in expression -missing left parenthesis in expression -reference to forward macro definition -16 bit segments not allowed with /coff option -FAR not allowed in flat model comm variables -invalid .model parameter for flat model -.ALIAS directive not supported with /coff option -LEVEL 1 -cannot modify READONLY segment -N/A -non-unique STRUCT/UNION field used without qualification -start address on END directive ignored with .STARTUP -cannot ASSUME CS -unknown default prologue argument -too many arguments in macro call -option untranslated, directive required -invalid command-line option value, default is used -insufficent memory for /EP : /EP ignored -expected '>' on text literal -multiple .MODEL directives found : .MODEL ignored -line number information for segment without class 'CODE' -instructions and initialized data not supported in AT segments -directive ignored with /coff switch -/Gc switch incompatible with flat model -/AT switch incompatible with flat model -invalid command-line option -LEVEL 2 -@@: label defined but not referenced -expression expected, assume value 0 -EXTERNDEF previously assumed to be external -length of symbol previously assumed to be different -symbol previously assumed to not be in a group -types are different -calling convention not supported in flat model -LEVEL 3 -N/A -no return from procedure -N/A -conditional jump lengthened -procedure argument or local not referenced -expression may be pass-dependent diff --git a/tools/masm/ML.EXE b/tools/masm/ML.EXE deleted file mode 100644 index 4657408..0000000 Binary files a/tools/masm/ML.EXE and /dev/null differ diff --git a/tools/masm/debug.exe b/tools/masm/debug.exe deleted file mode 100644 index 267a5b3..0000000 Binary files a/tools/masm/debug.exe and /dev/null differ diff --git a/tools/player/command.com b/tools/player/command.com deleted file mode 100644 index 3673f50..0000000 Binary files a/tools/player/command.com and /dev/null differ diff --git a/tools/player/msdos.exe b/tools/player/msdos.exe deleted file mode 100644 index 28d6d4b..0000000 Binary files a/tools/player/msdos.exe and /dev/null differ diff --git a/tools/player/playerasm.bat b/tools/player/playerasm.bat deleted file mode 100644 index 1d541d0..0000000 --- a/tools/player/playerasm.bat +++ /dev/null @@ -1,54 +0,0 @@ -::this batch file is used to assemble and link ASM code by xsro.masm-tasm -@REM echo %0 %1 %2 %3 -set "cdo=%CD%" -::%1 toolspath -set TOOLS=%1 -::%2 masmortasm -::%3 the source code file's path -set filename=%~n3 - -::switch to the source code file's folder -cd %~dp3 -%~d3 -mkdir C:\.dosasm\ -echo this folder is used by vscode extension xsro.masm-tasm to generate codes >C:\.dosasm\readme.txt -echo feel free to delete this folder for it will be create when you use the extension to run or debug your code via msdos >>C:\.dosasm\readme.txt - -set path=%~f1\player\ -if "%2" == "MASM" goto masm -if "%2" == "TASM" goto tasm -if "%2" == "run" goto RUN -if "%2" == "debug" goto DEBUG -goto end - -:masm - mkdir c:\.dosasm\masm\ >%TOOLS%\msdos.log - copy "%~f1\masm\*.*" c:\.dosasm\masm\ >%TOOLS%\msdos.log - set path=%PATH%;c:\.dosasm\masm\; >%TOOLS%\msdos.log - masm %filename%; >%TOOLS%\ASM.LOG - if not exist %filename%.obj goto end >%TOOLS%\msdos.log - msdos link %filename%; >%TOOLS%\LINK.LOG - goto end -:tasm - mkdir c:\.dosasm\tasm\ >%TOOLS%\msdos.log - copy "%~f1\tasm\*.*" c:\.dosasm\tasm\ >%TOOLS%\msdos.log - set path=%PATH%;c:\.dosasm\tasm\; >%TOOLS%\msdos.log - msdos -e tasm /zi %filename% >%TOOLS%\ASM.LOG - if not exist %filename%.obj goto end >%TOOLS%\msdos.log - msdos -e tlink /v/3 %filename% >%TOOLS%\LINK.LOG -:RUN - -goto end -:DEBUG - -goto end -:end -::print message use this form to help extension to process -::currently only process ASM message -@echo ===ASM message=== -@type %TOOLS%\ASM.LOG -@echo ===ASM END=== - -@echo ===LINK message=== -@type %TOOLS%\LINK.LOG -@echo ===LINK END=== \ No newline at end of file diff --git a/tools/tasm/DPMI16BI.OVL b/tools/tasm/DPMI16BI.OVL deleted file mode 100644 index 9ae4846..0000000 Binary files a/tools/tasm/DPMI16BI.OVL and /dev/null differ diff --git a/tools/tasm/RTM.EXE b/tools/tasm/RTM.EXE deleted file mode 100644 index c60688a..0000000 Binary files a/tools/tasm/RTM.EXE and /dev/null differ diff --git a/tools/tasm/TASM.EXE b/tools/tasm/TASM.EXE deleted file mode 100644 index 7f7e973..0000000 Binary files a/tools/tasm/TASM.EXE and /dev/null differ diff --git a/tools/tasm/TD.EXE b/tools/tasm/TD.EXE deleted file mode 100644 index 2c95263..0000000 Binary files a/tools/tasm/TD.EXE and /dev/null differ diff --git a/tools/tasm/TDC2.TD b/tools/tasm/TDC2.TD deleted file mode 100644 index 3f7a135..0000000 Binary files a/tools/tasm/TDC2.TD and /dev/null differ diff --git a/tools/tasm/TDHELP.TDH b/tools/tasm/TDHELP.TDH deleted file mode 100644 index 92d4241..0000000 Binary files a/tools/tasm/TDHELP.TDH and /dev/null differ diff --git a/tools/tasm/TLINK.EXE b/tools/tasm/TLINK.EXE deleted file mode 100644 index d65c9c2..0000000 Binary files a/tools/tasm/TLINK.EXE and /dev/null differ diff --git a/web/.gitignore b/web/.gitignore deleted file mode 100644 index f9ed0db..0000000 --- a/web/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -out/ -dist/ \ No newline at end of file diff --git a/web/README.md b/web/README.md deleted file mode 100644 index 338bfff..0000000 --- a/web/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# run both emulators and emulators-ui in client - -run both emulators and emulators-ui in browser environment and expose an interface to control. \ No newline at end of file diff --git a/web/index.html b/web/index.html deleted file mode 100644 index 882b4a8..0000000 --- a/web/index.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - -
-
-
- - - - - \ No newline at end of file diff --git a/web/res/empty.jsdos b/web/res/empty.jsdos deleted file mode 100644 index aa47751..0000000 Binary files a/web/res/empty.jsdos and /dev/null differ diff --git a/web/src/index.ts b/web/src/index.ts deleted file mode 100644 index c6259a9..0000000 --- a/web/src/index.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Emulators } from 'emulators'; -import { EmulatorsUi } from 'emulators-ui'; - -declare const bundlePath: string; -declare const emulators: Emulators; -declare const emulatorsUi: EmulatorsUi; -declare const acquireVsCodeApi: () => { postMessage: (val: unknown) => undefined }; - -// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -let postMessage = (val: unknown) => console.log(val); - -try { - const vscode = acquireVsCodeApi(); - postMessage = vscode.postMessage; -} catch (e) { - console.log(e); -} - -async function main(): Promise { - const ele = document.getElementById("root"); - const ci = await emulatorsUi.dos(ele as HTMLDivElement, { - emulatorFunction: 'dosboxDirect' - }).run(bundlePath); - ci.events().onStdout( - value => { - postMessage({ - command: "stdout", - value - }); - } - ); -} - -main(); - diff --git a/web/tsconfig.json b/web/tsconfig.json deleted file mode 100644 index 8aa441e..0000000 --- a/web/tsconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "compilerOptions": { - "outDir": "out/", - "rootDir": "src/", - "lib": [ - "es2015", - "dom", - ], - "moduleResolution": "node", - "strict": true, - "target": "es2015", - "sourceMap": true - }, -} \ No newline at end of file diff --git a/web/webpack.config.js b/web/webpack.config.js deleted file mode 100644 index 7c373c7..0000000 --- a/web/webpack.config.js +++ /dev/null @@ -1,39 +0,0 @@ -const { resolve } = require('path'); - -const config2 = { - entry: resolve(__dirname, 'src/index.ts'), // the entry point 📖 -> https://webpack.js.org/configuration/entry-context/ - output: { - path: resolve(__dirname, 'dist'), - filename: 'index.js', - devtoolModuleFilenameTemplate: "../[resource-path]", - }, - externals: [], - devtool: 'source-map', - resolve: { // support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader - extensions: ['.ts', '.js'] - }, - module: { - rules: [{ - test: /\.ts$/, - exclude: /node_modules/, - use: [{ - // configure TypeScript loader: - // * enable sources maps for end-to-end source maps - loader: 'ts-loader', - options: { - compilerOptions: { - "sourceMap": true, - } - } - }] - }] - }, - optimization: { - minimize: process.argv.includes('--mode=production') - }, - stats: { - warnings: false - } -} - -module.exports = config2 \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index 932fdc9..d7f7a49 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -56,6 +56,5 @@ const config = { }; module.exports = [ - config, - require('./web/webpack.config') + config ] diff --git a/yarn.lock b/yarn.lock index 0b35a20..1c935be 100644 --- a/yarn.lock +++ b/yarn.lock @@ -78,6 +78,11 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@sindresorhus/is@^0.7.0": + version "0.7.0" + resolved "https://registry.nlark.com/@sindresorhus/is/download/@sindresorhus/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd" + integrity sha1-mgb08TfuhNffBGDB/bETX/psUP0= + "@tootallnate/once@1": version "1.1.2" resolved "https://registry.npm.taobao.org/@tootallnate/once/download/@tootallnate/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" @@ -461,6 +466,13 @@ anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" +archive-type@^4.0.0: + version "4.0.0" + resolved "https://registry.npm.taobao.org/archive-type/download/archive-type-4.0.0.tgz#f92e72233056dfc6969472749c267bdb046b1d70" + integrity sha1-+S5yIzBW38aWlHJ0nCZ72wRrHXA= + dependencies: + file-type "^4.2.0" + argparse@^1.0.7: version "1.0.10" resolved "https://registry.npm.taobao.org/argparse/download/argparse-1.0.10.tgz?cache=0&sync_timestamp=1598649397806&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fargparse%2Fdownload%2Fargparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -496,6 +508,11 @@ balanced-match@^1.0.0: resolved "https://registry.nlark.com/balanced-match/download/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha1-6D46fj8wCzTLnYf2FfoMvzV2kO4= +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.nlark.com/base64-js/download/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha1-GxtEAWClv3rUC2UPCVljSBkDkwo= + big-integer@^1.6.17: version "1.6.48" resolved "https://registry.npm.taobao.org/big-integer/download/big-integer-1.6.48.tgz#8fd88bd1632cba4a1c8c3e3d7159f08bb95b4b9e" @@ -514,6 +531,14 @@ binary@~0.3.0: buffers "~0.1.1" chainsaw "~0.1.0" +bl@^1.0.0: + version "1.2.3" + resolved "https://registry.npm.taobao.org/bl/download/bl-1.2.3.tgz#1e8dd80142eac80d7158c9dccc047fb620e035e7" + integrity sha1-Ho3YAULqyA1xWMnczAR/tiDgNec= + dependencies: + readable-stream "^2.3.5" + safe-buffer "^5.1.1" + bluebird@~3.4.1: version "3.4.7" resolved "https://registry.nlark.com/bluebird/download/bluebird-3.4.7.tgz?cache=0&sync_timestamp=1618847007562&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fbluebird%2Fdownload%2Fbluebird-3.4.7.tgz#f72d760be09b7f76d08ed8fae98b289a8d05fab3" @@ -555,11 +580,29 @@ browserslist@^4.14.5: escalade "^3.1.1" node-releases "^1.1.73" +buffer-alloc-unsafe@^1.1.0: + version "1.1.0" + resolved "https://registry.npm.taobao.org/buffer-alloc-unsafe/download/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" + integrity sha1-vX3CauKXLQ7aJTvgYdupkjScGfA= + +buffer-alloc@^1.2.0: + version "1.2.0" + resolved "https://registry.nlark.com/buffer-alloc/download/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" + integrity sha1-iQ3ZDZI6hz4I4Q5f1RpX5bfM4Ow= + dependencies: + buffer-alloc-unsafe "^1.1.0" + buffer-fill "^1.0.0" + buffer-crc32@~0.2.3: version "0.2.13" resolved "https://registry.npm.taobao.org/buffer-crc32/download/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= +buffer-fill@^1.0.0: + version "1.0.0" + resolved "https://registry.nlark.com/buffer-fill/download/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" + integrity sha1-+PeLdniYiO858gXNY39o5wISKyw= + buffer-from@^1.0.0: version "1.1.2" resolved "https://registry.nlark.com/buffer-from/download/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" @@ -570,11 +613,32 @@ buffer-indexof-polyfill@~1.0.0: resolved "https://registry.npm.taobao.org/buffer-indexof-polyfill/download/buffer-indexof-polyfill-1.0.2.tgz#d2732135c5999c64b277fcf9b1abe3498254729c" integrity sha1-0nMhNcWZnGSyd/z5savjSYJUcpw= +buffer@^5.2.1: + version "5.7.1" + resolved "https://registry.nlark.com/buffer/download/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" + integrity sha1-umLnwTEzBTWCGXFghRqPZI6Z7tA= + dependencies: + base64-js "^1.3.1" + ieee754 "^1.1.13" + buffers@~0.1.1: version "0.1.1" resolved "https://registry.npm.taobao.org/buffers/download/buffers-0.1.1.tgz#b24579c3bed4d6d396aeee6d9a8ae7f5482ab7bb" integrity sha1-skV5w77U1tOWru5tmorn9Ugqt7s= +cacheable-request@^2.1.1: + version "2.1.4" + resolved "https://registry.nlark.com/cacheable-request/download/cacheable-request-2.1.4.tgz?cache=0&sync_timestamp=1623237563054&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcacheable-request%2Fdownload%2Fcacheable-request-2.1.4.tgz#0d808801b6342ad33c91df9d0b44dc09b91e5c3d" + integrity sha1-DYCIAbY0KtM8kd+dC0TcCbkeXD0= + dependencies: + clone-response "1.0.2" + get-stream "3.0.0" + http-cache-semantics "3.8.1" + keyv "3.0.0" + lowercase-keys "1.0.0" + normalize-url "2.0.1" + responselike "1.0.2" + call-bind@^1.0.0: version "1.0.2" resolved "https://registry.nlark.com/call-bind/download/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" @@ -689,6 +753,13 @@ clone-deep@^4.0.1: kind-of "^6.0.2" shallow-clone "^3.0.0" +clone-response@1.0.2: + version "1.0.2" + resolved "https://registry.npm.taobao.org/clone-response/download/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" + integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= + dependencies: + mimic-response "^1.0.0" + color-convert@^1.9.0: version "1.9.3" resolved "https://registry.nlark.com/color-convert/download/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" @@ -718,7 +789,7 @@ colorette@^1.2.1, colorette@^1.2.2: resolved "https://registry.nlark.com/colorette/download/colorette-1.3.0.tgz?cache=0&sync_timestamp=1628600199068&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcolorette%2Fdownload%2Fcolorette-1.3.0.tgz#ff45d2f0edb244069d3b772adeb04fed38d0a0af" integrity sha1-/0XS8O2yRAadO3cq3rBP7TjQoK8= -commander@^2.20.0: +commander@^2.20.0, commander@^2.8.1: version "2.20.3" resolved "https://registry.nlark.com/commander/download/commander-2.20.3.tgz?cache=0&sync_timestamp=1627359190297&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcommander%2Fdownload%2Fcommander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha1-/UhehMA+tIgcIHIrpIA16FMa6zM= @@ -738,6 +809,13 @@ concat-map@0.0.1: resolved "https://registry.npm.taobao.org/concat-map/download/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= +content-disposition@^0.5.2: + version "0.5.3" + resolved "https://registry.npm.taobao.org/content-disposition/download/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" + integrity sha1-4TDK9+cnkIfFYWwgB9BIVpiYT70= + dependencies: + safe-buffer "5.1.2" + core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.nlark.com/core-util-is/download/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -787,6 +865,71 @@ decamelize@^4.0.0: resolved "https://registry.nlark.com/decamelize/download/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" integrity sha1-qkcte/Zg6xXzSU79UxyrfypwmDc= +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.nlark.com/decode-uri-component/download/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + +decompress-response@^3.3.0: + version "3.3.0" + resolved "https://registry.npm.taobao.org/decompress-response/download/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" + integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M= + dependencies: + mimic-response "^1.0.0" + +decompress-tar@^4.0.0, decompress-tar@^4.1.0, decompress-tar@^4.1.1: + version "4.1.1" + resolved "https://registry.nlark.com/decompress-tar/download/decompress-tar-4.1.1.tgz#718cbd3fcb16209716e70a26b84e7ba4592e5af1" + integrity sha1-cYy9P8sWIJcW5womuE57pFkuWvE= + dependencies: + file-type "^5.2.0" + is-stream "^1.1.0" + tar-stream "^1.5.2" + +decompress-tarbz2@^4.0.0: + version "4.1.1" + resolved "https://registry.nlark.com/decompress-tarbz2/download/decompress-tarbz2-4.1.1.tgz#3082a5b880ea4043816349f378b56c516be1a39b" + integrity sha1-MIKluIDqQEOBY0nzeLVsUWvho5s= + dependencies: + decompress-tar "^4.1.0" + file-type "^6.1.0" + is-stream "^1.1.0" + seek-bzip "^1.0.5" + unbzip2-stream "^1.0.9" + +decompress-targz@^4.0.0: + version "4.1.1" + resolved "https://registry.nlark.com/decompress-targz/download/decompress-targz-4.1.1.tgz#c09bc35c4d11f3de09f2d2da53e9de23e7ce1eee" + integrity sha1-wJvDXE0R894J8tLaU+neI+fOHu4= + dependencies: + decompress-tar "^4.1.1" + file-type "^5.2.0" + is-stream "^1.1.0" + +decompress-unzip@^4.0.1: + version "4.0.1" + resolved "https://registry.nlark.com/decompress-unzip/download/decompress-unzip-4.0.1.tgz#deaaccdfd14aeaf85578f733ae8210f9b4848f69" + integrity sha1-3qrM39FK6vhVePczroIQ+bSEj2k= + dependencies: + file-type "^3.8.0" + get-stream "^2.2.0" + pify "^2.3.0" + yauzl "^2.4.2" + +decompress@^4.2.1: + version "4.2.1" + resolved "https://registry.npm.taobao.org/decompress/download/decompress-4.2.1.tgz#007f55cc6a62c055afa37c07eb6a4ee1b773f118" + integrity sha1-AH9VzGpiwFWvo3wH62pO4bdz8Rg= + dependencies: + decompress-tar "^4.0.0" + decompress-tarbz2 "^4.0.0" + decompress-targz "^4.0.0" + decompress-unzip "^4.0.1" + graceful-fs "^4.1.10" + make-dir "^1.0.0" + pify "^2.3.0" + strip-dirs "^2.0.0" + deep-is@^0.1.3: version "0.1.3" resolved "https://registry.npm.taobao.org/deep-is/download/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" @@ -860,6 +1003,23 @@ domutils@^2.5.2, domutils@^2.6.0, domutils@^2.7.0: domelementtype "^2.2.0" domhandler "^4.2.0" +download@^8.0.0: + version "8.0.0" + resolved "https://registry.nlark.com/download/download/download-8.0.0.tgz#afc0b309730811731aae9f5371c9f46be73e51b1" + integrity sha1-r8CzCXMIEXMarp9Tccn0a+c+UbE= + dependencies: + archive-type "^4.0.0" + content-disposition "^0.5.2" + decompress "^4.2.1" + ext-name "^5.0.0" + file-type "^11.1.0" + filenamify "^3.0.0" + get-stream "^4.1.0" + got "^8.3.1" + make-dir "^2.1.0" + p-event "^2.1.0" + pify "^4.0.1" + duplexer2@~0.1.4: version "0.1.4" resolved "https://registry.nlark.com/duplexer2/download/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" @@ -867,6 +1027,11 @@ duplexer2@~0.1.4: dependencies: readable-stream "^2.0.2" +duplexer3@^0.1.4: + version "0.1.4" + resolved "https://registry.npm.taobao.org/duplexer3/download/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= + electron-to-chromium@^1.3.793: version "1.3.805" resolved "https://registry.nlark.com/electron-to-chromium/download/electron-to-chromium-1.3.805.tgz?cache=0&sync_timestamp=1628820169328&other_urls=https%3A%2F%2Fregistry.nlark.com%2Felectron-to-chromium%2Fdownload%2Felectron-to-chromium-1.3.805.tgz#a0873393a3b027ec60bdaf22a19c4946688cf941" @@ -877,16 +1042,18 @@ emoji-regex@^8.0.0: resolved "https://registry.nlark.com/emoji-regex/download/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha1-6Bj9ac5cz8tARZT4QpY79TFkzDc= -emulators-ui@^0.68.0: - version "0.68.0" - resolved "https://registry.nlark.com/emulators-ui/download/emulators-ui-0.68.0.tgz#145363978236a57a934bc2f4c0aea5583d2eab7b" - integrity sha1-FFNjl4I2pXqTS8L0wK6lWD0uq3s= - emulators@^0.67.0: version "0.67.0" resolved "https://registry.nlark.com/emulators/download/emulators-0.67.0.tgz#9daba2fd48cdb634d2c55b12c7116e61ffd2c6b6" integrity sha1-naui/UjNtjTSxVsSxxFuYf/SxrY= +end-of-stream@^1.0.0, end-of-stream@^1.1.0: + version "1.4.4" + resolved "https://registry.npm.taobao.org/end-of-stream/download/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha1-WuZKX0UFe682JuwU2gyl5LJDHrA= + dependencies: + once "^1.4.0" + enhanced-resolve@^5.0.0, enhanced-resolve@^5.8.0: version "5.8.2" resolved "https://registry.nlark.com/enhanced-resolve/download/enhanced-resolve-5.8.2.tgz?cache=0&sync_timestamp=1620663202047&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fenhanced-resolve%2Fdownload%2Fenhanced-resolve-5.8.2.tgz#15ddc779345cbb73e97c611cd00c01c1e7bf4d8b" @@ -932,7 +1099,7 @@ escape-string-regexp@4.0.0, escape-string-regexp@^4.0.0: resolved "https://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha1-FLqDpdNz49MR5a/KKc9b+tllvzQ= -escape-string-regexp@^1.0.5: +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= @@ -1078,6 +1245,21 @@ execa@^5.0.0: signal-exit "^3.0.3" strip-final-newline "^2.0.0" +ext-list@^2.0.0: + version "2.2.2" + resolved "https://registry.npm.taobao.org/ext-list/download/ext-list-2.2.2.tgz#0b98e64ed82f5acf0f2931babf69212ef52ddd37" + integrity sha1-C5jmTtgvWs8PKTG6v2khLvUt3Tc= + dependencies: + mime-db "^1.28.0" + +ext-name@^5.0.0: + version "5.0.0" + resolved "https://registry.npm.taobao.org/ext-name/download/ext-name-5.0.0.tgz#70781981d183ee15d13993c8822045c506c8f0a6" + integrity sha1-cHgZgdGD7hXROZPIgiBFxQbI8KY= + dependencies: + ext-list "^2.0.0" + sort-keys-length "^1.0.0" + fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -1130,6 +1312,45 @@ file-entry-cache@^6.0.1: dependencies: flat-cache "^3.0.4" +file-type@^11.1.0: + version "11.1.0" + resolved "https://registry.nlark.com/file-type/download/file-type-11.1.0.tgz#93780f3fed98b599755d846b99a1617a2ad063b8" + integrity sha1-k3gPP+2YtZl1XYRrmaFheirQY7g= + +file-type@^3.8.0: + version "3.9.0" + resolved "https://registry.nlark.com/file-type/download/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9" + integrity sha1-JXoHg4TR24CHvESdEH1SpSZyuek= + +file-type@^4.2.0: + version "4.4.0" + resolved "https://registry.nlark.com/file-type/download/file-type-4.4.0.tgz#1b600e5fca1fbdc6e80c0a70c71c8dba5f7906c5" + integrity sha1-G2AOX8ofvcboDApwxxyNul95BsU= + +file-type@^5.2.0: + version "5.2.0" + resolved "https://registry.nlark.com/file-type/download/file-type-5.2.0.tgz#2ddbea7c73ffe36368dfae49dc338c058c2b8ad6" + integrity sha1-LdvqfHP/42No365J3DOMBYwritY= + +file-type@^6.1.0: + version "6.2.0" + resolved "https://registry.nlark.com/file-type/download/file-type-6.2.0.tgz#e50cd75d356ffed4e306dc4f5bcf52a79903a919" + integrity sha1-5QzXXTVv/tTjBtxPW89Sp5kDqRk= + +filename-reserved-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.nlark.com/filename-reserved-regex/download/filename-reserved-regex-2.0.0.tgz?cache=0&sync_timestamp=1629073361790&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ffilename-reserved-regex%2Fdownload%2Ffilename-reserved-regex-2.0.0.tgz#abf73dfab735d045440abfea2d91f389ebbfa229" + integrity sha1-q/c9+rc10EVECr/qLZHzieu/oik= + +filenamify@^3.0.0: + version "3.0.0" + resolved "https://registry.npmmirror.com/filenamify/download/filenamify-3.0.0.tgz?cache=0&sync_timestamp=1634472792719&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Ffilenamify%2Fdownload%2Ffilenamify-3.0.0.tgz#9603eb688179f8c5d40d828626dcbb92c3a4672c" + integrity sha1-lgPraIF5+MXUDYKGJty7ksOkZyw= + dependencies: + filename-reserved-regex "^2.0.0" + strip-outer "^1.0.0" + trim-repeated "^1.0.0" + fill-range@^7.0.1: version "7.0.1" resolved "https://registry.nlark.com/fill-range/download/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" @@ -1171,6 +1392,19 @@ flatted@^3.1.0: resolved "https://registry.nlark.com/flatted/download/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561" integrity sha1-ZL/tXLaP48p4s+shStl7Y77c5WE= +from2@^2.1.1: + version "2.3.0" + resolved "https://registry.nlark.com/from2/download/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" + integrity sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8= + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.0" + +fs-constants@^1.0.0: + version "1.0.0" + resolved "https://registry.npm.taobao.org/fs-constants/download/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" + integrity sha1-a+Dem+mYzhavivwkSXue6bfM2a0= + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.nlark.com/fs.realpath/download/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -1215,6 +1449,26 @@ get-intrinsic@^1.0.2: has "^1.0.3" has-symbols "^1.0.1" +get-stream@3.0.0, get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.nlark.com/get-stream/download/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= + +get-stream@^2.2.0: + version "2.3.1" + resolved "https://registry.nlark.com/get-stream/download/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" + integrity sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4= + dependencies: + object-assign "^4.0.1" + pinkie-promise "^2.0.0" + +get-stream@^4.1.0: + version "4.1.0" + resolved "https://registry.nlark.com/get-stream/download/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + integrity sha1-wbJVV189wh1Zv8ec09K0axw6VLU= + dependencies: + pump "^3.0.0" + get-stream@^6.0.0: version "6.0.1" resolved "https://registry.nlark.com/get-stream/download/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" @@ -1263,7 +1517,30 @@ globby@^11.0.1, globby@^11.0.3: merge2 "^1.3.0" slash "^3.0.0" -graceful-fs@^4.1.2, graceful-fs@^4.2.2, graceful-fs@^4.2.4: +got@^8.3.1: + version "8.3.2" + resolved "https://registry.nlark.com/got/download/got-8.3.2.tgz#1d23f64390e97f776cac52e5b936e5f514d2e937" + integrity sha1-HSP2Q5Dpf3dsrFLluTbl9RTS6Tc= + dependencies: + "@sindresorhus/is" "^0.7.0" + cacheable-request "^2.1.1" + decompress-response "^3.3.0" + duplexer3 "^0.1.4" + get-stream "^3.0.0" + into-stream "^3.1.0" + is-retry-allowed "^1.1.0" + isurl "^1.0.0-alpha5" + lowercase-keys "^1.0.0" + mimic-response "^1.0.0" + p-cancelable "^0.4.0" + p-timeout "^2.0.1" + pify "^3.0.0" + safe-buffer "^5.1.1" + timed-out "^4.0.1" + url-parse-lax "^3.0.0" + url-to-options "^1.0.1" + +graceful-fs@^4.1.10, graceful-fs@^4.1.2, graceful-fs@^4.2.2, graceful-fs@^4.2.4: version "4.2.8" resolved "https://registry.nlark.com/graceful-fs/download/graceful-fs-4.2.8.tgz?cache=0&sync_timestamp=1628194078324&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fgraceful-fs%2Fdownload%2Fgraceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" integrity sha1-5BK40z9eAGWTy9PO5t+fLOu+gCo= @@ -1283,11 +1560,23 @@ has-flag@^4.0.0: resolved "https://registry.nlark.com/has-flag/download/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s= +has-symbol-support-x@^1.4.1: + version "1.4.2" + resolved "https://registry.npm.taobao.org/has-symbol-support-x/download/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" + integrity sha1-FAn5i8ACR9pF2mfO4KNvKC/yZFU= + has-symbols@^1.0.1: version "1.0.2" resolved "https://registry.npm.taobao.org/has-symbols/download/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" integrity sha1-Fl0wcMADCXUqEjakeTMeOsVvFCM= +has-to-string-tag-x@^1.2.0: + version "1.4.1" + resolved "https://registry.npm.taobao.org/has-to-string-tag-x/download/has-to-string-tag-x-1.4.1.tgz#a045ab383d7b4b2012a00148ab0aa5f290044d4d" + integrity sha1-oEWrOD17SyASoAFIqwql8pAETU0= + dependencies: + has-symbol-support-x "^1.4.1" + has@^1.0.3: version "1.0.3" resolved "https://registry.nlark.com/has/download/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" @@ -1310,6 +1599,11 @@ htmlparser2@^6.1.0: domutils "^2.5.2" entities "^2.0.0" +http-cache-semantics@3.8.1: + version "3.8.1" + resolved "https://registry.npm.taobao.org/http-cache-semantics/download/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" + integrity sha1-ObDhat2bYFvwqe89nar0hDtMrNI= + http-proxy-agent@^4.0.1: version "4.0.1" resolved "https://registry.npm.taobao.org/http-proxy-agent/download/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" @@ -1332,6 +1626,11 @@ human-signals@^2.1.0: resolved "https://registry.nlark.com/human-signals/download/human-signals-2.1.0.tgz?cache=0&sync_timestamp=1624364695595&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fhuman-signals%2Fdownload%2Fhuman-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" integrity sha1-3JH8ukLk0G5Kuu0zs+ejwC9RTqA= +ieee754@^1.1.13: + version "1.2.1" + resolved "https://registry.nlark.com/ieee754/download/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha1-jrehCmP/8l0VpXsAFYbRd9Gw01I= + ignore@^4.0.6: version "4.0.6" resolved "https://registry.nlark.com/ignore/download/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" @@ -1381,7 +1680,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@~2.0.0, inherits@~2.0.3: +inherits@2, inherits@^2.0.1, inherits@~2.0.0, inherits@~2.0.3: version "2.0.4" resolved "https://registry.nlark.com/inherits/download/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha1-D6LGT5MpF8NDOg3tVTY6rjdBa3w= @@ -1391,6 +1690,14 @@ interpret@^2.2.0: resolved "https://registry.nlark.com/interpret/download/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9" integrity sha1-GnigtZZcQKVBbQB61vUK0nxBffk= +into-stream@^3.1.0: + version "3.1.0" + resolved "https://registry.nlark.com/into-stream/download/into-stream-3.1.0.tgz#96fb0a936c12babd6ff1752a17d05616abd094c6" + integrity sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY= + dependencies: + from2 "^2.1.1" + p-is-promise "^1.1.0" + is-binary-path@~2.1.0: version "2.1.0" resolved "https://registry.npm.taobao.org/is-binary-path/download/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" @@ -1427,11 +1734,21 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" +is-natural-number@^4.0.1: + version "4.0.1" + resolved "https://registry.nlark.com/is-natural-number/download/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8" + integrity sha1-q5124dtM7VHjXeDHLr7PCfc0zeg= + is-number@^7.0.0: version "7.0.0" resolved "https://registry.npm.taobao.org/is-number/download/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss= +is-object@^1.0.1: + version "1.0.2" + resolved "https://registry.nlark.com/is-object/download/is-object-1.0.2.tgz#a56552e1c665c9e950b4a025461da87e72f86fcf" + integrity sha1-pWVS4cZlyelQtKAlRh2ofnL4b88= + is-path-cwd@^2.2.0: version "2.2.0" resolved "https://registry.nlark.com/is-path-cwd/download/is-path-cwd-2.2.0.tgz?cache=0&sync_timestamp=1628686507859&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fis-path-cwd%2Fdownload%2Fis-path-cwd-2.2.0.tgz#67d43b82664a7b5191fd9119127eb300048a9fdb" @@ -1442,6 +1759,11 @@ is-path-inside@^3.0.2: resolved "https://registry.nlark.com/is-path-inside/download/is-path-inside-3.0.3.tgz?cache=0&sync_timestamp=1620046845369&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fis-path-inside%2Fdownload%2Fis-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" integrity sha1-0jE2LlOgf/Kw4Op/7QSRYf/RYoM= +is-plain-obj@^1.0.0: + version "1.1.0" + resolved "https://registry.npm.taobao.org/is-plain-obj/download/is-plain-obj-1.1.0.tgz?cache=0&sync_timestamp=1618600554597&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-plain-obj%2Fdownload%2Fis-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= + is-plain-obj@^2.1.0: version "2.1.0" resolved "https://registry.npm.taobao.org/is-plain-obj/download/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" @@ -1454,6 +1776,16 @@ is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" +is-retry-allowed@^1.1.0: + version "1.2.0" + resolved "https://registry.nlark.com/is-retry-allowed/download/is-retry-allowed-1.2.0.tgz#d778488bd0a4666a3be8a1482b9f2baafedea8b4" + integrity sha1-13hIi9CkZmo76KFIK58rqv7eqLQ= + +is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.nlark.com/is-stream/download/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + is-stream@^2.0.0: version "2.0.1" resolved "https://registry.nlark.com/is-stream/download/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" @@ -1479,6 +1811,14 @@ isobject@^3.0.1: resolved "https://registry.npm.taobao.org/isobject/download/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= +isurl@^1.0.0-alpha5: + version "1.0.0" + resolved "https://registry.npm.taobao.org/isurl/download/isurl-1.0.0.tgz#b27f4f49f3cdaa3ea44a0a5b7f3462e6edc39d67" + integrity sha1-sn9PSfPNqj6kSgpbfzRi5u3DnWc= + dependencies: + has-to-string-tag-x "^1.2.0" + is-object "^1.0.1" + jest-worker@^27.0.2: version "27.0.6" resolved "https://registry.nlark.com/jest-worker/download/jest-worker-27.0.6.tgz#a5fdb1e14ad34eb228cfe162d9f729cdbfa28aed" @@ -1508,6 +1848,11 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" +json-buffer@3.0.0: + version "3.0.0" + resolved "https://registry.nlark.com/json-buffer/download/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" + integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= + json-parse-better-errors@^1.0.2: version "1.0.2" resolved "https://registry.npm.taobao.org/json-parse-better-errors/download/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" @@ -1538,6 +1883,13 @@ jszip@^3.7.1: readable-stream "~2.3.6" set-immediate-shim "~1.0.1" +keyv@3.0.0: + version "3.0.0" + resolved "https://registry.npm.taobao.org/keyv/download/keyv-3.0.0.tgz#44923ba39e68b12a7cec7df6c3268c031f2ef373" + integrity sha1-RJI7o55osSp87H32wyaMAx8u83M= + dependencies: + json-buffer "3.0.0" + kind-of@^6.0.2: version "6.0.3" resolved "https://registry.nlark.com/kind-of/download/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" @@ -1622,6 +1974,16 @@ log-symbols@4.1.0: chalk "^4.1.0" is-unicode-supported "^0.1.0" +lowercase-keys@1.0.0: + version "1.0.0" + resolved "https://registry.npmmirror.com/lowercase-keys/download/lowercase-keys-1.0.0.tgz?cache=0&sync_timestamp=1634551808987&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Flowercase-keys%2Fdownload%2Flowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306" + integrity sha1-TjNms55/VFfjXxMkvfb4jQv8cwY= + +lowercase-keys@^1.0.0: + version "1.0.1" + resolved "https://registry.npmmirror.com/lowercase-keys/download/lowercase-keys-1.0.1.tgz?cache=0&sync_timestamp=1634551808987&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Flowercase-keys%2Fdownload%2Flowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" + integrity sha1-b54wtHCE2XGnyCD/FabFFnt0wm8= + lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.nlark.com/lru-cache/download/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -1629,6 +1991,21 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +make-dir@^1.0.0: + version "1.3.0" + resolved "https://registry.nlark.com/make-dir/download/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" + integrity sha1-ecEDO4BRW9bSTsmTPoYMp17ifww= + dependencies: + pify "^3.0.0" + +make-dir@^2.1.0: + version "2.1.0" + resolved "https://registry.nlark.com/make-dir/download/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" + integrity sha1-XwMQ4YuL6JjMBwCSlaMK5B6R5vU= + dependencies: + pify "^4.0.1" + semver "^5.6.0" + markdown-it@^10.0.0: version "10.0.0" resolved "https://registry.nlark.com/markdown-it/download/markdown-it-10.0.0.tgz?cache=0&sync_timestamp=1627929816808&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fmarkdown-it%2Fdownload%2Fmarkdown-it-10.0.0.tgz#abfc64f141b1722d663402044e43927f1f50a8dc" @@ -1668,6 +2045,11 @@ mime-db@1.49.0: resolved "https://registry.nlark.com/mime-db/download/mime-db-1.49.0.tgz#f3dfde60c99e9cf3bc9701d687778f537001cbed" integrity sha1-89/eYMmenPO8lwHWh3ePU3ABy+0= +mime-db@^1.28.0: + version "1.50.0" + resolved "https://registry.nlark.com/mime-db/download/mime-db-1.50.0.tgz?cache=0&sync_timestamp=1631863109039&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fmime-db%2Fdownload%2Fmime-db-1.50.0.tgz#abd4ac94e98d3c0e185016c67ab45d5fde40c11f" + integrity sha1-q9SslOmNPA4YUBbGerRdX95AwR8= + mime-types@^2.1.27: version "2.1.32" resolved "https://registry.nlark.com/mime-types/download/mime-types-2.1.32.tgz?cache=0&sync_timestamp=1627407819001&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fmime-types%2Fdownload%2Fmime-types-2.1.32.tgz#1d00e89e7de7fe02008db61001d9e02852670fd5" @@ -1685,6 +2067,11 @@ mimic-fn@^2.1.0: resolved "https://registry.nlark.com/mimic-fn/download/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha1-ftLCzMyvhNP/y3pptXcR/CCDQBs= +mimic-response@^1.0.0: + version "1.0.1" + resolved "https://registry.nlark.com/mimic-response/download/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" + integrity sha1-SSNTiHju9CBjy4o+OweYeBSHqxs= + minimatch@3.0.4, minimatch@^3.0.3, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.npm.taobao.org/minimatch/download/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" @@ -1775,6 +2162,15 @@ normalize-path@^3.0.0, normalize-path@~3.0.0: resolved "https://registry.nlark.com/normalize-path/download/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha1-Dc1p/yOhybEf0JeDFmRKA4ghamU= +normalize-url@2.0.1: + version "2.0.1" + resolved "https://registry.nlark.com/normalize-url/download/normalize-url-2.0.1.tgz#835a9da1551fa26f70e92329069a23aa6574d7e6" + integrity sha1-g1qdoVUfom9w6SMpBpojqmV01+Y= + dependencies: + prepend-http "^2.0.0" + query-string "^5.0.1" + sort-keys "^2.0.0" + npm-run-path@^4.0.1: version "4.0.1" resolved "https://registry.nlark.com/npm-run-path/download/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" @@ -1789,12 +2185,17 @@ nth-check@^2.0.0: dependencies: boolbase "^1.0.0" +object-assign@^4.0.1, object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.nlark.com/object-assign/download/object-assign-4.1.1.tgz?cache=0&sync_timestamp=1618846798176&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fobject-assign%2Fdownload%2Fobject-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + object-inspect@^1.9.0: version "1.11.0" resolved "https://registry.nlark.com/object-inspect/download/object-inspect-1.11.0.tgz?cache=0&sync_timestamp=1626120241132&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fobject-inspect%2Fdownload%2Fobject-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1" integrity sha1-nc6xRs7dQUig2eUauI00z1CZIrE= -once@^1.3.0: +once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.nlark.com/once/download/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= @@ -1838,6 +2239,28 @@ osenv@^0.1.3: os-homedir "^1.0.0" os-tmpdir "^1.0.0" +p-cancelable@^0.4.0: + version "0.4.1" + resolved "https://registry.nlark.com/p-cancelable/download/p-cancelable-0.4.1.tgz#35f363d67d52081c8d9585e37bcceb7e0bbcb2a0" + integrity sha1-NfNj1n1SCByNlYXje8zrfgu8sqA= + +p-event@^2.1.0: + version "2.3.1" + resolved "https://registry.nlark.com/p-event/download/p-event-2.3.1.tgz#596279ef169ab2c3e0cae88c1cfbb08079993ef6" + integrity sha1-WWJ57xaassPgyuiMHPuwgHmZPvY= + dependencies: + p-timeout "^2.0.1" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.npm.taobao.org/p-finally/download/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= + +p-is-promise@^1.1.0: + version "1.1.0" + resolved "https://registry.npm.taobao.org/p-is-promise/download/p-is-promise-1.1.0.tgz#9c9456989e9f6588017b0434d56097675c3da05e" + integrity sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4= + p-limit@^2.2.0: version "2.3.0" resolved "https://registry.nlark.com/p-limit/download/p-limit-2.3.0.tgz?cache=0&sync_timestamp=1628812721654&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fp-limit%2Fdownload%2Fp-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" @@ -1873,6 +2296,13 @@ p-map@^4.0.0: dependencies: aggregate-error "^3.0.0" +p-timeout@^2.0.1: + version "2.0.1" + resolved "https://registry.npmmirror.com/p-timeout/download/p-timeout-2.0.1.tgz?cache=0&sync_timestamp=1635094914837&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fp-timeout%2Fdownload%2Fp-timeout-2.0.1.tgz#d8dd1979595d2dc0139e1fe46b8b646cb3cdf038" + integrity sha1-2N0ZeVldLcATnh/ka4tkbLPN8Dg= + dependencies: + p-finally "^1.0.0" + p-try@^2.0.0: version "2.2.0" resolved "https://registry.nlark.com/p-try/download/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" @@ -1944,6 +2374,33 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: resolved "https://registry.nlark.com/picomatch/download/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" integrity sha1-8fBh3o9qS/AiiS4tEoI0+5gwKXI= +pify@^2.3.0: + version "2.3.0" + resolved "https://registry.npm.taobao.org/pify/download/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= + +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.npm.taobao.org/pify/download/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= + +pify@^4.0.1: + version "4.0.1" + resolved "https://registry.npm.taobao.org/pify/download/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" + integrity sha1-SyzSXFDVmHNcUCkiJP2MbfQeMjE= + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.nlark.com/pinkie-promise/download/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.nlark.com/pinkie/download/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= + pkg-dir@^4.2.0: version "4.2.0" resolved "https://registry.nlark.com/pkg-dir/download/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" @@ -1956,6 +2413,11 @@ prelude-ls@^1.2.1: resolved "https://registry.nlark.com/prelude-ls/download/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha1-3rxkidem5rDnYRiIzsiAM30xY5Y= +prepend-http@^2.0.0: + version "2.0.0" + resolved "https://registry.nlark.com/prepend-http/download/prepend-http-2.0.0.tgz?cache=0&sync_timestamp=1628547565904&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fprepend-http%2Fdownload%2Fprepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" + integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.npm.taobao.org/process-nextick-args/download/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -1966,6 +2428,14 @@ progress@^2.0.0: resolved "https://registry.nlark.com/progress/download/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha1-foz42PW48jnBvGi+tOt4Vn1XLvg= +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.nlark.com/pump/download/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha1-tKIRaBW94vTh6mAjVOjHVWUQemQ= + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + punycode@^2.1.0: version "2.1.1" resolved "https://registry.nlark.com/punycode/download/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" @@ -1978,6 +2448,15 @@ qs@^6.9.1: dependencies: side-channel "^1.0.4" +query-string@^5.0.1: + version "5.1.1" + resolved "https://registry.nlark.com/query-string/download/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" + integrity sha1-p4wBK3HBfgXy4/ojGd0zBoLvs8s= + dependencies: + decode-uri-component "^0.2.0" + object-assign "^4.1.0" + strict-uri-encode "^1.0.0" + queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.npm.taobao.org/queue-microtask/download/queue-microtask-1.2.3.tgz?cache=0&sync_timestamp=1616391510274&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fqueue-microtask%2Fdownload%2Fqueue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" @@ -1997,7 +2476,7 @@ read@^1.0.7: dependencies: mute-stream "~0.0.4" -readable-stream@^2.0.2, readable-stream@~2.3.6: +readable-stream@^2.0.0, readable-stream@^2.0.2, readable-stream@^2.3.0, readable-stream@^2.3.5, readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.npm.taobao.org/readable-stream/download/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha1-Hsoc9xGu+BTAT2IlKjamL2yyO1c= @@ -2064,6 +2543,13 @@ resolve@^1.9.0: is-core-module "^2.2.0" path-parse "^1.0.6" +responselike@1.0.2: + version "1.0.2" + resolved "https://registry.nlark.com/responselike/download/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" + integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec= + dependencies: + lowercase-keys "^1.0.0" + reusify@^1.0.4: version "1.0.4" resolved "https://registry.nlark.com/reusify/download/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" @@ -2090,16 +2576,16 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -safe-buffer@^5.1.0: - version "5.2.1" - resolved "https://registry.nlark.com/safe-buffer/download/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha1-Hq+fqb2x/dTsdfWPnNtOa3gn7sY= - -safe-buffer@~5.1.0, safe-buffer@~5.1.1: +safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.nlark.com/safe-buffer/download/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha1-mR7GnSluAxN0fVm9/St0XDX4go0= +safe-buffer@^5.1.0, safe-buffer@^5.1.1: + version "5.2.1" + resolved "https://registry.nlark.com/safe-buffer/download/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha1-Hq+fqb2x/dTsdfWPnNtOa3gn7sY= + schema-utils@^3.0.0, schema-utils@^3.1.0: version "3.1.1" resolved "https://registry.nlark.com/schema-utils/download/schema-utils-3.1.1.tgz?cache=0&sync_timestamp=1626694740261&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fschema-utils%2Fdownload%2Fschema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281" @@ -2109,7 +2595,14 @@ schema-utils@^3.0.0, schema-utils@^3.1.0: ajv "^6.12.5" ajv-keywords "^3.5.2" -semver@^5.1.0: +seek-bzip@^1.0.5: + version "1.0.6" + resolved "https://registry.npm.taobao.org/seek-bzip/download/seek-bzip-1.0.6.tgz#35c4171f55a680916b52a07859ecf3b5857f21c4" + integrity sha1-NcQXH1WmgJFrUqB4WezztYV/IcQ= + dependencies: + commander "^2.8.1" + +semver@^5.1.0, semver@^5.6.0: version "5.7.1" resolved "https://registry.npm.taobao.org/semver/download/semver-5.7.1.tgz?cache=0&sync_timestamp=1616463641178&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha1-qVT5Ma66UI0we78Gnv8MAclhFvc= @@ -2185,6 +2678,27 @@ slice-ansi@^4.0.0: astral-regex "^2.0.0" is-fullwidth-code-point "^3.0.0" +sort-keys-length@^1.0.0: + version "1.0.1" + resolved "https://registry.npm.taobao.org/sort-keys-length/download/sort-keys-length-1.0.1.tgz#9cb6f4f4e9e48155a6aa0671edd336ff1479a188" + integrity sha1-nLb09OnkgVWmqgZx7dM2/xR5oYg= + dependencies: + sort-keys "^1.0.0" + +sort-keys@^1.0.0: + version "1.1.2" + resolved "https://registry.nlark.com/sort-keys/download/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad" + integrity sha1-RBttTTRnmPG05J6JIK37oOVD+a0= + dependencies: + is-plain-obj "^1.0.0" + +sort-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.nlark.com/sort-keys/download/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128" + integrity sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg= + dependencies: + is-plain-obj "^1.0.0" + source-map-support@~0.5.19: version "0.5.19" resolved "https://registry.nlark.com/source-map-support/download/source-map-support-0.5.19.tgz?cache=0&sync_timestamp=1618847050054&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsource-map-support%2Fdownload%2Fsource-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" @@ -2208,6 +2722,11 @@ sprintf-js@~1.0.2: resolved "https://registry.npm.taobao.org/sprintf-js/download/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= +strict-uri-encode@^1.0.0: + version "1.1.0" + resolved "https://registry.npm.taobao.org/strict-uri-encode/download/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" + integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= + "string-width@^1.0.2 || 2": version "2.1.1" resolved "https://registry.npm.taobao.org/string-width/download/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" @@ -2246,6 +2765,13 @@ strip-ansi@^6.0.0: dependencies: ansi-regex "^5.0.0" +strip-dirs@^2.0.0: + version "2.1.0" + resolved "https://registry.nlark.com/strip-dirs/download/strip-dirs-2.1.0.tgz#4987736264fc344cf20f6c34aca9d13d1d4ed6c5" + integrity sha1-SYdzYmT8NEzyD2w0rKnRPR1O1sU= + dependencies: + is-natural-number "^4.0.1" + strip-final-newline@^2.0.0: version "2.0.0" resolved "https://registry.nlark.com/strip-final-newline/download/strip-final-newline-2.0.0.tgz?cache=0&sync_timestamp=1620046435959&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fstrip-final-newline%2Fdownload%2Fstrip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" @@ -2256,6 +2782,13 @@ strip-json-comments@3.1.1, strip-json-comments@^3.1.0, strip-json-comments@^3.1. resolved "https://registry.npm.taobao.org/strip-json-comments/download/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha1-MfEoGzgyYwQ0gxwxDAHMzajL4AY= +strip-outer@^1.0.0: + version "1.0.1" + resolved "https://registry.nlark.com/strip-outer/download/strip-outer-1.0.1.tgz#b2fd2abf6604b9d1e6013057195df836b8a9d631" + integrity sha1-sv0qv2YEudHmATBXGV34Nrip1jE= + dependencies: + escape-string-regexp "^1.0.2" + supports-color@8.1.1, supports-color@^8.0.0: version "8.1.1" resolved "https://registry.nlark.com/supports-color/download/supports-color-8.1.1.tgz?cache=0&sync_timestamp=1626703342506&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsupports-color%2Fdownload%2Fsupports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" @@ -2294,6 +2827,19 @@ tapable@^2.1.1, tapable@^2.2.0: resolved "https://registry.npm.taobao.org/tapable/download/tapable-2.2.0.tgz?cache=0&sync_timestamp=1607088902003&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftapable%2Fdownload%2Ftapable-2.2.0.tgz#5c373d281d9c672848213d0e037d1c4165ab426b" integrity sha1-XDc9KB2cZyhIIT0OA30cQWWrQms= +tar-stream@^1.5.2: + version "1.6.2" + resolved "https://registry.npm.taobao.org/tar-stream/download/tar-stream-1.6.2.tgz?cache=0&sync_timestamp=1609236246435&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftar-stream%2Fdownload%2Ftar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555" + integrity sha1-jqVdqzeXIlPZqa+Q/c1VmuQ1xVU= + dependencies: + bl "^1.0.0" + buffer-alloc "^1.2.0" + end-of-stream "^1.0.0" + fs-constants "^1.0.0" + readable-stream "^2.3.0" + to-buffer "^1.1.1" + xtend "^4.0.0" + terser-webpack-plugin@^5.1.3: version "5.1.4" resolved "https://registry.nlark.com/terser-webpack-plugin/download/terser-webpack-plugin-5.1.4.tgz?cache=0&sync_timestamp=1624624550780&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fterser-webpack-plugin%2Fdownload%2Fterser-webpack-plugin-5.1.4.tgz#c369cf8a47aa9922bd0d8a94fe3d3da11a7678a1" @@ -2320,6 +2866,16 @@ text-table@^0.2.0: resolved "https://registry.nlark.com/text-table/download/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= +through@^2.3.8: + version "2.3.8" + resolved "https://registry.nlark.com/through/download/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + +timed-out@^4.0.1: + version "4.0.1" + resolved "https://registry.nlark.com/timed-out/download/timed-out-4.0.1.tgz?cache=0&sync_timestamp=1619073519240&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ftimed-out%2Fdownload%2Ftimed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" + integrity sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8= + tmp@^0.2.1: version "0.2.1" resolved "https://registry.npm.taobao.org/tmp/download/tmp-0.2.1.tgz?cache=0&sync_timestamp=1592843137359&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftmp%2Fdownload%2Ftmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14" @@ -2327,6 +2883,11 @@ tmp@^0.2.1: dependencies: rimraf "^3.0.0" +to-buffer@^1.1.1: + version "1.1.1" + resolved "https://registry.nlark.com/to-buffer/download/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" + integrity sha1-STvUj2LXxD/N7TE6A9ytsuEhOoA= + to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.nlark.com/to-regex-range/download/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -2339,6 +2900,13 @@ to-regex-range@^5.0.1: resolved "https://registry.npm.taobao.org/traverse/download/traverse-0.3.9.tgz#717b8f220cc0bb7b44e40514c22b2e8bbc70d8b9" integrity sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk= +trim-repeated@^1.0.0: + version "1.0.0" + resolved "https://registry.nlark.com/trim-repeated/download/trim-repeated-1.0.0.tgz#e3646a2ea4e891312bf7eace6cfb05380bc01c21" + integrity sha1-42RqLqTokTEr9+rObPsFOAvAHCE= + dependencies: + escape-string-regexp "^1.0.2" + ts-loader@^9.2.5: version "9.2.5" resolved "https://registry.nlark.com/ts-loader/download/ts-loader-9.2.5.tgz#127733a5e9243bf6dafcb8aa3b8a266d8041dca9" @@ -2402,6 +2970,14 @@ uc.micro@^1.0.1, uc.micro@^1.0.5: resolved "https://registry.nlark.com/uc.micro/download/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" integrity sha1-nEEagCpAmpH8bPdAgbq6NLJEmaw= +unbzip2-stream@^1.0.9: + version "1.4.3" + resolved "https://registry.nlark.com/unbzip2-stream/download/unbzip2-stream-1.4.3.tgz#b0da04c4371311df771cdc215e87f2130991ace7" + integrity sha1-sNoExDcTEd93HNwhXofyEwmRrOc= + dependencies: + buffer "^5.2.1" + through "^2.3.8" + underscore@^1.12.1: version "1.13.1" resolved "https://registry.nlark.com/underscore/download/underscore-1.13.1.tgz#0c1c6bd2df54b6b69f2314066d65b6cde6fcf9d1" @@ -2435,6 +3011,18 @@ url-join@^1.1.0: resolved "https://registry.nlark.com/url-join/download/url-join-1.1.0.tgz?cache=0&sync_timestamp=1622604485950&other_urls=https%3A%2F%2Fregistry.nlark.com%2Furl-join%2Fdownload%2Furl-join-1.1.0.tgz#741c6c2f4596c4830d6718460920d0c92202dc78" integrity sha1-dBxsL0WWxIMNZxhGCSDQySIC3Hg= +url-parse-lax@^3.0.0: + version "3.0.0" + resolved "https://registry.nlark.com/url-parse-lax/download/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" + integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww= + dependencies: + prepend-http "^2.0.0" + +url-to-options@^1.0.1: + version "1.0.1" + resolved "https://registry.nlark.com/url-to-options/download/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" + integrity sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k= + util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.nlark.com/util-deprecate/download/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -2594,6 +3182,11 @@ wrappy@1: resolved "https://registry.nlark.com/wrappy/download/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= +xtend@^4.0.0: + version "4.0.2" + resolved "https://registry.nlark.com/xtend/download/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha1-u3J3n1+kZRhrH0OPZ0+jR/2121Q= + y18n@^5.0.5: version "5.0.8" resolved "https://registry.npm.taobao.org/y18n/download/y18n-5.0.8.tgz?cache=0&sync_timestamp=1617822642544&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fy18n%2Fdownload%2Fy18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" @@ -2637,7 +3230,7 @@ yargs@16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" -yauzl@^2.3.1: +yauzl@^2.3.1, yauzl@^2.4.2: version "2.10.0" resolved "https://registry.nlark.com/yauzl/download/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=