prox-cli 1.3.2

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 (63) hide show
  1. package/bin/index.js +137 -0
  2. package/package.json +21 -0
  3. package/templates/next@14/.editorconfig +16 -0
  4. package/templates/next@14/.eslintrc.json +10 -0
  5. package/templates/next@14/.husky/pre-commit +1 -0
  6. package/templates/next@14/.prettierrc +14 -0
  7. package/templates/next@14/.yarnrc.yml +1 -0
  8. package/templates/next@14/README.md +36 -0
  9. package/templates/next@14/commitlint.config.js +0 -0
  10. package/templates/next@14/components.json +25 -0
  11. package/templates/next@14/cypress/e2e/spec.cy.ts +5 -0
  12. package/templates/next@14/cypress/fixtures/example.json +5 -0
  13. package/templates/next@14/cypress/support/commands.ts +37 -0
  14. package/templates/next@14/cypress/support/e2e.ts +17 -0
  15. package/templates/next@14/cypress.config.ts +9 -0
  16. package/templates/next@14/documentation/readme +1 -0
  17. package/templates/next@14/next.config.mjs +4 -0
  18. package/templates/next@14/package-lock.json +13597 -0
  19. package/templates/next@14/package.json +66 -0
  20. package/templates/next@14/postcss.config.mjs +8 -0
  21. package/templates/next@14/public/fonts/GeistMonoVF.woff +0 -0
  22. package/templates/next@14/public/fonts/GeistVF.woff +0 -0
  23. package/templates/next@14/public/images/global/proxy-logo.svg +1 -0
  24. package/templates/next@14/public/images/readme +1 -0
  25. package/templates/next@14/src/app/favicon.ico +0 -0
  26. package/templates/next@14/src/app/layout.tsx +24 -0
  27. package/templates/next@14/src/app/page.tsx +14 -0
  28. package/templates/next@14/src/components/layouts/readme +1 -0
  29. package/templates/next@14/src/components/providers/index.tsx +17 -0
  30. package/templates/next@14/src/components/providers/modules/readme +1 -0
  31. package/templates/next@14/src/components/shared/readme +1 -0
  32. package/templates/next@14/src/components/skeletons/readme +1 -0
  33. package/templates/next@14/src/components/ui/button.tsx +60 -0
  34. package/templates/next@14/src/components/ui/readme +1 -0
  35. package/templates/next@14/src/components/ui/svgs/npm.tsx +13 -0
  36. package/templates/next@14/src/components/ui/svgs/npmWordmark.tsx +12 -0
  37. package/templates/next@14/src/components/welcome-component.tsx +37 -0
  38. package/templates/next@14/src/configuration/readme +1 -0
  39. package/templates/next@14/src/fonts/index.ts +13 -0
  40. package/templates/next@14/src/i18n/messages/ar.json +0 -0
  41. package/templates/next@14/src/i18n/messages/en.json +0 -0
  42. package/templates/next@14/src/i18n/navigation.ts +6 -0
  43. package/templates/next@14/src/i18n/request.ts +17 -0
  44. package/templates/next@14/src/i18n/routing.ts +14 -0
  45. package/templates/next@14/src/lib/actions/readme +1 -0
  46. package/templates/next@14/src/lib/api/readme +1 -0
  47. package/templates/next@14/src/lib/constants/readme +1 -0
  48. package/templates/next@14/src/lib/context/readme +1 -0
  49. package/templates/next@14/src/lib/hooks/readme +1 -0
  50. package/templates/next@14/src/lib/schema/readme +1 -0
  51. package/templates/next@14/src/lib/seo/readme +1 -0
  52. package/templates/next@14/src/lib/storage/local.storage.ts +54 -0
  53. package/templates/next@14/src/lib/storage/session.storage.ts +54 -0
  54. package/templates/next@14/src/lib/types/readme +1 -0
  55. package/templates/next@14/src/lib/utils/cn.util.ts +6 -0
  56. package/templates/next@14/src/lib/utils.ts +6 -0
  57. package/templates/next@14/src/middleware.ts +19 -0
  58. package/templates/next@14/src/store/readme +1 -0
  59. package/templates/next@14/src/styles/globals.css +78 -0
  60. package/templates/next@14/src/tests/e2e.spec.tsx +9 -0
  61. package/templates/next@14/tailwind.config.ts +63 -0
  62. package/templates/next@14/tsconfig.json +37 -0
  63. package/templates/next@14/vitest.config.mts +10 -0
package/bin/index.js ADDED
@@ -0,0 +1,137 @@
1
+ #!/usr/bin/env node
2
+ import { program } from "commander";
3
+ import fs from "fs-extra";
4
+ import { join, dirname } from "path";
5
+ import { fileURLToPath } from "url";
6
+ import prompts from "prompts";
7
+ import chalk from "chalk";
8
+
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = dirname(__filename);
11
+
12
+ program
13
+ .command("create [projectName]")
14
+ .description("Create a new project from template")
15
+ .option("-t, --template <template>", "Specify template name")
16
+ .action(async (projectName, options) => {
17
+ const templatesPath = join(__dirname, "../templates");
18
+ const templates = await fs.readdir(templatesPath);
19
+
20
+ if (templates.length === 0) {
21
+ console.log(chalk.yellow("⚠️ No templates found!"));
22
+ return;
23
+ }
24
+
25
+ let chosenTemplate = options.template;
26
+ let finalProjectName = projectName;
27
+
28
+ // إذا لم يتم تحديد اسم المشروع، اسأل عنه
29
+ if (!finalProjectName) {
30
+ const response = await prompts({
31
+ type: "text",
32
+ name: "projectName",
33
+ message: "Project name:",
34
+ initial: "my-project",
35
+ validate: (value) =>
36
+ value.trim() === "" ? "Project name is required!" : true,
37
+ });
38
+
39
+ if (!response.projectName) {
40
+ console.log(chalk.red("\n✖ Operation cancelled"));
41
+ process.exit(1);
42
+ }
43
+
44
+ finalProjectName = response.projectName;
45
+ }
46
+
47
+ // إذا لم يتم تحديد التيمبلت، اعرض القائمة
48
+ if (!chosenTemplate) {
49
+ const response = await prompts({
50
+ type: "select",
51
+ name: "template",
52
+ message: "Select a template:",
53
+ choices: templates.map((t) => ({ title: t, value: t })),
54
+ });
55
+
56
+ if (!response.template) {
57
+ console.log(chalk.red("\n✖ Operation cancelled"));
58
+ process.exit(1);
59
+ }
60
+
61
+ chosenTemplate = response.template;
62
+ } else {
63
+ // تحقق من وجود التيمبلت المحدد
64
+ if (!templates.includes(chosenTemplate)) {
65
+ console.log(chalk.red(`\n✖ Template '${chosenTemplate}' not found!`));
66
+ console.log(
67
+ chalk.cyan(`\n📋 Available templates: ${templates.join(", ")}`)
68
+ );
69
+ return;
70
+ }
71
+ }
72
+
73
+ const targetPath = join(process.cwd(), finalProjectName);
74
+ const templatePath = join(templatesPath, chosenTemplate);
75
+
76
+ // تحقق من وجود المجلد
77
+ if (await fs.pathExists(targetPath)) {
78
+ const response = await prompts({
79
+ type: "confirm",
80
+ name: "overwrite",
81
+ message: `Directory '${finalProjectName}' already exists. Overwrite?`,
82
+ initial: false,
83
+ });
84
+
85
+ if (!response.overwrite) {
86
+ console.log(chalk.red("\n✖ Operation cancelled"));
87
+ return;
88
+ }
89
+ await fs.remove(targetPath);
90
+ }
91
+
92
+ console.log(
93
+ chalk.cyan(
94
+ `\n🚀 Creating project ${chalk.bold(
95
+ finalProjectName
96
+ )} from ${chalk.bold(chosenTemplate)} template...\n`
97
+ )
98
+ );
99
+
100
+ await fs.ensureDir(targetPath);
101
+ await fs.copy(templatePath, targetPath);
102
+
103
+ // تحديث package.json
104
+ const pkgPath = join(targetPath, "package.json");
105
+ if (await fs.pathExists(pkgPath)) {
106
+ const pkg = await fs.readJSON(pkgPath);
107
+ pkg.name = finalProjectName;
108
+ await fs.writeJSON(pkgPath, pkg, { spaces: 2 });
109
+ }
110
+
111
+ console.log(chalk.green(`\n✓ Project created successfully!\n`));
112
+ console.log(chalk.cyan(` cd ${finalProjectName}`));
113
+ console.log(chalk.cyan(` npm install`));
114
+ console.log(chalk.cyan(` npm run dev\n`));
115
+ });
116
+
117
+ // عرض التيمبلتس المتاحة
118
+ program
119
+ .command("list")
120
+ .description("List all available templates")
121
+ .action(async () => {
122
+ const templatesPath = join(__dirname, "../templates");
123
+ const templates = await fs.readdir(templatesPath);
124
+
125
+ if (templates.length === 0) {
126
+ console.log(chalk.yellow("⚠️ No templates found!"));
127
+ return;
128
+ }
129
+
130
+ console.log(chalk.cyan("\n📋 Available templates:\n"));
131
+ templates.forEach((template, index) => {
132
+ console.log(chalk.white(` ${index + 1}. ${template}`));
133
+ });
134
+ console.log();
135
+ });
136
+
137
+ program.parse();
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "prox-cli",
3
+ "version": "1.3.2",
4
+ "bin": {
5
+ "prox": "./bin/index.js"
6
+ },
7
+ "description": "cli for build template clean structure projects",
8
+ "license": "ISC",
9
+ "author": "Mahmoud Kamel",
10
+ "type": "module",
11
+ "main": "index.js",
12
+ "scripts": {
13
+ "test": "echo \"Error: no test specified\" && exit 1"
14
+ },
15
+ "dependencies": {
16
+ "chalk": "^5.6.2",
17
+ "commander": "^14.0.2",
18
+ "fs-extra": "^11.3.3",
19
+ "prompts": "^2.4.2"
20
+ }
21
+ }
@@ -0,0 +1,16 @@
1
+ # EditorConfig is awesome: https://EditorConfig.org
2
+
3
+ # top-most EditorConfig file
4
+ root = true
5
+
6
+ [*]
7
+ indent_style = space
8
+ indent_size = 4
9
+ quote_type = double
10
+ end_of_line = crlf
11
+ charset = utf-8
12
+ trim_trailing_whitespace = false
13
+ insert_final_newline = false
14
+
15
+ [*.md]
16
+ indent_size = 3
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": ["next/core-web-vitals", "next/typescript"],
3
+ "rules": {
4
+ "indent": ["error", 4],
5
+ "semi": ["error", "always"],
6
+ "quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }],
7
+ "no-var": "error",
8
+ "no-console": "error"
9
+ }
10
+ }
@@ -0,0 +1 @@
1
+ yarn test
@@ -0,0 +1,14 @@
1
+ {
2
+ "printWidth": 140,
3
+ "tabWidth": 4,
4
+ "semi": true,
5
+ "singleQuote": false,
6
+ "quoteProps": "consistent",
7
+ "jsxSingleQuote": false,
8
+ "trailingComma": "all",
9
+ "bracketSameLine": false,
10
+ "endOfLine": "lf",
11
+ "proseWrap": "always",
12
+ "htmlWhitespaceSensitivity": "strict",
13
+ "plugins": ["prettier-plugin-tailwindcss", "@trivago/prettier-plugin-sort-imports", "prettier-plugin-css-order"]
14
+ }
@@ -0,0 +1 @@
1
+ nodeLinker: node-modules
@@ -0,0 +1,36 @@
1
+ This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
2
+
3
+ ## Getting Started
4
+
5
+ First, run the development server:
6
+
7
+ ```bash
8
+ npm run dev
9
+ # or
10
+ yarn dev
11
+ # or
12
+ pnpm dev
13
+ # or
14
+ bun dev
15
+ ```
16
+
17
+ Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18
+
19
+ You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20
+
21
+ This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
22
+
23
+ ## Learn More
24
+
25
+ To learn more about Next.js, take a look at the following resources:
26
+
27
+ - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28
+ - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29
+
30
+ You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
31
+
32
+ ## Deploy on Vercel
33
+
34
+ The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35
+
36
+ Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema.json",
3
+ "style": "new-york",
4
+ "rsc": true,
5
+ "tsx": true,
6
+ "tailwind": {
7
+ "config": "tailwind.config.ts",
8
+ "css": "src/styles/globals.css",
9
+ "baseColor": "neutral",
10
+ "cssVariables": true,
11
+ "prefix": ""
12
+ },
13
+ "iconLibrary": "lucide",
14
+ "aliases": {
15
+ "components": "@/components",
16
+ "utils": "@/lib/utils/cn.util",
17
+ "ui": "@/components/ui",
18
+ "lib": "@/lib",
19
+ "hooks": "@/lib/hooks"
20
+ },
21
+ "registries": {
22
+ "@shadcnblocks": "https://shadcnblocks.com/r/{name}.json",
23
+ "@svgl": "https://svgl.app/r/{name}.json"
24
+ }
25
+ }
@@ -0,0 +1,5 @@
1
+ describe('template spec', () => {
2
+ it('passes', () => {
3
+ cy.visit('https://example.cypress.io')
4
+ })
5
+ })
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "Using fixtures to represent data",
3
+ "email": "hello@cypress.io",
4
+ "body": "Fixtures are a great way to mock data for responses to routes"
5
+ }
@@ -0,0 +1,37 @@
1
+ /// <reference types="cypress" />
2
+ // ***********************************************
3
+ // This example commands.ts shows you how to
4
+ // create various custom commands and overwrite
5
+ // existing commands.
6
+ //
7
+ // For more comprehensive examples of custom
8
+ // commands please read more here:
9
+ // https://on.cypress.io/custom-commands
10
+ // ***********************************************
11
+ //
12
+ //
13
+ // -- This is a parent command --
14
+ // Cypress.Commands.add('login', (email, password) => { ... })
15
+ //
16
+ //
17
+ // -- This is a child command --
18
+ // Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
19
+ //
20
+ //
21
+ // -- This is a dual command --
22
+ // Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
23
+ //
24
+ //
25
+ // -- This will overwrite an existing command --
26
+ // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
27
+ //
28
+ // declare global {
29
+ // namespace Cypress {
30
+ // interface Chainable {
31
+ // login(email: string, password: string): Chainable<void>
32
+ // drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
33
+ // dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
34
+ // visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
35
+ // }
36
+ // }
37
+ // }
@@ -0,0 +1,17 @@
1
+ // ***********************************************************
2
+ // This example support/e2e.ts is processed and
3
+ // loaded automatically before your test files.
4
+ //
5
+ // This is a great place to put global configuration and
6
+ // behavior that modifies Cypress.
7
+ //
8
+ // You can change the location of this file or turn off
9
+ // automatically serving support files with the
10
+ // 'supportFile' configuration option.
11
+ //
12
+ // You can read more here:
13
+ // https://on.cypress.io/configuration
14
+ // ***********************************************************
15
+
16
+ // Import commands.js using ES2015 syntax:
17
+ import './commands'
@@ -0,0 +1,9 @@
1
+ import { defineConfig } from "cypress";
2
+
3
+ export default defineConfig({
4
+ e2e: {
5
+ setupNodeEvents(on, config) {
6
+ // implement node event listeners here
7
+ },
8
+ },
9
+ });
@@ -0,0 +1 @@
1
+ this for put all folder or files explain project
@@ -0,0 +1,4 @@
1
+ /** @type {import('next').NextConfig} */
2
+ const nextConfig = {};
3
+
4
+ export default nextConfig;