@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.
Files changed (75) hide show
  1. package/README.md +159 -0
  2. package/dist/actions.d.ts +12 -0
  3. package/dist/actions.js +157 -0
  4. package/dist/cli-parser.d.ts +21 -0
  5. package/dist/cli-parser.js +141 -0
  6. package/dist/configs/axios.config.d.ts +2 -0
  7. package/dist/configs/axios.config.js +12 -0
  8. package/dist/configs/biome.config.d.ts +2 -0
  9. package/dist/configs/biome.config.js +12 -0
  10. package/dist/configs/cookies-next.config.d.ts +2 -0
  11. package/dist/configs/cookies-next.config.js +6 -0
  12. package/dist/configs/date-fns.config.d.ts +2 -0
  13. package/dist/configs/date-fns.config.js +6 -0
  14. package/dist/configs/eslint-prettier.config.d.ts +2 -0
  15. package/dist/configs/eslint-prettier.config.js +35 -0
  16. package/dist/configs/framer-motion.config.d.ts +2 -0
  17. package/dist/configs/framer-motion.config.js +6 -0
  18. package/dist/configs/ky.config.d.ts +2 -0
  19. package/dist/configs/ky.config.js +12 -0
  20. package/dist/configs/lucide-react.config.d.ts +2 -0
  21. package/dist/configs/lucide-react.config.js +6 -0
  22. package/dist/configs/nuqs.config.d.ts +2 -0
  23. package/dist/configs/nuqs.config.js +12 -0
  24. package/dist/configs/react-hook-form.config.d.ts +2 -0
  25. package/dist/configs/react-hook-form.config.js +6 -0
  26. package/dist/configs/recharts.config.d.ts +2 -0
  27. package/dist/configs/recharts.config.js +6 -0
  28. package/dist/configs/tanstack-query.config.d.ts +2 -0
  29. package/dist/configs/tanstack-query.config.js +19 -0
  30. package/dist/configs/zod.config.d.ts +2 -0
  31. package/dist/configs/zod.config.js +6 -0
  32. package/dist/dependency-versions.d.ts +13 -0
  33. package/dist/dependency-versions.js +50 -0
  34. package/dist/git-setup.d.ts +23 -0
  35. package/dist/git-setup.js +275 -0
  36. package/dist/index.d.ts +2 -0
  37. package/dist/index.js +537 -0
  38. package/dist/project-generator.d.ts +15 -0
  39. package/dist/project-generator.js +311 -0
  40. package/dist/snippet-manager.d.ts +11 -0
  41. package/dist/snippet-manager.js +76 -0
  42. package/dist/snippets/axios/index.ts +6 -0
  43. package/dist/snippets/biome/biome.json +93 -0
  44. package/dist/snippets/eslint-prettier/eslintignore +6 -0
  45. package/dist/snippets/eslint-prettier/eslintrc.js +3 -0
  46. package/dist/snippets/eslint-prettier/prettierignore +9 -0
  47. package/dist/snippets/eslint-prettier/prettierrc.js +9 -0
  48. package/dist/snippets/ky/index.ts +5 -0
  49. package/dist/snippets/react-query/index.tsx +53 -0
  50. package/dist/snippets/vscode/extensions.json +3 -0
  51. package/dist/snippets/vscode/settings.json +19 -0
  52. package/dist/templates/frontend/next15/base/.env.example +3 -0
  53. package/dist/templates/frontend/next15/base/README.md +50 -0
  54. package/dist/templates/frontend/next15/base/next.config.ts +7 -0
  55. package/dist/templates/frontend/next15/base/package.json +23 -0
  56. package/dist/templates/frontend/next15/base/postcss.config.mjs +8 -0
  57. package/dist/templates/frontend/next15/base/public/public.md +12 -0
  58. package/dist/templates/frontend/next15/base/src/@types/@types.md +7 -0
  59. package/dist/templates/frontend/next15/base/src/@types/types.d.ts +1 -0
  60. package/dist/templates/frontend/next15/base/src/app/(application)/page.tsx +50 -0
  61. package/dist/templates/frontend/next15/base/src/app/favicon.ico +0 -0
  62. package/dist/templates/frontend/next15/base/src/app/layout.tsx +23 -0
  63. package/dist/templates/frontend/next15/base/src/app/providers.tsx +5 -0
  64. package/dist/templates/frontend/next15/base/src/components/components.md +9 -0
  65. package/dist/templates/frontend/next15/base/src/constants/constants.md +10 -0
  66. package/dist/templates/frontend/next15/base/src/hooks/hooks.md +11 -0
  67. package/dist/templates/frontend/next15/base/src/lib/lib.md +9 -0
  68. package/dist/templates/frontend/next15/base/src/services/services.md +14 -0
  69. package/dist/templates/frontend/next15/base/src/styles/globals.css +1 -0
  70. package/dist/templates/frontend/next15/base/src/types/types.md +15 -0
  71. package/dist/templates/frontend/next15/base/src/utils/utils.md +18 -0
  72. package/dist/templates/frontend/next15/base/tsconfig.json +26 -0
  73. package/dist/types.d.ts +60 -0
  74. package/dist/types.js +1 -0
  75. 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,8 @@
1
+ /** @type {import('postcss-load-config').Config} */
2
+ const config = {
3
+ plugins: {
4
+ "@tailwindcss/postcss": {},
5
+ },
6
+ };
7
+
8
+ export default config;
@@ -0,0 +1,12 @@
1
+ # Public Assets
2
+
3
+ This directory contains static assets that are publicly accessible.
4
+
5
+ ## Structure
6
+
7
+ - Images (SVG, PNG, JPG)
8
+ - Fonts
9
+ - Icons
10
+ - Other static files
11
+
12
+ Files in this directory are served at the root path `/`.
@@ -0,0 +1,7 @@
1
+ # Global Types
2
+
3
+ This directory contains global TypeScript type definitions.
4
+
5
+ ## Files
6
+
7
+ - `types.d.ts` - Global type definitions available throughout the application
@@ -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
+ }
@@ -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,5 @@
1
+ "use client";
2
+
3
+ export function Providers({ children }: { children: React.ReactNode }) {
4
+ return <>{children}</>;
5
+ }
@@ -0,0 +1,9 @@
1
+ # Components
2
+
3
+ This directory contains reusable React components.
4
+
5
+ ## Structure
6
+
7
+ - Place shared/reusable components here
8
+ - Use subdirectories to organize related components
9
+ - Each component should have its own folder with index file
@@ -0,0 +1,10 @@
1
+ # Constants
2
+
3
+ This directory contains application-wide constants.
4
+
5
+ ## Examples
6
+
7
+ ```typescript
8
+ export const API_VERSION = 'v1';
9
+ export const MAX_FILE_SIZE = 5 * 1024 * 1024; // 5MB
10
+ ```
@@ -0,0 +1,11 @@
1
+ # Custom Hooks
2
+
3
+ This directory contains custom React hooks.
4
+
5
+ ## Examples
6
+
7
+ ```typescript
8
+ export function useLocalStorage<T>(key: string, initialValue: T) {
9
+ // Hook implementation
10
+ }
11
+ ```
@@ -0,0 +1,9 @@
1
+ # Library Configurations
2
+
3
+ This directory contains configurations for external libraries.
4
+
5
+ ## Examples
6
+
7
+ - `api.ts` - HTTP client configuration (ky/axios)
8
+ - `tanstack-query.tsx` - React Query setup
9
+ - `utils.ts` - Utility functions (shadcn)
@@ -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,15 @@
1
+ # Types
2
+
3
+ This directory contains TypeScript type definitions.
4
+
5
+ ## Structure
6
+
7
+ ```typescript
8
+ export interface User {
9
+ id: string;
10
+ name: string;
11
+ email: string;
12
+ }
13
+
14
+ export type UserRole = 'admin' | 'user' | 'guest';
15
+ ```
@@ -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
+ }
@@ -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
+ }