xshell 0.0.34 → 0.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/file.d.ts +8 -5
- package/file.js +20 -15
- package/file.js.map +1 -1
- package/net.browser.d.ts +73 -0
- package/net.browser.js +159 -1
- package/net.browser.js.map +1 -1
- package/net.d.ts +76 -0
- package/net.js +160 -1
- package/net.js.map +1 -1
- package/package.json +14 -12
- package/process.d.ts +5 -6
- package/process.js +59 -39
- package/process.js.map +1 -1
- package/prototype.browser.d.ts +3 -0
- package/prototype.browser.js +6 -0
- package/prototype.browser.js.map +1 -1
- package/prototype.d.ts +3 -0
- package/prototype.js +6 -0
- package/prototype.js.map +1 -1
- package/repl.d.ts +2 -2
- package/repl.js +27 -27
- package/repl.js.map +1 -1
- package/server.d.ts +1 -0
package/prototype.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prototype.js","sourceRoot":"","sources":["prototype.ts"],"names":[],"mappings":";;;;AAoOA,oDAAmB;AAEnB,0DAAwB;AACxB,kEAAiC;AAEjC,sEAAoC;AAEpC,oEAAmC;AACnC,0DAAyB;AAOhB,gBAPF,eAAK,CAOE;AALd,eAAK,CAAC,KAAK,GAAG,CAAC,CAAA;AAGF,QAAA,WAAW,GAAG,IAAA,qBAAU,GAAE,CAAA;AAIvC,SAAgB,8BAA8B,CAAE,OAAqC;IACjF,OAAO,MAAM,CAAC,WAAW,CACrB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;SAClB,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE;YAC5B,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,KAAK;YACjB,KAAK;SACc,CAAC,CAAC,CAC5B,CAAC,CAAA;AACV,CAAC;AAVD,wEAUC;AAGD,SAAgB,8BAA8B,CAAE,OAAqC;IACjF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,CAAC,MAAM,IAAI,SAAS,IAAI,SAAS,IAAI,MAAM,CAAC;YAE5C,6DAA6D;YAC7D,CAAC,MAAM,IAAI,SAAS,IAAI,SAAS,IAAI,MAAM,IAAI,SAAS,KAAK,MAAM,CAAC;YAEpE,wEAAwE;YACxE,CAAC,MAAM,IAAI,SAAS,IAAI,SAAS,IAAI,MAAM,CAAC;YAE5C,wCAAwC;YACxC,CAAC,MAAM,IAAI,SAAS,IAAI,SAAS,IAAI,MAAM,CAAC;YAE5C,yBAAyB;YACzB,CAAC,MAAM,IAAI,SAAS,IAAI,SAAS,IAAI,MAAM,CAAC;YAE5C,mBAAmB;YACnB,CAAC,MAAM,IAAI,SAAS,IAAI,SAAS,IAAI,MAAM,CAAC;YAE5C,+BAA+B;YAC/B,CAAC,MAAM,IAAI,SAAS,IAAI,SAAS,IAAI,MAAM,CAAC;YAE5C,iBAAiB;YACjB,CAAC,MAAM,IAAI,SAAS,IAAI,SAAS,IAAI,MAAM,CAAC;YAE5C,iDAAiD;YACjD,CAAC,MAAM,IAAI,SAAS,IAAI,SAAS,IAAI,MAAM,CAAC;YAE5C,gCAAgC;YAChC,CAAC,MAAM,IAAI,SAAS,IAAI,SAAS,IAAI,MAAM,CAAC;YAC5C,CAAC,MAAM,IAAI,SAAS,IAAI,SAAS,IAAI,MAAM,CAAC;YAE5C,kBAAkB;YAClB,CAAC,OAAO,IAAI,SAAS,IAAI,SAAS,IAAI,OAAO,CAAC;YAE9C,kCAAkC;YAClC,CAAC,OAAO,IAAI,SAAS,IAAI,SAAS,IAAI,OAAO,CAAC;YAE9C,mEAAmE;YACnE,CAAC,OAAO,IAAI,SAAS,IAAI,SAAS,IAAI,OAAO,CAAC,CACjD,CACJ,CAAA;AACL,CAAC;AAlED,wDAkEC","sourcesContent":["declare global {\n interface String {\n readonly width: number\n \n // --- util methods\n /** truncate string with fixed width and preserve color */\n truncate (this: string, width: number): string\n \n /** pad string to `<width>` \n - character?: `' '`\n - position?: `'right'`\n */\n pad (this: string, width: number, { character, position }?: { character?: string, position?: 'left' | 'right'}): string\n \n limit (this: string, width: number, { character, position }?: { character?: string, position?: 'left' | 'right'}): string\n \n to_regexp (this: string, preservations?: string, flags?: string): RegExp\n \n to_bool (this: string): boolean\n \n /** string pattern replacement\n - pattern: pattern of matched string part\n - pattern_: pattern of target string part\n - preservations?: `''` preserved regexp characters\n - flags?: `''` regexp flags\n - transformer?: `(name, matched) => matched || ''` placeholder transformer\n - pattern_placeholder?: `/\\{.*?\\}/g`\n \n ```ts\n 'g:/acgn/海贼王/[Skytree][海贼王][One_Piece][893][GB_BIG5_JP][X264_AAC][1080P][CRRIP][天空树双语字幕组].mkv'.reformat( \n '{dirp}/[Skytree][海贼王][{ en_name: \\\\w+ }][{ episode: \\\\d+ }][GB_BIG5_JP][{encoding}_AAC][1080P][CRRIP][天空树双语字幕组].{format}', \n 'g:/acgn/海贼王/{episode} {encoding}.{format}', \n '\\\\+', \n 'i', \n (name, value) => name === 'episode' ? String(+value + 1) : value.toLowerCase() \n )\n ```\n */\n refmt ( this: string,\n pattern: string,\n \n pattern_: string,\n \n preservations?: string,\n \n flags?: string,\n \n transformer?: (name: string, value: string, placeholders: { [name: string]: string }) => string,\n \n pattern_placeholder?: RegExp\n \n ): string\n \n \n /** string pattern match\n ```ts\n 'git+https://github.com/tamino-martinius/node-ts-dedent-123.git'.find(\n '^{protocol:[\\\\w+]+}://{hostname:[\\\\w\\\\.]+}/{username}/{project}-{index:\\\\d+}.{suffix}', '^', 'i'\n )\n {\n protocol: 'git+https',\n hostname: 'github.com',\n ...\n }\n ```\n \n - preservations?: `''` preserved regexp characters\n - flags?: `''` regexp flags\n - pattern_placeholder?: `/\\{.*?\\}/g`\n */\n find (this: string,\n \n pattern: string, \n \n preservations?: string, \n \n flags?: string, \n \n pattern_placeholder?: RegExp\n \n ): Record<string, string>\n \n \n /** - type?: `'single'` */\n quote (this: string, type?: keyof typeof quotes | 'psh'): string\n \n /** - shape?: `'parenthesis'` */\n bracket (this: string, shape?: keyof typeof brackets): string\n \n surround (this: string, left: string, right?: string): string\n \n surround_tag (this: string, tag_name: string): string\n \n to_lf (this: string): string\n \n to_crlf (this: string): string\n \n /** 'xxx'.replace(/pattern/g, '') \n if pattern is string then RegExp will add flags (default 'g'), else ignore flags\n */\n rm (this: string, pattern: string | RegExp, flags?: string): string\n \n \n // --- chalk colors\n readonly red: string\n readonly red_: string\n \n readonly green: string\n readonly green_: string\n \n readonly yellow: string\n readonly yellow_: string\n \n readonly blue: string\n readonly blue_: string\n \n readonly magenta: string\n readonly magenta_: string\n \n readonly cyan: string\n readonly cyan_: string\n \n readonly grey: string\n \n readonly underline: string\n \n strip_ansi (this: string): string\n \n \n // --- text processing\n /** split string to lines and strip last '' after last \\n */\n split_lines (this: string): string[]\n \n trim_doc_comment (this: string): string\n \n split_indent (this: string): { indent: number, text: string }\n \n \n to_base64 (this: string): string\n \n /** - buffer: `false` return raw Buffer */\n decode_base64 (this: string): string\n decode_base64 (this: string, buffer: true): Buffer\n decode_base64 (this: string, buffer?: boolean): string | Buffer\n \n \n space (this: string): string\n \n \n // --- path ops\n fdir: string\n \n /** path.basename, e.g. \n - D:/0/aaa.txt -> aaa.txt\n - D:/aaa/ -> aaa\n */\n fname: string\n \n /** .txt */\n fext: string\n \n /** fs.existsSync */\n fexists: boolean\n \n is_dir: boolean\n \n to_slash (this: string): string\n \n to_backslash (this: string): string\n }\n \n \n interface Date {\n /** - ms?: `false` show ms */\n to_str (this: Date, ms?: boolean): string\n \n to_date_str (this: Date): string\n \n /** - ms?: `false` show ms */\n to_time_str (this: Date, ms?: boolean): string\n }\n \n \n interface Number {\n /** 12.4 KB (1 KB = 1024 B) */\n to_fsize_str (this: number, units?: 'iec' | 'metric'): string\n \n \n to_bin_str (this: number): string\n \n to_hex_str (this: number, length?: number): string\n \n to_oct_str (this: number): string\n }\n \n \n interface Array<T> {\n last: T\n \n log (this: string[], limit?: number): void\n \n indent (this: string[], width: number, c?: string): string[]\n \n indent2to4 (this: string[]): string[]\n \n \n // --- text processing\n /**\n - trim_line?: `true`\n - rm_empty_lines?: `true`\n - rm_last_empty_lines?: `false`\n */\n trim_lines (this: string[], { trim_line, rm_empty_lines, rm_last_empty_lines }?: { trim_line?: boolean, rm_empty_lines?: boolean, rm_last_empty_lines?: boolean }): string[]\n \n trim_license (this: string[]): string[]\n \n split_indents (this: string[]): { indent: number, text: string }[]\n \n join_lines (): string\n }\n \n \n interface BigInt {\n toJSON (this: bigint): string\n }\n}\n\n\nimport fs from 'fs'\n\nimport path from 'upath'\nimport byte_size from 'byte-size'\n\nimport EmojiRegex from 'emoji-regex'\n\nimport strip_ansi from 'strip-ansi'\nimport chalk from 'chalk'\n\nchalk.level = 2\n\n\nexport const emoji_regex = EmojiRegex()\n\nexport { chalk }\n\nexport function to_method_property_descriptors (methods: { [name: string]: Function }): PropertyDescriptorMap {\n return Object.fromEntries(\n Object.entries(methods)\n .map(([name, value]) => ([name, {\n configurable: true,\n writable: true,\n enumerable: false,\n value,\n } as PropertyDescriptor])\n ))\n}\n\n\nexport function to_getter_property_descriptors (getters: { [name: string]: Function }): PropertyDescriptorMap {\n return Object.fromEntries(\n Object.entries(getters)\n .map(([name, get]) => ([name, {\n configurable: true,\n enumerable: false,\n get,\n } as PropertyDescriptor])\n ))\n}\n\n\nexport const cjk = '([\\u2e80-\\u9fff\\uf900-\\ufaff])'\n\nexport const quotes = {\n single: \"'\",\n double: '\"',\n backtick: '`',\n}\n\nexport const brackets = {\n round: ['(', ')'],\n square: ['[', ']'],\n curly: ['{', '}'],\n pointy: ['<', '>'],\n corner: ['「', '」'],\n fat: ['【', '】'],\n tortoise_shell: ['〔', '〕'],\n} as const\n\nconst color_map = Object.fromEntries(\n ['red_', 'green_', 'yellow_', 'blue_', 'magenta_', 'cyan_'].map(color =>\n [color, `${color.slice(0, -1)}Bright`])\n)\n\n// ------------------------------------ String.prototype\nObject.defineProperties(String.prototype, {\n ... to_getter_property_descriptors({\n width (this: string) {\n const s = strip_ansi(\n this.replace(emoji_regex, ' ')\n )\n let width = 0\n for (let i = 0; i < s.length; i++) {\n const code = s.codePointAt(i)\n \n if (\n (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) || // ignore control characters\n code >= 0x300 && code <= 0x36f // ignore combining characters\n ) continue\n \n // surrogates\n if (code > 0xffff)\n i++\n \n width += is_codepoint_fullwidth(code) ? 2 : 1\n }\n return width\n }\n }),\n \n \n // ------------ text processing utils\n ... to_method_property_descriptors({\n /** truncate string with fixed width and preserve color */\n truncate (this: string, width: number) {\n const color_bak = this.startsWith('\\u001b') ? this.slice(0, 5) : ''\n const s = strip_ansi(this)\n if (width <= 2) return this.slice(0, width)\n let i_fitted = 0\n let fitted_width = 0\n let cur_width = 0\n for (let i = 0; i < s.length; i++) {\n const code = s.codePointAt(i)\n \n if (\n (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) || // Ignore control characters\n code >= 0x300 && code <= 0x36F // Ignore combining characters\n ) continue\n \n // surrogates (codepoint need two utf-16 encoding units, thus here skip the first in order to prevent repeated counting) \n if (code > 0xFFFF)\n i++\n \n const w = is_codepoint_fullwidth(code) ? 2 : 1\n \n if (cur_width + w + 2 <= width) {\n i_fitted = i\n fitted_width += w\n }\n \n cur_width += w\n \n if (cur_width > width) {\n const i_fitted_next = i_fitted + 1\n const t = s.slice(0, i_fitted_next) + ' '.repeat(width - 2 - fitted_width) + '…' \n return color_bak ? color_bak + t + '\\u001b[39m' : t\n }\n }\n return this\n },\n \n \n pad (this: string, width: number, { character = ' ', position = 'right' }: { character?: string, position?: 'left' | 'right'} = { }) {\n const _width = this.width\n if (_width >= width) return this\n if (position === 'right') return this + character.repeat( (width - _width) / character.width )\n return character.repeat(width - _width) + this\n },\n \n \n limit (this: string, width: number, { character = ' ', position = 'right' }: { character?: string, position?: 'left' | 'right'} = { }) {\n return this.pad(width, { character, position }).truncate(width)\n },\n \n \n to_regexp (this: string, preservations: string, flags = ''): RegExp {\n const preserved_chars = new Set(preservations)\n const replace_chars: string = Array.prototype.filter.call('|\\\\{}()[]^$+*?.-', (c: string) => !preserved_chars.has(c))\n .map((c: string) =>\n c === ']' ? '\\\\]' : c\n ).join('')\n \n return new RegExp(\n this.replace(\n new RegExp(`[${replace_chars}]`, 'g'),\n '\\\\$&'\n ), \n flags\n )\n },\n \n \n to_bool (this: string) {\n return this.length && this !== '0' && this.toLowerCase() !== 'false'\n },\n \n refmt (this: string, \n pattern : string,\n pattern_: string,\n preservations: string = '',\n flags = '',\n transformer: (name: string, value: string, placeholders: { [name: string]: string }) => string = (name, value) => value || '',\n pattern_placeholder = /\\{.*?\\}/g,\n ): string {\n // --- convert pattern to pattern_regx\n let last_end = 0\n \n // placeholder matched group indexes\n let $placeholders: Record<string, number> = { }\n \n let regx_parts = [ ]\n \n function add_part (left: number, right?: number) {\n const part = pattern.slice(left, right)\n if (part)\n regx_parts.push(\n part.to_regexp(preservations).source.bracket()\n )\n }\n \n pattern.replace(pattern_placeholder, ($0, offset) => {\n add_part(last_end, offset)\n last_end = offset + $0.length\n \n const placeholder = $0.slice(1, -1)\n let [placeholder_name, placeholder_pattern] = placeholder.split(':').map(s => s.trim())\n let optional = false\n if (placeholder_name.endsWith('?')) {\n placeholder_name = placeholder_name.slice(0, -1)\n optional = true\n }\n $placeholders[placeholder_name] = regx_parts.push(\n placeholder_pattern ? \n `${placeholder_pattern.bracket()}${optional ? '?' : ''}`\n :\n '(.*?)'\n )\n return ''\n })\n \n add_part(last_end)\n \n // modify last (.*?) to greedy in order to satisfy the situation of .{suffix}\n regx_parts = regx_parts.filter(part => part)\n if (regx_parts.last === '(.*?)')\n regx_parts[regx_parts.length - 1] = '(.*)'\n \n const pattern_regx = new RegExp(regx_parts.join(''), flags)\n \n \n // --- match original string based on pattern_regx, and get result to build placeholders dict\n const matches = pattern_regx.exec(this)\n \n if (!matches) return this\n \n const placeholders = Object.fromEntries(\n Object.entries($placeholders)\n .map(([name, $i]) => [\n [name, matches[$i]],\n [`${name}.before`, matches[$i - 1] || ''],\n [`${name}.after`, matches[$i + 1] || ''],\n ])\n .flat()\n )\n \n \n // --- convert pattern_ to replacement_str, if transformer exists then apply on placeholder\n last_end = 0\n let replacement_parts = [ ]\n \n pattern_.replace(pattern_placeholder, ($0, offset) => {\n replacement_parts.push(\n pattern_.slice(last_end, offset)\n )\n last_end = offset + $0.length\n \n const placeholder_name = $0.slice(1, -1)\n \n replacement_parts.push(\n transformer(placeholder_name, placeholders[placeholder_name], placeholders)\n )\n \n return ''\n })\n replacement_parts.push(\n pattern_.slice(last_end)\n )\n \n return this.replace(pattern_regx, replacement_parts.join(''))\n },\n \n \n find (this: string,\n pattern: string, \n preservations: string = '', \n flags = '', \n pattern_placeholder = /\\{.*?\\}/g\n ): Record<string, string> {\n // --- convert pattern to pattern_regx\n let last_end = 0\n \n // placeholder matched group index\n let $placeholders: Record<string, number> = { }\n \n let regx_parts = [ ]\n \n function add_part (left: number, right?: number) {\n const part = pattern.slice(left, right)\n if (part)\n regx_parts.push(\n part.to_regexp(preservations).source.bracket()\n )\n }\n \n pattern.replace(pattern_placeholder, ($0, offset) => {\n add_part(last_end, offset)\n last_end = offset + $0.length\n \n const placeholder = $0.slice(1, -1)\n let [placeholder_name, placeholder_pattern] = placeholder.split(':').map(s => s.trim())\n let optional = false\n if (placeholder_name.endsWith('?')) {\n placeholder_name = placeholder_name.slice(0, -1)\n optional = true\n }\n \n $placeholders[placeholder_name] = regx_parts.push(\n placeholder_pattern ? \n `${placeholder_pattern.bracket()}${optional ? '?' : ''}`\n :\n '(.*?)'\n )\n return ''\n })\n \n add_part(last_end)\n \n // convert last (.*?) to greedy, to make .{suffix} work\n regx_parts = regx_parts.filter(part => part)\n if (regx_parts[regx_parts.length - 1] === '(.*?)')\n regx_parts[regx_parts.length - 1] = '(.*)'\n \n const pattern_regx = new RegExp(regx_parts.join(''), flags)\n \n \n // --- match original string based on pattern_regx, and get result to build placeholders dict\n const matches = pattern_regx.exec(this)\n \n if (!matches) return { }\n \n return Object.fromEntries(\n Object.entries($placeholders)\n .map(([name, $i]) => \n [name, matches[$i] || '']\n )\n )\n },\n \n quote (this: string, type: keyof typeof quotes | 'psh' = 'single') {\n if (type === 'psh')\n return `& ${this.quote()}`\n return this.surround(quotes[type])\n },\n \n \n bracket (this: string, shape: keyof typeof brackets = 'round') {\n return this.surround(...brackets[shape] as [string, string])\n },\n \n \n surround (this: string, left: string, right?: string) {\n return left + this + (right || left)\n },\n \n surround_tag (this: string, tag_name: string): string {\n return '<' + tag_name + '>' + this + '</' + tag_name + '>'\n },\n \n \n to_lf (this: string) {\n return this.replace(/\\r\\n/g, '\\n')\n },\n \n \n to_crlf (this: string) {\n return this.replace(/\\n/g, '\\r\\n')\n },\n \n \n rm (this: string, pattern: string | RegExp, flags: string = 'g') {\n if (typeof pattern === 'string')\n pattern = new RegExp(pattern, flags)\n \n return this.replace(pattern, '')\n },\n \n \n split_lines (this: string, delimiter: string | RegExp = /\\r?\\n/) {\n let lines = this.split(delimiter)\n if (lines.last === '')\n lines.pop()\n return lines\n },\n \n \n split_indent (this: string): { indent: number, text: string } {\n let i = 0\n let indent = 0\n for (; i < this.length; i++)\n if (this[i] === ' ')\n indent += 1\n else if (this[i] === '\\t')\n indent += 4\n else\n break\n \n return {\n indent,\n text: this.slice(i)\n }\n },\n \n \n trim_doc_comment (this: string) {\n return `/** ${this.slice(3, -2).replace(/\\s*\\*\\s*/g, ' ').replace(/@(param|params|return) \\{.*?\\}\\s*/g, '').trim()} */`\n },\n \n \n to_base64 (this: string) {\n return Buffer.from(this).toString('base64')\n },\n \n \n decode_base64 (this: string, buffer = false) {\n const buf = Buffer.from(this, 'base64')\n if (buffer)\n return buf\n return buf.toString()\n },\n \n \n strip_ansi (this: string) {\n return strip_ansi(this)\n },\n \n \n space (this: string) {\n if (!this) return this\n let text_: string\n text_ = this\n .replace(new RegExp(cjk + `(['\"])`, 'g'), '$1 $2')\n .replace(new RegExp(`(['\"])` + cjk, 'g'), '$1 $2')\n \n .replace(/([\"']+)\\s*(.+?)\\s*([\"']+)/g, '$1$2$3')\n \n .replace(new RegExp(cjk + '([\\\\+\\\\-\\\\*\\\\/=&\\\\\\\\\\\\|<>])([A-Za-z0-9])', 'g'), '$1 $2 $3')\n .replace(new RegExp('([A-Za-z0-9])([\\\\+\\\\-\\\\*\\\\/=&\\\\\\\\\\\\|<>])' + cjk, 'g'), '$1 $2 $3')\n \n const text_bak = text_\n \n text_ = text_.replace(new RegExp(cjk + '([\\\\(\\\\[\\\\{<\\u201c]+(.*?)[\\\\)\\\\]\\\\}>\\u201d]+)' + cjk, 'g'), '$1 $2 $4')\n \n if (text_ === text_bak)\n text_ = text_\n .replace(new RegExp(cjk + '([\\\\(\\\\[\\\\{<\\u201c>])', 'g'), '$1 $2')\n .replace(new RegExp('([\\\\)\\\\]\\\\}>\\u201d<])' + cjk, 'g'), '$1 $2')\n \n return text_\n .replace(/([\\(\\[\\{<\\u201c]+)(\\s*)(.+?)(\\s*)([\\)\\]\\}>\\u201d]+)/g, '$1$3$5')\n .replace(new RegExp(cjk + '([~!;:,\\\\.\\\\?\\u2026])([A-Za-z0-9])', 'g'), '$1$2 $3')\n .replace(new RegExp(cjk + '([A-Za-z0-9`\\\\$%\\\\^&\\\\*\\\\-=\\\\+\\\\\\\\\\\\|\\\\/@\\u00a1-\\u00ff\\u2022\\u2027\\u2150-\\u218f])', 'g'), '$1 $2')\n .replace(new RegExp('([A-Za-z0-9`\\\\$%\\\\^&\\\\*\\\\-=\\\\+\\\\\\\\\\\\|\\\\/@\\u00a1-\\u00ff\\u2022\\u2027\\u2150-\\u218f])' + cjk, 'g'), '$1 $2')\n }\n }),\n \n \n // ------------ chalk colors\n ... Object.fromEntries(\n [\n 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'grey', \n 'red_', 'green_', 'yellow_', 'blue_', 'magenta_', 'cyan_',\n 'underline',\n ].map(color =>\n ([color, {\n configurable: true,\n get (this: string) {\n return chalk[color_map[color] || color](this)\n }\n }]))\n ),\n \n \n // ------------ file path ops\n ... to_getter_property_descriptors({\n fdir (this: string) {\n const dir = path.dirname(this)\n return dir.endsWith('/') ? dir : `${dir}/`\n },\n \n fname (this: string) {\n return path.basename(this)\n },\n \n fext (this: string) {\n return path.extname(this)\n },\n \n fexists (this: string) {\n return fs.existsSync(this)\n },\n \n is_dir (this: string) {\n if (this.endsWith('/')) return true\n try {\n return fs.lstatSync(this).isDirectory()\n } catch (error) {\n return false\n }\n },\n }),\n \n ... to_method_property_descriptors({\n to_slash (this: string) {\n if (!this)\n return this\n return path.normalizeSafe(this)\n },\n \n to_backslash (this: string) {\n return this.replaceAll('/', '\\\\')\n },\n })\n})\n\n\n// ------------------------------------ Date.prototype\nObject.defineProperties(Date.prototype, to_method_property_descriptors({\n to_str (this: Date, ms?: boolean) {\n const [ampm, hour] = (() => {\n let hour = this.getHours()\n if (hour <= 6)\n return ['凌晨', hour]\n \n if (hour <= 8)\n return ['清晨', hour]\n \n if (hour <= 9)\n return ['早上', hour]\n \n if (hour <= 10)\n return ['上午', hour]\n \n if (hour <= 12)\n return ['中午', hour]\n \n hour -= 12\n \n if (hour <= 5)\n return ['下午', hour]\n \n if (hour <= 10)\n return ['晚上', hour]\n \n return ['深夜', hour]\n })()\n \n const zero_padding = { character: '0', position: 'left' } as const\n \n return '' +\n // year.month.date\n this.getFullYear() + '.' + \n String(this.getMonth() + 1).pad(2, zero_padding) + '.' + \n String(this.getDate()).pad(2, zero_padding) + ' ' +\n \n // 上午\n ampm + ' ' +\n \n // 10:03:02\n String(hour).pad(2, zero_padding) + ':' +\n String(this.getMinutes()).pad(2, zero_padding) + ':' +\n String(this.getSeconds()).pad(2, zero_padding) + \n \n (ms ?\n '.' + String(this.getMilliseconds()).pad(3, zero_padding)\n :\n ''\n )\n },\n \n to_date_str (this: Date) {\n return this.to_str().split(' ')[0]\n },\n \n to_time_str (this: Date, ms?: boolean) {\n const [, ampm, time ] = this.to_str(ms).split(' ')\n return `${ampm} ${time}`\n },\n}))\n\n\n\n// ------------------------------------ Number.prototype\nObject.defineProperties(Number.prototype, to_method_property_descriptors({\n to_fsize_str (this: number, units: 'iec' | 'metric' = 'iec') {\n const { value, unit } = byte_size(this, { units })\n return `${value} ${unit.replace('i', '')}`\n },\n \n to_bin_str (this: number) {\n return `0b${this.toString(2)}`\n },\n \n to_hex_str (this: number, length?: number) {\n const s = this.toString(16)\n if (!length)\n length = Math.ceil(s.length / 4) * 4\n return `0x${'0'.repeat(length - s.length)}${s}`\n },\n \n to_oct_str (this: number) {\n return `0o${this.toString(8)}`\n },\n}))\n\n\n\n// ------------------------------------ Array.prototype\nObject.defineProperties(Array.prototype, {\n ... to_getter_property_descriptors({\n last (this: any[]) {\n return this[this.length - 1]\n }\n }),\n \n \n // --- text processing methods\n ... to_method_property_descriptors({\n log (this: string[], limit: number = 10000) {\n const text = this.join('\\n') + '\\n'\n if (limit === -1 || this.length <= limit)\n console.log(text)\n else if (limit > 0)\n console.log(text.slice(0, limit) + '\\n...'.blue)\n else \n console.log('...\\n'.blue + text.slice(limit))\n },\n \n trim_lines (this: string[], { trim_line = true, rm_empty_lines = true, rm_last_empty_lines = false }: { trim_line?: boolean, rm_empty_lines?: boolean, rm_last_empty_lines?: boolean } = { }) {\n if (!this.length)\n return this\n let lines = this\n \n if (trim_line)\n lines = lines.map(line => line.trim() )\n \n if (rm_empty_lines)\n return lines.filter( line => line )\n \n if (rm_last_empty_lines) {\n lines.reverse()\n const i_not_empty = lines.findIndex( line => line )\n if (i_not_empty !== -1)\n lines = lines.slice(i_not_empty)\n lines.reverse()\n return lines\n }\n \n return lines\n },\n \n \n trim_license (this: string[]) {\n const i = this.indexOf('/*')\n const j = this.indexOf('*/')\n if (i === 0 && this[i+1].includes('License'))\n return this.slice(j+1)\n else\n return this\n },\n \n split_indents (this: string[]): { indent: number, text: string }[] {\n return this.map(line => \n line.split_indent()\n )\n },\n \n indent (this: string[], width?: number, character: string = ' ') {\n return this.map(line => \n character.repeat(width) + line\n )\n },\n \n indent2to4 (this: string[]) {\n return this.split_indents()\n .map(line => \n ' '.repeat(\n Math.floor(line.indent / 2) * 4\n ) + line.text\n )\n },\n \n join_lines (this: string[], append = true) {\n return `${this.join('\\n')}${append ? '\\n' : ''}`\n }\n })\n})\n\n\nObject.defineProperties(BigInt.prototype, to_method_property_descriptors({\n toJSON (this: bigint) {\n return this.toString()\n }\n}))\n\n\nexport function to_json (obj: any, replacer?: any) {\n return JSON.stringify(obj, replacer, 4) + '\\n'\n}\n\nexport function to_json_safely (obj: any, replacer?: any) {\n return to_json(obj, replacer)\n .replace(/\\u2028/g, '\\\\u2028')\n .replace(/\\u2029/g, '\\\\u2029')\n .replace(/<\\/script>/g, '<\\\\/script>')\n}\n\n\nexport function is_codepoint_fullwidth (codepoint: number) {\n // code points are derived from:\n // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt\n return (\n !Number.isNaN(codepoint) &&\n codepoint >= 0x1100 &&\n (\n codepoint <= 0x115f || // hangul jamo\n \n codepoint === 0x201c || codepoint === 0x201d || // \n codepoint === 0x2026 || // …\n codepoint === 0x203b || // ※\n \n // arrows\n (0x2190 <= codepoint && codepoint <= 0x21FF) ||\n \n codepoint === 0x2329 || // left-pointing angle bracket\n codepoint === 0x232a || // right-pointing angle bracket\n \n // ①\n (0x2460 <= codepoint && codepoint <= 0x24ff) ||\n \n // box drawing\n (0x2500 <= codepoint && codepoint <= 0x257f) ||\n \n // shapes, symbols, …\n (0x2580 <= codepoint && codepoint <= 0x2bef) ||\n \n // cjk radicals supplement .. enclosed cjk letters and months\n (0x2e80 <= codepoint && codepoint <= 0x3247 && codepoint !== 0x303f) ||\n \n // enclosed cjk letters and months .. cjk unified ideographs extension a\n (0x3250 <= codepoint && codepoint <= 0x4dbf) ||\n \n // cjk unified ideographs .. yi radicals\n (0x4E00 <= codepoint && codepoint <= 0xA4C6) ||\n \n // hangul jamo extended-a\n (0xa960 <= codepoint && codepoint <= 0xa97c) ||\n \n // hangul syllables\n (0xac00 <= codepoint && codepoint <= 0xd7a3) ||\n \n // cjk compatibility ideographs\n (0xf900 <= codepoint && codepoint <= 0xfaff) ||\n \n // vertical forms\n (0xfe10 <= codepoint && codepoint <= 0xfe19) ||\n \n // cjk compatibility forms .. small form variants\n (0xfe30 <= codepoint && codepoint <= 0xfe6b) ||\n \n // halfwidth and fullwidth forms\n (0xff01 <= codepoint && codepoint <= 0xff60) ||\n (0xffe0 <= codepoint && codepoint <= 0xffe6) ||\n \n // kana supplement\n (0x1b000 <= codepoint && codepoint <= 0x1b001) ||\n \n // enclosed ideographic supplement\n (0x1f200 <= codepoint && codepoint <= 0x1f251) ||\n \n // cjk unified ideographs extension b .. tertiary ideographic plane\n (0x20000 <= codepoint && codepoint <= 0x3fffd)\n )\n )\n}\n"]}
|
|
1
|
+
{"version":3,"file":"prototype.js","sourceRoot":"","sources":["prototype.ts"],"names":[],"mappings":";;;;AAyOA,oDAAmB;AAEnB,0DAAwB;AACxB,kEAAiC;AAEjC,sEAAoC;AAEpC,oEAAmC;AACnC,0DAAyB;AAOhB,gBAPF,eAAK,CAOE;AALd,eAAK,CAAC,KAAK,GAAG,CAAC,CAAA;AAGF,QAAA,WAAW,GAAG,IAAA,qBAAU,GAAE,CAAA;AAIvC,SAAgB,8BAA8B,CAAE,OAAqC;IACjF,OAAO,MAAM,CAAC,WAAW,CACrB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;SAClB,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE;YAC5B,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,KAAK;YACjB,KAAK;SACc,CAAC,CAAC,CAC5B,CAAC,CAAA;AACV,CAAC;AAVD,wEAUC;AAGD,SAAgB,8BAA8B,CAAE,OAAqC;IACjF,OAAO,MAAM,CAAC,WAAW,CACrB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;SAClB,GAAG,CAAC,CAAC,CAAC,IAAI,E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AAI,OAAO,CAAC,CACjD,CACJ,CAAA;AACL,CAAC;AAlED,wDAkEC","sourcesContent":["declare global {\n interface String {\n readonly width: number\n \n // --- util methods\n /** truncate string with fixed width and preserve color */\n truncate (this: string, width: number): string\n \n /** pad string to `<width>` \n - character?: `' '`\n - position?: `'right'`\n */\n pad (this: string, width: number, { character, position }?: { character?: string, position?: 'left' | 'right'}): string\n \n limit (this: string, width: number, { character, position }?: { character?: string, position?: 'left' | 'right'}): string\n \n to_regexp (this: string, preservations?: string, flags?: string): RegExp\n \n to_bool (this: string): boolean\n \n /** string pattern replacement\n - pattern: pattern of matched string part\n - pattern_: pattern of target string part\n - preservations?: `''` preserved regexp characters\n - flags?: `''` regexp flags\n - transformer?: `(name, matched) => matched || ''` placeholder transformer\n - pattern_placeholder?: `/\\{.*?\\}/g`\n \n ```ts\n 'g:/acgn/海贼王/[Skytree][海贼王][One_Piece][893][GB_BIG5_JP][X264_AAC][1080P][CRRIP][天空树双语字幕组].mkv'.reformat( \n '{dirp}/[Skytree][海贼王][{ en_name: \\\\w+ }][{ episode: \\\\d+ }][GB_BIG5_JP][{encoding}_AAC][1080P][CRRIP][天空树双语字幕组].{format}', \n 'g:/acgn/海贼王/{episode} {encoding}.{format}', \n '\\\\+', \n 'i', \n (name, value) => name === 'episode' ? String(+value + 1) : value.toLowerCase() \n )\n ```\n */\n refmt ( this: string,\n pattern: string,\n \n pattern_: string,\n \n preservations?: string,\n \n flags?: string,\n \n transformer?: (name: string, value: string, placeholders: { [name: string]: string }) => string,\n \n pattern_placeholder?: RegExp\n \n ): string\n \n \n /** string pattern match\n ```ts\n 'git+https://github.com/tamino-martinius/node-ts-dedent-123.git'.find(\n '^{protocol:[\\\\w+]+}://{hostname:[\\\\w\\\\.]+}/{username}/{project}-{index:\\\\d+}.{suffix}', '^', 'i'\n )\n {\n protocol: 'git+https',\n hostname: 'github.com',\n ...\n }\n ```\n \n - preservations?: `''` preserved regexp characters\n - flags?: `''` regexp flags\n - pattern_placeholder?: `/\\{.*?\\}/g`\n */\n find (this: string,\n \n pattern: string, \n \n preservations?: string, \n \n flags?: string, \n \n pattern_placeholder?: RegExp\n \n ): Record<string, string>\n \n \n /** - type?: `'single'` */\n quote (this: string, type?: keyof typeof quotes | 'psh'): string\n \n /** - shape?: `'parenthesis'` */\n bracket (this: string, shape?: keyof typeof brackets): string\n \n surround (this: string, left: string, right?: string): string\n \n surround_tag (this: string, tag_name: string): string\n \n to_lf (this: string): string\n \n to_crlf (this: string): string\n \n /** 'xxx'.replace(/pattern/g, '') \n if pattern is string then RegExp will add flags (default 'g'), else ignore flags\n */\n rm (this: string, pattern: string | RegExp, flags?: string): string\n \n \n // --- chalk colors\n readonly red: string\n readonly red_: string\n \n readonly green: string\n readonly green_: string\n \n readonly yellow: string\n readonly yellow_: string\n \n readonly blue: string\n readonly blue_: string\n \n readonly magenta: string\n readonly magenta_: string\n \n readonly cyan: string\n readonly cyan_: string\n \n readonly grey: string\n \n readonly underline: string\n \n strip_ansi (this: string): string\n \n \n // --- text processing\n /** split string to lines and strip last '' after last \\n */\n split_lines (this: string): string[]\n \n trim_doc_comment (this: string): string\n \n split_indent (this: string): { indent: number, text: string }\n \n \n to_base64 (this: string): string\n \n /** - buffer: `false` return raw Buffer */\n decode_base64 (this: string): string\n decode_base64 (this: string, buffer: true): Buffer\n decode_base64 (this: string, buffer?: boolean): string | Buffer\n \n \n space (this: string): string\n \n \n // --- path ops\n fdir: string\n \n /** path.basename, e.g. \n - D:/0/aaa.txt -> aaa.txt\n - D:/aaa/ -> aaa\n */\n fname: string\n \n /** .txt */\n fext: string\n \n /** fs.existsSync */\n fexists: boolean\n \n is_dir: boolean\n \n to_slash (this: string): string\n \n to_backslash (this: string): string\n }\n \n \n interface Date {\n /** - ms?: `false` show ms */\n to_str (this: Date, ms?: boolean): string\n \n to_date_str (this: Date): string\n \n /** - ms?: `false` show ms */\n to_time_str (this: Date, ms?: boolean): string\n }\n \n \n interface Number {\n /** 12.4 KB (1 KB = 1024 B) */\n to_fsize_str (this: number, units?: 'iec' | 'metric'): string\n \n \n to_bin_str (this: number): string\n \n to_hex_str (this: number, length?: number): string\n \n to_oct_str (this: number): string\n }\n \n \n interface Array<T> {\n last: T\n \n log (this: string[], limit?: number): void\n \n indent (this: string[], width: number, c?: string): string[]\n \n indent2to4 (this: string[]): string[]\n \n \n // --- text processing\n /**\n - trim_line?: `true`\n - rm_empty_lines?: `true`\n - rm_last_empty_lines?: `false`\n */\n trim_lines (this: string[], { trim_line, rm_empty_lines, rm_last_empty_lines }?: { trim_line?: boolean, rm_empty_lines?: boolean, rm_last_empty_lines?: boolean }): string[]\n \n trim_license (this: string[]): string[]\n \n split_indents (this: string[]): { indent: number, text: string }[]\n \n join_lines (): string\n }\n \n \n interface BigInt {\n toJSON (this: bigint): string\n }\n \n \n interface Error {\n toJSON (this: Error): string\n }\n}\n\n\nimport fs from 'fs'\n\nimport path from 'upath'\nimport byte_size from 'byte-size'\n\nimport EmojiRegex from 'emoji-regex'\n\nimport strip_ansi from 'strip-ansi'\nimport chalk from 'chalk'\n\nchalk.level = 2\n\n\nexport const emoji_regex = EmojiRegex()\n\nexport { chalk }\n\nexport function to_method_property_descriptors (methods: { [name: string]: Function }): PropertyDescriptorMap {\n return Object.fromEntries(\n Object.entries(methods)\n .map(([name, value]) => ([name, {\n configurable: true,\n writable: true,\n enumerable: false,\n value,\n } as PropertyDescriptor])\n ))\n}\n\n\nexport function to_getter_property_descriptors (getters: { [name: string]: Function }): PropertyDescriptorMap {\n return Object.fromEntries(\n Object.entries(getters)\n .map(([name, get]) => ([name, {\n configurable: true,\n enumerable: false,\n get,\n } as PropertyDescriptor])\n ))\n}\n\n\nexport const cjk = '([\\u2e80-\\u9fff\\uf900-\\ufaff])'\n\nexport const quotes = {\n single: \"'\",\n double: '\"',\n backtick: '`',\n}\n\nexport const brackets = {\n round: ['(', ')'],\n square: ['[', ']'],\n curly: ['{', '}'],\n pointy: ['<', '>'],\n corner: ['「', '」'],\n fat: ['【', '】'],\n tortoise_shell: ['〔', '〕'],\n} as const\n\nconst color_map = Object.fromEntries(\n ['red_', 'green_', 'yellow_', 'blue_', 'magenta_', 'cyan_'].map(color =>\n [color, `${color.slice(0, -1)}Bright`])\n)\n\n// ------------------------------------ String.prototype\nObject.defineProperties(String.prototype, {\n ... to_getter_property_descriptors({\n width (this: string) {\n const s = strip_ansi(\n this.replace(emoji_regex, ' ')\n )\n let width = 0\n for (let i = 0; i < s.length; i++) {\n const code = s.codePointAt(i)\n \n if (\n (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) || // ignore control characters\n code >= 0x300 && code <= 0x36f // ignore combining characters\n ) continue\n \n // surrogates\n if (code > 0xffff)\n i++\n \n width += is_codepoint_fullwidth(code) ? 2 : 1\n }\n return width\n }\n }),\n \n \n // ------------ text processing utils\n ... to_method_property_descriptors({\n /** truncate string with fixed width and preserve color */\n truncate (this: string, width: number) {\n const color_bak = this.startsWith('\\u001b') ? this.slice(0, 5) : ''\n const s = strip_ansi(this)\n if (width <= 2) return this.slice(0, width)\n let i_fitted = 0\n let fitted_width = 0\n let cur_width = 0\n for (let i = 0; i < s.length; i++) {\n const code = s.codePointAt(i)\n \n if (\n (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) || // Ignore control characters\n code >= 0x300 && code <= 0x36F // Ignore combining characters\n ) continue\n \n // surrogates (codepoint need two utf-16 encoding units, thus here skip the first in order to prevent repeated counting) \n if (code > 0xFFFF)\n i++\n \n const w = is_codepoint_fullwidth(code) ? 2 : 1\n \n if (cur_width + w + 2 <= width) {\n i_fitted = i\n fitted_width += w\n }\n \n cur_width += w\n \n if (cur_width > width) {\n const i_fitted_next = i_fitted + 1\n const t = s.slice(0, i_fitted_next) + ' '.repeat(width - 2 - fitted_width) + '…' \n return color_bak ? color_bak + t + '\\u001b[39m' : t\n }\n }\n return this\n },\n \n \n pad (this: string, width: number, { character = ' ', position = 'right' }: { character?: string, position?: 'left' | 'right'} = { }) {\n const _width = this.width\n if (_width >= width) return this\n if (position === 'right') return this + character.repeat( (width - _width) / character.width )\n return character.repeat(width - _width) + this\n },\n \n \n limit (this: string, width: number, { character = ' ', position = 'right' }: { character?: string, position?: 'left' | 'right'} = { }) {\n return this.pad(width, { character, position }).truncate(width)\n },\n \n \n to_regexp (this: string, preservations: string, flags = ''): RegExp {\n const preserved_chars = new Set(preservations)\n const replace_chars: string = Array.prototype.filter.call('|\\\\{}()[]^$+*?.-', (c: string) => !preserved_chars.has(c))\n .map((c: string) =>\n c === ']' ? '\\\\]' : c\n ).join('')\n \n return new RegExp(\n this.replace(\n new RegExp(`[${replace_chars}]`, 'g'),\n '\\\\$&'\n ), \n flags\n )\n },\n \n \n to_bool (this: string) {\n return this.length && this !== '0' && this.toLowerCase() !== 'false'\n },\n \n refmt (this: string, \n pattern : string,\n pattern_: string,\n preservations: string = '',\n flags = '',\n transformer: (name: string, value: string, placeholders: { [name: string]: string }) => string = (name, value) => value || '',\n pattern_placeholder = /\\{.*?\\}/g,\n ): string {\n // --- convert pattern to pattern_regx\n let last_end = 0\n \n // placeholder matched group indexes\n let $placeholders: Record<string, number> = { }\n \n let regx_parts = [ ]\n \n function add_part (left: number, right?: number) {\n const part = pattern.slice(left, right)\n if (part)\n regx_parts.push(\n part.to_regexp(preservations).source.bracket()\n )\n }\n \n pattern.replace(pattern_placeholder, ($0, offset) => {\n add_part(last_end, offset)\n last_end = offset + $0.length\n \n const placeholder = $0.slice(1, -1)\n let [placeholder_name, placeholder_pattern] = placeholder.split(':').map(s => s.trim())\n let optional = false\n if (placeholder_name.endsWith('?')) {\n placeholder_name = placeholder_name.slice(0, -1)\n optional = true\n }\n $placeholders[placeholder_name] = regx_parts.push(\n placeholder_pattern ? \n `${placeholder_pattern.bracket()}${optional ? '?' : ''}`\n :\n '(.*?)'\n )\n return ''\n })\n \n add_part(last_end)\n \n // modify last (.*?) to greedy in order to satisfy the situation of .{suffix}\n regx_parts = regx_parts.filter(part => part)\n if (regx_parts.last === '(.*?)')\n regx_parts[regx_parts.length - 1] = '(.*)'\n \n const pattern_regx = new RegExp(regx_parts.join(''), flags)\n \n \n // --- match original string based on pattern_regx, and get result to build placeholders dict\n const matches = pattern_regx.exec(this)\n \n if (!matches) return this\n \n const placeholders = Object.fromEntries(\n Object.entries($placeholders)\n .map(([name, $i]) => [\n [name, matches[$i]],\n [`${name}.before`, matches[$i - 1] || ''],\n [`${name}.after`, matches[$i + 1] || ''],\n ])\n .flat()\n )\n \n \n // --- convert pattern_ to replacement_str, if transformer exists then apply on placeholder\n last_end = 0\n let replacement_parts = [ ]\n \n pattern_.replace(pattern_placeholder, ($0, offset) => {\n replacement_parts.push(\n pattern_.slice(last_end, offset)\n )\n last_end = offset + $0.length\n \n const placeholder_name = $0.slice(1, -1)\n \n replacement_parts.push(\n transformer(placeholder_name, placeholders[placeholder_name], placeholders)\n )\n \n return ''\n })\n replacement_parts.push(\n pattern_.slice(last_end)\n )\n \n return this.replace(pattern_regx, replacement_parts.join(''))\n },\n \n \n find (this: string,\n pattern: string, \n preservations: string = '', \n flags = '', \n pattern_placeholder = /\\{.*?\\}/g\n ): Record<string, string> {\n // --- convert pattern to pattern_regx\n let last_end = 0\n \n // placeholder matched group index\n let $placeholders: Record<string, number> = { }\n \n let regx_parts = [ ]\n \n function add_part (left: number, right?: number) {\n const part = pattern.slice(left, right)\n if (part)\n regx_parts.push(\n part.to_regexp(preservations).source.bracket()\n )\n }\n \n pattern.replace(pattern_placeholder, ($0, offset) => {\n add_part(last_end, offset)\n last_end = offset + $0.length\n \n const placeholder = $0.slice(1, -1)\n let [placeholder_name, placeholder_pattern] = placeholder.split(':').map(s => s.trim())\n let optional = false\n if (placeholder_name.endsWith('?')) {\n placeholder_name = placeholder_name.slice(0, -1)\n optional = true\n }\n \n $placeholders[placeholder_name] = regx_parts.push(\n placeholder_pattern ? \n `${placeholder_pattern.bracket()}${optional ? '?' : ''}`\n :\n '(.*?)'\n )\n return ''\n })\n \n add_part(last_end)\n \n // convert last (.*?) to greedy, to make .{suffix} work\n regx_parts = regx_parts.filter(part => part)\n if (regx_parts[regx_parts.length - 1] === '(.*?)')\n regx_parts[regx_parts.length - 1] = '(.*)'\n \n const pattern_regx = new RegExp(regx_parts.join(''), flags)\n \n \n // --- match original string based on pattern_regx, and get result to build placeholders dict\n const matches = pattern_regx.exec(this)\n \n if (!matches) return { }\n \n return Object.fromEntries(\n Object.entries($placeholders)\n .map(([name, $i]) => \n [name, matches[$i] || '']\n )\n )\n },\n \n quote (this: string, type: keyof typeof quotes | 'psh' = 'single') {\n if (type === 'psh')\n return `& ${this.quote()}`\n return this.surround(quotes[type])\n },\n \n \n bracket (this: string, shape: keyof typeof brackets = 'round') {\n return this.surround(...brackets[shape] as [string, string])\n },\n \n \n surround (this: string, left: string, right?: string) {\n return left + this + (right || left)\n },\n \n surround_tag (this: string, tag_name: string): string {\n return '<' + tag_name + '>' + this + '</' + tag_name + '>'\n },\n \n \n to_lf (this: string) {\n return this.replace(/\\r\\n/g, '\\n')\n },\n \n \n to_crlf (this: string) {\n return this.replace(/\\n/g, '\\r\\n')\n },\n \n \n rm (this: string, pattern: string | RegExp, flags: string = 'g') {\n if (typeof pattern === 'string')\n pattern = new RegExp(pattern, flags)\n \n return this.replace(pattern, '')\n },\n \n \n split_lines (this: string, delimiter: string | RegExp = /\\r?\\n/) {\n let lines = this.split(delimiter)\n if (lines.last === '')\n lines.pop()\n return lines\n },\n \n \n split_indent (this: string): { indent: number, text: string } {\n let i = 0\n let indent = 0\n for (; i < this.length; i++)\n if (this[i] === ' ')\n indent += 1\n else if (this[i] === '\\t')\n indent += 4\n else\n break\n \n return {\n indent,\n text: this.slice(i)\n }\n },\n \n \n trim_doc_comment (this: string) {\n return `/** ${this.slice(3, -2).replace(/\\s*\\*\\s*/g, ' ').replace(/@(param|params|return) \\{.*?\\}\\s*/g, '').trim()} */`\n },\n \n \n to_base64 (this: string) {\n return Buffer.from(this).toString('base64')\n },\n \n \n decode_base64 (this: string, buffer = false) {\n const buf = Buffer.from(this, 'base64')\n if (buffer)\n return buf\n return buf.toString()\n },\n \n \n strip_ansi (this: string) {\n return strip_ansi(this)\n },\n \n \n space (this: string) {\n if (!this) return this\n let text_: string\n text_ = this\n .replace(new RegExp(cjk + `(['\"])`, 'g'), '$1 $2')\n .replace(new RegExp(`(['\"])` + cjk, 'g'), '$1 $2')\n \n .replace(/([\"']+)\\s*(.+?)\\s*([\"']+)/g, '$1$2$3')\n \n .replace(new RegExp(cjk + '([\\\\+\\\\-\\\\*\\\\/=&\\\\\\\\\\\\|<>])([A-Za-z0-9])', 'g'), '$1 $2 $3')\n .replace(new RegExp('([A-Za-z0-9])([\\\\+\\\\-\\\\*\\\\/=&\\\\\\\\\\\\|<>])' + cjk, 'g'), '$1 $2 $3')\n \n const text_bak = text_\n \n text_ = text_.replace(new RegExp(cjk + '([\\\\(\\\\[\\\\{<\\u201c]+(.*?)[\\\\)\\\\]\\\\}>\\u201d]+)' + cjk, 'g'), '$1 $2 $4')\n \n if (text_ === text_bak)\n text_ = text_\n .replace(new RegExp(cjk + '([\\\\(\\\\[\\\\{<\\u201c>])', 'g'), '$1 $2')\n .replace(new RegExp('([\\\\)\\\\]\\\\}>\\u201d<])' + cjk, 'g'), '$1 $2')\n \n return text_\n .replace(/([\\(\\[\\{<\\u201c]+)(\\s*)(.+?)(\\s*)([\\)\\]\\}>\\u201d]+)/g, '$1$3$5')\n .replace(new RegExp(cjk + '([~!;:,\\\\.\\\\?\\u2026])([A-Za-z0-9])', 'g'), '$1$2 $3')\n .replace(new RegExp(cjk + '([A-Za-z0-9`\\\\$%\\\\^&\\\\*\\\\-=\\\\+\\\\\\\\\\\\|\\\\/@\\u00a1-\\u00ff\\u2022\\u2027\\u2150-\\u218f])', 'g'), '$1 $2')\n .replace(new RegExp('([A-Za-z0-9`\\\\$%\\\\^&\\\\*\\\\-=\\\\+\\\\\\\\\\\\|\\\\/@\\u00a1-\\u00ff\\u2022\\u2027\\u2150-\\u218f])' + cjk, 'g'), '$1 $2')\n }\n }),\n \n \n // ------------ chalk colors\n ... Object.fromEntries(\n [\n 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'grey', \n 'red_', 'green_', 'yellow_', 'blue_', 'magenta_', 'cyan_',\n 'underline',\n ].map(color =>\n ([color, {\n configurable: true,\n get (this: string) {\n return chalk[color_map[color] || color](this)\n }\n }]))\n ),\n \n \n // ------------ file path ops\n ... to_getter_property_descriptors({\n fdir (this: string) {\n const dir = path.dirname(this)\n return dir.endsWith('/') ? dir : `${dir}/`\n },\n \n fname (this: string) {\n return path.basename(this)\n },\n \n fext (this: string) {\n return path.extname(this)\n },\n \n fexists (this: string) {\n return fs.existsSync(this)\n },\n \n is_dir (this: string) {\n if (this.endsWith('/')) return true\n try {\n return fs.lstatSync(this).isDirectory()\n } catch (error) {\n return false\n }\n },\n }),\n \n ... to_method_property_descriptors({\n to_slash (this: string) {\n if (!this)\n return this\n return path.normalizeSafe(this)\n },\n \n to_backslash (this: string) {\n return this.replaceAll('/', '\\\\')\n },\n })\n})\n\n\n// ------------------------------------ Date.prototype\nObject.defineProperties(Date.prototype, to_method_property_descriptors({\n to_str (this: Date, ms?: boolean) {\n const [ampm, hour] = (() => {\n let hour = this.getHours()\n if (hour <= 6)\n return ['凌晨', hour]\n \n if (hour <= 8)\n return ['清晨', hour]\n \n if (hour <= 9)\n return ['早上', hour]\n \n if (hour <= 10)\n return ['上午', hour]\n \n if (hour <= 12)\n return ['中午', hour]\n \n hour -= 12\n \n if (hour <= 5)\n return ['下午', hour]\n \n if (hour <= 10)\n return ['晚上', hour]\n \n return ['深夜', hour]\n })()\n \n const zero_padding = { character: '0', position: 'left' } as const\n \n return '' +\n // year.month.date\n this.getFullYear() + '.' + \n String(this.getMonth() + 1).pad(2, zero_padding) + '.' + \n String(this.getDate()).pad(2, zero_padding) + ' ' +\n \n // 上午\n ampm + ' ' +\n \n // 10:03:02\n String(hour).pad(2, zero_padding) + ':' +\n String(this.getMinutes()).pad(2, zero_padding) + ':' +\n String(this.getSeconds()).pad(2, zero_padding) + \n \n (ms ?\n '.' + String(this.getMilliseconds()).pad(3, zero_padding)\n :\n ''\n )\n },\n \n to_date_str (this: Date) {\n return this.to_str().split(' ')[0]\n },\n \n to_time_str (this: Date, ms?: boolean) {\n const [, ampm, time ] = this.to_str(ms).split(' ')\n return `${ampm} ${time}`\n },\n}))\n\n\n\n// ------------------------------------ Number.prototype\nObject.defineProperties(Number.prototype, to_method_property_descriptors({\n to_fsize_str (this: number, units: 'iec' | 'metric' = 'iec') {\n const { value, unit } = byte_size(this, { units })\n return `${value} ${unit.replace('i', '')}`\n },\n \n to_bin_str (this: number) {\n return `0b${this.toString(2)}`\n },\n \n to_hex_str (this: number, length?: number) {\n const s = this.toString(16)\n if (!length)\n length = Math.ceil(s.length / 4) * 4\n return `0x${'0'.repeat(length - s.length)}${s}`\n },\n \n to_oct_str (this: number) {\n return `0o${this.toString(8)}`\n },\n}))\n\n\n\n// ------------------------------------ Array.prototype\nObject.defineProperties(Array.prototype, {\n ... to_getter_property_descriptors({\n last (this: any[]) {\n return this[this.length - 1]\n }\n }),\n \n \n // --- text processing methods\n ... to_method_property_descriptors({\n log (this: string[], limit: number = 10000) {\n const text = this.join('\\n') + '\\n'\n if (limit === -1 || this.length <= limit)\n console.log(text)\n else if (limit > 0)\n console.log(text.slice(0, limit) + '\\n...'.blue)\n else \n console.log('...\\n'.blue + text.slice(limit))\n },\n \n trim_lines (this: string[], { trim_line = true, rm_empty_lines = true, rm_last_empty_lines = false }: { trim_line?: boolean, rm_empty_lines?: boolean, rm_last_empty_lines?: boolean } = { }) {\n if (!this.length)\n return this\n let lines = this\n \n if (trim_line)\n lines = lines.map(line => line.trim() )\n \n if (rm_empty_lines)\n return lines.filter( line => line )\n \n if (rm_last_empty_lines) {\n lines.reverse()\n const i_not_empty = lines.findIndex( line => line )\n if (i_not_empty !== -1)\n lines = lines.slice(i_not_empty)\n lines.reverse()\n return lines\n }\n \n return lines\n },\n \n \n trim_license (this: string[]) {\n const i = this.indexOf('/*')\n const j = this.indexOf('*/')\n if (i === 0 && this[i+1].includes('License'))\n return this.slice(j+1)\n else\n return this\n },\n \n split_indents (this: string[]): { indent: number, text: string }[] {\n return this.map(line => \n line.split_indent()\n )\n },\n \n indent (this: string[], width?: number, character: string = ' ') {\n return this.map(line => \n character.repeat(width) + line\n )\n },\n \n indent2to4 (this: string[]) {\n return this.split_indents()\n .map(line => \n ' '.repeat(\n Math.floor(line.indent / 2) * 4\n ) + line.text\n )\n },\n \n join_lines (this: string[], append = true) {\n return `${this.join('\\n')}${append ? '\\n' : ''}`\n }\n })\n})\n\n\nObject.defineProperties(BigInt.prototype, to_method_property_descriptors({\n toJSON (this: bigint) {\n return this.toString()\n }\n}))\n\nObject.defineProperties(Error.prototype, to_method_property_descriptors({\n toJSON (this: Error) {\n return Object.fromEntries(\n Object.getOwnPropertyNames(this)\n .map(name => \n [name, this[name]])\n )\n }\n}))\n\n\n\nexport function to_json (obj: any, replacer?: any) {\n return JSON.stringify(obj, replacer, 4) + '\\n'\n}\n\nexport function to_json_safely (obj: any, replacer?: any) {\n return to_json(obj, replacer)\n .replace(/\\u2028/g, '\\\\u2028')\n .replace(/\\u2029/g, '\\\\u2029')\n .replace(/<\\/script>/g, '<\\\\/script>')\n}\n\n\nexport function is_codepoint_fullwidth (codepoint: number) {\n // code points are derived from:\n // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt\n return (\n !Number.isNaN(codepoint) &&\n codepoint >= 0x1100 &&\n (\n codepoint <= 0x115f || // hangul jamo\n \n codepoint === 0x201c || codepoint === 0x201d || // \n codepoint === 0x2026 || // …\n codepoint === 0x203b || // ※\n \n // arrows\n (0x2190 <= codepoint && codepoint <= 0x21FF) ||\n \n codepoint === 0x2329 || // left-pointing angle bracket\n codepoint === 0x232a || // right-pointing angle bracket\n \n // ①\n (0x2460 <= codepoint && codepoint <= 0x24ff) ||\n \n // box drawing\n (0x2500 <= codepoint && codepoint <= 0x257f) ||\n \n // shapes, symbols, …\n (0x2580 <= codepoint && codepoint <= 0x2bef) ||\n \n // cjk radicals supplement .. enclosed cjk letters and months\n (0x2e80 <= codepoint && codepoint <= 0x3247 && codepoint !== 0x303f) ||\n \n // enclosed cjk letters and months .. cjk unified ideographs extension a\n (0x3250 <= codepoint && codepoint <= 0x4dbf) ||\n \n // cjk unified ideographs .. yi radicals\n (0x4E00 <= codepoint && codepoint <= 0xA4C6) ||\n \n // hangul jamo extended-a\n (0xa960 <= codepoint && codepoint <= 0xa97c) ||\n \n // hangul syllables\n (0xac00 <= codepoint && codepoint <= 0xd7a3) ||\n \n // cjk compatibility ideographs\n (0xf900 <= codepoint && codepoint <= 0xfaff) ||\n \n // vertical forms\n (0xfe10 <= codepoint && codepoint <= 0xfe19) ||\n \n // cjk compatibility forms .. small form variants\n (0xfe30 <= codepoint && codepoint <= 0xfe6b) ||\n \n // halfwidth and fullwidth forms\n (0xff01 <= codepoint && codepoint <= 0xff60) ||\n (0xffe0 <= codepoint && codepoint <= 0xffe6) ||\n \n // kana supplement\n (0x1b000 <= codepoint && codepoint <= 0x1b001) ||\n \n // enclosed ideographic supplement\n (0x1f200 <= codepoint && codepoint <= 0x1f251) ||\n \n // cjk unified ideographs extension b .. tertiary ideographic plane\n (0x20000 <= codepoint && codepoint <= 0x3fffd)\n )\n )\n}\n"]}
|
package/repl.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as ts, type Statement } from 'typescript';
|
|
2
2
|
import type { Context } from 'koa';
|
|
3
|
-
import './prototype';
|
|
3
|
+
import './prototype.js';
|
|
4
4
|
declare global {
|
|
5
5
|
var __: any;
|
|
6
6
|
var started_at: Date;
|
|
@@ -22,7 +22,7 @@ export declare let ts_options_commonjs: any;
|
|
|
22
22
|
export declare let ts_options_commonjs_repl: any;
|
|
23
23
|
export declare function load_tsconfig(): Promise<void>;
|
|
24
24
|
export declare function eval_ts(code: string): Promise<any>;
|
|
25
|
-
export declare function repl_code(type:
|
|
25
|
+
export declare function repl_code(type: 'ts', ...args: any[]): Promise<any>;
|
|
26
26
|
export declare function start_repl(): Promise<void>;
|
|
27
27
|
export declare function stop(): Promise<void>;
|
|
28
28
|
export declare function exit(): Promise<void>;
|
package/repl.js
CHANGED
|
@@ -7,11 +7,11 @@ const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
|
7
7
|
const repl_1 = tslib_1.__importDefault(require("repl"));
|
|
8
8
|
const process_1 = tslib_1.__importDefault(require("process"));
|
|
9
9
|
const typescript_1 = tslib_1.__importDefault(require("typescript"));
|
|
10
|
-
require("./prototype");
|
|
11
|
-
const
|
|
12
|
-
const
|
|
10
|
+
require("./prototype.js");
|
|
11
|
+
const utils_js_1 = require("./utils.js");
|
|
12
|
+
const file_js_1 = require("./file.js");
|
|
13
13
|
const process_js_1 = require("./process.js");
|
|
14
|
-
(0,
|
|
14
|
+
(0, utils_js_1.set_inspect_options)();
|
|
15
15
|
const { factory, SyntaxKind, NodeFlags, ModifierFlags, isIdentifier: is_identifier, isNamedImports: is_named_imports, isImportDeclaration: is_import_decl, isAwaitExpression: is_await_expr, isExpressionStatement: is_expr_stmt, isVariableStatement: is_var_stmt, isNamespaceImport: is_namespace_import, isClassDeclaration: is_class_decl, isCallExpression: is_call_expr, isReturnStatement: is_return_stmt, isBinaryExpression: is_binary_expr, isFunctionDeclaration: is_func_decl, createPrinter: create_printer, } = typescript_1.default;
|
|
16
16
|
let inspection_limit = 10000;
|
|
17
17
|
let printing_compiled_js = false;
|
|
@@ -196,7 +196,7 @@ function wrap_await_stmt(statements, code) {
|
|
|
196
196
|
}
|
|
197
197
|
async function compile_ts({ fp, code, print = printing_compiled_js, save = false, } = {}) {
|
|
198
198
|
if (!code && fp)
|
|
199
|
-
code = await (0,
|
|
199
|
+
code = await (0, file_js_1.fread)(fp);
|
|
200
200
|
const source_file = parse_code(code);
|
|
201
201
|
let statements = [...source_file.statements];
|
|
202
202
|
statements = statements.map(trans_import_2_require).flat();
|
|
@@ -215,20 +215,20 @@ async function compile_ts({ fp, code, print = printing_compiled_js, save = false
|
|
|
215
215
|
let { diagnostics, outputText: output_text } = typescript_1.default.transpileModule(code, { compilerOptions: exports.ts_options_commonjs_repl });
|
|
216
216
|
if (diagnostics.length) {
|
|
217
217
|
console.log(diagnostics.join('\n\n\n'));
|
|
218
|
-
(0,
|
|
218
|
+
(0, utils_js_1.log_line)();
|
|
219
219
|
}
|
|
220
220
|
if (print) {
|
|
221
221
|
console.log(output_text);
|
|
222
|
-
(0,
|
|
222
|
+
(0, utils_js_1.log_line)();
|
|
223
223
|
}
|
|
224
224
|
if (fp && save)
|
|
225
|
-
await (0,
|
|
225
|
+
await (0, file_js_1.fwrite)(fp.replace(/\.ts(x?)$/, '.js$1'), output_text);
|
|
226
226
|
return output_text;
|
|
227
227
|
}
|
|
228
228
|
exports.compile_ts = compile_ts;
|
|
229
229
|
async function load_tsconfig() {
|
|
230
230
|
const fp = `${process_js_1.fp_root}tsconfig.json`;
|
|
231
|
-
({ config: { compilerOptions: exports.ts_options } } = typescript_1.default.parseConfigFileTextToJson(fp, await (0,
|
|
231
|
+
({ config: { compilerOptions: exports.ts_options } } = typescript_1.default.parseConfigFileTextToJson(fp, await (0, file_js_1.fread)(fp, { print: false })));
|
|
232
232
|
exports.ts_options_commonjs = {
|
|
233
233
|
...exports.ts_options,
|
|
234
234
|
module: 'CommonJS',
|
|
@@ -260,23 +260,23 @@ async function eval_ts(code) {
|
|
|
260
260
|
exports.eval_ts = eval_ts;
|
|
261
261
|
// ------------------------------------ repl
|
|
262
262
|
async function repl_code(type, ...args) {
|
|
263
|
-
(0,
|
|
263
|
+
(0, utils_js_1.log_line)();
|
|
264
264
|
// --- run code
|
|
265
|
-
global.__ = await
|
|
266
|
-
(0,
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
265
|
+
const __ = global.__ = await eval_ts(...args);
|
|
266
|
+
(0, utils_js_1.log_line)();
|
|
267
|
+
console.log((0, utils_js_1.inspect)(__, { limit: inspection_limit }));
|
|
268
|
+
console.log('\n\n');
|
|
269
|
+
return __;
|
|
270
270
|
}
|
|
271
271
|
exports.repl_code = repl_code;
|
|
272
272
|
async function start_repl() {
|
|
273
273
|
// ------------ load library
|
|
274
|
-
(0,
|
|
274
|
+
(0, utils_js_1.log_section)('xshell is booting ...', { time: true });
|
|
275
275
|
log_mod_loaded('prototype');
|
|
276
276
|
log_mod_loaded('utils');
|
|
277
277
|
log_mod_loaded('file');
|
|
278
|
-
const mfs = (0,
|
|
279
|
-
(0,
|
|
278
|
+
const mfs = (0, file_js_1.create_mfs)();
|
|
279
|
+
(0, file_js_1.set_ufs)(new file_js_1.UFS([mfs, fs_1.default]));
|
|
280
280
|
log_mod_loaded('ufs');
|
|
281
281
|
log_mod_loaded('process');
|
|
282
282
|
log_mod_loaded('net');
|
|
@@ -292,34 +292,34 @@ async function start_repl() {
|
|
|
292
292
|
useColors: true,
|
|
293
293
|
terminal: true,
|
|
294
294
|
});
|
|
295
|
-
(0,
|
|
295
|
+
(0, utils_js_1.log_section)('repl initialized', { color: 'yellow', time: true });
|
|
296
296
|
process_1.default.title = 'xshell';
|
|
297
297
|
await Promise.all([
|
|
298
298
|
pollute_global(),
|
|
299
299
|
load_tsconfig(),
|
|
300
300
|
(async () => {
|
|
301
301
|
// --- http server
|
|
302
|
-
(0,
|
|
302
|
+
(0, utils_js_1.log_section)('server is initializing', { color: 'green', time: true });
|
|
303
303
|
let { server } = await Promise.resolve().then(() => tslib_1.__importStar(require('./server.js')));
|
|
304
304
|
await server.start();
|
|
305
|
-
(0,
|
|
305
|
+
(0, utils_js_1.log_section)('server initialized', { color: 'green', time: true });
|
|
306
306
|
})(),
|
|
307
307
|
]);
|
|
308
|
-
(0,
|
|
308
|
+
(0, utils_js_1.log_section)('xshell booted successfully', { color: 'red', time: true });
|
|
309
309
|
console.log('xshell is listening at http://0.0.0.0:8421'.green);
|
|
310
310
|
}
|
|
311
311
|
exports.start_repl = start_repl;
|
|
312
312
|
async function stop() {
|
|
313
|
-
(0,
|
|
314
|
-
for (const key in
|
|
315
|
-
|
|
313
|
+
(0, utils_js_1.log_section)('xshell is exiting', { color: 'red' });
|
|
314
|
+
for (const key in file_js_1.fwatchers)
|
|
315
|
+
file_js_1.fwatchers[key].close();
|
|
316
316
|
(await Promise.resolve().then(() => tslib_1.__importStar(require('./server.js'))))
|
|
317
317
|
.server.stop();
|
|
318
318
|
}
|
|
319
319
|
exports.stop = stop;
|
|
320
320
|
async function exit() {
|
|
321
321
|
await stop();
|
|
322
|
-
await (0,
|
|
322
|
+
await (0, utils_js_1.delay)(100);
|
|
323
323
|
process_1.default.exit();
|
|
324
324
|
}
|
|
325
325
|
exports.exit = exit;
|
|
@@ -354,7 +354,7 @@ async function pollute_global() {
|
|
|
354
354
|
pollute_module_exports('./server.js'),
|
|
355
355
|
pollute_module_exports('./repl.js'),
|
|
356
356
|
]);
|
|
357
|
-
(0,
|
|
357
|
+
(0, utils_js_1.log_section)('all modules were loaded', { color: 'green', time: true });
|
|
358
358
|
}
|
|
359
359
|
exports.pollute_global = pollute_global;
|
|
360
360
|
async function pollute_module_exports(fp_mod) {
|
package/repl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repl.js","sourceRoot":"","sources":["repl.ts"],"names":[],"mappings":";;;;AAAA,oDAAoB;AACpB,oDAAmB;AACnB,wDAAuB;AACvB,8DAA6B;AAI7B,oEAYmB;AAKnB,uBAAoB;AACpB,mCAAoF;AACpF,iCAA2E;AAC3E,6CAAsC;AAatC,IAAA,2BAAmB,GAAE,CAAA;AAKrB,MAAM,EACF,OAAO,EAEP,UAAU,EACV,SAAS,EACT,aAAa,EAEb,YAAY,EAAE,aAAa,EAC3B,cAAc,EAAE,gBAAgB,EAChC,mBAAmB,EAAE,cAAc,EACnC,iBAAiB,EAAE,aAAa,EAChC,qBAAqB,EAAE,YAAY,EACnC,mBAAmB,EAAE,WAAW,EAChC,iBAAiB,EAAE,mBAAmB,EACtC,kBAAkB,EAAE,aAAa,EACjC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,wDAKC;AAEM,KAAK,UAAU,6BAA6B,CAAE,MAAc,EAAE,IAAY;IAC7E,MAAM,CAAC,IAAI,CAAC,GAAG,CACX,gEAAa,MAAM,GAAC,CACvB,CAAC,OAAO,CAAA;AACb,CAAC;AAJD,sEAIC;AAGD,SAAS,cAAc,CAAE,EAAU;IAC/B,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAA;AACtC,CAAC","sourcesContent":["import nvm from 'vm'\nimport fs from 'fs'\nimport repl from 'repl'\nimport process from 'process'\n\n\n\nimport {\n default as ts,\n type SourceFile,\n type Node,\n type Statement, \n type Modifier,\n type SyntaxKind as TSyntaxKind,\n type Identifier,\n type StringLiteral,\n type ExpressionStatement,\n type ObjectBindingPattern,\n type BindingElement,\n} from 'typescript'\n\nimport type { Context } from 'koa'\n\n\nimport './prototype'\nimport { log_section, log_line, delay, inspect, set_inspect_options } from './utils'\nimport { fread, fwrite, fwatchers, create_mfs, set_ufs, UFS } from './file'\nimport { fp_root } from './process.js'\n\n\ndeclare global {\n var __: any\n \n var started_at: Date\n \n var repl_router: (ctx: Context) => Promise<boolean>\n}\n\n\n\nset_inspect_options()\n\n\n\n\nconst {\n factory,\n \n SyntaxKind, \n NodeFlags,\n ModifierFlags,\n \n isIdentifier: is_identifier, \n isNamedImports: is_named_imports,\n isImportDeclaration: is_import_decl,\n isAwaitExpression: is_await_expr,\n isExpressionStatement: is_expr_stmt,\n isVariableStatement: is_var_stmt,\n isNamespaceImport: is_namespace_import,\n isClassDeclaration: is_class_decl,\n isCallExpression: is_call_expr,\n isReturnStatement: is_return_stmt,\n isBinaryExpression: is_binary_expr,\n isFunctionDeclaration: is_func_decl,\n \n createPrinter: create_printer,\n} = ts\n\n\nlet inspection_limit = 10000\nlet printing_compiled_js = false\n\nexport function set_inspection_limit (limit: number = 10000) {\n if (limit === -1)\n limit = 50 * 10**4\n inspection_limit = limit\n}\n\n\nexport function set_printing_compiled_js (enabled: boolean) {\n printing_compiled_js = enabled\n}\n\n\n// ------------------------------------ Code Compilers, Transformers\nfunction resolve_kind (kind: TSyntaxKind) {\n if (kind === SyntaxKind.VariableStatement) return 'VariableStatement'\n return SyntaxKind[kind]\n}\n\n\nfunction print_ast (nodes: Node[] | Node, sourceFile: SourceFile) {\n function print_node (node: Node) {\n console.log(`${ resolve_kind(node.kind) }: ${ node.getText(sourceFile) }`)\n }\n if (Array.isArray(nodes))\n nodes.forEach( node => { print_node(node) })\n else\n print_node(nodes)\n}\n\n\nexport function parse_code (code: string) {\n return ts.createSourceFile('repl.ts', code, ts.ScriptTarget.ESNext)\n}\n\n\nexport function generate_code (stmts: Statement[]) {\n return create_printer({ omitTrailingSemicolon: true, removeComments: false, newLine: ts.NewLineKind.LineFeed })\n .printFile(\n factory.updateSourceFile(\n ts.createSourceFile('output.ts', '', ts.ScriptTarget.ESNext),\n stmts\n )\n )\n}\n\n\n\nfunction trans_import_2_require (import_decl: Statement) {\n if (!is_import_decl(import_decl)) return import_decl\n \n const { importClause: import_clause, moduleSpecifier: module_specifier } = import_decl\n \n // require('module_specifier')\n const require_module_stmt = factory.createCallExpression( factory.createIdentifier('require'), [ ], [ module_specifier ])\n \n // aaa, bbb as ccc, default as ddd, ...\n // (import_clause.namedBindings as NamedImports).elements\n \n return [\n // import mod from 'mod'\n // global.mod = __importDefault(require(\"mod\")).default\n ... import_clause.name ? [\n factory.createExpressionStatement( factory.createAssignment(\n factory.createPropertyAccessExpression( factory.createIdentifier('global'), import_clause.name),\n factory.createPropertyAccessExpression( factory.createCallExpression( factory.createIdentifier('__importDefault'), [ ], [ require_module_stmt ]), 'default'),\n )\n ) ] : [ ],\n \n // import * as mod from 'mod'\n // global.mod = __importStar(require(\"mod\"))\n ... import_clause.namedBindings && is_namespace_import(import_clause.namedBindings) ? [\n factory.createExpressionStatement( factory.createAssignment(\n factory.createPropertyAccessExpression( factory.createIdentifier('global'), import_clause.namedBindings.name),\n factory.createCallExpression( factory.createIdentifier('__importStar'), [ ], [ require_module_stmt ])\n ))\n ] : [ ],\n \n \n // import { element2 as element2_, element3 as element3_, other, default as mod2 } from 'mod2'\n ... import_clause.namedBindings && is_named_imports(import_clause.namedBindings) ? [\n // var { element2: element2_, element3 } = __importDefault(require(\"mod\"))\n factory.createVariableStatement([ ], [ factory.createVariableDeclaration(\n factory.createObjectBindingPattern(\n // ImportSpecifier[] -> ObjectBindingPattern.BindingElement[]\n import_clause.namedBindings.elements.map( import_specifier => \n factory.createBindingElement(\n undefined, \n import_specifier.propertyName, \n import_specifier.name, \n import_specifier.propertyName?.text === 'default' ? require_module_stmt : undefined\n ))),\n undefined,\n undefined,\n require_module_stmt\n ) ]),\n \n // Object.assign(global, { element2_, element3 })\n factory.createExpressionStatement( factory.createCallExpression(\n factory.createPropertyAccessExpression( factory.createIdentifier('Object'), 'assign'),\n [ ],\n // ImportSpecifier[] -> ObjectBindingPattern.BindingElement[]\n [ factory.createIdentifier('global'), factory.createObjectLiteralExpression( import_clause.namedBindings.elements.map( import_specifier => factory.createShorthandPropertyAssignment(import_specifier.name) ), false) ]\n )),\n \n factory.createExpressionStatement(\n import_clause.namedBindings.elements.length === 1 ? \n // (a)\n factory.createParenthesizedExpression(import_clause.namedBindings.elements[0].name)\n : // ({ a: xxx, b: xxx })\n factory.createObjectLiteralExpression( import_clause.namedBindings.elements.map( import_specifier => factory.createShorthandPropertyAssignment(import_specifier.name) ), false)\n )\n ] : [ ],\n ]\n}\n\n\n/** export function foo () { } */\nfunction trans_export_stmt (stmt: Statement) {\n if (ts.isExportAssignment(stmt))\n return factory.createExpressionStatement(stmt.expression)\n \n function is_export_modifier (modifier: Modifier) {\n return modifier.flags & ModifierFlags.Export || modifier.flags & ModifierFlags.ExportDefault || modifier.kind === SyntaxKind.ExportKeyword\n }\n \n if (stmt.modifiers?.some( modifier => is_export_modifier(modifier) )) {\n // @ts-ignore\n stmt.modifiers = factory.createNodeArray<Modifier>(\n stmt.modifiers.filter( modifier => !is_export_modifier(modifier) )\n )\n return stmt\n }\n \n return stmt\n}\n\n\nfunction trans_require_2_import (stmt: Statement, source_file: SourceFile) {\n if (!is_var_stmt(stmt)) return stmt\n const { name, initializer: require_call } = stmt.declarationList.declarations[0]\n \n if (!is_call_expr(require_call) || require_call.expression.getText(source_file) !== 'require') return stmt\n \n const modpath = require_call.arguments[0] as StringLiteral\n \n // createNamedImports(createImportSpecifier())\n \n return factory.createImportDeclaration(\n undefined, \n undefined,\n factory.createImportClause(false, name as Identifier, undefined),\n modpath\n )\n}\n\n\n/** const a = 123, b = 234, { c, d: e } = obj */\nfunction trans_variable_decl_2_var (var_decl: Statement) {\n if (!is_var_stmt(var_decl)) return var_decl\n // @ts-ignore\n var_decl.declarationList.flags = NodeFlags.None\n return var_decl\n}\n\n\nfunction trans_class_decl_2_expr (class_decl: Statement) {\n if (!is_class_decl(class_decl)) return class_decl\n \n // stmts like 'export class C { }' were moved 'export modifier' in 'trans_export_stmt'\n \n return factory.createVariableStatement(\n [ ],\n factory.createVariableDeclarationList([\n factory.createVariableDeclaration(\n class_decl.name, \n undefined, \n undefined, \n factory.createClassExpression(undefined, undefined, class_decl.name, undefined, undefined, class_decl.members)\n )\n ]))\n}\n\n\nfunction get_expr_of_stmt (statement: Statement): ExpressionStatement | Statement {\n if (is_expr_stmt(statement))\n return statement\n \n if (is_var_stmt(statement)) {\n const { declarations } = statement.declarationList\n return factory.createExpressionStatement(\n declarations.length === 1 ?\n (() => {\n const { name } = declarations[0]\n if (is_identifier(name)) // const a = c\n return name\n else // const { a, b } = c\n return factory.createObjectLiteralExpression(\n name.elements\n .filter(({ name }: BindingElement) => \n is_identifier(name))\n .map(({ name }: BindingElement) => \n factory.createShorthandPropertyAssignment(name as Identifier))\n )\n })()\n :\n factory.createObjectLiteralExpression(\n declarations.map( var_decl => \n factory.createShorthandPropertyAssignment(var_decl.name as Identifier)),\n true)\n )\n }\n \n if (is_func_decl(statement))\n return factory.createExpressionStatement(statement.name)\n \n return statement\n}\n\nfunction trans_return_2_expr (stmt: Statement): Statement {\n if (!is_return_stmt(stmt)) return stmt\n return factory.createExpressionStatement(stmt.expression)\n}\n\n\nfunction assign_var_decl (var_decl: Statement, destination: string = 'global') {\n if (!is_var_stmt(var_decl))\n return [var_decl]\n \n // VariableDeclaration[] -> ObjectLiteral[]\n // const a = 123, b = 234, { c, d: e } = obj\n const obj_literal =\n factory.createObjectLiteralExpression(\n var_decl.declarationList.declarations.map( declaration => \n is_identifier(declaration.name) ?\n [ factory.createShorthandPropertyAssignment(declaration.name) ]\n : // ObjectBindingPattern\n (declaration.name as ObjectBindingPattern).elements.map( (element: BindingElement) => factory.createShorthandPropertyAssignment(element.name as Identifier))\n ).flat()\n , true\n )\n \n \n return [\n var_decl,\n factory.createExpressionStatement( factory.createCallExpression(\n factory.createPropertyAccessExpression( factory.createIdentifier('Object'), 'assign'),\n [ ],\n [ factory.createIdentifier(destination), obj_literal ]\n )),\n factory.createExpressionStatement(obj_literal)\n ]\n}\n\n\nfunction return_last_expr (statements: Statement[]) {\n if (!statements.length) return statements\n \n const last_expr = get_expr_of_stmt(statements.last)\n if (is_expr_stmt(last_expr))\n return [ ...statements.slice(0, -1), factory.createReturnStatement(last_expr.expression) ]\n else\n return statements\n}\n\n\nfunction wrap_await_stmt (statements: Statement[], code: string) {\n function wrap (stmts: Statement[]) {\n return [\n factory.createExpressionStatement(\n factory.createCallExpression(\n factory.createFunctionExpression(\n [ factory.createModifier(SyntaxKind.AsyncKeyword) ],\n undefined,\n 'async_wrapper',\n [ ],\n [ ],\n undefined,\n factory.createBlock(\n return_last_expr(\n stmts.map(statement => assign_var_decl(statement)).flat()\n )\n , true)\n ),\n [ ],\n [ ]\n )\n ),\n ]\n }\n \n if (!code.includes('await')) return statements\n \n if (code.includes('await') && !code.includes('async ')) return wrap(statements)\n \n if (statements.some( stmt => (\n is_expr_stmt(stmt) && is_await_expr(stmt.expression) ||\n is_var_stmt(stmt) && stmt.declarationList.declarations.some( var_decl => \n var_decl.initializer && is_await_expr(var_decl.initializer)\n ) ||\n is_expr_stmt(stmt) && is_call_expr(stmt.expression) && stmt.expression.arguments.some( expr => is_await_expr(expr)) ||\n is_expr_stmt(stmt) && is_binary_expr(stmt.expression) && is_await_expr(stmt.expression.right)\n )))\n return wrap(statements)\n \n return statements\n}\n\n\nexport async function compile_ts ({\n fp, \n code, \n print = printing_compiled_js, \n save = false,\n}: {\n fp?: string\n code?: string\n print?: boolean\n save?: boolean\n} = { }): Promise<string> {\n if (!code && fp)\n code = await fread(fp)\n \n const source_file = parse_code(code)\n \n let statements: Statement[] = [...source_file.statements]\n statements = statements.map(trans_import_2_require).flat()\n statements = statements.map(trans_export_stmt)\n statements = statements.map(trans_class_decl_2_expr)\n statements = wrap_await_stmt(statements, code)\n statements = statements.map(trans_variable_decl_2_var)\n statements = statements.map(trans_return_2_expr)\n \n if (statements.length) {\n const last_stmt = statements[statements.length - 1]\n const last_expr = get_expr_of_stmt(last_stmt)\n if (last_expr !== last_stmt)\n statements = [...statements, last_expr]\n }\n \n \n code = generate_code(statements)\n \n let { diagnostics, outputText: output_text } = ts.transpileModule(code, { compilerOptions: ts_options_commonjs_repl })\n \n if (diagnostics.length) {\n console.log(diagnostics.join('\\n\\n\\n'))\n log_line()\n }\n \n if (print) {\n console.log(output_text)\n log_line()\n }\n \n if (fp && save)\n await fwrite(fp.replace(/\\.ts(x?)$/, '.js$1'), output_text)\n \n return output_text\n}\n\n\n/** tsconfig.compilerOptions */\nexport let ts_options: any\nexport let ts_options_commonjs: any\nexport let ts_options_commonjs_repl: any\n\nexport async function load_tsconfig () {\n const fp = `${fp_root}tsconfig.json`\n ;({ config: { compilerOptions: ts_options } } = ts.parseConfigFileTextToJson(\n fp, \n await fread(fp, { print: false })\n ))\n \n ts_options_commonjs = {\n ...ts_options,\n \n module: 'CommonJS',\n incremental: false,\n \n // determine CommonJS module require method\n esModuleInterop: true,\n }\n \n ts_options_commonjs_repl = {\n ...ts_options,\n \n module: 'CommonJS',\n esModuleInterop: true,\n \n // nvm.runInThisContext doesn't support inline source map\n sourceMap: false,\n }\n}\n\n\nlet eval_id = 0\n\nexport async function eval_ts (code: string) {\n try {\n const js = await compile_ts({ code })\n global.__ = await nvm.runInThisContext(js, `repl/${eval_id++}.ts`)\n \n return global.__\n } catch (error) {\n console.error(error)\n return error\n }\n}\n\n\n// ------------------------------------ repl\nexport async function repl_code (type: string, ...args: any[]) {\n log_line()\n \n // --- run code\n global.__ = await global['eval_' + type](...args)\n \n log_line()\n \n if (type !== 'shell')\n console.log(\n inspect(global.__, { limit: inspection_limit })\n )\n \n \n console.log('\\n'.repeat(2))\n}\n\n\nexport async function start_repl () {\n // ------------ load library\n log_section('xshell is booting ...', { time: true })\n \n log_mod_loaded('prototype')\n log_mod_loaded('utils')\n log_mod_loaded('file')\n \n const mfs = create_mfs()\n set_ufs(\n new UFS([mfs, fs])\n )\n log_mod_loaded('ufs')\n \n log_mod_loaded('process')\n log_mod_loaded('net')\n \n // --- prevent from exiting\n process.on('uncaughtException', error => {\n console.error(error)\n })\n \n // --- start nodejs repl\n repl.start({\n prompt: '',\n replMode: repl.REPL_MODE_SLOPPY,\n useGlobal: true,\n useColors: true,\n terminal: true,\n })\n \n log_section('repl initialized', { color: 'yellow', time: true })\n \n process.title = 'xshell'\n \n await Promise.all([\n pollute_global(),\n \n load_tsconfig(),\n \n (async () => {\n // --- http server\n log_section('server is initializing', { color: 'green', time: true })\n let { server } = await import('./server.js')\n await server.start()\n log_section('server initialized', { color: 'green', time: true })\n })(),\n ])\n \n log_section('xshell booted successfully', { color: 'red', time: true })\n console.log('xshell is listening at http://0.0.0.0:8421'.green)\n}\n\n\nexport async function stop () {\n log_section('xshell is exiting', { color: 'red' })\n \n for (const key in fwatchers)\n fwatchers[key].close()\n \n ;(await import('./server.js'))\n .server.stop()\n}\n\nexport async function exit () {\n await stop()\n await delay(100)\n process.exit()\n}\n\n\nexport async function pollute_global () {\n Object.assign(global, {\n __importDefault: (mod: any) => ((mod?.__esModule) ? mod : { default: mod }),\n __importStar: (mod: any) => {\n if (mod?.__esModule) return mod\n let result: { default?: any } = { }\n if (mod != null)\n for (let k in mod)\n if (Object.hasOwnProperty.call(mod, k))\n result[k] = mod[k]\n result.default = mod\n return result\n },\n exports: global\n })\n \n await Promise.all([\n pollute_module_default_export('upath', 'path'),\n pollute_module_default_export('cheerio', 'cheerio'),\n \n pollute_module_default_export('lodash/omit.js', 'omit'),\n pollute_module_default_export('lodash/sortBy.js', 'sort_by'),\n pollute_module_default_export('lodash/groupBy.js', 'group_by'),\n \n pollute_module_default_export('qs', 'qs'),\n \n pollute_module_exports('./prototype.js'),\n pollute_module_exports('./utils.js'),\n pollute_module_exports('./process.js'),\n pollute_module_exports('./file.js'),\n pollute_module_exports('./net.js'),\n pollute_module_exports('./server.js'),\n pollute_module_exports('./repl.js'),\n ])\n \n log_section('all modules were loaded', { color: 'green', time: true })\n}\n\n\nexport async function pollute_module_exports (fp_mod: string) {\n Object.assign(\n global,\n await import(fp_mod)\n )\n}\n\nexport async function pollute_module_default_export (fp_mod: string, name: string) {\n global[name] = (\n await import(fp_mod)\n ).default\n}\n\n\nfunction log_mod_loaded (id: string) {\n console.log(`${id.pad(40)}loaded`)\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"repl.js","sourceRoot":"","sources":["repl.ts"],"names":[],"mappings":";;;;AAAA,oDAAoB;AACpB,oDAAmB;AACnB,wDAAuB;AACvB,8DAA6B;AAI7B,oEAYmB;AAKnB,0BAAuB;AACvB,yCAAuF;AACvF,uCAA8E;AAC9E,6CAAsC;AAatC,IAAA,8BAAmB,GAAE,CAAA;AAKrB,MAAM,EACF,OAAO,EAEP,UAAU,EACV,SAAS,EACT,aAAa,EAEb,YAAY,EAAE,aAAa,EAC3B,cAAc,EAAE,gBAAgB,EAChC,mBAAmB,EAAE,cAAc,EACnC,iBAAiB,EAAE,aAAa,EAChC,qBAAqB,EAAE,YAAY,EACnC,mBAAmB,EAAE,WAAW,EAChC,iBAAiB,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AEM,KAAK,UAAU,6BAA6B,CAAE,MAAc,EAAE,IAAY;IAC7E,MAAM,CAAC,IAAI,CAAC,GAAG,CACX,gEAAa,MAAM,GAAC,CACvB,CAAC,OAAO,CAAA;AACb,CAAC;AAJD,sEAIC;AAGD,SAAS,cAAc,CAAE,EAAU;IAC/B,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAA;AACtC,CAAC","sourcesContent":["import nvm from 'vm'\nimport fs from 'fs'\nimport repl from 'repl'\nimport process from 'process'\n\n\n\nimport {\n default as ts,\n type SourceFile,\n type Node,\n type Statement, \n type Modifier,\n type SyntaxKind as TSyntaxKind,\n type Identifier,\n type StringLiteral,\n type ExpressionStatement,\n type ObjectBindingPattern,\n type BindingElement,\n} from 'typescript'\n\nimport type { Context } from 'koa'\n\n\nimport './prototype.js'\nimport { log_section, log_line, delay, inspect, set_inspect_options } from './utils.js'\nimport { fread, fwrite, fwatchers, create_mfs, set_ufs, UFS } from './file.js'\nimport { fp_root } from './process.js'\n\n\ndeclare global {\n var __: any\n \n var started_at: Date\n \n var repl_router: (ctx: Context) => Promise<boolean>\n}\n\n\n\nset_inspect_options()\n\n\n\n\nconst {\n factory,\n \n SyntaxKind, \n NodeFlags,\n ModifierFlags,\n \n isIdentifier: is_identifier, \n isNamedImports: is_named_imports,\n isImportDeclaration: is_import_decl,\n isAwaitExpression: is_await_expr,\n isExpressionStatement: is_expr_stmt,\n isVariableStatement: is_var_stmt,\n isNamespaceImport: is_namespace_import,\n isClassDeclaration: is_class_decl,\n isCallExpression: is_call_expr,\n isReturnStatement: is_return_stmt,\n isBinaryExpression: is_binary_expr,\n isFunctionDeclaration: is_func_decl,\n \n createPrinter: create_printer,\n} = ts\n\n\nlet inspection_limit = 10000\nlet printing_compiled_js = false\n\nexport function set_inspection_limit (limit: number = 10000) {\n if (limit === -1)\n limit = 50 * 10**4\n inspection_limit = limit\n}\n\n\nexport function set_printing_compiled_js (enabled: boolean) {\n printing_compiled_js = enabled\n}\n\n\n// ------------------------------------ Code Compilers, Transformers\nfunction resolve_kind (kind: TSyntaxKind) {\n if (kind === SyntaxKind.VariableStatement) return 'VariableStatement'\n return SyntaxKind[kind]\n}\n\n\nfunction print_ast (nodes: Node[] | Node, sourceFile: SourceFile) {\n function print_node (node: Node) {\n console.log(`${ resolve_kind(node.kind) }: ${ node.getText(sourceFile) }`)\n }\n if (Array.isArray(nodes))\n nodes.forEach( node => { print_node(node) })\n else\n print_node(nodes)\n}\n\n\nexport function parse_code (code: string) {\n return ts.createSourceFile('repl.ts', code, ts.ScriptTarget.ESNext)\n}\n\n\nexport function generate_code (stmts: Statement[]) {\n return create_printer({ omitTrailingSemicolon: true, removeComments: false, newLine: ts.NewLineKind.LineFeed })\n .printFile(\n factory.updateSourceFile(\n ts.createSourceFile('output.ts', '', ts.ScriptTarget.ESNext),\n stmts\n )\n )\n}\n\n\n\nfunction trans_import_2_require (import_decl: Statement) {\n if (!is_import_decl(import_decl)) return import_decl\n \n const { importClause: import_clause, moduleSpecifier: module_specifier } = import_decl\n \n // require('module_specifier')\n const require_module_stmt = factory.createCallExpression( factory.createIdentifier('require'), [ ], [ module_specifier ])\n \n // aaa, bbb as ccc, default as ddd, ...\n // (import_clause.namedBindings as NamedImports).elements\n \n return [\n // import mod from 'mod'\n // global.mod = __importDefault(require(\"mod\")).default\n ... import_clause.name ? [\n factory.createExpressionStatement( factory.createAssignment(\n factory.createPropertyAccessExpression( factory.createIdentifier('global'), import_clause.name),\n factory.createPropertyAccessExpression( factory.createCallExpression( factory.createIdentifier('__importDefault'), [ ], [ require_module_stmt ]), 'default'),\n )\n ) ] : [ ],\n \n // import * as mod from 'mod'\n // global.mod = __importStar(require(\"mod\"))\n ... import_clause.namedBindings && is_namespace_import(import_clause.namedBindings) ? [\n factory.createExpressionStatement( factory.createAssignment(\n factory.createPropertyAccessExpression( factory.createIdentifier('global'), import_clause.namedBindings.name),\n factory.createCallExpression( factory.createIdentifier('__importStar'), [ ], [ require_module_stmt ])\n ))\n ] : [ ],\n \n \n // import { element2 as element2_, element3 as element3_, other, default as mod2 } from 'mod2'\n ... import_clause.namedBindings && is_named_imports(import_clause.namedBindings) ? [\n // var { element2: element2_, element3 } = __importDefault(require(\"mod\"))\n factory.createVariableStatement([ ], [ factory.createVariableDeclaration(\n factory.createObjectBindingPattern(\n // ImportSpecifier[] -> ObjectBindingPattern.BindingElement[]\n import_clause.namedBindings.elements.map( import_specifier => \n factory.createBindingElement(\n undefined, \n import_specifier.propertyName, \n import_specifier.name, \n import_specifier.propertyName?.text === 'default' ? require_module_stmt : undefined\n ))),\n undefined,\n undefined,\n require_module_stmt\n ) ]),\n \n // Object.assign(global, { element2_, element3 })\n factory.createExpressionStatement( factory.createCallExpression(\n factory.createPropertyAccessExpression( factory.createIdentifier('Object'), 'assign'),\n [ ],\n // ImportSpecifier[] -> ObjectBindingPattern.BindingElement[]\n [ factory.createIdentifier('global'), factory.createObjectLiteralExpression( import_clause.namedBindings.elements.map( import_specifier => factory.createShorthandPropertyAssignment(import_specifier.name) ), false) ]\n )),\n \n factory.createExpressionStatement(\n import_clause.namedBindings.elements.length === 1 ? \n // (a)\n factory.createParenthesizedExpression(import_clause.namedBindings.elements[0].name)\n : // ({ a: xxx, b: xxx })\n factory.createObjectLiteralExpression( import_clause.namedBindings.elements.map( import_specifier => factory.createShorthandPropertyAssignment(import_specifier.name) ), false)\n )\n ] : [ ],\n ]\n}\n\n\n/** export function foo () { } */\nfunction trans_export_stmt (stmt: Statement) {\n if (ts.isExportAssignment(stmt))\n return factory.createExpressionStatement(stmt.expression)\n \n function is_export_modifier (modifier: Modifier) {\n return modifier.flags & ModifierFlags.Export || modifier.flags & ModifierFlags.ExportDefault || modifier.kind === SyntaxKind.ExportKeyword\n }\n \n if (stmt.modifiers?.some( modifier => is_export_modifier(modifier) )) {\n // @ts-ignore\n stmt.modifiers = factory.createNodeArray<Modifier>(\n stmt.modifiers.filter( modifier => !is_export_modifier(modifier) )\n )\n return stmt\n }\n \n return stmt\n}\n\n\nfunction trans_require_2_import (stmt: Statement, source_file: SourceFile) {\n if (!is_var_stmt(stmt)) return stmt\n const { name, initializer: require_call } = stmt.declarationList.declarations[0]\n \n if (!is_call_expr(require_call) || require_call.expression.getText(source_file) !== 'require') return stmt\n \n const modpath = require_call.arguments[0] as StringLiteral\n \n // createNamedImports(createImportSpecifier())\n \n return factory.createImportDeclaration(\n undefined, \n undefined,\n factory.createImportClause(false, name as Identifier, undefined),\n modpath\n )\n}\n\n\n/** const a = 123, b = 234, { c, d: e } = obj */\nfunction trans_variable_decl_2_var (var_decl: Statement) {\n if (!is_var_stmt(var_decl)) return var_decl\n // @ts-ignore\n var_decl.declarationList.flags = NodeFlags.None\n return var_decl\n}\n\n\nfunction trans_class_decl_2_expr (class_decl: Statement) {\n if (!is_class_decl(class_decl)) return class_decl\n \n // stmts like 'export class C { }' were moved 'export modifier' in 'trans_export_stmt'\n \n return factory.createVariableStatement(\n [ ],\n factory.createVariableDeclarationList([\n factory.createVariableDeclaration(\n class_decl.name, \n undefined, \n undefined, \n factory.createClassExpression(undefined, undefined, class_decl.name, undefined, undefined, class_decl.members)\n )\n ]))\n}\n\n\nfunction get_expr_of_stmt (statement: Statement): ExpressionStatement | Statement {\n if (is_expr_stmt(statement))\n return statement\n \n if (is_var_stmt(statement)) {\n const { declarations } = statement.declarationList\n return factory.createExpressionStatement(\n declarations.length === 1 ?\n (() => {\n const { name } = declarations[0]\n if (is_identifier(name)) // const a = c\n return name\n else // const { a, b } = c\n return factory.createObjectLiteralExpression(\n name.elements\n .filter(({ name }: BindingElement) => \n is_identifier(name))\n .map(({ name }: BindingElement) => \n factory.createShorthandPropertyAssignment(name as Identifier))\n )\n })()\n :\n factory.createObjectLiteralExpression(\n declarations.map( var_decl => \n factory.createShorthandPropertyAssignment(var_decl.name as Identifier)),\n true)\n )\n }\n \n if (is_func_decl(statement))\n return factory.createExpressionStatement(statement.name)\n \n return statement\n}\n\nfunction trans_return_2_expr (stmt: Statement): Statement {\n if (!is_return_stmt(stmt)) return stmt\n return factory.createExpressionStatement(stmt.expression)\n}\n\n\nfunction assign_var_decl (var_decl: Statement, destination: string = 'global') {\n if (!is_var_stmt(var_decl))\n return [var_decl]\n \n // VariableDeclaration[] -> ObjectLiteral[]\n // const a = 123, b = 234, { c, d: e } = obj\n const obj_literal =\n factory.createObjectLiteralExpression(\n var_decl.declarationList.declarations.map( declaration => \n is_identifier(declaration.name) ?\n [ factory.createShorthandPropertyAssignment(declaration.name) ]\n : // ObjectBindingPattern\n (declaration.name as ObjectBindingPattern).elements.map( (element: BindingElement) => factory.createShorthandPropertyAssignment(element.name as Identifier))\n ).flat()\n , true\n )\n \n \n return [\n var_decl,\n factory.createExpressionStatement( factory.createCallExpression(\n factory.createPropertyAccessExpression( factory.createIdentifier('Object'), 'assign'),\n [ ],\n [ factory.createIdentifier(destination), obj_literal ]\n )),\n factory.createExpressionStatement(obj_literal)\n ]\n}\n\n\nfunction return_last_expr (statements: Statement[]) {\n if (!statements.length) return statements\n \n const last_expr = get_expr_of_stmt(statements.last)\n if (is_expr_stmt(last_expr))\n return [ ...statements.slice(0, -1), factory.createReturnStatement(last_expr.expression) ]\n else\n return statements\n}\n\n\nfunction wrap_await_stmt (statements: Statement[], code: string) {\n function wrap (stmts: Statement[]) {\n return [\n factory.createExpressionStatement(\n factory.createCallExpression(\n factory.createFunctionExpression(\n [ factory.createModifier(SyntaxKind.AsyncKeyword) ],\n undefined,\n 'async_wrapper',\n [ ],\n [ ],\n undefined,\n factory.createBlock(\n return_last_expr(\n stmts.map(statement => assign_var_decl(statement)).flat()\n )\n , true)\n ),\n [ ],\n [ ]\n )\n ),\n ]\n }\n \n if (!code.includes('await')) return statements\n \n if (code.includes('await') && !code.includes('async ')) return wrap(statements)\n \n if (statements.some( stmt => (\n is_expr_stmt(stmt) && is_await_expr(stmt.expression) ||\n is_var_stmt(stmt) && stmt.declarationList.declarations.some( var_decl => \n var_decl.initializer && is_await_expr(var_decl.initializer)\n ) ||\n is_expr_stmt(stmt) && is_call_expr(stmt.expression) && stmt.expression.arguments.some( expr => is_await_expr(expr)) ||\n is_expr_stmt(stmt) && is_binary_expr(stmt.expression) && is_await_expr(stmt.expression.right)\n )))\n return wrap(statements)\n \n return statements\n}\n\n\nexport async function compile_ts ({\n fp, \n code, \n print = printing_compiled_js, \n save = false,\n}: {\n fp?: string\n code?: string\n print?: boolean\n save?: boolean\n} = { }): Promise<string> {\n if (!code && fp)\n code = await fread(fp)\n \n const source_file = parse_code(code)\n \n let statements: Statement[] = [...source_file.statements]\n statements = statements.map(trans_import_2_require).flat()\n statements = statements.map(trans_export_stmt)\n statements = statements.map(trans_class_decl_2_expr)\n statements = wrap_await_stmt(statements, code)\n statements = statements.map(trans_variable_decl_2_var)\n statements = statements.map(trans_return_2_expr)\n \n if (statements.length) {\n const last_stmt = statements[statements.length - 1]\n const last_expr = get_expr_of_stmt(last_stmt)\n if (last_expr !== last_stmt)\n statements = [...statements, last_expr]\n }\n \n \n code = generate_code(statements)\n \n let { diagnostics, outputText: output_text } = ts.transpileModule(code, { compilerOptions: ts_options_commonjs_repl })\n \n if (diagnostics.length) {\n console.log(diagnostics.join('\\n\\n\\n'))\n log_line()\n }\n \n if (print) {\n console.log(output_text)\n log_line()\n }\n \n if (fp && save)\n await fwrite(fp.replace(/\\.ts(x?)$/, '.js$1'), output_text)\n \n return output_text\n}\n\n\n/** tsconfig.compilerOptions */\nexport let ts_options: any\nexport let ts_options_commonjs: any\nexport let ts_options_commonjs_repl: any\n\nexport async function load_tsconfig () {\n const fp = `${fp_root}tsconfig.json`\n ;({ config: { compilerOptions: ts_options } } = ts.parseConfigFileTextToJson(\n fp, \n await fread(fp, { print: false })\n ))\n \n ts_options_commonjs = {\n ...ts_options,\n \n module: 'CommonJS',\n incremental: false,\n \n // determine CommonJS module require method\n esModuleInterop: true,\n }\n \n ts_options_commonjs_repl = {\n ...ts_options,\n \n module: 'CommonJS',\n esModuleInterop: true,\n \n // nvm.runInThisContext doesn't support inline source map\n sourceMap: false,\n }\n}\n\n\nlet eval_id = 0\n\nexport async function eval_ts (code: string) {\n try {\n const js = await compile_ts({ code })\n global.__ = await nvm.runInThisContext(js, `repl/${eval_id++}.ts`)\n \n return global.__\n } catch (error) {\n console.error(error)\n return error\n }\n}\n\n\n// ------------------------------------ repl\nexport async function repl_code (type: 'ts', ...args: any[]) {\n log_line()\n \n // --- run code\n const __ = global.__ = await eval_ts(...(args as [string]))\n \n log_line()\n \n console.log(\n inspect(__, { limit: inspection_limit })\n )\n \n console.log('\\n\\n')\n \n return __\n}\n\n\nexport async function start_repl () {\n // ------------ load library\n log_section('xshell is booting ...', { time: true })\n \n log_mod_loaded('prototype')\n log_mod_loaded('utils')\n log_mod_loaded('file')\n \n const mfs = create_mfs()\n set_ufs(\n new UFS([mfs, fs])\n )\n log_mod_loaded('ufs')\n \n log_mod_loaded('process')\n log_mod_loaded('net')\n \n // --- prevent from exiting\n process.on('uncaughtException', error => {\n console.error(error)\n })\n \n // --- start nodejs repl\n repl.start({\n prompt: '',\n replMode: repl.REPL_MODE_SLOPPY,\n useGlobal: true,\n useColors: true,\n terminal: true,\n })\n \n log_section('repl initialized', { color: 'yellow', time: true })\n \n process.title = 'xshell'\n \n await Promise.all([\n pollute_global(),\n \n load_tsconfig(),\n \n (async () => {\n // --- http server\n log_section('server is initializing', { color: 'green', time: true })\n let { server } = await import('./server.js')\n await server.start()\n log_section('server initialized', { color: 'green', time: true })\n })(),\n ])\n \n log_section('xshell booted successfully', { color: 'red', time: true })\n console.log('xshell is listening at http://0.0.0.0:8421'.green)\n}\n\n\nexport async function stop () {\n log_section('xshell is exiting', { color: 'red' })\n \n for (const key in fwatchers)\n fwatchers[key].close()\n \n ;(await import('./server.js'))\n .server.stop()\n}\n\nexport async function exit () {\n await stop()\n await delay(100)\n process.exit()\n}\n\n\nexport async function pollute_global () {\n Object.assign(global, {\n __importDefault: (mod: any) => ((mod?.__esModule) ? mod : { default: mod }),\n __importStar: (mod: any) => {\n if (mod?.__esModule) return mod\n let result: { default?: any } = { }\n if (mod != null)\n for (let k in mod)\n if (Object.hasOwnProperty.call(mod, k))\n result[k] = mod[k]\n result.default = mod\n return result\n },\n exports: global\n })\n \n await Promise.all([\n pollute_module_default_export('upath', 'path'),\n pollute_module_default_export('cheerio', 'cheerio'),\n \n pollute_module_default_export('lodash/omit.js', 'omit'),\n pollute_module_default_export('lodash/sortBy.js', 'sort_by'),\n pollute_module_default_export('lodash/groupBy.js', 'group_by'),\n \n pollute_module_default_export('qs', 'qs'),\n \n pollute_module_exports('./prototype.js'),\n pollute_module_exports('./utils.js'),\n pollute_module_exports('./process.js'),\n pollute_module_exports('./file.js'),\n pollute_module_exports('./net.js'),\n pollute_module_exports('./server.js'),\n pollute_module_exports('./repl.js'),\n ])\n \n log_section('all modules were loaded', { color: 'green', time: true })\n}\n\n\nexport async function pollute_module_exports (fp_mod: string) {\n Object.assign(\n global,\n await import(fp_mod)\n )\n}\n\nexport async function pollute_module_default_export (fp_mod: string, name: string) {\n global[name] = (\n await import(fp_mod)\n ).default\n}\n\n\nfunction log_mod_loaded (id: string) {\n console.log(`${id.pad(40)}loaded`)\n}\n\n"]}
|
package/server.d.ts
CHANGED