@cnpx/cnpx 0.0.2-dev.20260403103238 → 0.0.3-dev.20260403142545

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.
@@ -1,8 +1,8 @@
1
1
 
2
- > @cnpx/cnpx@0.0.2 build /home/runner/work/template/template/cnpx/cnpx
2
+ > @cnpx/cnpx@0.0.3 build /home/runner/work/template/template/cnpx/cnpx
3
3
  > tsup
4
4
 
5
- CLI Building entry: src/bin.ts, src/checkForUpdate.ts, src/clone.ts, src/fetch.ts, src/getCategories.ts, src/getPackageManager.ts, src/getTemplates.ts, src/index.ts, src/main.ts, src/type.ts
5
+ CLI Building entry: src/bin.ts, src/checkForUpdate.ts, src/clone.ts, src/fetch.ts, src/getCategories.ts, src/getPackageManager.ts, src/getTemplates.ts, src/index.ts, src/isInvalidPath.ts, src/main.ts, src/type.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
7
  CLI tsup v8.5.1
8
8
  CLI Using tsup config: /home/runner/work/template/template/cnpx/cnpx/tsup.config.ts
@@ -13,47 +13,51 @@
13
13
  Generated an empty chunk: "type".
14
14
  Generated an empty chunk: "type".
15
15
  CJS out/bin.js 267.00 B
16
- CJS out/clone.js 417.00 B
17
- CJS out/checkForUpdate.js 1.44 KB
18
- CJS out/getPackageManager.js 342.00 B
16
+ CJS out/clone.js 416.00 B
19
17
  CJS out/fetch.js 109.00 B
20
- CJS out/index.js 1.98 KB
21
18
  CJS out/getCategories.js 659.00 B
19
+ CJS out/getPackageManager.js 342.00 B
20
+ CJS out/checkForUpdate.js 1.44 KB
22
21
  CJS out/getTemplates.js 584.00 B
23
- CJS out/main.js 1.57 KB
22
+ CJS out/index.js 1.98 KB
23
+ CJS out/isInvalidPath.js 196.00 B
24
24
  CJS out/type.js 13.00 B
25
- CJS ⚡️ Build success in 130ms
25
+ CJS out/main.js 2.09 KB
26
+ CJS ⚡️ Build success in 104ms
26
27
  ESM out/type.mjs 0 B
27
- ESM out/bin.mjs 227.00 B
28
- ESM out/main.mjs 1.42 KB
29
- ESM out/clone.mjs 300.00 B
28
+ ESM out/isInvalidPath.mjs 214.00 B
29
+ ESM out/main.mjs 1.88 KB
30
30
  ESM out/fetch.mjs 128.00 B
31
- ESM out/getCategories.mjs 659.00 B
31
+ ESM out/bin.mjs 227.00 B
32
32
  ESM out/checkForUpdate.mjs 1.36 KB
33
+ ESM out/clone.mjs 299.00 B
34
+ ESM out/getCategories.mjs 659.00 B
33
35
  ESM out/getPackageManager.mjs 312.00 B
34
- ESM out/getTemplates.mjs 589.00 B
35
36
  ESM out/index.mjs 268.00 B
37
+ ESM out/getTemplates.mjs 589.00 B
36
38
  ESM out/chunk-A7RKGLUR.mjs 77.00 B
37
- ESM ⚡️ Build success in 131ms
39
+ ESM ⚡️ Build success in 105ms
38
40
  DTS Build start
39
- DTS ⚡️ Build success in 1253ms
41
+ DTS ⚡️ Build success in 977ms
40
42
  DTS out/bin.d.ts 20.00 B
41
43
  DTS out/index.d.ts 454.00 B
42
44
  DTS out/checkForUpdate.d.ts 78.00 B
43
- DTS out/clone.d.ts 104.00 B
45
+ DTS out/clone.d.ts 120.00 B
44
46
  DTS out/fetch.d.ts 101.00 B
45
47
  DTS out/getCategories.d.ts 210.00 B
46
48
  DTS out/getPackageManager.d.ts 94.00 B
47
49
  DTS out/getTemplates.d.ts 154.00 B
50
+ DTS out/isInvalidPath.d.ts 89.00 B
48
51
  DTS out/main.d.ts 63.00 B
49
52
  DTS out/type.d.ts 477.00 B
50
53
  DTS out/bin.d.mts 20.00 B
51
54
  DTS out/index.d.mts 462.00 B
52
55
  DTS out/checkForUpdate.d.mts 78.00 B
53
- DTS out/clone.d.mts 104.00 B
56
+ DTS out/clone.d.mts 120.00 B
54
57
  DTS out/fetch.d.mts 101.00 B
55
58
  DTS out/getCategories.d.mts 211.00 B
56
59
  DTS out/getPackageManager.d.mts 94.00 B
57
60
  DTS out/getTemplates.d.mts 155.00 B
61
+ DTS out/isInvalidPath.d.mts 89.00 B
58
62
  DTS out/main.d.mts 63.00 B
59
63
  DTS out/type.d.mts 477.00 B
package/README.md CHANGED
@@ -1,12 +1,5 @@
1
1
  # @cnpx/cnpx
2
2
 
3
- [![Discord](https://img.shields.io/discord/1211530334458617866?style=flat&logo=discord&logoColor=ffffff&color=5865f2)](https://discord.gg/FaCCaFM74Q)
4
- [![GitHub Action](https://github.com/xcfio/template/actions/workflows/test.yaml/badge.svg)](https://github.com/xcfio/template/actions)
5
- [![NPM Version](https://img.shields.io/npm/v/@cnpx/cnpx)](https://www.npmjs.com/package/@cnpx/cnpx)
6
- [![NPM Downloads](https://img.shields.io/npm/dy/@cnpx/cnpx)](https://www.npmjs.com/package/@cnpx/cnpx)
7
- [![NPM Unpacked Size](https://img.shields.io/npm/unpacked-size/@cnpx/cnpx)](https://www.npmjs.com/package/@cnpx/cnpx)
8
- [![NPM License](https://img.shields.io/npm/l/@cnpx/cnpx)](https://github.com/xcfio/template/blob/main/LICENSE)
9
-
10
3
  `@cnpx/cnpx` is an interactive CLI that scaffolds projects from the
11
4
  [`xcfio/template`](https://github.com/xcfio/template) repository.
12
5
 
@@ -99,8 +92,11 @@ Available scripts:
99
92
 
100
93
  - The CLI is currently fully interactive and does not expose command-line flags.
101
94
  - GitHub API rate limits can block category/template loading.
102
- - Template cloning currently uses `force: true`; existing files in the target
103
- directory may be overwritten.
95
+
96
+ ## Support
97
+
98
+ - Issues: [GitHub Issues](https://github.com/xcfio/template/issues)
99
+ - Discord: [Discord Server](https://discord.gg/FaCCaFM74Q)
104
100
 
105
101
  ## License
106
102
 
package/out/clone.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- declare function clone(name: string, type: string, template: string): Promise<void>;
1
+ declare function clone(name: string, type: string, template: string, force: boolean): Promise<void>;
2
2
 
3
3
  export { clone };
package/out/clone.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- declare function clone(name: string, type: string, template: string): Promise<void>;
1
+ declare function clone(name: string, type: string, template: string, force: boolean): Promise<void>;
2
2
 
3
3
  export { clone };
package/out/clone.js CHANGED
@@ -1 +1 @@
1
- 'use strict';var prompts=require('@clack/prompts'),i=require('degit');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var i__default=/*#__PURE__*/_interopDefault(i);async function l(e,r,o){const t=prompts.spinner();t.start("Cloning repository"),await i__default.default(`xcfio/template/${r}/${o}`,{cache:true,force:true,verbose:true}).clone(e),t.stop("Template cloned successfully");}exports.clone=l;
1
+ 'use strict';var prompts=require('@clack/prompts'),s=require('degit');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var s__default=/*#__PURE__*/_interopDefault(s);async function a(e,o,n,r){const t=prompts.spinner();t.start("Cloning repository"),await s__default.default(`xcfio/template/${o}/${n}`,{force:r,cache:true,verbose:true}).clone(e),t.stop("Template cloned successfully");}exports.clone=a;
package/out/clone.mjs CHANGED
@@ -1 +1 @@
1
- import'./chunk-A7RKGLUR.mjs';import {spinner}from'@clack/prompts';import i from'degit';async function l(e,r,o){const t=spinner();t.start("Cloning repository"),await i(`xcfio/template/${r}/${o}`,{cache:true,force:true,verbose:true}).clone(e),t.stop("Template cloned successfully");}export{l as clone};
1
+ import'./chunk-A7RKGLUR.mjs';import {spinner}from'@clack/prompts';import s from'degit';async function a(e,o,n,r){const t=spinner();t.start("Cloning repository"),await s(`xcfio/template/${o}/${n}`,{force:r,cache:true,verbose:true}).clone(e),t.stop("Template cloned successfully");}export{a as clone};
package/out/index.d.mts CHANGED
@@ -7,6 +7,6 @@ export { getTemplates } from './getTemplates.mjs';
7
7
  export { main } from './main.mjs';
8
8
  export { FilteredGithubResponse, GithubAPIResponse } from './type.mjs';
9
9
 
10
- var version = "0.0.2";
10
+ var version = "0.0.3";
11
11
 
12
12
  export { version };
package/out/index.d.ts CHANGED
@@ -7,6 +7,6 @@ export { getTemplates } from './getTemplates.js';
7
7
  export { main } from './main.js';
8
8
  export { FilteredGithubResponse, GithubAPIResponse } from './type.js';
9
9
 
10
- var version = "0.0.2";
10
+ var version = "0.0.3";
11
11
 
12
12
  export { version };
@@ -0,0 +1,3 @@
1
+ declare function isInvalidPath(path: string): boolean | null;
2
+
3
+ export { isInvalidPath };
@@ -0,0 +1,3 @@
1
+ declare function isInvalidPath(path: string): boolean | null;
2
+
3
+ export { isInvalidPath };
@@ -0,0 +1 @@
1
+ 'use strict';var node_fs=require('node:fs');function o(r){return node_fs.existsSync(r)?node_fs.statSync(r).isDirectory()?node_fs.readdirSync(r).length?true:null:false:null}exports.isInvalidPath=o;
@@ -0,0 +1 @@
1
+ import'./chunk-A7RKGLUR.mjs';import {existsSync,statSync,readdirSync}from'node:fs';function o(r){return existsSync(r)?statSync(r).isDirectory()?readdirSync(r).length?true:null:false:null}export{o as isInvalidPath};
package/out/main.js CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var prompts=require('@clack/prompts'),getPackageManager=require('./getPackageManager'),checkForUpdate=require('./checkForUpdate'),getCategories=require('./getCategories'),colorette=require('colorette'),getTemplates=require('./getTemplates'),clone=require('./clone');async function H(){prompts.intro(colorette.blue("Create a new project"));const i=prompts.spinner();i.start("Checking for updates"),await checkForUpdate.checkForUpdate(),i.clear();const t=await prompts.text({message:"Project Name",placeholder:"my-project",defaultValue:"my-project"});if(prompts.isCancel(t))return prompts.cancel("Operation cancelled"),process.exit(0);const s=await getCategories.getCategories(),a=await prompts.select({message:"Select a category",options:s.map(e=>({name:e.name,value:e.name}))});if(prompts.isCancel(a))return prompts.cancel("Operation cancelled"),process.exit(0);const l=await getTemplates.getTemplates(a),n=await prompts.select({message:"Select a template",options:l.map(e=>({name:e.name,value:e.name}))});if(prompts.isCancel(n))return prompts.cancel("Operation cancelled"),process.exit(0);const m=await prompts.confirm({message:`Create project with name: ${colorette.bold(t)}, category: ${colorette.bold(a)}, template: ${colorette.bold(n)}?`});if(prompts.isCancel(m)||!m)return prompts.cancel("Operation cancelled"),process.exit(0);await clone.clone(t,a,n),prompts.note(`cd ${t}
1
+ 'use strict';var prompts=require('@clack/prompts'),getPackageManager=require('./getPackageManager'),colorette=require('colorette'),checkForUpdate=require('./checkForUpdate'),isInvalidPath=require('./isInvalidPath'),getCategories=require('./getCategories'),getTemplates=require('./getTemplates'),clone=require('./clone'),node_path=require('node:path');async function q(){prompts.intro(colorette.blue("Create a new project"));const c=prompts.spinner();c.start("Checking for updates"),await checkForUpdate.checkForUpdate(),c.clear();const t=await prompts.text({message:"Project Name",placeholder:"my-project",defaultValue:"my-project"});if(prompts.isCancel(t))return prompts.cancel("Operation cancelled"),process.exit(0);const s=isInvalidPath.isInvalidPath(node_path.join(process.cwd(),t));let m=false;if(s!==null)if(s){const e=await prompts.confirm({message:`Directory ${colorette.green(t)} already exists. Do you want to overwrite it?`});if(prompts.isCancel(e)||!e)return prompts.cancel("Operation cancelled"),process.exit(0);m=true;}else return prompts.cancel(`${colorette.green(t)} is a file. Please choose a different project name.`),process.exit(1);const d=await getCategories.getCategories(),r=await prompts.select({message:"Select a category",options:d.map(e=>({name:e.name,value:e.name}))});if(prompts.isCancel(r))return prompts.cancel("Operation cancelled"),process.exit(0);const g=await getTemplates.getTemplates(r),n=await prompts.select({message:"Select a template",options:g.map(e=>({name:e.name,value:e.name}))});if(prompts.isCancel(n))return prompts.cancel("Operation cancelled"),process.exit(0);const l=await prompts.confirm({message:`Create project with name: ${colorette.bold(t)}, category: ${colorette.bold(r)}, template: ${colorette.bold(n)}?`});if(prompts.isCancel(l)||!l)return prompts.cancel("Operation cancelled"),process.exit(0);await clone.clone(t,r,n,m),prompts.note(`cd ${t}
2
2
  ${getPackageManager.getPackageManager()} install
3
- node --run dev`,"To get started, run:"),prompts.outro(`\u2B50 Give a ${colorette.yellow("star")} on GitHub: https://github.com/xcfio/template`);}
4
- exports.main=H;
3
+ node --run dev`,"To get started, run:"),prompts.outro(`Thanks for using template! \u2B50 Give a ${colorette.yellow("star")} on GitHub: https://github.com/xcfio/template`);}
4
+ exports.main=q;
package/out/main.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import'./chunk-A7RKGLUR.mjs';import {intro,spinner,text,isCancel,cancel,select,confirm,note,outro}from'@clack/prompts';import {getPackageManager}from'./getPackageManager';import {checkForUpdate}from'./checkForUpdate';import {getCategories}from'./getCategories';import {blue,bold,yellow}from'colorette';import {getTemplates}from'./getTemplates';import {clone}from'./clone';async function H(){intro(blue("Create a new project"));const i=spinner();i.start("Checking for updates"),await checkForUpdate(),i.clear();const t=await text({message:"Project Name",placeholder:"my-project",defaultValue:"my-project"});if(isCancel(t))return cancel("Operation cancelled"),process.exit(0);const s=await getCategories(),a=await select({message:"Select a category",options:s.map(e=>({name:e.name,value:e.name}))});if(isCancel(a))return cancel("Operation cancelled"),process.exit(0);const l=await getTemplates(a),n=await select({message:"Select a template",options:l.map(e=>({name:e.name,value:e.name}))});if(isCancel(n))return cancel("Operation cancelled"),process.exit(0);const m=await confirm({message:`Create project with name: ${bold(t)}, category: ${bold(a)}, template: ${bold(n)}?`});if(isCancel(m)||!m)return cancel("Operation cancelled"),process.exit(0);await clone(t,a,n),note(`cd ${t}
1
+ import'./chunk-A7RKGLUR.mjs';import {intro,spinner,text,isCancel,cancel,confirm,select,note,outro}from'@clack/prompts';import {getPackageManager}from'./getPackageManager';import {blue,green,bold,yellow}from'colorette';import {checkForUpdate}from'./checkForUpdate';import {isInvalidPath}from'./isInvalidPath';import {getCategories}from'./getCategories';import {getTemplates}from'./getTemplates';import {clone}from'./clone';import {join}from'node:path';async function q(){intro(blue("Create a new project"));const c=spinner();c.start("Checking for updates"),await checkForUpdate(),c.clear();const t=await text({message:"Project Name",placeholder:"my-project",defaultValue:"my-project"});if(isCancel(t))return cancel("Operation cancelled"),process.exit(0);const s=isInvalidPath(join(process.cwd(),t));let m=false;if(s!==null)if(s){const e=await confirm({message:`Directory ${green(t)} already exists. Do you want to overwrite it?`});if(isCancel(e)||!e)return cancel("Operation cancelled"),process.exit(0);m=true;}else return cancel(`${green(t)} is a file. Please choose a different project name.`),process.exit(1);const d=await getCategories(),r=await select({message:"Select a category",options:d.map(e=>({name:e.name,value:e.name}))});if(isCancel(r))return cancel("Operation cancelled"),process.exit(0);const g=await getTemplates(r),n=await select({message:"Select a template",options:g.map(e=>({name:e.name,value:e.name}))});if(isCancel(n))return cancel("Operation cancelled"),process.exit(0);const l=await confirm({message:`Create project with name: ${bold(t)}, category: ${bold(r)}, template: ${bold(n)}?`});if(isCancel(l)||!l)return cancel("Operation cancelled"),process.exit(0);await clone(t,r,n,m),note(`cd ${t}
2
2
  ${getPackageManager()} install
3
- node --run dev`,"To get started, run:"),outro(`\u2B50 Give a ${yellow("star")} on GitHub: https://github.com/xcfio/template`);}
4
- export{H as main};
3
+ node --run dev`,"To get started, run:"),outro(`Thanks for using template! \u2B50 Give a ${yellow("star")} on GitHub: https://github.com/xcfio/template`);}
4
+ export{q as main};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cnpx/cnpx",
3
- "version": "0.0.2-dev.20260403103238",
4
- "description": "",
3
+ "version": "0.0.3-dev.20260403142545",
4
+ "description": "A simple CLI to scaffold projects from remote templates",
5
5
  "author": "xcfio",
6
6
  "homepage": "https://github.com/xcfio/template/tree/main/cnpx/cnpx#readme",
7
7
  "type": "commonjs",