weml-monaco 0.4.4 → 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.
- package/CHANGELOG.md +30 -0
- package/README.md +15 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.global.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,36 @@ This package mirrors the language logic of the VS Code extension; entries below
|
|
|
8
8
|
track the port catching up with the VS Code provider changes (see the root
|
|
9
9
|
`CHANGELOG.md` for the extension).
|
|
10
10
|
|
|
11
|
+
## [0.5.0] — 2026-09-09
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
- **Breaking:** the Monaco type surface is imported from
|
|
15
|
+
`monaco-editor/editor/editor.api.js` instead of the `monaco-editor` root.
|
|
16
|
+
The root re-exports the TypeScript, CSS, JSON and HTML language
|
|
17
|
+
contributions, so its type forced every consumer to import Monaco whole and
|
|
18
|
+
ship all four language workers — around 11 MB of bundle nobody used. The
|
|
19
|
+
editor core carries everything this package actually touches. Passing the
|
|
20
|
+
full `monaco-editor` namespace still type-checks, since it is a superset.
|
|
21
|
+
- **Breaking:** `peerDependencies.monaco-editor` raised from `>=0.34.0` to
|
|
22
|
+
`>=0.56.0`. The subpath resolves through the `exports` map introduced in
|
|
23
|
+
0.56 (`"./*": "./esm/vs/*.js"`) and needs `moduleResolution` `node16` or
|
|
24
|
+
`bundler`; on 0.55 and older the equivalent path was
|
|
25
|
+
`monaco-editor/esm/vs/editor/editor.api`.
|
|
26
|
+
- Development and the CDN demo build against monaco-editor 0.56.
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
- The bundles no longer register themselves with an AMD loader. `he` (via
|
|
30
|
+
node-html-parser) ends in a UMD footer whose `define()` call is anonymous, so
|
|
31
|
+
loading `dist/index.global.js` from a `<script>` tag on a page that also runs
|
|
32
|
+
Monaco's AMD loader made the loader attribute that module to whatever it was
|
|
33
|
+
resolving, warning `Duplicate definition of module 'vs/editor/editor.main'`.
|
|
34
|
+
The build now folds `define.amd` to `false`, dropping the branch.
|
|
35
|
+
|
|
36
|
+
The type-path change itself does not touch the runtime output: every Monaco
|
|
37
|
+
import in `src/` is an `import type`, and only the first line of the emitted
|
|
38
|
+
declarations changes. `dist/index.mjs`, `index.cjs` and `index.global.js`
|
|
39
|
+
differ solely by the removed AMD footer above.
|
|
40
|
+
|
|
11
41
|
## [0.4.4] — 2026-09-07
|
|
12
42
|
|
|
13
43
|
Synced with VS Code extension `0.7.12`.
|
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ Monaco is **passed in** at registration time, so this works no matter how
|
|
|
58
58
|
Monaco itself is loaded (AMD/CDN, ESM bundle, or a global):
|
|
59
59
|
|
|
60
60
|
```ts
|
|
61
|
-
import * as monaco from 'monaco-editor';
|
|
61
|
+
import * as monaco from 'monaco-editor/editor/editor.api.js';
|
|
62
62
|
import { registerWeml } from 'weml-monaco';
|
|
63
63
|
|
|
64
64
|
const disposable = registerWeml(monaco);
|
|
@@ -69,6 +69,20 @@ monaco.editor.create(document.getElementById('container'), { model });
|
|
|
69
69
|
// disposable.dispose(); // tears down every provider + diagnostics listener
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
+
The import path is the editor core rather than the `monaco-editor` root on
|
|
73
|
+
purpose. The root re-exports the TypeScript, CSS, JSON and HTML language
|
|
74
|
+
contributions, so importing it pulls all four — and their workers — into the
|
|
75
|
+
application bundle. `weml-monaco` never touches them: it only needs
|
|
76
|
+
`editor`, `languages`, `Position`, `MarkerSeverity` and a handful of
|
|
77
|
+
interfaces, all of which live in `editor/editor.api.js`. Passing the full
|
|
78
|
+
`monaco-editor` namespace still type-checks (it is a superset), so this is a
|
|
79
|
+
choice the consumer makes, not a restriction.
|
|
80
|
+
|
|
81
|
+
The subpath resolves through the package's `exports` map, which requires
|
|
82
|
+
**monaco-editor 0.56 or newer** and `moduleResolution` `node16`/`bundler`.
|
|
83
|
+
On 0.55 and older the equivalent path was
|
|
84
|
+
`monaco-editor/esm/vs/editor/editor.api`.
|
|
85
|
+
|
|
72
86
|
`registerWeml(monaco, options?)` accepts:
|
|
73
87
|
|
|
74
88
|
| option | default | meaning |
|
package/dist/index.cjs
CHANGED
|
@@ -267,7 +267,7 @@ var require_he = __commonJS({
|
|
|
267
267
|
"escape": escape,
|
|
268
268
|
"unescape": decode
|
|
269
269
|
};
|
|
270
|
-
if (typeof define == "function" &&
|
|
270
|
+
if (typeof define == "function" && false) {
|
|
271
271
|
define(function() {
|
|
272
272
|
return he;
|
|
273
273
|
});
|