Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
monaco-dolphindb
Advanced tools
Readme
# peerDependencies
pnpm add dolphindb monaco-editor vscode-oniguruma vscode-textmate
pnpm add monaco-dolphindb
# optionalDependencies if you want to use 'monaco-dolphindb/react'
pnpm add @monaco-editor/react
monaco-dolphindb need some external resources to work properly, you should copy them from node_modules to your project:
onig.wasm
from vscode-oniguruma/release/onig.wasm
docs.en.json
and docs.zh.json
from dolphindb
Then write some code to load them.
import { registerDolphinDBLanguage } from 'monaco-dolphindb';
import { loadWASM } from 'vscode-oniguruma';
// load wasm
await loadWASM(await fetch('/onig.wasm'));
await registerDolphinDBLanguage(Monaco, {
docs: '/docs.zh.json',
});
const editor = Monaco.editor.create(document.getElementById('root')!, {
value: '1 + 2',
language: 'dolphindb',
...settings,
});
PS: monaco-dolphindb/react
include some special logic to make it easy to use for our internal project, so it may not fit your project, you can copy the source code and modify it to fit your project.
MonacoDolphinDBEditor
import { loadWASM } from 'vscode-oniguruma';
import { MonacoDolphinDBEditor } from 'monaco-dolphindb/react';
import * as monaco from 'monaco-editor';
import { loader } from '@monaco-editor/react';
import * as ReactDOM from 'react-dom/client';
loader.config({
monaco,
});
async function beforeMonacoEditorInit() {
return loadWASM(await fetch('/onig.wasm'));
}
function App() {
const [value, setValue] = React.useState('1 + 2');
const onChange = React.useCallback((value?: string) => {
setValue(value ?? '');
}, []);
return (
<MonacoDolphinDBEditor
dolphinDBLanguageOptions={{
docs: '/docs.zh.json',
language: 'zh',
}}
beforeInit={beforeMonacoEditorInit}
options={{
acceptSuggestionOnEnter: 'on',
}}
value={value}
onChange={onChange}
/>
);
}
ReactDOM.createRoot(document.getElementById('root')!).render(<App />);
MonacoDolphinDBDiffEditor
import { loadWASM } from 'vscode-oniguruma';
import { MonacoDolphinDBDiffEditor } from 'monaco-dolphindb/react';
import * as monaco from 'monaco-editor';
import { loader } from '@monaco-editor/react';
import * as ReactDOM from 'react-dom/client';
loader.config({
monaco,
});
async function beforeMonacoEditorInit() {
return loadWASM(await fetch('/onig.wasm'));
}
function App() {
return (
<MonacoDolphinDBDiffEditor
dolphinDBLanguageOptions={{
docs: '/docs.zh.json',
language: 'zh',
}}
beforeInit={beforeMonacoEditorInit}
original="1 + 2"
modified="1 + 3"
/>
);
}
ReactDOM.createRoot(document.getElementById('root')!).render(<App />);
FAQs
Support DolphinDB language in Monaco Editor (syntax highlight, completions, docs)
The npm package monaco-dolphindb receives a total of 3 weekly downloads. As such, monaco-dolphindb popularity was classified as not popular.
We found that monaco-dolphindb demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.