Skip to content

Commit 933ef25

Browse files
committed
feat(#354 | create-hypergraph-app): move hypergraph-app-template into hypergraph monorepo
1 parent bea0602 commit 933ef25

36 files changed

+3129
-375
lines changed

apps/create-hypergraph-app/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024-present Geo Browser, PB LLC and other contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# @graphprotocol/create-hypergraph-app
2+
3+
CLI toolchain to scaffold a [Hypergraph-enabled](https://github.com/graphprotocol/hypergraph) application with a given template.
4+
5+
Inspiration takes from the `vite`, `nextjs`, and `effect` create app command tools.
6+
7+
## Scaffolding a hypergraph app
8+
9+
With NPM:
10+
11+
```bash
12+
npm create hypergraph-app@latest
13+
```
14+
15+
With Yarn:
16+
17+
```bash
18+
yarn create hypergraph-app
19+
```
20+
21+
With PNPM:
22+
23+
```bash
24+
pnpm create hypergraph-app@latest
25+
```
26+
27+
With Bun:
28+
29+
```bash
30+
bun create hypergraph-app
31+
```
32+
33+
Then follow the given prompts.
34+
35+
### Currently Supported Templates
36+
37+
- vite + react
38+
39+
## References
40+
41+
- [create vite app](https://github.com/vitejs/vite/tree/main/packages/create-vite)
42+
- [create effect app](https://effect.website/docs/getting-started/create-effect-app/)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "@graphprotocol/create-hypergraph-app",
3+
"version": "0.0.1",
4+
"description": "CLI toolchain to scaffold a hypergraph-enabled application with a given template.",
5+
"type": "module",
6+
"bin": {
7+
"create-hypergraph-app": "dist/bin.js",
8+
"cha": "dist/bin.js"
9+
},
10+
"files": ["dist", "template-*"],
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/graphprotocol/hypergraph.git",
14+
"directory": "apps/create-hypergraph-app"
15+
},
16+
"publishConfig": {
17+
"access": "public",
18+
"directory": "dist",
19+
"linkDirectory": false
20+
},
21+
"scripts": {
22+
"test": "vitest run",
23+
"dev": "pnpx tsx ./src/bin.ts",
24+
"build": "tsup",
25+
"check": "tsc --noEmit"
26+
},
27+
"keywords": ["The Graph", "Web3", "Knowledge Graph", "Hypergraph", "TypeSyncs"],
28+
"license": "MIT",
29+
"engines": {
30+
"node": ">=20"
31+
},
32+
"bugs": {
33+
"url": "https://github.com/graphprotocol/hypergraph/issues"
34+
},
35+
"homepage": "https://github.com/graphprotocol/hypergraph/tree/main/apps/create-hypergraph-app#readme"
36+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Ignore artifacts:
2+
build
3+
dist
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"printWidth": 120
4+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Hypergraph + Vite + React
2+
3+
This template is a minimal setup for a [Hypergraph](https://github.com/graphprotocol/hypergraph) app using Vite and React.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "new-york",
4+
"rsc": false,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "",
8+
"css": "src/index.css",
9+
"baseColor": "slate",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils",
16+
"ui": "@/components/ui",
17+
"lib": "@/lib",
18+
"hooks": "@/hooks"
19+
},
20+
"iconLibrary": "lucide"
21+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
7+
export default tseslint.config(
8+
{ ignores: ['dist'] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ['**/*.{ts,tsx}'],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser,
15+
},
16+
plugins: {
17+
'react-hooks': reactHooks,
18+
'react-refresh': reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
'react-refresh/only-export-components': [
23+
'warn',
24+
{ allowConstantExport: true },
25+
],
26+
},
27+
},
28+
)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Hypergraph App Template | Vite + React</title>
7+
<link rel="icon" type="image/svg+xml" href="/hypergraph.svg" />
8+
</head>
9+
<body class="h-full w-full">
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)