{"id":31462011,"url":"https://github.com/devmentor416/dm-tools","last_synced_at":"2026-04-27T16:31:59.447Z","repository":{"id":57213458,"uuid":"111322700","full_name":"devmentor416/dm-tools","owner":"devmentor416","description":"Multi Language project creation tools","archived":false,"fork":false,"pushed_at":"2023-12-10T11:45:32.000Z","size":5622,"stargazers_count":0,"open_issues_count":10,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-01T15:39:13.353Z","etag":null,"topics":["cpp","javascript","nodejs","testing","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devmentor416.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-11-19T18:52:09.000Z","updated_at":"2023-12-10T11:45:41.000Z","dependencies_parsed_at":"2022-08-24T21:41:57.651Z","dependency_job_id":"9e840145-35b2-481e-ac8a-7c0dfbaf977d","html_url":"https://github.com/devmentor416/dm-tools","commit_stats":null,"previous_names":["devmentor416/devmentor"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devmentor416/dm-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devmentor416%2Fdm-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devmentor416%2Fdm-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devmentor416%2Fdm-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devmentor416%2Fdm-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devmentor416","download_url":"https://codeload.github.com/devmentor416/dm-tools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devmentor416%2Fdm-tools/sbom","scorecard":{"id":337941,"data":{"date":"2025-08-11","repo":{"name":"github.com/devmentor416/dm-tools","commit":"b4d799263b77df501fee60bc5bcd6273e20d88e0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.8,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: npmCommand not pinned by hash: .templates/apollo-graphql-server/npm-up.sh:8","Warn: npmCommand not pinned by hash: .templates/apollo-graphql-server/npm-up.sh:9","Warn: npmCommand not pinned by hash: .templates/apollo-graphql-server/npm-up.sh:10","Warn: npmCommand not pinned by hash: .templates/apollo-graphql-server/npm-up.sh:11","Warn: npmCommand not pinned by hash: .templates/apollo-graphql-server/npm-up.sh:12","Warn: npmCommand not pinned by hash: .templates/default/npm-up.sh:9","Warn: npmCommand not pinned by hash: .templates/default/npm-up.sh:10","Warn: npmCommand not pinned by hash: .templates/default/npm-up.sh:11","Warn: npmCommand not pinned by hash: .templates/default/npm-up.sh:12","Warn: npmCommand not pinned by hash: .templates/default/npm-up.sh:13","Warn: npmCommand not pinned by hash: .templates/javascript/npm-up.sh:8","Warn: npmCommand not pinned by hash: .templates/javascript/npm-up.sh:9","Warn: npmCommand not pinned by hash: .templates/javascript/npm-up.sh:10","Warn: npmCommand not pinned by hash: .templates/javascript/npm-up.sh:11","Warn: npmCommand not pinned by hash: .templates/javascript/npm-up.sh:12","Warn: npmCommand not pinned by hash: .templates/javascript/npm-up.sh:13","Warn: npmCommand not pinned by hash: .templates/koa/npm-up.sh:8","Warn: npmCommand not pinned by hash: .templates/koa/npm-up.sh:9","Warn: npmCommand not pinned by hash: .templates/koa/npm-up.sh:10","Warn: npmCommand not pinned by hash: .templates/koa/npm-up.sh:11","Warn: npmCommand not pinned by hash: .templates/koa/npm-up.sh:12","Warn: npmCommand not pinned by hash: .templates/node/npm-up.sh:8","Warn: npmCommand not pinned by hash: .templates/node/npm-up.sh:9","Warn: npmCommand not pinned by hash: .templates/node/npm-up.sh:10","Warn: npmCommand not pinned by hash: .templates/node/npm-up.sh:11","Warn: npmCommand not pinned by hash: .templates/node/npm-up.sh:12","Warn: npmCommand not pinned by hash: .templates/typescript/npm-up.sh:8","Warn: npmCommand not pinned by hash: .templates/typescript/npm-up.sh:9","Warn: npmCommand not pinned by hash: .templates/typescript/npm-up.sh:10","Warn: npmCommand not pinned by hash: .templates/typescript/npm-up.sh:11","Warn: npmCommand not pinned by hash: .templates/typescript/npm-up.sh:12","Warn: npmCommand not pinned by hash: .templates/web/npm-up.sh:9","Warn: npmCommand not pinned by hash: .templates/web/npm-up.sh:10","Warn: npmCommand not pinned by hash: npm-up.sh:8","Warn: npmCommand not pinned by hash: npm-up.sh:9","Warn: npmCommand not pinned by hash: npm-up.sh:10","Warn: npmCommand not pinned by hash: npm-up.sh:11","Warn: npmCommand not pinned by hash: npm-up.sh:12","Warn: npmCommand not pinned by hash: pack.sh:4","Info:   0 out of  39 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"51 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-qxrj-hx23-xp82","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-6r2x-8pq8-9489","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-75v8-2h7p-7m2m","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-593f-38f6-jp5m","Warn: Project is vulnerable to: GHSA-x2rg-q646-7m2v","Warn: Project is vulnerable to: GHSA-jgmv-j7ww-jx2x","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-xf5p-87ch-gxw2","Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj","Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-mxhp-79qh-mcx6","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-w5p7-h5w8-2hfq","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx","Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6","Warn: Project is vulnerable to: GHSA-r7jx-5m6m-cpg9","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T05:10:25.649Z","repository_id":57213458,"created_at":"2025-08-18T05:10:25.650Z","updated_at":"2025-08-18T05:10:25.650Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32345802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","javascript","nodejs","testing","typescript"],"created_at":"2025-10-01T15:34:10.453Z","updated_at":"2026-04-27T16:31:59.442Z","avatar_url":"https://github.com/devmentor416.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dev Mentor Project Creator Tool\n\n![Travis](https://img.shields.io/travis/devmentor416/dm-tools.svg)\n![Version](https://img.shields.io/badge/dm--tools-0.7.1-blue.svg)\n![License](https://img.shields.io/badge/license-GPL--4.0-blue.svg)\n[![Greenkeeper badge](https://badges.greenkeeper.io/devmentor416/dm-tools.svg)](https://greenkeeper.io/)\n\n![Image Logo](img/dm-tools.png)\n\u003c!-- @import \"[TOC]\" {cmd=\"toc\" depthFrom=1 depthTo=6 orderedList=true} --\u003e\n\u003c!-- code_chunk_output --\u003e\n\n1. [Dev Mentor Project Creator Tool](#dev-mentor-project-creator-tool)\n    1. [Introduction](#introduction)\n    2. [No IDE: Build and Debug like a Pro](#no-ide-build-and-debug-like-a-pro)\n    3. [Configuration: run, debug and build entry files](#configuration-run-debug-and-build-entry-files)\n    4. [Project Types](#project-types)\n    5. [Installing DM-Tools](#installing-dm-tools)\n    6. [Benefits](#benefits)\n    7. [Creating a Project](#creating-a-project)\n        1. [NPM Scripts](#npm-scripts)\n    8. [Running a Node.js program](#running-a-nodejs-program)\n    9. [Running Tests](#running-tests)\n        1. [Developing and watching](#developing-and-watching)\n            1. [Watching Tests](#watching-tests)\n    10. [TypeScript development](#typescript-development)\n        1. [Project structure](#project-structure)\n        2. [Building](#building)\n        3. [Warning](#warning)\n        4. [Library code (Modules)](#library-code-modules)\n        5. [Formatting the code](#formatting-the-code)\n        6. [Linting](#linting)\n        7. [Testing](#testing)\n    11. [Static Web development](#static-web-development)\n        1. [Browsersync Asset fetching](#browsersync-asset-fetching)\n    12. [Test coverage](#test-coverage)\n    13. [Create a Node.js JavaScript project](#create-a-nodejs-javascript-project)\n        1. [TypeScript Node ES5](#typescript-node-es5)\n    14. [Building C++ Testable Projects](#building-c-testable-projects)\n        1. [Basic Usage](#basic-usage)\n            1. [Project \"hello_world\" Creation](#project-hello_world-creation)\n        2. [Building Project](#building-project)\n        3. [Running hello_world program](#running-hello_world-program)\n        4. [Running the Test Program](#running-the-test-program)\n        5. [Micro Test - Testing Your Project](#micro-test---testing-your-project)\n    15. [TypeScript Coding Guideline](#typescript-coding-guideline)\n    16. [Debugging](#debugging)\n\n\u003c!-- /code_chunk_output --\u003e\n## Introduction\n\n__DM-Tools__ is a command-line utility for generating a project for the following programming languages.\n\n1. Basic JavaScript\n1. TypeScript\n1. JavaScript using Babel 7\n1. C++\n\nFocus has been put into encouraging the use of best practices and the best tools.\n\nVersion of Node supported: Node v14.16.1+, for version earlier you will need to polyfill using \"__core-js__\".\n\n## No IDE: Build and Debug like a Pro\n\nYou can easily run and debug any TypeScript, JavaScript, Node.js program with ease. You do not need and IDE to debug! 💪🏽 All you need is a terminal and a browser and you can step through any code.\n\nIt is even possible to debug remotely, for more information, read the [Node Debugging Guide](https://nodejs.org/en/guides/debugging-getting-started).\n\nTo get started open a terminal and type:\n\n```sh\nnpm run debug\n```\n\nThis will start a debug build for TypeScript files then run it using Node.js and immediately break. JavaScript program will run immediately and break.\n\nNext open a browser.\n\nBrowser | Debug URL\n-|-\nBrave| `brave://inspect`\nChrome| `chrome://inspect`\nEdge|`edge://inspect`\n\nLook for an \"__Open dedicated DevTools for Node__\" or \"__inspect__\" link.\n\n![Brave inspect](img/brave-inspect.png)\n\nClicking on either link will popup a browser debug window. You are good to go. ✅\n\nSet breakpoints 🎯 and step through code like a pro. 😎\n\n![browser debugger](img/node-browser-debugger.png)\n\n__NOTE__: TypeScript file(s) will appear in the debugger windows, not transpiled JavaScript files. ❤️\n\n## Configuration: run, debug and build entry files\n\nThe generated project haves two entries in package.json file that control:\n\n1. The build entry file.\n1. The run and debug entry file.\n\nHere is sample package.json file:\n\n```json\n{\n  \"name\": \"@dm-tools/demo\",\n  \"version\": \"0.1.0\",\n  \"description\": \"DM-Tools generated TypeScript Express.js demo Server with static Website\",\n  \"main\": \"src/core/main.ts\",\n  \"config\": {\n    \"main\": \"build/core/main.js\",\n    \"doc_folder\": \"docs/typedoc\"\n  },\n...\n}\n```\n\nThe \"__main__\" property under the root, controls the entry file and location for the TypeScript built.\n\nThe property \"__config.main__\" is where the TypeScript code is compiled to, it points to the entry file to run.\n\nShould you even have a need to rename the entry files, this is where you would do it. For JavaScript projects, you will see duplicate entries both pointing to the run file.\n\n## Project Types\n\nThe following basic project types that can be created using DM-Tools are:\n\nOption|Language|Description\n-|-|-\n| |TS|Default (TypeScript Node.js program)\njs|JS|JavaScript Node.js server with static website\nts|TS|TypeScript Express.js Server (Zero compile with static Website)\nweb|HTML Sass |Static Website\nnode|TS|TypeScript Node.js Server\nkoa|TS|Koa Node.js API Server in TypeScript\ngql|JS|Apollo GraphQL API Server using Babel 7\ncpp|CPP |C++ with Micro Test using CMake\n\n## Installing DM-Tools\n\n```sh\nnpm install -g dm-tools\n```\n\n## Benefits\n\nHere are the benefits you will enjoy right out of the gate:\n\n- ✅ Quick start\n- ✅ Best practices\n- ✅ Build system\n- ✅ Code in TypeScript\n- ✅ Easy no IDE debugging\n- ✅ HTML, CSS \u0026 Sass live edit and preview\n- ✅ Error logging\n- ✅ Code linting\n- ✅ Code formatting\n- ✅ Unit testing\n- ✅ Code coverage\n- ✅ Document generation\n- ✅ Git commit hooks\n\n## Creating a Project\n\nStart playing with the demo starter project now, the generated source code is located in the project \"__src/__\" sub-folder.\n\n```sh\ndm new demo\ncd demo\n```\n\n__Note__: If you are using __Yarn__ over __NPM__, continue to work with __Yarn__, the DM-Tools generated project will use Yarn before NPM if it is available on your system.\n\n### NPM Scripts\n\nThe following NPM commands are provided, some are project type dependent.\n\nNPM script|Description\n----------|-----------\nbuild|Perform a release build|\ndev|Run in watch mode.|\ndoc|Generate doc files (jsdocs).|\nformat|Format the source code.|\n|lint|Run TypeScript / ES linter|\nnode:debug|Start debugger, requires Chrome.|\nstart|Run the Node.js program.|\ntest|Run Unit test with coverage|\ntest:e2e|End to end test with Cypress|\ntestwatch|Run Unit testing in watch mode|\nweb|Run static web server\n\n## Running a Node.js program\n\nTo simply run a production build of the Node.js program, type:\n\n```sh\nnpm start\n```\n\nThis will perform a clean build and run the demo program from the \"__build/__\" folder. The demo application log will be produced in the \"__logs/__\" sub-folder under the project root.\n\n## Running Tests\n\nTo run tests with coverage for the TypeScript / Node.js based programs, type:\n\n```sh\nnpm test\n```\n\nIt might be a good idea to run all the tests with coverage before a production build.\n\n### Developing and watching\n\nYou can run and watch a Node.js based program during development. To do this, open a terminal and type the following.\n\n```sh\nnpm run dev\n```\n\nThis will kickoff the \"dev build\" and \"dev watch\" NPM scripts.\n\n#### Watching Tests\n\nTo watch the unit tests while developing, type the following command in a new terminal.\n\n```sh\nnpm run testwatch\n```\n\n## TypeScript development\n\n### Project structure\n\nPlace all TypeScript source code under the folder, \"__src/__\", they will be picked up from here and compiled to the, \"__build/__\" folder under the project root.\n\nYou are free to create addition folders and sub-folders under, \"__src/__\", the compiler will recursively find and compile all TypeScript code.\n\nAll TypeScript code is compiled to __ES2020__ JavaScript. The target JavaScript code can be changed from the [TypeScript configuration](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) file, \"__tsconfig.json__\".\n\nSome of the things you may want to configure:\n\n- Files to compile\n- Folders to include\n- Folders to exclude\n- Target compiled output\n- Source map (Needed for debugging)\n- Module system (Use commonjs for Node)\n- Output file\n\nSupported compiled targets include:\n\n```pre\nES3, ES5, ES6, ES2016, ES2017, ES2018, ES2019, ES2020\n```\n\nSee [compiler options](https://www.typescriptlang.org/docs/handbook/compiler-options.html) for more details.\n\n### Building\n\nTo compile the TypeScript code, use the following command to start the build process:\n\n```sh\nnpm run release\n```\n\n### Warning\n\nThe \"__build/__\" folder and all sub-folders within it will be deleted to insure a clean build is performed each time. Do not place any files you will need later in the \"__build/__\" folder.\n\n### Library code (Modules)\n\nPlace any module or library source code that you write under the, \"__src/lib/__\", sub-folder. The compiled source code will be output to the, \"__build/lib/__\", sub-folder.\n\n### Formatting the code\n\nThe source code will be automatically formatted during development and production build. This will also happen before source code is committed to __Git__.\n\nIt is good practice to format the source code, so it conforms to a uniform structure. Avoid squabbles about style. Formatting in run by the NPM script, \"__format__\".\n\n### Linting\n\nTo validate the project TypeScript source code, use the following command:\n\n```sh\nnpm run lint\n```\n\n__Note__: The TypeScript source code is run through a linter (__ESLint__) before a build and before it is committed to the Git repository. Any errors encountered must be fixed before the Git commit is allowed to proceed.\n\n**Important!**: I have noticed, once in a while the git hooks will continue to fail when there is nothing really wrong. If you suspect this is the case, the easy fix is to delete the \"__node_modules__\" folder. Follow this with a \"__npm install__\" or simply type \"__yarn__\" and then try to commit or push the code again.\n\n### Testing\n\n[Testing is done using Ava](https://github.com/avajs/ava), the test methods are simple and easy to learn.\n\n__Ava__ makes testing simple. Code is easy to read since it is just JavaScript, this avoids the need to context switch to BDD syntax. Plus anyone who knows JavaScript will be able to write test code immediately.\n\nI firmly believe less time should be put into writing test code and having more time to write production code. Ava delivers on this by keeping the setup and test writing to a bare minimum. I believe __Ava__ is the best option for writing unit test for JavaScript based code.\n\nThe test code should be __co-located__ with the production source code. As a best practice, place tests under a sub-folder called \"__test/__\".\n\nPay attention to how the test source file is named: \"__test.\\\u003cfile\\\u003e.ts__\". So if you have a file called, \"__filter.ts__\", the test file should be named, \"__test.filter.ts__\".\n\nTo run the test, type:\n\n```sh\nnpm test\n```\n\n__Note__: Running the test will cause a fresh build to be kicked-off. Once the build finishes, all the unit tests will be run.\n\n## Static Web development\n\nIf you want to hack around with HTML, Sass and try things out quick. Start the project in __web__ mode using the following command:\n\n```sh\nnpm run web\n```\n\nThis will run the build first and then open a web browser on port 3000, and load the HTML page, \"__index.html__\" located in the \"__src/__\" sub-folder.\n\nAny changes made to \"__index.html__\" will automatically update and browser on save. You do not need to keep hitting __refresh__ on the browser.\n\nThe website uses lite-server, which is based on Browsersync to run a local development web-server and keeps all browsers listening to it in sync. This means it is possible to have multiple browsers listening to the server.\n\nOn how to configure the setup, read the [Browsersync options](https://browsersync.io/docs/options).\n\nBasic configurations setting you may be interested in are:\n\n- files\n- server\n- proxy\n- logLevel\n- port\n\nThe default Browsersync UI web address is: `http://localhost:3001/`.\n\n### Browsersync Asset fetching\n\nWith Browsersync, having to serve addition CSS and JavaScript files, make sure to add their path in routes. Something similar to like this:\n\n```js\n  \"server\": {\n    baseDir: \"src\",\n    routes: {\n      \"/node_modules/tachyons/css\":\"node_modules/tachyons/css\"\n    }\n  },\n```\n\nThis will allow including \"__\\\u003cscript\\\u003e__\" assets from the index.html file like this:\n\n```html\n\u003chead\u003e\n  \u003clink rel=\"stylesheet\" href=\"./node_modules/tachyons/css/tachyons.min.css\"\u003e\n\u003c/head\u003e\n```\n\n## Test coverage\n\nTest coverage is done when test is run using \"__nyc__\". The test coverage result is displayed to the console after the results of the unit tests. A folder called \"__coverage/__\" will be created under the project root. It will hold the results of the code coverage from the test run. Of interest to you will be the HTML report. It is a nice way to see what code was covered and what code was not by the unit tests.\n\nTo configure the test coverage, make changes to the \"__nyc__\" settings found in the file \"__package.json__\".\n\n## Create a Node.js JavaScript project\n\nIf you want to develop in plain JavaScript, or develop a ES6 Node.js based project, this is now supported. It is also good for quickly testing out code and not getting slowed down by the compile step.\n\nYou will need the latest version of Node.js for ES6 and beyond support, otherwise plain JavaScript will continue to work.\n\n```sh\ndm new demo --type js\nnpm install\n```\n\n__Note__: You may also use \"__-t__\" which is the short-form for \"__--type__\".\n\nThe plain JavaScript generated file has a development mode. It will run the __Entry__ file (\"__main.js__\") using Node.js each time the source code is updated. You can develop and see the output from the __terminal__ to test out code quickly.\n\n```sh\nnpm run dev\n```\n\n### TypeScript Node ES5\n\nIf you need to use ES5 Node.js support with TypeScript here are the following change you need to make.\n\nMake sure you're using Node v14.16.1 or higher.\n\nAdd the following two lines under compilerOptions to \"__tsconfig.json__\" and \"__tsconfig.test.json__\".\n\n```js\n\"compilerOptions\": {\n  \"target\": \"es2020\",\n  \"lib\": [\n    \"es2020\",\n    \"es2019\",\n    \"es2018\",\n    \"es2017\",\n    \"dom\"\n    ]\n}\n```\n\n## Building C++ Testable Projects\n\nDM-Tools can be used to create a C++ project with Unit Testing setup using [Micro Test](https://github.com/rajinder-yadav/micro_test).\n\nThe C++ project uses [CMake](https://cmake.org/) to generate cross-platform Makefiles for:\n\n1. Linux\n1. MacOS\n1. Windows\n\n### Basic Usage\n\nLet us go through the steps of creating a simple \"hello_world\" project.\n\n#### Project \"hello_world\" Creation\n\nThe created project will be found under the __hello_world__ folder.\n\n```sh\ncd /tmp\ndm new hello_world --cpp\n```\n\n### Building Project\n\nThe Makefile is located under sub-folder build.\n\n```sh\ncd hello_world/build\nmake\n```\n\n### Running hello_world program\n\nThe executable hello_world will be found in the build folder.\n\n```sh\n./hello_world\n```\n\n### Running the Test Program\n\nThe test program is located under build/test/ sub-folder. Initially one failing test is created for you to follow.\n\n```sh\n./test/test.hello_world\n```\n\n### Micro Test - Testing Your Project\n\nDM-Tools creates a test sub-folder under src/ and uses the latest Micro Test header file, it basically pulls it from the Micro Test Git repository.\n\nTo learn more about how to write tests using [Micro Test](https://bitbucket.org/rajinder_yadav/micro_test) check out the project site. You will be amazed how simple and fast it is to write test code.\n\n## TypeScript Coding Guideline\n\nRead the [coding guideline](https://github.com/devmentor416/devmentor/wiki/Coding-guideline) found in the wiki.\n\n## Debugging\n\nIf you get a post or address is use, you might have a background process that didn't shutdown correctly. To shut it down, use the following command to find its process ID and then kill it.\n\n```sh\nlsof -i :PORT\nlsof -i :3000\n\nkill \u003cPIDP\u003e\nkill -9 \u003cPIDP\u003e\n```\n\n__Happy Hacking =)__\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevmentor416%2Fdm-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevmentor416%2Fdm-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevmentor416%2Fdm-tools/lists"}