@cnpx/cnpx 0.0.2 → 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.
- package/.turbo/turbo-build.log +26 -22
- package/README.md +5 -9
- package/out/clone.d.mts +1 -1
- package/out/clone.d.ts +1 -1
- package/out/clone.js +1 -1
- package/out/clone.mjs +1 -1
- package/out/index.d.mts +1 -1
- package/out/index.d.ts +1 -1
- package/out/isInvalidPath.d.mts +3 -0
- package/out/isInvalidPath.d.ts +3 -0
- package/out/isInvalidPath.js +1 -0
- package/out/isInvalidPath.mjs +1 -0
- package/out/main.js +3 -3
- package/out/main.mjs +3 -3
- package/package.json +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
> @cnpx/cnpx@0.0.
|
|
2
|
+
> @cnpx/cnpx@0.0.3 build /home/runner/work/template/template/cnpx/cnpx
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
|
-
[34mCLI[39m 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
|
+
[34mCLI[39m 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
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
7
|
[34mCLI[39m tsup v8.5.1
|
|
8
8
|
[34mCLI[39m Using tsup config: /home/runner/work/template/template/cnpx/cnpx/tsup.config.ts
|
|
@@ -12,48 +12,52 @@
|
|
|
12
12
|
[34mESM[39m Build start
|
|
13
13
|
Generated an empty chunk: "type".
|
|
14
14
|
Generated an empty chunk: "type".
|
|
15
|
-
[32mESM[39m [1mout/type.mjs [22m[32m0 B[39m
|
|
16
|
-
[32mESM[39m [1mout/bin.mjs [22m[32m227.00 B[39m
|
|
17
|
-
[32mESM[39m [1mout/clone.mjs [22m[32m300.00 B[39m
|
|
18
|
-
[32mESM[39m [1mout/fetch.mjs [22m[32m128.00 B[39m
|
|
19
|
-
[32mESM[39m [1mout/checkForUpdate.mjs [22m[32m1.36 KB[39m
|
|
20
|
-
[32mESM[39m [1mout/main.mjs [22m[32m1.42 KB[39m
|
|
21
|
-
[32mESM[39m [1mout/getPackageManager.mjs [22m[32m312.00 B[39m
|
|
22
|
-
[32mESM[39m [1mout/getTemplates.mjs [22m[32m589.00 B[39m
|
|
23
|
-
[32mESM[39m [1mout/getCategories.mjs [22m[32m659.00 B[39m
|
|
24
|
-
[32mESM[39m [1mout/index.mjs [22m[32m268.00 B[39m
|
|
25
|
-
[32mESM[39m [1mout/chunk-A7RKGLUR.mjs [22m[32m77.00 B[39m
|
|
26
|
-
[32mESM[39m ⚡️ Build success in 190ms
|
|
27
15
|
[32mCJS[39m [1mout/bin.js [22m[32m267.00 B[39m
|
|
28
|
-
[32mCJS[39m [1mout/clone.js [22m[
|
|
16
|
+
[32mCJS[39m [1mout/clone.js [22m[32m416.00 B[39m
|
|
29
17
|
[32mCJS[39m [1mout/fetch.js [22m[32m109.00 B[39m
|
|
30
|
-
[32mCJS[39m [1mout/checkForUpdate.js [22m[32m1.44 KB[39m
|
|
31
18
|
[32mCJS[39m [1mout/getCategories.js [22m[32m659.00 B[39m
|
|
32
19
|
[32mCJS[39m [1mout/getPackageManager.js [22m[32m342.00 B[39m
|
|
33
|
-
[32mCJS[39m [1mout/
|
|
20
|
+
[32mCJS[39m [1mout/checkForUpdate.js [22m[32m1.44 KB[39m
|
|
34
21
|
[32mCJS[39m [1mout/getTemplates.js [22m[32m584.00 B[39m
|
|
35
|
-
[32mCJS[39m [1mout/
|
|
22
|
+
[32mCJS[39m [1mout/index.js [22m[32m1.98 KB[39m
|
|
23
|
+
[32mCJS[39m [1mout/isInvalidPath.js [22m[32m196.00 B[39m
|
|
36
24
|
[32mCJS[39m [1mout/type.js [22m[32m13.00 B[39m
|
|
37
|
-
[32mCJS[39m
|
|
25
|
+
[32mCJS[39m [1mout/main.js [22m[32m2.09 KB[39m
|
|
26
|
+
[32mCJS[39m ⚡️ Build success in 104ms
|
|
27
|
+
[32mESM[39m [1mout/type.mjs [22m[32m0 B[39m
|
|
28
|
+
[32mESM[39m [1mout/isInvalidPath.mjs [22m[32m214.00 B[39m
|
|
29
|
+
[32mESM[39m [1mout/main.mjs [22m[32m1.88 KB[39m
|
|
30
|
+
[32mESM[39m [1mout/fetch.mjs [22m[32m128.00 B[39m
|
|
31
|
+
[32mESM[39m [1mout/bin.mjs [22m[32m227.00 B[39m
|
|
32
|
+
[32mESM[39m [1mout/checkForUpdate.mjs [22m[32m1.36 KB[39m
|
|
33
|
+
[32mESM[39m [1mout/clone.mjs [22m[32m299.00 B[39m
|
|
34
|
+
[32mESM[39m [1mout/getCategories.mjs [22m[32m659.00 B[39m
|
|
35
|
+
[32mESM[39m [1mout/getPackageManager.mjs [22m[32m312.00 B[39m
|
|
36
|
+
[32mESM[39m [1mout/index.mjs [22m[32m268.00 B[39m
|
|
37
|
+
[32mESM[39m [1mout/getTemplates.mjs [22m[32m589.00 B[39m
|
|
38
|
+
[32mESM[39m [1mout/chunk-A7RKGLUR.mjs [22m[32m77.00 B[39m
|
|
39
|
+
[32mESM[39m ⚡️ Build success in 105ms
|
|
38
40
|
[34mDTS[39m Build start
|
|
39
|
-
[32mDTS[39m ⚡️ Build success in
|
|
41
|
+
[32mDTS[39m ⚡️ Build success in 977ms
|
|
40
42
|
[32mDTS[39m [1mout/bin.d.ts [22m[32m20.00 B[39m
|
|
41
43
|
[32mDTS[39m [1mout/index.d.ts [22m[32m454.00 B[39m
|
|
42
44
|
[32mDTS[39m [1mout/checkForUpdate.d.ts [22m[32m78.00 B[39m
|
|
43
|
-
[32mDTS[39m [1mout/clone.d.ts [22m[
|
|
45
|
+
[32mDTS[39m [1mout/clone.d.ts [22m[32m120.00 B[39m
|
|
44
46
|
[32mDTS[39m [1mout/fetch.d.ts [22m[32m101.00 B[39m
|
|
45
47
|
[32mDTS[39m [1mout/getCategories.d.ts [22m[32m210.00 B[39m
|
|
46
48
|
[32mDTS[39m [1mout/getPackageManager.d.ts [22m[32m94.00 B[39m
|
|
47
49
|
[32mDTS[39m [1mout/getTemplates.d.ts [22m[32m154.00 B[39m
|
|
50
|
+
[32mDTS[39m [1mout/isInvalidPath.d.ts [22m[32m89.00 B[39m
|
|
48
51
|
[32mDTS[39m [1mout/main.d.ts [22m[32m63.00 B[39m
|
|
49
52
|
[32mDTS[39m [1mout/type.d.ts [22m[32m477.00 B[39m
|
|
50
53
|
[32mDTS[39m [1mout/bin.d.mts [22m[32m20.00 B[39m
|
|
51
54
|
[32mDTS[39m [1mout/index.d.mts [22m[32m462.00 B[39m
|
|
52
55
|
[32mDTS[39m [1mout/checkForUpdate.d.mts [22m[32m78.00 B[39m
|
|
53
|
-
[32mDTS[39m [1mout/clone.d.mts [22m[
|
|
56
|
+
[32mDTS[39m [1mout/clone.d.mts [22m[32m120.00 B[39m
|
|
54
57
|
[32mDTS[39m [1mout/fetch.d.mts [22m[32m101.00 B[39m
|
|
55
58
|
[32mDTS[39m [1mout/getCategories.d.mts [22m[32m211.00 B[39m
|
|
56
59
|
[32mDTS[39m [1mout/getPackageManager.d.mts [22m[32m94.00 B[39m
|
|
57
60
|
[32mDTS[39m [1mout/getTemplates.d.mts [22m[32m155.00 B[39m
|
|
61
|
+
[32mDTS[39m [1mout/isInvalidPath.d.mts [22m[32m89.00 B[39m
|
|
58
62
|
[32mDTS[39m [1mout/main.d.mts [22m[32m63.00 B[39m
|
|
59
63
|
[32mDTS[39m [1mout/type.d.mts [22m[32m477.00 B[39m
|
package/README.md
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
# @cnpx/cnpx
|
|
2
2
|
|
|
3
|
-
[](https://discord.gg/FaCCaFM74Q)
|
|
4
|
-
[](https://github.com/xcfio/template/actions)
|
|
5
|
-
[](https://www.npmjs.com/package/@cnpx/cnpx)
|
|
6
|
-
[](https://www.npmjs.com/package/@cnpx/cnpx)
|
|
7
|
-
[](https://www.npmjs.com/package/@cnpx/cnpx)
|
|
8
|
-
[](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
|
-
|
|
103
|
-
|
|
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
package/out/clone.d.ts
CHANGED
package/out/clone.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var prompts=require('@clack/prompts'),
|
|
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
|
|
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
package/out/index.d.ts
CHANGED
|
@@ -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'),
|
|
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(
|
|
4
|
-
exports.main=
|
|
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,
|
|
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(
|
|
4
|
-
export{
|
|
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.
|
|
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",
|