Skip to content

Commit 9baaeba

Browse files
committed
Many updates, preparation v0.1.1
1 parent 81adbd2 commit 9baaeba

File tree

12 files changed

+52
-18
lines changed

12 files changed

+52
-18
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,7 @@ crates/polyglot-sql-wasm/pkg-node/
6767
# Node.js
6868
node_modules/
6969
dist/
70+
.vite/
71+
.wrangler/
7072
packages/sdk/coverage/
7173

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Polyglot
22

3-
Rust/WASM-powered SQL transpiler for 32 dialects, inspired by Python's [sqlglot](https://github.com/tobymao/sqlglot).
3+
Rust/Wasm-powered SQL transpiler for 32 dialects, inspired by [sqlglot](https://github.com/tobymao/sqlglot).
44

55
Polyglot parses, generates, transpiles, and formats SQL across 32 database dialects. It ships as a Rust crate ([`polyglot-sql`](https://crates.io/crates/polyglot-sql/)) and a TypeScript/WASM SDK ([`@polyglot-sql/sdk`](https://www.npmjs.com/package/@polyglot-sql/sdk) on npm).
66

7-
There's also a [playground](https://polyglot-playground.gh.tobilg.com/) where you can try it out in the browser, and the [TypeScript API Docs](https://polyglot.gh.tobilg.com/).
7+
There's also a [playground](https://polyglot-playground.gh.tobilg.com/) where you can try it out in the browser, as well as the [Rust API Docs](https://docs.rs/polyglot-sql/latest/polyglot_sql/) and [TypeScript API Docs](https://polyglot.gh.tobilg.com/).
88

99
## Features
1010

packages/documentation/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Polyglot SQL
22

3-
Rust/WASM-powered SQL transpiler for TypeScript. Parse, generate, transpile, format, and build SQL across 32 database dialects.
3+
Rust/Wasm-powered SQL transpiler for TypeScript. Parse, generate, transpile, format, and build SQL across 32 database dialects.
44

55
## Packages
66

77
| Package | Description |
88
|---------|-------------|
9-
| [@polyglot-sql/sdk](https://www.npmjs.com/package/@polyglot-sql/sdk) | TypeScript SDK with WASM-powered SQL transpilation |
9+
| [@polyglot-sql/sdk](https://www.npmjs.com/package/@polyglot-sql/sdk) | TypeScript SDK with Wasm-powered SQL transpilation |
1010

1111
## Quick Start
1212

packages/documentation/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"build": "typedoc",
7+
"build": "typedoc && node postbuild.mjs",
88
"preview": "npx serve dist",
99
"deploy": "pnpm run build && wrangler pages deploy"
1010
},
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { readdir, readFile, writeFile, cp } from "node:fs/promises";
2+
import { join } from "node:path";
3+
4+
const DIST = "dist";
5+
const OG_TAGS = `<meta property="og:type" content="website" />
6+
<meta property="og:title" content="Polyglot SQL API Documentation" />
7+
<meta property="og:description" content="Transpile SQL between 30+ database dialects in the browser" />
8+
<meta property="og:image" content="https://polyglot.gh.tobilg.com/polyglot-opengraph.png" />
9+
<meta name="twitter:card" content="summary_large_image" />
10+
<meta name="twitter:title" content="Polyglot SQL API Documentation" />
11+
<meta name="twitter:description" content="Transpile SQL between 30+ database dialects in the browser" />
12+
<meta name="twitter:image" content="https://polyglot.gh.tobilg.com/polyglot-opengraph.png" />`;
13+
14+
async function findHtmlFiles(dir) {
15+
const files = [];
16+
for (const entry of await readdir(dir, { withFileTypes: true })) {
17+
const path = join(dir, entry.name);
18+
if (entry.isDirectory()) files.push(...(await findHtmlFiles(path)));
19+
else if (entry.name.endsWith(".html")) files.push(path);
20+
}
21+
return files;
22+
}
23+
24+
const htmlFiles = await findHtmlFiles(DIST);
25+
for (const file of htmlFiles) {
26+
const content = await readFile(file, "utf8");
27+
if (!content.includes("og:title")) {
28+
await writeFile(file, content.replace("</head>", `${OG_TAGS}\n</head>`));
29+
}
30+
}
31+
32+
await cp("public", DIST, { recursive: true });
33+
34+
console.log(`Injected OG tags into ${htmlFiles.length} HTML files and copied public assets.`);
246 KB
Loading

packages/example/.vite/deps/_metadata.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

packages/example/.vite/deps/package.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/playground/index.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<meta name="description" content="Transpile SQL between 30+ database dialects in the browser" />
8+
<meta property="og:type" content="website" />
9+
<meta property="og:title" content="Polyglot SQL Playground" />
10+
<meta property="og:description" content="Transpile SQL between 30+ database dialects in the browser" />
11+
<meta property="og:image" content="https://polyglot-playground.gh.tobilg.com/polyglot-opengraph.png" />
12+
<meta name="twitter:card" content="summary_large_image" />
13+
<meta name="twitter:title" content="Polyglot SQL Playground" />
14+
<meta name="twitter:description" content="Transpile SQL between 30+ database dialects in the browser" />
15+
<meta name="twitter:image" content="https://polyglot-playground.gh.tobilg.com/polyglot-opengraph.png" />
716
<title>Polyglot SQL Playground</title>
817
<style>
918
.init-spinner {

packages/playground/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"dev": "vite",
88
"build": "tsc -b && vite build",
99
"preview": "vite preview",
10-
"deploy": "wrangler pages deploy dist"
10+
"deploy": "pnpm run build && wrangler pages deploy dist"
1111
},
1212
"dependencies": {
1313
"@polyglot-sql/sdk": "workspace:*",

0 commit comments

Comments
 (0)