create-vatts-app 1.0.1 → 1.1.0-alpha.1
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/dist/cli.js +25 -1
- package/dist/createApp.js +2 -1
- package/dist/packageJson.d.ts +1 -1
- package/dist/packageJson.js +52 -16
- package/dist/steps/createExampleRoutes.js +13 -4
- package/dist/steps/createProject.js +2 -1
- package/dist/steps/createProjectStructure.js +6 -1
- package/dist/templates.d.ts +2 -0
- package/dist/templates.js +139 -2
- package/dist/types.d.ts +2 -0
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -37,6 +37,10 @@ function parseArgs(argv) {
|
|
|
37
37
|
const examplesFlag = args.includes("--examples");
|
|
38
38
|
const noAliasFlag = args.includes("--no-alias");
|
|
39
39
|
const aliasValue = readArgValue(args, "--alias");
|
|
40
|
+
const pathRouterFlag = args.includes("--path-router") || args.includes("-p");
|
|
41
|
+
const noPathRouterFlag = args.includes("--no-path-router");
|
|
42
|
+
const reactFlag = args.includes("--react");
|
|
43
|
+
const vueFlag = args.includes("--vue");
|
|
40
44
|
return {
|
|
41
45
|
appName,
|
|
42
46
|
tailwind: tailwindFlag ? true : undefined,
|
|
@@ -45,6 +49,9 @@ function parseArgs(argv) {
|
|
|
45
49
|
install: noInstallFlag ? false : installFlag ? true : undefined,
|
|
46
50
|
moduleAlias: noAliasFlag ? false : aliasValue ? true : undefined,
|
|
47
51
|
alias: aliasValue ? normalizeAliasPrefix(aliasValue) : undefined,
|
|
52
|
+
pathRouter: pathRouterFlag ? true : noPathRouterFlag ? false : undefined,
|
|
53
|
+
typeScript: args.includes("--typescript") || args.includes("-ts") ? true : undefined,
|
|
54
|
+
framework: reactFlag ? 'react' : vueFlag ? 'vue' : undefined
|
|
48
55
|
};
|
|
49
56
|
}
|
|
50
57
|
async function promptForMissingOptions(opts) {
|
|
@@ -58,6 +65,21 @@ async function promptForMissingOptions(opts) {
|
|
|
58
65
|
typescript = await console_1.default.confirm("Do you want to use typescript?", true);
|
|
59
66
|
console.log(" ");
|
|
60
67
|
}
|
|
68
|
+
let framework = opts.framework;
|
|
69
|
+
async function askFramework() {
|
|
70
|
+
const frame = await console_1.default.ask("What framework do you want to use? (React/Vue)", 'react');
|
|
71
|
+
console.log('');
|
|
72
|
+
if (frame.toLowerCase() !== 'react' && frame.toLowerCase() !== 'vue') {
|
|
73
|
+
return await askFramework();
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
return frame;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (framework === undefined) {
|
|
80
|
+
// @ts-ignore
|
|
81
|
+
framework = await askFramework();
|
|
82
|
+
}
|
|
61
83
|
let tailwind = opts.tailwind;
|
|
62
84
|
if (tailwind === undefined) {
|
|
63
85
|
tailwind = await console_1.default.confirm("Do you want to include Tailwind CSS?", true);
|
|
@@ -103,6 +125,8 @@ async function promptForMissingOptions(opts) {
|
|
|
103
125
|
moduleAlias,
|
|
104
126
|
alias,
|
|
105
127
|
pathRouter,
|
|
106
|
-
typeScript: typescript
|
|
128
|
+
typeScript: typescript,
|
|
129
|
+
// @ts-ignore
|
|
130
|
+
framework
|
|
107
131
|
};
|
|
108
132
|
}
|
package/dist/createApp.js
CHANGED
|
@@ -67,7 +67,8 @@ async function createApp(options) {
|
|
|
67
67
|
vattsVersion: ownPkg.version,
|
|
68
68
|
packageJson: {},
|
|
69
69
|
pathRouter: resolved.pathRouter,
|
|
70
|
-
typeScript: resolved.typeScript
|
|
70
|
+
typeScript: resolved.typeScript,
|
|
71
|
+
framework: resolved.framework
|
|
71
72
|
};
|
|
72
73
|
console.clear();
|
|
73
74
|
for (const step of steps_1.steps) {
|
package/dist/packageJson.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { CreateAppContext } from "./types";
|
|
2
|
-
export declare function buildPackageJson(ctx: Pick<CreateAppContext, "appName" | "vattsVersion" | "willTailwind" | "typeScript">): Promise<any>;
|
|
2
|
+
export declare function buildPackageJson(ctx: Pick<CreateAppContext, "appName" | "vattsVersion" | "willTailwind" | "typeScript" | "framework">): Promise<any>;
|
package/dist/packageJson.js
CHANGED
|
@@ -6,19 +6,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.buildPackageJson = buildPackageJson;
|
|
7
7
|
const console_1 = __importDefault(require("vatts/console"));
|
|
8
8
|
async function buildPackageJson(ctx) {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
// Função genérica para pegar a versão mais recente de qualquer pacote
|
|
10
|
+
async function getLatest(pkg, fallback) {
|
|
11
11
|
try {
|
|
12
|
-
const response = await fetch(
|
|
12
|
+
const response = await fetch(`https://registry.npmjs.org/${pkg}/latest`);
|
|
13
13
|
const data = await response.json();
|
|
14
14
|
return data.version;
|
|
15
15
|
}
|
|
16
16
|
catch (error) {
|
|
17
|
-
console_1.default.error(
|
|
18
|
-
return
|
|
17
|
+
console_1.default.error(`Could not check for the latest ${pkg} version:`, error);
|
|
18
|
+
return fallback;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
// Busca o Vatts e o @types/node em paralelo
|
|
22
|
+
const [version, typesNodeVersion] = await Promise.all([
|
|
23
|
+
getLatest('vatts', ctx.vattsVersion),
|
|
24
|
+
getLatest('@types/node', '20.11.0') // Adicionado @types/node
|
|
25
|
+
]);
|
|
22
26
|
const packageJson = {
|
|
23
27
|
name: ctx.appName,
|
|
24
28
|
version: "0.1.0",
|
|
@@ -28,31 +32,63 @@ async function buildPackageJson(ctx) {
|
|
|
28
32
|
dev: "vatts dev",
|
|
29
33
|
},
|
|
30
34
|
dependencies: {
|
|
31
|
-
vatts: `^${version}
|
|
32
|
-
react: "^19.2.3",
|
|
33
|
-
"react-dom": "^19.2.3"
|
|
35
|
+
vatts: `^${version}`
|
|
34
36
|
},
|
|
35
37
|
devDependencies: {
|
|
36
|
-
"@types/
|
|
38
|
+
"@types/node": `^${typesNodeVersion}` // Inserido aqui
|
|
37
39
|
},
|
|
38
40
|
};
|
|
41
|
+
if (ctx.framework === 'react') {
|
|
42
|
+
// Busca as dependências do React em paralelo
|
|
43
|
+
const [reactVer, reactDomVer, typesReactVer] = await Promise.all([
|
|
44
|
+
getLatest('react', '19.2.3'),
|
|
45
|
+
getLatest('react-dom', '19.2.3'),
|
|
46
|
+
getLatest('@types/react', '19.2.8')
|
|
47
|
+
]);
|
|
48
|
+
packageJson.dependencies = {
|
|
49
|
+
...packageJson.devDependencies,
|
|
50
|
+
react: `^${reactVer}`,
|
|
51
|
+
"react-dom": `^${reactDomVer}`
|
|
52
|
+
};
|
|
53
|
+
packageJson.devDependencies = {
|
|
54
|
+
...packageJson.devDependencies,
|
|
55
|
+
"@types/react": `^${typesReactVer}`,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
else if (ctx.framework === 'vue') {
|
|
59
|
+
const vueVer = await getLatest('vue', '3.5.27');
|
|
60
|
+
packageJson.dependencies = {
|
|
61
|
+
...packageJson.dependencies,
|
|
62
|
+
"vue": `^${vueVer}`
|
|
63
|
+
};
|
|
64
|
+
}
|
|
39
65
|
if (ctx.typeScript) {
|
|
66
|
+
const [tsVer, tsNodeVer] = await Promise.all([
|
|
67
|
+
getLatest('typescript', '5.9.3'),
|
|
68
|
+
getLatest('ts-node', '10.9.2')
|
|
69
|
+
]);
|
|
40
70
|
packageJson.devDependencies = {
|
|
41
71
|
...packageJson.devDependencies,
|
|
42
|
-
typescript:
|
|
72
|
+
typescript: `^${tsVer}`,
|
|
43
73
|
};
|
|
44
74
|
packageJson.dependencies = {
|
|
45
75
|
...packageJson.dependencies,
|
|
46
|
-
"ts-node":
|
|
76
|
+
"ts-node": `^${tsNodeVer}`,
|
|
47
77
|
};
|
|
48
78
|
}
|
|
49
79
|
if (ctx.willTailwind) {
|
|
80
|
+
const [tailwindVer, tailwindPostcssVer, postcssVer, autoprefixerVer] = await Promise.all([
|
|
81
|
+
getLatest('tailwindcss', '4.1.18'),
|
|
82
|
+
getLatest('@tailwindcss/postcss', '4.1.18'),
|
|
83
|
+
getLatest('postcss', '8.5.6'),
|
|
84
|
+
getLatest('autoprefixer', '10.4.23')
|
|
85
|
+
]);
|
|
50
86
|
packageJson.dependencies = {
|
|
51
87
|
...packageJson.dependencies,
|
|
52
|
-
tailwindcss:
|
|
53
|
-
"@tailwindcss/postcss":
|
|
54
|
-
postcss:
|
|
55
|
-
autoprefixer:
|
|
88
|
+
tailwindcss: `^${tailwindVer}`,
|
|
89
|
+
"@tailwindcss/postcss": `^${tailwindPostcssVer}`,
|
|
90
|
+
postcss: `^${postcssVer}`,
|
|
91
|
+
autoprefixer: `^${autoprefixerVer}`,
|
|
56
92
|
};
|
|
57
93
|
}
|
|
58
94
|
return packageJson;
|
|
@@ -43,11 +43,20 @@ const fs_1 = require("../fs");
|
|
|
43
43
|
const templates_1 = require("../templates");
|
|
44
44
|
async function createExampleRoutes(ctx) {
|
|
45
45
|
const dynamic = console_1.default.dynamicLine("Creating example routes...");
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
if (ctx.framework === 'react') {
|
|
47
|
+
let pathResolve = path.join(ctx.rootDir, "src", "web", "routes", `index.${ctx.typeScript ? 'tsx' : 'jsx'}`);
|
|
48
|
+
if (ctx.pathRouter) {
|
|
49
|
+
pathResolve = path.join(ctx.rootDir, "src", "web", `page.${ctx.typeScript ? 'tsx' : 'jsx'}`);
|
|
50
|
+
}
|
|
51
|
+
(0, fs_1.writeFile)(pathResolve, (0, templates_1.webIndexRouteTemplate)(ctx.willTailwind, ctx.pathRouter, ctx.typeScript));
|
|
52
|
+
}
|
|
53
|
+
else if (ctx.framework === 'vue') {
|
|
54
|
+
let pathResolve = path.join(ctx.rootDir, "src", "web", "routes", `index.vue`);
|
|
55
|
+
if (ctx.pathRouter) {
|
|
56
|
+
pathResolve = path.join(ctx.rootDir, "src", "web", `page.vue`);
|
|
57
|
+
}
|
|
58
|
+
(0, fs_1.writeFile)(pathResolve, (0, templates_1.vueExampleRoute)(ctx.typeScript, ctx.pathRouter, ctx.willTailwind));
|
|
49
59
|
}
|
|
50
|
-
(0, fs_1.writeFile)(pathResolve, (0, templates_1.webIndexRouteTemplate)(ctx.willTailwind, ctx.pathRouter, ctx.typeScript));
|
|
51
60
|
(0, fs_1.writeFile)(path.join(ctx.rootDir, "src", "backend", "routes", `Example.${ctx.typeScript ? 'ts' : 'js'}`), (0, templates_1.backendExampleRouteTemplate)(ctx.typeScript));
|
|
52
61
|
dynamic.end("Example routes created.");
|
|
53
62
|
}
|
|
@@ -48,7 +48,8 @@ async function createProject(ctx) {
|
|
|
48
48
|
appName: ctx.appName,
|
|
49
49
|
vattsVersion: ctx.vattsVersion,
|
|
50
50
|
willTailwind: ctx.willTailwind,
|
|
51
|
-
typeScript: ctx.typeScript
|
|
51
|
+
typeScript: ctx.typeScript,
|
|
52
|
+
framework: ctx.framework
|
|
52
53
|
});
|
|
53
54
|
(0, fs_1.writeJson)(path.join(ctx.rootDir, "package.json"), ctx.packageJson);
|
|
54
55
|
dynamic.end("Created project directory and package.json");
|
|
@@ -51,6 +51,11 @@ async function createProjectStructure(ctx) {
|
|
|
51
51
|
(0, fs_1.ensureDir)(path.join(ctx.rootDir, "src", "web"));
|
|
52
52
|
}
|
|
53
53
|
(0, fs_1.writeFile)(path.join(ctx.rootDir, "src", "web", "globals.css"), (0, templates_1.globalsCssTemplate)(ctx.willTailwind));
|
|
54
|
-
|
|
54
|
+
if (ctx.framework === 'react') {
|
|
55
|
+
(0, fs_1.writeFile)(path.join(ctx.rootDir, "src", "web", `layout.${ctx.typeScript ? 'tsx' : 'jsx'}`), ctx.typeScript ? (0, templates_1.layoutTsxTemplate)() : (0, templates_1.layoutJsxTemplate)());
|
|
56
|
+
}
|
|
57
|
+
else if (ctx.framework === 'vue') {
|
|
58
|
+
(0, fs_1.writeFile)(path.join(ctx.rootDir, "src", "web", `layout.vue`), (0, templates_1.vueExampleLayout)(ctx.typeScript));
|
|
59
|
+
}
|
|
55
60
|
dynamic.end("Created project structure");
|
|
56
61
|
}
|
package/dist/templates.d.ts
CHANGED
|
@@ -9,3 +9,5 @@ export declare function postcssConfigTemplate(): string;
|
|
|
9
9
|
export declare function tailwindConfigTemplate(): string;
|
|
10
10
|
export declare function webIndexRouteTemplate(willTailwind: boolean, pathRouter: boolean, typescript: boolean): string;
|
|
11
11
|
export declare function backendExampleRouteTemplate(typescript: boolean): "import {VattsResponse} from \"vatts\"\n\nconst ExampleRoute = {\n pattern: '/api/example',\n GET(request, params) {\n return VattsResponse.json({\n message: 'Welcome to the Example API!'\n })\n },\n POST: async (request, params) => {\n const data = await request.json();\n return VattsResponse.json({\n message: 'POST request received at Example API!',\n body: data\n })\n }\n};\n\nexport default ExampleRoute;" | "import {BackendRouteConfig, VattsRequest, VattsResponse} from \"vatts\"\n\nconst ExampleRoute: BackendRouteConfig = {\n pattern: '/api/example',\n GET(request: VattsRequest, params) {\n return VattsResponse.json({\n message: 'Welcome to the Example API!'\n })\n },\n POST: async (request: VattsRequest, params) => {\n const data = await request.json();\n return VattsResponse.json({\n message: 'POST request received at Example API!',\n body: data\n })\n }\n};\n\nexport default ExampleRoute;";
|
|
12
|
+
export declare function vueExampleRoute(typescript: boolean, pathRouter: boolean, tailwind: boolean): string;
|
|
13
|
+
export declare function vueExampleLayout(typescript: boolean): string;
|
package/dist/templates.js
CHANGED
|
@@ -9,6 +9,8 @@ exports.postcssConfigTemplate = postcssConfigTemplate;
|
|
|
9
9
|
exports.tailwindConfigTemplate = tailwindConfigTemplate;
|
|
10
10
|
exports.webIndexRouteTemplate = webIndexRouteTemplate;
|
|
11
11
|
exports.backendExampleRouteTemplate = backendExampleRouteTemplate;
|
|
12
|
+
exports.vueExampleRoute = vueExampleRoute;
|
|
13
|
+
exports.vueExampleLayout = vueExampleLayout;
|
|
12
14
|
function globalsCssTemplate(willTailwind) {
|
|
13
15
|
// even without tailwind, leave empty file to avoid import errors
|
|
14
16
|
return willTailwind ? `@import "tailwindcss";\n` : `body {
|
|
@@ -98,7 +100,7 @@ function tsconfigTemplate(opts) {
|
|
|
98
100
|
: "";
|
|
99
101
|
return `{
|
|
100
102
|
"compilerOptions": {
|
|
101
|
-
"target": "
|
|
103
|
+
"target": "ESNext",
|
|
102
104
|
"module": "NodeNext",
|
|
103
105
|
"jsx": "react-jsx",
|
|
104
106
|
"strict": true,
|
|
@@ -110,7 +112,7 @@ function tsconfigTemplate(opts) {
|
|
|
110
112
|
"rootDir": "./src",
|
|
111
113
|
"outDir": "./dist",
|
|
112
114
|
"moduleResolution": "nodenext",
|
|
113
|
-
"types": ["vatts/global"]${aliasBlock}
|
|
115
|
+
"types": ["vatts/global", "node"]${aliasBlock}
|
|
114
116
|
},
|
|
115
117
|
"include": ["src/**/*"],
|
|
116
118
|
"exclude": ["node_modules", "dist"]
|
|
@@ -314,3 +316,138 @@ const ExampleRoute: BackendRouteConfig = {
|
|
|
314
316
|
|
|
315
317
|
export default ExampleRoute;`;
|
|
316
318
|
}
|
|
319
|
+
function vueExampleRoute(typescript, pathRouter, tailwind) {
|
|
320
|
+
return `${pathRouter ? '' : `<script${typescript ? ' lang="ts"' : ''}>
|
|
321
|
+
${typescript ? 'import type { RouteConfig } from "vatts/vue";\n' : ''}
|
|
322
|
+
export const config${typescript ? ': RouteConfig' : ''} = {
|
|
323
|
+
pattern: '/',
|
|
324
|
+
component: undefined,
|
|
325
|
+
generateMetadata: () => ({
|
|
326
|
+
title: 'Vatts.js | Home'
|
|
327
|
+
})
|
|
328
|
+
};
|
|
329
|
+
</script>`}
|
|
330
|
+
${tailwind ? `<template>
|
|
331
|
+
<div class="flex min-h-screen flex-col items-center justify-center bg-gray-950 p-4 text-center">
|
|
332
|
+
<div class="group relative">
|
|
333
|
+
<div class="absolute -inset-1 rounded-lg bg-gradient-to-r from-purple-600 to-cyan-400 opacity-25 blur transition duration-500 group-hover:opacity-50"></div>
|
|
334
|
+
<div class="relative rounded-lg bg-gray-900 px-8 py-6 ring-1 ring-gray-800">
|
|
335
|
+
<h1 class="mb-2 text-4xl font-bold tracking-tight text-white sm:text-5xl">
|
|
336
|
+
Hello <span class="text-transparent bg-clip-text bg-gradient-to-r from-purple-400 to-cyan-400">World</span>
|
|
337
|
+
</h1>
|
|
338
|
+
|
|
339
|
+
<p class="text-sm font-medium text-gray-400">
|
|
340
|
+
Running with <span class="text-gray-200">Vatts.js</span>
|
|
341
|
+
</p>
|
|
342
|
+
</div>
|
|
343
|
+
</div>
|
|
344
|
+
</div>
|
|
345
|
+
</template>` : `<template>
|
|
346
|
+
<div class="container">
|
|
347
|
+
<div class="group-wrapper">
|
|
348
|
+
<div class="gradient-blur"></div>
|
|
349
|
+
|
|
350
|
+
<div class="card">
|
|
351
|
+
<h1 class="title">
|
|
352
|
+
Hello <span class="gradient-text">World</span>
|
|
353
|
+
</h1>
|
|
354
|
+
|
|
355
|
+
<p class="subtitle">
|
|
356
|
+
Running with <span class="subtitle-highlight">Vatts.js</span>
|
|
357
|
+
</p>
|
|
358
|
+
</div>
|
|
359
|
+
</div>
|
|
360
|
+
</div>
|
|
361
|
+
</template>
|
|
362
|
+
|
|
363
|
+
<style scoped>
|
|
364
|
+
/* O CSS permanece exatamente o mesmo que você enviou */
|
|
365
|
+
.container {
|
|
366
|
+
display: flex;
|
|
367
|
+
min-height: 100vh;
|
|
368
|
+
flex-direction: column;
|
|
369
|
+
align-items: center;
|
|
370
|
+
justify-content: center;
|
|
371
|
+
background-color: #030712;
|
|
372
|
+
padding: 1rem;
|
|
373
|
+
text-align: center;
|
|
374
|
+
font-family: sans-serif;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.group-wrapper {
|
|
378
|
+
position: relative;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.gradient-blur {
|
|
382
|
+
position: absolute;
|
|
383
|
+
top: -4px;
|
|
384
|
+
right: -4px;
|
|
385
|
+
bottom: -4px;
|
|
386
|
+
left: -4px;
|
|
387
|
+
border-radius: 0.5rem;
|
|
388
|
+
background: linear-gradient(to right, #9333ea, #22d3ee);
|
|
389
|
+
filter: blur(8px);
|
|
390
|
+
transition: opacity 500ms ease;
|
|
391
|
+
opacity: 0.25;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.group-wrapper:hover .gradient-blur {
|
|
395
|
+
opacity: 0.5;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.card {
|
|
399
|
+
position: relative;
|
|
400
|
+
border-radius: 0.5rem;
|
|
401
|
+
background-color: #111827;
|
|
402
|
+
padding: 1.5rem 2rem;
|
|
403
|
+
border: 1px solid #1f2937;
|
|
404
|
+
color: white;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.title {
|
|
408
|
+
margin-bottom: 0.5rem;
|
|
409
|
+
font-size: 2.25rem;
|
|
410
|
+
font-weight: bold;
|
|
411
|
+
letter-spacing: -0.025em;
|
|
412
|
+
color: white;
|
|
413
|
+
line-height: 1;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.gradient-text {
|
|
417
|
+
color: transparent;
|
|
418
|
+
background-clip: text;
|
|
419
|
+
-webkit-background-clip: text;
|
|
420
|
+
background-image: linear-gradient(to right, #c084fc, #22d3ee);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.subtitle {
|
|
424
|
+
font-size: 0.875rem;
|
|
425
|
+
font-weight: 500;
|
|
426
|
+
color: #9ca3af;
|
|
427
|
+
margin: 0;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.subtitle-highlight {
|
|
431
|
+
color: #e5e7eb;
|
|
432
|
+
}
|
|
433
|
+
</style>`}`;
|
|
434
|
+
}
|
|
435
|
+
function vueExampleLayout(typescript) {
|
|
436
|
+
return `<script${typescript ? ' lang="ts"' : ''}>
|
|
437
|
+
${typescript ? `import type { Metadata } from "vatts/vue";` : ''}
|
|
438
|
+
export const metadata${typescript ? ': Metadata' : ''} = {
|
|
439
|
+
title: "Vatts JS | The Fast and Simple Web Framework for React",
|
|
440
|
+
description: "The fastest and simplest web framework for React! Start building high-performance web applications today with Vatts JS.",
|
|
441
|
+
keywords: ["Vatts JS", "web framework", "React", "JavaScript", "TypeScript", "web development", "fast", "simple", "SSR", "frontend"],
|
|
442
|
+
author: "Vatts JS Team",
|
|
443
|
+
};
|
|
444
|
+
</script>
|
|
445
|
+
|
|
446
|
+
<script setup ${typescript ? ' lang="ts"' : ''}>
|
|
447
|
+
import './globals.css';
|
|
448
|
+
</script>
|
|
449
|
+
|
|
450
|
+
<template>
|
|
451
|
+
<slot />
|
|
452
|
+
</template>`;
|
|
453
|
+
}
|
package/dist/types.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export type CreateAppOptions = {
|
|
|
10
10
|
alias?: string;
|
|
11
11
|
pathRouter?: boolean;
|
|
12
12
|
typeScript?: boolean;
|
|
13
|
+
framework?: 'react' | 'vue';
|
|
13
14
|
};
|
|
14
15
|
export type CreateAppContext = {
|
|
15
16
|
appName: string;
|
|
@@ -25,4 +26,5 @@ export type CreateAppContext = {
|
|
|
25
26
|
vattsVersion: string;
|
|
26
27
|
packageJson: Record<string, any>;
|
|
27
28
|
typeScript: boolean;
|
|
29
|
+
framework: 'react' | 'vue';
|
|
28
30
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-vatts-app",
|
|
3
|
-
"version": "1.0.1",
|
|
3
|
+
"version": "1.1.0-alpha.1",
|
|
4
4
|
"description": "CLI tool to create a new Vatts.js application",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"commander": "^14.0.2",
|
|
29
29
|
"ts-node": "^10.9.2",
|
|
30
|
-
"vatts": "1.
|
|
30
|
+
"vatts": "1.2.0-alpha.2"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "rimraf dist && tsc",
|