@effect-app/eslint-shared-config 0.4.1 → 0.5.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 (166) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/node_modules/@ben_12/eslint-plugin-dprint/dist/lib/dprint/yaml-config-schema.json +20 -0
  3. package/node_modules/@ben_12/eslint-plugin-dprint/package.json +12 -14
  4. package/node_modules/@dprint/formatter/README.md +29 -27
  5. package/node_modules/@dprint/formatter/esm/_dnt.test_polyfills.d.ts.map +1 -0
  6. package/node_modules/@dprint/formatter/esm/common.d.ts +6 -2
  7. package/node_modules/@dprint/formatter/esm/common.d.ts.map +1 -1
  8. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/almost_equals.d.ts.map +1 -0
  9. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/array_includes.d.ts.map +1 -0
  10. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/assert.d.ts.map +1 -0
  11. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/assertion_error.d.ts.map +1 -0
  12. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/equal.d.ts.map +1 -0
  13. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/equals.d.ts.map +1 -0
  14. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/exists.d.ts.map +1 -0
  15. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/fail.d.ts.map +1 -0
  16. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/false.d.ts.map +1 -0
  17. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/greater.d.ts.map +1 -0
  18. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/greater_or_equal.d.ts.map +1 -0
  19. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/instance_of.d.ts.map +1 -0
  20. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/is_error.d.ts.map +1 -0
  21. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/less.d.ts.map +1 -0
  22. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/less_or_equal.d.ts.map +1 -0
  23. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/match.d.ts.map +1 -0
  24. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/mod.d.ts.map +1 -0
  25. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/not_equals.d.ts.map +1 -0
  26. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/not_instance_of.d.ts.map +1 -0
  27. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/not_match.d.ts.map +1 -0
  28. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/not_strict_equals.d.ts.map +1 -0
  29. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/object_match.d.ts.map +1 -0
  30. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/rejects.d.ts.map +1 -0
  31. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/strict_equals.d.ts.map +1 -0
  32. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/string_includes.d.ts.map +1 -0
  33. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/throws.d.ts.map +1 -0
  34. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/unimplemented.d.ts.map +1 -0
  35. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/unreachable.d.ts.map +1 -0
  36. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.12/build_message.d.ts.map +1 -0
  37. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.12/diff.d.ts.map +1 -0
  38. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.12/diff_str.d.ts.map +1 -0
  39. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.12/format.d.ts.map +1 -0
  40. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.12/styles.d.ts.map +1 -0
  41. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.12/types.d.ts.map +1 -0
  42. package/node_modules/@dprint/formatter/esm/mod.d.ts +43 -1
  43. package/node_modules/@dprint/formatter/esm/mod.d.ts.map +1 -1
  44. package/node_modules/@dprint/formatter/esm/mod.js +106 -3
  45. package/node_modules/@dprint/formatter/esm/mod_test.d.ts.map +1 -1
  46. package/node_modules/@dprint/formatter/esm/v3.d.ts.map +1 -1
  47. package/node_modules/@dprint/formatter/esm/v3.js +4 -2
  48. package/node_modules/@dprint/formatter/esm/v4.d.ts.map +1 -1
  49. package/node_modules/@dprint/formatter/esm/v4.js +4 -2
  50. package/node_modules/@dprint/formatter/package.json +5 -2
  51. package/node_modules/@dprint/formatter/script/_dnt.test_polyfills.d.ts.map +1 -0
  52. package/node_modules/@dprint/formatter/script/common.d.ts +6 -2
  53. package/node_modules/@dprint/formatter/script/common.d.ts.map +1 -1
  54. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/almost_equals.d.ts.map +1 -0
  55. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/array_includes.d.ts.map +1 -0
  56. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/assert.d.ts.map +1 -0
  57. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/assertion_error.d.ts.map +1 -0
  58. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/equal.d.ts.map +1 -0
  59. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/equals.d.ts.map +1 -0
  60. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/exists.d.ts.map +1 -0
  61. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/fail.d.ts.map +1 -0
  62. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/false.d.ts.map +1 -0
  63. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/greater.d.ts.map +1 -0
  64. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/greater_or_equal.d.ts.map +1 -0
  65. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/instance_of.d.ts.map +1 -0
  66. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/is_error.d.ts.map +1 -0
  67. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/less.d.ts.map +1 -0
  68. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/less_or_equal.d.ts.map +1 -0
  69. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/match.d.ts.map +1 -0
  70. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/mod.d.ts.map +1 -0
  71. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/not_equals.d.ts.map +1 -0
  72. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/not_instance_of.d.ts.map +1 -0
  73. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/not_match.d.ts.map +1 -0
  74. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/not_strict_equals.d.ts.map +1 -0
  75. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/object_match.d.ts.map +1 -0
  76. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/rejects.d.ts.map +1 -0
  77. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/strict_equals.d.ts.map +1 -0
  78. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/string_includes.d.ts.map +1 -0
  79. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/throws.d.ts.map +1 -0
  80. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/unimplemented.d.ts.map +1 -0
  81. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/unreachable.d.ts.map +1 -0
  82. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.12/build_message.d.ts.map +1 -0
  83. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.12/diff.d.ts.map +1 -0
  84. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.12/diff_str.d.ts.map +1 -0
  85. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.12/format.d.ts.map +1 -0
  86. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.12/styles.d.ts.map +1 -0
  87. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.12/types.d.ts.map +1 -0
  88. package/node_modules/@dprint/formatter/script/mod.d.ts +43 -1
  89. package/node_modules/@dprint/formatter/script/mod.d.ts.map +1 -1
  90. package/node_modules/@dprint/formatter/script/mod.js +127 -14
  91. package/node_modules/@dprint/formatter/script/mod_test.d.ts.map +1 -1
  92. package/node_modules/@dprint/formatter/script/v3.d.ts.map +1 -1
  93. package/node_modules/@dprint/formatter/script/v3.js +6 -5
  94. package/node_modules/@dprint/formatter/script/v4.d.ts.map +1 -1
  95. package/node_modules/@dprint/formatter/script/v4.js +23 -12
  96. package/package.json +18 -18
  97. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert.d.ts.map +0 -1
  98. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_almost_equals.d.ts.map +0 -1
  99. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_array_includes.d.ts.map +0 -1
  100. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_equals.d.ts.map +0 -1
  101. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_exists.d.ts.map +0 -1
  102. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_false.d.ts.map +0 -1
  103. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_greater.d.ts.map +0 -1
  104. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_greater_or_equal.d.ts.map +0 -1
  105. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_instance_of.d.ts.map +0 -1
  106. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_is_error.d.ts.map +0 -1
  107. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_less.d.ts.map +0 -1
  108. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_less_or_equal.d.ts.map +0 -1
  109. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_match.d.ts.map +0 -1
  110. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_not_equals.d.ts.map +0 -1
  111. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_not_instance_of.d.ts.map +0 -1
  112. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_not_match.d.ts.map +0 -1
  113. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_not_strict_equals.d.ts.map +0 -1
  114. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_object_match.d.ts.map +0 -1
  115. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_rejects.d.ts.map +0 -1
  116. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_strict_equals.d.ts.map +0 -1
  117. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_string_includes.d.ts.map +0 -1
  118. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_throws.d.ts.map +0 -1
  119. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assertion_error.d.ts.map +0 -1
  120. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/equal.d.ts.map +0 -1
  121. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/fail.d.ts.map +0 -1
  122. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/mod.d.ts.map +0 -1
  123. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/unimplemented.d.ts.map +0 -1
  124. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/unreachable.d.ts.map +0 -1
  125. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.0/build_message.d.ts.map +0 -1
  126. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.0/diff.d.ts.map +0 -1
  127. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.0/diff_str.d.ts.map +0 -1
  128. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.0/format.d.ts.map +0 -1
  129. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.0/mod.d.ts.map +0 -1
  130. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.0/styles.d.ts.map +0 -1
  131. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.0/types.d.ts.map +0 -1
  132. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert.d.ts.map +0 -1
  133. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_almost_equals.d.ts.map +0 -1
  134. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_array_includes.d.ts.map +0 -1
  135. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_equals.d.ts.map +0 -1
  136. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_exists.d.ts.map +0 -1
  137. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_false.d.ts.map +0 -1
  138. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_greater.d.ts.map +0 -1
  139. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_greater_or_equal.d.ts.map +0 -1
  140. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_instance_of.d.ts.map +0 -1
  141. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_is_error.d.ts.map +0 -1
  142. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_less.d.ts.map +0 -1
  143. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_less_or_equal.d.ts.map +0 -1
  144. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_match.d.ts.map +0 -1
  145. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_not_equals.d.ts.map +0 -1
  146. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_not_instance_of.d.ts.map +0 -1
  147. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_not_match.d.ts.map +0 -1
  148. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_not_strict_equals.d.ts.map +0 -1
  149. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_object_match.d.ts.map +0 -1
  150. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_rejects.d.ts.map +0 -1
  151. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_strict_equals.d.ts.map +0 -1
  152. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_string_includes.d.ts.map +0 -1
  153. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_throws.d.ts.map +0 -1
  154. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assertion_error.d.ts.map +0 -1
  155. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/equal.d.ts.map +0 -1
  156. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/fail.d.ts.map +0 -1
  157. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/mod.d.ts.map +0 -1
  158. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/unimplemented.d.ts.map +0 -1
  159. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/unreachable.d.ts.map +0 -1
  160. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.0/build_message.d.ts.map +0 -1
  161. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.0/diff.d.ts.map +0 -1
  162. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.0/diff_str.d.ts.map +0 -1
  163. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.0/format.d.ts.map +0 -1
  164. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.0/mod.d.ts.map +0 -1
  165. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.0/styles.d.ts.map +0 -1
  166. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.0/types.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @effect-app/eslint-shared-config
2
2
 
3
+ ## 0.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 1a102e2: update packages
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [1a102e2]
12
+ - @effect-app/eslint-codegen-model@1.47.0
13
+
3
14
  ## 0.4.1
4
15
 
5
16
  ### Patch Changes
@@ -118,6 +118,26 @@
118
118
  "description": "Control whether trailing zeros should be removed or not.",
119
119
  "type": "boolean"
120
120
  },
121
+ "proseWrap": {
122
+ "description": "Control whether to wrap prose in plain scalars when they exceed the print width.",
123
+ "type": "string",
124
+ "oneOf": [
125
+ {
126
+ "description": "Don't change how prose is wrapped.",
127
+ "type": "string",
128
+ "enum": [
129
+ "preserve"
130
+ ]
131
+ },
132
+ {
133
+ "description": "Wrap prose if it exceeds the print width.",
134
+ "type": "string",
135
+ "enum": [
136
+ "always"
137
+ ]
138
+ }
139
+ ]
140
+ },
121
141
  "ignoreCommentDirective": {
122
142
  "description": "Text directive for ignoring formatting specific content.",
123
143
  "type": "string"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ben_12/eslint-plugin-dprint",
3
- "version": "1.12.0",
3
+ "version": "1.14.0",
4
4
  "description": "An ESLint plugin that fixes code with dprint",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -12,14 +12,14 @@
12
12
  ],
13
13
  "peerDependencies": {
14
14
  "@dprint/dockerfile": "^0.3.3",
15
- "@dprint/json": "^0.21.0",
15
+ "@dprint/json": "^0.21.1",
16
16
  "@dprint/markdown": "^0.20.0",
17
17
  "@dprint/toml": "^0.7.0",
18
- "@dprint/typescript": "^0.95.12",
18
+ "@dprint/typescript": "^0.95.13",
19
19
  "dprint-plugin-graphql": "^0.2.3",
20
- "dprint-plugin-malva": "^0.15.0",
21
- "dprint-plugin-markup": "^0.24.0",
22
- "dprint-plugin-yaml": "^0.5.1",
20
+ "dprint-plugin-malva": "^0.15.1",
21
+ "dprint-plugin-markup": "^0.25.3",
22
+ "dprint-plugin-yaml": "^0.6.0",
23
23
  "eslint": ">=7.0.0"
24
24
  },
25
25
  "peerDependenciesMeta": {
@@ -54,32 +54,30 @@
54
54
  "dependencies": {
55
55
  "@dprint/formatter": "^0.4.1",
56
56
  "debug": "^4.1.1",
57
- "diff": "^7.0.0",
57
+ "diff": "^8.0.0",
58
58
  "jsonc-parser": "^3.2.0"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@ben_12/eslint-plugin-dprint": "file:./test/internal-rules",
62
62
  "@ben_12/eslint-simple-parser": "^0.1.0",
63
63
  "@dprint/dockerfile": "^0.3.3",
64
- "@dprint/json": "^0.21.0",
64
+ "@dprint/json": "^0.21.1",
65
65
  "@dprint/markdown": "^0.20.0",
66
66
  "@dprint/toml": "^0.7.0",
67
- "@dprint/typescript": "^0.95.12",
67
+ "@dprint/typescript": "^0.95.13",
68
68
  "@types/debug": "^4.1.5",
69
- "@types/diff": "^7.0.0",
70
69
  "@types/eslint": "^9.0.0",
71
70
  "@types/node": "^18.0.0",
72
71
  "@typescript-eslint/eslint-plugin": "^8.0.0",
73
72
  "axios": "^1.7.9",
74
73
  "dprint-plugin-graphql": "^0.2.3",
75
- "dprint-plugin-malva": "^0.15.0",
76
- "dprint-plugin-markup": "^0.24.0",
77
- "dprint-plugin-yaml": "^0.5.1",
74
+ "dprint-plugin-malva": "^0.15.1",
75
+ "dprint-plugin-markup": "^0.25.3",
76
+ "dprint-plugin-yaml": "^0.6.0",
78
77
  "eslint": "^9.0.0",
79
78
  "mocha": "^11.0.0",
80
79
  "nyc": "^17.0.0",
81
80
  "rimraf": "^6.0.0",
82
- "shx": "^0.3.4",
83
81
  "ts-node": "^10.0.0",
84
82
  "typescript": "~5.0.0"
85
83
  },
@@ -11,7 +11,7 @@ JS formatter for dprint Wasm plugins.
11
11
  Deno:
12
12
 
13
13
  ```sh
14
- deno add @dprint/formatter
14
+ deno add npm:@dprint/formatter
15
15
  ```
16
16
 
17
17
  Node.js:
@@ -22,40 +22,40 @@ npm i @dprint/formatter
22
22
 
23
23
  ## Use
24
24
 
25
- ```ts
26
- import { createStreaming, GlobalConfiguration } from "@dprint/formatter";
25
+ The context API allows you to manage multiple plugins with shared configuration and automatic plugin selection based on file type:
27
26
 
28
- const globalConfig: GlobalConfiguration = {
27
+ ```ts
28
+ import { createContext } from "@dprint/formatter";
29
+ import * as json from "@dprint/json";
30
+ import * as markdown from "@dprint/markdown";
31
+ import * as typescript from "@dprint/typescript";
32
+ import fs from "node:fs";
33
+
34
+ const context = createContext({
35
+ // global config
29
36
  indentWidth: 2,
30
37
  lineWidth: 80,
31
- };
32
- const tsFormatter = await createStreaming(
33
- // check https://plugins.dprint.dev/ for latest plugin versions
34
- fetch("https://plugins.dprint.dev/typescript-0.57.0.wasm"),
35
- );
38
+ });
36
39
 
37
- tsFormatter.setConfig(globalConfig, {
40
+ // note: some plugins might have a getBuffer() export instead
41
+ context.addPlugin(fs.readFileSync(typescript.getPath()), {
38
42
  semiColons: "asi",
39
43
  });
40
-
41
- // outputs: "const t = 5\n"
42
- console.log(tsFormatter.formatText("file.ts", "const t = 5;"));
44
+ context.addPlugin(fs.readFileSync(json.getPath()));
45
+ context.addPlugin(fs.readFileSync(markdown.getPath()));
46
+
47
+ console.log(context.formatText({
48
+ filePath: "config.json",
49
+ fileText: "{\"a\":1}",
50
+ }));
51
+
52
+ console.log(context.formatText({
53
+ filePath: "app.ts",
54
+ fileText: "const x=1",
55
+ }));
43
56
  ```
44
57
 
45
- Using with plugins on npm (ex. [@dprint/json](https://www.npmjs.com/package/@dprint/json)):
46
-
47
- ```ts
48
- import { createFromBuffer } from "@dprint/formatter";
49
- // You may have to use `getBuffer` on plugins that haven't updated yet.
50
- // See the plugins README.md for details.
51
- import { getPath } from "@dprint/json";
52
- import * as fs from "node:fs";
53
-
54
- const buffer = fs.readFileSync(getPath());
55
- const formatter = createFromBuffer(buffer);
56
-
57
- console.log(formatter.formatText("test.json", "{test: 5}"));
58
- ```
58
+ The context also handles host formatting automatically, so embedded code blocks (like JSON in Markdown) will be formatted by the appropriate plugin.
59
59
 
60
60
  ### Plugin NPM Packages
61
61
 
@@ -67,4 +67,6 @@ Note: In the future I will ensure plugins are published to JSR as well.
67
67
  - [@dprint/toml](https://www.npmjs.com/package/@dprint/toml)
68
68
  - [@dprint/dockerfile](https://www.npmjs.com/package/@dprint/dockerfile)
69
69
  - [@dprint/biome](https://www.npmjs.com/package/@dprint/biome)
70
+ - [@dprint/oxc](https://www.npmjs.com/package/@dprint/oxc)
71
+ - [@dprint/mago](https://www.npmjs.com/package/@dprint/mago)
70
72
  - [@dprint/ruff](https://www.npmjs.com/package/@dprint/ruff)
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_dnt.test_polyfills.d.ts","sourceRoot":"","sources":["../src/_dnt.test_polyfills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAgC,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAGlE,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,UAAU;QAClB;;;;;;;;;;;;;;WAcG;QACH,GAAG,EAAE,MAAM,CAAC;QACZ;;;;;;;;;;;;WAYG;QACH,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,GAAG,MAAM,CAAC;QACtE;;;;;;;;WAQG;QACH,IAAI,EAAE,OAAO,CAAC;QAEd;;;;;;;;;;;;WAYG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;;;;;;;;;;;WAYG;QACH,OAAO,EAAE,MAAM,CAAC;KACjB;CACF;AAED,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,KAAK,UAAU,GAAG,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;AACnD,UAAU,0BAA0B;IAClC,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC;CACxD;AACD,UAAU,0BAA0B;IAClC,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAAC;CACtC;AACD,UAAU,kBACR,SAAQ,0BAA0B,EAAE,0BAA0B;CAC/D;AAiBD,eAAO,IAAI,6BAA6B,EA2BnC,0BAA0B,CAAC;AAMhC,eAAO,IAAI,6BAA6B,EA4DnC,0BAA0B,CAAC;AAMhC,eAAO,IAAI,oBAAoB,EAoB1B,kBAAkB,CAAC"}
@@ -42,14 +42,18 @@ export interface Formatter {
42
42
  * Gets the license text of the plugin.
43
43
  */
44
44
  getLicenseText(): string;
45
+ /**
46
+ * Sets the host formatter for formatting embedded code.
47
+ * @param formatWithHost - A function that formats embedded code blocks.
48
+ */
49
+ setHostFormatter(formatWithHost: ((request: FormatRequest) => string) | undefined): void;
45
50
  /**
46
51
  * Formats the specified file text.
47
52
  * @param request - Data to format.
48
- * @param formatWithHost - Host formatter.
49
53
  * @returns The formatted text.
50
54
  * @throws If there is an error formatting.
51
55
  */
52
- formatText(request: FormatRequest, formatWithHost?: (request: FormatRequest) => string): string;
56
+ formatText(request: FormatRequest): string;
53
57
  }
54
58
  /** Configuration specified for use across plugins. */
55
59
  export interface GlobalConfiguration {
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,gDAAgD;IAChD,cAA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;OAEG;IACH,aAAa,IAAI,UAAU,CAAC;IAC5B;;OAEG;IACH,mBAAmB,IAAI,gBAAgB,CAAC;IACxC;;OAEG;IACH,cAAc,IAAI,MAAM,CAAC;IACzB;;;OAGG;IACH,gBAAgB,CAAC,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,aAAa,KAAK,MAAM,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;IACzF;;;;;OAKG;IACH,UAAU,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAAC;CAC5C;AAED,sDAAsD;AACtD,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,QAAQ,CAAC;CACjD;AAED,0EAA0E;AAC1E,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,kCAAkC;AAClC,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,8DAA8D;AAC9D,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"almost_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/almost_equals.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,EAClB,GAAG,CAAC,EAAE,MAAM,QAmBb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"array_includes.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/array_includes.ts"],"names":[],"mappings":"AAMA,0FAA0F;AAC1F,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,EACvB,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,EACzB,GAAG,CAAC,EAAE,MAAM,QAwBb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/assert.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,SAAK,GAAG,OAAO,CAAC,IAAI,CAI5D"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertion_error.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/assertion_error.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC;;;;OAIG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAIpD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"equal.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/equal.ts"],"names":[],"mappings":"AA0FA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAgHrD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/equals.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,QAmBb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exists.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/exists.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,MAAM,EAAE,CAAC,EACT,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC,CAOlC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fail.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/fail.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,wBAAgB,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAGxC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"false.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/false.ts"],"names":[],"mappings":"AAIA,uDAAuD;AACvD,MAAM,MAAM,KAAK,GAAG,KAAK,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;AAE3D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,SAAK,GAAG,OAAO,CAAC,IAAI,IAAI,KAAK,CAI1E"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"greater.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/greater.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,QAMpE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"greater_or_equal.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/greater_or_equal.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,QASb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instance_of.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/instance_of.ts"],"names":[],"mappings":"AAIA,sBAAsB;AAEtB,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AACzD,4BAA4B;AAC5B,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,cAAc,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;AAE3E;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAE9B,CAAC,SAAS,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAE9C,MAAM,EAAE,OAAO,EACf,YAAY,EAAE,CAAC,EACf,GAAG,SAAK,GACP,OAAO,CAAC,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,CA6BnC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is_error.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/is_error.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EACnD,KAAK,EAAE,OAAO,EAEd,UAAU,CAAC,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAC/C,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAC5B,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,KAAK,IAAI,CAAC,CA8BpB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"less.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/less.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,QAMjE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"less_or_equal.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/less_or_equal.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,QASb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"match.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/match.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,MAAM,QAMb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/mod.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"not_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/not_equals.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,QAUtE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"not_instance_of.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/not_instance_of.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,CAAC,EACtC,MAAM,EAAE,CAAC,EAET,cAAc,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAClD,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAKjC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"not_match.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/not_match.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,MAAM,QAMb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"not_strict_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/not_strict_equals.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,QAYb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object_match.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/object_match.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,iBAAiB,CAE/B,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,EAChC,QAAQ,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EACtC,GAAG,CAAC,EAAE,MAAM,GACX,IAAI,CAUN"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rejects.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/rejects.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,MAAM,WAAW,CAAC,OAAO,CAAC,EAC9B,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,OAAO,CAAC,CAAC;AACpB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EACnD,EAAE,EAAE,MAAM,WAAW,CAAC,OAAO,CAAC,EAE9B,UAAU,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAC9C,WAAW,CAAC,EAAE,MAAM,EACpB,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strict_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/strict_equals.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,IAAI,CAAC,CAgCrB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string_includes.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/string_includes.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,MAAM,QAMb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"throws.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/throws.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAC1B,EAAE,EAAE,MAAM,OAAO,EACjB,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC;AACX;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EAClD,EAAE,EAAE,MAAM,OAAO,EAEjB,UAAU,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAC9C,WAAW,CAAC,EAAE,MAAM,EACpB,GAAG,CAAC,EAAE,MAAM,GACX,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unimplemented.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/unimplemented.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAGjD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unreachable.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/unreachable.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAG/C"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build_message.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.12/build_message.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,QAAQ;AAClB;;;GAGG;AACH,UAAU,UAAQ,GACjB,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAWvB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CASrD;AAED,4CAA4C;AAC5C,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG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@@
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.12/format.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,SAAS,GAAG,CACtB,CAAC,EAAE,OAAO,EACV,OAAO,EAAE;IACP,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,KACE,MAAM,CAAC;AAEZ;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAmBzC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.12/styles.ts"],"names":[],"mappings":"AAqCA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAExC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE1C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAExC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3C;AAWD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.12/types.ts"],"names":[],"mappings":"AAGA,kDAAkD;AAClD,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD;;;GAGG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;AAEvE;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI;IAChC,IAAI,EAAE,QAAQ,GAAG,YAAY,CAAC;IAC9B,KAAK,EAAE,CAAC,CAAC;CACV,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI;IACjC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC;IAC1B,KAAK,EAAE,CAAC,CAAC;IACT,OAAO,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;CAC3B,CAAC"}
@@ -1,5 +1,47 @@
1
- import type { Formatter } from "./common.js";
1
+ import type { ConfigurationDiagnostic, FormatRequest, Formatter, GlobalConfiguration } from "./common.js";
2
2
  export type { ConfigurationDiagnostic, FileMatchingInfo, FormatRequest, Formatter, GlobalConfiguration, Host, PluginInfo, } from "./common.js";
3
+ /** A formatter returned from adding a plugin to a context. */
4
+ export interface ContextFormatter {
5
+ /** Formats the specified file text using this plugin. */
6
+ formatText(request: FormatRequest): string;
7
+ /** Gets the resolved configuration for this plugin. */
8
+ getResolvedConfig(): Record<string, unknown>;
9
+ /** Gets the configuration diagnostics for this plugin. */
10
+ getConfigDiagnostics(): ConfigurationDiagnostic[];
11
+ }
12
+ /** A context for managing multiple formatters with shared configuration. */
13
+ export interface FormatterContext {
14
+ /**
15
+ * Adds a plugin to the context.
16
+ * @param source - The buffer or Wasm module of the plugin (e.g., from `@dprint/json` getBuffer()).
17
+ * @param param - Plugin config.
18
+ * @returns A formatter for directly formatting with this plugin.
19
+ */
20
+ addPlugin(source: BufferSource | WebAssembly.Module, pluginConfig?: Record<string, unknown>): ContextFormatter;
21
+ /**
22
+ * Adds a plugin to the context.
23
+ * @param source - Source response object.
24
+ * @param pluginConfig - Plugin config.
25
+ * @returns A formatter for directly formatting with this plugin.
26
+ */
27
+ addPluginStreaming(source: ResponseLike, pluginConfig?: Record<string, unknown>): Promise<ContextFormatter>;
28
+ /**
29
+ * Formats the specified file text, automatically selecting the appropriate plugin.
30
+ * @param request - Data to format.
31
+ * @returns The formatted text.
32
+ * @throws If no plugin matches the file or there is an error formatting.
33
+ */
34
+ formatText(request: FormatRequest): string;
35
+ /**
36
+ * Gets all configuration diagnostics from all plugins.
37
+ */
38
+ getConfigDiagnostics(): ConfigurationDiagnostic[];
39
+ }
40
+ /**
41
+ * Creates a formatter context for managing multiple plugins with shared configuration.
42
+ * @param globalConfig - Global configuration shared across all plugins.
43
+ */
44
+ export declare function createContext(globalConfig?: GlobalConfiguration): FormatterContext;
3
45
  export interface ResponseLike {
4
46
  status: number;
5
47
  arrayBuffer(): Promise<BufferSource>;
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAI7C,YAAY,EACV,uBAAuB,EACvB,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,IAAI,EAC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C,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC,gBAAgB,CAAC;IAEpB;;;;;OAKG;IACH,kBAAkB,CAChB,MAAM,EAAE,YAAY,EACpB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAE7B;;;;;OAKG;IACH,UAAU,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAAC;IAE3C;;OAEG;IACH,oBAAoB,IAAI,uBAAuB,EAAE,CAAC;CACnD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,YAAY,GAAE,mBAAwB,GAAG,gBAAgB,CA6GtF;AAoBD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC;IACrC,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACxB,OAAO,EAAE;QACP,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;KAClC,CAAC;CACH;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,eAAe,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,YAAY,GACpD,OAAO,CAAC,SAAS,CAAC,CAGpB;AAsBD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,gBAAgB,EAAE,YAAY,GAAG,SAAS,CAG1E;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAkB9E"}
@@ -1,11 +1,115 @@
1
1
  import * as v3 from "./v3.js";
2
2
  import * as v4 from "./v4.js";
3
+ /**
4
+ * Creates a formatter context for managing multiple plugins with shared configuration.
5
+ * @param globalConfig - Global configuration shared across all plugins.
6
+ */
7
+ export function createContext(globalConfig = {}) {
8
+ const plugins = [];
9
+ function findPluginForFile(filePath) {
10
+ const fileName = getFileName(filePath);
11
+ const ext = getFileExtension(filePath);
12
+ // First try to match by exact file name
13
+ for (const plugin of plugins) {
14
+ if (plugin.fileNames.has(fileName)) {
15
+ return plugin;
16
+ }
17
+ }
18
+ // Then try to match by extension
19
+ if (ext) {
20
+ for (const plugin of plugins) {
21
+ if (plugin.fileExtensions.has(ext)) {
22
+ return plugin;
23
+ }
24
+ }
25
+ }
26
+ return undefined;
27
+ }
28
+ function createHostFormatter(currentPlugin) {
29
+ return (request) => {
30
+ const plugin = findPluginForFile(request.filePath);
31
+ if (plugin && plugin !== currentPlugin) {
32
+ return plugin.formatter.formatText(request);
33
+ }
34
+ // Return unchanged if no other plugin matches
35
+ return request.fileText;
36
+ };
37
+ }
38
+ return {
39
+ async addPluginStreaming(source, pluginConfig) {
40
+ const wasmModule = await createWasmModuleFromStreaming(source);
41
+ return this.addPlugin(wasmModule, pluginConfig);
42
+ },
43
+ addPlugin(source, pluginConfig = {}) {
44
+ const formatter = source instanceof WebAssembly.Module
45
+ ? createFromWasmModule(source)
46
+ : createFromBuffer(source);
47
+ // Set configuration
48
+ formatter.setConfig(globalConfig, pluginConfig);
49
+ // Get file matching info
50
+ const matchingInfo = formatter.getFileMatchingInfo();
51
+ const fileExtensions = new Set(matchingInfo.fileExtensions.map((ext) => ext.toLowerCase()));
52
+ const fileNames = new Set(matchingInfo.fileNames.map((name) => name.toLowerCase()));
53
+ const registered = {
54
+ formatter,
55
+ pluginConfig,
56
+ fileExtensions,
57
+ fileNames,
58
+ };
59
+ plugins.push(registered);
60
+ // Set up host formatter for this plugin
61
+ formatter.setHostFormatter(createHostFormatter(registered));
62
+ // Return a context-aware formatter
63
+ return {
64
+ formatText(request) {
65
+ return formatter.formatText(request);
66
+ },
67
+ getResolvedConfig() {
68
+ return formatter.getResolvedConfig();
69
+ },
70
+ getConfigDiagnostics() {
71
+ return formatter.getConfigDiagnostics();
72
+ },
73
+ };
74
+ },
75
+ formatText(request) {
76
+ const plugin = findPluginForFile(request.filePath);
77
+ if (!plugin) {
78
+ throw new Error(`No plugin found for file: ${request.filePath}. `
79
+ + `Registered plugins handle: ${plugins
80
+ .map((p) => [...p.fileExtensions].join(", "))
81
+ .join("; ")}`);
82
+ }
83
+ return plugin.formatter.formatText(request);
84
+ },
85
+ getConfigDiagnostics() {
86
+ return plugins.flatMap((p) => p.formatter.getConfigDiagnostics());
87
+ },
88
+ };
89
+ }
90
+ function getFileName(filePath) {
91
+ const lastSlash = Math.max(filePath.lastIndexOf("/"), filePath.lastIndexOf("\\"));
92
+ return (lastSlash >= 0 ? filePath.slice(lastSlash + 1) : filePath)
93
+ .toLowerCase();
94
+ }
95
+ function getFileExtension(filePath) {
96
+ const fileName = getFileName(filePath);
97
+ const lastDot = fileName.lastIndexOf(".");
98
+ if (lastDot > 0) {
99
+ return fileName.slice(lastDot + 1);
100
+ }
101
+ return undefined;
102
+ }
3
103
  /**
4
104
  * Creates a formatter from the specified streaming source.
5
105
  * @remarks This is the most efficient way to create a formatter.
6
106
  * @param response - The streaming source to create the formatter from.
7
107
  */
8
108
  export async function createStreaming(responsePromise) {
109
+ const wasmModule = await createWasmModuleFromStreaming(responsePromise);
110
+ return createFromWasmModule(wasmModule);
111
+ }
112
+ async function createWasmModuleFromStreaming(responsePromise) {
9
113
  const response = await responsePromise;
10
114
  if (response.status !== 200) {
11
115
  throw new Error(`Unexpected status code: ${response.status}\n${await response.text()}`);
@@ -13,13 +117,12 @@ export async function createStreaming(responsePromise) {
13
117
  if (typeof WebAssembly.instantiateStreaming === "function"
14
118
  && response.headers.get("content-type") === "application/wasm") {
15
119
  // deno-lint-ignore no-explicit-any
16
- const module = await WebAssembly.compileStreaming(response);
17
- return createFromWasmModule(module);
120
+ return await WebAssembly.compileStreaming(response);
18
121
  }
19
122
  else {
20
123
  // fallback for node.js or when the content type isn't application/wasm
21
124
  return response.arrayBuffer()
22
- .then((buffer) => createFromBuffer(buffer));
125
+ .then((buffer) => new WebAssembly.Module(buffer));
23
126
  }
24
127
  }
25
128
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"mod_test.d.ts","sourceRoot":"","sources":["../src/mod_test.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"mod_test.d.ts","sourceRoot":"","sources":["../src/mod_test.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"v3.d.ts","sourceRoot":"","sources":["../src/v3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,SAAS,EAAuB,IAAI,EAAc,MAAM,aAAa,CAAC;AAKnG;;GAEG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAyEjC;AAED,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,WAAW,CAAC,QAAQ,EAClC,IAAI,EAAE,IAAI,GACT,SAAS,CAiIX"}
1
+ {"version":3,"file":"v3.d.ts","sourceRoot":"","sources":["../src/v3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,SAAS,EAAuB,IAAI,EAAc,MAAM,aAAa,CAAC;AAKnG;;GAEG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAyEjC;AAED,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,WAAW,CAAC,QAAQ,EAClC,IAAI,EAAE,IAAI,GACT,SAAS,CAmIX"}
@@ -125,12 +125,14 @@ export function createFromInstance(wasmInstance, host) {
125
125
  const length = get_license_text();
126
126
  return receiveString(wasmInstance, length);
127
127
  },
128
- formatText(request, formatWithHost) {
128
+ setHostFormatter(formatWithHost) {
129
+ host.setHostFormatter(formatWithHost);
130
+ },
131
+ formatText(request) {
129
132
  if (request.bytesRange != null) {
130
133
  // not supported for v3
131
134
  return request.fileText;
132
135
  }
133
- host.setHostFormatter(formatWithHost);
134
136
  setConfigIfNotSet();
135
137
  if (request.overrideConfig != null) {
136
138
  if (pluginSchemaVersion === 2) {
@@ -1 +1 @@
1
- {"version":3,"file":"v4.d.ts","sourceRoot":"","sources":["../src/v4.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,SAAS,EAAuB,IAAI,EAAc,MAAM,aAAa,CAAC;AAMnG;;GAEG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAuHjC;AAED,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,WAAW,CAAC,QAAQ,EAClC,IAAI,EAAE,IAAI,GACT,SAAS,CAmHX"}
1
+ {"version":3,"file":"v4.d.ts","sourceRoot":"","sources":["../src/v4.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,SAAS,EAAuB,IAAI,EAAc,MAAM,aAAa,CAAC;AAMnG;;GAEG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAuHjC;AAED,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,WAAW,CAAC,QAAQ,EAClC,IAAI,EAAE,IAAI,GACT,SAAS,CAoHX"}
@@ -138,12 +138,14 @@ export function createFromInstance(wasmInstance, host) {
138
138
  const length = get_license_text();
139
139
  return receiveString(length);
140
140
  },
141
- formatText(request, formatWithHost) {
141
+ setHostFormatter(formatWithHost) {
142
+ host.setHostFormatter(formatWithHost);
143
+ },
144
+ formatText(request) {
142
145
  if (request.bytesRange != null && format_range == null) {
143
146
  // plugin doesn't support range formatting
144
147
  return request.fileText;
145
148
  }
146
- host.setHostFormatter(formatWithHost);
147
149
  setConfigIfNotSet();
148
150
  if (request.overrideConfig != null) {
149
151
  sendString(JSON.stringify(request.overrideConfig));