@neo4j-cypher/react-codemirror
Advanced tools
Comparing version 2.0.0-alpha.0 to 2.0.0-canary-7700c71
@@ -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`. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
581523
121
7466
1
35
Yes
19
12
3
2
+ Added@types/prismjs@^1.26.3
+ Added@types/workerpool@^6.4.7
+ Addedlodash.debounce@^4.0.8
+ Addedprismjs@^1.29.0
+ Addedworkerpool@^9.0.4
+ Added@neo4j-cypher/language-support@2.0.0-canary-7700c71(transitive)
+ Added@types/node@22.10.5(transitive)
+ Added@types/prismjs@1.26.5(transitive)
+ Added@types/workerpool@6.4.7(transitive)
+ Addedantlr4@4.13.2(transitive)
+ Addedantlr4-c3@3.4.1(transitive)
+ Addedantlr4ng@3.0.14(transitive)
+ Addedantlr4ng-cli@2.0.0(transitive)
+ Addedlodash.debounce@4.0.8(transitive)
+ Addedprismjs@1.29.0(transitive)
+ Addedundici-types@6.20.0(transitive)
+ Addedworkerpool@9.2.0(transitive)
- Removed@uiw/react-codemirror@^4.19.9
- Removedreact@^18.2.0
- Removed@babel/runtime@7.26.0(transitive)
- Removed@codemirror/theme-one-dark@6.1.2(transitive)
- Removed@uiw/codemirror-extensions-basic-setup@4.23.7(transitive)
- Removed@uiw/react-codemirror@4.23.7(transitive)
- Removedcodemirror@6.65.7(transitive)
- Removedreact@19.0.0(transitive)
- Removedreact-dom@19.0.0(transitive)
- Removedregenerator-runtime@0.14.1(transitive)
- Removedscheduler@0.25.0(transitive)