@jackctaylor/roblox-ts 3.0.0-projectrefs.0
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/CHANGELOG.md +716 -0
- package/LICENSE +21 -0
- package/README.md +55 -0
- package/include/Promise.lua +2068 -0
- package/include/RuntimeLib.lua +258 -0
- package/out/CLI/cli.d.ts +2 -0
- package/out/CLI/cli.js +41 -0
- package/out/CLI/commands/build.d.ts +7 -0
- package/out/CLI/commands/build.js +438 -0
- package/out/CLI/errors/CLIError.d.ts +4 -0
- package/out/CLI/errors/CLIError.js +12 -0
- package/out/CLI/index.d.ts +3 -0
- package/out/CLI/index.js +22 -0
- package/out/CLI/test.d.ts +1 -0
- package/out/CLI/test.js +82 -0
- package/out/CLI/util/patchFs.d.ts +1 -0
- package/out/CLI/util/patchFs.js +26 -0
- package/out/Project/classes/VirtualFileSystem.d.ts +14 -0
- package/out/Project/classes/VirtualFileSystem.js +102 -0
- package/out/Project/classes/VirtualProject.d.ts +15 -0
- package/out/Project/classes/VirtualProject.js +121 -0
- package/out/Project/functions/buildProject.d.ts +18 -0
- package/out/Project/functions/buildProject.js +48 -0
- package/out/Project/functions/buildProjectReferences.d.ts +3 -0
- package/out/Project/functions/buildProjectReferences.js +78 -0
- package/out/Project/functions/buildSolution.d.ts +10 -0
- package/out/Project/functions/buildSolution.js +97 -0
- package/out/Project/functions/checkFileName.d.ts +1 -0
- package/out/Project/functions/checkFileName.js +18 -0
- package/out/Project/functions/checkRojoConfig.d.ts +4 -0
- package/out/Project/functions/checkRojoConfig.js +26 -0
- package/out/Project/functions/cleanup.d.ts +2 -0
- package/out/Project/functions/cleanup.js +30 -0
- package/out/Project/functions/compileFiles.d.ts +4 -0
- package/out/Project/functions/compileFiles.js +160 -0
- package/out/Project/functions/compileProject.d.ts +14 -0
- package/out/Project/functions/compileProject.js +71 -0
- package/out/Project/functions/copyFiles.d.ts +3 -0
- package/out/Project/functions/copyFiles.js +13 -0
- package/out/Project/functions/copyInclude.d.ts +2 -0
- package/out/Project/functions/copyInclude.js +17 -0
- package/out/Project/functions/copyItem.d.ts +3 -0
- package/out/Project/functions/copyItem.js +27 -0
- package/out/Project/functions/createNodeModulesPathMapping.d.ts +1 -0
- package/out/Project/functions/createNodeModulesPathMapping.js +31 -0
- package/out/Project/functions/createPathTranslator.d.ts +4 -0
- package/out/Project/functions/createPathTranslator.js +22 -0
- package/out/Project/functions/createProgramFactory.d.ts +3 -0
- package/out/Project/functions/createProgramFactory.js +31 -0
- package/out/Project/functions/createProjectData.d.ts +2 -0
- package/out/Project/functions/createProjectData.js +102 -0
- package/out/Project/functions/createProjectProgram.d.ts +3 -0
- package/out/Project/functions/createProjectProgram.js +11 -0
- package/out/Project/functions/getChangedFilePaths.d.ts +2 -0
- package/out/Project/functions/getChangedFilePaths.js +47 -0
- package/out/Project/functions/getChangedSourceFiles.d.ts +2 -0
- package/out/Project/functions/getChangedSourceFiles.js +19 -0
- package/out/Project/functions/getParsedCommandLine.d.ts +3 -0
- package/out/Project/functions/getParsedCommandLine.js +41 -0
- package/out/Project/functions/getProjectReferences.d.ts +2 -0
- package/out/Project/functions/getProjectReferences.js +65 -0
- package/out/Project/functions/getResolvedProjectReferences.d.ts +3 -0
- package/out/Project/functions/getResolvedProjectReferences.js +43 -0
- package/out/Project/functions/setupProjectWatchProgram.d.ts +2 -0
- package/out/Project/functions/setupProjectWatchProgram.js +352 -0
- package/out/Project/functions/setupSolutionWatchProgram.d.ts +2 -0
- package/out/Project/functions/setupSolutionWatchProgram.js +355 -0
- package/out/Project/functions/tryRemoveOutput.d.ts +2 -0
- package/out/Project/functions/tryRemoveOutput.js +30 -0
- package/out/Project/functions/validateCompilerOptions.d.ts +2 -0
- package/out/Project/functions/validateCompilerOptions.js +87 -0
- package/out/Project/index.d.ts +4 -0
- package/out/Project/index.js +20 -0
- package/out/Project/preEmitDiagnostics/fileUsesCommentDirectives.d.ts +3 -0
- package/out/Project/preEmitDiagnostics/fileUsesCommentDirectives.js +28 -0
- package/out/Project/transformers/builtin/transformPaths.d.ts +5 -0
- package/out/Project/transformers/builtin/transformPaths.js +129 -0
- package/out/Project/transformers/builtin/transformTypeReferenceDirectives.d.ts +2 -0
- package/out/Project/transformers/builtin/transformTypeReferenceDirectives.js +23 -0
- package/out/Project/transformers/createTransformerList.d.ts +4 -0
- package/out/Project/transformers/createTransformerList.js +87 -0
- package/out/Project/transformers/createTransformerWatcher.d.ts +3 -0
- package/out/Project/transformers/createTransformerWatcher.js +59 -0
- package/out/Project/transformers/getPluginConfigs.d.ts +2 -0
- package/out/Project/transformers/getPluginConfigs.js +34 -0
- package/out/Project/util/createReadBuildProgramHost.d.ts +5 -0
- package/out/Project/util/createReadBuildProgramHost.js +15 -0
- package/out/Project/util/getCustomPreEmitDiagnostics.d.ts +4 -0
- package/out/Project/util/getCustomPreEmitDiagnostics.js +13 -0
- package/out/Project/util/isCompilableFile.d.ts +1 -0
- package/out/Project/util/isCompilableFile.js +18 -0
- package/out/Project/util/walkDirectorySync.d.ts +1 -0
- package/out/Project/util/walkDirectorySync.js +22 -0
- package/out/Shared/classes/Lazy.d.ts +8 -0
- package/out/Shared/classes/Lazy.js +22 -0
- package/out/Shared/classes/LogService.d.ts +9 -0
- package/out/Shared/classes/LogService.js +37 -0
- package/out/Shared/constants.d.ts +23 -0
- package/out/Shared/constants.js +50 -0
- package/out/Shared/diagnostics.d.ts +79 -0
- package/out/Shared/diagnostics.js +140 -0
- package/out/Shared/errors/DiagnosticError.d.ts +7 -0
- package/out/Shared/errors/DiagnosticError.js +16 -0
- package/out/Shared/errors/LoggableError.d.ts +5 -0
- package/out/Shared/errors/LoggableError.js +14 -0
- package/out/Shared/errors/ProjectError.d.ts +4 -0
- package/out/Shared/errors/ProjectError.js +12 -0
- package/out/Shared/index.d.ts +0 -0
- package/out/Shared/index.js +2 -0
- package/out/Shared/types.d.ts +50 -0
- package/out/Shared/types.js +3 -0
- package/out/Shared/util/assert.d.ts +1 -0
- package/out/Shared/util/assert.js +12 -0
- package/out/Shared/util/benchmark.d.ts +3 -0
- package/out/Shared/util/benchmark.js +32 -0
- package/out/Shared/util/createDiagnosticWithLocation.d.ts +3 -0
- package/out/Shared/util/createDiagnosticWithLocation.js +29 -0
- package/out/Shared/util/createGithubLink.d.ts +1 -0
- package/out/Shared/util/createGithubLink.js +12 -0
- package/out/Shared/util/createTextDiagnostic.d.ts +2 -0
- package/out/Shared/util/createTextDiagnostic.js +18 -0
- package/out/Shared/util/findAncestorDir.d.ts +1 -0
- package/out/Shared/util/findAncestorDir.js +16 -0
- package/out/Shared/util/findLastIndex.d.ts +1 -0
- package/out/Shared/util/findLastIndex.js +12 -0
- package/out/Shared/util/formatDiagnostics.d.ts +2 -0
- package/out/Shared/util/formatDiagnostics.js +19 -0
- package/out/Shared/util/getCanonicalFileName.d.ts +2 -0
- package/out/Shared/util/getCanonicalFileName.js +10 -0
- package/out/Shared/util/getOrSetDefault.d.ts +1 -0
- package/out/Shared/util/getOrSetDefault.js +12 -0
- package/out/Shared/util/getRootDirs.d.ts +2 -0
- package/out/Shared/util/getRootDirs.js +10 -0
- package/out/Shared/util/hasErrors.d.ts +2 -0
- package/out/Shared/util/hasErrors.js +11 -0
- package/out/Shared/util/isPathDescendantOf.d.ts +1 -0
- package/out/Shared/util/isPathDescendantOf.js +11 -0
- package/out/Shared/util/realPathExistsSync.d.ts +1 -0
- package/out/Shared/util/realPathExistsSync.js +13 -0
- package/out/Shared/warn.d.ts +1 -0
- package/out/Shared/warn.js +12 -0
- package/out/TSTransformer/classes/DiagnosticService.d.ts +11 -0
- package/out/TSTransformer/classes/DiagnosticService.js +37 -0
- package/out/TSTransformer/classes/MacroManager.d.ts +46 -0
- package/out/TSTransformer/classes/MacroManager.js +178 -0
- package/out/TSTransformer/classes/MultiTransformState.d.ts +9 -0
- package/out/TSTransformer/classes/MultiTransformState.js +15 -0
- package/out/TSTransformer/classes/TransformState.d.ts +73 -0
- package/out/TSTransformer/classes/TransformState.js +307 -0
- package/out/TSTransformer/index.d.ts +4 -0
- package/out/TSTransformer/index.js +23 -0
- package/out/TSTransformer/macros/callMacros.d.ts +2 -0
- package/out/TSTransformer/macros/callMacros.js +56 -0
- package/out/TSTransformer/macros/constructorMacros.d.ts +2 -0
- package/out/TSTransformer/macros/constructorMacros.js +97 -0
- package/out/TSTransformer/macros/identifierMacros.d.ts +2 -0
- package/out/TSTransformer/macros/identifierMacros.js +7 -0
- package/out/TSTransformer/macros/propertyCallMacros.d.ts +4 -0
- package/out/TSTransformer/macros/propertyCallMacros.js +726 -0
- package/out/TSTransformer/macros/types.d.ts +12 -0
- package/out/TSTransformer/macros/types.js +3 -0
- package/out/TSTransformer/nodes/binding/transformArrayAssignmentPattern.d.ts +4 -0
- package/out/TSTransformer/nodes/binding/transformArrayAssignmentPattern.js +78 -0
- package/out/TSTransformer/nodes/binding/transformArrayBindingPattern.d.ts +4 -0
- package/out/TSTransformer/nodes/binding/transformArrayBindingPattern.js +52 -0
- package/out/TSTransformer/nodes/binding/transformBindingName.d.ts +4 -0
- package/out/TSTransformer/nodes/binding/transformBindingName.js +30 -0
- package/out/TSTransformer/nodes/binding/transformObjectAssignmentPattern.d.ts +4 -0
- package/out/TSTransformer/nodes/binding/transformObjectAssignmentPattern.js +97 -0
- package/out/TSTransformer/nodes/binding/transformObjectBindingPattern.d.ts +4 -0
- package/out/TSTransformer/nodes/binding/transformObjectBindingPattern.js +57 -0
- package/out/TSTransformer/nodes/class/transformClassConstructor.d.ts +7 -0
- package/out/TSTransformer/nodes/class/transformClassConstructor.js +96 -0
- package/out/TSTransformer/nodes/class/transformClassLikeDeclaration.d.ts +7 -0
- package/out/TSTransformer/nodes/class/transformClassLikeDeclaration.js +262 -0
- package/out/TSTransformer/nodes/class/transformDecorators.d.ts +4 -0
- package/out/TSTransformer/nodes/class/transformDecorators.js +179 -0
- package/out/TSTransformer/nodes/class/transformPropertyDeclaration.d.ts +4 -0
- package/out/TSTransformer/nodes/class/transformPropertyDeclaration.js +33 -0
- package/out/TSTransformer/nodes/expressions/transformArrayLiteralExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformArrayLiteralExpression.js +79 -0
- package/out/TSTransformer/nodes/expressions/transformAwaitExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformAwaitExpression.js +13 -0
- package/out/TSTransformer/nodes/expressions/transformBinaryExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformBinaryExpression.js +199 -0
- package/out/TSTransformer/nodes/expressions/transformBooleanLiteral.d.ts +3 -0
- package/out/TSTransformer/nodes/expressions/transformBooleanLiteral.js +15 -0
- package/out/TSTransformer/nodes/expressions/transformCallExpression.d.ts +7 -0
- package/out/TSTransformer/nodes/expressions/transformCallExpression.js +191 -0
- package/out/TSTransformer/nodes/expressions/transformClassExpression.d.ts +3 -0
- package/out/TSTransformer/nodes/expressions/transformClassExpression.js +10 -0
- package/out/TSTransformer/nodes/expressions/transformConditionalExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformConditionalExpression.js +55 -0
- package/out/TSTransformer/nodes/expressions/transformDeleteExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformDeleteExpression.js +14 -0
- package/out/TSTransformer/nodes/expressions/transformElementAccessExpression.d.ts +5 -0
- package/out/TSTransformer/nodes/expressions/transformElementAccessExpression.js +62 -0
- package/out/TSTransformer/nodes/expressions/transformExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformExpression.js +107 -0
- package/out/TSTransformer/nodes/expressions/transformFunctionExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformFunctionExpression.js +46 -0
- package/out/TSTransformer/nodes/expressions/transformIdentifier.d.ts +5 -0
- package/out/TSTransformer/nodes/expressions/transformIdentifier.js +147 -0
- package/out/TSTransformer/nodes/expressions/transformImportExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformImportExpression.js +30 -0
- package/out/TSTransformer/nodes/expressions/transformJsxElement.d.ts +3 -0
- package/out/TSTransformer/nodes/expressions/transformJsxElement.js +8 -0
- package/out/TSTransformer/nodes/expressions/transformJsxExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformJsxExpression.js +19 -0
- package/out/TSTransformer/nodes/expressions/transformJsxFragment.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformJsxFragment.js +28 -0
- package/out/TSTransformer/nodes/expressions/transformJsxSelfClosingElement.d.ts +3 -0
- package/out/TSTransformer/nodes/expressions/transformJsxSelfClosingElement.js +8 -0
- package/out/TSTransformer/nodes/expressions/transformNewExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformNewExpression.js +26 -0
- package/out/TSTransformer/nodes/expressions/transformNoSubstitutionTemplateLiteral.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformNoSubstitutionTemplateLiteral.js +14 -0
- package/out/TSTransformer/nodes/expressions/transformNumericLiteral.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformNumericLiteral.js +13 -0
- package/out/TSTransformer/nodes/expressions/transformObjectLiteralExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformObjectLiteralExpression.js +98 -0
- package/out/TSTransformer/nodes/expressions/transformOmittedExpression.d.ts +2 -0
- package/out/TSTransformer/nodes/expressions/transformOmittedExpression.js +11 -0
- package/out/TSTransformer/nodes/expressions/transformParenthesizedExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformParenthesizedExpression.js +19 -0
- package/out/TSTransformer/nodes/expressions/transformPropertyAccessExpression.d.ts +5 -0
- package/out/TSTransformer/nodes/expressions/transformPropertyAccessExpression.js +36 -0
- package/out/TSTransformer/nodes/expressions/transformSpreadElement.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformSpreadElement.js +35 -0
- package/out/TSTransformer/nodes/expressions/transformStringLiteral.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformStringLiteral.js +12 -0
- package/out/TSTransformer/nodes/expressions/transformSuperKeyword.d.ts +2 -0
- package/out/TSTransformer/nodes/expressions/transformSuperKeyword.js +11 -0
- package/out/TSTransformer/nodes/expressions/transformTaggedTemplateExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformTaggedTemplateExpression.js +27 -0
- package/out/TSTransformer/nodes/expressions/transformTemplateExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformTemplateExpression.js +25 -0
- package/out/TSTransformer/nodes/expressions/transformThisExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformThisExpression.js +29 -0
- package/out/TSTransformer/nodes/expressions/transformTypeExpression.d.ts +3 -0
- package/out/TSTransformer/nodes/expressions/transformTypeExpression.js +8 -0
- package/out/TSTransformer/nodes/expressions/transformUnaryExpression.d.ts +5 -0
- package/out/TSTransformer/nodes/expressions/transformUnaryExpression.js +68 -0
- package/out/TSTransformer/nodes/expressions/transformVoidExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformVoidExpression.js +14 -0
- package/out/TSTransformer/nodes/expressions/transformYieldExpression.d.ts +4 -0
- package/out/TSTransformer/nodes/expressions/transformYieldExpression.js +46 -0
- package/out/TSTransformer/nodes/jsx/transformJsx.d.ts +4 -0
- package/out/TSTransformer/nodes/jsx/transformJsx.js +36 -0
- package/out/TSTransformer/nodes/jsx/transformJsxAttributes.d.ts +4 -0
- package/out/TSTransformer/nodes/jsx/transformJsxAttributes.js +83 -0
- package/out/TSTransformer/nodes/jsx/transformJsxChildren.d.ts +4 -0
- package/out/TSTransformer/nodes/jsx/transformJsxChildren.js +34 -0
- package/out/TSTransformer/nodes/jsx/transformJsxTagName.d.ts +4 -0
- package/out/TSTransformer/nodes/jsx/transformJsxTagName.js +42 -0
- package/out/TSTransformer/nodes/statements/transformBlock.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformBlock.js +14 -0
- package/out/TSTransformer/nodes/statements/transformBreakStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformBreakStatement.js +24 -0
- package/out/TSTransformer/nodes/statements/transformClassDeclaration.d.ts +3 -0
- package/out/TSTransformer/nodes/statements/transformClassDeclaration.js +8 -0
- package/out/TSTransformer/nodes/statements/transformContinueStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformContinueStatement.js +24 -0
- package/out/TSTransformer/nodes/statements/transformDoStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformDoStatement.js +31 -0
- package/out/TSTransformer/nodes/statements/transformEnumDeclaration.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformEnumDeclaration.js +97 -0
- package/out/TSTransformer/nodes/statements/transformExportAssignment.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformExportAssignment.js +53 -0
- package/out/TSTransformer/nodes/statements/transformExportDeclaration.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformExportDeclaration.js +109 -0
- package/out/TSTransformer/nodes/statements/transformExpressionStatement.d.ts +5 -0
- package/out/TSTransformer/nodes/statements/transformExpressionStatement.js +62 -0
- package/out/TSTransformer/nodes/statements/transformForOfStatement.d.ts +5 -0
- package/out/TSTransformer/nodes/statements/transformForOfStatement.js +375 -0
- package/out/TSTransformer/nodes/statements/transformForStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformForStatement.js +371 -0
- package/out/TSTransformer/nodes/statements/transformFunctionDeclaration.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformFunctionDeclaration.js +68 -0
- package/out/TSTransformer/nodes/statements/transformIfStatement.d.ts +5 -0
- package/out/TSTransformer/nodes/statements/transformIfStatement.js +46 -0
- package/out/TSTransformer/nodes/statements/transformImportDeclaration.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformImportDeclaration.js +98 -0
- package/out/TSTransformer/nodes/statements/transformImportEqualsDeclaration.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformImportEqualsDeclaration.js +36 -0
- package/out/TSTransformer/nodes/statements/transformModuleDeclaration.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformModuleDeclaration.js +122 -0
- package/out/TSTransformer/nodes/statements/transformReturnStatement.d.ts +5 -0
- package/out/TSTransformer/nodes/statements/transformReturnStatement.js +74 -0
- package/out/TSTransformer/nodes/statements/transformStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformStatement.js +83 -0
- package/out/TSTransformer/nodes/statements/transformSwitchStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformSwitchStatement.js +105 -0
- package/out/TSTransformer/nodes/statements/transformThrowStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformThrowStatement.js +18 -0
- package/out/TSTransformer/nodes/statements/transformTryStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformTryStatement.js +148 -0
- package/out/TSTransformer/nodes/statements/transformVariableStatement.d.ts +8 -0
- package/out/TSTransformer/nodes/statements/transformVariableStatement.js +155 -0
- package/out/TSTransformer/nodes/statements/transformWhileStatement.d.ts +4 -0
- package/out/TSTransformer/nodes/statements/transformWhileStatement.js +30 -0
- package/out/TSTransformer/nodes/transformEntityName.d.ts +4 -0
- package/out/TSTransformer/nodes/transformEntityName.js +24 -0
- package/out/TSTransformer/nodes/transformInitializer.d.ts +4 -0
- package/out/TSTransformer/nodes/transformInitializer.js +22 -0
- package/out/TSTransformer/nodes/transformInterpolatedStringPart.d.ts +3 -0
- package/out/TSTransformer/nodes/transformInterpolatedStringPart.js +12 -0
- package/out/TSTransformer/nodes/transformLogical.d.ts +4 -0
- package/out/TSTransformer/nodes/transformLogical.js +103 -0
- package/out/TSTransformer/nodes/transformLogicalOrCoalescingAssignmentExpression.d.ts +5 -0
- package/out/TSTransformer/nodes/transformLogicalOrCoalescingAssignmentExpression.js +91 -0
- package/out/TSTransformer/nodes/transformMethodDeclaration.d.ts +5 -0
- package/out/TSTransformer/nodes/transformMethodDeclaration.js +82 -0
- package/out/TSTransformer/nodes/transformOptionalChain.d.ts +46 -0
- package/out/TSTransformer/nodes/transformOptionalChain.js +257 -0
- package/out/TSTransformer/nodes/transformParameters.d.ts +8 -0
- package/out/TSTransformer/nodes/transformParameters.js +104 -0
- package/out/TSTransformer/nodes/transformPropertyName.d.ts +4 -0
- package/out/TSTransformer/nodes/transformPropertyName.js +18 -0
- package/out/TSTransformer/nodes/transformSourceFile.d.ts +4 -0
- package/out/TSTransformer/nodes/transformSourceFile.js +171 -0
- package/out/TSTransformer/nodes/transformStatementList.d.ts +7 -0
- package/out/TSTransformer/nodes/transformStatementList.js +63 -0
- package/out/TSTransformer/nodes/transformWritable.d.ts +9 -0
- package/out/TSTransformer/nodes/transformWritable.js +49 -0
- package/out/TSTransformer/typeGuards.d.ts +5 -0
- package/out/TSTransformer/typeGuards.js +27 -0
- package/out/TSTransformer/types.d.ts +9 -0
- package/out/TSTransformer/types.js +3 -0
- package/out/TSTransformer/util/addIndexDiagnostics.d.ts +3 -0
- package/out/TSTransformer/util/addIndexDiagnostics.js +24 -0
- package/out/TSTransformer/util/addOneIfArrayType.d.ts +4 -0
- package/out/TSTransformer/util/addOneIfArrayType.js +14 -0
- package/out/TSTransformer/util/arrayBindingPatternContainsHoists.d.ts +3 -0
- package/out/TSTransformer/util/arrayBindingPatternContainsHoists.js +23 -0
- package/out/TSTransformer/util/arrayLikeExpressionContainsSpread.d.ts +2 -0
- package/out/TSTransformer/util/arrayLikeExpressionContainsSpread.js +17 -0
- package/out/TSTransformer/util/assertNever.d.ts +1 -0
- package/out/TSTransformer/util/assertNever.js +36 -0
- package/out/TSTransformer/util/assignment.d.ts +7 -0
- package/out/TSTransformer/util/assignment.js +48 -0
- package/out/TSTransformer/util/binding/getAccessorForBindingType.d.ts +6 -0
- package/out/TSTransformer/util/binding/getAccessorForBindingType.js +141 -0
- package/out/TSTransformer/util/binding/getTargetIdForBindingPattern.d.ts +4 -0
- package/out/TSTransformer/util/binding/getTargetIdForBindingPattern.js +15 -0
- package/out/TSTransformer/util/binding/objectAccessor.d.ts +4 -0
- package/out/TSTransformer/util/binding/objectAccessor.js +39 -0
- package/out/TSTransformer/util/bitwise.d.ts +6 -0
- package/out/TSTransformer/util/bitwise.js +67 -0
- package/out/TSTransformer/util/checkVariableHoist.d.ts +3 -0
- package/out/TSTransformer/util/checkVariableHoist.js +33 -0
- package/out/TSTransformer/util/cleanModuleName.d.ts +1 -0
- package/out/TSTransformer/util/cleanModuleName.js +7 -0
- package/out/TSTransformer/util/convertToIndexableExpression.d.ts +3 -0
- package/out/TSTransformer/util/convertToIndexableExpression.js +14 -0
- package/out/TSTransformer/util/createBinaryFromOperator.d.ts +4 -0
- package/out/TSTransformer/util/createBinaryFromOperator.js +54 -0
- package/out/TSTransformer/util/createGetService.d.ts +2 -0
- package/out/TSTransformer/util/createGetService.js +15 -0
- package/out/TSTransformer/util/createHoistDeclaration.d.ts +4 -0
- package/out/TSTransformer/util/createHoistDeclaration.js +20 -0
- package/out/TSTransformer/util/createImportExpression.d.ts +5 -0
- package/out/TSTransformer/util/createImportExpression.js +181 -0
- package/out/TSTransformer/util/createStringFromLiteral.d.ts +2 -0
- package/out/TSTransformer/util/createStringFromLiteral.js +27 -0
- package/out/TSTransformer/util/createTransformServices.d.ts +3 -0
- package/out/TSTransformer/util/createTransformServices.js +9 -0
- package/out/TSTransformer/util/createTruthinessChecks.d.ts +5 -0
- package/out/TSTransformer/util/createTruthinessChecks.js +50 -0
- package/out/TSTransformer/util/createTypeCheck.d.ts +2 -0
- package/out/TSTransformer/util/createTypeCheck.js +11 -0
- package/out/TSTransformer/util/ensureTransformOrder.d.ts +5 -0
- package/out/TSTransformer/util/ensureTransformOrder.js +39 -0
- package/out/TSTransformer/util/expressionChain.d.ts +3 -0
- package/out/TSTransformer/util/expressionChain.js +16 -0
- package/out/TSTransformer/util/expressionMightMutate.d.ts +4 -0
- package/out/TSTransformer/util/expressionMightMutate.js +57 -0
- package/out/TSTransformer/util/findConstructor.d.ts +4 -0
- package/out/TSTransformer/util/findConstructor.js +11 -0
- package/out/TSTransformer/util/fixupWhitespaceAndDecodeEntities.d.ts +1 -0
- package/out/TSTransformer/util/fixupWhitespaceAndDecodeEntities.js +306 -0
- package/out/TSTransformer/util/getAddIterableToArrayBuilder.d.ts +6 -0
- package/out/TSTransformer/util/getAddIterableToArrayBuilder.js +253 -0
- package/out/TSTransformer/util/getAssignableValue.d.ts +3 -0
- package/out/TSTransformer/util/getAssignableValue.js +15 -0
- package/out/TSTransformer/util/getConstantValueLiteral.d.ts +4 -0
- package/out/TSTransformer/util/getConstantValueLiteral.js +19 -0
- package/out/TSTransformer/util/getDeclaredVariables.d.ts +2 -0
- package/out/TSTransformer/util/getDeclaredVariables.js +37 -0
- package/out/TSTransformer/util/getExtendsNode.d.ts +2 -0
- package/out/TSTransformer/util/getExtendsNode.js +16 -0
- package/out/TSTransformer/util/getFlags.d.ts +1 -0
- package/out/TSTransformer/util/getFlags.js +13 -0
- package/out/TSTransformer/util/getKindName.d.ts +2 -0
- package/out/TSTransformer/util/getKindName.js +61 -0
- package/out/TSTransformer/util/getOriginalSymbolOfNode.d.ts +2 -0
- package/out/TSTransformer/util/getOriginalSymbolOfNode.js +15 -0
- package/out/TSTransformer/util/getSourceFileFromModuleSpecifier.d.ts +3 -0
- package/out/TSTransformer/util/getSourceFileFromModuleSpecifier.js +33 -0
- package/out/TSTransformer/util/getStatements.d.ts +2 -0
- package/out/TSTransformer/util/getStatements.js +11 -0
- package/out/TSTransformer/util/hasMultipleDefinitions.d.ts +2 -0
- package/out/TSTransformer/util/hasMultipleDefinitions.js +17 -0
- package/out/TSTransformer/util/isBlockedByTryStatement.d.ts +3 -0
- package/out/TSTransformer/util/isBlockedByTryStatement.js +17 -0
- package/out/TSTransformer/util/isMethod.d.ts +4 -0
- package/out/TSTransformer/util/isMethod.js +90 -0
- package/out/TSTransformer/util/isSymbolMutable.d.ts +3 -0
- package/out/TSTransformer/util/isSymbolMutable.js +24 -0
- package/out/TSTransformer/util/isSymbolOfValue.d.ts +2 -0
- package/out/TSTransformer/util/isSymbolOfValue.js +11 -0
- package/out/TSTransformer/util/isUsedAsStatement.d.ts +2 -0
- package/out/TSTransformer/util/isUsedAsStatement.js +23 -0
- package/out/TSTransformer/util/isValidMethodIndexWithoutCall.d.ts +3 -0
- package/out/TSTransformer/util/isValidMethodIndexWithoutCall.js +31 -0
- package/out/TSTransformer/util/offset.d.ts +2 -0
- package/out/TSTransformer/util/offset.js +44 -0
- package/out/TSTransformer/util/pointer.d.ts +13 -0
- package/out/TSTransformer/util/pointer.js +46 -0
- package/out/TSTransformer/util/spreadDestructuring/index.d.ts +9 -0
- package/out/TSTransformer/util/spreadDestructuring/index.js +45 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureArray.d.ts +3 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureArray.js +17 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureGenerator.d.ts +3 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureGenerator.js +33 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureMap.d.ts +3 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureMap.js +34 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureObject.d.ts +3 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureObject.js +41 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureSet.d.ts +3 -0
- package/out/TSTransformer/util/spreadDestructuring/spreadDestructureSet.js +28 -0
- package/out/TSTransformer/util/traversal.d.ts +7 -0
- package/out/TSTransformer/util/traversal.js +57 -0
- package/out/TSTransformer/util/types.d.ts +31 -0
- package/out/TSTransformer/util/types.js +259 -0
- package/out/TSTransformer/util/validateIdentifier.d.ts +3 -0
- package/out/TSTransformer/util/validateIdentifier.js +18 -0
- package/out/TSTransformer/util/validateMethodAssignment.d.ts +3 -0
- package/out/TSTransformer/util/validateMethodAssignment.js +81 -0
- package/out/TSTransformer/util/validateNotAny.d.ts +3 -0
- package/out/TSTransformer/util/validateNotAny.js +37 -0
- package/out/TSTransformer/util/valueToIdStr.d.ts +2 -0
- package/out/TSTransformer/util/valueToIdStr.js +29 -0
- package/out/TSTransformer/util/wrapExpressionStatement.d.ts +2 -0
- package/out/TSTransformer/util/wrapExpressionStatement.js +22 -0
- package/out/TSTransformer/util/wrapReturnIfLuaTuple.d.ts +4 -0
- package/out/TSTransformer/util/wrapReturnIfLuaTuple.js +56 -0
- package/out/TSTransformer/util/wrapStatementsAsGenerator.d.ts +4 -0
- package/out/TSTransformer/util/wrapStatementsAsGenerator.js +19 -0
- package/package.json +72 -0
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.setupSolutionWatchProgram = setupSolutionWatchProgram;
|
|
7
|
+
const chokidar_1 = __importDefault(require("chokidar"));
|
|
8
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const checkFileName_1 = require("./checkFileName");
|
|
11
|
+
const cleanup_1 = require("./cleanup");
|
|
12
|
+
const compileFiles_1 = require("./compileFiles");
|
|
13
|
+
const copyFiles_1 = require("./copyFiles");
|
|
14
|
+
const copyInclude_1 = require("./copyInclude");
|
|
15
|
+
const copyItem_1 = require("./copyItem");
|
|
16
|
+
const createPathTranslator_1 = require("./createPathTranslator");
|
|
17
|
+
const createProgramFactory_1 = require("./createProgramFactory");
|
|
18
|
+
const createProjectData_1 = require("./createProjectData");
|
|
19
|
+
const getChangedSourceFiles_1 = require("./getChangedSourceFiles");
|
|
20
|
+
const getParsedCommandLine_1 = require("./getParsedCommandLine");
|
|
21
|
+
const getProjectReferences_1 = require("./getProjectReferences");
|
|
22
|
+
const tryRemoveOutput_1 = require("./tryRemoveOutput");
|
|
23
|
+
const isCompilableFile_1 = require("../util/isCompilableFile");
|
|
24
|
+
const walkDirectorySync_1 = require("../util/walkDirectorySync");
|
|
25
|
+
const constants_1 = require("../../Shared/constants");
|
|
26
|
+
const DiagnosticError_1 = require("../../Shared/errors/DiagnosticError");
|
|
27
|
+
const assert_1 = require("../../Shared/util/assert");
|
|
28
|
+
const getRootDirs_1 = require("../../Shared/util/getRootDirs");
|
|
29
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
30
|
+
const CHOKIDAR_OPTIONS = {
|
|
31
|
+
awaitWriteFinish: {
|
|
32
|
+
pollInterval: 10,
|
|
33
|
+
stabilityThreshold: 50,
|
|
34
|
+
},
|
|
35
|
+
ignoreInitial: true,
|
|
36
|
+
};
|
|
37
|
+
function fixSlashes(fsPath) {
|
|
38
|
+
return fsPath.replace(/\\/g, "/");
|
|
39
|
+
}
|
|
40
|
+
function setupSolutionWatchProgram(rootTsConfigPath, projectOptions) {
|
|
41
|
+
const referencedProjects = (0, getProjectReferences_1.getProjectReferences)(rootTsConfigPath, projectOptions.luau);
|
|
42
|
+
const projectStates = new Map();
|
|
43
|
+
const rootData = (0, createProjectData_1.createProjectData)(rootTsConfigPath, projectOptions);
|
|
44
|
+
rootData.referencedProjects = referencedProjects;
|
|
45
|
+
rootData.isCompositeProject = true;
|
|
46
|
+
const rootRojoConfigPath = rootData.rojoConfigPath;
|
|
47
|
+
const rootIncludePath = rootData.projectOptions.includePath;
|
|
48
|
+
for (const refProject of referencedProjects) {
|
|
49
|
+
const refProjectOptions = { ...projectOptions };
|
|
50
|
+
refProjectOptions.noInclude = true;
|
|
51
|
+
if (rootRojoConfigPath) {
|
|
52
|
+
refProjectOptions.rojo = rootRojoConfigPath;
|
|
53
|
+
}
|
|
54
|
+
const data = (0, createProjectData_1.createProjectData)(refProject.tsConfigPath, refProjectOptions);
|
|
55
|
+
data.referencedProjects = referencedProjects;
|
|
56
|
+
data.isCompositeProject = true;
|
|
57
|
+
data.isReferencedProject = true;
|
|
58
|
+
if (rootIncludePath) {
|
|
59
|
+
data.rootProjectIncludePath = rootIncludePath;
|
|
60
|
+
}
|
|
61
|
+
const { fileNames, options } = (0, getParsedCommandLine_1.getParsedCommandLine)(data);
|
|
62
|
+
projectStates.set(refProject.tsConfigPath, {
|
|
63
|
+
data,
|
|
64
|
+
fileNamesSet: new Set(fileNames),
|
|
65
|
+
options,
|
|
66
|
+
program: undefined,
|
|
67
|
+
pathTranslator: undefined,
|
|
68
|
+
createProgram: (0, createProgramFactory_1.createProgramFactory)(data, options),
|
|
69
|
+
rootDirs: (0, getRootDirs_1.getRootDirs)(options),
|
|
70
|
+
isRoot: false,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
const { fileNames: rootFileNames, options: rootOptions } = (0, getParsedCommandLine_1.getParsedCommandLine)(rootData);
|
|
74
|
+
projectStates.set(rootTsConfigPath, {
|
|
75
|
+
data: rootData,
|
|
76
|
+
fileNamesSet: new Set(rootFileNames),
|
|
77
|
+
options: rootOptions,
|
|
78
|
+
program: undefined,
|
|
79
|
+
pathTranslator: undefined,
|
|
80
|
+
createProgram: (0, createProgramFactory_1.createProgramFactory)(rootData, rootOptions),
|
|
81
|
+
rootDirs: (0, getRootDirs_1.getRootDirs)(rootOptions),
|
|
82
|
+
isRoot: true,
|
|
83
|
+
});
|
|
84
|
+
let initialCompileCompleted = false;
|
|
85
|
+
let collecting = false;
|
|
86
|
+
let filesToAdd = new Set();
|
|
87
|
+
let filesToChange = new Set();
|
|
88
|
+
let filesToDelete = new Set();
|
|
89
|
+
const watchReporter = typescript_1.default.createWatchStatusReporter(typescript_1.default.sys, true);
|
|
90
|
+
const diagnosticReporter = typescript_1.default.createDiagnosticReporter(typescript_1.default.sys, true);
|
|
91
|
+
function reportText(messageText) {
|
|
92
|
+
watchReporter({
|
|
93
|
+
category: typescript_1.default.DiagnosticCategory.Message,
|
|
94
|
+
messageText,
|
|
95
|
+
code: 0,
|
|
96
|
+
file: undefined,
|
|
97
|
+
length: undefined,
|
|
98
|
+
start: undefined,
|
|
99
|
+
}, typescript_1.default.sys.newLine, rootOptions);
|
|
100
|
+
}
|
|
101
|
+
function reportEmitResult(diagnostics) {
|
|
102
|
+
for (const diagnostic of diagnostics) {
|
|
103
|
+
diagnosticReporter(diagnostic);
|
|
104
|
+
}
|
|
105
|
+
const amtErrors = diagnostics.filter(v => v.category === typescript_1.default.DiagnosticCategory.Error).length;
|
|
106
|
+
reportText(`Found ${amtErrors} error${amtErrors === 1 ? "" : "s"}. Watching for file changes.`);
|
|
107
|
+
}
|
|
108
|
+
function findProjectForFile(filePath) {
|
|
109
|
+
const normalizedPath = path_1.default.normalize(filePath);
|
|
110
|
+
for (const state of projectStates.values()) {
|
|
111
|
+
for (const rootDir of state.rootDirs) {
|
|
112
|
+
if (normalizedPath.startsWith(path_1.default.normalize(rootDir) + path_1.default.sep)) {
|
|
113
|
+
return state;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
function refreshProgram(state) {
|
|
120
|
+
state.program = state.createProgram([...state.fileNamesSet], state.options);
|
|
121
|
+
state.pathTranslator = (0, createPathTranslator_1.createPathTranslator)(state.program, state.data);
|
|
122
|
+
}
|
|
123
|
+
function buildProject(state) {
|
|
124
|
+
refreshProgram(state);
|
|
125
|
+
(0, assert_1.assert)(state.program && state.pathTranslator);
|
|
126
|
+
if (state.isRoot) {
|
|
127
|
+
(0, cleanup_1.cleanup)(state.pathTranslator);
|
|
128
|
+
(0, copyInclude_1.copyInclude)(state.data);
|
|
129
|
+
}
|
|
130
|
+
(0, copyFiles_1.copyFiles)(state.data, state.pathTranslator, new Set(state.rootDirs));
|
|
131
|
+
const sourceFiles = (0, getChangedSourceFiles_1.getChangedSourceFiles)(state.program);
|
|
132
|
+
return (0, compileFiles_1.compileFiles)(state.program.getProgram(), state.data, state.pathTranslator, sourceFiles);
|
|
133
|
+
}
|
|
134
|
+
function runInitialCompile() {
|
|
135
|
+
const allDiagnostics = [];
|
|
136
|
+
for (const refProject of referencedProjects) {
|
|
137
|
+
const state = projectStates.get(refProject.tsConfigPath);
|
|
138
|
+
if (state) {
|
|
139
|
+
const result = buildProject(state);
|
|
140
|
+
allDiagnostics.push(...result.diagnostics);
|
|
141
|
+
if (result.emitSkipped) {
|
|
142
|
+
return allDiagnostics;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
const rootState = projectStates.get(rootTsConfigPath);
|
|
147
|
+
if (rootState) {
|
|
148
|
+
const result = buildProject(rootState);
|
|
149
|
+
allDiagnostics.push(...result.diagnostics);
|
|
150
|
+
if (!result.emitSkipped) {
|
|
151
|
+
initialCompileCompleted = true;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return allDiagnostics;
|
|
155
|
+
}
|
|
156
|
+
const filesToCompile = new Map();
|
|
157
|
+
const filesToCopy = new Map();
|
|
158
|
+
const filesToClean = new Map();
|
|
159
|
+
function getOrCreateSet(map, key) {
|
|
160
|
+
let set = map.get(key);
|
|
161
|
+
if (!set) {
|
|
162
|
+
set = new Set();
|
|
163
|
+
map.set(key, set);
|
|
164
|
+
}
|
|
165
|
+
return set;
|
|
166
|
+
}
|
|
167
|
+
function runIncrementalCompile(additions, changes, removals) {
|
|
168
|
+
const affectedProjects = new Set();
|
|
169
|
+
for (const fsPath of additions) {
|
|
170
|
+
const state = findProjectForFile(fsPath);
|
|
171
|
+
if (!state)
|
|
172
|
+
continue;
|
|
173
|
+
affectedProjects.add(state.data.tsConfigPath);
|
|
174
|
+
if (fs_extra_1.default.statSync(fsPath).isDirectory()) {
|
|
175
|
+
(0, walkDirectorySync_1.walkDirectorySync)(fsPath, item => {
|
|
176
|
+
if ((0, isCompilableFile_1.isCompilableFile)(item)) {
|
|
177
|
+
state.fileNamesSet.add(item);
|
|
178
|
+
getOrCreateSet(filesToCompile, state.data.tsConfigPath).add(item);
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
else if ((0, isCompilableFile_1.isCompilableFile)(fsPath)) {
|
|
183
|
+
state.fileNamesSet.add(fsPath);
|
|
184
|
+
getOrCreateSet(filesToCompile, state.data.tsConfigPath).add(fsPath);
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
(0, checkFileName_1.checkFileName)(fsPath);
|
|
188
|
+
getOrCreateSet(filesToCopy, state.data.tsConfigPath).add(fsPath);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
for (const fsPath of changes) {
|
|
192
|
+
const state = findProjectForFile(fsPath);
|
|
193
|
+
if (!state)
|
|
194
|
+
continue;
|
|
195
|
+
affectedProjects.add(state.data.tsConfigPath);
|
|
196
|
+
if ((0, isCompilableFile_1.isCompilableFile)(fsPath)) {
|
|
197
|
+
getOrCreateSet(filesToCompile, state.data.tsConfigPath).add(fsPath);
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
if (fsPath.endsWith(constants_1.DTS_EXT)) {
|
|
201
|
+
const transformerWatcher = state.data.transformerWatcher;
|
|
202
|
+
if (transformerWatcher) {
|
|
203
|
+
const contents = typescript_1.default.sys.readFile(fsPath);
|
|
204
|
+
if (contents) {
|
|
205
|
+
transformerWatcher.updateFile(fsPath, contents);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
getOrCreateSet(filesToCopy, state.data.tsConfigPath).add(fsPath);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
for (const fsPath of removals) {
|
|
213
|
+
const state = findProjectForFile(fsPath);
|
|
214
|
+
if (!state)
|
|
215
|
+
continue;
|
|
216
|
+
affectedProjects.add(state.data.tsConfigPath);
|
|
217
|
+
state.fileNamesSet.delete(fsPath);
|
|
218
|
+
getOrCreateSet(filesToClean, state.data.tsConfigPath).add(fsPath);
|
|
219
|
+
}
|
|
220
|
+
for (const refProject of referencedProjects) {
|
|
221
|
+
if (affectedProjects.has(refProject.tsConfigPath)) {
|
|
222
|
+
affectedProjects.add(rootTsConfigPath);
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
const allDiagnostics = [];
|
|
227
|
+
for (const refProject of referencedProjects) {
|
|
228
|
+
if (!affectedProjects.has(refProject.tsConfigPath))
|
|
229
|
+
continue;
|
|
230
|
+
const state = projectStates.get(refProject.tsConfigPath);
|
|
231
|
+
if (!state)
|
|
232
|
+
continue;
|
|
233
|
+
refreshProgram(state);
|
|
234
|
+
(0, assert_1.assert)(state.program && state.pathTranslator);
|
|
235
|
+
const toCompile = filesToCompile.get(refProject.tsConfigPath);
|
|
236
|
+
const sourceFiles = (0, getChangedSourceFiles_1.getChangedSourceFiles)(state.program, state.options.incremental ? undefined : toCompile ? [...toCompile] : undefined);
|
|
237
|
+
const emitResult = (0, compileFiles_1.compileFiles)(state.program.getProgram(), state.data, state.pathTranslator, sourceFiles);
|
|
238
|
+
allDiagnostics.push(...emitResult.diagnostics);
|
|
239
|
+
if (emitResult.emitSkipped) {
|
|
240
|
+
return allDiagnostics;
|
|
241
|
+
}
|
|
242
|
+
const toClean = filesToClean.get(refProject.tsConfigPath);
|
|
243
|
+
if (toClean) {
|
|
244
|
+
for (const fsPath of toClean) {
|
|
245
|
+
(0, tryRemoveOutput_1.tryRemoveOutput)(state.pathTranslator, state.pathTranslator.getOutputPath(fsPath));
|
|
246
|
+
if (state.options.declaration) {
|
|
247
|
+
(0, tryRemoveOutput_1.tryRemoveOutput)(state.pathTranslator, state.pathTranslator.getOutputDeclarationPath(fsPath));
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
const toCopy = filesToCopy.get(refProject.tsConfigPath);
|
|
252
|
+
if (toCopy) {
|
|
253
|
+
for (const fsPath of toCopy) {
|
|
254
|
+
(0, copyItem_1.copyItem)(state.data, state.pathTranslator, fsPath);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
if (affectedProjects.has(rootTsConfigPath)) {
|
|
259
|
+
const state = projectStates.get(rootTsConfigPath);
|
|
260
|
+
if (state) {
|
|
261
|
+
refreshProgram(state);
|
|
262
|
+
(0, assert_1.assert)(state.program && state.pathTranslator);
|
|
263
|
+
const toCompile = filesToCompile.get(rootTsConfigPath);
|
|
264
|
+
const sourceFiles = (0, getChangedSourceFiles_1.getChangedSourceFiles)(state.program, state.options.incremental ? undefined : toCompile ? [...toCompile] : undefined);
|
|
265
|
+
const emitResult = (0, compileFiles_1.compileFiles)(state.program.getProgram(), state.data, state.pathTranslator, sourceFiles);
|
|
266
|
+
allDiagnostics.push(...emitResult.diagnostics);
|
|
267
|
+
if (!emitResult.emitSkipped) {
|
|
268
|
+
const toClean = filesToClean.get(rootTsConfigPath);
|
|
269
|
+
if (toClean) {
|
|
270
|
+
for (const fsPath of toClean) {
|
|
271
|
+
(0, tryRemoveOutput_1.tryRemoveOutput)(state.pathTranslator, state.pathTranslator.getOutputPath(fsPath));
|
|
272
|
+
if (state.options.declaration) {
|
|
273
|
+
(0, tryRemoveOutput_1.tryRemoveOutput)(state.pathTranslator, state.pathTranslator.getOutputDeclarationPath(fsPath));
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
const toCopy = filesToCopy.get(rootTsConfigPath);
|
|
278
|
+
if (toCopy) {
|
|
279
|
+
for (const fsPath of toCopy) {
|
|
280
|
+
(0, copyItem_1.copyItem)(state.data, state.pathTranslator, fsPath);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
filesToCompile.clear();
|
|
287
|
+
filesToCopy.clear();
|
|
288
|
+
filesToClean.clear();
|
|
289
|
+
return allDiagnostics;
|
|
290
|
+
}
|
|
291
|
+
function runCompile() {
|
|
292
|
+
try {
|
|
293
|
+
if (!initialCompileCompleted) {
|
|
294
|
+
return runInitialCompile();
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
const additions = filesToAdd;
|
|
298
|
+
const changes = filesToChange;
|
|
299
|
+
const removals = filesToDelete;
|
|
300
|
+
filesToAdd = new Set();
|
|
301
|
+
filesToChange = new Set();
|
|
302
|
+
filesToDelete = new Set();
|
|
303
|
+
return runIncrementalCompile(additions, changes, removals);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
catch (e) {
|
|
307
|
+
if (e instanceof DiagnosticError_1.DiagnosticError) {
|
|
308
|
+
return [...e.diagnostics];
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
throw e;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
function closeEventCollection() {
|
|
316
|
+
collecting = false;
|
|
317
|
+
reportEmitResult(runCompile());
|
|
318
|
+
}
|
|
319
|
+
function openEventCollection() {
|
|
320
|
+
if (!collecting) {
|
|
321
|
+
collecting = true;
|
|
322
|
+
reportText("File change detected. Starting incremental compilation...");
|
|
323
|
+
setTimeout(closeEventCollection, 100);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
function collectAddEvent(fsPath) {
|
|
327
|
+
filesToAdd.add(fixSlashes(fsPath));
|
|
328
|
+
openEventCollection();
|
|
329
|
+
}
|
|
330
|
+
function collectChangeEvent(fsPath) {
|
|
331
|
+
filesToChange.add(fixSlashes(fsPath));
|
|
332
|
+
openEventCollection();
|
|
333
|
+
}
|
|
334
|
+
function collectDeleteEvent(fsPath) {
|
|
335
|
+
filesToDelete.add(fixSlashes(fsPath));
|
|
336
|
+
openEventCollection();
|
|
337
|
+
}
|
|
338
|
+
const allRootDirs = [];
|
|
339
|
+
for (const state of projectStates.values()) {
|
|
340
|
+
allRootDirs.push(...state.rootDirs);
|
|
341
|
+
}
|
|
342
|
+
const chokidarOptions = { ...CHOKIDAR_OPTIONS, usePolling: projectOptions.usePolling };
|
|
343
|
+
chokidar_1.default
|
|
344
|
+
.watch(allRootDirs, chokidarOptions)
|
|
345
|
+
.on("add", collectAddEvent)
|
|
346
|
+
.on("addDir", collectAddEvent)
|
|
347
|
+
.on("change", collectChangeEvent)
|
|
348
|
+
.on("unlink", collectDeleteEvent)
|
|
349
|
+
.on("unlinkDir", collectDeleteEvent)
|
|
350
|
+
.once("ready", () => {
|
|
351
|
+
reportText("Starting compilation in watch mode (solution build)...");
|
|
352
|
+
reportEmitResult(runCompile());
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
//# sourceMappingURL=setupSolutionWatchProgram.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.tryRemoveOutput = tryRemoveOutput;
|
|
7
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
+
const LogService_1 = require("../../Shared/classes/LogService");
|
|
9
|
+
const constants_1 = require("../../Shared/constants");
|
|
10
|
+
function isOutputFileOrphaned(pathTranslator, filePath) {
|
|
11
|
+
if (filePath.endsWith(constants_1.DTS_EXT) && !pathTranslator.declaration) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
for (const path of pathTranslator.getInputPaths(filePath)) {
|
|
15
|
+
if (fs_extra_1.default.pathExistsSync(path)) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
if (pathTranslator.buildInfoOutputPath === filePath) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
function tryRemoveOutput(pathTranslator, outPath) {
|
|
25
|
+
if (isOutputFileOrphaned(pathTranslator, outPath)) {
|
|
26
|
+
fs_extra_1.default.removeSync(outPath);
|
|
27
|
+
LogService_1.LogService.writeLineIfVerbose(`remove ${outPath}`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=tryRemoveOutput.js.map
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.validateCompilerOptions = validateCompilerOptions;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const kleur_1 = __importDefault(require("kleur"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const constants_1 = require("../../Shared/constants");
|
|
11
|
+
const ProjectError_1 = require("../../Shared/errors/ProjectError");
|
|
12
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
13
|
+
const ENFORCED_OPTIONS = {
|
|
14
|
+
target: typescript_1.default.ScriptTarget.ESNext,
|
|
15
|
+
module: typescript_1.default.ModuleKind.CommonJS,
|
|
16
|
+
moduleDetection: typescript_1.default.ModuleDetectionKind.Force,
|
|
17
|
+
moduleResolution: typescript_1.default.ModuleResolutionKind.Node10,
|
|
18
|
+
noLib: true,
|
|
19
|
+
strict: true,
|
|
20
|
+
allowSyntheticDefaultImports: true,
|
|
21
|
+
};
|
|
22
|
+
function y(str) {
|
|
23
|
+
return kleur_1.default.yellow(str);
|
|
24
|
+
}
|
|
25
|
+
function validateTypeRoots(projectPath, typeRoots) {
|
|
26
|
+
for (const typeRoot of typeRoots) {
|
|
27
|
+
const resolvedTypeRoot = path_1.default.resolve(projectPath, typeRoot);
|
|
28
|
+
if (resolvedTypeRoot.endsWith(constants_1.RBXTS_SCOPE) && fs_1.default.existsSync(resolvedTypeRoot)) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
function validateCompilerOptions(opts, projectPath) {
|
|
35
|
+
var _a, _b;
|
|
36
|
+
const errors = new Array();
|
|
37
|
+
if (opts.noLib !== ENFORCED_OPTIONS.noLib) {
|
|
38
|
+
errors.push(`${y(`"noLib"`)} must be ${y(`true`)}`);
|
|
39
|
+
}
|
|
40
|
+
if (opts.strict !== ENFORCED_OPTIONS.strict) {
|
|
41
|
+
errors.push(`${y(`"strict"`)} must be ${y(`true`)}`);
|
|
42
|
+
}
|
|
43
|
+
if (opts.target !== ENFORCED_OPTIONS.target) {
|
|
44
|
+
}
|
|
45
|
+
if (opts.module !== ENFORCED_OPTIONS.module) {
|
|
46
|
+
errors.push(`${y(`"module"`)} must be ${y(`commonjs`)}`);
|
|
47
|
+
}
|
|
48
|
+
if (opts.moduleDetection !== ENFORCED_OPTIONS.moduleDetection) {
|
|
49
|
+
errors.push(`${y(`"moduleDetection"`)} must be ${y(`"force"`)}`);
|
|
50
|
+
}
|
|
51
|
+
if (opts.moduleResolution !== ENFORCED_OPTIONS.moduleResolution) {
|
|
52
|
+
errors.push(`${y(`"moduleResolution"`)} must be ${y(`"Node"`)}`);
|
|
53
|
+
}
|
|
54
|
+
if (opts.allowSyntheticDefaultImports !== ENFORCED_OPTIONS.allowSyntheticDefaultImports) {
|
|
55
|
+
errors.push(`${y(`"allowSyntheticDefaultImports"`)} must be ${y(`true`)}`);
|
|
56
|
+
}
|
|
57
|
+
if (opts.typeRoots === undefined || !validateTypeRoots(projectPath, opts.typeRoots)) {
|
|
58
|
+
errors.push(`${y(`"typeRoots"`)} must contain a path to ${y(`${constants_1.NODE_MODULES}/${constants_1.RBXTS_SCOPE}`)} (e.g., "node_modules/@rbxts" or "../../node_modules/@rbxts")`);
|
|
59
|
+
}
|
|
60
|
+
for (const typesLocation of (_a = opts.types) !== null && _a !== void 0 ? _a : []) {
|
|
61
|
+
const typeRoots = (_b = opts.typeRoots) !== null && _b !== void 0 ? _b : ["node_modules/@rbxts"];
|
|
62
|
+
if (!typeRoots.some(typeRoot => {
|
|
63
|
+
const typesPath = path_1.default.resolve(projectPath, typeRoot, typesLocation);
|
|
64
|
+
return fs_1.default.existsSync(typesPath) || fs_1.default.existsSync(typesPath + constants_1.DTS_EXT);
|
|
65
|
+
})) {
|
|
66
|
+
errors.push(`${y(`"types"`)} ${y(typesLocation)} were not found. Make sure the path is relative to \`typeRoots\``);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (opts.rootDir === undefined && opts.rootDirs === undefined) {
|
|
70
|
+
errors.push(`${y(`"rootDir"`)} or ${y(`"rootDirs"`)} must be defined`);
|
|
71
|
+
}
|
|
72
|
+
if (opts.outDir === undefined) {
|
|
73
|
+
errors.push(`${y(`"outDir"`)} must be defined`);
|
|
74
|
+
}
|
|
75
|
+
if (opts.importsNotUsedAsValues !== undefined) {
|
|
76
|
+
const suggestedValue = opts.importsNotUsedAsValues === typescript_1.default.ImportsNotUsedAsValues.Preserve ? "true" : "false";
|
|
77
|
+
errors.push(`${y(`"importsNotUsedAsValues"`)} is no longer supported, use ${y(`"verbatimModuleSyntax": ${suggestedValue}`)} instead`);
|
|
78
|
+
}
|
|
79
|
+
if (errors.length > 0) {
|
|
80
|
+
throw new ProjectError_1.ProjectError([
|
|
81
|
+
`Invalid "tsconfig.json" configuration!`,
|
|
82
|
+
`https://roblox-ts.com/docs/quick-start#project-folder-setup`,
|
|
83
|
+
errors.map(e => `- ${e}\n`).join(""),
|
|
84
|
+
].join("\n"));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=validateCompilerOptions.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./classes/VirtualProject"), exports);
|
|
18
|
+
__exportStar(require("./functions/cleanup"), exports);
|
|
19
|
+
__exportStar(require("./functions/createProjectData"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fileUsesCommentDirectives = fileUsesCommentDirectives;
|
|
4
|
+
const diagnostics_1 = require("../../Shared/diagnostics");
|
|
5
|
+
function fileUsesCommentDirectives(data, sourceFile) {
|
|
6
|
+
var _a;
|
|
7
|
+
if (data.projectOptions.allowCommentDirectives) {
|
|
8
|
+
return [];
|
|
9
|
+
}
|
|
10
|
+
const diagnostics = new Array();
|
|
11
|
+
for (const commentDirective of (_a = sourceFile.commentDirectives) !== null && _a !== void 0 ? _a : []) {
|
|
12
|
+
diagnostics.push(diagnostics_1.errors.noCommentDirectives({
|
|
13
|
+
sourceFile,
|
|
14
|
+
range: commentDirective.range,
|
|
15
|
+
}));
|
|
16
|
+
}
|
|
17
|
+
const tsNoCheckPragma = sourceFile.pragmas.get("ts-nocheck");
|
|
18
|
+
if (tsNoCheckPragma) {
|
|
19
|
+
for (const pragma of Array.isArray(tsNoCheckPragma) ? tsNoCheckPragma : [tsNoCheckPragma]) {
|
|
20
|
+
diagnostics.push(diagnostics_1.errors.noCommentDirectives({
|
|
21
|
+
sourceFile,
|
|
22
|
+
range: pragma.range,
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return diagnostics;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=fileUsesCommentDirectives.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
export interface TsTransformPathsConfig {
|
|
3
|
+
useRootDirs?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export default function transformer(program: ts.Program, config: TsTransformPathsConfig): (context: ts.TransformationContext) => (sourceFile: ts.SourceFile | ts.Bundle) => ts.SourceFile | ts.Bundle;
|