@longzai-intelligence-cli/standard 0.0.2
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/dist/index.d.ts +35 -0
- package/dist/index.js +1 -0
- package/dist/rolldown-runtime-BqT_7tdF.js +1 -0
- package/package.json +45 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import "./rolldown-runtime-BqT_7tdF.js";
|
|
2
|
+
import { ColorProvider, InteractionProvider } from "@longzai-intelligence-cli/core";
|
|
3
|
+
//#region src/index.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { createCli } from '@longzai-intelligence-cli/core';
|
|
8
|
+
* import { clackInteraction, picocolorsColor } from '@longzai-intelligence-cli/standard';
|
|
9
|
+
*
|
|
10
|
+
* createCli({
|
|
11
|
+
* name: 'lzi-my-app',
|
|
12
|
+
* interaction: clackInteraction,
|
|
13
|
+
* color: picocolorsColor,
|
|
14
|
+
* });
|
|
15
|
+
* ```;
|
|
16
|
+
*
|
|
17
|
+
* @longzai-intelligence-cli/standard
|
|
18
|
+
*
|
|
19
|
+
* 固定策略实现:clack 交互 + picocolors 着色。
|
|
20
|
+
* 消费方在 createCli 时注入本包导出的 provider,获得开箱即用的标准 CLI 体验。
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* picocolors 着色实现
|
|
24
|
+
*
|
|
25
|
+
* picocolors 未直接暴露 gray 别名,此处补齐以保证 ColorProvider 契约完整。
|
|
26
|
+
*/
|
|
27
|
+
declare const picocolorsColor: ColorProvider;
|
|
28
|
+
/**
|
|
29
|
+
* clack 交互实现
|
|
30
|
+
*
|
|
31
|
+
* 基于 @clack/prompts 的方向键交互范式。取消操作(Ctrl+C / Esc)时退出进程。
|
|
32
|
+
*/
|
|
33
|
+
declare const clackInteraction: InteractionProvider;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { clackInteraction, picocolorsColor };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-BqT_7tdF.js";import*as e from"@clack/prompts";import t from"picocolors";const n={red:e=>t.red(e),green:e=>t.green(e),yellow:e=>t.yellow(e),blue:e=>t.blue(e),bold:e=>t.bold(e),gray:e=>t.gray(e)},r={async select(t,n){let r=await e.select({message:t,options:n.map(e=>({value:e.value,label:e.label,hint:e.hint}))});return e.isCancel(r)&&(e.cancel(`操作已取消`),process.exit(0)),typeof r==`string`?r:String(r)},async textInput(t,n){let r=await e.text({message:t,placeholder:n?.placeholder,defaultValue:n?.defaultValue});return e.isCancel(r)&&(e.cancel(`操作已取消`),process.exit(0)),typeof r==`string`?r:String(r)},async confirm(t,n){let r=await e.confirm({message:t,initialValue:n?.defaultValue??!1});return e.isCancel(r)&&(e.cancel(`操作已取消`),process.exit(0)),typeof r==`boolean`?r:!!r},spinner(){let t=e.spinner();return{start(e){t.start(e)},stop(e){t.stop(e)}}},note(t,n){e.note(t,n)},log:{info(n){e.log.info(t.blue(n))},success(n){e.log.success(t.green(n))},warn(n){e.log.warn(t.yellow(n))},error(n){e.log.error(t.red(n))},step(t){e.log.step(t)}}};export{r as clackInteraction,n as picocolorsColor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"node:module";export{};
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@longzai-intelligence-cli/standard",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"private": false,
|
|
5
|
+
"keywords": [
|
|
6
|
+
"clack",
|
|
7
|
+
"cli",
|
|
8
|
+
"picocolors",
|
|
9
|
+
"preset"
|
|
10
|
+
],
|
|
11
|
+
"license": "UNLICENSED",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "lzi-builder",
|
|
26
|
+
"build:prod": "NODE_ENV=production lzi-builder",
|
|
27
|
+
"prepublishOnly": "bun run build:prod",
|
|
28
|
+
"typecheck": "bun run typecheck:app && bun run typecheck:node && bun run typecheck:test",
|
|
29
|
+
"typecheck:app": "tsgo --noEmit -p tsconfig/app.json",
|
|
30
|
+
"typecheck:node": "tsgo --noEmit -p tsconfig/node.json",
|
|
31
|
+
"typecheck:test": "tsgo --noEmit -p tsconfig/test.json",
|
|
32
|
+
"lint": "oxlint && oxfmt --check",
|
|
33
|
+
"lint:fix": "oxlint --fix && oxfmt",
|
|
34
|
+
"test": "bun test",
|
|
35
|
+
"test:watch": "bun test --watch",
|
|
36
|
+
"test:coverage": "bun test --coverage",
|
|
37
|
+
"clean": "lzi-dev-cli clean"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@clack/prompts": "^0.11.0",
|
|
41
|
+
"@longzai-intelligence-cli/core": "0.0.2",
|
|
42
|
+
"picocolors": "^1.1.1"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {}
|
|
45
|
+
}
|