GithubHelp home page GithubHelp logo

jeroenouw / cgx Goto Github PK

View Code? Open in Web Editor NEW
256.0 3.0 20.0 1.15 MB

πŸ’»πŸ”₯CLI to generate the recommended documentation/files to improve contribution (Github, Gitlab, CodeCommit and Bitbucket)

Home Page: https://www.npmjs.com/package/cgx

License: MIT License

JavaScript 0.37% TypeScript 99.63%
cli typescript community generator github gitlab documentation project-documentation markdown documentation-generator

cgx's Introduction

Hi there πŸ‘‹

  • πŸ”­ I’m currently working on CGX
  • πŸ€” I’m looking for a contributor for CGX
  • 🌱 I’m currently learning
  • πŸ˜„ Pronouns: Yeh-Roon
  • πŸ“« How to reach me: Twitter/LinkedIn

Github stats

cgx's People

Contributors

aiherrera avatar farist avatar jeroenouw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cgx's Issues

Unit test hangs because Sinon stub doesn't work

Describe the bug
When I run npm run test:unit the test hangs with Inquirer prompt and Sinon stub doesn't get used

To Reproduce
Steps to reproduce the behavior:

  1. add .mocharc.js with below code in it to run with new Mocha version and node v14.14.0
'use strict';

module.exports = {
  diff: true,
  extension: ['ts'],
  reporter: 'spec',
  recursive: true,
  require: ['ts-node/register', 'test/mocha.require.ts'],
  spec: 'src/**/*.spec.ts',
  watch: true
}
  1. Run npm run test:unit

Expected behavior
Test should run fine

Screenshots
Screen Shot 2020-10-19 at 11 22 59 pm

Handle exception when trying to create a changelog file in a non-git directory

Describe the bug
Exception is raised when user tries to create Changelog file in a directory without Git initialised.

To Reproduce
Steps to reproduce the behavior:

  1. Run cgx
  2. Select any provider
  3. Scroll down to Changelog
  4. See error
fatal: not a git repository (or any of the parent directories): .git
(node:4920) UnhandledPromiseRejectionWarning: Error: Command failed: git log --pretty=format:"%h%n%d%n%an%n%s%n%ai%n%b%ae%n%n" --no-merges -z
fatal: not a git repository (or any of the parent directories): .git

    at checkExecSyncError (child_process.js:611:11)
    at Object.execSync (child_process.js:647:15)
    at Changelog.generateFileContent (C:\Users\joaos\AppData\Roaming\npm\node_modules\cgx\lib\templates\universal\changelog.template.js:17:35)
    at Changelog.generateFile (C:\Users\joaos\AppData\Roaming\npm\node_modules\cgx\lib\templates\universal\changelog.template.js:13:63)
    at GithubActions.<anonymous> (C:\Users\joaos\AppData\Roaming\npm\node_modules\cgx\lib\actions\github.actions.js:43:70)
    at step (C:\Users\joaos\AppData\Roaming\npm\node_modules\cgx\node_modules\tslib\tslib.js:136:27)
    at Object.next (C:\Users\joaos\AppData\Roaming\npm\node_modules\cgx\node_modules\tslib\tslib.js:117:57)
    at fulfilled (C:\Users\joaos\AppData\Roaming\npm\node_modules\cgx\node_modules\tslib\tslib.js:107:62)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:4920) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:4920) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Expected behavior
In a directory iwthout a .git subdirectory, cgx must show an error message like This is not a Git repository and exit.

Desktop (please complete the following information):
- OS: Windows 10 v2004 build 19041.21

Add unit tests

Describe the solution you'd like
Adding unit testing to prevent bugs

Additional context
Pre-work is done at branch 1.3.0 (using mocha, nyc, sinon)

TemplateGenerator class that can be extended

Is your feature request related to a problem? Please describe.
x

Describe the solution you'd like
TemplateGenerator class that can be extended instead of code duplications

Describe alternatives you've considered
x

Additional context
x

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.