create-make 0.3.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,18 @@
1
1
  # create-make
2
2
  An advance CLI tools for creating new project from GitHub repository.
3
3
 
4
+ ## Usage
5
+ To use this CLI tools on your system you need to install [Node.js](https://nodejs.org) and optionally you can install [yarn](https://classic.yarnpkg.com) if you want to use the second command below.
6
+
7
+ ```bash
8
+ npx create-make
9
+ ```
10
+ or
11
+ ```bash
12
+ yarn create make
13
+ ```
14
+
15
+
4
16
  ## Config
5
17
 
6
18
  Linux:
@@ -19,7 +31,7 @@ Windows:
19
31
  ```
20
32
 
21
33
 
22
- To use your own custom template repo for creating new project
34
+ Example of a config.json to use with your own custom template repo for creating new project
23
35
 
24
36
  ```json
25
37
  {
@@ -40,4 +52,4 @@ To use your own custom template repo for creating new project
40
52
  }
41
53
  ```
42
54
 
43
- _Note:_ Your custom categories and templates will show up in *Others* part of *Select a category*
55
+ _Note:_ Your custom categories and templates will show up in __Others__ part of __Select a category__
package/dist/index.cjs CHANGED
@@ -5,7 +5,7 @@ const node_child_process = require('node:child_process');
5
5
  const node_path = require('node:path');
6
6
  const inquirer = require('inquirer');
7
7
 
8
- var OS_NAME=process.platform;var OS_APP_HOME=process.env.APPDATA||(OS_NAME=="darwin"?process.env.HOME+"/Library/Preferences":process.env.HOME+"/.local/share");var APP_PATH="".concat(OS_APP_HOME,"/create-make");var CONFIG_PATH="".concat(APP_PATH,"/config.json");var DEFAULT_CATEGORIES={TypeScript:{"Vanilla Typescript":{repo:"https://github.com/z-starter/vite-vanilla-ts.git",args:[{str:"vite-vanilla-ts",value:"projectName"}]}}};var SCHEMA_PATH="".concat(APP_PATH,"/schema.json");var DEFAULT_SCHEMA={$schema:"https://json-schema.org/draft-07/schema",$id:"https://example.com/product.schema.json",title:"Create Make",description:"An advance CLI tools for creating new project from GitHub repository.",type:"object",properties:{categories:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"object",properties:{repo:{type:"string",default:"repoUrl"},args:{type:"array",items:{type:"object",properties:{str:{type:"string",default:"contentToReplace"},value:{type:"string",default:"projectName"}}}}}}}}}};
8
+ var OS_NAME=process.platform;var OS_APP_HOME=process.env.APPDATA||(OS_NAME=="darwin"?process.env.HOME+"/Library/Preferences":process.env.HOME+"/.local/share");var APP_PATH="".concat(OS_APP_HOME,"/create-make");var CONFIG_PATH="".concat(APP_PATH,"/config.json");var DEFAULT_CATEGORIES={TypeScript:{Vanilla:{repo:"https://github.com/z-starter/vite-vanilla-ts.git",args:[{str:"vite-vanilla-ts",value:"projectName"}]},Phaser:{repo:"https://github.com/z-starter/vite-phaser-ts.git",args:[{str:"vite-phaser-ts",value:"projectName"}]}}};var SCHEMA_PATH="".concat(APP_PATH,"/schema.json");var DEFAULT_SCHEMA={$schema:"https://json-schema.org/draft-07/schema",$id:"https://example.com/product.schema.json",title:"Create Make",description:"An advance CLI tools for creating new project from GitHub repository.",type:"object",properties:{categories:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"object",properties:{repo:{type:"string",default:"repoUrl"},args:{type:"array",items:{type:"object",properties:{str:{type:"string",default:"contentToReplace"},value:{type:"string",default:"projectName"}}}}}}}}}};
9
9
 
10
10
  function _array_like_to_array(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_without_holes(arr){if(Array.isArray(arr))return _array_like_to_array(arr)}function _iterable_to_array(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter)}function _non_iterable_spread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _to_consumable_array(arr){return _array_without_holes(arr)||_iterable_to_array(arr)||_unsupported_iterable_to_array(arr)||_non_iterable_spread()}function _unsupported_iterable_to_array(o,minLen){if(!o)return;if(typeof o==="string")return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}var mkdir=function(path){return node_fs.mkdirSync(path,{recursive:true})};var rmRF=function(path){return node_fs.rmSync(path,{recursive:true,force:true})};var pathExists=function(path){return node_fs.existsSync(path)};var readFile=function(path){return node_fs.readFileSync(path,{encoding:"utf8"})};var writeFile=function(path,data){return node_fs.writeFileSync(path,data,{encoding:"utf8"})};var cmd=function(command){var path=arguments.length>1&&arguments[1]!==void 0?arguments[1]:process.cwd();return node_child_process.execSync(command,{stdio:[0,1,2],cwd:path})};var gitClone=function(repo,projectName){return cmd("git clone --depth=1 ".concat(repo," ").concat(projectName))};var findFile=function(dir,fileName){var exclude=arguments.length>2&&arguments[2]!==void 0?arguments[2]:["node_modules",".git"];var finds=[];node_fs.readdirSync(dir).forEach(function(file){var filePath=node_path.join(dir,file);if(!exclude.includes(filePath)){var fileStat=node_fs.statSync(filePath);if(fileStat.isDirectory())finds=_to_consumable_array(finds).concat(_to_consumable_array(findFile(filePath,fileName)));else if(fileName===true)finds.push(filePath);else if(new RegExp("\\b"+fileName+"\\b").test(node_path.basename(file)))finds.push(filePath);}});return finds};var filesChangeContent=function(path,oldContent,newContent){findFile(path,true).map(function(item){var content=node_fs.readFileSync(item,{encoding:"utf-8"});if(new RegExp("\\b"+oldContent+"\\b").test(content)){node_fs.writeFileSync(item,content.replace(oldContent,newContent),{encoding:"utf-8"});}});};
11
11
 
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { execSync } from 'node:child_process';
3
3
  import { join, basename } from 'node:path';
4
4
  import inquirer from 'inquirer';
5
5
 
6
- var OS_NAME=process.platform;var OS_APP_HOME=process.env.APPDATA||(OS_NAME=="darwin"?process.env.HOME+"/Library/Preferences":process.env.HOME+"/.local/share");var APP_PATH="".concat(OS_APP_HOME,"/create-make");var CONFIG_PATH="".concat(APP_PATH,"/config.json");var DEFAULT_CATEGORIES={TypeScript:{"Vanilla Typescript":{repo:"https://github.com/z-starter/vite-vanilla-ts.git",args:[{str:"vite-vanilla-ts",value:"projectName"}]}}};var SCHEMA_PATH="".concat(APP_PATH,"/schema.json");var DEFAULT_SCHEMA={$schema:"https://json-schema.org/draft-07/schema",$id:"https://example.com/product.schema.json",title:"Create Make",description:"An advance CLI tools for creating new project from GitHub repository.",type:"object",properties:{categories:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"object",properties:{repo:{type:"string",default:"repoUrl"},args:{type:"array",items:{type:"object",properties:{str:{type:"string",default:"contentToReplace"},value:{type:"string",default:"projectName"}}}}}}}}}};
6
+ var OS_NAME=process.platform;var OS_APP_HOME=process.env.APPDATA||(OS_NAME=="darwin"?process.env.HOME+"/Library/Preferences":process.env.HOME+"/.local/share");var APP_PATH="".concat(OS_APP_HOME,"/create-make");var CONFIG_PATH="".concat(APP_PATH,"/config.json");var DEFAULT_CATEGORIES={TypeScript:{Vanilla:{repo:"https://github.com/z-starter/vite-vanilla-ts.git",args:[{str:"vite-vanilla-ts",value:"projectName"}]},Phaser:{repo:"https://github.com/z-starter/vite-phaser-ts.git",args:[{str:"vite-phaser-ts",value:"projectName"}]}}};var SCHEMA_PATH="".concat(APP_PATH,"/schema.json");var DEFAULT_SCHEMA={$schema:"https://json-schema.org/draft-07/schema",$id:"https://example.com/product.schema.json",title:"Create Make",description:"An advance CLI tools for creating new project from GitHub repository.",type:"object",properties:{categories:{type:"object",additionalProperties:{type:"object",additionalProperties:{type:"object",properties:{repo:{type:"string",default:"repoUrl"},args:{type:"array",items:{type:"object",properties:{str:{type:"string",default:"contentToReplace"},value:{type:"string",default:"projectName"}}}}}}}}}};
7
7
 
8
8
  function _array_like_to_array(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_without_holes(arr){if(Array.isArray(arr))return _array_like_to_array(arr)}function _iterable_to_array(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter)}function _non_iterable_spread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _to_consumable_array(arr){return _array_without_holes(arr)||_iterable_to_array(arr)||_unsupported_iterable_to_array(arr)||_non_iterable_spread()}function _unsupported_iterable_to_array(o,minLen){if(!o)return;if(typeof o==="string")return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}var mkdir=function(path){return mkdirSync(path,{recursive:true})};var rmRF=function(path){return rmSync(path,{recursive:true,force:true})};var pathExists=function(path){return existsSync(path)};var readFile=function(path){return readFileSync(path,{encoding:"utf8"})};var writeFile=function(path,data){return writeFileSync(path,data,{encoding:"utf8"})};var cmd=function(command){var path=arguments.length>1&&arguments[1]!==void 0?arguments[1]:process.cwd();return execSync(command,{stdio:[0,1,2],cwd:path})};var gitClone=function(repo,projectName){return cmd("git clone --depth=1 ".concat(repo," ").concat(projectName))};var findFile=function(dir,fileName){var exclude=arguments.length>2&&arguments[2]!==void 0?arguments[2]:["node_modules",".git"];var finds=[];readdirSync(dir).forEach(function(file){var filePath=join(dir,file);if(!exclude.includes(filePath)){var fileStat=statSync(filePath);if(fileStat.isDirectory())finds=_to_consumable_array(finds).concat(_to_consumable_array(findFile(filePath,fileName)));else if(fileName===true)finds.push(filePath);else if(new RegExp("\\b"+fileName+"\\b").test(basename(file)))finds.push(filePath);}});return finds};var filesChangeContent=function(path,oldContent,newContent){findFile(path,true).map(function(item){var content=readFileSync(item,{encoding:"utf-8"});if(new RegExp("\\b"+oldContent+"\\b").test(content)){writeFileSync(item,content.replace(oldContent,newContent),{encoding:"utf-8"});}});};
9
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-make",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "An advance CLI tools for creating new project from GitHub repository.",
5
5
  "type": "module",
6
6
  "main": "bin.js",
@@ -16,6 +16,14 @@
16
16
  },
17
17
  "license": "MIT",
18
18
  "keywords": [
19
+ "create",
20
+ "project",
21
+ "scaffold",
22
+ "template",
23
+ "templating",
24
+ "boilerplate",
25
+ "make",
26
+ "starter",
19
27
  "starter maker",
20
28
  "project maker"
21
29
  ],