@osdk/create-app 0.13.0-next-20240426195134 → 0.14.0-main-20240503113403
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/CHANGELOG.md +6 -3
- package/build/js/index.browser.mjs +517 -0
- package/build/js/index.browser.mjs.map +1 -0
- package/build/js/index.cjs +8 -2
- package/build/js/index.cjs.map +1 -1
- package/build/js/index.mjs +8 -2
- package/build/js/index.mjs.map +1 -1
- package/build/types/prompts/promptTemplate.d.ts.map +1 -1
- package/build/types/templates.d.ts +1 -0
- package/build/types/templates.d.ts.map +1 -1
- package/package.json +3 -1
- package/templates/template-next-static-export/package.json.hbs +1 -1
- package/templates/template-tutorial-todo-app/.eslintrc.cjs +18 -0
- package/templates/template-tutorial-todo-app/README.md.hbs +33 -0
- package/templates/template-tutorial-todo-app/index.html +13 -0
- package/templates/template-tutorial-todo-app/package.json.hbs +31 -0
- package/templates/template-tutorial-todo-app/public/todo-app.svg +4 -0
- package/templates/template-tutorial-todo-app/src/AuthCallback.tsx +24 -0
- package/templates/template-tutorial-todo-app/src/AuthenticatedRoute.tsx +33 -0
- package/templates/template-tutorial-todo-app/src/CreateProjectButton.tsx +33 -0
- package/templates/template-tutorial-todo-app/src/CreateProjectDialog.tsx +56 -0
- package/templates/template-tutorial-todo-app/src/CreateTaskButton.tsx.hbs +35 -0
- package/templates/template-tutorial-todo-app/src/CreateTaskDialog.tsx.hbs +52 -0
- package/templates/template-tutorial-todo-app/src/DeleteProjectButton.tsx.hbs +34 -0
- package/templates/template-tutorial-todo-app/src/DeleteProjectDialog.tsx.hbs +46 -0
- package/templates/template-tutorial-todo-app/src/Dialog.module.css +5 -0
- package/templates/template-tutorial-todo-app/src/Dialog.tsx +19 -0
- package/templates/template-tutorial-todo-app/src/Home.module.css +35 -0
- package/templates/template-tutorial-todo-app/src/Home.tsx.hbs +62 -0
- package/templates/template-tutorial-todo-app/src/Layout.module.css +16 -0
- package/templates/template-tutorial-todo-app/src/Layout.tsx +21 -0
- package/templates/template-tutorial-todo-app/src/Login.module.css +5 -0
- package/templates/template-tutorial-todo-app/src/Login.tsx +42 -0
- package/templates/template-tutorial-todo-app/src/ProjectSelect.tsx.hbs +40 -0
- package/templates/template-tutorial-todo-app/src/TaskList.module.css +6 -0
- package/templates/template-tutorial-todo-app/src/TaskList.tsx.hbs +38 -0
- package/templates/template-tutorial-todo-app/src/TaskListItem.module.css +3 -0
- package/templates/template-tutorial-todo-app/src/TaskListItem.tsx.hbs +37 -0
- package/templates/template-tutorial-todo-app/src/client.ts.hbs +31 -0
- package/templates/template-tutorial-todo-app/src/index.css +73 -0
- package/templates/template-tutorial-todo-app/src/main.tsx +33 -0
- package/templates/template-tutorial-todo-app/src/mocks.ts.hbs +208 -0
- package/templates/template-tutorial-todo-app/src/useProjectTasks.ts.hbs +59 -0
- package/templates/template-tutorial-todo-app/src/useProjects.ts.hbs +44 -0
- package/templates/template-tutorial-todo-app/src/vite-env.d.ts +1 -0
- package/templates/template-tutorial-todo-app/tsconfig.json +25 -0
- package/templates/template-tutorial-todo-app/tsconfig.node.json +10 -0
- package/templates/template-tutorial-todo-app/vite.config.ts.hbs +19 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FoundryClient, PublicClientAuth } from "{{osdkPackage}}";
|
|
2
|
+
|
|
3
|
+
const url = import.meta.env.VITE_FOUNDRY_API_URL;
|
|
4
|
+
const clientId = import.meta.env.VITE_FOUNDRY_CLIENT_ID;
|
|
5
|
+
const redirectUrl = import.meta.env.VITE_FOUNDRY_REDIRECT_URL;
|
|
6
|
+
checkEnv(url, "VITE_FOUNDRY_API_URL");
|
|
7
|
+
checkEnv(clientId, "VITE_FOUNDRY_CLIENT_ID");
|
|
8
|
+
checkEnv(redirectUrl, "VITE_FOUNDRY_REDIRECT_URL");
|
|
9
|
+
|
|
10
|
+
function checkEnv(
|
|
11
|
+
value: string | undefined,
|
|
12
|
+
name: string,
|
|
13
|
+
): asserts value is string {
|
|
14
|
+
if (value == null) {
|
|
15
|
+
throw new Error(`Missing environment variable: ${name}`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Initialize the client to interact with the Ontology SDK
|
|
21
|
+
*/
|
|
22
|
+
const client = new FoundryClient({
|
|
23
|
+
url,
|
|
24
|
+
auth: new PublicClientAuth({
|
|
25
|
+
clientId,
|
|
26
|
+
url,
|
|
27
|
+
redirectUrl,
|
|
28
|
+
}),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export default client;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
|
3
|
+
line-height: 1.5;
|
|
4
|
+
font-weight: 400;
|
|
5
|
+
|
|
6
|
+
color-scheme: light dark;
|
|
7
|
+
color: rgba(255, 255, 255, 0.87);
|
|
8
|
+
background-color: #242424;
|
|
9
|
+
|
|
10
|
+
font-synthesis: none;
|
|
11
|
+
text-rendering: optimizeLegibility;
|
|
12
|
+
-webkit-font-smoothing: antialiased;
|
|
13
|
+
-moz-osx-font-smoothing: grayscale;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
#root {
|
|
17
|
+
max-width: 1280px;
|
|
18
|
+
margin: 2rem auto;
|
|
19
|
+
padding: 2rem;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
a {
|
|
23
|
+
font-weight: 500;
|
|
24
|
+
color: #646cff;
|
|
25
|
+
text-decoration: inherit;
|
|
26
|
+
}
|
|
27
|
+
a:hover {
|
|
28
|
+
color: #535bf2;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
body {
|
|
32
|
+
margin: 0;
|
|
33
|
+
display: flex;
|
|
34
|
+
min-width: 320px;
|
|
35
|
+
min-height: 100vh;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
h1 {
|
|
39
|
+
font-size: 3.2em;
|
|
40
|
+
line-height: 1.1;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
button {
|
|
44
|
+
border-radius: 8px;
|
|
45
|
+
border: 1px solid transparent;
|
|
46
|
+
padding: 0.6em 1.2em;
|
|
47
|
+
font-size: 1em;
|
|
48
|
+
font-weight: 500;
|
|
49
|
+
font-family: inherit;
|
|
50
|
+
background-color: #1a1a1a;
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
transition: border-color 0.25s;
|
|
53
|
+
}
|
|
54
|
+
button:hover {
|
|
55
|
+
border-color: #646cff;
|
|
56
|
+
}
|
|
57
|
+
button:focus,
|
|
58
|
+
button:focus-visible {
|
|
59
|
+
outline: 4px auto -webkit-focus-ring-color;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@media (prefers-color-scheme: light) {
|
|
63
|
+
:root {
|
|
64
|
+
color: #213547;
|
|
65
|
+
background-color: #ffffff;
|
|
66
|
+
}
|
|
67
|
+
a:hover {
|
|
68
|
+
color: #747bff;
|
|
69
|
+
}
|
|
70
|
+
button {
|
|
71
|
+
background-color: #f9f9f9;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import ReactDOM from "react-dom/client";
|
|
2
|
+
import { createBrowserRouter, RouterProvider } from "react-router-dom";
|
|
3
|
+
import AuthCallback from "./AuthCallback";
|
|
4
|
+
import AuthenticatedRoute from "./AuthenticatedRoute";
|
|
5
|
+
import Home from "./Home";
|
|
6
|
+
import Login from "./Login";
|
|
7
|
+
import "./index.css";
|
|
8
|
+
|
|
9
|
+
const router = createBrowserRouter([
|
|
10
|
+
{
|
|
11
|
+
path: "/",
|
|
12
|
+
element: <AuthenticatedRoute />,
|
|
13
|
+
children: [
|
|
14
|
+
{
|
|
15
|
+
path: "/",
|
|
16
|
+
element: <Home />,
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
path: "/login",
|
|
22
|
+
element: <Login />,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
// This is the route defined in your application's redirect URL
|
|
26
|
+
path: "/auth/callback",
|
|
27
|
+
element: <AuthCallback />,
|
|
28
|
+
},
|
|
29
|
+
]);
|
|
30
|
+
|
|
31
|
+
ReactDOM.createRoot(document.getElementById("root")!).render(
|
|
32
|
+
<RouterProvider router={router} />,
|
|
33
|
+
);
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { OsdkTodoProject, OsdkTodoTask } from "{{osdkPackage}}/ontology/objects";
|
|
2
|
+
import { LocalDate } from "{{osdkPackage}}";
|
|
3
|
+
|
|
4
|
+
interface MockProject {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
tasks: MockTask[];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface MockTask {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const projects: MockProject[] = [
|
|
16
|
+
{
|
|
17
|
+
id: "1",
|
|
18
|
+
name: "Fake Project",
|
|
19
|
+
tasks: [
|
|
20
|
+
{
|
|
21
|
+
id: "1",
|
|
22
|
+
name: "Try to",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: "2",
|
|
26
|
+
name: "Implement this",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "3",
|
|
30
|
+
name: "With the Ontology SDK!",
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: "2",
|
|
36
|
+
name: "Yet Another Fake Project",
|
|
37
|
+
tasks: [
|
|
38
|
+
{
|
|
39
|
+
id: "4",
|
|
40
|
+
name: "More tasks here",
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
async function delay(): Promise<void> {
|
|
47
|
+
return new Promise((resolve) =>
|
|
48
|
+
setTimeout(() => resolve(), 500 + Math.random() * 1000)
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Good enough random id for mocks
|
|
53
|
+
function randomId(): string {
|
|
54
|
+
return `${Math.floor(Math.random() * 2 ** 31)}`;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function getProjects(): Promise<OsdkTodoProject[]> {
|
|
58
|
+
await delay();
|
|
59
|
+
const result = [...projects];
|
|
60
|
+
result.sort((p1, p2) => p1.name.localeCompare(p2.name));
|
|
61
|
+
return result.map(project);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async function createProject({
|
|
65
|
+
name,
|
|
66
|
+
}: {
|
|
67
|
+
name: string;
|
|
68
|
+
}): Promise<OsdkTodoProject["__primaryKey"]> {
|
|
69
|
+
await delay();
|
|
70
|
+
const id = randomId();
|
|
71
|
+
projects.push({ id, name, tasks: [] });
|
|
72
|
+
return id;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async function deleteProject(id: string): Promise<void> {
|
|
76
|
+
await delay();
|
|
77
|
+
const idx = projects.findIndex((p) => p.id === id);
|
|
78
|
+
if (idx !== -1) {
|
|
79
|
+
projects.splice(idx, 1);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
async function createTask({
|
|
84
|
+
name,
|
|
85
|
+
projectId,
|
|
86
|
+
}: {
|
|
87
|
+
name: string;
|
|
88
|
+
projectId: string;
|
|
89
|
+
}): Promise<OsdkTodoTask["__primaryKey"]> {
|
|
90
|
+
await delay();
|
|
91
|
+
const project = projects.find((p) => p.id === projectId);
|
|
92
|
+
if (project == null) {
|
|
93
|
+
throw new Error(`Project ${projectId} not found!`);
|
|
94
|
+
}
|
|
95
|
+
const id = randomId();
|
|
96
|
+
project.tasks.unshift({ id, name });
|
|
97
|
+
return id;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
async function deleteTask(id: string): Promise<void> {
|
|
101
|
+
await delay();
|
|
102
|
+
for (const project of projects) {
|
|
103
|
+
const idx = project.tasks.findIndex((t) => t.id === id);
|
|
104
|
+
if (idx !== -1) {
|
|
105
|
+
project.tasks.splice(idx, 1);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function project(mockProject: MockProject): OsdkTodoProject {
|
|
111
|
+
return {
|
|
112
|
+
__apiName: "OsdkTodoProject",
|
|
113
|
+
__primaryKey: mockProject.id,
|
|
114
|
+
__rid: `${mockProject.id}`,
|
|
115
|
+
$apiName: "OsdkTodoProject",
|
|
116
|
+
$primaryKey: mockProject.id,
|
|
117
|
+
$rid: `${mockProject.id}`,
|
|
118
|
+
id: mockProject.id,
|
|
119
|
+
name: mockProject.name,
|
|
120
|
+
osdkTodoTasks: {
|
|
121
|
+
all: async () => ({
|
|
122
|
+
type: "ok",
|
|
123
|
+
value: mockProject.tasks.map((mockTask) => task(mockProject, mockTask)),
|
|
124
|
+
}),
|
|
125
|
+
get: async () => ({
|
|
126
|
+
type: "error",
|
|
127
|
+
error: {
|
|
128
|
+
errorType: "UNKNOWN",
|
|
129
|
+
errorName: "UnknownError",
|
|
130
|
+
originalError: "",
|
|
131
|
+
name: "Error",
|
|
132
|
+
message: "Not implemented!",
|
|
133
|
+
},
|
|
134
|
+
}),
|
|
135
|
+
page: async () => ({
|
|
136
|
+
type: "error",
|
|
137
|
+
error: {
|
|
138
|
+
errorType: "UNKNOWN",
|
|
139
|
+
errorName: "UnknownError",
|
|
140
|
+
originalError: "",
|
|
141
|
+
name: "Error",
|
|
142
|
+
message: "Not implemented!",
|
|
143
|
+
},
|
|
144
|
+
}),
|
|
145
|
+
asyncIter: () => {
|
|
146
|
+
throw new Error("Function not implemented.");
|
|
147
|
+
},
|
|
148
|
+
fetchPage: () => {
|
|
149
|
+
throw new Error("Function not implemented.");
|
|
150
|
+
},
|
|
151
|
+
fetchPageWithErrors: () => {
|
|
152
|
+
throw new Error("Function not implemented.");
|
|
153
|
+
},
|
|
154
|
+
fetchOneWithErrors: () => {
|
|
155
|
+
throw new Error("Function not implemented.");
|
|
156
|
+
},
|
|
157
|
+
fetchOne: () => {
|
|
158
|
+
throw new Error("Function not implemented.");
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
budget: undefined,
|
|
162
|
+
description: undefined,
|
|
163
|
+
document: undefined,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function task(mockProject: MockProject, mockTask: MockTask): OsdkTodoTask {
|
|
168
|
+
return {
|
|
169
|
+
__apiName: "OsdkTodoTask",
|
|
170
|
+
__primaryKey: mockTask.id,
|
|
171
|
+
__rid: `${mockTask.id}`,
|
|
172
|
+
$apiName: "OsdkTodoTask",
|
|
173
|
+
$primaryKey: mockTask.id,
|
|
174
|
+
$rid: `${mockTask.id}`,
|
|
175
|
+
id: mockTask.id,
|
|
176
|
+
title: mockTask.name,
|
|
177
|
+
startDate: LocalDate.now(),
|
|
178
|
+
dueDate: LocalDate.now().plusWeeks(1),
|
|
179
|
+
status: "IN PROGRESS",
|
|
180
|
+
projectId: mockProject.id,
|
|
181
|
+
osdkTodoProject: {
|
|
182
|
+
get: async () => ({
|
|
183
|
+
type: "ok",
|
|
184
|
+
value: project(mockProject),
|
|
185
|
+
}),
|
|
186
|
+
fetchOneWithErrors: () => {
|
|
187
|
+
throw new Error("Function not implemented.");
|
|
188
|
+
},
|
|
189
|
+
fetchOne: () => {
|
|
190
|
+
throw new Error("Function not implemented.");
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
description: undefined,
|
|
194
|
+
assignedTo: undefined,
|
|
195
|
+
createdAt: undefined,
|
|
196
|
+
createdBy: undefined,
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const Mocks = {
|
|
201
|
+
getProjects,
|
|
202
|
+
createProject,
|
|
203
|
+
deleteProject,
|
|
204
|
+
createTask,
|
|
205
|
+
deleteTask,
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
export default Mocks;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { OsdkTodoProject, OsdkTodoTask } from "{{osdkPackage}}/ontology/objects";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import useSWR from "swr";
|
|
4
|
+
import Mocks from "./mocks";
|
|
5
|
+
|
|
6
|
+
export function useProjectTasks(project: OsdkTodoProject | undefined) {
|
|
7
|
+
const { data, isLoading, isValidating, error, mutate } = useSWR<OsdkTodoTask[]>(
|
|
8
|
+
project != null ? `projects/${project.id}/tasks` : null,
|
|
9
|
+
async () => {
|
|
10
|
+
if (project == null) {
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
13
|
+
const result = await project.osdkTodoTasks.all();
|
|
14
|
+
if (result.type !== "ok") {
|
|
15
|
+
throw result.error;
|
|
16
|
+
}
|
|
17
|
+
return result.value;
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const createTask: (
|
|
22
|
+
name: string
|
|
23
|
+
) => Promise<OsdkTodoTask["__primaryKey"] | undefined> = useCallback(
|
|
24
|
+
async (name) => {
|
|
25
|
+
if (project == null) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
// Try to implement this with the Ontology SDK!
|
|
29
|
+
const id = await Mocks.createTask({
|
|
30
|
+
name,
|
|
31
|
+
projectId: project.__primaryKey,
|
|
32
|
+
});
|
|
33
|
+
await mutate();
|
|
34
|
+
return id;
|
|
35
|
+
},
|
|
36
|
+
[project, mutate]
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
const deleteTask: (task: OsdkTodoTask) => Promise<void> = useCallback(
|
|
40
|
+
async (task) => {
|
|
41
|
+
if (project == null) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
// Try to implement this with the Ontology SDK!
|
|
45
|
+
await Mocks.deleteTask(task.__primaryKey);
|
|
46
|
+
await mutate();
|
|
47
|
+
},
|
|
48
|
+
[project, mutate]
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
tasks: data,
|
|
53
|
+
isLoading,
|
|
54
|
+
isValidating,
|
|
55
|
+
isError: error,
|
|
56
|
+
createTask,
|
|
57
|
+
deleteTask,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { OsdkTodoProject } from "{{osdkPackage}}/ontology/objects";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import useSWR from "swr";
|
|
4
|
+
import Mocks from "./mocks";
|
|
5
|
+
|
|
6
|
+
function useProjects() {
|
|
7
|
+
const { data, isLoading, isValidating, error, mutate } = useSWR<
|
|
8
|
+
OsdkTodoProject[]
|
|
9
|
+
>("projects", async () => {
|
|
10
|
+
// Try to implement this with the Ontology SDK!
|
|
11
|
+
return Mocks.getProjects();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const createProject: (name: string) => Promise<OsdkTodoProject["__primaryKey"]> =
|
|
15
|
+
useCallback(
|
|
16
|
+
async (name) => {
|
|
17
|
+
// Try to implement this with the Ontology SDK!
|
|
18
|
+
const id = await Mocks.createProject({ name });
|
|
19
|
+
await mutate();
|
|
20
|
+
return id;
|
|
21
|
+
},
|
|
22
|
+
[mutate]
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const deleteProject: (project: OsdkTodoProject) => Promise<void> = useCallback(
|
|
26
|
+
async (project) => {
|
|
27
|
+
// Try to implement this with the Ontology SDK!
|
|
28
|
+
await Mocks.deleteProject(project.__primaryKey);
|
|
29
|
+
await mutate();
|
|
30
|
+
},
|
|
31
|
+
[mutate]
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
projects: data,
|
|
36
|
+
isLoading,
|
|
37
|
+
isValidating,
|
|
38
|
+
isError: error,
|
|
39
|
+
createProject,
|
|
40
|
+
deleteProject,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default useProjects;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
"jsx": "react-jsx",
|
|
16
|
+
|
|
17
|
+
/* Linting */
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true
|
|
22
|
+
},
|
|
23
|
+
"include": ["src"],
|
|
24
|
+
"references": [{ "path": "./tsconfig.node.json" }]
|
|
25
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import react from "@vitejs/plugin-react";
|
|
2
|
+
import { defineConfig } from "vite";
|
|
3
|
+
|
|
4
|
+
// https://vitejs.dev/config/
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
plugins: [react()],
|
|
7
|
+
server: {
|
|
8
|
+
port: 8080,
|
|
9
|
+
{{#if corsProxy}}
|
|
10
|
+
proxy: {
|
|
11
|
+
"^(/multipass/api|/api)": {
|
|
12
|
+
target: "{{foundryUrl}}",
|
|
13
|
+
changeOrigin: true,
|
|
14
|
+
secure: true,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
{{/if}}
|
|
18
|
+
},
|
|
19
|
+
});
|