@mhjuma/traverse 0.4.0 → 0.4.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @mhjuma/traverse
2
2
 
3
+ ## 0.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix KQL syntax highlighting and autocomplete silently breaking in production builds. The `@kusto/monaco-kusto` worker crashed at load with `ReferenceError: global is not defined` because Vite only applies the main `plugins` array to workers in dev — production worker bundles shipped without the Bridge.NET `global` shim and the Node polyfills.
8
+
9
+ Consumers must now also re-apply `nodePolyfills` + `traverseVitePlugin()` via Vite's `worker.plugins`. This is documented in the quick-start guide and the `traverseVitePlugin` JSDoc, and applied to the bundled web and desktop apps.
10
+
3
11
  ## 0.4.0
4
12
 
5
13
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhjuma/traverse",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -42,15 +42,20 @@
42
42
  "devDependencies": {
43
43
  "@azure/msal-browser": "5.6.3",
44
44
  "@monaco-editor/react": "4.7.0",
45
- "monaco-editor": "0.52.2",
46
45
  "@types/react": "19.2.14",
47
46
  "@types/react-dom": "19.2.3",
47
+ "@vitest/coverage-v8": "4.1.4",
48
+ "jsdom": "29.0.2",
49
+ "monaco-editor": "0.52.2",
48
50
  "oxlint": "1.59.0",
49
51
  "oxlint-tsgolint": "0.20.0",
50
52
  "typescript": "6.0.2",
51
- "@vitest/coverage-v8": "4.1.4",
52
- "vitest": "4.1.4",
53
- "jsdom": "29.0.2"
53
+ "vitest": "4.1.4"
54
+ },
55
+ "repository": {
56
+ "type": "git",
57
+ "url": "git+https://github.com/MJuma/traverse.git",
58
+ "directory": "packages/core"
54
59
  },
55
60
  "scripts": {
56
61
  "build": "tsc --noEmit",
@@ -28,6 +28,12 @@
28
28
  * `nodePolyfills({ overrides: { fs: null } })` themselves alongside this
29
29
  * plugin. See `docs/guide/quick-start.md` for the full Vite setup.
30
30
  *
31
+ * **Production builds**: Vite only applies the main `plugins` array to workers
32
+ * in dev. For a production build you MUST re-apply both this plugin and
33
+ * `nodePolyfills` via `worker.plugins`, or the kusto worker ships without the
34
+ * shim/polyfills and crashes at runtime with `ReferenceError: global is not
35
+ * defined` (breaking KQL highlighting + autocomplete in prod only).
36
+ *
31
37
  * @example
32
38
  * ```ts
33
39
  * // vite.config.ts
@@ -35,12 +41,18 @@
35
41
  * import { nodePolyfills } from 'vite-plugin-node-polyfills';
36
42
  * import { traverseVitePlugin } from '@mhjuma/traverse/vite-plugin';
37
43
  *
44
+ * const traversePlugins = () => [
45
+ * nodePolyfills({ overrides: { fs: null } }),
46
+ * traverseVitePlugin(),
47
+ * ];
48
+ *
38
49
  * export default defineConfig({
39
50
  * plugins: [
40
51
  * // ... your own plugins ...
41
- * nodePolyfills({ overrides: { fs: null } }),
42
- * traverseVitePlugin(),
52
+ * ...traversePlugins(),
43
53
  * ],
54
+ * // Required for production builds — see note above.
55
+ * worker: { plugins: traversePlugins },
44
56
  * });
45
57
  * ```
46
58
  */