jiek 0.2.0 → 0.2.1-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/commands/init.esm.js +271 -0
- package/dist/commands/init.esm.js.map +1 -0
- package/dist/commands/init.esm.min.js +2 -0
- package/dist/commands/init.esm.min.js.map +1 -0
- package/dist/index.esm.js +3 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +426 -63
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.umd.js +428 -65
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/merge-package-json.esm.js +2 -0
- package/dist/merge-package-json.esm.js.map +1 -1
- package/dist/merge-package-json.esm.min.js +1 -1
- package/dist/merge-package-json.esm.min.js.map +1 -1
- package/dist/utils/filterSupport.esm.js +4 -15
- package/dist/utils/filterSupport.esm.js.map +1 -1
- package/dist/utils/filterSupport.esm.min.js +1 -1
- package/dist/utils/filterSupport.esm.min.js.map +1 -1
- package/dist/utils/getRoot.esm.js +14 -0
- package/dist/utils/getRoot.esm.js.map +1 -0
- package/dist/utils/getRoot.esm.min.js +2 -0
- package/dist/utils/getRoot.esm.min.js.map +1 -0
- package/dist/utils/getWD.esm.js +25 -0
- package/dist/utils/getWD.esm.js.map +1 -0
- package/dist/utils/getWD.esm.min.js +2 -0
- package/dist/utils/getWD.esm.min.js.map +1 -0
- package/dist/utils/loadConfig.esm.js +91 -0
- package/dist/utils/loadConfig.esm.js.map +1 -0
- package/dist/utils/loadConfig.esm.min.js +2 -0
- package/dist/utils/loadConfig.esm.min.js.map +1 -0
- package/package.json +7 -6
@@ -0,0 +1,25 @@
|
|
1
|
+
import { getWorkspaceDir } from '@jiek/utils/getWorkspaceDir';
|
2
|
+
import { type } from './filterSupport.esm.js';
|
3
|
+
import { getRoot } from './getRoot.esm.js';
|
4
|
+
|
5
|
+
let wd;
|
6
|
+
let notWorkspace = false;
|
7
|
+
function getWD() {
|
8
|
+
if (wd)
|
9
|
+
return { wd, notWorkspace };
|
10
|
+
const root = getRoot();
|
11
|
+
try {
|
12
|
+
wd = getWorkspaceDir(root, type);
|
13
|
+
} catch (e) {
|
14
|
+
if ("message" in e && e.message === "workspace root not found") {
|
15
|
+
wd = root;
|
16
|
+
notWorkspace = true;
|
17
|
+
} else {
|
18
|
+
throw e;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
return { wd, notWorkspace };
|
22
|
+
}
|
23
|
+
|
24
|
+
export { getWD };
|
25
|
+
//# sourceMappingURL=getWD.esm.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getWD.esm.js","sources":["../../src/utils/getWD.ts"],"sourcesContent":["import { getWorkspaceDir } from '@jiek/utils/getWorkspaceDir'\n\nimport { type } from './filterSupport'\nimport { getRoot } from './getRoot'\n\nlet wd: string\nlet notWorkspace = false\n\nexport function getWD() {\n if (wd) return { wd, notWorkspace }\n\n const root = getRoot()\n try {\n wd = getWorkspaceDir(root, type)\n } catch (e) {\n // @ts-ignore\n if ('message' in e && e.message === 'workspace root not found') {\n wd = root\n notWorkspace = true\n } else {\n throw e\n }\n }\n return { wd, notWorkspace }\n}\n"],"names":[],"mappings":";;;;AAKA,IAAI,EAAA,CAAA;AACJ,IAAI,YAAe,GAAA,KAAA,CAAA;AAEZ,SAAS,KAAQ,GAAA;AACtB,EAAI,IAAA,EAAA;AAAI,IAAO,OAAA,EAAE,IAAI,YAAa,EAAA,CAAA;AAElC,EAAA,MAAM,OAAO,OAAQ,EAAA,CAAA;AACrB,EAAI,IAAA;AACF,IAAK,EAAA,GAAA,eAAA,CAAgB,MAAM,IAAI,CAAA,CAAA;AAAA,WACxB,CAAG,EAAA;AAEV,IAAA,IAAI,SAAa,IAAA,CAAA,IAAK,CAAE,CAAA,OAAA,KAAY,0BAA4B,EAAA;AAC9D,MAAK,EAAA,GAAA,IAAA,CAAA;AACL,MAAe,YAAA,GAAA,IAAA,CAAA;AAAA,KACV,MAAA;AACL,MAAM,MAAA,CAAA,CAAA;AAAA,KACR;AAAA,GACF;AACA,EAAO,OAAA,EAAE,IAAI,YAAa,EAAA,CAAA;AAC5B;;;;"}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{getWorkspaceDir as o}from"@jiek/utils/getWorkspaceDir";import{type as t}from"./filterSupport.esm.min.js";import{getRoot as r}from"./getRoot.esm.min.js";let e,s=!1;function i(){if(e)return{wd:e,notWorkspace:s};const i=r();try{e=o(i,t)}catch(o){if(!("message"in o)||"workspace root not found"!==o.message)throw o;e=i,s=!0}return{wd:e,notWorkspace:s}}export{i as getWD};
|
2
|
+
//# sourceMappingURL=getWD.esm.min.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getWD.esm.min.js","sources":["../../src/utils/getWD.ts"],"sourcesContent":["import { getWorkspaceDir } from '@jiek/utils/getWorkspaceDir'\n\nimport { type } from './filterSupport'\nimport { getRoot } from './getRoot'\n\nlet wd: string\nlet notWorkspace = false\n\nexport function getWD() {\n if (wd) return { wd, notWorkspace }\n\n const root = getRoot()\n try {\n wd = getWorkspaceDir(root, type)\n } catch (e) {\n // @ts-ignore\n if ('message' in e && e.message === 'workspace root not found') {\n wd = root\n notWorkspace = true\n } else {\n throw e\n }\n }\n return { wd, notWorkspace }\n}\n"],"names":["wd","notWorkspace","getWD","root","getRoot","getWorkspaceDir","type","e","message"],"mappings":"+JAKA,IAAIA,EACAC,GAAe,EAEZ,SAASC,IACV,GAAAF,EAAW,MAAA,CAAEA,KAAIC,gBAErB,MAAME,EAAOC,IACT,IACGJ,EAAAK,EAAgBF,EAAMG,SACpBC,GAEP,KAAI,YAAaA,IAAmB,6BAAdA,EAAEC,QAIhB,MAAAD,EAHDP,EAAAG,EACUF,GAAA,CAInB,CACO,MAAA,CAAED,KAAIC,eACf"}
|
@@ -0,0 +1,91 @@
|
|
1
|
+
import fs from 'node:fs';
|
2
|
+
import path from 'node:path';
|
3
|
+
import { program } from 'commander';
|
4
|
+
import { load } from 'js-yaml';
|
5
|
+
import { getWD } from './getWD.esm.js';
|
6
|
+
|
7
|
+
function packageIsExist(name) {
|
8
|
+
try {
|
9
|
+
require.resolve(name);
|
10
|
+
return true;
|
11
|
+
} catch (e) {
|
12
|
+
console.log(e);
|
13
|
+
return false;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
let tsRegisterName;
|
17
|
+
const registers = [
|
18
|
+
process.env.JIEK_TS_REGISTER,
|
19
|
+
"esbuild-register"
|
20
|
+
].filter(Boolean);
|
21
|
+
for (const register of registers) {
|
22
|
+
if (packageIsExist(register)) {
|
23
|
+
tsRegisterName = register;
|
24
|
+
break;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
let configName = "jiek.config";
|
28
|
+
function getConfigPath(root) {
|
29
|
+
const isSupportTsLoader = !!tsRegisterName;
|
30
|
+
function configWithExtIsExist(ext) {
|
31
|
+
const filenames = [
|
32
|
+
path.resolve(root, `${configName}.${ext}`),
|
33
|
+
path.resolve(root, `.${configName}.${ext}`)
|
34
|
+
];
|
35
|
+
for (const filename of filenames) {
|
36
|
+
if (fs.existsSync(filename) && fs.lstatSync(filename).isFile()) {
|
37
|
+
return filename;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
return;
|
41
|
+
}
|
42
|
+
configName = configWithExtIsExist("js") ?? configName;
|
43
|
+
configName = configWithExtIsExist("json") ?? configName;
|
44
|
+
configName = configWithExtIsExist("yaml") ?? configName;
|
45
|
+
if (isSupportTsLoader) {
|
46
|
+
configName = configWithExtIsExist("ts") ?? configName;
|
47
|
+
}
|
48
|
+
return path.resolve(root, configName);
|
49
|
+
}
|
50
|
+
function loadConfig() {
|
51
|
+
const { wd: root, notWorkspace } = getWD();
|
52
|
+
if (notWorkspace)
|
53
|
+
throw new Error("not in workspace");
|
54
|
+
let configPath = program.getOptionValue("configPath");
|
55
|
+
if (!configPath) {
|
56
|
+
configPath = getConfigPath(root);
|
57
|
+
} else {
|
58
|
+
if (!fs.existsSync(configPath))
|
59
|
+
throw new Error(`config file not found: ${configPath}`);
|
60
|
+
if (!path.isAbsolute(configPath))
|
61
|
+
configPath = path.resolve(root, configPath);
|
62
|
+
}
|
63
|
+
const ext = path.extname(configPath);
|
64
|
+
let module;
|
65
|
+
switch (ext) {
|
66
|
+
case ".js":
|
67
|
+
module = require(configPath);
|
68
|
+
break;
|
69
|
+
case ".json":
|
70
|
+
return require(configPath);
|
71
|
+
case ".yaml":
|
72
|
+
return load(fs.readFileSync(configPath, "utf-8"));
|
73
|
+
case ".ts":
|
74
|
+
if (tsRegisterName) {
|
75
|
+
require(tsRegisterName);
|
76
|
+
module = require(configPath);
|
77
|
+
break;
|
78
|
+
}
|
79
|
+
throw new Error(
|
80
|
+
"ts config file is not supported without ts register, please install esbuild-register or set JIEK_TS_REGISTER env for custom ts register"
|
81
|
+
);
|
82
|
+
default:
|
83
|
+
throw new Error(`unsupported config file type: ${ext}`);
|
84
|
+
}
|
85
|
+
if (!module)
|
86
|
+
throw new Error("config file is empty");
|
87
|
+
return module.default ?? module;
|
88
|
+
}
|
89
|
+
|
90
|
+
export { loadConfig };
|
91
|
+
//# sourceMappingURL=loadConfig.esm.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"loadConfig.esm.js","sources":["../../src/utils/loadConfig.ts"],"sourcesContent":["import fs from 'node:fs'\nimport path from 'node:path'\n\nimport { program } from 'commander'\nimport { load } from 'js-yaml'\n\nimport { getWD } from './getWD'\n\nfunction packageIsExist(name: string) {\n try {\n require.resolve(name)\n return true\n } catch (e) {\n console.log(e)\n return false\n }\n}\n\nlet tsRegisterName: string | undefined\nconst registers = [\n process.env.JIEK_TS_REGISTER,\n 'esbuild-register'\n].filter(Boolean) as string[]\nfor (const register of registers) {\n if (packageIsExist(register)) {\n tsRegisterName = register\n break\n }\n}\n\nlet configName = 'jiek.config'\n\nfunction getConfigPath(root: string) {\n const isSupportTsLoader = !!tsRegisterName\n function configWithExtIsExist(ext: string) {\n const filenames = [\n path.resolve(root, `${configName}.${ext}`),\n path.resolve(root, `.${configName}.${ext}`)\n ]\n for (const filename of filenames) {\n if (\n fs.existsSync(filename) &&\n fs.lstatSync(filename)\n .isFile()\n ) {\n return filename\n }\n }\n return\n }\n configName = configWithExtIsExist('js') ?? configName\n configName = configWithExtIsExist('json') ?? configName\n configName = configWithExtIsExist('yaml') ?? configName\n if (isSupportTsLoader) {\n configName = configWithExtIsExist('ts') ?? configName\n }\n return path.resolve(root, configName)\n}\n\nexport function loadConfig() {\n const { wd: root, notWorkspace } = getWD()\n if (notWorkspace)\n throw new Error('not in workspace')\n\n let configPath = program.getOptionValue('configPath')\n\n if (!configPath) {\n configPath = getConfigPath(root)\n } else {\n if (!fs.existsSync(configPath))\n throw new Error(`config file not found: ${configPath}`)\n if (!path.isAbsolute(configPath))\n configPath = path.resolve(root, configPath)\n }\n const ext = path.extname(configPath)\n\n let module: any\n switch (ext) {\n case '.js':\n module = require(configPath)\n break\n case '.json':\n return require(configPath)\n case '.yaml':\n return load(fs.readFileSync(configPath, 'utf-8'))\n case '.ts':\n if (tsRegisterName) {\n require(tsRegisterName)\n module = require(configPath)\n break\n }\n throw new Error(\n 'ts config file is not supported without ts register, ' +\n 'please install esbuild-register or set JIEK_TS_REGISTER env for custom ts register'\n )\n default:\n throw new Error(`unsupported config file type: ${ext}`)\n }\n if (!module) throw new Error('config file is empty')\n\n return module.default ?? module\n}\n"],"names":[],"mappings":";;;;;;AAQA,SAAS,eAAe,IAAc,EAAA;AACpC,EAAI,IAAA;AACF,IAAA,OAAA,CAAQ,QAAQ,IAAI,CAAA,CAAA;AACpB,IAAO,OAAA,IAAA,CAAA;AAAA,WACA,CAAG,EAAA;AACV,IAAA,OAAA,CAAQ,IAAI,CAAC,CAAA,CAAA;AACb,IAAO,OAAA,KAAA,CAAA;AAAA,GACT;AACF,CAAA;AAEA,IAAI,cAAA,CAAA;AACJ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,CAAA,CAAA;AACtB,QAAA,MAAA,GAAS,QAAQ,UAAU,CAAA,CAAA;AAC3B,QAAA,MAAA;AAAA,OACF;AACA,MAAA,MAAM,IAAI,KAAA;AAAA,QACR,yIAAA;AAAA,OAEF,CAAA;AAAA,IACF;AACE,MAAA,MAAM,IAAI,KAAA,CAAM,CAAiC,8BAAA,EAAA,GAAG,CAAE,CAAA,CAAA,CAAA;AAAA,GAC1D;AACA,EAAA,IAAI,CAAC,MAAA;AAAQ,IAAM,MAAA,IAAI,MAAM,sBAAsB,CAAA,CAAA;AAEnD,EAAA,OAAO,OAAO,OAAW,IAAA,MAAA,CAAA;AAC3B;;;;"}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import e from"node:fs";import r from"node:path";import{program as o}from"commander";import{load as t}from"js-yaml";import{getWD as s}from"./getWD.esm.min.js";function n(e){try{return require.resolve(e),!0}catch(e){return console.log(e),!1}}let i;const f=[process.env.JIEK_TS_REGISTER,"esbuild-register"].filter(Boolean);for(const e of f)if(n(e)){i=e;break}let c="jiek.config";function l(){const{wd:n,notWorkspace:f}=s();if(f)throw new Error("not in workspace");let l=o.getOptionValue("configPath");if(l){if(!e.existsSync(l))throw new Error(`config file not found: ${l}`);r.isAbsolute(l)||(l=r.resolve(n,l))}else l=function(o){const t=!!i;function s(t){const s=[r.resolve(o,`${c}.${t}`),r.resolve(o,`.${c}.${t}`)];for(const r of s)if(e.existsSync(r)&&e.lstatSync(r).isFile())return r}return c=s("js")??c,c=s("json")??c,c=s("yaml")??c,t&&(c=s("ts")??c),r.resolve(o,c)}(n);const u=r.extname(l);let a;switch(u){case".js":a=require(l);break;case".json":return require(l);case".yaml":return t(e.readFileSync(l,"utf-8"));case".ts":if(i){require(i),a=require(l);break}throw new Error("ts config file is not supported without ts register, please install esbuild-register or set JIEK_TS_REGISTER env for custom ts register");default:throw new Error(`unsupported config file type: ${u}`)}if(!a)throw new Error("config file is empty");return a.default??a}export{l as loadConfig};
|
2
|
+
//# sourceMappingURL=loadConfig.esm.min.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"loadConfig.esm.min.js","sources":["../../src/utils/loadConfig.ts"],"sourcesContent":["import fs from 'node:fs'\nimport path from 'node:path'\n\nimport { program } from 'commander'\nimport { load } from 'js-yaml'\n\nimport { getWD } from './getWD'\n\nfunction packageIsExist(name: string) {\n try {\n require.resolve(name)\n return true\n } catch (e) {\n console.log(e)\n return false\n }\n}\n\nlet tsRegisterName: string | undefined\nconst registers = [\n process.env.JIEK_TS_REGISTER,\n 'esbuild-register'\n].filter(Boolean) as string[]\nfor (const register of registers) {\n if (packageIsExist(register)) {\n tsRegisterName = register\n break\n }\n}\n\nlet configName = 'jiek.config'\n\nfunction getConfigPath(root: string) {\n const isSupportTsLoader = !!tsRegisterName\n function configWithExtIsExist(ext: string) {\n const filenames = [\n path.resolve(root, `${configName}.${ext}`),\n path.resolve(root, `.${configName}.${ext}`)\n ]\n for (const filename of filenames) {\n if (\n fs.existsSync(filename) &&\n fs.lstatSync(filename)\n .isFile()\n ) {\n return filename\n }\n }\n return\n }\n configName = configWithExtIsExist('js') ?? configName\n configName = configWithExtIsExist('json') ?? configName\n configName = configWithExtIsExist('yaml') ?? configName\n if (isSupportTsLoader) {\n configName = configWithExtIsExist('ts') ?? configName\n }\n return path.resolve(root, configName)\n}\n\nexport function loadConfig() {\n const { wd: root, notWorkspace } = getWD()\n if (notWorkspace)\n throw new Error('not in workspace')\n\n let configPath = program.getOptionValue('configPath')\n\n if (!configPath) {\n configPath = getConfigPath(root)\n } else {\n if (!fs.existsSync(configPath))\n throw new Error(`config file not found: ${configPath}`)\n if (!path.isAbsolute(configPath))\n configPath = path.resolve(root, configPath)\n }\n const ext = path.extname(configPath)\n\n let module: any\n switch (ext) {\n case '.js':\n module = require(configPath)\n break\n case '.json':\n return require(configPath)\n case '.yaml':\n return load(fs.readFileSync(configPath, 'utf-8'))\n case '.ts':\n if (tsRegisterName) {\n require(tsRegisterName)\n module = require(configPath)\n break\n }\n throw new Error(\n 'ts config file is not supported without ts register, ' +\n 'please install esbuild-register or set JIEK_TS_REGISTER env for custom ts register'\n )\n default:\n throw new Error(`unsupported config file type: ${ext}`)\n }\n if (!module) throw new Error('config file is empty')\n\n return module.default ?? module\n}\n"],"names":["packageIsExist","name","require","resolve","e","console","log","tsRegisterName","registers","process","env","JIEK_TS_REGISTER","filter","Boolean","register","configName","loadConfig","wd","root","notWorkspace","getWD","Error","configPath","program","getOptionValue","fs","existsSync","path","isAbsolute","isSupportTsLoader","configWithExtIsExist","ext","filenames","filename","lstatSync","isFile","getConfigPath","extname","module","load","readFileSync","default"],"mappings":"8JAQA,SAASA,EAAeC,GAClB,IAEK,OADPC,QAAQC,QAAQF,IACT,QACAG,GAEA,OADPC,QAAQC,IAAIF,IACL,CACT,CACF,CAEA,IAAIG,EACJ,MAAMC,EAAY,CAChBC,QAAQC,IAAIC,iBACZ,oBACAC,OAAOC,SACT,IAAA,MAAWC,KAAYN,EACjB,GAAAR,EAAec,GAAW,CACXP,EAAAO,EACjB,KACF,CAGF,IAAIC,EAAa,cA6BV,SAASC,IACd,MAAQC,GAAIC,EAAMC,aAAAA,GAAiBC,IAC/B,GAAAD,EACI,MAAA,IAAIE,MAAM,oBAEd,IAAAC,EAAaC,EAAQC,eAAe,cAExC,GAAKF,EAEE,CACD,IAACG,EAAGC,WAAWJ,GACjB,MAAM,IAAID,MAAM,0BAA0BC,KACvCK,EAAKC,WAAWN,KACNA,EAAAK,EAAKxB,QAAQe,EAAMI,GACpC,MANEA,EAnCJ,SAAuBJ,GACf,MAAAW,IAAsBtB,EAC5B,SAASuB,EAAqBC,GAC5B,MAAMC,EAAY,CAChBL,EAAKxB,QAAQe,EAAM,GAAGH,KAAcgB,KACpCJ,EAAKxB,QAAQe,EAAM,IAAIH,KAAcgB,MAEvC,IAAA,MAAWE,KAAYD,EAEnB,GAAAP,EAAGC,WAAWO,IACdR,EAAGS,UAAUD,GACVE,SAEI,OAAAF,CAIb,CAOO,OANMlB,EAAAe,EAAqB,OAASf,EAC9BA,EAAAe,EAAqB,SAAWf,EAChCA,EAAAe,EAAqB,SAAWf,EACzCc,IACWd,EAAAe,EAAqB,OAASf,GAEtCY,EAAKxB,QAAQe,EAAMH,EAC5B,CAUiBqB,CAAclB,GAOvB,MAAAa,EAAMJ,EAAKU,QAAQf,GAErB,IAAAgB,EACJ,OAAQP,GACN,IAAK,MACHO,EAASpC,QAAQoB,GACjB,MACF,IAAK,QACH,OAAOpB,QAAQoB,GACjB,IAAK,QACH,OAAOiB,EAAKd,EAAGe,aAAalB,EAAY,UAC1C,IAAK,MACH,GAAIf,EAAgB,CAClBL,QAAQK,GACR+B,EAASpC,QAAQoB,GACjB,KACF,CACA,MAAM,IAAID,MACR,2IAGJ,QACE,MAAM,IAAIA,MAAM,iCAAiCU,KAErD,IAAKO,EAAc,MAAA,IAAIjB,MAAM,wBAE7B,OAAOiB,EAAOG,SAAWH,CAC3B"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "jiek",
|
3
|
-
"version": "0.2.
|
3
|
+
"version": "0.2.1-alpha.1",
|
4
4
|
"description": "YiJie's personal kits.",
|
5
5
|
"bin": {
|
6
6
|
"jiek": "bin/jiek.js",
|
@@ -30,6 +30,8 @@
|
|
30
30
|
"autoprefixer": "^10.4.16",
|
31
31
|
"commander": "^12.0.0",
|
32
32
|
"detect-indent": "^6.1.0",
|
33
|
+
"inquirer": "^8.2.6",
|
34
|
+
"micromatch": "^4.0.5",
|
33
35
|
"js-yaml": "^4.1.0",
|
34
36
|
"jsonc-parser": "^3.2.1",
|
35
37
|
"rollup": "^4.1.5",
|
@@ -41,25 +43,24 @@
|
|
41
43
|
"@jiek/utils": "0.1.6"
|
42
44
|
},
|
43
45
|
"optionalDependencies": {
|
44
|
-
"@pnpm/filter-workspace-packages": "^7.2.13"
|
46
|
+
"@pnpm/filter-workspace-packages": "^7.2.13",
|
47
|
+
"esbuild-register": "^3.5.0"
|
45
48
|
},
|
46
49
|
"devDependencies": {
|
47
50
|
"@npm/types": "^1.0.2",
|
48
51
|
"@pnpm/filter-workspace-packages": "^7.2.13",
|
49
52
|
"@pnpm/workspace.pkgs-graph": "^2.0.15",
|
50
53
|
"@types/js-yaml": "^4.0.9",
|
54
|
+
"@types/inquirer": "^9.0.7",
|
55
|
+
"@types/micromatch": "^4.0.6",
|
51
56
|
"esbuild-register": "^3.5.0"
|
52
57
|
},
|
53
|
-
"publishConfig": {
|
54
|
-
"jsdelivr": "./dist/index.umd.min.js"
|
55
|
-
},
|
56
58
|
"scripts": {
|
57
59
|
"build": "jiek-dev build"
|
58
60
|
},
|
59
61
|
"types": "./dist/index.d.ts",
|
60
62
|
"main": "./dist/index.umd.js",
|
61
63
|
"module": "./dist/index.esm.js",
|
62
|
-
"unpkg": "./dist/index.umd.min.js",
|
63
64
|
"browser": "./dist/index.umd.min.js",
|
64
65
|
"typesVersions": {
|
65
66
|
"<5.0": {
|