Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Enable Custom 'package.json' Templates for Streamlined Glee Project Initialization #845

Open
2 tasks done
techmannih opened this issue Sep 16, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@techmannih
Copy link

Why do we need this improvement?

I propose adding support for customizable package.json templates in Glee projects. This enhancement will allow users to specify and use their own package.json configurations during project creation, significantly streamlining the setup process and improving the overall user experience.

How will this change help?

Current Behavior:

Currently, Glee generates a package.json file with default settings when a new project is created. Users then need to manually edit this file to adjust dependencies, scripts, and other settings to match their specific project requirements. Below is an example of the default package.json provided:

{
  "name": "glee-hello-world",
  "version": "0.1.0",
  "description": "Hello world app to improve Glee onboarding",
  "type": "module",
  "engines": {
    "node": ">=14.15.1"
  },
  "scripts": {
    "dev": "glee dev",
    "start": "glee start"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/asyncapi/glee-hello-world.git"
  },
  "keywords": [
    "glee"
  ],
  "author": "Fran Mendez",
  "license": "Apache-2.0",
  "bugs": {
    "url": "https://github.com/asyncapi/glee-hello-world/issues"
  },
  "homepage": "https://github.com/asyncapi/glee-hello-world#readme",
  "dependencies": {
    "@asyncapi/glee": "^0.37.7"
  },
  "devDependencies": {
    "@types/node": "^20.5.9"
  }
}

Proposed Enhancement:

Introduce a feature to specify a custom package.json template during project creation. This can be achieved via a command-line option or configuration file, allowing users to predefine their project setup and avoid manual modifications. Below is an example of how users might set up their custom package.json:

{
  "name": "my-custom-project",
  "version": "0.1.0",
  "description": "Custom setup for Glee project",
  "type": "module",
  "engines": {
     "node": ">=14.15.1"
  },
  "scripts": {
    "dev": "glee dev",
    "start": "glee start"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/your-repo/my-custom-project.git"
  },
  "keywords": [
    "glee"
  ],
  "author": "",
 "license": "Apache-2.0",
  "bugs": {
    "url": "https://github.com/your-repo/my-custom-project/issues"
  },
  "homepage": "https://github.com/your-repo/my-custom-project#readme",
  "dependencies": {
    "@asyncapi/glee": "^0.37.7"
  },
  "devDependencies": {
    "@types/node": "^20.5.9"
  }
}

Benefits:

Streamlined Setup: Avoids the need to manually edit a default package.json, making the project creation process faster and more user-friendly.
Enhanced Customization: Users can start with a package.json file that meets their specific needs, reducing the need for post-creation adjustments.
Improved Consistency: Ensures uniform configuration across multiple projects or teams by using predefined templates.
Increased Efficiency: Automates the inclusion of standard dependencies, scripts, and settings, saving time and effort.

Screenshots

No response

How could it be implemented/designed?

Template Handling: Allow users to specify and apply a custom package.json template when creating a project, or use a default template if none is provided.

Placeholder Replacement: Support dynamic placeholders in the template (e.g., {projectName}, {version}) and replace them with user-provided values.

🚧 Breaking changes

Yes

👀 Have you checked for similar open issues?

  • I checked and didn't find a similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue?

Yes I am willing to submit a PR!

@techmannih techmannih added the enhancement New feature or request label Sep 16, 2024
@techmannih
Copy link
Author

@Souvikns @KhudaDad414 please assign me this issue

@techmannih
Copy link
Author

@AceTheCreator ,
please assign this issue

@AceTheCreator
Copy link
Member

@techmannih we don't assign issues, please kindly go ahead and work on it :)

@techmannih
Copy link
Author

Okay, got it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants