Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix #134 - support TS 4.9 #135

Merged
merged 2 commits into from
Dec 9, 2022
Merged

Fix #134 - support TS 4.9 #135

merged 2 commits into from
Dec 9, 2022

Conversation

samchon
Copy link
Contributor

@samchon samchon commented Dec 9, 2022

Just followed ts-patch of @nonara and it works fine in my case.

@cevek - hope ttypescript to support TS 4.9 ASAP.

Jeongho Nam added 2 commits December 9, 2022 17:14

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@cevek cevek merged commit f37f095 into cevek:master Dec 9, 2022
@cevek
Copy link
Owner

cevek commented Dec 9, 2022

released ttypescript@1.5.14
thank you @samchon!

@samchon
Copy link
Contributor Author

samchon commented Dec 9, 2022

@cevek: I think you have published the new version without compilation.

This is tsc.js of ttypescript@1.5.14

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var fs = require("fs");
var resolve = require("resolve");
var loadTypescript_1 = require("./loadTypescript");
var path_1 = require("path");
var vm_1 = require("vm");
var ts = (0, loadTypescript_1.loadTypeScript)('typescript', { folder: process.cwd(), forceConfigLoad: true });
var tscFileName = resolve.sync('typescript/lib/tsc', { basedir: process.cwd() });
var commandLineTsCode = fs
    .readFileSync(tscFileName, 'utf8')
    .replace(/^[\s\S]+(\(function \(ts\) \{\s+function countLines[\s\S]+)$/, '$1');
var globalCode = (fs.readFileSync(tscFileName, 'utf8').match(/^([\s\S]*?)var ts;/) || ['', ''])[1];
(0, vm_1.runInThisContext)("(function (exports, require, module, __filename, __dirname, ts) {".concat(globalCode).concat(commandLineTsCode, "\n});"), {
    filename: tscFileName,
    lineOffset: 0,
    displayErrors: true,
}).call(ts, ts, require, { exports: ts }, tscFileName, (0, path_1.dirname)(tscFileName), ts);

@cevek
Copy link
Owner

cevek commented Dec 9, 2022

@samchon oh, yeah, you're right! shame on me 🤦‍♂️
Fixed it on 1.5.15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants