weml-monaco 0.3.3 → 0.4.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 CHANGED
@@ -8,6 +8,38 @@ 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.4.0] — 2026-08-17
12
+
13
+ Packaging only — the language logic is unchanged.
14
+
15
+ ### Changed
16
+ - **Rebuilt the package with tsup** into `dist/index.mjs` (ESM), `dist/index.cjs`
17
+ (CJS) and `dist/index.global.js` (minified IIFE for `<script>`/CDN use), with an
18
+ `exports` map, per-condition type declarations, `sideEffects: false` and
19
+ `engines: node >= 18`. `main` used to point at the IIFE bundle, so
20
+ `require('weml-monaco')` returned an empty object — it now resolves to real CJS.
21
+ - **The published tarball shrank from ~7 MB to ~2 MB.** The IIFE build is minified
22
+ and ships without a sourcemap; only the ESM/CJS bundles carry maps.
23
+ - `node-html-parser` and `vscode-html-languageservice` moved to `devDependencies`:
24
+ both are bundled into every artefact, so the package now installs with **no
25
+ runtime dependencies**.
26
+ - Publishing runs `publint` + `arethetypeswrong` (`npm run check:package`) in CI.
27
+
28
+ ### Fixed
29
+ - **Sourcemaps no longer reference files that do not exist.** esbuild used to chain
30
+ the maps shipped by `entities`, `domutils`, `css-select` and `nth-check`, which
31
+ point at TypeScript sources those packages never publish; the resulting `sources`
32
+ entries resolved to `<app>/node_modules/node_modules/...` and made every consuming
33
+ dev server log a warning per source on each load (Vite: *"Sourcemap … points to a
34
+ source file outside its package"*). Dependency sourcemap comments are now ignored
35
+ at build time, so every source in the shipped maps has inline content.
36
+
37
+ ### Migration
38
+ Deep imports of `dist/weml-monaco.js` / `dist/weml-monaco.esm.js` no longer exist
39
+ (and the `exports` map blocks deep paths anyway). Import the package by name —
40
+ `import { registerWeml } from 'weml-monaco'` — or, for a `<script>` tag, use
41
+ `weml-monaco/global` (`window.WemlMonaco`).
42
+
11
43
  ## [0.3.2] — 2026-08-13
12
44
 
13
45
  Synced with VS Code extension `0.7.7`.
package/README.md CHANGED
@@ -27,12 +27,29 @@ standalone re-implementation living entirely under `monaco-editor/`.
27
27
 
28
28
  ## Install & build
29
29
 
30
+ ```bash
31
+ npm install weml-monaco
32
+ ```
33
+
34
+ The package has no runtime dependencies (`node-html-parser` and
35
+ `vscode-html-languageservice` are bundled in) and `monaco-editor` is a peer
36
+ dependency you already have.
37
+
38
+ | entry point | file | for |
39
+ | ---------------------- | ----------------------- | -------------------------------------- |
40
+ | `weml-monaco` | `dist/index.mjs` | ESM — bundlers, `import` |
41
+ | `weml-monaco` | `dist/index.cjs` | CJS — `require` |
42
+ | `weml-monaco/global` | `dist/index.global.js` | `<script>` / CDN → `window.WemlMonaco` |
43
+
44
+ Working on the package itself:
45
+
30
46
  ```bash
31
47
  cd monaco-editor
32
48
  npm install
33
- npm run build # → dist/weml-monaco.js (IIFE global), .esm.js (ESM), *.d.ts
34
- npm run typecheck # tsc --noEmit
35
- npm test # build the ESM bundle + run the Node smoke test
49
+ npm run build # tsup → dist/ (ESM + CJS + IIFE + declarations)
50
+ npm run typecheck # tsc --noEmit
51
+ npm test # build + Node smoke test
52
+ npm run check:package # publint + arethetypeswrong on the packed tarball
36
53
  ```
37
54
 
38
55
  ## Usage
@@ -42,7 +59,7 @@ Monaco itself is loaded (AMD/CDN, ESM bundle, or a global):
42
59
 
43
60
  ```ts
44
61
  import * as monaco from 'monaco-editor';
45
- import { registerWeml } from 'weml-monaco'; // or the bundled dist/weml-monaco.esm.js
62
+ import { registerWeml } from 'weml-monaco';
46
63
 
47
64
  const disposable = registerWeml(monaco);
48
65
 
@@ -113,7 +130,7 @@ behave like `editor.insertSnippet` in VS Code.
113
130
  ## Demo
114
131
 
115
132
  ```bash
116
- npm run demo # bundles src/index.ts → demo/weml-monaco.js
133
+ npm run demo # builds dist/ and copies the IIFE bundle → demo/weml-monaco.js
117
134
  # then open demo/index.html in a browser
118
135
  ```
119
136