Skip to content

Commit

Permalink
chore: run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
uday-rana committed Oct 12, 2024
1 parent b72837f commit d71472e
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 71 deletions.
24 changes: 13 additions & 11 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
Expand Down
21 changes: 10 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,24 @@ name: CI

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npx prettier --check src/
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: npx prettier --check src/
22 changes: 11 additions & 11 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
- Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand Down Expand Up @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
Expand Down
41 changes: 22 additions & 19 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,44 @@ We welcome contributions to improve codeshift! Whether it's reporting a bug, sug
## How to Contribute

1. Fork the repository
- Click the "Fork" button on the top right of the repository page.

- Click the "Fork" button on the top right of the repository page.

2. Clone your fork

```bash
git clone https://github.com/<your-username>/codeshift.git
cd codeshift
```
```bash
git clone https://github.com/<your-username>/codeshift.git
cd codeshift
```

3. Create a branch for your feature or fix

```bash
git checkout -b feature/my-awesome-feature
```
```bash
git checkout -b feature/my-awesome-feature
```

4. Make your changes
- Ensure that your code follows the existing style and conventions.
- Run tests and ensure everything is working as expected.

- Ensure that your code follows the existing style and conventions.
- Run tests and ensure everything is working as expected.

5. Commit your changes
- Follow the Conventional Commits format for commit messages.

```bash
git commit -m "feat(scope): add new feature description"
```
- Follow the Conventional Commits format for commit messages.

```bash
git commit -m "feat(scope): add new feature description"
```

6. Push to your fork

```bash
git push origin feature/my-awesome-feature
```
```bash
git push origin feature/my-awesome-feature
```

7. Submit a pull request
- Go to the original repository, navigate to the "Pull Requests" tab, and open a new pull request.
- Provide a clear description of your changes, explaining the problem it solves or the feature it adds.
- Go to the original repository, navigate to the "Pull Requests" tab, and open a new pull request.
- Provide a clear description of your changes, explaining the problem it solves or the feature it adds.

## Guidelines

Expand Down
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,34 @@ Codeshift is a command-line tool to translate and transform source code files be

- Clone the repository with [Git](https://git-scm.com/):

```bash
git clone https://github.com/uday-rana/codeshift.git
```
```bash
git clone https://github.com/uday-rana/codeshift.git
```

- Alternatively, download the repository as a .zip from the GitHub page and extract it

- In the repository's root directory (where `package.json` is located), run `npm install`:

```bash
cd codeshift/
npm install
```
```bash
cd codeshift/
npm install
```

- To be able to run the program without prefixing `node`, run `npm install -g .` or `npm link` within the project directory:

```bash
npm install -g .
```
```bash
npm install -g .
```

- Create a file called `.env` by copying the `.env.example` file

- Add your API key, preferred base URL, and preferred model. It should look similar to the example below:

- For OpenAI, use the base URL `https://api.openai.com/v1`
- For OpenRouter, use the base URL `https://openrouter.ai/api/v1`
- For Groq, use the base URL `https://api.groq.com/openai/v1`.
- For a list of models for each provider, see:

- [OpenAI models](https://platform.openai.com/docs/models)
- [OpenRouter models](https://openrouter.ai/models)
- [Groq models](https://console.groq.com/docs/models)
Expand Down
6 changes: 3 additions & 3 deletions examples/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const express = require('express');
const express = require("express");
const app = express();
const port = 3000;

// Basic route to handle GET requests
app.get('/', (req, res) => {
res.send('Hello, World!');
app.get("/", (req, res) => {
res.send("Hello, World!");
});

// Starting the server
Expand Down
4 changes: 2 additions & 2 deletions src/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ let model = process.env.MODEL;

// Find match in supportedProviders based on baseURL
const provider = Object.values(supportedProviders).find((supportedProvider) =>
baseURL.startsWith(supportedProvider.baseURL)
baseURL.startsWith(supportedProvider.baseURL),
);

if (!model) {
if (!provider) {
throw new Error(
`Unsupported provider for BASE_URL ${process.env.BASE_URL}. Please set a valid MODEL environment variable.`
`Unsupported provider for BASE_URL ${process.env.BASE_URL}. Please set a valid MODEL environment variable.`,
);
}
model = provider.defaultModel;
Expand Down

0 comments on commit d71472e

Please sign in to comment.