Skip to content

clay/geoviz updates #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"plugin:node/recommended",
"plugin:security/recommended-legacy"
],
"ignorePatterns": ["browser-test/**/*"],
"rules": {
"node/no-unsupported-features/es-syntax": "off",
// no-missing-import gets confused by typescript `paths`
Expand All @@ -20,6 +21,7 @@
{
"allowModules": ["vitest", "vitest-fetch-mock"]
}
]
],
"@typescript-eslint/no-explicit-any": "warn"
}
}
24 changes: 24 additions & 0 deletions browser-test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
14 changes: 14 additions & 0 deletions browser-test/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Wherobots SDK Browser Demo</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
29 changes: 29 additions & 0 deletions browser-test/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "browser-test",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@eslint/js": "^9.21.0",
"@types/react": "^19.0.10",
"@types/react-dom": "^19.0.4",
"@vitejs/plugin-react": "^4.3.4",
"eslint": "^9.21.0",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.19",
"globals": "^15.15.0",
"typescript": "~5.7.2",
"typescript-eslint": "^8.24.1",
"vite": "^6.2.0"
}
}
33 changes: 33 additions & 0 deletions browser-test/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { useEffect, useState } from "react";
import { Connection, Runtime } from "../../dist/src/index";

function App() {
const [result, setResult] = useState<any>(null);
useEffect(() => {
const fetchResult = async () => {
const connection = await Connection.connect({
runtime: Runtime.TINY,
// bearerToken: 'changeme',
// apiKey: 'changeme',
});
const result = await connection.execute(
"SHOW SCHEMAS IN wherobots_open_data",
);
console.log(result);
setResult(result);
};
fetchResult();
}, []);

return (
<>
{result && (
<div>
<pre>{JSON.stringify(result, null, 2)}</pre>
</div>
)}
</>
);
}

export default App;
Empty file added browser-test/src/index.css
Empty file.
5 changes: 5 additions & 0 deletions browser-test/src/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createRoot } from "react-dom/client";
import "./index.css";
import App from "./App.tsx";

createRoot(document.getElementById("root")!).render(<App />);
1 change: 1 addition & 0 deletions browser-test/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
26 changes: 26 additions & 0 deletions browser-test/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "react-jsx",

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["src"]
}
7 changes: 7 additions & 0 deletions browser-test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
}
24 changes: 24 additions & 0 deletions browser-test/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"target": "ES2022",
"lib": ["ES2023"],
"module": "ESNext",
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["vite.config.ts"]
}
7 changes: 7 additions & 0 deletions browser-test/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
});
4 changes: 2 additions & 2 deletions examples/connectionWithCancellation.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* run with:

* `WHEROBOTS_API_KEY=<api key> node -r @swc-node/register examples/connectionWithCancellation.ts`
* `WHEROBOTS_API_KEY=<api key> npx tsx examples/connectionWithCancellation.ts`
*
* or for verbose logging:
*
* `NODE_DEBUG="wherobots-sql-driver" WHEROBOTS_API_KEY=<api key> node -r @swc-node/register examples/connectionWithCancellation.ts`
* `NODE_DEBUG="wherobots-sql-driver" WHEROBOTS_API_KEY=<api key> npx tsx examples/connectionWithCancellation.ts`
*/

import { Connection, Runtime } from "@/index";
Expand Down
4 changes: 2 additions & 2 deletions examples/connectionWithDefaults.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* run with:

* `WHEROBOTS_API_KEY=<api key> node -r @swc-node/register examples/connectionWithDefaults.ts`
* `WHEROBOTS_API_KEY=<api key> npx tsx examples/connectionWithDefaults.ts`
*
* or for verbose logging:
*
* `NODE_DEBUG="wherobots-sql-driver" WHEROBOTS_API_KEY=<api key> node -r @swc-node/register examples/connectionWithDefaults.ts`
* `NODE_DEBUG="wherobots-sql-driver" WHEROBOTS_API_KEY=<api key> npx tsx examples/connectionWithDefaults.ts`
*/

import { Connection, Runtime } from "@/index";
Expand Down
4 changes: 2 additions & 2 deletions examples/multiSessionConnections.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* run with:

* `WHEROBOTS_API_KEY=<api key> node -r @swc-node/register examples/multiSessionConnections.ts`
* `WHEROBOTS_API_KEY=<api key> npx tsx examples/multiSessionConnections.ts`
*
* or for verbose logging:
*
* `NODE_DEBUG="wherobots-sql-driver" WHEROBOTS_API_KEY=<api key> node -r @swc-node/register examples/multiSessionConnections.ts`
* `NODE_DEBUG="wherobots-sql-driver" WHEROBOTS_API_KEY=<api key> npx tsx examples/multiSessionConnections.ts`
*/

import { Connection } from "@/connection";
Expand Down
Loading