@tikkhun/index-generator 0.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 +8 -0
- package/dist/cli/index.d.mts +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +6 -0
- package/dist/cli/index.mjs +6 -0
- package/dist/lib/cli/index.d.mts +31 -0
- package/dist/lib/cli/index.d.ts +31 -0
- package/dist/lib/cli/index.js +5 -0
- package/dist/lib/cli/index.mjs +5 -0
- package/dist/lib/index.d.mts +6 -0
- package/dist/lib/index.d.ts +6 -0
- package/dist/lib/index.js +5 -0
- package/dist/lib/index.mjs +5 -0
- package/package.json +49 -0
package/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
#!/usr/bin/env node
|
@@ -0,0 +1 @@
|
|
1
|
+
#!/usr/bin/env node
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
'use strict';var cliCore=require('@tikkhun/cli-core'),glob=require('glob'),g=require('fs/promises');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var g__default=/*#__PURE__*/_interopDefault(g);/**
|
3
|
+
index-generator
|
4
|
+
*/
|
5
|
+
var r=(e,s,t)=>new Promise((d,n)=>{var x=i=>{try{a(t.next(i));}catch(p){n(p);}},f=i=>{try{a(t.throw(i));}catch(p){n(p);}},a=i=>i.done?d(i.value):Promise.resolve(i.value).then(x,f);a((t=t.apply(e,s)).next());});var o={name:"index-generator",version:"0.0.1",description:""};function c(e,s){return r(this,null,function*(){try{let d=(yield glob.glob(e)).map(n=>`export * from "${n}";`).join(`
|
6
|
+
`);yield g__default.default.writeFile((s==null?void 0:s.indexName)||"index.ts",d,"utf-8");}catch(t){console.error("\u751F\u6210 index \u6587\u4EF6\u65F6\u51FA\u9519:",t);}})}var y={workspace:"."},w={workspace:"\u8DEF\u5F84"},v={workspace:"string"},h={name:o.name,version:o.version,description:o.description,types:[cliCore.CommandTypes.args,cliCore.CommandTypes.prompts],defaultOptions:y,optionTitles:w,optionTypes:v,action:e=>r(null,null,function*(){c(e==null?void 0:e.workspace);})},m=new cliCore.Cli(h);m.start();
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
import {CommandTypes,Cli}from'@tikkhun/cli-core';import {glob}from'glob';import g from'fs/promises';/**
|
3
|
+
index-generator
|
4
|
+
*/
|
5
|
+
var r=(e,s,t)=>new Promise((d,n)=>{var x=i=>{try{a(t.next(i));}catch(p){n(p);}},f=i=>{try{a(t.throw(i));}catch(p){n(p);}},a=i=>i.done?d(i.value):Promise.resolve(i.value).then(x,f);a((t=t.apply(e,s)).next());});var o={name:"index-generator",version:"0.0.1",description:""};function c(e,s){return r(this,null,function*(){try{let d=(yield glob(e)).map(n=>`export * from "${n}";`).join(`
|
6
|
+
`);yield g.writeFile((s==null?void 0:s.indexName)||"index.ts",d,"utf-8");}catch(t){console.error("\u751F\u6210 index \u6587\u4EF6\u65F6\u51FA\u9519:",t);}})}var y={workspace:"."},w={workspace:"\u8DEF\u5F84"},v={workspace:"string"},h={name:o.name,version:o.version,description:o.description,types:[CommandTypes.args,CommandTypes.prompts],defaultOptions:y,optionTitles:w,optionTypes:v,action:e=>r(null,null,function*(){c(e==null?void 0:e.workspace);})},m=new Cli(h);m.start();
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import * as _tikkhun_cli_core from '@tikkhun/cli-core';
|
2
|
+
import { CommandTypes } from '@tikkhun/cli-core';
|
3
|
+
|
4
|
+
declare const defaultOptions: {
|
5
|
+
workspace: string;
|
6
|
+
};
|
7
|
+
declare const optionTitles: {
|
8
|
+
workspace: string;
|
9
|
+
};
|
10
|
+
declare const optionTypes: {
|
11
|
+
workspace: string;
|
12
|
+
};
|
13
|
+
declare const cliOptions: {
|
14
|
+
name: string;
|
15
|
+
version: string;
|
16
|
+
description: string;
|
17
|
+
types: CommandTypes[];
|
18
|
+
defaultOptions: {
|
19
|
+
workspace: string;
|
20
|
+
};
|
21
|
+
optionTitles: {
|
22
|
+
workspace: string;
|
23
|
+
};
|
24
|
+
optionTypes: {
|
25
|
+
workspace: string;
|
26
|
+
};
|
27
|
+
action: (options: any) => Promise<void>;
|
28
|
+
};
|
29
|
+
declare const cli: _tikkhun_cli_core.CommandManager;
|
30
|
+
|
31
|
+
export { cli, cliOptions, defaultOptions, optionTitles, optionTypes };
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import * as _tikkhun_cli_core from '@tikkhun/cli-core';
|
2
|
+
import { CommandTypes } from '@tikkhun/cli-core';
|
3
|
+
|
4
|
+
declare const defaultOptions: {
|
5
|
+
workspace: string;
|
6
|
+
};
|
7
|
+
declare const optionTitles: {
|
8
|
+
workspace: string;
|
9
|
+
};
|
10
|
+
declare const optionTypes: {
|
11
|
+
workspace: string;
|
12
|
+
};
|
13
|
+
declare const cliOptions: {
|
14
|
+
name: string;
|
15
|
+
version: string;
|
16
|
+
description: string;
|
17
|
+
types: CommandTypes[];
|
18
|
+
defaultOptions: {
|
19
|
+
workspace: string;
|
20
|
+
};
|
21
|
+
optionTitles: {
|
22
|
+
workspace: string;
|
23
|
+
};
|
24
|
+
optionTypes: {
|
25
|
+
workspace: string;
|
26
|
+
};
|
27
|
+
action: (options: any) => Promise<void>;
|
28
|
+
};
|
29
|
+
declare const cli: _tikkhun_cli_core.CommandManager;
|
30
|
+
|
31
|
+
export { cli, cliOptions, defaultOptions, optionTitles, optionTypes };
|
@@ -0,0 +1,5 @@
|
|
1
|
+
'use strict';var cliCore=require('@tikkhun/cli-core'),glob=require('glob'),b=require('fs/promises');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var b__default=/*#__PURE__*/_interopDefault(b);/**
|
2
|
+
index-generator
|
3
|
+
*/
|
4
|
+
var r=(e,s,t)=>new Promise((d,n)=>{var m=i=>{try{a(t.next(i));}catch(p){n(p);}},x=i=>{try{a(t.throw(i));}catch(p){n(p);}},a=i=>i.done?d(i.value):Promise.resolve(i.value).then(m,x);a((t=t.apply(e,s)).next());});var o={name:"index-generator",version:"0.0.1",description:""};function c(e,s){return r(this,null,function*(){try{let d=(yield glob.glob(e)).map(n=>`export * from "${n}";`).join(`
|
5
|
+
`);yield b__default.default.writeFile((s==null?void 0:s.indexName)||"index.ts",d,"utf-8");}catch(t){console.error("\u751F\u6210 index \u6587\u4EF6\u65F6\u51FA\u9519:",t);}})}var k={workspace:"."},y={workspace:"\u8DEF\u5F84"},w={workspace:"string"},v={name:o.name,version:o.version,description:o.description,types:[cliCore.CommandTypes.args,cliCore.CommandTypes.prompts],defaultOptions:k,optionTitles:y,optionTypes:w,action:e=>r(null,null,function*(){c(e==null?void 0:e.workspace);})},q=new cliCore.Cli(v);exports.cli=q;exports.cliOptions=v;exports.defaultOptions=k;exports.optionTitles=y;exports.optionTypes=w;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import {CommandTypes,Cli}from'@tikkhun/cli-core';import {glob}from'glob';import b from'fs/promises';/**
|
2
|
+
index-generator
|
3
|
+
*/
|
4
|
+
var r=(e,s,t)=>new Promise((d,n)=>{var m=i=>{try{a(t.next(i));}catch(p){n(p);}},x=i=>{try{a(t.throw(i));}catch(p){n(p);}},a=i=>i.done?d(i.value):Promise.resolve(i.value).then(m,x);a((t=t.apply(e,s)).next());});var o={name:"index-generator",version:"0.0.1",description:""};function c(e,s){return r(this,null,function*(){try{let d=(yield glob(e)).map(n=>`export * from "${n}";`).join(`
|
5
|
+
`);yield b.writeFile((s==null?void 0:s.indexName)||"index.ts",d,"utf-8");}catch(t){console.error("\u751F\u6210 index \u6587\u4EF6\u65F6\u51FA\u9519:",t);}})}var k={workspace:"."},y={workspace:"\u8DEF\u5F84"},w={workspace:"string"},v={name:o.name,version:o.version,description:o.description,types:[CommandTypes.args,CommandTypes.prompts],defaultOptions:k,optionTitles:y,optionTypes:w,action:e=>r(null,null,function*(){c(e==null?void 0:e.workspace);})},q=new Cli(v);export{q as cli,v as cliOptions,k as defaultOptions,y as optionTitles,w as optionTypes};
|
@@ -0,0 +1,5 @@
|
|
1
|
+
'use strict';var glob=require('glob'),d=require('fs/promises');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var d__default=/*#__PURE__*/_interopDefault(d);/**
|
2
|
+
index-generator
|
3
|
+
*/
|
4
|
+
var f=(a,t,e)=>new Promise((i,n)=>{var m=r=>{try{o(e.next(r));}catch(x){n(x);}},s=r=>{try{o(e.throw(r));}catch(x){n(x);}},o=r=>r.done?i(r.value):Promise.resolve(r.value).then(m,s);o((e=e.apply(a,t)).next());});function w(a,t){return f(this,null,function*(){try{let i=(yield glob.glob(a)).map(n=>`export * from "${n}";`).join(`
|
5
|
+
`);yield d__default.default.writeFile((t==null?void 0:t.indexName)||"index.ts",i,"utf-8");}catch(e){console.error("\u751F\u6210 index \u6587\u4EF6\u65F6\u51FA\u9519:",e);}})}exports.generateIndex=w;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import {glob}from'glob';import d from'fs/promises';/**
|
2
|
+
index-generator
|
3
|
+
*/
|
4
|
+
var f=(a,t,e)=>new Promise((i,n)=>{var m=r=>{try{o(e.next(r));}catch(x){n(x);}},s=r=>{try{o(e.throw(r));}catch(x){n(x);}},o=r=>r.done?i(r.value):Promise.resolve(r.value).then(m,s);o((e=e.apply(a,t)).next());});function w(a,t){return f(this,null,function*(){try{let i=(yield glob(a)).map(n=>`export * from "${n}";`).join(`
|
5
|
+
`);yield d.writeFile((t==null?void 0:t.indexName)||"index.ts",i,"utf-8");}catch(e){console.error("\u751F\u6210 index \u6587\u4EF6\u65F6\u51FA\u9519:",e);}})}export{w as generateIndex};
|
package/package.json
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
{
|
2
|
+
"name": "@tikkhun/index-generator",
|
3
|
+
"version": "0.0.1",
|
4
|
+
"description": "",
|
5
|
+
"bin": {
|
6
|
+
"tikkhun-index-generator": "dist/cli/cli.js"
|
7
|
+
},
|
8
|
+
"main": "dist/lib/index.js",
|
9
|
+
"module": "dist/lib/index.mjs",
|
10
|
+
"types": "dist/lib/index.d.ts",
|
11
|
+
"exports": {
|
12
|
+
".": {
|
13
|
+
"import": {
|
14
|
+
"types": "./dist/lib/index.d.mts",
|
15
|
+
"default": "./dist/lib/index.mjs"
|
16
|
+
},
|
17
|
+
"require": {
|
18
|
+
"types": "./dist/lib/index.d.ts",
|
19
|
+
"default": "./dist/lib/index.js"
|
20
|
+
}
|
21
|
+
}
|
22
|
+
},
|
23
|
+
"files": [
|
24
|
+
"dist"
|
25
|
+
],
|
26
|
+
"publishConfig": {
|
27
|
+
"access": "public"
|
28
|
+
},
|
29
|
+
"keywords": [],
|
30
|
+
"author": "",
|
31
|
+
"license": "ISC",
|
32
|
+
"dependencies": {
|
33
|
+
"@tikkhun/cli-core": "latest",
|
34
|
+
"@tikkhun/logger": "latest",
|
35
|
+
"commander": "^12.1.0",
|
36
|
+
"glob": "^11.0.2"
|
37
|
+
},
|
38
|
+
"devDependencies": {
|
39
|
+
"@types/node": "^20.3.1",
|
40
|
+
"tsup": "^8.3.0",
|
41
|
+
"tsx": "^4.19.1",
|
42
|
+
"vitest": "^2.1.3"
|
43
|
+
},
|
44
|
+
"scripts": {
|
45
|
+
"build": "tsup",
|
46
|
+
"dev": "tsx ./src/index.ts",
|
47
|
+
"test": "vitest"
|
48
|
+
}
|
49
|
+
}
|