@ismartify/cli
Advanced tools
@@ -1,1 +0,1 @@ | ||
| {"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":[]} | ||
| {"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;"],"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":[]} |
| // src/scripts/version.ts | ||
| import http from "node:http"; | ||
| import inquirer from "inquirer"; | ||
| var script = /* @__PURE__ */ new Map(); | ||
| script.set("title", "Version"); | ||
| script.set("description", "\u663E\u793A CLI \u5DE5\u5177\u7248\u672C\u4FE1\u606F"); | ||
| 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) => { | ||
| 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)); | ||
| 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); | ||
| }); | ||
| }); | ||
| }); | ||
| }); | ||
@@ -12,0 +39,0 @@ var version_default = script; |
@@ -1,1 +0,1 @@ | ||
| {"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":[]} | ||
| {"version":3,"sources":["../../src/scripts/version.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;"],"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,kBAAQ;","names":[]} |
+9
-4
| { | ||
| "name": "@ismartify/cli", | ||
| "version": "1.1.1", | ||
| "version": "1.1.2", | ||
| "description": "iSmartify CLI 工具", | ||
@@ -14,6 +14,10 @@ "type": "module", | ||
| "scripts": { | ||
| "dev": "cross-env NODE_ENV=development tsup --watch&&npm run start", | ||
| "dev": "cross-env NODE_ENV=development tsup --watch", | ||
| "build": "cross-env NODE_ENV=production tsup", | ||
| "start": "cross-env NODE_ENV=production node dist/index.js", | ||
| "list": "cross-env NODE_ENV=development tsx src/index.ts" | ||
| "test": "vitest", | ||
| "release": "standard-version", | ||
| "release:minor": "standard-version --release-as minor", | ||
| "release:major": "standard-version --release-as major", | ||
| "release:patch": "standard-version --release-as patch" | ||
| }, | ||
@@ -34,2 +38,3 @@ "keywords": [ | ||
| "glob": "^11.0.1", | ||
| "standard-version": "^9.5.0", | ||
| "tsup": "^8.4.0", | ||
@@ -39,2 +44,2 @@ "typescript": "^5.8.2", | ||
| } | ||
| } | ||
| } |
@@ -46,2 +46,2 @@ import http from "node:http" | ||
| export default script; | ||
| export default script; |
@@ -0,14 +1,46 @@ | ||
| import http from "node:http" | ||
| import inquirer from "inquirer" | ||
| const script = new Map(); | ||
| script.set('title', 'Version'); | ||
| script.set('description', '显示 CLI 工具版本信息'); | ||
| script.set('title', 'Server'); | ||
| script.set('description', '启动 HTTP 服务器'); | ||
| script.set('setup', async (context: any) => { | ||
| const { port } = await inquirer.prompt([ | ||
| { | ||
| type: 'input', | ||
| name: 'port', | ||
| message: '请输入端口号:', | ||
| default: '3000' | ||
| } | ||
| ]); | ||
| context.port = parseInt(port); | ||
| console.log(`端口设置为: ${context.port}`); | ||
| }); | ||
| script.set('main', async (context: any) => { | ||
| console.log('\n版本信息:'); | ||
| console.log(`名称: ${context.name}`); | ||
| console.log(`版本: ${context.version}`); | ||
| console.log('\n配置信息:'); | ||
| console.log(JSON.stringify(context.config, null, 2)); | ||
| 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(`服务器运行在 http://localhost:${context.port}`); | ||
| }); | ||
| // 等待用户按 Ctrl+C | ||
| await new Promise(() => { | ||
| process.on('SIGINT', () => { | ||
| console.log('\n正在关闭服务器...'); | ||
| server.close(() => { | ||
| console.log('服务器已关闭'); | ||
| process.exit(0); | ||
| }); | ||
| }); | ||
| }); | ||
| }); | ||
| export default script; | ||
| export default script; |
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
706321
0.41%6910
0.79%1
-50%7
16.67%11
22.22%