Modified sql prettier plugin

This commit is contained in:
2025-09-20 19:18:33 +08:00
parent c3670bb8cd
commit 9222a52d91
44 changed files with 1099 additions and 2211 deletions

View File

@@ -1,2 +0,0 @@
*.tgz
jsr.jsonc

View File

@@ -1,10 +0,0 @@
import fs from "node:fs/promises";
import initAsync from "./json_fmt.js";
const wasm = new URL("./json_fmt_bg.wasm", import.meta.url);
export default function __wbg_init(init = { module_or_path: fs.readFile(wasm) }) {
return initAsync(init);
}
export * from "./json_fmt.js";

View File

@@ -1,8 +0,0 @@
import initAsync from "./json_fmt.js";
import wasm from "./json_fmt_bg.wasm?url";
export default function __wbg_init(input = { module_or_path: wasm }) {
return initAsync(input);
}
export * from "./json_fmt.js";

View File

@@ -1,39 +0,0 @@
#!/usr/bin/env node
import process from "node:process";
import path from "node:path";
import fs from "node:fs";
const pkg_path = path.resolve(process.cwd(), process.argv[2]);
const pkg_text = fs.readFileSync(pkg_path, { encoding: "utf-8" });
const pkg_json = JSON.parse(pkg_text);
delete pkg_json.files;
pkg_json.main = pkg_json.module;
pkg_json.type = "module";
pkg_json.publishConfig = {
access: "public",
};
pkg_json.exports = {
".": {
types: "./json_fmt.d.ts",
node: "./json_fmt_node.js",
default: "./json_fmt.js",
},
"./vite": {
types: "./json_fmt.d.ts",
default: "./json_fmt_vite.js",
},
"./package.json": "./package.json",
"./*": "./*",
};
fs.writeFileSync(pkg_path, JSON.stringify(pkg_json, null, 4));
// JSR
const jsr_path = path.resolve(pkg_path, "..", "jsr.jsonc");
pkg_json.name = "@fmt/json-fmt";
pkg_json.exports = "./json_fmt.js";
pkg_json.exclude = ["!**", "*.tgz"];
fs.writeFileSync(jsr_path, JSON.stringify(pkg_json, null, 4));

View File

@@ -4,8 +4,3 @@ crates_dir=$(pwd)
cd ../..
wasm-pack build --target=web --scope=wasm-fmt crates/json_fmt
cd $crates_dir
cp -R ./extra/. ./pkg/
./scripts/package.mjs ./pkg/package.json

View File

@@ -1,2 +0,0 @@
*.tgz
jsr.jsonc

View File

@@ -1,10 +0,0 @@
import fs from "node:fs/promises";
import initAsync from "./web_fmt.js";
const wasm = new URL("./web_fmt_bg.wasm", import.meta.url);
export default function __wbg_init(init = { module_or_path: fs.readFile(wasm) }) {
return initAsync(init);
}
export * from "./web_fmt.js";

View File

@@ -1,8 +0,0 @@
import initAsync from "./web_fmt.js";
import wasm from "./web_fmt_bg.wasm?url";
export default function __wbg_init(input = { module_or_path: wasm }) {
return initAsync(input);
}
export * from "./web_fmt.js";

View File

@@ -1,39 +0,0 @@
#!/usr/bin/env node
import process from "node:process";
import path from "node:path";
import fs from "node:fs";
const pkg_path = path.resolve(process.cwd(), process.argv[2]);
const pkg_text = fs.readFileSync(pkg_path, { encoding: "utf-8" });
const pkg_json = JSON.parse(pkg_text);
delete pkg_json.files;
pkg_json.main = pkg_json.module;
pkg_json.type = "module";
pkg_json.publishConfig = {
access: "public",
};
pkg_json.exports = {
".": {
types: "./web_fmt.d.ts",
node: "./web_fmt_node.js",
default: "./web_fmt.js",
},
"./vite": {
types: "./web_fmt.d.ts",
default: "./web_fmt_vite.js",
},
"./package.json": "./package.json",
"./*": "./*",
};
fs.writeFileSync(pkg_path, JSON.stringify(pkg_json, null, 4));
// JSR
const jsr_path = path.resolve(pkg_path, "..", "jsr.jsonc");
pkg_json.name = "@fmt/web-fmt";
pkg_json.exports = "./web_fmt.js";
pkg_json.exclude = ["!**", "*.tgz"];
fs.writeFileSync(jsr_path, JSON.stringify(pkg_json, null, 4));

View File

@@ -4,8 +4,3 @@ crates_dir=$(pwd)
cd ../..
wasm-pack build --target=web --scope=wasm-fmt crates/web_fmt
cd $crates_dir
cp -R ./extra/. ./pkg/
./scripts/package.mjs ./pkg/package.json