create-harper 1.7.3 → 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
|
@@ -59,6 +59,16 @@ export const frameworks = [
|
|
|
59
59
|
display: 'JavaScript',
|
|
60
60
|
color: yellow,
|
|
61
61
|
},
|
|
62
|
+
{
|
|
63
|
+
name: 'react-ts-ssr',
|
|
64
|
+
display: 'TypeScript + SSR',
|
|
65
|
+
color: blue,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'react-ssr',
|
|
69
|
+
display: 'JavaScript + SSR',
|
|
70
|
+
color: yellow,
|
|
71
|
+
},
|
|
62
72
|
],
|
|
63
73
|
},
|
|
64
74
|
{
|
|
@@ -76,6 +86,16 @@ export const frameworks = [
|
|
|
76
86
|
display: 'JavaScript',
|
|
77
87
|
color: yellow,
|
|
78
88
|
},
|
|
89
|
+
{
|
|
90
|
+
name: 'vue-ts-ssr',
|
|
91
|
+
display: 'TypeScript + SSR',
|
|
92
|
+
color: blue,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: 'vue-ssr',
|
|
96
|
+
display: 'JavaScript + SSR',
|
|
97
|
+
color: yellow,
|
|
98
|
+
},
|
|
79
99
|
],
|
|
80
100
|
},
|
|
81
101
|
];
|
|
@@ -31,5 +31,5 @@ If you are going to deploy your application to https://fabric.harper.fast/, you
|
|
|
31
31
|
|
|
32
32
|
Available templates:
|
|
33
33
|
${yellow('vanilla-ts vanilla')}
|
|
34
|
-
${cyan('react-ts react')}
|
|
35
|
-
${green('vue-ts vue')}`;
|
|
34
|
+
${cyan('react-ts react react-ts-ssr react-ssr')}
|
|
35
|
+
${green('vue-ts vue vue-ts-ssr vue-ssr')}`;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-harper",
|
|
3
3
|
"description": "Scaffold a new Harper project in JavaScript or TypeScript.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.8.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "HarperDB",
|
|
@@ -17,10 +17,14 @@
|
|
|
17
17
|
"!lib/**/*.test.js",
|
|
18
18
|
"template-react/",
|
|
19
19
|
"template-react-ts/",
|
|
20
|
+
"template-react-ssr/",
|
|
21
|
+
"template-react-ts-ssr/",
|
|
20
22
|
"template-vanilla/",
|
|
21
23
|
"template-vanilla-ts/",
|
|
22
24
|
"template-vue/",
|
|
23
|
-
"template-vue-ts/"
|
|
25
|
+
"template-vue-ts/",
|
|
26
|
+
"template-vue-ssr/",
|
|
27
|
+
"template-vue-ts-ssr/"
|
|
24
28
|
],
|
|
25
29
|
"scripts": {
|
|
26
30
|
"commitlint": "commitlint --edit",
|
package/template-react/README.md
CHANGED
|
@@ -81,7 +81,7 @@ These schemas are the heart of a great Harper app, specifying which tables you w
|
|
|
81
81
|
|
|
82
82
|
### View Your Website
|
|
83
83
|
|
|
84
|
-
Pop open [http://localhost:9926](http://localhost:9926) to view [
|
|
84
|
+
Pop open [http://localhost:9926](http://localhost:9926) to view [index.html](./index.html) in your browser.
|
|
85
85
|
|
|
86
86
|
### Use Your API
|
|
87
87
|
|
|
@@ -105,7 +105,11 @@ Take a look at the [default configuration](./config.yaml), which specifies how f
|
|
|
105
105
|
|
|
106
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
107
|
|
|
108
|
-
Come back
|
|
108
|
+
Come back and log in your local CLI to your cluster:
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
harper login
|
|
112
|
+
```
|
|
109
113
|
|
|
110
114
|
Then you can deploy your app to your cluster:
|
|
111
115
|
|
|
@@ -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,18 +13,20 @@
|
|
|
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-react": "^6.0.1",
|
|
23
|
-
"eslint": "^10.0.2",
|
|
24
|
-
"globals": "^17.4.0",
|
|
25
|
-
"prettier": "^3.8.1",
|
|
26
22
|
"react": "^19.2.4",
|
|
27
23
|
"react-dom": "^19.2.4",
|
|
28
24
|
"vite": "^8.0.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@eslint/js": "^10.0.1",
|
|
28
|
+
"eslint": "^10.0.2",
|
|
29
|
+
"globals": "^17.4.0",
|
|
30
|
+
"prettier": "^3.8.1"
|
|
29
31
|
}
|
|
30
32
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import reactLogo from '/react.svg';
|
|
2
|
-
import typescriptLogo from '/typescript.svg';
|
|
3
2
|
import viteLogo from '/vite.svg';
|
|
4
3
|
import { useCallback, useState } from 'react';
|
|
5
4
|
import { increment } from './counter.js';
|
|
@@ -16,13 +15,10 @@ export function App() {
|
|
|
16
15
|
<a href="https://vite.dev" target="_blank" rel="noopener noreferrer">
|
|
17
16
|
<img src={viteLogo} className="logo" alt="Vite logo" />
|
|
18
17
|
</a>
|
|
19
|
-
<a href="https://www.typescriptlang.org/" target="_blank" rel="noopener noreferrer">
|
|
20
|
-
<img src={typescriptLogo} className="logo vanilla" alt="TypeScript logo" />
|
|
21
|
-
</a>
|
|
22
18
|
<a href="https://react.dev/" target="_blank" rel="noopener noreferrer">
|
|
23
19
|
<img src={reactLogo} className="logo react" alt="React logo" />
|
|
24
20
|
</a>
|
|
25
|
-
<h1>Vite +
|
|
21
|
+
<h1>Vite + React</h1>
|
|
26
22
|
<p>Wow, look at this!</p>
|
|
27
23
|
<div className="card">
|
|
28
24
|
<button id="counter" type="button" onClick={countUp}>
|
|
@@ -9,11 +9,11 @@ export default defineConfig({
|
|
|
9
9
|
],
|
|
10
10
|
resolve: {
|
|
11
11
|
alias: {
|
|
12
|
-
'@': path.resolve(
|
|
12
|
+
'@': path.resolve(import.meta.dirname, './src'),
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
15
|
build: {
|
|
16
|
-
outDir: '
|
|
16
|
+
outDir: 'dist',
|
|
17
17
|
emptyOutDir: true,
|
|
18
18
|
rolldownOptions: {
|
|
19
19
|
external: ['**/*.test.*', '**/*.spec.*'],
|
|
@@ -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.jsx'
|
|
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.jsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,32 @@
|
|
|
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-react": "^6.0.1",
|
|
22
|
+
"react": "^19.2.4",
|
|
23
|
+
"react-dom": "^19.2.4",
|
|
24
|
+
"vite": "^8.0.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@eslint/js": "^10.0.1",
|
|
28
|
+
"eslint": "^10.0.2",
|
|
29
|
+
"globals": "^17.4.0",
|
|
30
|
+
"prettier": "^3.8.1"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -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>
|