Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@neo4j-cypher/react-codemirror

Package Overview
Dependencies
Maintainers
2
Versions
138
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neo4j-cypher/react-codemirror - npm Package Compare versions

Comparing version 2.0.0-alpha.0 to 2.0.0-canary-7700c71

CHANGELOG.md

62

package.json

@@ -6,18 +6,40 @@ {

"dist",
"esm",
"src",
"package.json",
"README.md"
"README.md",
"LICENSE.md",
"CHANGELOG.md"
],
"version": "2.0.0-alpha.0",
"main": "dist/index.cjs",
"module": "esm/index.mjs",
"keywords": [
"neo4j",
"cypher",
"react",
"editor",
"codemirror",
"codemirror 6"
],
"version": "2.0.0-canary-7700c71",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"type": "module",
"sideEffects": false,
"scripts": {
"build": "concurrently \"npm:build-esm\" \"npm:build-commonjs\"",
"build-esm": "esbuild --bundle --format=esm --outfile=esm/index.mjs --packages=external src/index.ts",
"build-commonjs": "esbuild --bundle --format=cjs --outfile=dist/index.cjs --packages=external src/index.ts",
"build": "tsc --declaration --outDir dist/",
"clean": "rm -rf dist",
"test": "jest",
"test:e2e": "playwright test",
"e2e-http-server": "vite dev"
"test:e2e": "playwright test -c playwright-ct.config.ts",
"test:e2e-ui": "playwright test -c playwright-ct.config.ts --ui",
"benchmark": "BENCHMARKING=true npx playwright test -c playwright-ct.config.ts -g \"benchmarking & performance test session\""
},
"repository": {
"type": "git",
"url": "git://github.com/neo4j/cypher-language-support.git"
},
"bugs": {
"url": "https://github.com/neo4j/cypher-language-support/issues"
},
"engineStrict": true,
"engines": {
"node": ">=18.18.2"
},
"dependencies": {

@@ -33,11 +55,17 @@ "@codemirror/autocomplete": "^6.5.1",

"@lezer/highlight": "^1.1.3",
"@uiw/react-codemirror": "^4.19.9",
"@neo4j-cypher/language-support": "2.0.0-canary-7700c71",
"@types/prismjs": "^1.26.3",
"@types/workerpool": "^6.4.7",
"ayu": "^8.0.1",
"fastest-levenshtein": "^1.0.16",
"react": "^18.2.0",
"vscode-languageserver-types": "^3.17.3"
"lodash.debounce": "^4.0.8",
"prismjs": "^1.29.0",
"vscode-languageserver-types": "^3.17.3",
"workerpool": "^9.0.4"
},
"devDependencies": {
"@neo4j-ndl/base": "^1.10.1",
"@playwright/experimental-ct-react": "^1.39.0",
"@playwright/test": "^1.36.2",
"@types/lodash.debounce": "^4.0.9",
"@types/react": "^18.0.28",

@@ -49,6 +77,8 @@ "@vitejs/plugin-react": "^3.1.0",

"playwright": "^1.36.2",
"typescript": "^4.9.3",
"vite": "^4.4.8",
"vite-plugin-node-stdlib-browser": "^0.2.1"
"react": "^18.2.0",
"typescript": "^4.9.5"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
}
}

@@ -5,8 +5,31 @@ # React Codemirror

## Usage
`npm install @neo4j-cypher/react-codemirror@next`
```tsx
import { useState } from 'react';
import { CypherEditor } from '@neo4j-cypher/react-codemirror@next';
export function CodeEditor() {
const [value, setValue] = useState('');
// can be used to access underlying codemirror state or call for example `focus`
const editorRef = useRef<CypherEditor>(null);
return <CypherEditor value={value} onChange={setValue} ref={editorRef} />;
}
```
For a full example, see the [react-codemirror-playground](https://github.com/neo4j/cypher-language-support/tree/main/packages/react-codemirror-playground).
## Usage without react
Currently we only support using the codemirror editor via the react wrapper, but we plan to release the codemirror extensions separately as well.
## Learning codemirror
It can take a little time to get into the CodeMirror6 ways of thinking, Trevor Harmon has a [great blog post](https://thetrevorharmon.com/blog/learning-codemirror/) explaining the cm6 "primitives". He also has a demo on how to integrate ANTLR4 with codemirror over [here](https://github.com/thetrevorharmon/zephyr-demo).
### Completion Icons
We use unmodified copies of Visual Studio Code Icons from microsofts repository [here](https://github.com/microsoft/vscode-icons) licensed under creative commons.
### Build notes
We need to bundle the other project dependencies into the build until we've published those packages. When we do publish them, we can just do the same "tsc" build step as for example `language-support`.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc