static-injector 2.2.1 → 4.0.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.
Files changed (93) hide show
  1. package/import/commonjs/index.js +94 -50
  2. package/import/es2022/di/index.js +1 -0
  3. package/import/es2022/di/initializer_token.js +1 -1
  4. package/import/es2022/di/inject_switch.js +1 -2
  5. package/import/es2022/di/injection_token.js +13 -6
  6. package/import/es2022/di/injector.js +3 -3
  7. package/import/es2022/di/injector_compatibility.js +23 -0
  8. package/import/es2022/di/injector_token.js +2 -3
  9. package/import/es2022/di/internal_tokens.js +1 -1
  10. package/import/es2022/di/r3_injector.js +19 -16
  11. package/import/es2022/di/scope.js +1 -1
  12. package/import/es2022/di.js +24 -0
  13. package/import/es2022/render3/errors_di.js +2 -2
  14. package/import/es2022/render3/instructions/di.js +7 -0
  15. package/import/es2022/render3/util/stringify_utils.js +1 -0
  16. package/import/es2022/util/array_utils.js +7 -0
  17. package/import/es2022/util/stringify.js +15 -0
  18. package/import/fesm2022/index.js +88 -44
  19. package/import/typings/di/create_injector.d.ts +2 -2
  20. package/import/typings/di/forward_ref.d.ts +1 -1
  21. package/import/typings/di/index.d.ts +1 -0
  22. package/import/typings/di/initializer_token.d.ts +1 -1
  23. package/import/typings/di/injection_token.d.ts +11 -6
  24. package/import/typings/di/injector.d.ts +3 -3
  25. package/import/typings/di/injector_compatibility.d.ts +2 -1
  26. package/import/typings/di/injector_token.d.ts +1 -1
  27. package/import/typings/di/interface/provider.d.ts +12 -12
  28. package/import/typings/di/internal_tokens.d.ts +1 -1
  29. package/import/typings/di/metadata.d.ts +2 -2
  30. package/import/typings/di/null_injector.d.ts +1 -1
  31. package/import/typings/di/r3_injector.d.ts +1 -1
  32. package/import/typings/di.d.ts +24 -0
  33. package/import/typings/errors.d.ts +11 -3
  34. package/import/typings/render3/errors_di.d.ts +2 -1
  35. package/import/typings/render3/instructions/di.d.ts +7 -0
  36. package/import/typings/render3/util/stringify_utils.d.ts +1 -0
  37. package/import/typings/util/array_utils.d.ts +7 -0
  38. package/import/typings/util/empty.d.ts +1 -1
  39. package/import/typings/util/stringify.d.ts +8 -0
  40. package/package.json +7 -5
  41. package/readme.md +2 -2
  42. package/transform/compiler/src/compiler.d.ts +0 -22
  43. package/transform/compiler/src/compiler.js +0 -26
  44. package/transform/compiler/src/core.d.ts +6 -0
  45. package/transform/compiler/src/core.js +13 -0
  46. package/transform/compiler/src/injectable_compiler_2.js +2 -2
  47. package/transform/compiler/src/output/output_ast.d.ts +21 -7
  48. package/transform/compiler/src/output/output_ast.js +55 -9
  49. package/transform/compiler/src/render3/partial/api.d.ts +5 -0
  50. package/transform/compiler/src/render3/r3_factory.js +1 -1
  51. package/transform/compiler/src/render3/r3_identifiers.js +4 -0
  52. package/transform/compiler/src/render3/util.js +1 -3
  53. package/transform/compiler/src/render3/view/util.d.ts +2 -0
  54. package/transform/compiler/src/render3/view/util.js +10 -2
  55. package/transform/compiler-cli/src/ngtsc/annotations/common/index.d.ts +0 -7
  56. package/transform/compiler-cli/src/ngtsc/annotations/common/index.js +0 -7
  57. package/transform/compiler-cli/src/ngtsc/annotations/common/src/util.d.ts +3 -0
  58. package/transform/compiler-cli/src/ngtsc/annotations/common/src/util.js +14 -2
  59. package/transform/compiler-cli/src/ngtsc/annotations/src/injectable.d.ts +3 -2
  60. package/transform/compiler-cli/src/ngtsc/annotations/src/injectable.js +3 -1
  61. package/transform/compiler-cli/src/ngtsc/diagnostics/error.d.ts +2 -2
  62. package/transform/compiler-cli/src/ngtsc/diagnostics/error_code.js +2 -2
  63. package/transform/compiler-cli/src/ngtsc/diagnostics/index.d.ts +0 -7
  64. package/transform/compiler-cli/src/ngtsc/diagnostics/index.js +0 -7
  65. package/transform/compiler-cli/src/ngtsc/imports/index.d.ts +0 -7
  66. package/transform/compiler-cli/src/ngtsc/imports/index.js +0 -7
  67. package/transform/compiler-cli/src/ngtsc/reflection/index.d.ts +0 -7
  68. package/transform/compiler-cli/src/ngtsc/reflection/index.js +0 -7
  69. package/transform/compiler-cli/src/ngtsc/reflection/src/host.d.ts +7 -2
  70. package/transform/compiler-cli/src/ngtsc/reflection/src/host.js +3 -1
  71. package/transform/compiler-cli/src/ngtsc/reflection/src/type_to_value.d.ts +2 -1
  72. package/transform/compiler-cli/src/ngtsc/reflection/src/type_to_value.js +16 -5
  73. package/transform/compiler-cli/src/ngtsc/reflection/src/typescript.d.ts +4 -3
  74. package/transform/compiler-cli/src/ngtsc/reflection/src/typescript.js +25 -9
  75. package/transform/compiler-cli/src/ngtsc/transform/index.d.ts +0 -7
  76. package/transform/compiler-cli/src/ngtsc/transform/index.js +0 -7
  77. package/transform/compiler-cli/src/ngtsc/transform/src/api.d.ts +18 -0
  78. package/transform/compiler-cli/src/ngtsc/transform/src/api.js +20 -0
  79. package/transform/compiler-cli/src/ngtsc/transform/src/utils.d.ts +1 -1
  80. package/transform/compiler-cli/src/ngtsc/transform/src/utils.js +35 -24
  81. package/transform/compiler-cli/src/ngtsc/translator/index.d.ts +0 -7
  82. package/transform/compiler-cli/src/ngtsc/translator/index.js +0 -7
  83. package/transform/compiler-cli/src/ngtsc/translator/src/api/ast_factory.d.ts +9 -1
  84. package/transform/compiler-cli/src/ngtsc/translator/src/import_manager.d.ts +21 -3
  85. package/transform/compiler-cli/src/ngtsc/translator/src/import_manager.js +13 -3
  86. package/transform/compiler-cli/src/ngtsc/translator/src/translator.d.ts +1 -0
  87. package/transform/compiler-cli/src/ngtsc/translator/src/translator.js +6 -0
  88. package/transform/compiler-cli/src/ngtsc/translator/src/ts_util.d.ts +12 -0
  89. package/transform/compiler-cli/src/ngtsc/translator/src/ts_util.js +27 -0
  90. package/transform/compiler-cli/src/ngtsc/translator/src/typescript_ast_factory.d.ts +1 -0
  91. package/transform/compiler-cli/src/ngtsc/translator/src/typescript_ast_factory.js +9 -1
  92. package/transform/index.d.ts +1 -1
  93. package/transform/injectable-transform.js +2 -2
@@ -28,7 +28,7 @@ class InjectableTransformerFactory {
28
28
  this.options = options;
29
29
  this.typeChecker = this.program.getTypeChecker();
30
30
  this.reflectionHost = new reflection_1.TypeScriptReflectionHost(this.typeChecker);
31
- this.handler = new injectable_1.InjectableDecoratorHandler(this.reflectionHost, false, !!this.options.strictCtorDeps, false);
31
+ this.handler = new injectable_1.InjectableDecoratorHandler(this.reflectionHost, false, !!this.options.strictCtorDeps, false, transform_1.CompilationMode.FULL);
32
32
  }
33
33
  getTransform() {
34
34
  return (context) => this.transform(context);
@@ -214,7 +214,7 @@ class InjectableTransformerFactory {
214
214
  return nodeArrayFromDecoratorsArray(filtered);
215
215
  }
216
216
  updateStatements(node, importManager) {
217
- return (0, transform_1.addImports)(importManager, node);
217
+ return (0, transform_1.addImports)(typescript_1.default.factory, importManager, node);
218
218
  }
219
219
  }
220
220
  exports.InjectableTransformerFactory = InjectableTransformerFactory;