-
-
Notifications
You must be signed in to change notification settings - Fork 184
Module resolution from node_modules #1011
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Conflicts: # package-lock.json
…ailing" This reverts commit 7b8bd80.
lolleko
requested changes
May 26, 2021
test/transpile/module-resolution/project-with-dependency-chain/tsconfig.json
Show resolved
Hide resolved
lolleko
approved these changes
Jun 13, 2021
sanikoyes
pushed a commit
to sanikoyes/TypeScriptToLua
that referenced
this pull request
Sep 24, 2021
* Create test project with node_modules * testProject test util * Fix typos in module resolution test * Base case module resolution * Replace requires in source maps too * Fixed incorrect path behavior * More tests * add module resolution with sourceDir node_modules * Get all module-resolution testcases to work * Restrict resolver to only lua files * All tests working * Added more in-project dependency checks to sourceDir test * Fixed problem with lua sibling files * Also resolve JSON modules * Add debug to resolution test to try to figure out why CI is failing * fix test runner path preloading * Revert "Add debug to resolution test to try to figure out why CI is failing" This reverts commit 7b8bd80. * Changed resolution failure from error to warning * move json.lua from dist to src in benchmark * Use commit version instead of master to compile benchmark scripts * Added module resolution test project with lua sources * Add library compilation mode * renamed compilemode to buildmode * clean up resolve * Fix tests * Removed old project test runner * PR comments * Remove file casing test * Resolution + library mode combined test * remove out path logic from printer * Fixed bundle entry point require not being resolved correctly * Add header to bundle * Made couldNotResolveRequire an error instead of warning * updated couldnotResolveRequire snapshot
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add extra resolve step when emitting to resolve Lua files that might be referenced but not part of the project output. This includes Lua files placed independently in the source directory, and also lua files in
node_modules.Upon resolution, any
require()calls will be resolved to search for the lua file they are including. If this file is not yet part of the output it is added. Require paths are rewritten so the lua output and requires match.Lua files from
node_modulesare placed intolua_modulesto avoid overwriting them when rewriting require paths.To create libraries, a buildMode config setting is added,. If this setting is set to "library", files from external packages in node_modules are not included, and their requires are not rewritten. This will be done once the package is included and used in a client project.
Closes #909, closes #1005, fixes #976, closes, fixes #823, fixes #751, closes #432
Documentation to go with this functionality:
TypeScriptToLua/TypeScriptToLua.github.io#44