reposer 1.2.0 โ 1.3.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/README.md +32 -20
- data/lib/repose/ai_generator.rb +3 -1
- data/lib/repose/cli.rb +32 -1
- data/lib/repose/github_client.rb +14 -0
- data/lib/repose/project_files_generator.rb +418 -0
- data/lib/repose/version.rb +1 -1
- data/lib/repose.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f0dac6cfdb3aabf4d7ac21336a8418b2ccc4d5915f461741d5fda5d2e1c3249e
|
|
4
|
+
data.tar.gz: 40af3f7d39bf3d483c8746f94a6f8cc2dc458cd828aaa0c915f19feaea6bd208
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6987ccdfcf352db9513bf43dd633423cf436b6552e473f044e9e4458aa1123967d854797bd58edf313d1330509345750d07aa7639c8ed14f17592943bd21b796
|
|
7
|
+
data.tar.gz: a2459ea73a170297b74f4ef5487a4486ed674c0af182332cfb3ea0a642634f4f1462a37a2bb95433197f1e3686e19b7638e8dc1ee4fc86fcb5722f63f366996d
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.3.0] - 2025-11-21
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **License Preview**: License type now displayed in repository preview before creation
|
|
14
|
+
- **Language-Specific Project Files**: Automatic generation of boilerplate project files
|
|
15
|
+
- **Go**: `go.mod` and `.gitignore`
|
|
16
|
+
- **Python**: `requirements.txt` and `.gitignore` (with framework-specific dependencies for Django, Flask, FastAPI)
|
|
17
|
+
- **JavaScript/TypeScript**: `package.json`, `tsconfig.json` (TypeScript only), and `.gitignore`
|
|
18
|
+
- **Ruby**: `Gemfile` and `.gitignore` (with framework-specific gems for Rails, Sinatra)
|
|
19
|
+
- **Rust**: `Cargo.toml` and `.gitignore`
|
|
20
|
+
- **Java**: `pom.xml` (Spring Boot projects) and `.gitignore`
|
|
21
|
+
- **.NET**: `.gitignore`
|
|
22
|
+
- **PHP**: `composer.json` (with framework-specific dependencies for Laravel, Symfony) and `.gitignore`
|
|
23
|
+
- All generated files are automatically committed to the new repository
|
|
24
|
+
|
|
10
25
|
## [1.2.0] - 2025-11-21
|
|
11
26
|
|
|
12
27
|
### Added
|
data/README.md
CHANGED
|
@@ -16,14 +16,17 @@ Reposer is an intelligent CLI tool that uses AI to create GitHub repositories wi
|
|
|
16
16
|
- **๐ค AI-Generated Content**: Multiple AI providers (Gemini, Ollama) or template-based fallback
|
|
17
17
|
- **๐ฏ Smart Context Awareness**: Understands project purpose from name, language, and framework
|
|
18
18
|
- **๐ง Interactive CLI**: Guided prompts for missing information with beautiful UI
|
|
19
|
-
- **๐ Professional READMEs**: Creates comprehensive, well-structured documentation
|
|
20
|
-
- **๐ท๏ธ Intelligent Topics**: Generates relevant tags and topics automatically
|
|
19
|
+
- **๐ Professional READMEs**: Creates comprehensive, well-structured documentation with emojis
|
|
20
|
+
- **๐ท๏ธ 20 Intelligent Topics**: Generates up to 20 relevant tags and topics automatically
|
|
21
|
+
- **๐ Emoji Support**: Automatic emoji inclusion in descriptions and READMEs for visual appeal
|
|
22
|
+
- **๐ License Selection**: Interactive license picker (MIT, Apache, GPL, BSD, MPL, Unlicense)
|
|
23
|
+
- **๐๏ธ Language-Specific Project Files**: Auto-generates boilerplate files (go.mod, package.json, requirements.txt, etc.)
|
|
21
24
|
- **๐๏ธ Preview Mode**: See generated content before creating repository
|
|
22
25
|
- **๐ Secure Configuration**: Encrypted storage of API keys and tokens
|
|
23
|
-
- **โก Multi-Language Support**: Built-in support for
|
|
26
|
+
- **โก Multi-Language Support**: Built-in support for 15+ programming languages
|
|
24
27
|
- **๐จ Framework Intelligence**: Recognizes and suggests popular frameworks
|
|
25
28
|
- **๐ค Flexible AI Integration**: Choose between Gemini, Ollama, or template-based generation
|
|
26
|
-
- **๐งช
|
|
29
|
+
- **๐งช 90%+ Test Coverage**: Production-ready with comprehensive testing
|
|
27
30
|
|
|
28
31
|
## ๐ค AI Provider Options
|
|
29
32
|
|
|
@@ -106,14 +109,17 @@ reposer create api-server --language go --framework gin --private
|
|
|
106
109
|
# Preview before creating
|
|
107
110
|
reposer create ai-chatbot --language python --framework fastapi --dry-run
|
|
108
111
|
|
|
112
|
+
# Specify license type
|
|
113
|
+
reposer create api-server --language go --framework gin --license apache-2.0
|
|
114
|
+
|
|
109
115
|
# Custom description and topics
|
|
110
116
|
reposer create data-processor \
|
|
111
117
|
--language python \
|
|
112
118
|
--description "High-performance data processing pipeline" \
|
|
113
119
|
--topics ml,data,etl,python
|
|
114
120
|
|
|
115
|
-
# Framework-specific project
|
|
116
|
-
reposer create blog-api --language ruby --framework rails --private
|
|
121
|
+
# Framework-specific project with custom license
|
|
122
|
+
reposer create blog-api --language ruby --framework rails --license gpl-3.0 --private
|
|
117
123
|
```
|
|
118
124
|
|
|
119
125
|
### Interactive Experience
|
|
@@ -122,26 +128,29 @@ $ reposer create awesome-api
|
|
|
122
128
|
๐ฏ Reposer - AI Repository Creator
|
|
123
129
|
========================================
|
|
124
130
|
Primary programming language: ruby
|
|
125
|
-
Framework/Library: Rails
|
|
131
|
+
Framework/Library: Rails
|
|
132
|
+
Choose a license: MIT License (Permissive, most popular)
|
|
126
133
|
What will this project do? A REST API for user management
|
|
127
134
|
|
|
128
135
|
๐ Generated Repository Content
|
|
129
136
|
----------------------------------------
|
|
130
137
|
Name: awesome-api
|
|
131
|
-
Description: A Ruby Rails
|
|
132
|
-
Topics: ruby, rails, api, web,
|
|
138
|
+
Description: ๐ A Ruby Rails REST API for user management ๐
|
|
139
|
+
Topics: ruby, rails, api, rest, web, backend, database, authentication,
|
|
140
|
+
mvc, ruby-on-rails, sinatra, bundler, gem, postgresql, redis,
|
|
141
|
+
jwt, oauth, microservices, docker, kubernetes
|
|
133
142
|
|
|
134
143
|
README Preview:
|
|
135
|
-
# Awesome Api
|
|
144
|
+
# ๐ Awesome Api
|
|
136
145
|
|
|
137
|
-
A Ruby Rails project for user management with comprehensive
|
|
146
|
+
๐ A Ruby Rails project for user management with comprehensive
|
|
138
147
|
API endpoints and authentication.
|
|
139
148
|
|
|
140
|
-
## Features
|
|
141
|
-
- User authentication and authorization
|
|
142
|
-
- RESTful API design
|
|
143
|
-
- Database integration
|
|
144
|
-
- Comprehensive test coverage
|
|
149
|
+
## โจ Features
|
|
150
|
+
- ๐ ๏ธ User authentication and authorization
|
|
151
|
+
- ๐ RESTful API design
|
|
152
|
+
- ๐ Database integration
|
|
153
|
+
- โ
Comprehensive test coverage
|
|
145
154
|
|
|
146
155
|
Create repository? (Y/n) y
|
|
147
156
|
โ
Repository created successfully!
|
|
@@ -197,16 +206,18 @@ Create a new repository with AI assistance.
|
|
|
197
206
|
- `--language LANG` - Primary programming language
|
|
198
207
|
- `--framework FRAMEWORK` - Framework or library to use
|
|
199
208
|
- `--description TEXT` - Custom description override
|
|
209
|
+
- `--license LICENSE` - License type (mit, apache-2.0, gpl-3.0, bsd-3-clause, mpl-2.0, unlicense)
|
|
200
210
|
- `--private` - Create private repository (default: public)
|
|
201
|
-
- `--topics TOPIC1,TOPIC2` - Custom topics/tags
|
|
211
|
+
- `--topics TOPIC1,TOPIC2` - Custom topics/tags (up to 20)
|
|
202
212
|
- `--dry-run` - Preview without creating
|
|
203
213
|
- `--template URL` - Use repository template
|
|
204
214
|
|
|
205
215
|
**Examples:**
|
|
206
216
|
```bash
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
217
|
+
reposer create web-app --language typescript --framework react
|
|
218
|
+
reposer create microservice --language go --license apache-2.0 --private
|
|
219
|
+
reposer create ml-model --language python --topics ml,ai,data-science --dry-run
|
|
220
|
+
reposer create api-server --language ruby --framework rails --license gpl-3.0
|
|
210
221
|
```
|
|
211
222
|
|
|
212
223
|
### `repose configure`
|
|
@@ -472,6 +483,7 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
|
|
472
483
|
|
|
473
484
|
## ๐ท๏ธ Version History
|
|
474
485
|
|
|
486
|
+
- **v1.2.0** (2025-11-21): Major upgrade with emoji support, 20-topic generation, license selection, and improved GitHub authentication
|
|
475
487
|
- **v1.1.0** (2025-01-20): Published as `repo-composer` (gem name change), AI provider integration (Gemini + Ollama) with 96.63% test coverage
|
|
476
488
|
- **v1.0.0** (2025-11-07): Production release with 98.39% test coverage (as `repose`)
|
|
477
489
|
- **v0.1.0** (2024-11-07): Initial release with core functionality
|
data/lib/repose/ai_generator.rb
CHANGED
|
@@ -17,7 +17,9 @@ module Repose
|
|
|
17
17
|
description: generate_description(context),
|
|
18
18
|
topics: generate_topics(context),
|
|
19
19
|
readme: generate_readme(context),
|
|
20
|
-
license: context[:license]
|
|
20
|
+
license: context[:license],
|
|
21
|
+
language: context[:language],
|
|
22
|
+
framework: context[:framework]
|
|
21
23
|
}
|
|
22
24
|
end
|
|
23
25
|
|
data/lib/repose/cli.rb
CHANGED
|
@@ -155,7 +155,13 @@ module Repose
|
|
|
155
155
|
"java" => ["Spring Boot", "Quarkus", "Micronaut"],
|
|
156
156
|
"go" => ["Gin", "Echo", "Fiber", "Chi"],
|
|
157
157
|
"rust" => ["Actix", "Axum", "Warp", "Rocket"],
|
|
158
|
-
"swift" => ["Vapor", "Perfect", "Kitura"]
|
|
158
|
+
"swift" => ["Vapor", "Perfect", "Kitura"],
|
|
159
|
+
"php" => ["Laravel", "Symfony", "CodeIgniter", "CakePHP"],
|
|
160
|
+
"c#" => [".NET Core", "ASP.NET", "Blazor"],
|
|
161
|
+
"c++" => ["Qt", "Boost", "Poco"],
|
|
162
|
+
"c" => ["GTK", "libuv", "SDL2"],
|
|
163
|
+
"scala" => ["Play", "Akka", "Lagom"],
|
|
164
|
+
"kotlin" => ["Ktor", "Spring Boot", "Micronaut"]
|
|
159
165
|
}
|
|
160
166
|
|
|
161
167
|
frameworks[language] || []
|
|
@@ -167,6 +173,7 @@ module Repose
|
|
|
167
173
|
|
|
168
174
|
puts pastel.bold("Name: ") + content[:name]
|
|
169
175
|
puts pastel.bold("Description: ") + content[:description]
|
|
176
|
+
puts pastel.bold("License: ") + (content[:license] || "MIT").upcase
|
|
170
177
|
puts pastel.bold("Topics: ") + content[:topics].join(", ")
|
|
171
178
|
|
|
172
179
|
puts "\n" + pastel.bold("README Preview:")
|
|
@@ -190,6 +197,30 @@ module Repose
|
|
|
190
197
|
)
|
|
191
198
|
|
|
192
199
|
spinner.success("โ
")
|
|
200
|
+
|
|
201
|
+
# Create language-specific project files
|
|
202
|
+
project_files = ProjectFilesGenerator.generate(
|
|
203
|
+
language: content[:language],
|
|
204
|
+
framework: content[:framework],
|
|
205
|
+
name: name
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
if project_files.any?
|
|
209
|
+
file_spinner = TTY::Spinner.new("[:spinner] Adding project files...", format: :dots)
|
|
210
|
+
file_spinner.auto_spin
|
|
211
|
+
|
|
212
|
+
project_files.each do |file_path, file_content|
|
|
213
|
+
github_client.create_file(
|
|
214
|
+
repo.full_name,
|
|
215
|
+
file_path,
|
|
216
|
+
"Add #{file_path}",
|
|
217
|
+
file_content
|
|
218
|
+
)
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
file_spinner.success("โ
")
|
|
222
|
+
end
|
|
223
|
+
|
|
193
224
|
puts pastel.green("Repository created successfully!")
|
|
194
225
|
puts pastel.cyan("๐ #{repo.html_url}")
|
|
195
226
|
rescue => e
|
data/lib/repose/github_client.rb
CHANGED
|
@@ -73,6 +73,20 @@ module Repose
|
|
|
73
73
|
raise Errors::GitHubError, "Failed to fetch user info: #{e.message}"
|
|
74
74
|
end
|
|
75
75
|
|
|
76
|
+
def create_file(repo_name, path, message, content)
|
|
77
|
+
@client.create_contents(
|
|
78
|
+
repo_name,
|
|
79
|
+
path,
|
|
80
|
+
message,
|
|
81
|
+
content
|
|
82
|
+
)
|
|
83
|
+
rescue Octokit::UnprocessableEntity => e
|
|
84
|
+
# File might already exist, skip it
|
|
85
|
+
puts "Skipping #{path} (already exists)"
|
|
86
|
+
rescue Octokit::Error => e
|
|
87
|
+
raise Errors::GitHubError, "Failed to create file #{path}: #{e.message}"
|
|
88
|
+
end
|
|
89
|
+
|
|
76
90
|
private
|
|
77
91
|
|
|
78
92
|
def normalize_license_key(license)
|
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
module Repose
|
|
4
|
+
class ProjectFilesGenerator
|
|
5
|
+
def self.generate(language:, framework:, name:)
|
|
6
|
+
files = {}
|
|
7
|
+
|
|
8
|
+
case language&.downcase
|
|
9
|
+
when 'go', 'golang'
|
|
10
|
+
files.merge!(generate_go_files(name))
|
|
11
|
+
when 'python'
|
|
12
|
+
files.merge!(generate_python_files(framework))
|
|
13
|
+
when 'javascript', 'typescript', 'node.js', 'nodejs'
|
|
14
|
+
files.merge!(generate_javascript_files(name, language))
|
|
15
|
+
when 'ruby'
|
|
16
|
+
files.merge!(generate_ruby_files(framework))
|
|
17
|
+
when 'rust'
|
|
18
|
+
files.merge!(generate_rust_files(name))
|
|
19
|
+
when 'java'
|
|
20
|
+
files.merge!(generate_java_files(name, framework))
|
|
21
|
+
when 'c#', 'csharp', 'dotnet', '.net'
|
|
22
|
+
files.merge!(generate_dotnet_files(name))
|
|
23
|
+
when 'php'
|
|
24
|
+
files.merge!(generate_php_files(framework))
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
files
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
private
|
|
31
|
+
|
|
32
|
+
def self.generate_go_files(name)
|
|
33
|
+
module_path = "github.com/user/#{name}"
|
|
34
|
+
|
|
35
|
+
{
|
|
36
|
+
'go.mod' => <<~GO_MOD,
|
|
37
|
+
module #{module_path}
|
|
38
|
+
|
|
39
|
+
go 1.21
|
|
40
|
+
|
|
41
|
+
require (
|
|
42
|
+
\t// Add your dependencies here
|
|
43
|
+
)
|
|
44
|
+
GO_MOD
|
|
45
|
+
'.gitignore' => <<~GITIGNORE
|
|
46
|
+
# Binaries for programs and plugins
|
|
47
|
+
*.exe
|
|
48
|
+
*.exe~
|
|
49
|
+
*.dll
|
|
50
|
+
*.so
|
|
51
|
+
*.dylib
|
|
52
|
+
|
|
53
|
+
# Test binary, built with `go test -c`
|
|
54
|
+
*.test
|
|
55
|
+
|
|
56
|
+
# Output of the go coverage tool
|
|
57
|
+
*.out
|
|
58
|
+
|
|
59
|
+
# Dependency directories
|
|
60
|
+
vendor/
|
|
61
|
+
|
|
62
|
+
# Go workspace file
|
|
63
|
+
go.work
|
|
64
|
+
GITIGNORE
|
|
65
|
+
}
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def self.generate_python_files(framework)
|
|
69
|
+
files = {
|
|
70
|
+
'requirements.txt' => <<~REQUIREMENTS,
|
|
71
|
+
# Add your dependencies here
|
|
72
|
+
# Example:
|
|
73
|
+
# requests>=2.31.0
|
|
74
|
+
# flask>=3.0.0
|
|
75
|
+
REQUIREMENTS
|
|
76
|
+
'.gitignore' => <<~GITIGNORE
|
|
77
|
+
# Byte-compiled / optimized / DLL files
|
|
78
|
+
__pycache__/
|
|
79
|
+
*.py[cod]
|
|
80
|
+
*$py.class
|
|
81
|
+
|
|
82
|
+
# Virtual environments
|
|
83
|
+
venv/
|
|
84
|
+
env/
|
|
85
|
+
ENV/
|
|
86
|
+
.venv
|
|
87
|
+
|
|
88
|
+
# Distribution / packaging
|
|
89
|
+
dist/
|
|
90
|
+
build/
|
|
91
|
+
*.egg-info/
|
|
92
|
+
|
|
93
|
+
# IDEs
|
|
94
|
+
.idea/
|
|
95
|
+
.vscode/
|
|
96
|
+
*.swp
|
|
97
|
+
*.swo
|
|
98
|
+
|
|
99
|
+
# Testing
|
|
100
|
+
.pytest_cache/
|
|
101
|
+
.coverage
|
|
102
|
+
htmlcov/
|
|
103
|
+
GITIGNORE
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if framework&.downcase&.include?('django')
|
|
107
|
+
files['requirements.txt'] = "django>=4.2.0\ndjango-environ>=0.11.0\npsycopg2-binary>=2.9.0\n"
|
|
108
|
+
elsif framework&.downcase&.include?('flask')
|
|
109
|
+
files['requirements.txt'] = "flask>=3.0.0\nflask-cors>=4.0.0\npython-dotenv>=1.0.0\n"
|
|
110
|
+
elsif framework&.downcase&.include?('fastapi')
|
|
111
|
+
files['requirements.txt'] = "fastapi>=0.104.0\nuvicorn[standard]>=0.24.0\npydantic>=2.5.0\n"
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
files
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
def self.generate_javascript_files(name, language)
|
|
118
|
+
is_typescript = language&.downcase&.include?('typescript')
|
|
119
|
+
|
|
120
|
+
package_json = {
|
|
121
|
+
name: name,
|
|
122
|
+
version: '1.0.0',
|
|
123
|
+
description: '',
|
|
124
|
+
main: is_typescript ? 'dist/index.js' : 'index.js',
|
|
125
|
+
scripts: {
|
|
126
|
+
test: 'echo "Error: no test specified" && exit 1'
|
|
127
|
+
},
|
|
128
|
+
keywords: [],
|
|
129
|
+
author: '',
|
|
130
|
+
license: 'MIT'
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if is_typescript
|
|
134
|
+
package_json[:scripts][:build] = 'tsc'
|
|
135
|
+
package_json[:scripts][:dev] = 'ts-node src/index.ts'
|
|
136
|
+
package_json[:devDependencies] = {
|
|
137
|
+
typescript: '^5.3.0',
|
|
138
|
+
'@types/node': '^20.10.0',
|
|
139
|
+
'ts-node': '^10.9.0'
|
|
140
|
+
}
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
files = {
|
|
144
|
+
'package.json' => JSON.pretty_generate(package_json),
|
|
145
|
+
'.gitignore' => <<~GITIGNORE
|
|
146
|
+
# Dependencies
|
|
147
|
+
node_modules/
|
|
148
|
+
|
|
149
|
+
# Production
|
|
150
|
+
dist/
|
|
151
|
+
build/
|
|
152
|
+
|
|
153
|
+
# Environment
|
|
154
|
+
.env
|
|
155
|
+
.env.local
|
|
156
|
+
|
|
157
|
+
# Logs
|
|
158
|
+
logs/
|
|
159
|
+
*.log
|
|
160
|
+
npm-debug.log*
|
|
161
|
+
|
|
162
|
+
# IDEs
|
|
163
|
+
.idea/
|
|
164
|
+
.vscode/
|
|
165
|
+
*.swp
|
|
166
|
+
|
|
167
|
+
# OS
|
|
168
|
+
.DS_Store
|
|
169
|
+
Thumbs.db
|
|
170
|
+
GITIGNORE
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if is_typescript
|
|
174
|
+
files['tsconfig.json'] = JSON.pretty_generate({
|
|
175
|
+
compilerOptions: {
|
|
176
|
+
target: 'ES2020',
|
|
177
|
+
module: 'commonjs',
|
|
178
|
+
lib: ['ES2020'],
|
|
179
|
+
outDir: './dist',
|
|
180
|
+
rootDir: './src',
|
|
181
|
+
strict: true,
|
|
182
|
+
esModuleInterop: true,
|
|
183
|
+
skipLibCheck: true,
|
|
184
|
+
forceConsistentCasingInFileNames: true
|
|
185
|
+
},
|
|
186
|
+
include: ['src/**/*'],
|
|
187
|
+
exclude: ['node_modules']
|
|
188
|
+
}, indent: ' ')
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
files
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
def self.generate_ruby_files(framework)
|
|
195
|
+
gemfile = if framework&.downcase&.include?('rails')
|
|
196
|
+
<<~GEMFILE
|
|
197
|
+
source 'https://rubygems.org'
|
|
198
|
+
ruby '~> 3.2'
|
|
199
|
+
|
|
200
|
+
gem 'rails', '~> 7.1'
|
|
201
|
+
gem 'pg', '~> 1.5'
|
|
202
|
+
gem 'puma', '~> 6.0'
|
|
203
|
+
|
|
204
|
+
group :development, :test do
|
|
205
|
+
gem 'rspec-rails'
|
|
206
|
+
gem 'rubocop'
|
|
207
|
+
end
|
|
208
|
+
GEMFILE
|
|
209
|
+
elsif framework&.downcase&.include?('sinatra')
|
|
210
|
+
<<~GEMFILE
|
|
211
|
+
source 'https://rubygems.org'
|
|
212
|
+
ruby '~> 3.2'
|
|
213
|
+
|
|
214
|
+
gem 'sinatra', '~> 3.1'
|
|
215
|
+
gem 'sinatra-contrib', '~> 3.1'
|
|
216
|
+
gem 'puma', '~> 6.0'
|
|
217
|
+
|
|
218
|
+
group :development, :test do
|
|
219
|
+
gem 'rspec'
|
|
220
|
+
gem 'rack-test'
|
|
221
|
+
gem 'rubocop'
|
|
222
|
+
end
|
|
223
|
+
GEMFILE
|
|
224
|
+
else
|
|
225
|
+
<<~GEMFILE
|
|
226
|
+
source 'https://rubygems.org'
|
|
227
|
+
ruby '~> 3.2'
|
|
228
|
+
|
|
229
|
+
# Add your dependencies here
|
|
230
|
+
|
|
231
|
+
group :development, :test do
|
|
232
|
+
gem 'rspec'
|
|
233
|
+
gem 'rubocop'
|
|
234
|
+
end
|
|
235
|
+
GEMFILE
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
{
|
|
239
|
+
'Gemfile' => gemfile,
|
|
240
|
+
'.gitignore' => <<~GITIGNORE
|
|
241
|
+
# Bundler
|
|
242
|
+
.bundle/
|
|
243
|
+
vendor/bundle/
|
|
244
|
+
|
|
245
|
+
# Logs
|
|
246
|
+
log/*.log
|
|
247
|
+
tmp/
|
|
248
|
+
|
|
249
|
+
# Database
|
|
250
|
+
*.sqlite3
|
|
251
|
+
*.db
|
|
252
|
+
|
|
253
|
+
# Environment
|
|
254
|
+
.env
|
|
255
|
+
.env.local
|
|
256
|
+
|
|
257
|
+
# IDEs
|
|
258
|
+
.idea/
|
|
259
|
+
.vscode/
|
|
260
|
+
*.swp
|
|
261
|
+
GITIGNORE
|
|
262
|
+
}
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
def self.generate_rust_files(name)
|
|
266
|
+
{
|
|
267
|
+
'Cargo.toml' => <<~CARGO_TOML,
|
|
268
|
+
[package]
|
|
269
|
+
name = "#{name.tr('-', '_')}"
|
|
270
|
+
version = "0.1.0"
|
|
271
|
+
edition = "2021"
|
|
272
|
+
|
|
273
|
+
[dependencies]
|
|
274
|
+
# Add your dependencies here
|
|
275
|
+
CARGO_TOML
|
|
276
|
+
'.gitignore' => <<~GITIGNORE
|
|
277
|
+
# Build output
|
|
278
|
+
/target/
|
|
279
|
+
Cargo.lock
|
|
280
|
+
|
|
281
|
+
# IDE
|
|
282
|
+
.idea/
|
|
283
|
+
.vscode/
|
|
284
|
+
*.swp
|
|
285
|
+
GITIGNORE
|
|
286
|
+
}
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
def self.generate_java_files(name, framework)
|
|
290
|
+
files = {
|
|
291
|
+
'.gitignore' => <<~GITIGNORE
|
|
292
|
+
# Compiled class files
|
|
293
|
+
*.class
|
|
294
|
+
target/
|
|
295
|
+
out/
|
|
296
|
+
|
|
297
|
+
# Package files
|
|
298
|
+
*.jar
|
|
299
|
+
*.war
|
|
300
|
+
*.ear
|
|
301
|
+
|
|
302
|
+
# IDE
|
|
303
|
+
.idea/
|
|
304
|
+
.vscode/
|
|
305
|
+
*.iml
|
|
306
|
+
.project
|
|
307
|
+
.classpath
|
|
308
|
+
.settings/
|
|
309
|
+
|
|
310
|
+
# Build tools
|
|
311
|
+
.gradle/
|
|
312
|
+
build/
|
|
313
|
+
GITIGNORE
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
if framework&.downcase&.include?('spring')
|
|
317
|
+
files['pom.xml'] = <<~POM_XML
|
|
318
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
319
|
+
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
320
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
321
|
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
|
322
|
+
http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
323
|
+
<modelVersion>4.0.0</modelVersion>
|
|
324
|
+
|
|
325
|
+
<groupId>com.example</groupId>
|
|
326
|
+
<artifactId>#{name}</artifactId>
|
|
327
|
+
<version>0.1.0</version>
|
|
328
|
+
|
|
329
|
+
<parent>
|
|
330
|
+
<groupId>org.springframework.boot</groupId>
|
|
331
|
+
<artifactId>spring-boot-starter-parent</artifactId>
|
|
332
|
+
<version>3.2.0</version>
|
|
333
|
+
</parent>
|
|
334
|
+
|
|
335
|
+
<dependencies>
|
|
336
|
+
<dependency>
|
|
337
|
+
<groupId>org.springframework.boot</groupId>
|
|
338
|
+
<artifactId>spring-boot-starter-web</artifactId>
|
|
339
|
+
</dependency>
|
|
340
|
+
</dependencies>
|
|
341
|
+
</project>
|
|
342
|
+
POM_XML
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
files
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
def self.generate_dotnet_files(name)
|
|
349
|
+
{
|
|
350
|
+
'.gitignore' => <<~GITIGNORE
|
|
351
|
+
# Build output
|
|
352
|
+
bin/
|
|
353
|
+
obj/
|
|
354
|
+
|
|
355
|
+
# User-specific files
|
|
356
|
+
*.suo
|
|
357
|
+
*.user
|
|
358
|
+
*.userosscache
|
|
359
|
+
*.sln.docstates
|
|
360
|
+
|
|
361
|
+
# NuGet
|
|
362
|
+
*.nupkg
|
|
363
|
+
*.snupkg
|
|
364
|
+
packages/
|
|
365
|
+
|
|
366
|
+
# IDE
|
|
367
|
+
.vs/
|
|
368
|
+
.vscode/
|
|
369
|
+
GITIGNORE
|
|
370
|
+
}
|
|
371
|
+
end
|
|
372
|
+
|
|
373
|
+
def self.generate_php_files(framework)
|
|
374
|
+
composer_json = {
|
|
375
|
+
name: 'vendor/package',
|
|
376
|
+
description: '',
|
|
377
|
+
type: 'project',
|
|
378
|
+
require: {
|
|
379
|
+
'php': '>=8.1'
|
|
380
|
+
},
|
|
381
|
+
'require-dev': {
|
|
382
|
+
'phpunit/phpunit': '^10.0'
|
|
383
|
+
},
|
|
384
|
+
autoload: {
|
|
385
|
+
'psr-4': {
|
|
386
|
+
'App\\': 'src/'
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
if framework&.downcase&.include?('laravel')
|
|
392
|
+
composer_json[:require]['laravel/framework'] = '^10.0'
|
|
393
|
+
elsif framework&.downcase&.include?('symfony')
|
|
394
|
+
composer_json[:require]['symfony/framework-bundle'] = '^6.4'
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
{
|
|
398
|
+
'composer.json' => JSON.pretty_generate(composer_json, indent: ' '),
|
|
399
|
+
'.gitignore' => <<~GITIGNORE
|
|
400
|
+
# Dependencies
|
|
401
|
+
/vendor/
|
|
402
|
+
|
|
403
|
+
# Environment
|
|
404
|
+
.env
|
|
405
|
+
.env.local
|
|
406
|
+
|
|
407
|
+
# Logs
|
|
408
|
+
*.log
|
|
409
|
+
|
|
410
|
+
# IDE
|
|
411
|
+
.idea/
|
|
412
|
+
.vscode/
|
|
413
|
+
*.swp
|
|
414
|
+
GITIGNORE
|
|
415
|
+
}
|
|
416
|
+
end
|
|
417
|
+
end
|
|
418
|
+
end
|
data/lib/repose/version.rb
CHANGED
data/lib/repose.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: reposer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Wesley Scholl
|
|
@@ -155,6 +155,7 @@ files:
|
|
|
155
155
|
- lib/repose/config.rb
|
|
156
156
|
- lib/repose/errors.rb
|
|
157
157
|
- lib/repose/github_client.rb
|
|
158
|
+
- lib/repose/project_files_generator.rb
|
|
158
159
|
- lib/repose/version.rb
|
|
159
160
|
- recreate_repo.rb
|
|
160
161
|
- setup_github_repo.rb
|