Skip to content

Commit

Permalink
Merge pull request #1 from peterdanwan/npm
Browse files Browse the repository at this point in the history
Merge npm branch to main
  • Loading branch information
peterdanwan authored Sep 9, 2024
2 parents 7906896 + 209555e commit 3fc0c94
Show file tree
Hide file tree
Showing 13 changed files with 2,609 additions and 37 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# .github/workflows/ci.yml

# Continuous Integration (CI) Workflow
name: ci

# Run this workflow whenever a push is made to any branch or when there's a pull request
on:
pull_request:
branches:
- '*'
push:
branches:
- '*'

jobs:
lint:
name: ESLint
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout
- name: Check out code
uses: actions/checkout@v4

# https://github.com/actions/setup-node
- name: Setup node
uses: actions/setup-node@v4
with:
# Use the latest lts version of node
node-version: 'lts/*'
# Cache npm dependencies so they don't have to be downloaded next time - https://github.com/actions/setup-node#caching-packages-dependencies
cache: 'npm'

- name: Install node dependencies
# Use `ci` vs. `install`, see https://docs.npmjs.com/cli/v8/commands/npm-ci
run: npm ci

- name: Run ESLint
run: npm run lint
138 changes: 138 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
.env.aws_secrets

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# EC2 Accounts
*.amazonaws.com

# Packaged files
*.zip
*.tgz
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
package.json
package-lock.json
14 changes: 14 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"endOfLine": "lf",
"insertPragma": false,
"proseWrap": "preserve",
"requirePragma": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false,
"printWidth": 100
}
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.detectIndentation": false,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"files.eol": "\n",
"files.insertFinalNewline": true
}
40 changes: 21 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,49 @@
## Table of Contents

1. [What is gimme_readme?][1-what-is-gimme-readme]
2. [Dependencies][2-dependencies]
2. [Getting Started][2-getting-started]
3. [Example Usage][3-example-usage]
4. [Contributing][4-contributing]

## 1. What is gimme_readme?

`gimme_readme` is a command-line tool that uses `OpenAI` to generate a `README.md` file that explains a given source code file.

## 2. Dependencies
## 2. Getting Started

To use the `gimme_readme`, you must do the following:
To use the `gimme_readme`, you must:

1. Install the latest version of [Python `3`, which comes with the `PIP` package manager](https://www.python.org/downloads/) (this will _not_ work with earlier versions of `Python`).
2. Install [openai] via the following command:

```sh
pip install openai
```

- NOTE: If you are on `Windows`, you must run this command as an `Administrator`.

3. Have a copy of `gr.py`, the main source file which will handle creating a `README.md` file based on your source code.
1. Install the latest version of [node](https://nodejs.org/en/download/package-manager) for your `operating system`.
2. Run `npm i -g gimme_readme`, which installs `gimme_readme` globally.

## 3. Example Usage

### On Linux / Mac OS
### Display all details

```sh
./gr.py FILE
gr
```

### On Windows
### Display version number

```sh
py ./gr.py FILE
# Can do this
gr -v
# Or this
gr --version
```

## 4. Contributing

Contributions to this project is welcomed! Please look for any [issues](https://github.com/peterdanwan/gimme_readme/issues)
Contributions to this project are welcomed!

We ask that you first check to see if the issue you've encountered or feature you wish to add is under the existing list of [issues](https://github.com/peterdanwan/gimme_readme/issues).

If your issue or suggested feature is already, please add onto the existing issue by adding your comments or making `pull request` with what you believe to be a valid change to the code.

Otherwise, if your issue or suggestion is not already list, please feel free to create a new issue, and if possible create a `pull request` that you think will resolve your issue.

[1-what-is-gimme-readme]: #1-what-is-gimme_readme
[2-dependencies]: #2-dependencies
[2-getting-started]: #2-getting-started
[3-example-usage]: #3-example-usage
[4-contributing]: #4-contributing
7 changes: 7 additions & 0 deletions env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# .env file

# Reference: https://platform.openai.com/api-keys
OPENAI_API_KEY=YOUR_OPENAI_API_KEY

# Reference: https://aistudio.google.com/app/apikey
GEMINI_KEY=YOUR_GEMINI_KEY
18 changes: 18 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import globals from 'globals';
import pluginJs from '@eslint/js';

export default [
{ files: ['**/*.js'], languageOptions: { sourceType: 'module' } },
pluginJs.configs.recommended,
{
languageOptions: {
ecmaVersion: 'latest',
globals: {
...globals.commonjs,
...globals.es2021,
...globals.node,
...globals.jest,
},
},
},
];
Loading

0 comments on commit 3fc0c94

Please sign in to comment.