Skip to content

Commit 7c898a9

Browse files
committed
feat: update configuration files and scripts
1 parent f4e6a9c commit 7c898a9

File tree

14 files changed

+141
-102
lines changed

14 files changed

+141
-102
lines changed

.gitattributes

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# Auto detect text files and perform LF normalization
2-
* text=auto eol=lf
1+
* -text
32

43
justfile -linguist-detectable
54
extra/** -linguist-detectable

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
/target
2+
3+
deno.lock

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ const formatted = format(input, "query.sql");
2727
console.log(formatted);
2828
```
2929

30-
## Node.js < 22.19
31-
32-
```JavaScript
33-
import { format } from "@wasm-fmt/sql_fmt/node";
34-
```
35-
3630
## Web
3731

3832
For web environments, you need to initialize WASM module manually:

dprint.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"indentWidth": 4,
44
"lineWidth": 120,
55
"newLineKind": "lf",
6-
"json": {},
6+
"json": {
7+
"trailingCommas": "never"
8+
},
79
"markdown": {},
810
"oxc": {},
911
"yaml": {},

extra/jsr.jsonc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../jsr.jsonc

extra/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../package.json

jsr.jsonc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "https://jsr.io/schema/config-file.v1.json",
3+
"name": "@fmt/sql-fmt",
4+
"version": "0.2.0",
5+
"exports": {
6+
".": "./sql_fmt.js",
7+
"./esm": "./sql_fmt_esm.js",
8+
"./node": "./sql_fmt_node.js",
9+
"./bundler": "./sql_fmt.js",
10+
"./web": "./sql_fmt_web.js"
11+
},
12+
"publish": {
13+
"include": [
14+
"sql_fmt_*",
15+
"sql_fmt.*",
16+
"README.md"
17+
],
18+
"exclude": [
19+
"!*"
20+
]
21+
}
22+
}

justfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ test-all: test-rust test-wasm
3232
build:
3333
wasm-pack build --scope=wasm-fmt .
3434
cp -R ./extra/. ./pkg/
35-
node ./scripts/package.mjs ./pkg/package.json
35+
node ./scripts/patch.mjs
3636

3737
[windows]
3838
build:
3939
wasm-pack build --scope=wasm-fmt .
4040
Copy-Item -Recurse -Force ./extra/* ./pkg/
41-
node ./scripts/package.mjs ./pkg/package.json
41+
node ./scripts/patch.mjs
4242

4343
fmt:
4444
cargo fmt --all
@@ -71,7 +71,8 @@ version bump_or_version:
7171
fi
7272

7373
VERSION=$(cargo pkgid | sed 's/.*[#@]//')
74-
74+
node ./scripts/sync_version.mjs "${VERSION}"
75+
7576
git add -A
7677
git commit -m "${VERSION}"
7778
git tag -a "v${VERSION}" -m "${VERSION}"

package.json

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"name": "@wasm-fmt/sql_fmt",
3+
"type": "module",
4+
"collaborators": [
5+
"magic-akari <[email protected]>"
6+
],
7+
"description": "A WASM Based SQL Formatter",
8+
"version": "0.2.0",
9+
"license": "MIT",
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/wasm-fmt/sql_fmt.git"
13+
},
14+
"homepage": "https://github.com/wasm-fmt/sql_fmt",
15+
"types": "sql_fmt.d.ts",
16+
"sideEffects": [
17+
"./sql_fmt.js",
18+
"./sql_fmt_node.js",
19+
"./sql_fmt_esm.js"
20+
],
21+
"keywords": [
22+
"wasm",
23+
"sql",
24+
"formatter"
25+
],
26+
"publishConfig": {
27+
"access": "public"
28+
},
29+
"exports": {
30+
".": {
31+
"types": "./sql_fmt.d.ts",
32+
"webpack": "./sql_fmt.js",
33+
"deno": "./sql_fmt.js",
34+
"bun": "./sql_fmt_node.js",
35+
"module-sync": "./sql_fmt_node.js",
36+
"node": "./sql_fmt_node.js",
37+
"default": "./sql_fmt_esm.js"
38+
},
39+
"./esm": {
40+
"types": "./sql_fmt.d.ts",
41+
"default": "./sql_fmt_esm.js"
42+
},
43+
"./node": {
44+
"types": "./sql_fmt.d.ts",
45+
"default": "./sql_fmt_node.js"
46+
},
47+
"./bundler": {
48+
"types": "./sql_fmt.d.ts",
49+
"default": "./sql_fmt.js"
50+
},
51+
"./web": {
52+
"types": "./sql_fmt_web.d.ts",
53+
"default": "./sql_fmt_web.js"
54+
},
55+
"./vite": {
56+
"types": "./sql_fmt_web.d.ts",
57+
"default": "./sql_fmt_vite.js"
58+
},
59+
"./wasm": "./sql_fmt_bg.wasm",
60+
"./package.json": "./package.json",
61+
"./*": "./*"
62+
}
63+
}

rust-toolchain.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[toolchain]
2-
channel = "1.91.1"
2+
channel = "1.93.0"
33
profile = "default"
4+
targets = ["wasm32-unknown-unknown"]

0 commit comments

Comments
 (0)