- Both `js-yaml` and `yaml-languageserver-parser` have been replaced with
`yaml`.
- `jsonc-parser` has been externalized.
- All defaults are now specified explicitly.
- The new property `yamlVersion` has been added to match
`yaml-language-server`. The default is `1.2`.
- `DiagnosticsOptions` properties are now sorted alphabetically and
documentation has been enhanced.
Closes#117
This is much more flexible than `monaco-plugin-helpers`. Because of
this, it’s possible to use Prettier as an external dependency, so users
can ignore it in their own build process of they choose not to support
formatting.
Instead of rewriting YAML language service imports in the build tool, I
decided to just import them from where they need to be imported in the
source code.
Closes#63
Most notably update to Webpack 5. Webpack 5 supports web workers without
the need of a loader, so the `webpack-worker-loader` example has been
removed.
This removes the need to explain certain statements and imports need to
happen in a specific order. Users can now just use:
```ts
import { setDiagnosticsOptions } from 'monaco-yaml';
setDiagnosticsOptions({});
```
Npm 7 also supports workspaces, but doesn’t require the workspace root to be
private. This means the examples can be workspaces within the project, so the
entire project can be handled as one mono repository with a single lock file and
`node_modules` directory.
Also the readme has been updated with usage instructions.
This is a preparation for `monaco-editor@^0.22.0`. In this version the global
`monaco` object was removed for ESM users.
A choice was made to use `monaco-editor` imports, because this probably has
best compatibility for most users. If users want to use `monaco-editor-core`,
they will have to create an alias in their own build process.
Since both yaml-language-server and prettier are included in the bundle, their
versions should match for best compatibility. Also code has been formatted using
the updated prettier.
This package includes `yaml-language-server` in its build. This means it’s not a
runtime dependency, but it belongs in `devDependencies`.
The runtime bundle does depend on the dependencies specified in `resolveSkip` in
`scripts/bundle-esm.js`. These packages have been added as direct dependencies
instead.
Jest, eslint, and typescript-tslint-plugin were installed, but never used. Node
types were used for timers, but this is incorrect, as this code is supposed to
run in the browser.