@actualwave/codemirror-lang-embed-sql 0.1.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.
Files changed (2) hide show
  1. package/index.js +17 -0
  2. package/package.json +22 -0
package/index.js ADDED
@@ -0,0 +1,17 @@
1
+ const { sql } = require('@codemirror/lang-sql');
2
+ const { matchTagName } = require('@actualwave/codemirror-lang-embed-core');
3
+
4
+ // config is passed through to @codemirror/lang-sql's sql() (dialect, schema,
5
+ // etc.) — see that package's SQLConfig type. sql()'s `.support` always
6
+ // includes keyword completion (schema completion is additive on top, only if
7
+ // config.schema is given) — see SQLConfig in @codemirror/lang-sql source.
8
+ function createEmbedding(config) {
9
+ const support = sql(config);
10
+ return {
11
+ matcher: matchTagName('sql'),
12
+ language: support.language,
13
+ extension: support.support,
14
+ };
15
+ }
16
+
17
+ module.exports = { createEmbedding };
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@actualwave/codemirror-lang-embed-sql",
3
+ "version": "0.1.0",
4
+ "description": "Registers the `sql` tagged-template tag for embedded SQL highlighting inside JS/TSX",
5
+ "main": "index.js",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/burdiuz/codemorror-lang-modules.git",
10
+ "directory": "packages/embed-sql"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/burdiuz/codemorror-lang-modules/issues"
14
+ },
15
+ "homepage": "https://github.com/burdiuz/codemorror-lang-modules/tree/main/packages/embed-sql",
16
+ "dependencies": {
17
+ "@actualwave/codemirror-lang-embed-core": "*"
18
+ },
19
+ "peerDependencies": {
20
+ "@codemirror/lang-sql": "^6.0.0"
21
+ }
22
+ }