Skip to content

Commit 8ac5972

Browse files
authored
Merge pull request #115 from code-collabo/add-templates
Add templates
2 parents 07a4e26 + baac556 commit 8ac5972

38 files changed

Lines changed: 1045 additions & 56 deletions

LICENSE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,8 @@ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
1919
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
2020
THE USE OR PERFORMANCE OF THIS SOFTWARE.
2121

22+
@dkundel's create-project LICENCE file:
23+
https://github.com/dkundel/create-project/blob/master/LICENSE
24+
2225
List of project resources:
2326
https://code-collabo.gitbook.io/node-mongo/contribution-guide/development-mode#project-resources

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat) ![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg) ![GitHub issues](https://img.shields.io/github/issues/code-collabo/node-mongo-cli?color=red) ![GitHub pull requests](https://img.shields.io/github/issues-pr/code-collabo/node-mongo-cli?color=goldenrod)
77

8+
**Supported node versions:** node v12.x to v16.x
9+
810
The **node-mongo-cli** is a command-line interface made with nodejs. It bootstraps any of these 3 boilerplate templates for your nodejs and/or mongoDB development:
911
- [ES module template](https://github.com/code-collabo/node-mongo-esm-kit)
1012
- [Commonjs template](https://github.com/code-collabo/node-mongo-cjs-kit)

doc/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat) ![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg) ![GitHub issues](https://img.shields.io/github/issues/code-collabo/node-mongo-cli?color=red) ![GitHub pull requests](https://img.shields.io/github/issues-pr/code-collabo/node-mongo-cli?color=goldenrod)
44

5+
**Supported node versions:** node v12.x to v16.x
6+
57
The **node-mongo** project has 3 main projects:
68

79
* The node-mongo CLI to bootstrap boilerplate templates.

src/help.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ node-mongo
1010
1111
Arguments:
1212
<folder_name> Replace this with your folder name
13-
<template> Available templates: esm, cjs and ts
13+
<template> Available templates: esm, cjs (and ts coming soon)
1414
1515
Usage example:
1616
node-mongo test-folder cjs

src/prompts/template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ let skipPromptsModified = (options, defaultFolderName, notAmongTemplateCollectio
2020
export const templateMissingOptionPrompt = async (options, folderNameAnswers, defaultFolderName) => {
2121
const defaultTemplate = 'esm';
2222
const templateQuestions = [];
23-
const templateCollection = [defaultTemplate, 'cjs', 'ts-esm'];
23+
const templateCollection = [defaultTemplate, 'cjs'];
2424

2525
const equalToAtLeastOneTemplate = templateCollection.some(tc => {
2626
return tc === options.template;

templates/cjs/.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
end_of_line = lf
8+
indent_size = 2
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[*.ts]
13+
quote_type = single
14+
15+
[*.md]
16+
# max_line_length = off
17+
trim_trailing_whitespace = true

templates/cjs/.eslintrc.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"root": true,
3+
"extends": [
4+
"eslint:recommended",
5+
"plugin:import/warnings",
6+
"plugin:import/warnings"
7+
],
8+
"parserOptions": {
9+
"ecmaVersion": 7,
10+
"sourceType": "module"
11+
},
12+
"env": {
13+
"browser": true,
14+
"node": true
15+
},
16+
"rules": {
17+
"no-console": 1
18+
}
19+
}

templates/cjs/.gitignore

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
#.env file
4+
.env
5+
6+
# dependencies
7+
/node_modules
8+
9+
# compiled output
10+
/dist
11+
/tmp
12+
/out-tsc
13+
# Only exists if Bazel was run
14+
/bazel-out
15+
16+
# profiling files
17+
chrome-profiler-events*.json
18+
speed-measure-plugin*.json
19+
20+
# IDEs and editors
21+
/.idea
22+
.project
23+
.classpath
24+
.c9/
25+
*.launch
26+
.settings/
27+
*.sublime-workspace
28+
29+
# IDE - VSCode
30+
.vscode/*
31+
!.vscode/settings.json
32+
!.vscode/tasks.json
33+
!.vscode/launch.json
34+
!.vscode/extensions.json
35+
.history/*
36+
37+
# misc
38+
/.sass-cache
39+
/connect.lock
40+
/coverage
41+
/libpeerconnection.log
42+
npm-debug.log
43+
yarn-error.log
44+
testem.log
45+
/typings
46+
47+
# System Files
48+
.DS_Store
49+
Thumbs.db

templates/cjs/LICENCE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
ISC License (ISC)
2+
3+
Copyright 2021 Obiagba Mary
4+
5+
Permission to use, copy, modify, and/or distribute
6+
this software for any purpose with or without fee
7+
is hereby granted, provided that the above copyright
8+
notice and this permission notice appear in all copies.
9+
10+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR
11+
DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
12+
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
14+
FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
15+
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
16+
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
17+
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
18+
ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19+
PERFORMANCE OF THIS SOFTWARE.

templates/cjs/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Readme
2+
3+
This project was generated with [@code-collabo/node-mongo-cli](https://code-collabo.gitbook.io/node-mongo/) version 1.0.0.
4+
5+
## Development server
6+
7+
For dev server, run:
8+
````
9+
npm start
10+
````
11+
Open up localhost port in the browser:
12+
````
13+
http://localhost:3000/
14+
````
15+
````
16+
http://localhost:3000/demo
17+
````
18+
19+
## Further help
20+
21+
Consult the [node-mongo documentation](https://code-collabo.gitbook.io/node-mongo/) and/or use the help command:
22+
````
23+
node-mongo --help
24+
````

0 commit comments

Comments
 (0)