create-a-pkg 1.0.0 → 1.0.1

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 ADDED
@@ -0,0 +1,30 @@
1
+ # 构建简单的 npm 库
2
+
3
+ [![version](<https://img.shields.io/npm/v/create-a-npm.svg?logo=npm&logoColor=rgb(0,0,0)&label=版本号&labelColor=rgb(73,73,228)&color=rgb(0,0,0)>)](https://www.npmjs.com/package/create-a-npm) [![issues 提交](<https://img.shields.io/badge/issues-提交-rgb(255,0,63)?logo=github>)](https://github.com/earthnutDev/create-a-npm/issues)
4
+
5
+ ## 安装
6
+
7
+ 该库不安装亦可直接使用 `npm create a-npm` 全局使用,如果你非要安装的话,就:
8
+
9
+ ```sh
10
+ npm install -g create-a-npm
11
+ ```
12
+
13
+ ## 使用
14
+
15
+ ```sh
16
+ # 最简单的使用方式
17
+ npm create a-npm
18
+ ```
19
+
20
+ 在使用中,会在用户的目录下创建 `.earthnut.dev.data/create-a-npm/config` 文件,以储存您的数据在本地(这些数据不会走网络,安全可用)方便下次使用时直接使用。_若觉得无用,可执行删除_,**_若觉得不知而误删除,下次后还需再次输入您的使用数据。_**所以,建议保留数据:
21
+
22
+ - linux: /home/`username`/earthnut.dev.data/create-a-npm/config
23
+ - macOS: /Users/`username`/earthnut.dev.data/create-a-npm/config
24
+ - Windows: C:\Users\`username`\earthnut.dev.data\create-a-npm\config
25
+
26
+ (尚未在 windows 上进行全量测试)
27
+
28
+ ## 📄 文档地址
29
+
30
+ 参看 [https://earthnut.dev/create-a-npm/](https://earthnut.dev/create-a-npm/)
package/package.json CHANGED
@@ -1,9 +1,37 @@
1
1
  {
2
2
  "name": "create-a-pkg",
3
3
  "type": "module",
4
- "version": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "description": "一个一键生成一个符合特定规则 <就是一个简单的代码模板库> 的 npm 包",
6
6
  "license": "MIT",
7
+ "devDependencies": {
8
+ "@eslint/js": "^9.28.0",
9
+ "@qqi/check-version": "^1.0.2",
10
+ "@qqi/rollup-external": "^1.0.6",
11
+ "@rollup/plugin-commonjs": "^28.0.3",
12
+ "@rollup/plugin-json": "^6.1.0",
13
+ "@rollup/plugin-node-resolve": "^16.0.1",
14
+ "@rollup/plugin-terser": "^0.4.4",
15
+ "@rollup/plugin-typescript": "^12.1.2",
16
+ "@types/node": "^24.0.1",
17
+ "eslint": "^9.28.0",
18
+ "eslint-config-prettier": "^10.1.5",
19
+ "eslint-plugin-jsdoc": "^51.0.1",
20
+ "globals": "^16.2.0",
21
+ "gvv": "^0.0.7",
22
+ "husky": "^9.1.7",
23
+ "jja": "^2.3.8",
24
+ "lint-staged": "^16.1.0",
25
+ "pjj": "^1.0.1",
26
+ "prettier": "^3.5.3",
27
+ "rollup": "^4.43.0",
28
+ "rollup-plugin-cleanup": "^3.2.1",
29
+ "rollup-plugin-copy": "^3.5.0",
30
+ "tslib": "^2.8.1",
31
+ "typescript": "^5.8.3",
32
+ "typescript-eslint": "^8.34.0",
33
+ "vjj": "^1.0.5"
34
+ },
7
35
  "dependencies": {
8
36
  "@color-pen/static": "^1.0.0",
9
37
  "@qqi/dev-log": "^1.0.4",
@@ -1 +1 @@
1
- import{initializeFile as e,getDirectoryBy as l,readFileToJsonSync as n,pathJoin as i}from"a-node-tools";import{originDependencies as p}from"./origin-dependencies.mjs";const[s]=e();let r=l("package.json","file",s);null==r&&(r=process.cwd());const t=n(i(r,"package.json")),c={cwd:"",range:"",pkgFile(...e){return i(this.cwd,...e)},rangeFile(...e){return i(this.range,...e)},get name(){return this.package.name},set name(e){this.childPkg?this.carryRange?(this.range=e.replace(/^@(.*)\/.*$/g,"$1"),this.cwd=e.replace(/@/,"").replace(/\//,"/packages/")):this.cwd=e.replace(/^.*\/(.*)$/g,"$1"):this.cwd=e,this.package.name=e},bin:0,local:{author:{name:"",email:"",url:""},dependencies:p},package:{name:"",version:"0.0.0",description:"",author:{name:"",email:"",url:""},dependencies:t?.dependencies||{},devDependencies:t?.devDependencies||{}},install:!1,carryRange:!1,childPkg:!1,buildDevDependencies(){const{dependencies:e}=this.local,{devDependencies:l,dependencies:n}=this.package,i={"@qqi/check-version":l["@qqi/check-version"]||"^1.0.2","@qqi/rollup-external":l["@qqi/rollup-external"]||"^1.0.5","@rollup/plugin-commonjs":l["@rollup/plugin-commonjs"]||"^28.0.3","@rollup/plugin-json":l["@rollup/plugin-json"]||"^6.1.0","@rollup/plugin-node-resolve":l["@rollup/plugin-node-resolve"]||"^16.0.1","@rollup/plugin-terser":l["@rollup/plugin-terser"]||"^0.4.4","a-command":n["a-command"]||"^2.3.8","a-node-tools":n["a-node-tools"]||"^4.2.6",gvv:l.gvv||"^0.0.7",jja:l.jja||"^2.3.8",pjj:l.pjj||"^1.0.1",vjj:l.vjj||"^1.0.5",rollup:l.rollup||"^4.43.0","rollup-plugin-cleanup":l["rollup-plugin-cleanup"]||"^3.2.1","rollup-plugin-copy":l["rollup-plugin-copy"]||"^3.5.0"};return e.includes("husky")&&e.includes("prettier")&&(i.husky=l.husky||"^9.1.7",i["lint-staged"]=l["lint-staged"]||"^16.1.0"),e.includes("eslint")&&(i.eslint=l.eslint||"^9.28.0",i["eslint-plugin-jsdoc"]=l["eslint-plugin-jsdoc"]||"^50.8.0",i.globals=l.globals||"^16.2.0",i["@eslint/js"]=l["@eslint/js"]||"^9.28.0",e.includes("typescript")&&(i["typescript-eslint"]=l["typescript-eslint"]||"^5.8.3"),e.includes("prettier")&&(i["eslint-config-prettier"]=l["eslint-config-prettier"]||"^5.8.3")),e.includes("prettier")&&(i.prettier=l.prettier||"^3.5.3"),e.includes("typescript")&&(i["@types/node"]=l["@types/node"]||"^24.0.1",i["@rollup/plugin-typescript"]=l["@rollup/plugin-typescript"]||"^12.1.2",i.typescript=l.typescript||"^5.8.3"),i}};export{c as dataStore};
1
+ import{initializeFile as e,getDirectoryBy as l,readFileToJsonSync as n,pathJoin as i}from"a-node-tools";import{originDependencies as p}from"./origin-dependencies.mjs";import{dog as s}from"../dog.mjs";import{isUndefined as t}from"a-type-of-js";const[r]=e();let o=l("package.json","file",r);s("获取到的地址为",o),t(o)&&(o=process.cwd());const c=n(i(o,"package.json"));s("获取到的数据为:",c);const a={cwd:"",range:"",pkgFile(...e){return i(this.cwd,...e)},rangeFile(...e){return i(this.range,...e)},get name(){return this.package.name},set name(e){this.childPkg?this.carryRange?(this.range=e.replace(/^@(.*)\/.*$/g,"$1"),this.cwd=e.replace(/@/,"").replace(/\//,"/packages/")):this.cwd=e.replace(/^.*\/(.*)$/g,"$1"):this.cwd=e,this.package.name=e},bin:0,local:{author:{name:"",email:"",url:""},dependencies:p},package:{name:"",version:"0.0.0",description:"",author:{name:"",email:"",url:""},dependencies:c?.dependencies||{},devDependencies:c?.devDependencies||{}},install:!1,carryRange:!1,childPkg:!1,buildDevDependencies(){const{dependencies:e}=this.local,{devDependencies:l,dependencies:n}=this.package;s("获取的本地的包信息",e),s("获取本地的");const i={"@qqi/check-version":l["@qqi/check-version"]||"^1.0.2","@qqi/rollup-external":l["@qqi/rollup-external"]||"^1.0.6","@rollup/plugin-commonjs":l["@rollup/plugin-commonjs"]||"^28.0.3","@rollup/plugin-json":l["@rollup/plugin-json"]||"^6.1.0","@rollup/plugin-node-resolve":l["@rollup/plugin-node-resolve"]||"^16.0.1","@rollup/plugin-terser":l["@rollup/plugin-terser"]||"^0.4.4","a-command":n["a-command"]||"^2.3.8","a-node-tools":n["a-node-tools"]||"^4.2.6",gvv:l.gvv||"^0.0.7",jja:l.jja||"^2.3.8",pjj:l.pjj||"^1.0.1",vjj:l.vjj||"^1.0.5",rollup:l.rollup||"^4.43.0","rollup-plugin-cleanup":l["rollup-plugin-cleanup"]||"^3.2.1","rollup-plugin-copy":l["rollup-plugin-copy"]||"^3.5.0"};return e.includes("husky")&&e.includes("prettier")&&(i.husky=l.husky||"^9.1.7",i["lint-staged"]=l["lint-staged"]||"^16.1.0"),e.includes("eslint")&&(i.eslint=l.eslint||"^9.28.0",i["eslint-plugin-jsdoc"]=l["eslint-plugin-jsdoc"]||"^51.0.1",i.globals=l.globals||"^16.2.0",i["@eslint/js"]=l["@eslint/js"]||"^9.28.0",e.includes("typescript")&&(i["typescript-eslint"]=l["typescript-eslint"]||"^8.34.0"),e.includes("prettier")&&(i["eslint-config-prettier"]=l["eslint-config-prettier"]||"^10.1.5")),e.includes("prettier")&&(i.prettier=l.prettier||"^3.5.3"),e.includes("typescript")&&(i["@types/node"]=l["@types/node"]||"^24.0.1",i["@rollup/plugin-typescript"]=l["@rollup/plugin-typescript"]||"^12.1.2",i.typescript=l.typescript||"^5.8.3"),s("构建的依赖图",i),i}};export{a as dataStore};