Skip to content
Commits on Source (2)
{
"name": "cyanprint",
"version": "0.13.1",
"version": "0.13.2",
"description": "CyanPrint is a scaffolding CLI for people to create templates or blueprints to scaffold commonly used ",
"main": "dist/cyan.js",
"license": "MIT",
......
{
"main": "Inbuilt Templates"
}
{"main":"Inbuilt Templates"}
\ No newline at end of file
# Main
Default Template group where all templates are installed
by default
# Default
By default, this has the meta-template for create a
CyanPrint template, the CyanPRint Meta Template
# Inbuilt Templates
*Unique Key*: main
# Author
[kirinnee](mailto:kirinnee97@gmail.com)
kirinnee97@gmail.com
{
"name": "Main",
"key": "inbuilt_templates",
"email": "kirinnee97@gmail.com",
"templates": {
"cyanprint": "CyanPrint Meta Template"
}
}
{"name":"Inbuilt Templates","key":"main","email":"kirinnee97@gmail.com","templates":{"cyanprint":"CyanPrint Meta Template"},"readme":"README.MD"}
\ No newline at end of file
stages:
- deploy
Deploy:
stage: deploy
only:
- master
tags:
- cyanprint
script:
cyan push $CYANPRINT_TOKEN
......@@ -9,7 +9,7 @@ A CyanPrint template to make CyanPrint templates
```
3. Install this template
```shell
cyan i https://github.com/kirinnee/cyan.CyanPrint.git
cyan i cyanprint
```
4. Create templates from via CyanPrint CLI
```shell
......@@ -23,4 +23,4 @@ A CyanPrint template to make CyanPrint templates
# License
This template is licensed under MIT - see the [LICENSE.md](LICENSE.MD) file for more details
\ No newline at end of file
This template is licensed under MIT - see the [LICENSE.md](LICENSE.MD) file for more details
......@@ -17,7 +17,7 @@ var~cyan.docs.description~
3. Install this template
if~cyan.docs.git~
```bash
$ cyan i var~git~ [group]
$ cyan i var~package-name~ [group]
```
end~cyan.docs.git~
4. Create templates from via CyanPrint CLI
......@@ -42,4 +42,4 @@ end~cyan.docs.semver~
if~cyan.docs.license~
# License
This template is licensed under var~cyan.docs.license~ - see the [LICENSE.md](LICENSE.MD) file for more details
end~cyan.docs.license~
\ No newline at end of file
end~cyan.docs.license~
{
"name": "var~cyan.docs.name~",
"key": "var~package-name~",
"repo": "var~git~",
"email": "var~cyan.docs.email~",
"readme": "README.MD"
}
image: kirinnee/frontend-gitlab-runner:latest
stages:
- deploy
Deploy:
only:
- master
stage: deploy
script:
cyan push $CYANPRINT_TOKEN
{
"name": "var~cyan.docs.name~",
"key": "var~package-name~",
"repo": "var~git~",
"email": "var~cyan.docs.email~",
"readme": "README.MD"
}
image: kirinnee/frontend-gitlab-runner:latest
stages:
- deploy
Deploy:
stage: deploy
only:
- master
script:
cyan push $CYANPRINT_TOKEN
......@@ -25,6 +25,15 @@ interface IAutoMapper {
interface IAutoInquire {
/**
* Ask a yes-no question, returns a boolean after user answers.
* @param question the question to ask
* @param yes The Yes answer, if not filled, will default to "Yes"
* @param no the No answer, if not filled will default to "No"
* @constructor
*/
InquirePredicate(question: string, yes?: string, no?: string): Promise<boolean>;
/**
* Choose to inquire which documents the user need
* @param docList - the documents they need
......@@ -84,6 +93,7 @@ interface Cyan {
guid?: string[],
npm?: boolean | string;
docs?: Documentation;
comments?: string[] | string;
}
interface CyanSafe {
......@@ -92,7 +102,8 @@ interface CyanSafe {
flags: object;
guid: string[],
npm: string | null;
docs: Documentation
docs: Documentation,
comments?: string[]
}
interface DocData {
......@@ -178,4 +189,4 @@ export {
IAutoInquire,
IAutoMapper,
IExecute
};
\ No newline at end of file
};
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}("undefined"!=typeof window?window:this,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,u)}c((r=r.apply(e,t||[])).next())})};e.exports=function(e,t,n,o){return r(this,void 0,void 0,function*(){let e=[],t="Typescript"===(yield n.prompt([{type:"list",name:"predicate",choices:["Typescript","Javascript"],message:"What language do you want the cyan.config file to be in? (This only affects the templater, not the actual template!)"}])).predicate;t?e.push({root:"./Template/typescript",pattern:"**/*.*",ignore:""}):e.push({root:"./Template/javascript",pattern:"**/*.*",ignore:""}),e.push({root:"./Template/common",pattern:"**/*.*",ignore:""});let r=yield o.InquireDocument({license:!1,git:!1,readme:!0,contributing:!1,semVer:!1}),i={};return t&&(i=yield o.InquireInput({"package-name":["cyanprint-cyanprint","Please enter the name of npm package"]})),r.usage.git&&(i.git=r.data.gitURL),{globs:e,variable:i,npm:t,flags:{gitignore:!0},docs:r,comments:["//"]}})}}])});
\ No newline at end of file
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}("undefined"!=typeof window?window:this,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,u)}c((r=r.apply(e,t||[])).next())})};e.exports=function(e,t,n,o){return r(this,void 0,void 0,function*(){let e=[],t="Typescript"===(yield n.prompt([{type:"list",name:"predicate",choices:["Typescript","Javascript"],message:"What language do you want the cyan.config file to be in? (This only affects the templater, not the actual template!)"}])).predicate;t?e.push({root:"./Template/typescript",pattern:"**/*.*",ignore:""}):e.push({root:"./Template/javascript",pattern:"**/*.*",ignore:""}),e.push({root:"./Template/common",pattern:"**/*.*",ignore:""});let r=yield o.InquireDocument({license:!1,git:!0,readme:!0,contributing:!1,semVer:!1}),i=yield o.InquireInput({"package-name":["cyanprint-template-name","Please enter a unique key of the cyanprint template"]});i.git=r.data.gitURL;const a={gitignore:!0,gitlab:!1};return a.gitlab=yield o.InquirePredicate("Do you want to use GitLab CI?"),{globs:e,variable:i,npm:t,flags:a,docs:r,comments:["//"]}})}}])});
\ No newline at end of file
......@@ -4,40 +4,43 @@ import {Cyan, DocQuestions, Documentation, Glob, IAutoInquire} from "./Typings";
export = async function (folderName: string, chalk: Chalk, inquirer: Inquirer, autoInquirer: IAutoInquire): Promise<Cyan> {
let answers: any = await inquirer.prompt([
{
type: "list",
name: "predicate",
choices: ["Typescript", "Javascript"],
message: "What language do you want the cyan.config file to be in? (This only affects the templater, not the actual template!)"
}
]);
let glob: Glob[] = [];
{
type: "list",
name: "predicate",
choices: ["Typescript", "Javascript"],
message: "What language do you want the cyan.config file to be in? (This only affects the templater, not the actual template!)"
}
]);
let glob: Glob[] = [];
let isTypescript: boolean = answers.predicate === "Typescript";
if (isTypescript) {
glob.push({root: "./Template/typescript", pattern: "**/*.*", ignore: ""});
} else {
glob.push({root: "./Template/javascript", pattern: "**/*.*", ignore: ""});
}
glob.push({root: "./Template/common", pattern: "**/*.*", ignore: ""});
let doc: DocQuestions = {license: false, git: false, readme: true, contributing: false, semVer: false};
let docs: Documentation = await autoInquirer.InquireDocument(doc);
if (isTypescript) {
glob.push({root: "./Template/typescript", pattern: "**/*.*", ignore: ""});
} else {
glob.push({root: "./Template/javascript", pattern: "**/*.*", ignore: ""});
}
glob.push({root: "./Template/common", pattern: "**/*.*", ignore: ""});
let npm: any = {};
if (isTypescript) npm = await autoInquirer.InquireInput({"package-name": ["cyanprint-cyanprint", "Please enter the name of npm package"]});
if (docs.usage.git) npm.git = docs.data.gitURL;
return {
globs: glob,
variable: npm,
npm: isTypescript,
flags: {
gitignore: true
},
docs: docs,
comments: ["//"]
} as Cyan;
let doc: DocQuestions = {license: false, git: true, readme: true, contributing: false, semVer: false};
let docs: Documentation = await autoInquirer.InquireDocument(doc);
let npm: any = await autoInquirer.InquireInput({"package-name": ["cyanprint-template-name", "Please enter a unique key of the cyanprint template"]});
npm.git = docs.data.gitURL;
const flags: any = {
gitignore: true,
gitlab: false
};
flags.gitlab = await autoInquirer.InquirePredicate("Do you want to use GitLab CI?");
return {
globs: glob,
variable: npm,
npm: isTypescript,
flags,
docs,
comments: ["//"]
} as Cyan;
}
......@@ -6,8 +6,8 @@
"build": "webpack"
},
"repository": {
"type": "git",
"url": "https://gitlab.com/cyanprint/cyanprint-template.git"
"type": "git",
"url": "https://gitlab.com/cyanprint/cyanprint-template.git"
},
"author": "kirinnee",
"license": "MIT",
......