create-harper 1.7.4 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/constants/frameworks.js +20 -0
- package/lib/constants/helpMessage.js +2 -2
- package/package.json +6 -2
- package/template-react/README.md +6 -2
- package/template-react/_gitignore +1 -2
- package/template-react/config.yaml +16 -3
- package/template-react/package.json +9 -7
- package/template-react/src/App.jsx +1 -5
- package/template-react/vite.config.js +2 -2
- package/template-react-ssr/README.md +124 -0
- package/template-react-ssr/_aiignore +1 -0
- package/template-react-ssr/_env +1 -0
- package/template-react-ssr/_env.example +1 -0
- package/template-react-ssr/_github/workflow/deploy.yaml +33 -0
- package/template-react-ssr/_gitignore +148 -0
- package/template-react-ssr/_nvmrc +1 -0
- package/template-react-ssr/config.yaml +42 -0
- package/template-react-ssr/eslint.config.js +23 -0
- package/template-react-ssr/graphql.config.yml +3 -0
- package/template-react-ssr/index.html +13 -0
- package/template-react-ssr/package.json +32 -0
- package/template-react-ssr/public/react.svg +14 -0
- package/template-react-ssr/public/vite.svg +42 -0
- package/template-react-ssr/resources/README.md +11 -0
- package/template-react-ssr/schemas/README.md +11 -0
- package/template-react-ssr/schemas/jsdocTypes.js +5 -0
- package/template-react-ssr/src/App.jsx +31 -0
- package/template-react-ssr/src/counter.js +7 -0
- package/template-react-ssr/src/entry-client.jsx +13 -0
- package/template-react-ssr/src/entry-server.jsx +18 -0
- package/template-react-ssr/src/style.css +96 -0
- package/template-react-ssr/src/vite-env.d.ts +9 -0
- package/template-react-ssr/test/counter.test.js +15 -0
- package/template-react-ssr/vite.config.js +22 -0
- package/template-react-ts/README.md +6 -2
- package/template-react-ts/_gitignore +1 -2
- package/template-react-ts/config.yaml +16 -3
- package/template-react-ts/package.json +10 -8
- package/template-react-ts/vite.config.ts +2 -2
- package/template-react-ts-ssr/README.md +132 -0
- package/template-react-ts-ssr/_aiignore +1 -0
- package/template-react-ts-ssr/_env +1 -0
- package/template-react-ts-ssr/_env.example +1 -0
- package/template-react-ts-ssr/_github/workflow/deploy.yaml +33 -0
- package/template-react-ts-ssr/_gitignore +148 -0
- package/template-react-ts-ssr/_nvmrc +1 -0
- package/template-react-ts-ssr/config.yaml +43 -0
- package/template-react-ts-ssr/eslint.config.js +23 -0
- package/template-react-ts-ssr/graphql.config.yml +3 -0
- package/template-react-ts-ssr/index.html +13 -0
- package/template-react-ts-ssr/package.json +36 -0
- package/template-react-ts-ssr/public/react.svg +14 -0
- package/template-react-ts-ssr/public/vite.svg +42 -0
- package/template-react-ts-ssr/resources/README.md +11 -0
- package/template-react-ts-ssr/schemas/README.md +11 -0
- package/template-react-ts-ssr/schemas/globalTypes.d.ts +5 -0
- package/template-react-ts-ssr/schemas/types.ts +5 -0
- package/template-react-ts-ssr/src/App.tsx +35 -0
- package/template-react-ts-ssr/src/counter.ts +7 -0
- package/template-react-ts-ssr/src/entry-client.tsx +13 -0
- package/template-react-ts-ssr/src/entry-server.tsx +17 -0
- package/template-react-ts-ssr/src/style.css +96 -0
- package/template-react-ts-ssr/src/vite-env.d.ts +9 -0
- package/template-react-ts-ssr/test/counter.test.ts +15 -0
- package/template-react-ts-ssr/tsconfig.json +34 -0
- package/template-react-ts-ssr/vite.config.ts +22 -0
- package/template-vanilla/README.md +5 -1
- package/template-vanilla-ts/README.md +5 -1
- package/template-vue/README.md +6 -2
- package/template-vue/_gitignore +1 -2
- package/template-vue/config.yaml +16 -3
- package/template-vue/package.json +9 -7
- package/template-vue/src/App.vue +1 -9
- package/template-vue/vite.config.js +1 -1
- package/template-vue-ssr/README.md +124 -0
- package/template-vue-ssr/_aiignore +1 -0
- package/template-vue-ssr/_env +1 -0
- package/template-vue-ssr/_env.example +1 -0
- package/template-vue-ssr/_github/workflow/deploy.yaml +33 -0
- package/template-vue-ssr/_gitignore +148 -0
- package/template-vue-ssr/_nvmrc +1 -0
- package/template-vue-ssr/config.yaml +42 -0
- package/template-vue-ssr/eslint.config.js +23 -0
- package/template-vue-ssr/graphql.config.yml +3 -0
- package/template-vue-ssr/index.html +13 -0
- package/template-vue-ssr/package.json +31 -0
- package/template-vue-ssr/public/react.svg +14 -0
- package/template-vue-ssr/public/vite.svg +42 -0
- package/template-vue-ssr/public/vue.svg +9 -0
- package/template-vue-ssr/resources/README.md +11 -0
- package/template-vue-ssr/schemas/README.md +11 -0
- package/template-vue-ssr/schemas/jsdocTypes.js +5 -0
- package/template-vue-ssr/src/App.vue +35 -0
- package/template-vue-ssr/src/counter.js +7 -0
- package/template-vue-ssr/src/entry-client.js +7 -0
- package/template-vue-ssr/src/entry-server.js +14 -0
- package/template-vue-ssr/src/style.css +96 -0
- package/template-vue-ssr/test/counter.test.js +15 -0
- package/template-vue-ssr/vite.config.js +22 -0
- package/template-vue-ts/README.md +6 -2
- package/template-vue-ts/_gitignore +1 -2
- package/template-vue-ts/config.yaml +16 -3
- package/template-vue-ts/package.json +8 -6
- package/template-vue-ts/vite.config.ts +1 -1
- package/template-vue-ts-ssr/README.md +132 -0
- package/template-vue-ts-ssr/_aiignore +1 -0
- package/template-vue-ts-ssr/_env +1 -0
- package/template-vue-ts-ssr/_env.example +1 -0
- package/template-vue-ts-ssr/_github/workflow/deploy.yaml +33 -0
- package/template-vue-ts-ssr/_gitignore +148 -0
- package/template-vue-ts-ssr/_nvmrc +1 -0
- package/template-vue-ts-ssr/config.yaml +43 -0
- package/template-vue-ts-ssr/eslint.config.js +23 -0
- package/template-vue-ts-ssr/graphql.config.yml +3 -0
- package/template-vue-ts-ssr/index.html +13 -0
- package/template-vue-ts-ssr/package.json +34 -0
- package/template-vue-ts-ssr/public/react.svg +14 -0
- package/template-vue-ts-ssr/public/vite.svg +42 -0
- package/template-vue-ts-ssr/public/vue.svg +9 -0
- package/template-vue-ts-ssr/resources/README.md +11 -0
- package/template-vue-ts-ssr/schemas/README.md +11 -0
- package/template-vue-ts-ssr/schemas/globalTypes.d.ts +5 -0
- package/template-vue-ts-ssr/schemas/types.ts +5 -0
- package/template-vue-ts-ssr/src/App.vue +43 -0
- package/template-vue-ts-ssr/src/counter.ts +7 -0
- package/template-vue-ts-ssr/src/entry-client.ts +7 -0
- package/template-vue-ts-ssr/src/entry-server.ts +13 -0
- package/template-vue-ts-ssr/src/style.css +96 -0
- package/template-vue-ts-ssr/src/vite-env.d.ts +15 -0
- package/template-vue-ts-ssr/test/counter.test.ts +15 -0
- package/template-vue-ts-ssr/tsconfig.json +33 -0
- package/template-vue-ts-ssr/vite.config.ts +22 -0
- package/template-react/deploy-template/config.yaml +0 -10
- package/template-react/deploy-template/fastify/static.js +0 -14
- package/template-react/deploy-template/package.json +0 -5
- package/template-react-ts/deploy-template/config.yaml +0 -10
- package/template-react-ts/deploy-template/fastify/static.js +0 -14
- package/template-react-ts/deploy-template/package.json +0 -5
- package/template-vue/deploy-template/config.yaml +0 -10
- package/template-vue/deploy-template/fastify/static.js +0 -14
- package/template-vue/deploy-template/package.json +0 -5
- package/template-vue-ts/deploy-template/config.yaml +0 -10
- package/template-vue-ts/deploy-template/fastify/static.js +0 -14
- package/template-vue-ts/deploy-template/package.json +0 -5
- /package/{template-react → template-react-ts-ssr}/public/typescript.svg +0 -0
- /package/{template-vue → template-vue-ts-ssr}/public/typescript.svg +0 -0
package/template-vue/_gitignore
CHANGED
package/template-vue/config.yaml
CHANGED
|
@@ -24,6 +24,19 @@ jsResource:
|
|
|
24
24
|
package: '@harperfast/schema-codegen'
|
|
25
25
|
jsdoc: 'schemas/jsdocTypes.js'
|
|
26
26
|
|
|
27
|
-
# Bootstraps Vite to build your frontend to HTML/JS/CSS
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
# Bootstraps Vite to build your frontend to HTML/JS/CSS.
|
|
28
|
+
# In production it builds your app (and recompiles when files in `files` change); the `static`
|
|
29
|
+
# component below serves the built output. Listed before `static` so its dev server wins in `harper dev`.
|
|
30
|
+
'@harperfast/vite':
|
|
31
|
+
package: '@harperfast/vite'
|
|
32
|
+
files: 'src/**/*'
|
|
33
|
+
output: 'dist'
|
|
34
|
+
|
|
35
|
+
# Serves the built frontend from Vite's output directory. `notFound` + `fallthrough: false` makes
|
|
36
|
+
# client-side routing work (unmatched routes return index.html); the REST routes above take precedence.
|
|
37
|
+
static:
|
|
38
|
+
files: 'dist/**'
|
|
39
|
+
notFound:
|
|
40
|
+
file: 'index.html'
|
|
41
|
+
statusCode: 200
|
|
42
|
+
fallthrough: false
|
|
@@ -13,17 +13,19 @@
|
|
|
13
13
|
"test": "node --test test/*.test.js",
|
|
14
14
|
"test:watch": "node --watch --test test/*.test.js",
|
|
15
15
|
"build": "vite build",
|
|
16
|
-
"deploy": "
|
|
16
|
+
"deploy": "harper deploy_component . restart=true replicated=true"
|
|
17
17
|
},
|
|
18
|
-
"
|
|
19
|
-
"@eslint/js": "^10.0.1",
|
|
18
|
+
"dependencies": {
|
|
20
19
|
"@harperfast/schema-codegen": "^1.0.10",
|
|
21
|
-
"@harperfast/vite
|
|
20
|
+
"@harperfast/vite": "^1.1.0",
|
|
22
21
|
"@vitejs/plugin-vue": "^6.0.5",
|
|
23
|
-
"eslint": "^10.0.2",
|
|
24
|
-
"globals": "^17.4.0",
|
|
25
|
-
"prettier": "^3.8.1",
|
|
26
22
|
"vite": "^8.0.0",
|
|
27
23
|
"vue": "^3.5.29"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@eslint/js": "^10.0.1",
|
|
27
|
+
"eslint": "^10.0.2",
|
|
28
|
+
"globals": "^17.4.0",
|
|
29
|
+
"prettier": "^3.8.1"
|
|
28
30
|
}
|
|
29
31
|
}
|
package/template-vue/src/App.vue
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import typescriptLogo from '/typescript.svg';
|
|
3
2
|
import viteLogo from '/vite.svg';
|
|
4
3
|
import vueLogo from '/vue.svg';
|
|
5
4
|
import { ref } from 'vue';
|
|
@@ -16,17 +15,10 @@ const countUp = () => {
|
|
|
16
15
|
<a href="https://vite.dev" target="_blank" rel="noopener noreferrer">
|
|
17
16
|
<img :src="viteLogo" class="logo" alt="Vite logo" />
|
|
18
17
|
</a>
|
|
19
|
-
<a
|
|
20
|
-
href="https://www.typescriptlang.org/"
|
|
21
|
-
target="_blank"
|
|
22
|
-
rel="noopener noreferrer"
|
|
23
|
-
>
|
|
24
|
-
<img :src="typescriptLogo" class="logo vanilla" alt="TypeScript logo" />
|
|
25
|
-
</a>
|
|
26
18
|
<a href="https://vuejs.org/" target="_blank" rel="noopener noreferrer">
|
|
27
19
|
<img :src="vueLogo" class="logo vue" alt="Vue logo" />
|
|
28
20
|
</a>
|
|
29
|
-
<h1>Vite +
|
|
21
|
+
<h1>Vite + Vue</h1>
|
|
30
22
|
<p>Wow, look at this!</p>
|
|
31
23
|
<div class="card">
|
|
32
24
|
<button id="counter" type="button" @click="countUp">
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# your-project-name-here
|
|
2
|
+
|
|
3
|
+
Your new app is now ready for development!
|
|
4
|
+
|
|
5
|
+
Here's what you should do next:
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
To get started, make sure you have [installed Harper](https://docs.harperdb.io/docs/deployments/install-harper):
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install -g harper
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Development
|
|
16
|
+
|
|
17
|
+
Then you can start your app:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
npm run dev
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Define Your Schema
|
|
24
|
+
|
|
25
|
+
1. Create a new yourTableName.graphql file in the [schemas](./schemas) directory.
|
|
26
|
+
2. Craft your schema by hand.
|
|
27
|
+
3. Save your changes.
|
|
28
|
+
|
|
29
|
+
These schemas are the heart of a great Harper app, specifying which tables you want and what attributes/fields they should have. Any table you `@export` stands up [endpoints automatically](./.agents/skills/harper-best-practices/rules/automatic-apis.md).
|
|
30
|
+
|
|
31
|
+
### Add Custom Endpoints
|
|
32
|
+
|
|
33
|
+
1. Create a new greeting.js file in the [resources](./resources) directory.
|
|
34
|
+
|
|
35
|
+
2. Customize your resource:
|
|
36
|
+
|
|
37
|
+
```javascript
|
|
38
|
+
export class Greeting extends Resource {
|
|
39
|
+
static loadAsInstance = false;
|
|
40
|
+
|
|
41
|
+
async post(
|
|
42
|
+
target,
|
|
43
|
+
newRecord,
|
|
44
|
+
) {
|
|
45
|
+
// By default, only super users can access these endpoints.
|
|
46
|
+
return { greeting: 'Greetings, post!' };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async get(target) {
|
|
50
|
+
// But if we want anyone to be able to access it, we can turn off the permission checks!
|
|
51
|
+
target.checkPermission = false;
|
|
52
|
+
return { greeting: 'Greetings, get! ' + process.version };
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async put(
|
|
56
|
+
target,
|
|
57
|
+
record,
|
|
58
|
+
) {
|
|
59
|
+
target.checkPermission = false;
|
|
60
|
+
if (this.getCurrentUser()?.name?.includes('Coffee')) {
|
|
61
|
+
// You can add your own authorization guards, of course.
|
|
62
|
+
return new Response('Coffee? COFFEE?!', { status: 418 });
|
|
63
|
+
}
|
|
64
|
+
return { greeting: 'Sssssssssssssss!' };
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async patch(
|
|
68
|
+
target,
|
|
69
|
+
record,
|
|
70
|
+
) {
|
|
71
|
+
return { greeting: 'We can make this work!' };
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async delete(target) {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
3. Save your changes.
|
|
81
|
+
|
|
82
|
+
### View Your Website
|
|
83
|
+
|
|
84
|
+
Pop open [http://localhost:9926](http://localhost:9926) to view [index.html](./index.html) in your browser.
|
|
85
|
+
|
|
86
|
+
### Use Your API
|
|
87
|
+
|
|
88
|
+
Test your application works by querying the `/Greeting` endpoint:
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
curl http://localhost:9926/Greeting
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
You should see the following:
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{ "greeting": "Hello, world!" }
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Configure Your App
|
|
101
|
+
|
|
102
|
+
Take a look at the [default configuration](./config.yaml), which specifies how files are handled in your application.
|
|
103
|
+
|
|
104
|
+
## Deployment
|
|
105
|
+
|
|
106
|
+
When you are ready, head to [https://fabric.harper.fast/](https://fabric.harper.fast/), log in to your account, and create a cluster.
|
|
107
|
+
|
|
108
|
+
Come back and log in your local CLI to your cluster:
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
harper login
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Then you can deploy your app to your cluster:
|
|
115
|
+
|
|
116
|
+
```sh
|
|
117
|
+
npm run deploy
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Keep Going!
|
|
121
|
+
|
|
122
|
+
For more information about getting started with Harper and building applications, see our [getting started guide](https://docs.harperdb.io/docs).
|
|
123
|
+
|
|
124
|
+
For more information on Harper Components, see the [Components documentation](https://docs.harperdb.io/docs/reference/components).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.env
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CLI_TARGET='your-fabric.harper.fast-cluster-url-here'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CLI_TARGET='YOUR_FABRIC.HARPER.FAST_CLUSTER_URL_HERE'
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: Deploy to Harper Fabric
|
|
2
|
+
on:
|
|
3
|
+
workflow_dispatch:
|
|
4
|
+
# push:
|
|
5
|
+
# branches:
|
|
6
|
+
# - main
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: main
|
|
10
|
+
cancel-in-progress: false
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
deploy:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout code
|
|
17
|
+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
18
|
+
with:
|
|
19
|
+
fetch-depth: 0
|
|
20
|
+
fetch-tags: true
|
|
21
|
+
- name: Set up Node.js
|
|
22
|
+
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
|
|
23
|
+
with:
|
|
24
|
+
cache: 'npm'
|
|
25
|
+
node-version-file: '.nvmrc'
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: npm ci
|
|
28
|
+
- name: Run unit tests
|
|
29
|
+
run: npm test
|
|
30
|
+
- name: Run lint
|
|
31
|
+
run: npm run lint
|
|
32
|
+
- name: Build & deploy
|
|
33
|
+
run: npm run deploy
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
.DS_Store
|
|
2
|
+
dist
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# https://raw.githubusercontent.com/github/gitignore/refs/heads/main/Node.gitignore
|
|
6
|
+
#
|
|
7
|
+
|
|
8
|
+
# Logs
|
|
9
|
+
logs
|
|
10
|
+
*.log
|
|
11
|
+
npm-debug.log*
|
|
12
|
+
yarn-debug.log*
|
|
13
|
+
yarn-error.log*
|
|
14
|
+
lerna-debug.log*
|
|
15
|
+
|
|
16
|
+
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
17
|
+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
18
|
+
|
|
19
|
+
# Runtime data
|
|
20
|
+
pids
|
|
21
|
+
*.pid
|
|
22
|
+
*.seed
|
|
23
|
+
*.pid.lock
|
|
24
|
+
|
|
25
|
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
26
|
+
lib-cov
|
|
27
|
+
|
|
28
|
+
# Coverage directory used by tools like istanbul
|
|
29
|
+
coverage
|
|
30
|
+
*.lcov
|
|
31
|
+
|
|
32
|
+
# nyc test coverage
|
|
33
|
+
.nyc_output
|
|
34
|
+
|
|
35
|
+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
36
|
+
.grunt
|
|
37
|
+
|
|
38
|
+
# Bower dependency directory (https://bower.io/)
|
|
39
|
+
bower_components
|
|
40
|
+
|
|
41
|
+
# node-waf configuration
|
|
42
|
+
.lock-wscript
|
|
43
|
+
|
|
44
|
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
45
|
+
build/Release
|
|
46
|
+
|
|
47
|
+
# Dependency directories
|
|
48
|
+
node_modules/
|
|
49
|
+
jspm_packages/
|
|
50
|
+
|
|
51
|
+
# Snowpack dependency directory (https://snowpack.dev/)
|
|
52
|
+
web_modules/
|
|
53
|
+
|
|
54
|
+
# TypeScript cache
|
|
55
|
+
*.tsbuildinfo
|
|
56
|
+
|
|
57
|
+
# Optional npm cache directory
|
|
58
|
+
.npm
|
|
59
|
+
|
|
60
|
+
# Optional eslint cache
|
|
61
|
+
.eslintcache
|
|
62
|
+
|
|
63
|
+
# Optional stylelint cache
|
|
64
|
+
.stylelintcache
|
|
65
|
+
|
|
66
|
+
# Optional REPL history
|
|
67
|
+
.node_repl_history
|
|
68
|
+
|
|
69
|
+
# Output of 'npm pack'
|
|
70
|
+
*.tgz
|
|
71
|
+
|
|
72
|
+
# Yarn Integrity file
|
|
73
|
+
.yarn-integrity
|
|
74
|
+
|
|
75
|
+
# dotenv environment variable files
|
|
76
|
+
.env
|
|
77
|
+
.env.*
|
|
78
|
+
!.env.example
|
|
79
|
+
|
|
80
|
+
# parcel-bundler cache (https://parceljs.org/)
|
|
81
|
+
.cache
|
|
82
|
+
.parcel-cache
|
|
83
|
+
|
|
84
|
+
# Next.js build output
|
|
85
|
+
.next
|
|
86
|
+
out
|
|
87
|
+
|
|
88
|
+
# Nuxt.js build / generate output
|
|
89
|
+
.nuxt
|
|
90
|
+
dist
|
|
91
|
+
.output
|
|
92
|
+
|
|
93
|
+
# Gatsby files
|
|
94
|
+
.cache/
|
|
95
|
+
# Comment in the public line in if your project uses Gatsby and not Next.js
|
|
96
|
+
# https://nextjs.org/blog/next-9-1#public-directory-support
|
|
97
|
+
# public
|
|
98
|
+
|
|
99
|
+
# vuepress build output
|
|
100
|
+
.vuepress/dist
|
|
101
|
+
|
|
102
|
+
# vuepress v2.x temp and cache directory
|
|
103
|
+
.temp
|
|
104
|
+
.cache
|
|
105
|
+
|
|
106
|
+
# Sveltekit cache directory
|
|
107
|
+
.svelte-kit/
|
|
108
|
+
|
|
109
|
+
# vitepress build output
|
|
110
|
+
**/.vitepress/dist
|
|
111
|
+
|
|
112
|
+
# vitepress cache directory
|
|
113
|
+
**/.vitepress/cache
|
|
114
|
+
|
|
115
|
+
# Docusaurus cache and generated files
|
|
116
|
+
.docusaurus
|
|
117
|
+
|
|
118
|
+
# Serverless directories
|
|
119
|
+
.serverless/
|
|
120
|
+
|
|
121
|
+
# FuseBox cache
|
|
122
|
+
.fusebox/
|
|
123
|
+
|
|
124
|
+
# DynamoDB Local files
|
|
125
|
+
.dynamodb/
|
|
126
|
+
|
|
127
|
+
# Firebase cache directory
|
|
128
|
+
.firebase/
|
|
129
|
+
|
|
130
|
+
# TernJS port file
|
|
131
|
+
.tern-port
|
|
132
|
+
|
|
133
|
+
# Stores VSCode versions used for testing VSCode extensions
|
|
134
|
+
.vscode-test
|
|
135
|
+
|
|
136
|
+
# yarn v3
|
|
137
|
+
.pnp.*
|
|
138
|
+
.yarn/*
|
|
139
|
+
!.yarn/patches
|
|
140
|
+
!.yarn/plugins
|
|
141
|
+
!.yarn/releases
|
|
142
|
+
!.yarn/sdks
|
|
143
|
+
!.yarn/versions
|
|
144
|
+
|
|
145
|
+
# Vite files
|
|
146
|
+
vite.config.js.timestamp-*
|
|
147
|
+
vite.config.ts.timestamp-*
|
|
148
|
+
.vite/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
24.13.1
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# yaml-language-server: $schema=./node_modules/harper/config-app.schema.json
|
|
2
|
+
|
|
3
|
+
# This is the configuration file for the application.
|
|
4
|
+
# It specifies built-in Harper components that will load the specified feature and files.
|
|
5
|
+
# For more information, see https://docs.harperdb.io/docs/reference/components/built-in-extensions
|
|
6
|
+
|
|
7
|
+
# Load Environment Variables from the specified file
|
|
8
|
+
# loadEnv:
|
|
9
|
+
# files: '.env'
|
|
10
|
+
|
|
11
|
+
# This provides the HTTP REST interface for all exported resources
|
|
12
|
+
rest: true
|
|
13
|
+
|
|
14
|
+
# These reads GraphQL schemas to define the schema of database/tables/attributes.
|
|
15
|
+
graphqlSchema:
|
|
16
|
+
files: 'schemas/*.graphql'
|
|
17
|
+
|
|
18
|
+
# Loads JavaScript modules such that their exports are exported as resources
|
|
19
|
+
jsResource:
|
|
20
|
+
files: 'resources/*.js'
|
|
21
|
+
|
|
22
|
+
# Generates jsdoc types for the schema so your code is schema-aware
|
|
23
|
+
'@harperfast/schema-codegen':
|
|
24
|
+
package: '@harperfast/schema-codegen'
|
|
25
|
+
jsdoc: 'schemas/jsdocTypes.js'
|
|
26
|
+
|
|
27
|
+
# Bootstraps Vite to build your frontend to HTML/JS/CSS.
|
|
28
|
+
# In production it builds your app (and recompiles when files in `files` change) and renders HTML on
|
|
29
|
+
# the server; the `static` component below serves the built assets. Listed before `static` so its dev
|
|
30
|
+
# server wins in `harper dev`.
|
|
31
|
+
'@harperfast/vite':
|
|
32
|
+
package: '@harperfast/vite'
|
|
33
|
+
files: 'src/**/*'
|
|
34
|
+
output: 'dist'
|
|
35
|
+
# Server-side render entry. Renders HTML on the server; omit to serve a client-only (SPA) app.
|
|
36
|
+
ssr: 'src/entry-server.js'
|
|
37
|
+
|
|
38
|
+
# Serves the built assets from Vite's output directory. `index: false` because this is an SSR app —
|
|
39
|
+
# the Vite plugin renders index.html; static only serves assets.
|
|
40
|
+
static:
|
|
41
|
+
files: 'dist/**'
|
|
42
|
+
index: false
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import globals from 'globals';
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
js.configs.recommended,
|
|
6
|
+
{
|
|
7
|
+
languageOptions: {
|
|
8
|
+
globals: {
|
|
9
|
+
...globals.browser,
|
|
10
|
+
...globals.node,
|
|
11
|
+
},
|
|
12
|
+
ecmaVersion: 'latest',
|
|
13
|
+
sourceType: 'module',
|
|
14
|
+
},
|
|
15
|
+
rules: {
|
|
16
|
+
'no-unused-vars': 'warn',
|
|
17
|
+
'no-console': 'off',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
ignores: ['node_modules/'],
|
|
22
|
+
},
|
|
23
|
+
];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>your-project-name-here</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="app"><!--ssr-outlet--></div>
|
|
11
|
+
<script type="module" src="/src/entry-client.js"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "your-package-name-here",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"repository": "github:HarperFast/create-harper",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"agent:run": "npx -y @harperfast/agent@latest",
|
|
8
|
+
"agent:skills:update": "npx -y skills@latest add harperfast/skills --all --yes",
|
|
9
|
+
"start": "harper run .",
|
|
10
|
+
"dev": "harper dev .",
|
|
11
|
+
"lint": "eslint .",
|
|
12
|
+
"format": "prettier --write .",
|
|
13
|
+
"test": "node --test test/*.test.js",
|
|
14
|
+
"test:watch": "node --watch --test test/*.test.js",
|
|
15
|
+
"build": "vite build",
|
|
16
|
+
"deploy": "harper deploy_component . restart=true replicated=true"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@harperfast/schema-codegen": "^1.0.10",
|
|
20
|
+
"@harperfast/vite": "^1.1.0",
|
|
21
|
+
"@vitejs/plugin-vue": "^6.0.5",
|
|
22
|
+
"vite": "^8.0.0",
|
|
23
|
+
"vue": "^3.5.29"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@eslint/js": "^10.0.1",
|
|
27
|
+
"eslint": "^10.0.2",
|
|
28
|
+
"globals": "^17.4.0",
|
|
29
|
+
"prettier": "^3.8.1"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg
|
|
2
|
+
width="100%"
|
|
3
|
+
height="100%"
|
|
4
|
+
viewBox="-10.5 -9.45 21 18.9"
|
|
5
|
+
fill="none"
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
>
|
|
8
|
+
<circle cx="0" cy="0" r="2" fill="#58c4dc"></circle>
|
|
9
|
+
<g stroke="#58c4dc" stroke-width="1" fill="none">
|
|
10
|
+
<ellipse rx="10" ry="4.5"></ellipse>
|
|
11
|
+
<ellipse rx="10" ry="4.5" transform="rotate(60)"></ellipse>
|
|
12
|
+
<ellipse rx="10" ry="4.5" transform="rotate(120)"></ellipse>
|
|
13
|
+
</g>
|
|
14
|
+
</svg>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<svg
|
|
2
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
3
|
+
aria-hidden="true"
|
|
4
|
+
role="img"
|
|
5
|
+
class="iconify iconify--logos"
|
|
6
|
+
width="31.88"
|
|
7
|
+
height="32"
|
|
8
|
+
preserveAspectRatio="xMidYMid meet"
|
|
9
|
+
viewBox="0 0 256 257"
|
|
10
|
+
>
|
|
11
|
+
<defs>
|
|
12
|
+
<linearGradient
|
|
13
|
+
id="IconifyId1813088fe1fbc01fb466"
|
|
14
|
+
x1="-.828%"
|
|
15
|
+
x2="57.636%"
|
|
16
|
+
y1="7.652%"
|
|
17
|
+
y2="78.411%"
|
|
18
|
+
>
|
|
19
|
+
<stop offset="0%" stop-color="#41D1FF"></stop>
|
|
20
|
+
<stop offset="100%" stop-color="#BD34FE"></stop>
|
|
21
|
+
</linearGradient>
|
|
22
|
+
<linearGradient
|
|
23
|
+
id="IconifyId1813088fe1fbc01fb467"
|
|
24
|
+
x1="43.376%"
|
|
25
|
+
x2="50.316%"
|
|
26
|
+
y1="2.242%"
|
|
27
|
+
y2="89.03%"
|
|
28
|
+
>
|
|
29
|
+
<stop offset="0%" stop-color="#FFEA83"></stop>
|
|
30
|
+
<stop offset="8.333%" stop-color="#FFDD35"></stop>
|
|
31
|
+
<stop offset="100%" stop-color="#FFA800"></stop>
|
|
32
|
+
</linearGradient>
|
|
33
|
+
</defs>
|
|
34
|
+
<path
|
|
35
|
+
fill="url(#IconifyId1813088fe1fbc01fb466)"
|
|
36
|
+
d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"
|
|
37
|
+
></path>
|
|
38
|
+
<path
|
|
39
|
+
fill="url(#IconifyId1813088fe1fbc01fb467)"
|
|
40
|
+
d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"
|
|
41
|
+
></path>
|
|
42
|
+
</svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Resources
|
|
2
|
+
|
|
3
|
+
The [schemas you define in .GraphQL files](../.agents/skills/harper-best-practices/rules/adding-tables-with-schemas.md) will [automatically stand-up REST APIs](../.agents/skills/harper-best-practices/rules/automatic-apis.md).
|
|
4
|
+
|
|
5
|
+
But you can [extend your tables with custom logic](../.agents/skills/harper-best-practices/rules/extending-tables.md) and [create your own resources](../.agents/skills/harper-best-practices/rules/custom-resources.md) in this directory.
|
|
6
|
+
|
|
7
|
+
## Want to read more?
|
|
8
|
+
|
|
9
|
+
Check out the rest of the "skills" documentation!
|
|
10
|
+
|
|
11
|
+
[Harper Best Practices Skill](../.agents/skills/harper-best-practices/SKILL.md)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Schemas
|
|
2
|
+
|
|
3
|
+
Your schemas are defined in `.graphql` files within this `schemas` directory. These files contain the structure and types for your database tables, allowing Harper to automatically generate REST APIs for CRUD operations.
|
|
4
|
+
|
|
5
|
+
Take a look at the [Adding Tables with Schemas](../.agents/skills/harper-best-practices/rules/adding-tables-with-schemas.md) to learn more!
|
|
6
|
+
|
|
7
|
+
## Want to read more?
|
|
8
|
+
|
|
9
|
+
Check out the rest of the "skills" documentation!
|
|
10
|
+
|
|
11
|
+
[Harper Best Practices Skill](../.agents/skills/harper-best-practices/SKILL.md)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import viteLogo from '/vite.svg';
|
|
3
|
+
import vueLogo from '/vue.svg';
|
|
4
|
+
import { ref } from 'vue';
|
|
5
|
+
import { increment } from './counter.js';
|
|
6
|
+
|
|
7
|
+
const counter = ref(0);
|
|
8
|
+
const countUp = () => {
|
|
9
|
+
counter.value = increment(counter.value);
|
|
10
|
+
};
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<div>
|
|
15
|
+
<a href="https://vite.dev" target="_blank" rel="noopener noreferrer">
|
|
16
|
+
<img :src="viteLogo" class="logo" alt="Vite logo" />
|
|
17
|
+
</a>
|
|
18
|
+
<a href="https://vuejs.org/" target="_blank" rel="noopener noreferrer">
|
|
19
|
+
<img :src="vueLogo" class="logo vue" alt="Vue logo" />
|
|
20
|
+
</a>
|
|
21
|
+
<h1>Vite + Vue</h1>
|
|
22
|
+
<p>Wow, look at this!</p>
|
|
23
|
+
<div class="card">
|
|
24
|
+
<button id="counter" type="button" @click="countUp">
|
|
25
|
+
count is {{ counter }}
|
|
26
|
+
</button>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<style scoped>
|
|
32
|
+
.logo.vue:hover {
|
|
33
|
+
filter: drop-shadow(0 0 2em #42b883aa);
|
|
34
|
+
}
|
|
35
|
+
</style>
|