This PR is based on top of #79, so a lot of the file changes may appear duplicated from there.
I'm not sure if my implementation in index.ts#createMockModuleImportStatement is the idiomatic way to achieve this functionality, but it seems to be working for the previous test cases and the few new test cases I have added:
Here is an example typescript input:
import { func } from 'bob';
func();
and with this PR, the produced output looks like this:
// Compiled using ts2gas 4.2.0 (TypeScript 4.9.5)
var exports = exports || {};
var module = module || { exports: exports };
var bob_1 = bob_1 || { func: func }; //import { func } from 'bob';
(0, bob_1.func)();
I'm also not sure what determines the suffix on the module names (e.g. the _1 part of bob_1), so it's just hardcoded to that currently.
Again, I'm not super familiar with the typescript compiler structure, so let me know if this is completely incorrect.
Hi again, this is my naive attempt at fixing #71.
This PR is based on top of #79, so a lot of the file changes may appear duplicated from there.
I'm not sure if my implementation in
index.ts#createMockModuleImportStatement
is the idiomatic way to achieve this functionality, but it seems to be working for the previous test cases and the few new test cases I have added:Here is an example typescript input:
and with this PR, the produced output looks like this:
I'm also not sure what determines the suffix on the module names (e.g. the
_1
part ofbob_1
), so it's just hardcoded to that currently.Again, I'm not super familiar with the typescript compiler structure, so let me know if this is completely incorrect.
Thanks!