@tikkhun/index-generator 0.1.0 → 0.1.3
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/cli/index.js
CHANGED
@@ -2,5 +2,5 @@
|
|
2
2
|
'use strict';var cliCore=require('@tikkhun/cli-core'),utilsCore=require('@tikkhun/utils-core'),fs=require('fs'),promises=require('fs/promises'),glob=require('glob'),o=require('path');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var o__default=/*#__PURE__*/_interopDefault(o);/**
|
3
3
|
@tikkhun/index-generator
|
4
4
|
*/
|
5
|
-
var O=Object.defineProperty,j=Object.defineProperties;var v=Object.getOwnPropertyDescriptors;var
|
6
|
-
`);console.log(r);let
|
5
|
+
var O=Object.defineProperty,j=Object.defineProperties;var v=Object.getOwnPropertyDescriptors;var b=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var y=(i,e,t)=>e in i?O(i,e,{enumerable:true,configurable:true,writable:true,value:t}):i[e]=t,x=(i,e)=>{for(var t in e||(e={}))I.call(e,t)&&y(i,t,e[t]);if(b)for(var t of b(e))G.call(e,t)&&y(i,t,e[t]);return i},u=(i,e)=>j(i,v(e));var d=(i,e,t)=>new Promise((g,r)=>{var a=n=>{try{c(t.next(n));}catch(p){r(p);}},s=n=>{try{c(t.throw(n));}catch(p){r(p);}},c=n=>n.done?g(n.value):Promise.resolve(n.value).then(a,s);c((t=t.apply(i,e)).next());});var l={name:"@tikkhun/index-generator",version:"0.1.2",description:"",bin:{"tikkhun-index-generator":"dist/cli/index.js"},main:"dist/lib/index.js",module:"dist/lib/index.mjs",types:"dist/lib/index.d.ts",exports:{".":{import:{types:"./dist/lib/index.d.mts",default:"./dist/lib/index.mjs"},require:{types:"./dist/lib/index.d.ts",default:"./dist/lib/index.js"}}},files:["dist"],scripts:{build:"tsup",dev:"tsx ./src/index.ts",test:"vitest"},publishConfig:{access:"public"},keywords:[],author:"",license:"ISC",dependencies:{"@tikkhun/cli-core":"workspace:^","@tikkhun/logger":"workspace:^","@tikkhun/utils-core":"workspace:^",glob:"^11.0.3"},devDependencies:{"@types/node":"^20.3.1",tsup:"^8.5.0",tsx:"^4.20.3",vitest:"^3.2.4"}};var m={cwd:".",indexName:"index.ts",include:["*"],exclude:[],clean:false,child:false,debug:false};function f(i){return d(this,null,function*(){try{let e=utilsCore.mergeOptions(m,i);e.debug&&console.log("opts",e);let t=o__default.default.resolve(e.cwd);if(e.child){let c=(yield glob.glob("**/*",{cwd:t,ignore:e.exclude})).filter(n=>fs.statSync(o__default.default.join(t,n)).isDirectory());for(let n of c)console.log("\u5BF9\u76EE\u5F55\u8FDB\u884Cindex\u751F\u6210",n),yield f(u(x({},e),{cwd:o__default.default.join(t,n),child:!1}));return}let r=(yield glob.glob(e.include,{cwd:t,ignore:e.exclude})).map(s=>`export * from "./${o__default.default.extname(s)?o__default.default.basename(s).split(o__default.default.extname(s))[0]:s}";`).join(`
|
6
|
+
`);console.log(r);let a=o__default.default.join(t,e.indexName);if(!(e!=null&&e.clean)&&(yield E(a))){console.error(`index\u6587\u4EF6\u5DF2\u5B58\u5728\uFF0C\u4E0D\u8FDB\u884C\u521B\u5EFA,\u6587\u4EF6\u540D\u4E3A${a}`);return}yield promises.writeFile(a,r,"utf-8");}catch(e){console.error("\u751F\u6210 index \u6587\u4EF6\u65F6\u51FA\u9519:",e);}})}function E(i){return d(this,null,function*(){try{return yield promises.access(i,promises.constants.F_OK),!0}catch(e){return false}})}var q=u(x({},m),{child:false});cliCore.echoPackage(l);var J={cwd:"\u8DEF\u5F84",indexName:"\u6587\u4EF6\u540D",include:"\u5305\u542B",exclude:"\u6392\u9664",clean:"\u6E05\u9664\u65E7\u7684",child:"\u5B50\u76EE\u5F55",debug:"\u8C03\u8BD5"},K={cwd:"string",indexName:"string",include:"array",exclude:"array",clean:"boolean",child:"boolean",debug:"boolean"},W={name:l.name,version:l.version,description:l.description,types:[cliCore.CommandTypes.args,cliCore.CommandTypes.prompts],defaultOptions:q,optionTitles:J,optionTypes:K,action:i=>d(null,null,function*(){f(i);})},k=new cliCore.Cli(W);k.start();
|
package/dist/cli/index.mjs
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
import {CommandTypes,Cli}from'@tikkhun/cli-core';import {mergeOptions}from'@tikkhun/utils-core';import {statSync}from'fs';import {writeFile,access,constants}from'fs/promises';import {glob}from'glob';import o from'path';/**
|
2
|
+
import {echoPackage,CommandTypes,Cli}from'@tikkhun/cli-core';import {mergeOptions}from'@tikkhun/utils-core';import {statSync}from'fs';import {writeFile,access,constants}from'fs/promises';import {glob}from'glob';import o from'path';/**
|
3
3
|
@tikkhun/index-generator
|
4
4
|
*/
|
5
|
-
var O=Object.defineProperty,j=Object.defineProperties;var v=Object.getOwnPropertyDescriptors;var
|
6
|
-
`);console.log(r);let
|
5
|
+
var O=Object.defineProperty,j=Object.defineProperties;var v=Object.getOwnPropertyDescriptors;var b=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var y=(i,e,t)=>e in i?O(i,e,{enumerable:true,configurable:true,writable:true,value:t}):i[e]=t,x=(i,e)=>{for(var t in e||(e={}))I.call(e,t)&&y(i,t,e[t]);if(b)for(var t of b(e))G.call(e,t)&&y(i,t,e[t]);return i},u=(i,e)=>j(i,v(e));var d=(i,e,t)=>new Promise((g,r)=>{var a=n=>{try{c(t.next(n));}catch(p){r(p);}},s=n=>{try{c(t.throw(n));}catch(p){r(p);}},c=n=>n.done?g(n.value):Promise.resolve(n.value).then(a,s);c((t=t.apply(i,e)).next());});var l={name:"@tikkhun/index-generator",version:"0.1.2",description:"",bin:{"tikkhun-index-generator":"dist/cli/index.js"},main:"dist/lib/index.js",module:"dist/lib/index.mjs",types:"dist/lib/index.d.ts",exports:{".":{import:{types:"./dist/lib/index.d.mts",default:"./dist/lib/index.mjs"},require:{types:"./dist/lib/index.d.ts",default:"./dist/lib/index.js"}}},files:["dist"],scripts:{build:"tsup",dev:"tsx ./src/index.ts",test:"vitest"},publishConfig:{access:"public"},keywords:[],author:"",license:"ISC",dependencies:{"@tikkhun/cli-core":"workspace:^","@tikkhun/logger":"workspace:^","@tikkhun/utils-core":"workspace:^",glob:"^11.0.3"},devDependencies:{"@types/node":"^20.3.1",tsup:"^8.5.0",tsx:"^4.20.3",vitest:"^3.2.4"}};var m={cwd:".",indexName:"index.ts",include:["*"],exclude:[],clean:false,child:false,debug:false};function f(i){return d(this,null,function*(){try{let e=mergeOptions(m,i);e.debug&&console.log("opts",e);let t=o.resolve(e.cwd);if(e.child){let c=(yield glob("**/*",{cwd:t,ignore:e.exclude})).filter(n=>statSync(o.join(t,n)).isDirectory());for(let n of c)console.log("\u5BF9\u76EE\u5F55\u8FDB\u884Cindex\u751F\u6210",n),yield f(u(x({},e),{cwd:o.join(t,n),child:!1}));return}let r=(yield glob(e.include,{cwd:t,ignore:e.exclude})).map(s=>`export * from "./${o.extname(s)?o.basename(s).split(o.extname(s))[0]:s}";`).join(`
|
6
|
+
`);console.log(r);let a=o.join(t,e.indexName);if(!(e!=null&&e.clean)&&(yield E(a))){console.error(`index\u6587\u4EF6\u5DF2\u5B58\u5728\uFF0C\u4E0D\u8FDB\u884C\u521B\u5EFA,\u6587\u4EF6\u540D\u4E3A${a}`);return}yield writeFile(a,r,"utf-8");}catch(e){console.error("\u751F\u6210 index \u6587\u4EF6\u65F6\u51FA\u9519:",e);}})}function E(i){return d(this,null,function*(){try{return yield access(i,constants.F_OK),!0}catch(e){return false}})}var q=u(x({},m),{child:false});echoPackage(l);var J={cwd:"\u8DEF\u5F84",indexName:"\u6587\u4EF6\u540D",include:"\u5305\u542B",exclude:"\u6392\u9664",clean:"\u6E05\u9664\u65E7\u7684",child:"\u5B50\u76EE\u5F55",debug:"\u8C03\u8BD5"},K={cwd:"string",indexName:"string",include:"array",exclude:"array",clean:"boolean",child:"boolean",debug:"boolean"},W={name:l.name,version:l.version,description:l.description,types:[CommandTypes.args,CommandTypes.prompts],defaultOptions:q,optionTitles:J,optionTypes:K,action:i=>d(null,null,function*(){f(i);})},k=new Cli(W);k.start();
|
package/dist/lib/cli/index.d.mts
CHANGED
@@ -17,6 +17,7 @@ declare const optionTitles: {
|
|
17
17
|
exclude: string;
|
18
18
|
clean: string;
|
19
19
|
child: string;
|
20
|
+
debug: string;
|
20
21
|
};
|
21
22
|
declare const optionTypes: {
|
22
23
|
cwd: string;
|
@@ -25,6 +26,7 @@ declare const optionTypes: {
|
|
25
26
|
exclude: string;
|
26
27
|
clean: string;
|
27
28
|
child: string;
|
29
|
+
debug: string;
|
28
30
|
};
|
29
31
|
declare const cliOptions: {
|
30
32
|
name: string;
|
@@ -47,6 +49,7 @@ declare const cliOptions: {
|
|
47
49
|
exclude: string;
|
48
50
|
clean: string;
|
49
51
|
child: string;
|
52
|
+
debug: string;
|
50
53
|
};
|
51
54
|
optionTypes: {
|
52
55
|
cwd: string;
|
@@ -55,6 +58,7 @@ declare const cliOptions: {
|
|
55
58
|
exclude: string;
|
56
59
|
clean: string;
|
57
60
|
child: string;
|
61
|
+
debug: string;
|
58
62
|
};
|
59
63
|
action: (options: any) => Promise<void>;
|
60
64
|
};
|
package/dist/lib/cli/index.d.ts
CHANGED
@@ -17,6 +17,7 @@ declare const optionTitles: {
|
|
17
17
|
exclude: string;
|
18
18
|
clean: string;
|
19
19
|
child: string;
|
20
|
+
debug: string;
|
20
21
|
};
|
21
22
|
declare const optionTypes: {
|
22
23
|
cwd: string;
|
@@ -25,6 +26,7 @@ declare const optionTypes: {
|
|
25
26
|
exclude: string;
|
26
27
|
clean: string;
|
27
28
|
child: string;
|
29
|
+
debug: string;
|
28
30
|
};
|
29
31
|
declare const cliOptions: {
|
30
32
|
name: string;
|
@@ -47,6 +49,7 @@ declare const cliOptions: {
|
|
47
49
|
exclude: string;
|
48
50
|
clean: string;
|
49
51
|
child: string;
|
52
|
+
debug: string;
|
50
53
|
};
|
51
54
|
optionTypes: {
|
52
55
|
cwd: string;
|
@@ -55,6 +58,7 @@ declare const cliOptions: {
|
|
55
58
|
exclude: string;
|
56
59
|
clean: string;
|
57
60
|
child: string;
|
61
|
+
debug: string;
|
58
62
|
};
|
59
63
|
action: (options: any) => Promise<void>;
|
60
64
|
};
|
package/dist/lib/cli/index.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
'use strict';var cliCore=require('@tikkhun/cli-core'),utilsCore=require('@tikkhun/utils-core'),fs=require('fs'),promises=require('fs/promises'),glob=require('glob'),o=require('path');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var o__default=/*#__PURE__*/_interopDefault(o);/**
|
2
2
|
@tikkhun/index-generator
|
3
3
|
*/
|
4
|
-
var k=Object.defineProperty,O=Object.defineProperties;var j=Object.getOwnPropertyDescriptors;var
|
5
|
-
`);console.log(r);let
|
4
|
+
var k=Object.defineProperty,O=Object.defineProperties;var j=Object.getOwnPropertyDescriptors;var b=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var y=(i,e,t)=>e in i?k(i,e,{enumerable:true,configurable:true,writable:true,value:t}):i[e]=t,x=(i,e)=>{for(var t in e||(e={}))I.call(e,t)&&y(i,t,e[t]);if(b)for(var t of b(e))v.call(e,t)&&y(i,t,e[t]);return i},u=(i,e)=>O(i,j(e));var d=(i,e,t)=>new Promise((g,r)=>{var a=n=>{try{c(t.next(n));}catch(p){r(p);}},s=n=>{try{c(t.throw(n));}catch(p){r(p);}},c=n=>n.done?g(n.value):Promise.resolve(n.value).then(a,s);c((t=t.apply(i,e)).next());});var l={name:"@tikkhun/index-generator",version:"0.1.2",description:"",bin:{"tikkhun-index-generator":"dist/cli/index.js"},main:"dist/lib/index.js",module:"dist/lib/index.mjs",types:"dist/lib/index.d.ts",exports:{".":{import:{types:"./dist/lib/index.d.mts",default:"./dist/lib/index.mjs"},require:{types:"./dist/lib/index.d.ts",default:"./dist/lib/index.js"}}},files:["dist"],scripts:{build:"tsup",dev:"tsx ./src/index.ts",test:"vitest"},publishConfig:{access:"public"},keywords:[],author:"",license:"ISC",dependencies:{"@tikkhun/cli-core":"workspace:^","@tikkhun/logger":"workspace:^","@tikkhun/utils-core":"workspace:^",glob:"^11.0.3"},devDependencies:{"@types/node":"^20.3.1",tsup:"^8.5.0",tsx:"^4.20.3",vitest:"^3.2.4"}};var m={cwd:".",indexName:"index.ts",include:["*"],exclude:[],clean:false,child:false,debug:false};function f(i){return d(this,null,function*(){try{let e=utilsCore.mergeOptions(m,i);e.debug&&console.log("opts",e);let t=o__default.default.resolve(e.cwd);if(e.child){let c=(yield glob.glob("**/*",{cwd:t,ignore:e.exclude})).filter(n=>fs.statSync(o__default.default.join(t,n)).isDirectory());for(let n of c)console.log("\u5BF9\u76EE\u5F55\u8FDB\u884Cindex\u751F\u6210",n),yield f(u(x({},e),{cwd:o__default.default.join(t,n),child:!1}));return}let r=(yield glob.glob(e.include,{cwd:t,ignore:e.exclude})).map(s=>`export * from "./${o__default.default.extname(s)?o__default.default.basename(s).split(o__default.default.extname(s))[0]:s}";`).join(`
|
5
|
+
`);console.log(r);let a=o__default.default.join(t,e.indexName);if(!(e!=null&&e.clean)&&(yield T(a))){console.error(`index\u6587\u4EF6\u5DF2\u5B58\u5728\uFF0C\u4E0D\u8FDB\u884C\u521B\u5EFA,\u6587\u4EF6\u540D\u4E3A${a}`);return}yield promises.writeFile(a,r,"utf-8");}catch(e){console.error("\u751F\u6210 index \u6587\u4EF6\u65F6\u51FA\u9519:",e);}})}function T(i){return d(this,null,function*(){try{return yield promises.access(i,promises.constants.F_OK),!0}catch(e){return false}})}var $=u(x({},m),{child:false});cliCore.echoPackage(l);var q={cwd:"\u8DEF\u5F84",indexName:"\u6587\u4EF6\u540D",include:"\u5305\u542B",exclude:"\u6392\u9664",clean:"\u6E05\u9664\u65E7\u7684",child:"\u5B50\u76EE\u5F55",debug:"\u8C03\u8BD5"},J={cwd:"string",indexName:"string",include:"array",exclude:"array",clean:"boolean",child:"boolean",debug:"boolean"},K={name:l.name,version:l.version,description:l.description,types:[cliCore.CommandTypes.args,cliCore.CommandTypes.prompts],defaultOptions:$,optionTitles:q,optionTypes:J,action:i=>d(null,null,function*(){f(i);})},X=new cliCore.Cli(K);exports.cli=X;exports.cliOptions=K;exports.defaultOptions=$;exports.optionTitles=q;exports.optionTypes=J;
|
package/dist/lib/cli/index.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import {CommandTypes,Cli}from'@tikkhun/cli-core';import {mergeOptions}from'@tikkhun/utils-core';import {statSync}from'fs';import {writeFile,access,constants}from'fs/promises';import {glob}from'glob';import o from'path';/**
|
1
|
+
import {echoPackage,CommandTypes,Cli}from'@tikkhun/cli-core';import {mergeOptions}from'@tikkhun/utils-core';import {statSync}from'fs';import {writeFile,access,constants}from'fs/promises';import {glob}from'glob';import o from'path';/**
|
2
2
|
@tikkhun/index-generator
|
3
3
|
*/
|
4
|
-
var k=Object.defineProperty,O=Object.defineProperties;var j=Object.getOwnPropertyDescriptors;var
|
5
|
-
`);console.log(r);let
|
4
|
+
var k=Object.defineProperty,O=Object.defineProperties;var j=Object.getOwnPropertyDescriptors;var b=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var y=(i,e,t)=>e in i?k(i,e,{enumerable:true,configurable:true,writable:true,value:t}):i[e]=t,x=(i,e)=>{for(var t in e||(e={}))I.call(e,t)&&y(i,t,e[t]);if(b)for(var t of b(e))v.call(e,t)&&y(i,t,e[t]);return i},u=(i,e)=>O(i,j(e));var d=(i,e,t)=>new Promise((g,r)=>{var a=n=>{try{c(t.next(n));}catch(p){r(p);}},s=n=>{try{c(t.throw(n));}catch(p){r(p);}},c=n=>n.done?g(n.value):Promise.resolve(n.value).then(a,s);c((t=t.apply(i,e)).next());});var l={name:"@tikkhun/index-generator",version:"0.1.2",description:"",bin:{"tikkhun-index-generator":"dist/cli/index.js"},main:"dist/lib/index.js",module:"dist/lib/index.mjs",types:"dist/lib/index.d.ts",exports:{".":{import:{types:"./dist/lib/index.d.mts",default:"./dist/lib/index.mjs"},require:{types:"./dist/lib/index.d.ts",default:"./dist/lib/index.js"}}},files:["dist"],scripts:{build:"tsup",dev:"tsx ./src/index.ts",test:"vitest"},publishConfig:{access:"public"},keywords:[],author:"",license:"ISC",dependencies:{"@tikkhun/cli-core":"workspace:^","@tikkhun/logger":"workspace:^","@tikkhun/utils-core":"workspace:^",glob:"^11.0.3"},devDependencies:{"@types/node":"^20.3.1",tsup:"^8.5.0",tsx:"^4.20.3",vitest:"^3.2.4"}};var m={cwd:".",indexName:"index.ts",include:["*"],exclude:[],clean:false,child:false,debug:false};function f(i){return d(this,null,function*(){try{let e=mergeOptions(m,i);e.debug&&console.log("opts",e);let t=o.resolve(e.cwd);if(e.child){let c=(yield glob("**/*",{cwd:t,ignore:e.exclude})).filter(n=>statSync(o.join(t,n)).isDirectory());for(let n of c)console.log("\u5BF9\u76EE\u5F55\u8FDB\u884Cindex\u751F\u6210",n),yield f(u(x({},e),{cwd:o.join(t,n),child:!1}));return}let r=(yield glob(e.include,{cwd:t,ignore:e.exclude})).map(s=>`export * from "./${o.extname(s)?o.basename(s).split(o.extname(s))[0]:s}";`).join(`
|
5
|
+
`);console.log(r);let a=o.join(t,e.indexName);if(!(e!=null&&e.clean)&&(yield T(a))){console.error(`index\u6587\u4EF6\u5DF2\u5B58\u5728\uFF0C\u4E0D\u8FDB\u884C\u521B\u5EFA,\u6587\u4EF6\u540D\u4E3A${a}`);return}yield writeFile(a,r,"utf-8");}catch(e){console.error("\u751F\u6210 index \u6587\u4EF6\u65F6\u51FA\u9519:",e);}})}function T(i){return d(this,null,function*(){try{return yield access(i,constants.F_OK),!0}catch(e){return false}})}var $=u(x({},m),{child:false});echoPackage(l);var q={cwd:"\u8DEF\u5F84",indexName:"\u6587\u4EF6\u540D",include:"\u5305\u542B",exclude:"\u6392\u9664",clean:"\u6E05\u9664\u65E7\u7684",child:"\u5B50\u76EE\u5F55",debug:"\u8C03\u8BD5"},J={cwd:"string",indexName:"string",include:"array",exclude:"array",clean:"boolean",child:"boolean",debug:"boolean"},K={name:l.name,version:l.version,description:l.description,types:[CommandTypes.args,CommandTypes.prompts],defaultOptions:$,optionTitles:q,optionTypes:J,action:i=>d(null,null,function*(){f(i);})},X=new Cli(K);export{X as cli,K as cliOptions,$ as defaultOptions,q as optionTitles,J as optionTypes};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tikkhun/index-generator",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.3",
|
4
4
|
"description": "",
|
5
5
|
"bin": {
|
6
6
|
"tikkhun-index-generator": "dist/cli/index.js"
|
@@ -31,7 +31,7 @@
|
|
31
31
|
"license": "ISC",
|
32
32
|
"dependencies": {
|
33
33
|
"glob": "^11.0.3",
|
34
|
-
"@tikkhun/cli-core": "^0.0.
|
34
|
+
"@tikkhun/cli-core": "^0.0.29",
|
35
35
|
"@tikkhun/logger": "^1.0.8",
|
36
36
|
"@tikkhun/utils-core": "^0.0.22"
|
37
37
|
},
|