jiek 0.2.1 → 0.2.2-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/bin/jiek.js +8 -1
- package/dist/base.esm.d.ts +55 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.esm.d.ts +2 -0
- package/dist/cli.esm.js +10 -0
- package/dist/cli.esm.js.map +1 -0
- package/dist/cli.esm.min.js +2 -0
- package/dist/cli.esm.min.js.map +1 -0
- package/dist/cli.iife.js +658 -0
- package/dist/cli.iife.js.map +1 -0
- package/dist/cli.iife.min.js +2 -0
- package/dist/cli.iife.min.js.map +1 -0
- package/dist/cli.umd.js +661 -0
- package/dist/cli.umd.js.map +1 -0
- package/dist/cli.umd.min.js +2 -0
- package/dist/cli.umd.min.js.map +1 -0
- package/dist/commands/build.esm.js +3 -4
- package/dist/commands/build.esm.js.map +1 -1
- package/dist/commands/build.esm.min.js +1 -1
- package/dist/commands/build.esm.min.js.map +1 -1
- 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.d.ts +56 -1
- package/dist/index.esm.d.ts +5 -1
- package/dist/index.esm.js +2 -7
- 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 +6 -289
- 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 +6 -291
- 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/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 +75 -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/dist/utils/tsRegister.esm.js +24 -0
- package/dist/utils/tsRegister.esm.js.map +1 -0
- package/dist/utils/tsRegister.esm.min.js +2 -0
- package/dist/utils/tsRegister.esm.min.js.map +1 -0
- package/package.json +14 -4
- package/bin/jiek-dev.js +0 -4
@@ -0,0 +1,75 @@
|
|
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
|
+
import { tsRegisterName } from './tsRegister.esm.js';
|
7
|
+
|
8
|
+
let configName = "jiek.config";
|
9
|
+
function getConfigPath(root) {
|
10
|
+
const isSupportTsLoader = !!tsRegisterName;
|
11
|
+
function configWithExtIsExist(ext) {
|
12
|
+
const filenames = [
|
13
|
+
path.resolve(root, `${configName}.${ext}`),
|
14
|
+
path.resolve(root, `.${configName}.${ext}`)
|
15
|
+
];
|
16
|
+
for (const filename of filenames) {
|
17
|
+
if (fs.existsSync(filename) && fs.lstatSync(filename).isFile()) {
|
18
|
+
return filename;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
return;
|
22
|
+
}
|
23
|
+
configName = configWithExtIsExist("js") ?? configName;
|
24
|
+
configName = configWithExtIsExist("json") ?? configName;
|
25
|
+
configName = configWithExtIsExist("yaml") ?? configName;
|
26
|
+
if (isSupportTsLoader) {
|
27
|
+
configName = configWithExtIsExist("ts") ?? configName;
|
28
|
+
}
|
29
|
+
return path.resolve(root, configName);
|
30
|
+
}
|
31
|
+
function loadConfig() {
|
32
|
+
const { wd: root, notWorkspace } = getWD();
|
33
|
+
if (notWorkspace)
|
34
|
+
throw new Error("not in workspace");
|
35
|
+
let configPath = program.getOptionValue("configPath");
|
36
|
+
if (!configPath) {
|
37
|
+
configPath = getConfigPath(root);
|
38
|
+
} else {
|
39
|
+
if (!fs.existsSync(configPath))
|
40
|
+
throw new Error(`config file not found: ${configPath}`);
|
41
|
+
if (!path.isAbsolute(configPath))
|
42
|
+
configPath = path.resolve(root, configPath);
|
43
|
+
}
|
44
|
+
const ext = path.extname(configPath);
|
45
|
+
let module;
|
46
|
+
switch (ext) {
|
47
|
+
case ".js":
|
48
|
+
module = require(configPath);
|
49
|
+
break;
|
50
|
+
case ".json":
|
51
|
+
return require(configPath);
|
52
|
+
case ".yaml":
|
53
|
+
return load(fs.readFileSync(configPath, "utf-8"));
|
54
|
+
case ".ts":
|
55
|
+
if (tsRegisterName) {
|
56
|
+
require(tsRegisterName);
|
57
|
+
module = require(configPath);
|
58
|
+
break;
|
59
|
+
}
|
60
|
+
throw new Error(
|
61
|
+
"ts config file is not supported without ts register, please install esbuild-register or set JIEK_TS_REGISTER env for custom ts register"
|
62
|
+
);
|
63
|
+
case ".config":
|
64
|
+
module = {};
|
65
|
+
break;
|
66
|
+
default:
|
67
|
+
throw new Error(`unsupported config file type: ${ext}`);
|
68
|
+
}
|
69
|
+
if (!module)
|
70
|
+
throw new Error("config file is empty");
|
71
|
+
return module.default ?? module;
|
72
|
+
}
|
73
|
+
|
74
|
+
export { loadConfig };
|
75
|
+
//# 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'\nimport { tsRegisterName } from './tsRegister'\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 case '.config':\n module = {}\n break\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":";;;;;;;AASA,IAAI,UAAa,GAAA,aAAA,CAAA;AAEjB,SAAS,cAAc,IAAc,EAAA;AACnC,EAAM,MAAA,iBAAA,GAAoB,CAAC,CAAC,cAAA,CAAA;AAC5B,EAAA,SAAS,qBAAqB,GAAa,EAAA;AACzC,IAAA,MAAM,SAAY,GAAA;AAAA,MAChB,KAAK,OAAQ,CAAA,IAAA,EAAM,GAAG,UAAU,CAAA,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path";import{program as t}from"commander";import{load as o}from"js-yaml";import{getWD as s}from"./getWD.esm.min.js";import{tsRegisterName as i}from"./tsRegister.esm.min.js";let n="jiek.config";function f(){const{wd:f,notWorkspace:c}=s();if(c)throw new Error("not in workspace");let l=t.getOptionValue("configPath");if(l){if(!e.existsSync(l))throw new Error(`config file not found: ${l}`);r.isAbsolute(l)||(l=r.resolve(f,l))}else l=function(t){const o=!!i;function s(o){const s=[r.resolve(t,`${n}.${o}`),r.resolve(t,`.${n}.${o}`)];for(const r of s)if(e.existsSync(r)&&e.lstatSync(r).isFile())return r}return n=s("js")??n,n=s("json")??n,n=s("yaml")??n,o&&(n=s("ts")??n),r.resolve(t,n)}(f);const a=r.extname(l);let m;switch(a){case".js":m=require(l);break;case".json":return require(l);case".yaml":return o(e.readFileSync(l,"utf-8"));case".ts":if(i){require(i),m=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");case".config":m={};break;default:throw new Error(`unsupported config file type: ${a}`)}if(!m)throw new Error("config file is empty");return m.default??m}export{f 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'\nimport { tsRegisterName } from './tsRegister'\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 case '.config':\n module = {}\n break\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":["configName","loadConfig","wd","root","notWorkspace","getWD","Error","configPath","program","getOptionValue","fs","existsSync","path","isAbsolute","resolve","isSupportTsLoader","tsRegisterName","configWithExtIsExist","ext","filenames","filename","lstatSync","isFile","getConfigPath","extname","module","require","load","readFileSync","default"],"mappings":"uNASA,IAAIA,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,EAAKE,QAAQX,EAAMI,GACpC,MANEA,EAnCJ,SAAuBJ,GACf,MAAAY,IAAsBC,EAC5B,SAASC,EAAqBC,GAC5B,MAAMC,EAAY,CAChBP,EAAKE,QAAQX,EAAM,GAAGH,KAAckB,KACpCN,EAAKE,QAAQX,EAAM,IAAIH,KAAckB,MAEvC,IAAA,MAAWE,KAAYD,EAEnB,GAAAT,EAAGC,WAAWS,IACdV,EAAGW,UAAUD,GACVE,SAEI,OAAAF,CAIb,CAOO,OANMpB,EAAAiB,EAAqB,OAASjB,EAC9BA,EAAAiB,EAAqB,SAAWjB,EAChCA,EAAAiB,EAAqB,SAAWjB,EACzCe,IACWf,EAAAiB,EAAqB,OAASjB,GAEtCY,EAAKE,QAAQX,EAAMH,EAC5B,CAUiBuB,CAAcpB,GAOvB,MAAAe,EAAMN,EAAKY,QAAQjB,GAErB,IAAAkB,EACJ,OAAQP,GACN,IAAK,MACHO,EAASC,QAAQnB,GACjB,MACF,IAAK,QACH,OAAOmB,QAAQnB,GACjB,IAAK,QACH,OAAOoB,EAAKjB,EAAGkB,aAAarB,EAAY,UAC1C,IAAK,MACH,GAAIS,EAAgB,CAClBU,QAAQV,GACRS,EAASC,QAAQnB,GACjB,KACF,CACA,MAAM,IAAID,MACR,2IAGJ,IAAK,UACHmB,EAAS,CAAA,EACT,MACF,QACE,MAAM,IAAInB,MAAM,iCAAiCY,KAErD,IAAKO,EAAc,MAAA,IAAInB,MAAM,wBAE7B,OAAOmB,EAAOI,SAAWJ,CAC3B"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
function packageIsExist(name) {
|
2
|
+
try {
|
3
|
+
require.resolve(name);
|
4
|
+
return true;
|
5
|
+
} catch (e) {
|
6
|
+
return false;
|
7
|
+
}
|
8
|
+
}
|
9
|
+
let tsRegisterName;
|
10
|
+
const registers = [
|
11
|
+
process.env.JIEK_TS_REGISTER,
|
12
|
+
"esbuild-register",
|
13
|
+
"@swc-node/register",
|
14
|
+
"ts-node/register"
|
15
|
+
].filter(Boolean);
|
16
|
+
for (const register of registers) {
|
17
|
+
if (packageIsExist(register)) {
|
18
|
+
tsRegisterName = register;
|
19
|
+
break;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
export { tsRegisterName };
|
24
|
+
//# sourceMappingURL=tsRegister.esm.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"tsRegister.esm.js","sources":["../../src/utils/tsRegister.ts"],"sourcesContent":["function packageIsExist(name: string) {\n try {\n require.resolve(name)\n return true\n } catch (e) {\n return false\n }\n}\n\nexport let tsRegisterName: string | undefined\nconst registers = [\n process.env.JIEK_TS_REGISTER,\n 'esbuild-register',\n '@swc-node/register',\n 'ts-node/register'\n].filter(Boolean) as string[]\nfor (const register of registers) {\n if (packageIsExist(register)) {\n tsRegisterName = register\n break\n }\n}\n"],"names":[],"mappings":"AAAA,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,IAAO,OAAA,KAAA,CAAA;AAAA,GACT;AACF,CAAA;AAEW,IAAA,eAAA;AACX,MAAM,SAAY,GAAA;AAAA,EAChB,QAAQ,GAAI,CAAA,gBAAA;AAAA,EACZ,kBAAA;AAAA,EACA,oBAAA;AAAA,EACA,kBAAA;AACF,CAAA,CAAE,OAAO,OAAO,CAAA,CAAA;AAChB,KAAA,MAAW,YAAY,SAAW,EAAA;AAChC,EAAI,IAAA,cAAA,CAAe,QAAQ,CAAG,EAAA;AAC5B,IAAiB,cAAA,GAAA,QAAA,CAAA;AACjB,IAAA,MAAA;AAAA,GACF;AACF;;;;"}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
function e(e){try{return require.resolve(e),!0}catch(e){return!1}}let r;const t=[process.env.JIEK_TS_REGISTER,"esbuild-register","@swc-node/register","ts-node/register"].filter(Boolean);for(const o of t)if(e(o)){r=o;break}export{r as tsRegisterName};
|
2
|
+
//# sourceMappingURL=tsRegister.esm.min.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"tsRegister.esm.min.js","sources":["../../src/utils/tsRegister.ts"],"sourcesContent":["function packageIsExist(name: string) {\n try {\n require.resolve(name)\n return true\n } catch (e) {\n return false\n }\n}\n\nexport let tsRegisterName: string | undefined\nconst registers = [\n process.env.JIEK_TS_REGISTER,\n 'esbuild-register',\n '@swc-node/register',\n 'ts-node/register'\n].filter(Boolean) as string[]\nfor (const register of registers) {\n if (packageIsExist(register)) {\n tsRegisterName = register\n break\n }\n}\n"],"names":["packageIsExist","name","require","resolve","e","tsRegisterName","registers","process","env","JIEK_TS_REGISTER","filter","Boolean","register"],"mappings":"AAAA,SAASA,EAAeC,GAClB,IAEK,OADPC,QAAQC,QAAQF,IACT,QACAG,GACA,OAAA,CACT,CACF,CAEW,IAAAC,EACX,MAAMC,EAAY,CAChBC,QAAQC,IAAIC,iBACZ,mBACA,qBACA,oBACAC,OAAOC,SACT,IAAA,MAAWC,KAAYN,EACjB,GAAAN,EAAeY,GAAW,CACXP,EAAAO,EACjB,KACF"}
|
package/package.json
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
{
|
2
2
|
"name": "jiek",
|
3
|
-
"version": "0.2.1",
|
3
|
+
"version": "0.2.2-alpha.1",
|
4
4
|
"description": "YiJie's personal kits.",
|
5
5
|
"bin": {
|
6
|
-
"jiek": "bin/jiek.js"
|
7
|
-
"jiek-dev": "bin/jiek-dev.js"
|
6
|
+
"jiek": "bin/jiek.js"
|
8
7
|
},
|
9
8
|
"files": [
|
10
9
|
"dist"
|
@@ -17,6 +16,12 @@
|
|
17
16
|
"require": "./dist/index.umd.js",
|
18
17
|
"inner-src": "./src/index.ts"
|
19
18
|
},
|
19
|
+
"./cli": {
|
20
|
+
"types": "./dist/cli.d.ts",
|
21
|
+
"import": "./dist/cli.esm.js",
|
22
|
+
"require": "./dist/cli.umd.js",
|
23
|
+
"inner-src": "./src/cli.ts"
|
24
|
+
},
|
20
25
|
"./rollup": {
|
21
26
|
"types": "./dist/rollup.d.ts",
|
22
27
|
"import": "./dist/rollup.esm.js",
|
@@ -30,6 +35,8 @@
|
|
30
35
|
"autoprefixer": "^10.4.16",
|
31
36
|
"commander": "^12.0.0",
|
32
37
|
"detect-indent": "^6.1.0",
|
38
|
+
"inquirer": "^8.2.6",
|
39
|
+
"micromatch": "^4.0.5",
|
33
40
|
"js-yaml": "^4.1.0",
|
34
41
|
"jsonc-parser": "^3.2.1",
|
35
42
|
"rollup": "^4.1.5",
|
@@ -41,13 +48,16 @@
|
|
41
48
|
"@jiek/utils": "0.1.6"
|
42
49
|
},
|
43
50
|
"optionalDependencies": {
|
44
|
-
"@pnpm/filter-workspace-packages": "^7.2.13"
|
51
|
+
"@pnpm/filter-workspace-packages": "^7.2.13",
|
52
|
+
"esbuild-register": "^3.5.0"
|
45
53
|
},
|
46
54
|
"devDependencies": {
|
47
55
|
"@npm/types": "^1.0.2",
|
48
56
|
"@pnpm/filter-workspace-packages": "^7.2.13",
|
49
57
|
"@pnpm/workspace.pkgs-graph": "^2.0.15",
|
50
58
|
"@types/js-yaml": "^4.0.9",
|
59
|
+
"@types/inquirer": "^9.0.7",
|
60
|
+
"@types/micromatch": "^4.0.6",
|
51
61
|
"esbuild-register": "^3.5.0"
|
52
62
|
},
|
53
63
|
"scripts": {
|
package/bin/jiek-dev.js
DELETED