@pie-element/cli 0.1.1

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 (255) hide show
  1. package/.compatibility/report.json +2491 -0
  2. package/.turbo/turbo-build.log +1 -0
  3. package/CHANGELOG.md +8 -0
  4. package/README.md +240 -0
  5. package/REFACTORING.md +131 -0
  6. package/bin/dev.js +5 -0
  7. package/bin/run.js +5 -0
  8. package/dist/commands/dev/demo/index.d.ts +33 -0
  9. package/dist/commands/dev/demo/index.d.ts.map +1 -0
  10. package/dist/commands/dev/demo/index.js +274 -0
  11. package/dist/commands/dev/demo/index.js.map +1 -0
  12. package/dist/commands/dev/test-bundler.d.ts +18 -0
  13. package/dist/commands/dev/test-bundler.d.ts.map +1 -0
  14. package/dist/commands/dev/test-bundler.js +284 -0
  15. package/dist/commands/dev/test-bundler.js.map +1 -0
  16. package/dist/commands/mathquill/migrate.d.ts +20 -0
  17. package/dist/commands/mathquill/migrate.d.ts.map +1 -0
  18. package/dist/commands/mathquill/migrate.js +240 -0
  19. package/dist/commands/mathquill/migrate.js.map +1 -0
  20. package/dist/commands/mathquill/status.d.ts +20 -0
  21. package/dist/commands/mathquill/status.d.ts.map +1 -0
  22. package/dist/commands/mathquill/status.js +231 -0
  23. package/dist/commands/mathquill/status.js.map +1 -0
  24. package/dist/commands/packages/create-controllers.d.ts +13 -0
  25. package/dist/commands/packages/create-controllers.d.ts.map +1 -0
  26. package/dist/commands/packages/create-controllers.js +103 -0
  27. package/dist/commands/packages/create-controllers.js.map +1 -0
  28. package/dist/commands/packages/create-lib-react.d.ts +17 -0
  29. package/dist/commands/packages/create-lib-react.d.ts.map +1 -0
  30. package/dist/commands/packages/create-lib-react.js +228 -0
  31. package/dist/commands/packages/create-lib-react.js.map +1 -0
  32. package/dist/commands/packages/create-react-elements.d.ts +16 -0
  33. package/dist/commands/packages/create-react-elements.d.ts.map +1 -0
  34. package/dist/commands/packages/create-react-elements.js +259 -0
  35. package/dist/commands/packages/create-react-elements.js.map +1 -0
  36. package/dist/commands/packages/enable-publishing.d.ts +11 -0
  37. package/dist/commands/packages/enable-publishing.d.ts.map +1 -0
  38. package/dist/commands/packages/enable-publishing.js +117 -0
  39. package/dist/commands/packages/enable-publishing.js.map +1 -0
  40. package/dist/commands/packages/init-synced-elements.d.ts +16 -0
  41. package/dist/commands/packages/init-synced-elements.d.ts.map +1 -0
  42. package/dist/commands/packages/init-synced-elements.js +204 -0
  43. package/dist/commands/packages/init-synced-elements.js.map +1 -0
  44. package/dist/commands/upstream/analyze-esm.d.ts +59 -0
  45. package/dist/commands/upstream/analyze-esm.d.ts.map +1 -0
  46. package/dist/commands/upstream/analyze-esm.js +1481 -0
  47. package/dist/commands/upstream/analyze-esm.js.map +1 -0
  48. package/dist/commands/upstream/check.d.ts +15 -0
  49. package/dist/commands/upstream/check.d.ts.map +1 -0
  50. package/dist/commands/upstream/check.js +165 -0
  51. package/dist/commands/upstream/check.js.map +1 -0
  52. package/dist/commands/upstream/deps.d.ts +15 -0
  53. package/dist/commands/upstream/deps.d.ts.map +1 -0
  54. package/dist/commands/upstream/deps.js +174 -0
  55. package/dist/commands/upstream/deps.js.map +1 -0
  56. package/dist/commands/upstream/sync-mathquill.d.ts +12 -0
  57. package/dist/commands/upstream/sync-mathquill.d.ts.map +1 -0
  58. package/dist/commands/upstream/sync-mathquill.js +97 -0
  59. package/dist/commands/upstream/sync-mathquill.js.map +1 -0
  60. package/dist/commands/upstream/sync.d.ts +25 -0
  61. package/dist/commands/upstream/sync.d.ts.map +1 -0
  62. package/dist/commands/upstream/sync.js +552 -0
  63. package/dist/commands/upstream/sync.js.map +1 -0
  64. package/dist/commands/upstream/track.d.ts +15 -0
  65. package/dist/commands/upstream/track.d.ts.map +1 -0
  66. package/dist/commands/upstream/track.js +115 -0
  67. package/dist/commands/upstream/track.js.map +1 -0
  68. package/dist/commands/upstream/update.d.ts +15 -0
  69. package/dist/commands/upstream/update.d.ts.map +1 -0
  70. package/dist/commands/upstream/update.js +98 -0
  71. package/dist/commands/upstream/update.js.map +1 -0
  72. package/dist/commands/verify/controllers.d.ts +12 -0
  73. package/dist/commands/verify/controllers.d.ts.map +1 -0
  74. package/dist/commands/verify/controllers.js +138 -0
  75. package/dist/commands/verify/controllers.js.map +1 -0
  76. package/dist/commands/verify/react-build.d.ts +13 -0
  77. package/dist/commands/verify/react-build.d.ts.map +1 -0
  78. package/dist/commands/verify/react-build.js +135 -0
  79. package/dist/commands/verify/react-build.js.map +1 -0
  80. package/dist/index.d.ts +2 -0
  81. package/dist/index.d.ts.map +1 -0
  82. package/dist/index.js +2 -0
  83. package/dist/index.js.map +1 -0
  84. package/dist/lib/mathquill/extension-generator.d.ts +9 -0
  85. package/dist/lib/mathquill/extension-generator.d.ts.map +1 -0
  86. package/dist/lib/mathquill/extension-generator.js +107 -0
  87. package/dist/lib/mathquill/extension-generator.js.map +1 -0
  88. package/dist/lib/mathquill/khan-extractor.d.ts +16 -0
  89. package/dist/lib/mathquill/khan-extractor.d.ts.map +1 -0
  90. package/dist/lib/mathquill/khan-extractor.js +148 -0
  91. package/dist/lib/mathquill/khan-extractor.js.map +1 -0
  92. package/dist/lib/mathquill/learnosity-extractor.d.ts +15 -0
  93. package/dist/lib/mathquill/learnosity-extractor.d.ts.map +1 -0
  94. package/dist/lib/mathquill/learnosity-extractor.js +170 -0
  95. package/dist/lib/mathquill/learnosity-extractor.js.map +1 -0
  96. package/dist/lib/mathquill/migration-orchestrator.d.ts +77 -0
  97. package/dist/lib/mathquill/migration-orchestrator.d.ts.map +1 -0
  98. package/dist/lib/mathquill/migration-orchestrator.js +391 -0
  99. package/dist/lib/mathquill/migration-orchestrator.js.map +1 -0
  100. package/dist/lib/mathquill/package-updater.d.ts +9 -0
  101. package/dist/lib/mathquill/package-updater.d.ts.map +1 -0
  102. package/dist/lib/mathquill/package-updater.js +103 -0
  103. package/dist/lib/mathquill/package-updater.js.map +1 -0
  104. package/dist/lib/mathquill/pie-extractor.d.ts +14 -0
  105. package/dist/lib/mathquill/pie-extractor.d.ts.map +1 -0
  106. package/dist/lib/mathquill/pie-extractor.js +167 -0
  107. package/dist/lib/mathquill/pie-extractor.js.map +1 -0
  108. package/dist/lib/upstream/repo-utils.d.ts +9 -0
  109. package/dist/lib/upstream/repo-utils.d.ts.map +1 -0
  110. package/dist/lib/upstream/repo-utils.js +10 -0
  111. package/dist/lib/upstream/repo-utils.js.map +1 -0
  112. package/dist/lib/upstream/sync-compatibility.d.ts +29 -0
  113. package/dist/lib/upstream/sync-compatibility.d.ts.map +1 -0
  114. package/dist/lib/upstream/sync-compatibility.js +70 -0
  115. package/dist/lib/upstream/sync-compatibility.js.map +1 -0
  116. package/dist/lib/upstream/sync-constants.d.ts +50 -0
  117. package/dist/lib/upstream/sync-constants.d.ts.map +1 -0
  118. package/dist/lib/upstream/sync-constants.js +66 -0
  119. package/dist/lib/upstream/sync-constants.js.map +1 -0
  120. package/dist/lib/upstream/sync-controllers-strategy.d.ts +18 -0
  121. package/dist/lib/upstream/sync-controllers-strategy.d.ts.map +1 -0
  122. package/dist/lib/upstream/sync-controllers-strategy.js +243 -0
  123. package/dist/lib/upstream/sync-controllers-strategy.js.map +1 -0
  124. package/dist/lib/upstream/sync-demo-metadata.d.ts +15 -0
  125. package/dist/lib/upstream/sync-demo-metadata.d.ts.map +1 -0
  126. package/dist/lib/upstream/sync-demo-metadata.js +165 -0
  127. package/dist/lib/upstream/sync-demo-metadata.js.map +1 -0
  128. package/dist/lib/upstream/sync-dev-exports.d.ts +13 -0
  129. package/dist/lib/upstream/sync-dev-exports.d.ts.map +1 -0
  130. package/dist/lib/upstream/sync-dev-exports.js +115 -0
  131. package/dist/lib/upstream/sync-dev-exports.js.map +1 -0
  132. package/dist/lib/upstream/sync-externals.d.ts +29 -0
  133. package/dist/lib/upstream/sync-externals.d.ts.map +1 -0
  134. package/dist/lib/upstream/sync-externals.js +164 -0
  135. package/dist/lib/upstream/sync-externals.js.map +1 -0
  136. package/dist/lib/upstream/sync-filesystem.d.ts +21 -0
  137. package/dist/lib/upstream/sync-filesystem.d.ts.map +1 -0
  138. package/dist/lib/upstream/sync-filesystem.js +64 -0
  139. package/dist/lib/upstream/sync-filesystem.js.map +1 -0
  140. package/dist/lib/upstream/sync-imports.d.ts +284 -0
  141. package/dist/lib/upstream/sync-imports.d.ts.map +1 -0
  142. package/dist/lib/upstream/sync-imports.js +816 -0
  143. package/dist/lib/upstream/sync-imports.js.map +1 -0
  144. package/dist/lib/upstream/sync-mathquill.d.ts +19 -0
  145. package/dist/lib/upstream/sync-mathquill.d.ts.map +1 -0
  146. package/dist/lib/upstream/sync-mathquill.js +160 -0
  147. package/dist/lib/upstream/sync-mathquill.js.map +1 -0
  148. package/dist/lib/upstream/sync-package-json.d.ts +28 -0
  149. package/dist/lib/upstream/sync-package-json.d.ts.map +1 -0
  150. package/dist/lib/upstream/sync-package-json.js +66 -0
  151. package/dist/lib/upstream/sync-package-json.js.map +1 -0
  152. package/dist/lib/upstream/sync-package-manager.d.ts +50 -0
  153. package/dist/lib/upstream/sync-package-manager.d.ts.map +1 -0
  154. package/dist/lib/upstream/sync-package-manager.js +570 -0
  155. package/dist/lib/upstream/sync-package-manager.js.map +1 -0
  156. package/dist/lib/upstream/sync-pielib-strategy.d.ts +26 -0
  157. package/dist/lib/upstream/sync-pielib-strategy.d.ts.map +1 -0
  158. package/dist/lib/upstream/sync-pielib-strategy.js +345 -0
  159. package/dist/lib/upstream/sync-pielib-strategy.js.map +1 -0
  160. package/dist/lib/upstream/sync-react-strategy.d.ts +54 -0
  161. package/dist/lib/upstream/sync-react-strategy.d.ts.map +1 -0
  162. package/dist/lib/upstream/sync-react-strategy.js +733 -0
  163. package/dist/lib/upstream/sync-react-strategy.js.map +1 -0
  164. package/dist/lib/upstream/sync-strategy.d.ts +49 -0
  165. package/dist/lib/upstream/sync-strategy.d.ts.map +1 -0
  166. package/dist/lib/upstream/sync-strategy.js +2 -0
  167. package/dist/lib/upstream/sync-strategy.js.map +1 -0
  168. package/dist/lib/upstream/sync-summary.d.ts +20 -0
  169. package/dist/lib/upstream/sync-summary.d.ts.map +1 -0
  170. package/dist/lib/upstream/sync-summary.js +157 -0
  171. package/dist/lib/upstream/sync-summary.js.map +1 -0
  172. package/dist/lib/upstream/sync-transforms.d.ts +60 -0
  173. package/dist/lib/upstream/sync-transforms.d.ts.map +1 -0
  174. package/dist/lib/upstream/sync-transforms.js +97 -0
  175. package/dist/lib/upstream/sync-transforms.js.map +1 -0
  176. package/dist/lib/upstream/sync-vite-config.d.ts +13 -0
  177. package/dist/lib/upstream/sync-vite-config.d.ts.map +1 -0
  178. package/dist/lib/upstream/sync-vite-config.js +231 -0
  179. package/dist/lib/upstream/sync-vite-config.js.map +1 -0
  180. package/dist/utils/compatibility.d.ts +129 -0
  181. package/dist/utils/compatibility.d.ts.map +1 -0
  182. package/dist/utils/compatibility.js +44 -0
  183. package/dist/utils/compatibility.js.map +1 -0
  184. package/dist/utils/conversion.d.ts +25 -0
  185. package/dist/utils/conversion.d.ts.map +1 -0
  186. package/dist/utils/conversion.js +123 -0
  187. package/dist/utils/conversion.js.map +1 -0
  188. package/dist/utils/git.d.ts +7 -0
  189. package/dist/utils/git.d.ts.map +1 -0
  190. package/dist/utils/git.js +63 -0
  191. package/dist/utils/git.js.map +1 -0
  192. package/dist/utils/logger.d.ts +29 -0
  193. package/dist/utils/logger.d.ts.map +1 -0
  194. package/dist/utils/logger.js +63 -0
  195. package/dist/utils/logger.js.map +1 -0
  196. package/dist/utils/package-json.d.ts +12 -0
  197. package/dist/utils/package-json.d.ts.map +1 -0
  198. package/dist/utils/package-json.js +29 -0
  199. package/dist/utils/package-json.js.map +1 -0
  200. package/package.json +59 -0
  201. package/packages/cli/bin/dev.js +5 -0
  202. package/packages/cli/bin/run.js +5 -0
  203. package/src/commands/dev/demo/index.ts +313 -0
  204. package/src/commands/dev/test-bundler.ts +345 -0
  205. package/src/commands/mathquill/migrate.ts +269 -0
  206. package/src/commands/mathquill/status.ts +267 -0
  207. package/src/commands/packages/create-controllers.ts +127 -0
  208. package/src/commands/packages/create-lib-react.ts +279 -0
  209. package/src/commands/packages/create-react-elements.ts +306 -0
  210. package/src/commands/packages/enable-publishing.ts +161 -0
  211. package/src/commands/packages/init-synced-elements.ts +259 -0
  212. package/src/commands/upstream/README.md +444 -0
  213. package/src/commands/upstream/analyze-esm.ts +1973 -0
  214. package/src/commands/upstream/check.ts +228 -0
  215. package/src/commands/upstream/deps.ts +222 -0
  216. package/src/commands/upstream/sync-mathquill.ts +108 -0
  217. package/src/commands/upstream/sync.ts +687 -0
  218. package/src/commands/upstream/track.ts +145 -0
  219. package/src/commands/upstream/update.ts +110 -0
  220. package/src/commands/verify/controllers.ts +166 -0
  221. package/src/commands/verify/react-build.ts +171 -0
  222. package/src/index.ts +1 -0
  223. package/src/lib/mathquill/extension-generator.ts +111 -0
  224. package/src/lib/mathquill/khan-extractor.ts +175 -0
  225. package/src/lib/mathquill/learnosity-extractor.ts +198 -0
  226. package/src/lib/mathquill/migration-orchestrator.ts +513 -0
  227. package/src/lib/mathquill/package-updater.ts +120 -0
  228. package/src/lib/mathquill/pie-extractor.ts +194 -0
  229. package/src/lib/upstream/repo-utils.ts +18 -0
  230. package/src/lib/upstream/sync-compatibility.ts +89 -0
  231. package/src/lib/upstream/sync-constants.ts +77 -0
  232. package/src/lib/upstream/sync-controllers-strategy.ts +291 -0
  233. package/src/lib/upstream/sync-demo-metadata.ts +199 -0
  234. package/src/lib/upstream/sync-dev-exports.ts +151 -0
  235. package/src/lib/upstream/sync-externals.ts +159 -0
  236. package/src/lib/upstream/sync-filesystem.ts +87 -0
  237. package/src/lib/upstream/sync-imports.ts +992 -0
  238. package/src/lib/upstream/sync-mathquill.ts +194 -0
  239. package/src/lib/upstream/sync-package-json.ts +86 -0
  240. package/src/lib/upstream/sync-package-manager.ts +694 -0
  241. package/src/lib/upstream/sync-pielib-strategy.ts +441 -0
  242. package/src/lib/upstream/sync-react-strategy.ts +945 -0
  243. package/src/lib/upstream/sync-strategy.ts +61 -0
  244. package/src/lib/upstream/sync-summary.ts +194 -0
  245. package/src/lib/upstream/sync-transforms.ts +154 -0
  246. package/src/lib/upstream/sync-vite-config.ts +243 -0
  247. package/src/types/es-module-lexer.d.ts +4 -0
  248. package/src/utils/compatibility.ts +182 -0
  249. package/src/utils/conversion.ts +153 -0
  250. package/src/utils/git.ts +63 -0
  251. package/src/utils/logger.ts +69 -0
  252. package/src/utils/package-json.ts +43 -0
  253. package/tests/sync-package-manager.test.ts +112 -0
  254. package/tests/transform-assign-props.test.ts +101 -0
  255. package/tsconfig.json +15 -0
@@ -0,0 +1,164 @@
1
+ /**
2
+ * Shared external dependency configuration for Vite builds
3
+ *
4
+ * These dependencies should NOT be bundled into library outputs.
5
+ * Instead, they are resolved at runtime from the consuming application.
6
+ */
7
+ /**
8
+ * Check if a module ID should be treated as external (not bundled)
9
+ *
10
+ * Categories of externals:
11
+ * 1. Framework peer dependencies (React, MUI, Emotion) - MUST be external to avoid duplicate instances
12
+ * 2. Internal monorepo packages (@pie-lib, @pie-element, @pie-element) - External for separate resolution
13
+ * 3. Utility libraries (prop-types, classnames, debug) - External to reduce duplication across packages
14
+ * 4. Specialized UI libraries (@dnd-kit, react-transition-group, styled-components) - External to avoid version conflicts
15
+ * 5. Lodash variants (lodash/lodash-es) - External for runtime resolution via import maps
16
+ * 6. D3 modules - External as they're commonly shared
17
+ */
18
+ export function isExternal(id, variant) {
19
+ // React and React DOM - always external (peer dependencies)
20
+ if (/^react($|\/)/.test(id))
21
+ return true;
22
+ if (/^react-dom($|\/)/.test(id))
23
+ return true;
24
+ // Internal monorepo packages - always external
25
+ if (/^@pie-lib\//.test(id))
26
+ return true;
27
+ if (/^@pie-element\//.test(id))
28
+ return true;
29
+ if (/^@pie-element\//.test(id))
30
+ return true;
31
+ if (/^@pie-framework\//.test(id))
32
+ return true;
33
+ // UI framework packages - always external (peer dependencies)
34
+ if (/^@mui\//.test(id))
35
+ return true;
36
+ if (/^@emotion\//.test(id))
37
+ return true;
38
+ // D3 visualization modules - always external
39
+ if (/^d3-/.test(id))
40
+ return true;
41
+ // Recharts charting library - external for fraction-model
42
+ if (id === 'recharts' || /^recharts\//.test(id))
43
+ return true;
44
+ // Testing libraries - always external
45
+ if (/^@testing-library\//.test(id))
46
+ return true;
47
+ // Lodash - variant-specific (elements use lodash, pie-lib uses lodash-es)
48
+ if (variant === 'element') {
49
+ if (id === 'lodash')
50
+ return true;
51
+ if (/^lodash\//.test(id))
52
+ return true;
53
+ }
54
+ else {
55
+ if (id === 'lodash-es')
56
+ return true;
57
+ if (/^lodash-es\//.test(id))
58
+ return true;
59
+ }
60
+ // Styled-components - external to avoid multiple instances
61
+ if (/^styled-components/.test(id))
62
+ return true;
63
+ // Konva visualization library - external for hotspot/drawing-response
64
+ if (id === 'konva' || id.startsWith('konva/'))
65
+ return true;
66
+ if (id === 'react-konva' || id.startsWith('react-konva/'))
67
+ return true;
68
+ // DnD Kit libraries - external for drag and drop functionality
69
+ if (/^@dnd-kit\//.test(id))
70
+ return true;
71
+ // Common utility and UI libraries - always external
72
+ const commonExternals = [
73
+ 'prop-types', // React prop validation
74
+ 'classnames', // CSS class utility
75
+ 'debug', // Debug logging
76
+ 'i18next', // Internationalization
77
+ 'humps', // String case conversion
78
+ 'mathjs', // Math expression evaluation
79
+ 'react-jss', // JSS styling for React
80
+ 'js-combinatorics', // Combinatorics library
81
+ '@mapbox/point-geometry', // Graphing utils dependency
82
+ '@dnd-kit/core', // Drag and drop
83
+ 'react-transition-group', // Animations
84
+ 'nested-property', // Object property access (placement-ordering)
85
+ 'pluralize', // Word pluralization (placement-ordering)
86
+ 'decimal.js', // Decimal math (placement-ordering)
87
+ ];
88
+ return commonExternals.includes(id);
89
+ }
90
+ /**
91
+ * Generate external function for Vite rollupOptions
92
+ * Use this in vite.config.ts generation
93
+ */
94
+ export function createExternalFunction(variant) {
95
+ const lodashCheck = variant === 'element'
96
+ ? `id === 'lodash' ||
97
+ /^lodash\\//.test(id) ||`
98
+ : `id === 'lodash-es' ||
99
+ /^lodash-es\\//.test(id) ||`;
100
+ return `(id) => {
101
+ return (
102
+ /^react($|\\/)/.test(id) ||
103
+ /^react-dom($|\\/)/.test(id) ||
104
+ /^@pie-lib\\//.test(id) ||
105
+ /^@pie-element\\//.test(id) ||
106
+ /^@pie-element\\//.test(id) ||
107
+ /^@pie-framework\\//.test(id) ||
108
+ /^@mui\\//.test(id) ||
109
+ /^@emotion\\//.test(id) ||
110
+ /^d3-/.test(id) ||
111
+ /^@testing-library\\//.test(id) ||
112
+ ${lodashCheck}
113
+ /^styled-components/.test(id) ||
114
+ id === 'konva' || /^konva\\//.test(id) ||
115
+ id === 'react-konva' || /^react-konva\\//.test(id) ||
116
+ /^@dnd-kit\\//.test(id) ||
117
+ id === '@mdi/react' || /^@mdi\\/react\\//.test(id) ||
118
+ id === '@mdi/js' || /^@mdi\\/js\\//.test(id) ||
119
+ id === 'recharts' || /^recharts\\//.test(id) ||
120
+ ['prop-types', 'classnames', 'debug', 'i18next', 'humps', 'mathjs', 'react-jss', 'js-combinatorics', '@mapbox/point-geometry', 'react-transition-group', 'nested-property', 'pluralize', 'decimal.js'].includes(id)
121
+ );
122
+ }`;
123
+ }
124
+ /**
125
+ * Generate external function for Konva-based elements (preserveModules: false)
126
+ * These bundle konva, react-konva, scheduler, and react-reconciler to avoid runtime resolution issues
127
+ */
128
+ export function createKonvaExternalFunction() {
129
+ return `(id) => {
130
+ // Bundle konva, react-konva, scheduler, and react-reconciler
131
+ // Check these FIRST before other react checks
132
+ if (id === 'konva' || id.startsWith('konva/')) return false;
133
+ if (id === 'react-konva' || id.startsWith('react-konva/')) return false;
134
+ if (id === 'scheduler' || id.startsWith('scheduler/')) return false;
135
+ if (id === 'react-reconciler' || id.startsWith('react-reconciler/')) return false;
136
+
137
+ // Always external: base package names
138
+ if (id === 'react' || id.startsWith('react/')) return true;
139
+ if (id === 'react-dom' || id.startsWith('react-dom/')) return true;
140
+ if (id.startsWith('@pie-lib/')) return true;
141
+ if (id.startsWith('@pie-element/')) return true;
142
+ if (id.startsWith('@pie-element/')) return true;
143
+ if (id.startsWith('@pie-framework/')) return true;
144
+ if (id.startsWith('@mui/')) return true;
145
+ if (id.startsWith('@emotion/')) return true;
146
+ if (id.startsWith('d3-')) return true;
147
+ // Keep recharts external
148
+ if (id === 'recharts' || id.startsWith('recharts/')) return true;
149
+ // Keep lodash external even with preserveModules: false
150
+ // It will be resolved via import map in demo HTML
151
+ if (id === 'lodash' || id.startsWith('lodash/')) return true;
152
+ if (id === 'styled-components' || id.startsWith('styled-components/')) return true;
153
+ // DnD Kit libraries
154
+ if (id.startsWith('@dnd-kit/')) return true;
155
+ // Material Design Icons for drawing-response
156
+ if (id === '@mdi/react' || id.startsWith('@mdi/react/')) return true;
157
+ if (id === '@mdi/js' || id.startsWith('@mdi/js/')) return true;
158
+ if (['prop-types', 'classnames', 'debug', 'i18next', 'humps', 'mathjs', 'react-jss', 'js-combinatorics', '@mapbox/point-geometry', 'react-transition-group', 'nested-property', 'pluralize', 'decimal.js'].includes(id)) return true;
159
+
160
+ // Everything else gets bundled (including dependencies of konva/react-konva)
161
+ return false;
162
+ }`;
163
+ }
164
+ //# sourceMappingURL=sync-externals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync-externals.js","sourceRoot":"","sources":["../../../src/lib/upstream/sync-externals.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,UAAU,CAAC,EAAU,EAAE,OAA6B;IAClE,4DAA4D;IAC5D,IAAI,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC;IACzC,IAAI,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC;IAE7C,+CAA+C;IAC/C,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC;IACxC,IAAI,iBAAiB,C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K,aAAa,IAAI,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC;QAAE,OAAO,IAAI,CAAC;IAEvE,+DAA+D;IAC/D,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC;IAExC,oDAAoD;IACpD,MAAM,eAAe,GAAG;QACtB,YAAY,EAAE,wBAAwB;QACtC,YAAY,EAAE,oBAAoB;QAClC,OAAO,EAAE,gBAAgB;QACzB,SAAS,EAAE,uBAAuB;QAClC,OAAO,EAAE,yBAAyB;QAClC,QAAQ,EAAE,6BAA6B;QACvC,WAAW,EAAE,wBAAwB;QACrC,kBAAkB,EAAE,wBAAwB;QAC5C,wBAAwB,EAAE,4BAA4B;QACtD,eAAe,EAAE,gBAAgB;QACjC,wBAAwB,EAAE,aAAa;QACvC,iBAAiB,EAAE,8CAA8C;QACjE,WAAW,EAAE,0CAA0C;QACvD,YAAY,EAAE,oCAAoC;KACnD,CAAC;IAEF,OAAO,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACtC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAA6B;IAClE,MAAM,WAAW,GACf,OAAO,KAAK,SAAS;QACnB,CAAC,CAAC;mCAC2B;QAC7B,CAAC,CAAC;sCAC8B,CAAC;IAErC,OAAO;;;;;;;;;;;;YAYG,WAAW;;;;;;;;;;QAUf,CAAC;AACT,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,2BAA2B;IACzC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAiCD,CAAC;AACT,CAAC"}
@@ -0,0 +1,21 @@
1
+ export interface CleanOptions {
2
+ dryRun?: boolean;
3
+ verbose?: boolean;
4
+ preserve?: string[];
5
+ }
6
+ export interface Logger {
7
+ info(message: string): void;
8
+ }
9
+ /**
10
+ * Clean a directory, optionally preserving subdirectories
11
+ */
12
+ export declare function cleanDirectory(targetDir: string, label: string, options?: CleanOptions, logger?: Logger): Promise<void>;
13
+ /**
14
+ * Check if any of the given paths exist
15
+ */
16
+ export declare function existsAny(paths: string[]): boolean;
17
+ /**
18
+ * Safe wrapper around readdir that sorts results
19
+ */
20
+ export declare function readdir(path: string): Promise<string[]>;
21
+ //# sourceMappingURL=sync-filesystem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync-filesystem.d.ts","sourceRoot":"","sources":["../../../src/lib/upstream/sync-filesystem.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,MAAM;IACrB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,YAAiB,EAC1B,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CAuCf;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAElD;AAED;;GAEG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAU7D"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * File system utilities for sync operations
3
+ */
4
+ import { existsSync } from 'node:fs';
5
+ import { readdir as fsReaddir, rm as fsRm } from 'node:fs/promises';
6
+ import { join } from 'node:path';
7
+ /**
8
+ * Clean a directory, optionally preserving subdirectories
9
+ */
10
+ export async function cleanDirectory(targetDir, label, options = {}, logger) {
11
+ const { dryRun = false, verbose = false, preserve = [] } = options;
12
+ if (!existsSync(targetDir)) {
13
+ return;
14
+ }
15
+ if (dryRun) {
16
+ if (verbose && logger) {
17
+ const preserveMsg = preserve.length > 0 ? ` (preserving: ${preserve.join(', ')})` : '';
18
+ logger.info(` 🧹 Would clean ${label}${preserveMsg}`);
19
+ }
20
+ return;
21
+ }
22
+ // If no directories to preserve, delete everything
23
+ if (preserve.length === 0) {
24
+ await fsRm(targetDir, { recursive: true, force: true });
25
+ if (verbose && logger) {
26
+ logger.info(` 🧹 Cleaned ${label}`);
27
+ }
28
+ return;
29
+ }
30
+ // Selectively delete entries, preserving specified directories
31
+ const entries = await fsReaddir(targetDir);
32
+ for (const entry of entries) {
33
+ if (preserve.includes(entry)) {
34
+ continue;
35
+ }
36
+ const entryPath = join(targetDir, entry);
37
+ await fsRm(entryPath, { recursive: true, force: true });
38
+ }
39
+ if (verbose && logger) {
40
+ logger.info(` 🧹 Cleaned ${label} (preserved: ${preserve.join(', ')})`);
41
+ }
42
+ }
43
+ /**
44
+ * Check if any of the given paths exist
45
+ */
46
+ export function existsAny(paths) {
47
+ return paths.some((p) => existsSync(p));
48
+ }
49
+ /**
50
+ * Safe wrapper around readdir that sorts results
51
+ */
52
+ export async function readdir(path) {
53
+ try {
54
+ const entries = await fsReaddir(path);
55
+ return entries.sort();
56
+ }
57
+ catch (error) {
58
+ if (error && typeof error === 'object' && 'code' in error && error.code === 'ENOENT') {
59
+ return [];
60
+ }
61
+ throw error;
62
+ }
63
+ }
64
+ //# sourceMappingURL=sync-filesystem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync-filesystem.js","sourceRoot":"","sources":["../../../src/lib/upstream/sync-filesystem.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAYjC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,SAAiB,EACjB,KAAa,EACb,UAAwB,EAA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D,CAAC;IAED,IAAI,OAAO,IAAI,MAAM,EAAE,CAAC;QACtB,MAAM,CAAC,IAAI,CAAC,gBAAgB,KAAK,gBAAgB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3E,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,KAAe;IACvC,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAY;IACxC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,CAAC;QACtC,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC;IACxB,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACrF,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,284 @@
1
+ /**
2
+ * Fix import statements in a file to handle default export conversions
3
+ *
4
+ * When converting JS files with default exports to TS, we need to update
5
+ * imports in consuming files to use named imports instead.
6
+ */
7
+ export declare function fixImportsInFile(filePath: string, defaultExportFiles: Set<string>): Promise<boolean>;
8
+ /**
9
+ * Check if code contains JSX syntax
10
+ */
11
+ export declare function containsJsx(code: string): boolean;
12
+ /**
13
+ * Replace editable-html imports with inlined constants
14
+ *
15
+ * editable-html is not ESM-compatible (depends on Slate v0.x), but some packages
16
+ * only import constants from it. We inline these constants to avoid the dependency.
17
+ */
18
+ export declare function inlineEditableHtmlConstants(code: string): string;
19
+ /**
20
+ * Fix missing re-export of TokenTypes in text-select token-select/index.jsx
21
+ * The upstream imports TokenTypes from ./token but doesn't re-export it,
22
+ * causing build failures when parent index.js tries to import it.
23
+ */
24
+ export declare function reexportTokenTypes(code: string, filePath: string): string;
25
+ /**
26
+ * Replace configure/lib/defaults import with an empty defaults object
27
+ * when configure directory is not synced (ESM-incompatible due to Slate v0.x)
28
+ */
29
+ export declare function inlineConfigureDefaults(code: string): string;
30
+ /**
31
+ * Determine if a file should have .tsx extension based on content
32
+ */
33
+ export declare function shouldUseTsxExtension(content: string, originalPath: string): boolean;
34
+ /**
35
+ * Convert CommonJS module.exports to ES module exports
36
+ *
37
+ * Handles patterns like:
38
+ * module.exports = { foo: ..., bar: ... }
39
+ *
40
+ * Converts to:
41
+ * export const foo = ...;
42
+ * export const bar = ...;
43
+ */
44
+ export declare function convertModuleExportsToEsm(content: string): string;
45
+ /**
46
+ * Transform lodash imports to lodash-es for ESM compatibility
47
+ *
48
+ * Handles all lodash import patterns:
49
+ * - Individual module imports: import isEmpty from 'lodash/isEmpty'
50
+ * - Named imports: import { isEmpty, isEqual } from 'lodash'
51
+ * - Default import: import _ from 'lodash'
52
+ * - Namespace import: import * as _ from 'lodash'
53
+ *
54
+ * Converts them to use lodash-es which is a pure ESM package.
55
+ */
56
+ export declare function transformLodashToLodashEs(content: string): string;
57
+ /**
58
+ * Transform package.json dependencies from lodash to lodash-es
59
+ *
60
+ * Replaces lodash with lodash-es version 4.17.22 (latest ESM version)
61
+ * Also removes @types/lodash as lodash-es includes built-in TypeScript types
62
+ */
63
+ export declare function transformPackageJsonLodash<T extends Record<string, any>>(packageJson: T): T;
64
+ /**
65
+ * Transform recharts version in package.json
66
+ *
67
+ * Upgrades recharts from 2.x to 3.x for ESM compatibility.
68
+ * Recharts 3.x removes the lodash dependency and is fully ESM-compatible.
69
+ */
70
+ export declare function transformPackageJsonRecharts<T extends Record<string, any>>(packageJson: T): T;
71
+ /**
72
+ * Transform @pie-framework event package imports to internal packages
73
+ *
74
+ * Handles:
75
+ * - @pie-framework/pie-player-events → @pie-element/shared-player-events
76
+ * - @pie-framework/pie-configure-events → @pie-element/shared-configure-events
77
+ */
78
+ export declare function transformPieFrameworkEventImports(content: string): string;
79
+ /**
80
+ * Transform @pie-lib/controller-utils imports to internal @pie-element/shared-controller-utils
81
+ *
82
+ * Handles:
83
+ * - @pie-lib/controller-utils → @pie-element/shared-controller-utils
84
+ *
85
+ * Our internal controller-utils package has the same API but with modernized TypeScript
86
+ * and no lodash/debug dependencies.
87
+ */
88
+ export declare function transformControllerUtilsImports(content: string): string;
89
+ /**
90
+ * Transform @pie-lib shared package imports to internal @pie-element/shared-* packages
91
+ *
92
+ * Handles:
93
+ * - @pie-lib/math-rendering → @pie-element/shared-math-rendering-mathjax
94
+ *
95
+ * These packages have been moved to shared/ for better version control and consistency.
96
+ */
97
+ export declare function transformSharedPackageImports(content: string): string;
98
+ /**
99
+ * Transform @pie-framework/mathquill imports to internal @pie-element/shared-mathquill
100
+ *
101
+ * Handles:
102
+ * - @pie-framework/mathquill → @pie-element/shared-mathquill
103
+ *
104
+ * Our internal mathquill package is a fork from the PIE org with matrix support,
105
+ * accessibility features, and modernized ESM code.
106
+ */
107
+ export declare function transformMathquillImports(content: string): string;
108
+ /**
109
+ * Transform package.json dependencies for PIE Framework event packages
110
+ *
111
+ * Replaces external @pie-framework event packages with internal workspace packages
112
+ */
113
+ export declare function transformPackageJsonPieEvents<T extends Record<string, any>>(packageJson: T): T;
114
+ /**
115
+ * Transform package.json dependencies for @pie-lib/controller-utils
116
+ *
117
+ * Replaces @pie-lib/controller-utils with internal @pie-element/shared-controller-utils
118
+ */
119
+ export declare function transformPackageJsonControllerUtils<T extends Record<string, any>>(packageJson: T): T;
120
+ /**
121
+ * Transform package.json dependencies for shared packages
122
+ *
123
+ * Replaces @pie-lib shared packages with internal @pie-element/shared-* packages
124
+ */
125
+ export declare function transformPackageJsonSharedPackages<T extends Record<string, any>>(packageJson: T): T;
126
+ /**
127
+ * Transform package.json dependencies for @pie-framework/mathquill
128
+ *
129
+ * Replaces @pie-framework/mathquill with internal @pie-element/shared-mathquill
130
+ */
131
+ export declare function transformPackageJsonMathquill<T extends Record<string, any>>(packageJson: T): T;
132
+ /**
133
+ * Transform direct property assignment patterns to use assignProps utility
134
+ *
135
+ * Replaces patterns like:
136
+ * Object.entries(props).forEach(([key, value]) => { element[key] = value; });
137
+ * With:
138
+ * assignProps(element, props);
139
+ *
140
+ * And adds the import if not present.
141
+ *
142
+ * NOTE: This transform is available but NOT enabled in the sync pipeline by default.
143
+ * Only enable it if this pattern appears frequently in upstream code and needs
144
+ * to be refactored automatically. For one-off cases, manual refactoring is preferred.
145
+ *
146
+ * To enable: Import and call this in sync-pielib-strategy.ts after other transforms.
147
+ */
148
+ export declare function transformToAssignProps(content: string): string;
149
+ /**
150
+ * Transform configure utility imports for flattened directory structure
151
+ *
152
+ * In upstream pie-elements, configure utility files live at configure/utils.js
153
+ * and are imported from configure/src/ files using '../utils'.
154
+ *
155
+ * In the synced structure, both configure/src/ files and configure/utils.js
156
+ * are synced to src/configure/, so the import path needs to change from
157
+ * '../utils' to './utils'.
158
+ *
159
+ * This transform handles:
160
+ * - import { x } from '../utils' → import { x } from './utils'
161
+ * - Only applies to files directly in configure/src/, not subdirectories
162
+ * - Only when the import is '../utils' (not '../utils/something')
163
+ */
164
+ export declare function transformConfigureUtilsImports(content: string, relativePath: string): string;
165
+ /**
166
+ * Transform SSR-unsafe require() calls to standard ESM imports
167
+ *
168
+ * Upstream pie-lib code uses this pattern for SSR compatibility with MathQuill:
169
+ *
170
+ * ```js
171
+ * // - mathquill error window not defined
172
+ * let EditableHtml;
173
+ * let StyledEditableHTML;
174
+ * if (typeof window !== 'undefined') {
175
+ * EditableHtml = require('@pie-lib/editable-html-tip-tap')['default'];
176
+ * StyledEditableHTML = styled(EditableHtml)(({ theme }) => ({
177
+ * fontFamily: theme.typography.fontFamily,
178
+ * }));
179
+ * }
180
+ * ```
181
+ *
182
+ * This doesn't work in browser ESM (require is not defined). Transform to:
183
+ *
184
+ * ```tsx
185
+ * import EditableHtmlImport from '@pie-lib/editable-html-tip-tap';
186
+ *
187
+ * const EditableHtml = EditableHtmlImport;
188
+ * const StyledEditableHTML = styled(EditableHtml)(({ theme }) => ({
189
+ * fontFamily: theme.typography.fontFamily,
190
+ * }));
191
+ * ```
192
+ *
193
+ * We use direct imports instead of React.lazy because:
194
+ * - Simpler code (no Suspense wrapper needed)
195
+ * - No loading flicker
196
+ * - Modern bundlers handle ESM imports correctly for SSR
197
+ * - The component is always needed (no code-splitting benefit)
198
+ */
199
+ export declare function transformSsrRequireToReactLazy(content: string): string;
200
+ /**
201
+ * Fix TypeScript type inference errors for styled components
202
+ *
203
+ * TypeScript can't infer types for some MUI styled components, causing errors like:
204
+ * "The inferred type of 'X' cannot be named without a reference to '@emotion/styled'"
205
+ *
206
+ * This transform adds explicit type annotations to fix these errors.
207
+ */
208
+ export declare function fixStyledComponentTypes(content: string): string;
209
+ /**
210
+ * Transform self-referential package imports to relative imports
211
+ *
212
+ * In upstream pie-elements, configure files sometimes import from their own package
213
+ * using the package name (e.g., import { X } from '@pie-element/fraction-model').
214
+ * This creates circular dependency issues in the build.
215
+ *
216
+ * This transform converts these self-referential imports to relative paths based on
217
+ * the package structure:
218
+ * - @pie-element/{name} → relative path to delivery component
219
+ *
220
+ * Example:
221
+ * In configure/src/main.jsx:
222
+ * import { FractionModelChart } from '@pie-element/fraction-model'
223
+ * Becomes:
224
+ * import FractionModelChart from '../delivery/fraction-model-chart'
225
+ *
226
+ * @param content - The file content
227
+ * @param packageName - The current package name (e.g., '@pie-element/fraction-model')
228
+ * @param sourceFilePath - The source file path relative to package root
229
+ * @returns Transformed content with relative imports
230
+ */
231
+ export declare function transformSelfReferentialImports(content: string, packageName: string, sourceFilePath: string): string;
232
+ /**
233
+ * Fix type inference errors for exported functions with complex return types
234
+ *
235
+ * TypeScript can't infer types for some exported functions that have complex dependencies,
236
+ * causing errors like: "The inferred type of 'X' cannot be named without a reference to 'Y'"
237
+ *
238
+ * This transform adds explicit `: any` type annotations to fix these portability errors.
239
+ */
240
+ export declare function fixExportedFunctionTypes(content: string, sourcePath?: string): string;
241
+ /**
242
+ * Transform MUI Menu imports to use InlineMenu from @pie-lib/render-ui
243
+ *
244
+ * Replaces direct imports of Menu from '@mui/material/Menu' with InlineMenu
245
+ * from '@pie-lib/render-ui', which includes fixes for the backdrop overlay issue.
246
+ *
247
+ * This addresses a common issue where MUI's Menu component covers the entire screen
248
+ * with a white background when used in inline contexts (dropdowns within text).
249
+ *
250
+ * Transformations:
251
+ * - import Menu from '@mui/material/Menu' → import { InlineMenu as Menu } from '@pie-lib/render-ui'
252
+ * - import Menu, { MenuProps } from '@mui/material/Menu' → import { InlineMenu as Menu } from '@pie-lib/render-ui'; import type { MenuProps } from '@mui/material/Menu'
253
+ * - styled(Menu) continues to work as Menu is aliased to InlineMenu
254
+ *
255
+ * @param content - Source code content
256
+ * @returns Transformed content with Menu imports replaced
257
+ */
258
+ export declare function transformMenuToInlineMenu(content: string): string;
259
+ /**
260
+ * Add InlineMenu export to render-ui index file
261
+ *
262
+ * The InlineMenu component is a pie-elements-ng specific component that wraps
263
+ * MUI's Menu to fix the backdrop overlay issue. Since it doesn't exist in the
264
+ * upstream pie-lib, we need to add its export after the sync completes.
265
+ *
266
+ * This transform adds the InlineMenu export to the end of the render-ui index
267
+ * file if it's not already present.
268
+ *
269
+ * @param content - Source code content
270
+ * @param sourcePath - Path to the source file (to identify render-ui index)
271
+ * @returns Transformed content with InlineMenu export added if needed
272
+ */
273
+ export declare function addInlineMenuExport(content: string, sourcePath?: string): string;
274
+ /**
275
+ * Transform MathQuill.getInterface(2) to getInterface(3)
276
+ *
277
+ * Interface version 2 requires jQuery, but pie-elements-ng uses interface version 3
278
+ * which has a jQuery-free API. This transform updates calls to use version 3.
279
+ *
280
+ * @param content - Source code content
281
+ * @returns Transformed content with getInterface(3) instead of getInterface(2)
282
+ */
283
+ export declare function transformMathQuillInterface(content: string): string;
284
+ //# sourceMappingURL=sync-imports.d.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