Skip to content
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

Initial Subscribe Sandbox App #882

Open
wants to merge 5 commits into
base: main
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
5 changes: 5 additions & 0 deletions .changeset/thick-spies-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"e2e.sandbox.subscribeapp": patch
---

Created initial sandbox app for subscribe
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ pnpm-publish-summary.json

api-docs/
temp/
tsup.config.bundled_*.mjs
tsup.config.bundled_*.mjs

examples/example-next-static-export/.next/
21 changes: 21 additions & 0 deletions packages/e2e.sandbox.subscribeapp/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
],
ignorePatterns: ["dist", "build", ".eslintrc.cjs"],
parser: "@typescript-eslint/parser",
plugins: ["react-refresh"],
rules: {
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": "warn",
},
};
24 changes: 24 additions & 0 deletions packages/e2e.sandbox.subscribeapp/.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?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do I need to configure this?

Empty file.
7 changes: 7 additions & 0 deletions packages/e2e.sandbox.subscribeapp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# OSDK Backed Map Application

## Run server for dev

1. Copy `.env.local.sample` to `.env.local` and fill out details for stack.
2. Run `pnpm run codegen` to make sure you're up to date
3. Run `pnpm dev`.
13 changes: 13 additions & 0 deletions packages/e2e.sandbox.subscribeapp/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!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>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
56 changes: 56 additions & 0 deletions packages/e2e.sandbox.subscribeapp/ontology.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"ontology": {
"apiName": "default",
"rid": "ri.ontology.main.ontology.a35bb7f9-2c57-4199-a1cd-af461d88bd6e",
"displayName": "",
"description": ""
},
"actionTypes": {
},
"objectTypes": {
"MtaBus": {
"objectType": {
"apiName": "MtaBus",
"primaryKey": "vehicleId",
"displayName": "MtaBus",
"description": "MtaBus",
"properties": {
"vehicleId": {
"dataType": {
"type": "string"
}
},
"nextStopId": {
"dataType": {
"type": "string"
}
},
"routeId": {
"dataType": {
"type": "string"
}
},
"positionId": {
"dataType": {
"type": "geotimeSeriesReference"
}
}
},
"status": "ACTIVE",
"rid": "ri.a.b.c.d",
"icon": {
"type": "blueprint",
"name": "traffic",
"color": "color"
},
"titleProperty": "name",
"pluralDisplayName": "Fintraffic AIS"
},
"linkTypes": []
}
},
"queryTypes": {
},
"interfaceTypes": {
}
}
77 changes: 77 additions & 0 deletions packages/e2e.sandbox.subscribeapp/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"name": "e2e.sandbox.subscribeapp",
"version": "0.0.0",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/palantir/osdk-ts.git"
},
"exports": {
".": {
"browser": "./build/browser/index.js",
"import": "./build/esm/index.js"
},
"./*": {
"browser": "./build/browser/public/*.js",
"import": "./build/esm/public/*.js"
}
},
"scripts": {
"build": "tsc -b && vite build",
"check-attw": "monorepo.tool.attw esm",
"check-spelling": "cspell --quiet .",
"clean": "rm -rf lib dist types build tsconfig.tsbuildinfo",
"codegen": "rm -rf src/generatedNoCheck2/* && osdk-unstable-typescript generate --outDir src/generatedNoCheck2 --beta --ontologyPath ontology.json --version dev --internal",
"dev": "vite",
"fix-lint": "eslint . --fix && dprint fmt --config $(find-up dprint.json)",
"lint": "eslint . && dprint check --config $(find-up dprint.json)",
"preview": "vite preview",
"transpile": "monorepo.tool.transpile"
},
"dependencies": {
"@types/leaflet": "^1.9.12",
"leaflet": "^1.9.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-leaflet": "^4.2.1"
},
"peerDependencies": {
"@osdk/api": "workspace:~",
"@osdk/client": "workspace:~"
},
"devDependencies": {
"@eslint/js": "^9.11.1",
"@osdk/api": "workspace:~",
"@osdk/cli.cmd.typescript": "workspace:~",
"@osdk/client": "workspace:~",
"@osdk/monorepo.api-extractor": "workspace:~",
"@osdk/monorepo.tsconfig": "workspace:~",
"@osdk/monorepo.tsup": "workspace:~",
"@types/react": "^18.3.10",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.2",
"eslint": "^9.11.1",
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.12",
"globals": "^15.9.0",
"tiny-invariant": "1.3.3",
"typescript": "^5.5.4",
"typescript-eslint": "^8.7.0",
"vite": "^5.4.8"
},
"publishConfig": {
"access": "public"
},
"files": [
"build/cjs",
"build/esm",
"build/browser",
"CHANGELOG.md",
"package.json",
"templates",
"*.d.ts"
],
"module": "./build/esm/index.js",
"types": "./build/esm/index.d.ts",
"type": "module"
}
41 changes: 41 additions & 0 deletions packages/e2e.sandbox.subscribeapp/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#root {
margin: 0 auto;
padding: 2rem;
text-align: center;
}

.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
filter: drop-shadow(0 0 2em #61dafbaa);
}

@keyframes logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

@media (prefers-reduced-motion: no-preference) {
a:nth-of-type(2) .logo {
animation: logo-spin infinite 20s linear;
}
}

.card {
padding: 2em;
}

.read-the-docs {
color: #888;
}
20 changes: 20 additions & 0 deletions packages/e2e.sandbox.subscribeapp/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import viteLogo from "/vite.svg";
import React from "react";
import "./App.css";
import MapComponent from "./MapComponent.js";
import { useSubscribe } from "./useSubscribe.tsx";

interface Coordinates {
lat: number;
lng: number;
}

function App() {
return (
<div>
<MapComponent />
</div>
);
}

export default App;
21 changes: 21 additions & 0 deletions packages/e2e.sandbox.subscribeapp/src/EntityPopup.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from "react";

interface EntityPopupProps {
id: string;
routeId: string;
nextStopId: string;
}

const EntityPopup: React.FC<EntityPopupProps> = (
{ id, routeId, nextStopId },
) => {
return (
<div>
<h1>{id}</h1>
<p>Route ID: {routeId}</p>
<p>Next Stop ID: {nextStopId}</p>
</div>
);
};

export default EntityPopup;
Loading
Loading