@adriankulik/create-fullstack-app 1.5.0 → 1.6.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/package.json +21 -4
- package/templates/backend/dotnet/lint.sh +1 -0
- package/templates/backend/dotnet/start.sh +1 -0
- package/templates/backend/dotnet/test.sh +1 -0
- package/templates/backend/fastapi/lint.sh +1 -0
- package/templates/backend/fastapi/requirements.txt +1 -1
- package/templates/backend/fastapi/start.sh +1 -0
- package/templates/backend/fastapi/test.sh +1 -0
- package/templates/backend/flask/lint.sh +1 -0
- package/templates/backend/flask/requirements.txt +1 -1
- package/templates/backend/flask/start.sh +1 -0
- package/templates/backend/flask/test.sh +1 -0
- package/templates/backend/nodejs/eslint.config.js +15 -0
- package/templates/backend/nodejs/lint.sh +1 -0
- package/templates/backend/nodejs/package-lock.json +1121 -2112
- package/templates/backend/nodejs/package.json +6 -6
- package/templates/backend/nodejs/start.sh +1 -0
- package/templates/backend/nodejs/test.sh +1 -0
- package/templates/base/.editorconfig +18 -0
- package/templates/base/.github/workflows/test.yml +26 -10
- package/templates/base/gitignore +4 -0
- package/templates/frontend/angular/angular.json +6 -0
- package/templates/frontend/angular/eslint.config.js +35 -0
- package/templates/frontend/angular/lint.sh +1 -0
- package/templates/frontend/angular/package-lock.json +1420 -488
- package/templates/frontend/angular/package.json +9 -2
- package/templates/frontend/angular/src/app/app.component.html +32 -0
- package/templates/frontend/angular/src/app/app.component.ts +12 -35
- package/templates/frontend/angular/start.sh +1 -0
- package/templates/frontend/angular/test.sh +1 -0
- package/templates/frontend/nextjs/__tests__/page.test.tsx +4 -4
- package/templates/frontend/nextjs/app/page.tsx +8 -2
- package/templates/frontend/nextjs/eslint.config.mjs +7 -0
- package/templates/frontend/nextjs/lint.sh +1 -0
- package/templates/frontend/nextjs/package-lock.json +1336 -872
- package/templates/frontend/nextjs/package.json +11 -10
- package/templates/frontend/nextjs/start.sh +1 -0
- package/templates/frontend/nextjs/test.sh +1 -0
- package/templates/frontend/nextjs/tsconfig.json +2 -1
- package/templates/frontend/svelte/eslint.config.js +29 -0
- package/templates/frontend/svelte/lint.sh +1 -0
- package/templates/frontend/svelte/package-lock.json +1676 -3482
- package/templates/frontend/svelte/package.json +14 -13
- package/templates/frontend/svelte/src/App.spec.ts +7 -7
- package/templates/frontend/svelte/src/App.svelte +14 -7
- package/templates/frontend/svelte/start.sh +1 -0
- package/templates/frontend/svelte/test.sh +1 -0
- package/templates/frontend/svelte/vite.config.ts +2 -2
- package/templates/frontend/vue/eslint.config.js +26 -0
- package/templates/frontend/vue/lint.sh +1 -0
- package/templates/frontend/vue/package-lock.json +1598 -2755
- package/templates/frontend/vue/package.json +13 -13
- package/templates/frontend/vue/src/App.vue +30 -9
- package/templates/frontend/vue/src/__tests__/App.spec.ts +4 -4
- package/templates/frontend/vue/start.sh +1 -0
- package/templates/frontend/vue/test.sh +1 -0
- package/templates/frontend/vue/tsconfig.json +13 -5
- package/templates/frontend/vue/vite.config.ts +0 -1
- package/cli/package-lock.json +0 -1338
- package/cli/package.json +0 -23
- package/templates/backend/nodejs/.eslintrc.json +0 -15
- package/templates/frontend/nextjs/.eslintrc.json +0 -3
- package/templates/frontend/svelte/.eslintrc.cjs +0 -27
- package/templates/frontend/vue/.eslintrc.cjs +0 -18
|
@@ -2,29 +2,29 @@
|
|
|
2
2
|
"name": "frontend-vue",
|
|
3
3
|
"version": "0.0.0",
|
|
4
4
|
"private": true,
|
|
5
|
+
"type": "module",
|
|
5
6
|
"scripts": {
|
|
6
7
|
"dev": "vite",
|
|
7
8
|
"build": "vite build",
|
|
8
9
|
"preview": "vite preview",
|
|
9
10
|
"test": "vitest run",
|
|
10
|
-
"lint": "eslint . --
|
|
11
|
+
"lint": "eslint . --fix"
|
|
11
12
|
},
|
|
12
13
|
"dependencies": {
|
|
13
14
|
"vue": "^3.5.33"
|
|
14
15
|
},
|
|
15
16
|
"devDependencies": {
|
|
16
|
-
"@
|
|
17
|
-
"@
|
|
18
|
-
"@vue/
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"eslint-plugin-vue": "^9.23.0",
|
|
24
|
-
"jsdom": "^24.0.0",
|
|
17
|
+
"@eslint/js": "^10.0.1",
|
|
18
|
+
"@vitejs/plugin-vue": "^6.0.6",
|
|
19
|
+
"@vue/test-utils": "^2.4.10",
|
|
20
|
+
"eslint": "^10.4.0",
|
|
21
|
+
"eslint-plugin-vue": "^10.9.1",
|
|
22
|
+
"globals": "^17.6.0",
|
|
23
|
+
"jsdom": "^29.1.1",
|
|
25
24
|
"prettier": "^3.2.5",
|
|
26
|
-
"typescript": "^5.
|
|
27
|
-
"
|
|
28
|
-
"
|
|
25
|
+
"typescript": "^5.9.0",
|
|
26
|
+
"typescript-eslint": "^8.59.3",
|
|
27
|
+
"vite": "^8.0.13",
|
|
28
|
+
"vitest": "^4.1.6"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ref } from 'vue'
|
|
3
3
|
|
|
4
|
+
interface MultiplyResponse {
|
|
5
|
+
result: number
|
|
6
|
+
}
|
|
7
|
+
|
|
4
8
|
const number = ref<string>('')
|
|
5
9
|
const result = ref<number | null>(null)
|
|
6
10
|
const error = ref<string | null>(null)
|
|
7
11
|
|
|
12
|
+
const apiUrl = import.meta.env.VITE_API_URL || 'http://localhost:8000'
|
|
13
|
+
|
|
8
14
|
const handleSubmit = async () => {
|
|
9
15
|
error.value = null
|
|
10
16
|
result.value = null
|
|
11
17
|
|
|
12
18
|
try {
|
|
13
|
-
const response = await fetch(
|
|
19
|
+
const response = await fetch(`${apiUrl}/api/multiply`, {
|
|
14
20
|
method: 'POST',
|
|
15
21
|
headers: {
|
|
16
22
|
'Content-Type': 'application/json',
|
|
@@ -22,7 +28,7 @@ const handleSubmit = async () => {
|
|
|
22
28
|
throw new Error('Network response was not ok')
|
|
23
29
|
}
|
|
24
30
|
|
|
25
|
-
const data = await response.json()
|
|
31
|
+
const data: MultiplyResponse = await response.json()
|
|
26
32
|
result.value = data.result
|
|
27
33
|
} catch (err: unknown) {
|
|
28
34
|
error.value = (err as Error).message
|
|
@@ -33,28 +39,43 @@ const handleSubmit = async () => {
|
|
|
33
39
|
<template>
|
|
34
40
|
<main style="padding: 2rem; font-family: sans-serif;">
|
|
35
41
|
<h1>Multiplier App (Vue)</h1>
|
|
36
|
-
<form
|
|
37
|
-
|
|
42
|
+
<form
|
|
43
|
+
style="margin-bottom: 1rem;"
|
|
44
|
+
@submit.prevent="handleSubmit"
|
|
45
|
+
>
|
|
46
|
+
<label
|
|
47
|
+
for="numberInput"
|
|
48
|
+
style="display: block; margin-bottom: 0.5rem;"
|
|
49
|
+
>
|
|
38
50
|
Enter a number:
|
|
39
51
|
</label>
|
|
40
52
|
<input
|
|
41
53
|
id="numberInput"
|
|
54
|
+
v-model="number"
|
|
42
55
|
type="number"
|
|
43
56
|
step="any"
|
|
44
|
-
v-model="number"
|
|
45
57
|
required
|
|
46
58
|
style="padding: 0.5rem; margin-right: 0.5rem;"
|
|
47
|
-
|
|
48
|
-
<button
|
|
59
|
+
>
|
|
60
|
+
<button
|
|
61
|
+
type="submit"
|
|
62
|
+
style="padding: 0.5rem 1rem;"
|
|
63
|
+
>
|
|
49
64
|
Multiply by 2
|
|
50
65
|
</button>
|
|
51
66
|
</form>
|
|
52
67
|
|
|
53
|
-
<div
|
|
68
|
+
<div
|
|
69
|
+
v-if="result !== null"
|
|
70
|
+
style="margin-top: 1rem; padding: 1rem; background-color: #e0ffe0; border: 1px solid #00cc00;"
|
|
71
|
+
>
|
|
54
72
|
<strong>Result:</strong> {{ result }}
|
|
55
73
|
</div>
|
|
56
74
|
|
|
57
|
-
<div
|
|
75
|
+
<div
|
|
76
|
+
v-if="error"
|
|
77
|
+
style="margin-top: 1rem; padding: 1rem; background-color: #ffe0e0; border: 1px solid #cc0000;"
|
|
78
|
+
>
|
|
58
79
|
<strong>Error:</strong> {{ error }}
|
|
59
80
|
</div>
|
|
60
81
|
</main>
|
|
@@ -2,16 +2,16 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'
|
|
|
2
2
|
import { mount } from '@vue/test-utils'
|
|
3
3
|
import App from '../App.vue'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
globalThis.fetch = vi.fn(() =>
|
|
6
6
|
Promise.resolve({
|
|
7
7
|
ok: true,
|
|
8
8
|
json: () => Promise.resolve({ result: 10 }),
|
|
9
|
-
})
|
|
10
|
-
)
|
|
9
|
+
} as unknown as Response)
|
|
10
|
+
) as typeof fetch
|
|
11
11
|
|
|
12
12
|
describe('App', () => {
|
|
13
13
|
beforeEach(() => {
|
|
14
|
-
fetch.mockClear()
|
|
14
|
+
(fetch as ReturnType<typeof vi.fn>).mockClear()
|
|
15
15
|
})
|
|
16
16
|
|
|
17
17
|
it('renders a heading', () => {
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
|
3
|
-
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
|
|
4
2
|
"compilerOptions": {
|
|
5
|
-
"
|
|
6
|
-
"
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"module": "ESNext",
|
|
7
6
|
"moduleResolution": "bundler",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"jsx": "preserve",
|
|
9
|
+
"resolveJsonModule": true,
|
|
10
|
+
"isolatedModules": true,
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
13
|
+
"skipLibCheck": true,
|
|
14
|
+
"noEmit": true,
|
|
8
15
|
"paths": {
|
|
9
16
|
"@/*": ["./src/*"]
|
|
10
17
|
}
|
|
11
|
-
}
|
|
18
|
+
},
|
|
19
|
+
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"]
|
|
12
20
|
}
|