Hanzo Dev commited on
Commit
ee094a8
·
1 Parent(s): 366fe97

Remove templates-repos submodules to fix HF cloning issue

Browse files
.gitignore CHANGED
@@ -32,4 +32,7 @@ yarn-error.log*
32
 
33
  # typescript
34
  *.tsbuildinfo
35
- next-env.d.ts
 
 
 
 
32
 
33
  # typescript
34
  *.tsbuildinfo
35
+ next-env.d.ts
36
+
37
+ # Template repositories (managed as submodules)
38
+ templates-repos/
.gitmodules DELETED
@@ -1,36 +0,0 @@
1
- [submodule "templates-repos/devforge"]
2
- path = templates-repos/devforge
3
- url = https://huggingface.co/spaces/hanzo-community/devforge
4
- [submodule "templates-repos/mobilefirst"]
5
- path = templates-repos/mobilefirst
6
- url = https://huggingface.co/spaces/hanzo-community/mobilefirst
7
- [submodule "templates-repos/saasify"]
8
- path = templates-repos/saasify
9
- url = https://huggingface.co/spaces/hanzo-community/saasify
10
- [submodule "templates-repos/startupkit"]
11
- path = templates-repos/startupkit
12
- url = https://huggingface.co/spaces/hanzo-community/startupkit
13
- [submodule "templates-repos/analyticsdash"]
14
- path = templates-repos/analyticsdash
15
- url = https://huggingface.co/spaces/hanzo-community/analyticsdash
16
- [submodule "templates-repos/blog"]
17
- path = templates-repos/blog
18
- url = https://huggingface.co/spaces/hanzo-community/blog
19
- [submodule "templates-repos/changelog"]
20
- path = templates-repos/changelog
21
- url = https://huggingface.co/spaces/hanzo-community/changelog
22
- [submodule "templates-repos/portfolio"]
23
- path = templates-repos/portfolio
24
- url = https://huggingface.co/spaces/hanzo-community/portfolio
25
- [submodule "templates-repos/ai-chat"]
26
- path = templates-repos/ai-chat
27
- url = https://huggingface.co/spaces/hanzo-community/ai-chat
28
- [submodule "templates-repos/search"]
29
- path = templates-repos/search
30
- url = https://huggingface.co/spaces/hanzo-community/search
31
- [submodule "templates-repos/ecommerce"]
32
- path = templates-repos/ecommerce
33
- url = https://huggingface.co/spaces/hanzo-community/ecommerce
34
- [submodule "templates-repos/api-docs"]
35
- path = templates-repos/api-docs
36
- url = https://huggingface.co/spaces/hanzo-community/api-docs
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates-repos/ai-chat DELETED
@@ -1 +0,0 @@
1
- Subproject commit 31484f5d47f625ec07ac42d0dc0acd11b2d08fa5
 
 
templates-repos/analyticsdash DELETED
@@ -1 +0,0 @@
1
- Subproject commit 32bc6edbd4a7aff6c11abf54c3911433b11e49b7
 
 
templates-repos/api-docs DELETED
@@ -1 +0,0 @@
1
- Subproject commit 5ae1198be0900e849c3dbde7f40856c3a005066a
 
 
templates-repos/blog DELETED
@@ -1 +0,0 @@
1
- Subproject commit 2c8a27307be3a1a89656c009d4ff692911f6d395
 
 
templates-repos/changelog DELETED
@@ -1 +0,0 @@
1
- Subproject commit 46fc3ab88b73feb9cd3f2ffd6ed323f80f82e580
 
 
templates-repos/devforge DELETED
@@ -1 +0,0 @@
1
- Subproject commit 9c5df0d43ede0a8210e2caf50a8a3f8ab1af43d9
 
 
templates-repos/ecommerce DELETED
@@ -1 +0,0 @@
1
- Subproject commit 4172f8b589e6a16fd0dddaae34df7251642d51ab
 
 
templates-repos/fix-dependencies.sh DELETED
@@ -1,102 +0,0 @@
1
- #!/bin/bash
2
-
3
- # List of all templates
4
- TEMPLATES=(
5
- "devforge"
6
- "mobilefirst"
7
- "saasify"
8
- "startupkit"
9
- "analyticsdash"
10
- "blog"
11
- "changelog"
12
- "ai-chat"
13
- "search"
14
- "ecommerce"
15
- "api-docs"
16
- )
17
-
18
- # Base directory
19
- BASE_DIR="/Users/z/work/hanzo/templates/gallery/templates-repos"
20
-
21
- echo "Fixing dependency issues in all Hanzo templates..."
22
-
23
- for template in "${TEMPLATES[@]}"; do
24
- TEMPLATE_DIR="$BASE_DIR/$template"
25
-
26
- if [ -d "$TEMPLATE_DIR" ]; then
27
- echo "Processing template: $template"
28
-
29
- # Update package.json to add --legacy-peer-deps to npm scripts
30
- if [ -f "$TEMPLATE_DIR/package.json" ]; then
31
- echo " - Updating package.json..."
32
- # Use node to update package.json safely
33
- node -e "
34
- const fs = require('fs');
35
- const path = '$TEMPLATE_DIR/package.json';
36
- const pkg = JSON.parse(fs.readFileSync(path, 'utf8'));
37
-
38
- // Add install script with legacy-peer-deps
39
- pkg.scripts = pkg.scripts || {};
40
- pkg.scripts.install = 'npm install --legacy-peer-deps';
41
- pkg.scripts.ci = 'npm ci --legacy-peer-deps';
42
-
43
- // Update build script to ensure dependencies are installed properly
44
- if (pkg.scripts.build && !pkg.scripts.build.includes('legacy-peer-deps')) {
45
- pkg.scripts['prebuild'] = 'npm install --legacy-peer-deps || true';
46
- }
47
-
48
- fs.writeFileSync(path, JSON.stringify(pkg, null, 2) + '\\n');
49
- console.log(' ✓ package.json updated');
50
- "
51
- fi
52
-
53
- # Update Dockerfile to use --legacy-peer-deps
54
- if [ -f "$TEMPLATE_DIR/Dockerfile" ]; then
55
- echo " - Updating Dockerfile..."
56
- # Create updated Dockerfile
57
- cat > "$TEMPLATE_DIR/Dockerfile" << 'EOF'
58
- FROM node:20-slim
59
-
60
- WORKDIR /app
61
-
62
- # Copy package files
63
- COPY package*.json ./
64
-
65
- # Install dependencies with legacy peer deps flag
66
- RUN npm ci --legacy-peer-deps || npm install --legacy-peer-deps
67
-
68
- # Copy application files
69
- COPY . .
70
-
71
- # Build the application
72
- RUN npm run build
73
-
74
- # Expose port
75
- EXPOSE 3000
76
-
77
- # Start the application
78
- CMD ["npm", "start"]
79
- EOF
80
- echo " ✓ Dockerfile updated"
81
- fi
82
-
83
- # Create or update .npmrc to set legacy-peer-deps by default
84
- echo " - Creating/updating .npmrc..."
85
- echo "legacy-peer-deps=true" > "$TEMPLATE_DIR/.npmrc"
86
- echo " ✓ .npmrc created"
87
-
88
- echo " ✓ Template $template fixed"
89
- echo ""
90
- else
91
- echo " ⚠ Template directory not found: $template"
92
- fi
93
- done
94
-
95
- echo "All templates have been updated!"
96
- echo ""
97
- echo "Summary of changes:"
98
- echo "1. Added 'install' and 'ci' scripts with --legacy-peer-deps flag to package.json"
99
- echo "2. Updated Dockerfile to use 'npm ci --legacy-peer-deps'"
100
- echo "3. Created .npmrc file with legacy-peer-deps=true"
101
- echo ""
102
- echo "You can now build Docker images without peer dependency conflicts."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates-repos/fix-infinite-loop.sh DELETED
@@ -1,62 +0,0 @@
1
- #!/bin/bash
2
-
3
- # List of all templates
4
- TEMPLATES=(
5
- "devforge"
6
- "mobilefirst"
7
- "saasify"
8
- "startupkit"
9
- "analyticsdash"
10
- "blog"
11
- "changelog"
12
- "ai-chat"
13
- "search"
14
- "ecommerce"
15
- "api-docs"
16
- )
17
-
18
- # Base directory
19
- BASE_DIR="/Users/z/work/hanzo/templates/gallery/templates-repos"
20
-
21
- echo "Fixing infinite loop issue in all templates..."
22
-
23
- for template in "${TEMPLATES[@]}"; do
24
- TEMPLATE_DIR="$BASE_DIR/$template"
25
-
26
- if [ -d "$TEMPLATE_DIR" ]; then
27
- echo "Processing template: $template"
28
-
29
- # Update package.json to remove the problematic install script
30
- if [ -f "$TEMPLATE_DIR/package.json" ]; then
31
- echo " - Updating package.json..."
32
- # Use node to update package.json safely
33
- node -e "
34
- const fs = require('fs');
35
- const path = '$TEMPLATE_DIR/package.json';
36
- const pkg = JSON.parse(fs.readFileSync(path, 'utf8'));
37
-
38
- // Remove the problematic install script
39
- if (pkg.scripts && pkg.scripts.install) {
40
- delete pkg.scripts.install;
41
- }
42
-
43
- // Keep the ci script for CI/CD
44
- pkg.scripts = pkg.scripts || {};
45
- pkg.scripts.ci = 'npm ci --legacy-peer-deps';
46
-
47
- // Remove prebuild if it exists
48
- if (pkg.scripts && pkg.scripts.prebuild) {
49
- delete pkg.scripts.prebuild;
50
- }
51
-
52
- fs.writeFileSync(path, JSON.stringify(pkg, null, 2) + '\\n');
53
- console.log(' ✓ package.json fixed');
54
- "
55
- fi
56
-
57
- echo " ✓ Template $template fixed"
58
- echo ""
59
- fi
60
- done
61
-
62
- echo "All templates have been fixed!"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates-repos/mobilefirst DELETED
@@ -1 +0,0 @@
1
- Subproject commit 367ef5e766cb5fb0596586a0bd9a412008ab99c5
 
 
templates-repos/saasify DELETED
@@ -1 +0,0 @@
1
- Subproject commit 2c0e351b124c85417c3b24da88279df7d591365f
 
 
templates-repos/search DELETED
@@ -1 +0,0 @@
1
- Subproject commit aa44244897828df196a444d04be276c6d59b5660
 
 
templates-repos/startupkit DELETED
@@ -1 +0,0 @@
1
- Subproject commit 107dba003e904057dd84f25e563b58005aab328b