Bingo for meetings- Adding a CLI application–part 12

Bingo is a small project, written in TypeScript , and developed with Alexandru Badita in launch break (one hour - more or less). You can find sources at https://github.com/alexandru360/PresentationBingoCards/ . Those are my blog posts for Bingo : ( scroll below for the post)
NrLink
1Create meeting
2Create Tests
3Finalize Create meeting
4Sharing meeting
5Keep Score
6Add obsolete
7Finalizing obsolete
8End meeting
9Dockerize tests
10Azure CI tests
11Yarn workspaces
12CLI
13Intermezzo - CLI improvements
14typescript compile run with node
15NestJS ,swagger and create a meeting
16Finalizing API
17Intermezzo - jest vs jasmine error
18Refactor WebAPI and test service
19Heroku Deploy NestJs
20Angular
21Deploy Angular to GitHub
22WebAPI and Web
23Documentation
24Documentation of the code
25Conclusions

(Now the actual blog post for Bingo Meetings project)

The easy way to test an application is to make a simple command line version . You can find the code at https://github.com/alexandru360/PresentationBingoCards/blob/master/bingo-meeting-console/index.ts

You can run also with Docker by running https://github.com/alexandru360/PresentationBingoCards/blob/master/dockerize/bingo_cli.bat

What were the steps ?

1. Install the @types/node, ts-node , typescript and others – see

https://github.com/alexandru360/PresentationBingoCards/blob/master/bingo-meeting-console/package.json

2. Create an index.ts with the required CLI ( hint: prompt, figlet, chalk , username , inquirer,console.table are good to have) – read https://dev.to/hugodias/building-your-first-interactive-node-js-cli-1g2c

3. Created an async main() and calling with

(async () => {
  try {
      await main();
        } catch (e) {
      console.log(JSON.stringify(e));
  }
})();

 

4. Modify package.json  to have

“main”: “dist/index.js”,

“types”: “dist/index.d.ts”,

“scripts”: {

“start”: “ts-node index.ts”,

“build”: “tsc”,

“compile”: “tsc”

}

5. Put in the root package

“scripts”: {

“test”: “cd bingo-meeting-objects-test && yarn test”,

“runConsole”: “cd bingo-meeting-console && yarn start”

}

and then run yarn runConsole

I can say that the C# console experience is better 😉

You can download the source code from https://github.com/alexandru360/PresentationBingoCards/releases/tag/CLI