@perma-tools/cli 0.0.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/README.md +159 -0
- package/dist/actions.d.ts +12 -0
- package/dist/actions.js +157 -0
- package/dist/cli-parser.d.ts +21 -0
- package/dist/cli-parser.js +141 -0
- package/dist/configs/axios.config.d.ts +2 -0
- package/dist/configs/axios.config.js +12 -0
- package/dist/configs/biome.config.d.ts +2 -0
- package/dist/configs/biome.config.js +12 -0
- package/dist/configs/cookies-next.config.d.ts +2 -0
- package/dist/configs/cookies-next.config.js +6 -0
- package/dist/configs/date-fns.config.d.ts +2 -0
- package/dist/configs/date-fns.config.js +6 -0
- package/dist/configs/eslint-prettier.config.d.ts +2 -0
- package/dist/configs/eslint-prettier.config.js +35 -0
- package/dist/configs/framer-motion.config.d.ts +2 -0
- package/dist/configs/framer-motion.config.js +6 -0
- package/dist/configs/ky.config.d.ts +2 -0
- package/dist/configs/ky.config.js +12 -0
- package/dist/configs/lucide-react.config.d.ts +2 -0
- package/dist/configs/lucide-react.config.js +6 -0
- package/dist/configs/nuqs.config.d.ts +2 -0
- package/dist/configs/nuqs.config.js +12 -0
- package/dist/configs/react-hook-form.config.d.ts +2 -0
- package/dist/configs/react-hook-form.config.js +6 -0
- package/dist/configs/recharts.config.d.ts +2 -0
- package/dist/configs/recharts.config.js +6 -0
- package/dist/configs/tanstack-query.config.d.ts +2 -0
- package/dist/configs/tanstack-query.config.js +19 -0
- package/dist/configs/zod.config.d.ts +2 -0
- package/dist/configs/zod.config.js +6 -0
- package/dist/dependency-versions.d.ts +13 -0
- package/dist/dependency-versions.js +50 -0
- package/dist/git-setup.d.ts +23 -0
- package/dist/git-setup.js +275 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +537 -0
- package/dist/project-generator.d.ts +15 -0
- package/dist/project-generator.js +311 -0
- package/dist/snippet-manager.d.ts +11 -0
- package/dist/snippet-manager.js +76 -0
- package/dist/snippets/axios/index.ts +6 -0
- package/dist/snippets/biome/biome.json +93 -0
- package/dist/snippets/eslint-prettier/eslintignore +6 -0
- package/dist/snippets/eslint-prettier/eslintrc.js +3 -0
- package/dist/snippets/eslint-prettier/prettierignore +9 -0
- package/dist/snippets/eslint-prettier/prettierrc.js +9 -0
- package/dist/snippets/ky/index.ts +5 -0
- package/dist/snippets/react-query/index.tsx +53 -0
- package/dist/snippets/vscode/extensions.json +3 -0
- package/dist/snippets/vscode/settings.json +19 -0
- package/dist/templates/frontend/next15/base/.env.example +3 -0
- package/dist/templates/frontend/next15/base/README.md +50 -0
- package/dist/templates/frontend/next15/base/next.config.ts +7 -0
- package/dist/templates/frontend/next15/base/package.json +23 -0
- package/dist/templates/frontend/next15/base/postcss.config.mjs +8 -0
- package/dist/templates/frontend/next15/base/public/public.md +12 -0
- package/dist/templates/frontend/next15/base/src/@types/@types.md +7 -0
- package/dist/templates/frontend/next15/base/src/@types/types.d.ts +1 -0
- package/dist/templates/frontend/next15/base/src/app/(application)/page.tsx +50 -0
- package/dist/templates/frontend/next15/base/src/app/favicon.ico +0 -0
- package/dist/templates/frontend/next15/base/src/app/layout.tsx +23 -0
- package/dist/templates/frontend/next15/base/src/app/providers.tsx +5 -0
- package/dist/templates/frontend/next15/base/src/components/components.md +9 -0
- package/dist/templates/frontend/next15/base/src/constants/constants.md +10 -0
- package/dist/templates/frontend/next15/base/src/hooks/hooks.md +11 -0
- package/dist/templates/frontend/next15/base/src/lib/lib.md +9 -0
- package/dist/templates/frontend/next15/base/src/services/services.md +14 -0
- package/dist/templates/frontend/next15/base/src/styles/globals.css +1 -0
- package/dist/templates/frontend/next15/base/src/types/types.md +15 -0
- package/dist/templates/frontend/next15/base/src/utils/utils.md +18 -0
- package/dist/templates/frontend/next15/base/tsconfig.json +26 -0
- package/dist/types.d.ts +60 -0
- package/dist/types.js +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "base",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "next dev --turbopack",
|
|
7
|
+
"build": "next build --turbopack",
|
|
8
|
+
"start": "next start"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"react": "19.2.1",
|
|
12
|
+
"react-dom": "19.2.1",
|
|
13
|
+
"next": "15.5.11"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"typescript": "^5",
|
|
17
|
+
"@types/node": "^20",
|
|
18
|
+
"@types/react": "^19",
|
|
19
|
+
"@types/react-dom": "^19",
|
|
20
|
+
"@tailwindcss/postcss": "^4",
|
|
21
|
+
"tailwindcss": "^4"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
type _WithChildren<T = unknown> = T & { children: React.ReactNode };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Layers } from "lucide-react";
|
|
2
|
+
import Image from "next/image";
|
|
3
|
+
import logo from "@/app/favicon.ico";
|
|
4
|
+
|
|
5
|
+
export default function Home() {
|
|
6
|
+
return (
|
|
7
|
+
<div className="flex min-h-screen flex-col">
|
|
8
|
+
<main className="flex flex-col gap-10 items-center justify-center flex-1">
|
|
9
|
+
<Image
|
|
10
|
+
src={logo}
|
|
11
|
+
alt="Logo"
|
|
12
|
+
draggable={false}
|
|
13
|
+
width={120}
|
|
14
|
+
height={120}
|
|
15
|
+
/>
|
|
16
|
+
|
|
17
|
+
<div className="container px-4 md:px-6">
|
|
18
|
+
<div className="flex flex-col items-center justify-center space-y-4 text-center">
|
|
19
|
+
<div className="space-y-2">
|
|
20
|
+
<h1 className="text-3xl font-bold tracking-tighter sm:text-4xl md:text-5xl lg:text-6xl">
|
|
21
|
+
Template Base para Next.js
|
|
22
|
+
</h1>
|
|
23
|
+
<p className="mx-auto max-w-[700px] text-gray-500 md:text-xl dark:text-gray-400">
|
|
24
|
+
Um ponto de partida sólido para suas aplicações Next.js com
|
|
25
|
+
estrutura organizada, componentes reutilizáveis e boas práticas.
|
|
26
|
+
</p>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</main>
|
|
31
|
+
|
|
32
|
+
<footer className="w-full border-t py-6 px-28">
|
|
33
|
+
<div className="container flex flex-col items-center justify-center gap-4 md:flex-row md:justify-between">
|
|
34
|
+
<div className="flex items-center gap-2 font-semibold">
|
|
35
|
+
<Layers size={20} />
|
|
36
|
+
<span>Next.js Template</span>
|
|
37
|
+
</div>
|
|
38
|
+
<p className="text-center text-sm text-gray-500 dark:text-gray-400">
|
|
39
|
+
© {new Date().getFullYear()} Next.js Template.
|
|
40
|
+
</p>
|
|
41
|
+
<div>
|
|
42
|
+
<span className="text-center text-sm text-gray-500 dark:text-gray-400">
|
|
43
|
+
Todos os direitos reservados.
|
|
44
|
+
</span>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</footer>
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Metadata } from "next";
|
|
2
|
+
import { Inter } from "next/font/google";
|
|
3
|
+
import "../styles/globals.css";
|
|
4
|
+
import { Providers } from "./providers";
|
|
5
|
+
|
|
6
|
+
const inter = Inter({ subsets: ["latin"] });
|
|
7
|
+
|
|
8
|
+
export const metadata: Metadata = {
|
|
9
|
+
title: "Next Template",
|
|
10
|
+
description: "Next Template",
|
|
11
|
+
// Add your favicon.ico, apple-icon.png, or icon.png to this directory
|
|
12
|
+
// Next.js will automatically detect and use them
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default function RootLayout({ children }: _WithChildren) {
|
|
16
|
+
return (
|
|
17
|
+
<html lang="pt-BR">
|
|
18
|
+
<body className={`${inter.className} antialiased`}>
|
|
19
|
+
<Providers>{children}</Providers>
|
|
20
|
+
</body>
|
|
21
|
+
</html>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Services
|
|
2
|
+
|
|
3
|
+
This directory contains API service layer.
|
|
4
|
+
|
|
5
|
+
## Structure
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
// users.service.ts
|
|
9
|
+
export const UserService = {
|
|
10
|
+
getAll: () => api.get('/users'),
|
|
11
|
+
getById: (id: string) => api.get(`/users/${id}`),
|
|
12
|
+
create: (data: User) => api.post('/users', data),
|
|
13
|
+
};
|
|
14
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Utilities
|
|
2
|
+
|
|
3
|
+
This directory contains utility functions.
|
|
4
|
+
|
|
5
|
+
## Examples
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
export function formatDate(date: Date): string {
|
|
9
|
+
return date.toLocaleDateString('pt-BR');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function debounce<T extends (...args: any[]) => any>(
|
|
13
|
+
func: T,
|
|
14
|
+
wait: number
|
|
15
|
+
): T {
|
|
16
|
+
// Implementation
|
|
17
|
+
}
|
|
18
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
4
|
+
"allowJs": true,
|
|
5
|
+
"skipLibCheck": true,
|
|
6
|
+
"strict": true,
|
|
7
|
+
"noEmit": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"module": "esnext",
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"resolveJsonModule": true,
|
|
12
|
+
"isolatedModules": true,
|
|
13
|
+
"jsx": "preserve",
|
|
14
|
+
"incremental": true,
|
|
15
|
+
"plugins": [
|
|
16
|
+
{
|
|
17
|
+
"name": "next"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"paths": {
|
|
21
|
+
"@/*": ["./src/*"]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
25
|
+
"exclude": ["node_modules"]
|
|
26
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export interface ProjectConfig {
|
|
2
|
+
packageManager: string;
|
|
3
|
+
applicationType: string;
|
|
4
|
+
framework?: string;
|
|
5
|
+
httpClient?: string;
|
|
6
|
+
linter?: string;
|
|
7
|
+
additionalLibs?: string[];
|
|
8
|
+
projectName?: string;
|
|
9
|
+
projectPath?: string;
|
|
10
|
+
shouldInstallDeps?: boolean;
|
|
11
|
+
withShadcn?: boolean;
|
|
12
|
+
shadcnComponents?: string[];
|
|
13
|
+
shadcnColor?: string;
|
|
14
|
+
gitSetup?: "repo-and-deploy" | "repo-only" | "none";
|
|
15
|
+
repoVisibility?: "public" | "private";
|
|
16
|
+
repoName?: string;
|
|
17
|
+
repoOrg?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface CopyFileAction {
|
|
20
|
+
type: "copy-file";
|
|
21
|
+
source: string;
|
|
22
|
+
destination: string;
|
|
23
|
+
priority?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface InjectProviderAction {
|
|
26
|
+
type: "inject-provider";
|
|
27
|
+
providerImport: string;
|
|
28
|
+
providerWrapper: string;
|
|
29
|
+
priority?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface ModifyFileAction {
|
|
32
|
+
type: "modify-file";
|
|
33
|
+
file: string;
|
|
34
|
+
modifications: Array<{
|
|
35
|
+
type: "add-import" | "wrap-content" | "replace";
|
|
36
|
+
content: string;
|
|
37
|
+
position?: "top" | "bottom" | "before" | "after";
|
|
38
|
+
marker?: string;
|
|
39
|
+
}>;
|
|
40
|
+
priority?: number;
|
|
41
|
+
}
|
|
42
|
+
export interface InstallDepsAction {
|
|
43
|
+
type: "install-deps";
|
|
44
|
+
dependencies: string[];
|
|
45
|
+
devDependencies?: string[];
|
|
46
|
+
priority?: number;
|
|
47
|
+
}
|
|
48
|
+
export interface RunCommandAction {
|
|
49
|
+
type: "run-command";
|
|
50
|
+
command: string;
|
|
51
|
+
args?: string[];
|
|
52
|
+
priority?: number;
|
|
53
|
+
}
|
|
54
|
+
export type SnippetAction = CopyFileAction | InjectProviderAction | ModifyFileAction | InstallDepsAction | RunCommandAction;
|
|
55
|
+
export interface SnippetConfig {
|
|
56
|
+
name: string;
|
|
57
|
+
dependencies?: string[];
|
|
58
|
+
devDependencies?: string[];
|
|
59
|
+
actions: SnippetAction[];
|
|
60
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@perma-tools/cli",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "🚀 CLI moderna e interativa para geração rápida de projetos frontend e backend com configurações personalizadas",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/grupopermaneo/permaneo-tools.git"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/grupopermaneo/permaneo-tools/issues"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/grupopermaneo/permaneo-tools#readme",
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"bin": {
|
|
17
|
+
"perma-tools": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"README.md"
|
|
22
|
+
],
|
|
23
|
+
"keywords": [
|
|
24
|
+
"cli",
|
|
25
|
+
"project-generator",
|
|
26
|
+
"nextjs",
|
|
27
|
+
"react",
|
|
28
|
+
"vite",
|
|
29
|
+
"boilerplate",
|
|
30
|
+
"scaffold",
|
|
31
|
+
"template",
|
|
32
|
+
"shadcn",
|
|
33
|
+
"tanstack-query",
|
|
34
|
+
"typescript"
|
|
35
|
+
],
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=18.0.0"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@clack/prompts": "^0.11.0",
|
|
44
|
+
"commander": "^14.0.1"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/node": "^24.7.1",
|
|
48
|
+
"tsx": "^4.20.6",
|
|
49
|
+
"typescript": "^5.9.3"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"start": "node --import tsx index.ts",
|
|
53
|
+
"dev": "node --import tsx index.ts",
|
|
54
|
+
"cli": "node --import tsx index.ts",
|
|
55
|
+
"lint": "biome check",
|
|
56
|
+
"format": "biome format --write",
|
|
57
|
+
"type-check": "tsc --noEmit --incremental false",
|
|
58
|
+
"build": "tsc && npm run copy-assets",
|
|
59
|
+
"copy-assets": "node scripts/copy-assets.js",
|
|
60
|
+
"test:local": "npm pack"
|
|
61
|
+
}
|
|
62
|
+
}
|