@matdata/sparql-formatter 1.0.0 → 1.2.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.
- package/README.md +5 -0
- package/dist/cli.js +1 -1
- package/dist/spfmt.min.js +1 -1
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -141,6 +141,11 @@ npx @matdata/sparql-formatter --check *.rq # exit code 1 if a file isn't fo
|
|
|
141
141
|
Run `sparql-formatter --help` for all options (`--indent`, `--keyword-case`, `--function-case`, `--no-align`,
|
|
142
142
|
`--no-blank-lines`, `--compact`, `--line-width`).
|
|
143
143
|
|
|
144
|
+
### VS Code
|
|
145
|
+
|
|
146
|
+
The [`vscode`](vscode) folder contains a VS Code extension (published on Marketplace and Open VSX registry) that formats `.rq`, `.ru` and `.sparql` files with
|
|
147
|
+
**Format Document** and shows syntax errors in the Problems panel. See its [README](vscode/README.md).
|
|
148
|
+
|
|
144
149
|
## Options
|
|
145
150
|
|
|
146
151
|
| Option | Default | Description |
|
package/dist/cli.js
CHANGED
package/dist/spfmt.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @matdata/sparql-formatter v1.
|
|
1
|
+
/*! @matdata/sparql-formatter v1.2.0 | MIT | https://github.com/Matdata-eu/sparql-formatter#readme */
|
|
2
2
|
"use strict";(()=>{var V=Object.defineProperty;var W=(o,t)=>{for(var e in t)V(o,e,{get:t[e],enumerable:!0})};var D={};W(D,{SparqlSyntaxError:()=>k,default:()=>ft,format:()=>L,formatAst:()=>K,isValid:()=>ut,parse:()=>v,spfmt:()=>O,tokenize:()=>T});var k=class extends Error{constructor(t,e,s,i,r=[]){super(`${t} (line ${s}, column ${i})`),this.name="SparqlSyntaxError",this.offset=e,this.line=s,this.column=i,this.expected=r}};var B="A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u{10000}-\\u{EFFFF}",x=B+"_",E=x+"\\-0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",S="%[0-9A-Fa-f]{2}|\\\\[_~.\\-!$&'()*+,;=/?#@%]",$=`[${B}](?:[${E}.]*[${E}])?`,j=`(?:[${x}:0-9]|${S})(?:(?:[${E}.:]|${S})*(?:[${E}:]|${S}))?`,H=new RegExp(`(?:${$})?:(?:${j})?`,"uy"),Q=new RegExp(`[?$][${x}0-9][${x}0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*`,"uy"),q=new RegExp(`_:[${x}0-9](?:[${E}.]*[${E}])?`,"uy"),Y=/<(?:[^<>"{}|^`\\\u0000- ]|\\u[0-9A-Fa-f]{4}|\\U[0-9A-Fa-f]{8})*>/y,z=/@[a-zA-Z]+(?:-[a-zA-Z0-9]+)*(?:--[a-zA-Z]+)?/y,X=/(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)[eE][+-]?[0-9]+/y,Z=/[0-9]*\.[0-9]+/y,J=/[0-9]+/y,tt=/[A-Za-z_][A-Za-z0-9_]*/y,R=String.raw`\\[tbnrf\\"']|\\u[0-9A-Fa-f]{4}|\\U[0-9A-Fa-f]{8}`,et=new RegExp(String.raw`'''(?:(?:'|'')?(?:[^'\\]|${R}))*'''`,"y"),st=new RegExp(String.raw`"""(?:(?:"|"")?(?:[^"\\]|${R}))*"""`,"y"),it=new RegExp(String.raw`'(?:[^'\\\n\r]|${R})*'`,"y"),rt=new RegExp(String.raw`"(?:[^"\\\n\r]|${R})*"`,"y"),nt=/\\(?:u|U0000)[dD][89a-fA-F][0-9a-fA-F]{2}/,ot=["<<(",")>>","<<",">>","{|","|}","^^","&&","||","!=","<=",">=","{","}","(",")","[","]",".",",",";","*","/","|","^","?","+","-","!","=","<",">","~"];function m(o,t,e){o.lastIndex=e;let s=o.exec(t);return s?s[0]:null}function T(o){let t=[],e=0,s=1,i=0,r=[],n=0,a=!1,h=null,p=-1,l=(c,w)=>{for(let A=c;A<w;A++){let f=o.charCodeAt(A);(f===10||f===13&&o.charCodeAt(A+1)!==10)&&(s++,i=A+1)}},d=c=>{throw new k(c,e,s,e-i+1)};for(;e<o.length;){let c=o[e];if(c===" "||c===" "||c==="\r"||c===`
|
|
3
3
|
`){(c===`
|
|
4
4
|
`||c==="\r"&&o[e+1]!==`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matdata/sparql-formatter",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "SPARQL 1.2 query and update formatter that keeps your comments where you put them",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sparql",
|
|
@@ -59,12 +59,14 @@
|
|
|
59
59
|
"test:dist": "node scripts/smoke-test.mjs",
|
|
60
60
|
"lint": "prettier --check .",
|
|
61
61
|
"format": "prettier --write .",
|
|
62
|
-
"prepublishOnly": "npm run build && npm test && npm run test:dist"
|
|
62
|
+
"prepublishOnly": "npm run build && npm test && npm run test:dist",
|
|
63
|
+
"vscode:package": "npm --prefix vscode run package",
|
|
64
|
+
"vscode:publish": "npm --prefix vscode run publish"
|
|
63
65
|
},
|
|
64
66
|
"devDependencies": {
|
|
65
|
-
"@types/node": "^
|
|
66
|
-
"esbuild": "^0.
|
|
67
|
+
"@types/node": "^26.6.3",
|
|
68
|
+
"esbuild": "^0.28.2",
|
|
67
69
|
"prettier": "^3.8.1",
|
|
68
|
-
"typescript": "^
|
|
70
|
+
"typescript": "^7.0.2"
|
|
69
71
|
}
|
|
70
72
|
}
|