@ismartify/cli
Advanced tools
| declare const script: Map<any, any>; | ||
| export { script as default }; |
| // src/scripts/server.ts | ||
| import http from "node:http"; | ||
| import inquirer from "inquirer"; | ||
| var script = /* @__PURE__ */ new Map(); | ||
| script.set("title", "Server"); | ||
| script.set("description", "\u542F\u52A8 HTTP \u670D\u52A1\u5668"); | ||
| script.set("setup", async (context) => { | ||
| const { port } = await inquirer.prompt([ | ||
| { | ||
| type: "input", | ||
| name: "port", | ||
| message: "\u8BF7\u8F93\u5165\u7AEF\u53E3\u53F7:", | ||
| default: "3000" | ||
| } | ||
| ]); | ||
| context.port = parseInt(port); | ||
| console.log(`\u7AEF\u53E3\u8BBE\u7F6E\u4E3A: ${context.port}`); | ||
| }); | ||
| script.set("main", async (context) => { | ||
| const server = http.createServer((req, res) => { | ||
| res.writeHead(200, { "Content-Type": "application/json" }); | ||
| res.end(JSON.stringify({ | ||
| message: "hello world" | ||
| })); | ||
| }); | ||
| server.listen(context.port, () => { | ||
| console.log(`\u670D\u52A1\u5668\u8FD0\u884C\u5728 http://localhost:${context.port}`); | ||
| }); | ||
| await new Promise(() => { | ||
| process.on("SIGINT", () => { | ||
| console.log("\n\u6B63\u5728\u5173\u95ED\u670D\u52A1\u5668..."); | ||
| server.close(() => { | ||
| console.log("\u670D\u52A1\u5668\u5DF2\u5173\u95ED"); | ||
| process.exit(0); | ||
| }); | ||
| }); | ||
| }); | ||
| }); | ||
| var server_default = script; | ||
| export { | ||
| server_default as default | ||
| }; | ||
| //# sourceMappingURL=server.js.map |
| {"version":3,"sources":["../../src/scripts/server.ts"],"sourcesContent":["import http from \"node:http\"\nimport inquirer from \"inquirer\"\n\nconst script = new Map();\n\nscript.set('title', 'Server');\nscript.set('description', '启动 HTTP 服务器');\n\nscript.set('setup', async (context: any) => {\n const { port } = await inquirer.prompt([\n {\n type: 'input',\n name: 'port',\n message: '请输入端口号:',\n default: '3000'\n }\n ]);\n context.port = parseInt(port);\n console.log(`端口设置为: ${context.port}`);\n});\n\nscript.set('main', async (context: any) => {\n const server = http.createServer((req, res) => {\n res.writeHead(200, { 'Content-Type': 'application/json' });\n res.end(JSON.stringify({\n message: \"hello world\"\n }));\n });\n\n server.listen(context.port, () => {\n console.log(`服务器运行在 http://localhost:${context.port}`);\n });\n\n // 等待用户按 Ctrl+C\n await new Promise(() => {\n process.on('SIGINT', () => {\n console.log('\\n正在关闭服务器...');\n server.close(() => {\n console.log('服务器已关闭');\n process.exit(0);\n });\n });\n });\n});\n\nexport default script;\n"],"mappings":";AAAA,OAAO,UAAU;AACjB,OAAO,cAAc;AAErB,IAAM,SAAS,oBAAI,IAAI;AAEvB,OAAO,IAAI,SAAS,QAAQ;AAC5B,OAAO,IAAI,eAAe,sCAAa;AAEvC,OAAO,IAAI,SAAS,OAAO,YAAiB;AAC1C,QAAM,EAAE,KAAK,IAAI,MAAM,SAAS,OAAO;AAAA,IACrC;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA,MACT,SAAS;AAAA,IACX;AAAA,EACF,CAAC;AACD,UAAQ,OAAO,SAAS,IAAI;AAC5B,UAAQ,IAAI,mCAAU,QAAQ,IAAI,EAAE;AACtC,CAAC;AAED,OAAO,IAAI,QAAQ,OAAO,YAAiB;AACzC,QAAM,SAAS,KAAK,aAAa,CAAC,KAAK,QAAQ;AAC7C,QAAI,UAAU,KAAK,EAAE,gBAAgB,mBAAmB,CAAC;AACzD,QAAI,IAAI,KAAK,UAAU;AAAA,MACrB,SAAS;AAAA,IACX,CAAC,CAAC;AAAA,EACJ,CAAC;AAED,SAAO,OAAO,QAAQ,MAAM,MAAM;AAChC,YAAQ,IAAI,yDAA2B,QAAQ,IAAI,EAAE;AAAA,EACvD,CAAC;AAGD,QAAM,IAAI,QAAQ,MAAM;AACtB,YAAQ,GAAG,UAAU,MAAM;AACzB,cAAQ,IAAI,iDAAc;AAC1B,aAAO,MAAM,MAAM;AACjB,gBAAQ,IAAI,sCAAQ;AACpB,gBAAQ,KAAK,CAAC;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC;AACH,CAAC;AAED,IAAO,iBAAQ;","names":[]} |
| declare const script: Map<any, any>; | ||
| export { script as default }; |
| // src/scripts/version.ts | ||
| var script = /* @__PURE__ */ new Map(); | ||
| script.set("title", "Version"); | ||
| script.set("description", "\u663E\u793A CLI \u5DE5\u5177\u7248\u672C\u4FE1\u606F"); | ||
| script.set("main", async (context) => { | ||
| console.log("\n\u7248\u672C\u4FE1\u606F:"); | ||
| console.log(`\u540D\u79F0: ${context.name}`); | ||
| console.log(`\u7248\u672C: ${context.version}`); | ||
| console.log("\n\u914D\u7F6E\u4FE1\u606F:"); | ||
| console.log(JSON.stringify(context.config, null, 2)); | ||
| }); | ||
| var version_default = script; | ||
| export { | ||
| version_default as default | ||
| }; | ||
| //# sourceMappingURL=version.js.map |
| {"version":3,"sources":["../../src/scripts/version.ts"],"sourcesContent":["const script = new Map();\n\nscript.set('title', 'Version');\nscript.set('description', '显示 CLI 工具版本信息');\n\nscript.set('main', async (context: any) => {\n console.log('\\n版本信息:');\n console.log(`名称: ${context.name}`);\n console.log(`版本: ${context.version}`);\n console.log('\\n配置信息:');\n console.log(JSON.stringify(context.config, null, 2));\n});\n\nexport default script; "],"mappings":";AAAA,IAAM,SAAS,oBAAI,IAAI;AAEvB,OAAO,IAAI,SAAS,SAAS;AAC7B,OAAO,IAAI,eAAe,uDAAe;AAEzC,OAAO,IAAI,QAAQ,OAAO,YAAiB;AACzC,UAAQ,IAAI,6BAAS;AACrB,UAAQ,IAAI,iBAAO,QAAQ,IAAI,EAAE;AACjC,UAAQ,IAAI,iBAAO,QAAQ,OAAO,EAAE;AACpC,UAAQ,IAAI,6BAAS;AACrB,UAAQ,IAAI,KAAK,UAAU,QAAQ,QAAQ,MAAM,CAAC,CAAC;AACrD,CAAC;AAED,IAAO,kBAAQ;","names":[]} |
+2
-2
| { | ||
| "name": "@ismartify/cli", | ||
| "version": "1.0.18", | ||
| "version": "1.1.0", | ||
| "description": "iSmartify CLI 工具", | ||
@@ -25,3 +25,2 @@ "type": "module", | ||
| "cross-env": "^7.0.3", | ||
| "glob": "^10.3.10", | ||
| "inquirer": "^12.4.3", | ||
@@ -34,2 +33,3 @@ "jiti": "^2.4.2", | ||
| "@types/node": "^22.13.10", | ||
| "glob": "^11.0.1", | ||
| "tsup": "^8.4.0", | ||
@@ -36,0 +36,0 @@ "typescript": "^5.8.2", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Network access
Supply chain riskThis module accesses the network.
Found 2 instances
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 3 instances
703448
2589.33%4
-20%14
75%6856
3527.51%6
20%7
600%10
900%- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed