jiek 0.4.6 → 0.4.7-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +22 -1
- package/bin/jiek.js +2 -1
- package/dist/cli.d.mts +97 -0
- package/dist/cli.d.mts.map +1 -0
- package/dist/cli.d.ts +96 -1
- package/dist/cli.d.ts.map +1 -0
- package/dist/{cli.cjs → cli.js} +355 -231
- package/dist/cli.js.map +1 -0
- package/dist/cli.min.js +1 -0
- package/dist/cli.min.js.map +1 -0
- package/dist/cli.min.mjs +1 -0
- package/dist/cli.min.mjs.map +1 -0
- package/dist/cli.mjs +803 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/index.d.mts +58 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.d.ts +47 -46
- package/dist/index.d.ts.map +1 -0
- package/dist/{index.cjs → index.js} +0 -1
- package/dist/index.js.map +1 -0
- package/dist/{index.min.cjs → index.min.js} +0 -1
- package/dist/index.min.js.map +1 -0
- package/dist/index.min.mjs +1 -0
- package/dist/index.min.mjs.map +1 -0
- package/dist/{index.esm.js → index.mjs} +0 -1
- package/dist/index.mjs.map +1 -0
- package/dist/rollup/index.d.mts +53 -0
- package/dist/rollup/index.d.mts.map +1 -0
- package/dist/rollup/index.d.ts +53 -0
- package/dist/rollup/index.d.ts.map +1 -0
- package/dist/rollup/index.js +553 -0
- package/dist/rollup/index.js.map +1 -0
- package/dist/rollup/index.min.js +1 -0
- package/dist/rollup/index.min.js.map +1 -0
- package/dist/rollup/index.min.mjs +1 -0
- package/dist/rollup/index.min.mjs.map +1 -0
- package/dist/rollup/index.mjs +551 -0
- package/dist/rollup/index.mjs.map +1 -0
- package/package.json +52 -35
- package/src/cli.ts +9 -0
- package/src/commands/base.ts +9 -0
- package/src/commands/build.ts +156 -0
- package/src/commands/init.ts +373 -0
- package/src/commands/publish.ts +156 -0
- package/src/index.ts +8 -0
- package/src/inner.ts +11 -0
- package/src/merge-package-json.ts +75 -0
- package/src/pkg.ts +1 -0
- package/src/rollup/base.ts +72 -0
- package/src/rollup/index.ts +420 -0
- package/src/rollup/plugins/globals.ts +34 -0
- package/src/rollup/plugins/progress.ts +26 -0
- package/src/rollup/plugins/skip.ts +23 -0
- package/src/rollup/utils/commonOptions.ts +9 -0
- package/src/rollup/utils/externalResolver.ts +21 -0
- package/src/rollup/utils/globalResolver.ts +13 -0
- package/src/rollup/utils/withMinify.ts +18 -0
- package/src/utils/filterSupport.ts +82 -0
- package/src/utils/getExports.ts +100 -0
- package/src/utils/getRoot.ts +16 -0
- package/src/utils/getWD.ts +31 -0
- package/src/utils/loadConfig.ts +93 -0
- package/src/utils/tsRegister.ts +22 -0
- package/dist/base.esm.d.ts +0 -55
- package/dist/cli.cjs.map +0 -1
- package/dist/cli.esm.d.ts +0 -2
- package/dist/cli.esm.js +0 -9
- package/dist/cli.esm.js.map +0 -1
- package/dist/cli.esm.min.js +0 -2
- package/dist/cli.esm.min.js.map +0 -1
- package/dist/cli.min.cjs +0 -2
- package/dist/cli.min.cjs.map +0 -1
- package/dist/commands/base.esm.js +0 -5
- package/dist/commands/base.esm.js.map +0 -1
- package/dist/commands/base.esm.min.js +0 -2
- package/dist/commands/base.esm.min.js.map +0 -1
- package/dist/commands/build.esm.js +0 -58
- package/dist/commands/build.esm.js.map +0 -1
- package/dist/commands/build.esm.min.js +0 -2
- package/dist/commands/build.esm.min.js.map +0 -1
- package/dist/commands/init.esm.js +0 -271
- package/dist/commands/init.esm.js.map +0 -1
- package/dist/commands/init.esm.min.js +0 -2
- package/dist/commands/init.esm.min.js.map +0 -1
- package/dist/commands/publish.esm.js +0 -87
- package/dist/commands/publish.esm.js.map +0 -1
- package/dist/commands/publish.esm.min.js +0 -2
- package/dist/commands/publish.esm.min.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.esm.d.ts +0 -6
- package/dist/index.esm.js.map +0 -1
- package/dist/index.esm.min.js +0 -2
- package/dist/index.esm.min.js.map +0 -1
- package/dist/index.min.cjs.map +0 -1
- package/dist/inner.esm.js +0 -10
- package/dist/inner.esm.js.map +0 -1
- package/dist/inner.esm.min.js +0 -2
- package/dist/inner.esm.min.js.map +0 -1
- package/dist/merge-package-json.esm.js +0 -64
- package/dist/merge-package-json.esm.js.map +0 -1
- package/dist/merge-package-json.esm.min.js +0 -2
- package/dist/merge-package-json.esm.min.js.map +0 -1
- package/dist/pkg.esm.js +0 -4
- package/dist/pkg.esm.js.map +0 -1
- package/dist/pkg.esm.min.js +0 -2
- package/dist/pkg.esm.min.js.map +0 -1
- package/dist/rollup/plugins/globals.esm.js +0 -31
- package/dist/rollup/plugins/globals.esm.js.map +0 -1
- package/dist/rollup/plugins/globals.esm.min.js +0 -2
- package/dist/rollup/plugins/globals.esm.min.js.map +0 -1
- package/dist/rollup/plugins/skip.esm.js +0 -16
- package/dist/rollup/plugins/skip.esm.js.map +0 -1
- package/dist/rollup/plugins/skip.esm.min.js +0 -2
- package/dist/rollup/plugins/skip.esm.min.js.map +0 -1
- package/dist/rollup/utils/commonOptions.esm.js +0 -9
- package/dist/rollup/utils/commonOptions.esm.js.map +0 -1
- package/dist/rollup/utils/commonOptions.esm.min.js +0 -2
- package/dist/rollup/utils/commonOptions.esm.min.js.map +0 -1
- package/dist/rollup/utils/externalResolver.esm.js +0 -12
- package/dist/rollup/utils/externalResolver.esm.js.map +0 -1
- package/dist/rollup/utils/externalResolver.esm.min.js +0 -2
- package/dist/rollup/utils/externalResolver.esm.min.js.map +0 -1
- package/dist/rollup/utils/globalResolver.esm.js +0 -9
- package/dist/rollup/utils/globalResolver.esm.js.map +0 -1
- package/dist/rollup/utils/globalResolver.esm.min.js +0 -2
- package/dist/rollup/utils/globalResolver.esm.min.js.map +0 -1
- package/dist/rollup/utils/withMinify.esm.js +0 -15
- package/dist/rollup/utils/withMinify.esm.js.map +0 -1
- package/dist/rollup/utils/withMinify.esm.min.js +0 -2
- package/dist/rollup/utils/withMinify.esm.min.js.map +0 -1
- package/dist/rollup.cjs +0 -330
- package/dist/rollup.cjs.map +0 -1
- package/dist/rollup.d.ts +0 -23
- package/dist/rollup.esm.d.ts +0 -23
- package/dist/rollup.esm.js +0 -248
- package/dist/rollup.esm.js.map +0 -1
- package/dist/rollup.esm.min.js +0 -2
- package/dist/rollup.esm.min.js.map +0 -1
- package/dist/rollup.min.cjs +0 -2
- package/dist/rollup.min.cjs.map +0 -1
- package/dist/utils/commondir.esm.js +0 -25
- package/dist/utils/commondir.esm.js.map +0 -1
- package/dist/utils/commondir.esm.min.js +0 -2
- package/dist/utils/commondir.esm.min.js.map +0 -1
- package/dist/utils/filterSupport.esm.js +0 -67
- package/dist/utils/filterSupport.esm.js.map +0 -1
- package/dist/utils/filterSupport.esm.min.js +0 -2
- package/dist/utils/filterSupport.esm.min.js.map +0 -1
- package/dist/utils/getRoot.esm.js +0 -14
- package/dist/utils/getRoot.esm.js.map +0 -1
- package/dist/utils/getRoot.esm.min.js +0 -2
- package/dist/utils/getRoot.esm.min.js.map +0 -1
- package/dist/utils/getWD.esm.js +0 -31
- package/dist/utils/getWD.esm.js.map +0 -1
- package/dist/utils/getWD.esm.min.js +0 -2
- package/dist/utils/getWD.esm.min.js.map +0 -1
- package/dist/utils/loadConfig.esm.js +0 -75
- package/dist/utils/loadConfig.esm.js.map +0 -1
- package/dist/utils/loadConfig.esm.min.js +0 -2
- package/dist/utils/loadConfig.esm.min.js.map +0 -1
- package/dist/utils/tsRegister.esm.js +0 -24
- package/dist/utils/tsRegister.esm.js.map +0 -1
- package/dist/utils/tsRegister.esm.min.js +0 -2
- package/dist/utils/tsRegister.esm.min.js.map +0 -1
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"filterSupport.esm.js","sources":["../../src/utils/filterSupport.ts"],"sourcesContent":["import fs from 'node:fs'\nimport path from 'node:path'\n\nimport { filterPackagesFromDir } from '@pnpm/filter-workspace-packages'\nimport { program } from 'commander'\nimport { load } from 'js-yaml'\n\nimport { getRoot } from './getRoot'\nimport { getWD } from './getWD'\n\nexport let type = ''\n\ntry {\n require.resolve('@pnpm/filter-workspace-packages')\n type = 'pnpm'\n} catch { /* empty */ }\nif (type !== '') {\n program\n .option('-f, --filter <filter>', 'filter packages')\n}\n\ninterface ProjectsGraph {\n wd: string\n root: string\n value?: Record<string, {\n name?: string\n }>\n}\n\nexport async function getSelectedProjectsGraph(): Promise<ProjectsGraph> {\n let filter = program.getOptionValue('filter')\n const root = getRoot()\n const { wd, notWorkspace } = getWD()\n if (!notWorkspace && type === 'pnpm') {\n const pnpmWorkspaceFilePath = path.resolve(wd, 'pnpm-workspace.yaml')\n const pnpmWorkspaceFileContent = fs.readFileSync(pnpmWorkspaceFilePath, 'utf-8')\n const pnpmWorkspace = load(pnpmWorkspaceFileContent) as {\n packages: string[]\n }\n if (root === wd && !filter) {\n throw new Error('root path is workspace root, please provide a filter')\n // TODO inquirer prompt support user select packages\n }\n if (root !== wd && !filter) {\n const packageJSONIsExist = fs.existsSync(path.resolve(root, 'package.json'))\n if (!packageJSONIsExist) {\n throw new Error('root path is not workspace root, please provide a filter')\n }\n const packageJSON = JSON.parse(fs.readFileSync(path.resolve(root, 'package.json'), 'utf-8'))\n if (!packageJSON.name) {\n throw new Error('root path is not workspace root, please provide a filter')\n }\n filter = packageJSON.name\n }\n const { selectedProjectsGraph } = await filterPackagesFromDir(wd, [{\n filter: filter ?? '',\n followProdDepsOnly: true\n }], {\n prefix: root,\n workspaceDir: wd,\n patterns: pnpmWorkspace.packages\n })\n return {\n wd, root,\n value: Object.entries(selectedProjectsGraph)\n .reduce((acc, [key, value]) => {\n acc[key] = value.package.manifest\n return acc\n }, {} as NonNullable<ProjectsGraph['value']>)\n }\n }\n return {\n wd, root,\n value: {\n [wd]: JSON.parse(fs.readFileSync(path.resolve(wd, 'package.json'), 'utf-8'))\n }\n }\n}\n"],"names":[],"mappings":"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"}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import e from"node:fs";import r from"node:path";import{filterPackagesFromDir as o}from"@pnpm/filter-workspace-packages";import{program as t}from"commander";import{load as a}from"js-yaml";import{getRoot as p}from"./getRoot.esm.min.js";import{getWD as s}from"./getWD.esm.min.js";let i="";try{require.resolve("@pnpm/filter-workspace-packages"),i="pnpm"}catch{}async function n(){let n=t.getOptionValue("filter");const c=p(),{wd:l,notWorkspace:f}=s();if(!f&&"pnpm"===i){const t=r.resolve(l,"pnpm-workspace.yaml"),p=e.readFileSync(t,"utf-8"),s=a(p);if(c===l&&!n)throw new Error("root path is workspace root, please provide a filter");if(c!==l&&!n){if(!e.existsSync(r.resolve(c,"package.json")))throw new Error("root path is not workspace root, please provide a filter");const o=JSON.parse(e.readFileSync(r.resolve(c,"package.json"),"utf-8"));if(!o.name)throw new Error("root path is not workspace root, please provide a filter");n=o.name}const{selectedProjectsGraph:i}=await o(l,[{filter:n??"",followProdDepsOnly:!0}],{prefix:c,workspaceDir:l,patterns:s.packages});return{wd:l,root:c,value:Object.entries(i).reduce(((e,[r,o])=>(e[r]=o.package.manifest,e)),{})}}return{wd:l,root:c,value:{[l]:JSON.parse(e.readFileSync(r.resolve(l,"package.json"),"utf-8"))}}}""!==i&&t.option("-f, --filter <filter>","filter packages");export{n as getSelectedProjectsGraph,i as type};
|
2
|
-
//# sourceMappingURL=filterSupport.esm.min.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"filterSupport.esm.min.js","sources":["../../src/utils/filterSupport.ts"],"sourcesContent":["import fs from 'node:fs'\nimport path from 'node:path'\n\nimport { filterPackagesFromDir } from '@pnpm/filter-workspace-packages'\nimport { program } from 'commander'\nimport { load } from 'js-yaml'\n\nimport { getRoot } from './getRoot'\nimport { getWD } from './getWD'\n\nexport let type = ''\n\ntry {\n require.resolve('@pnpm/filter-workspace-packages')\n type = 'pnpm'\n} catch { /* empty */ }\nif (type !== '') {\n program\n .option('-f, --filter <filter>', 'filter packages')\n}\n\ninterface ProjectsGraph {\n wd: string\n root: string\n value?: Record<string, {\n name?: string\n }>\n}\n\nexport async function getSelectedProjectsGraph(): Promise<ProjectsGraph> {\n let filter = program.getOptionValue('filter')\n const root = getRoot()\n const { wd, notWorkspace } = getWD()\n if (!notWorkspace && type === 'pnpm') {\n const pnpmWorkspaceFilePath = path.resolve(wd, 'pnpm-workspace.yaml')\n const pnpmWorkspaceFileContent = fs.readFileSync(pnpmWorkspaceFilePath, 'utf-8')\n const pnpmWorkspace = load(pnpmWorkspaceFileContent) as {\n packages: string[]\n }\n if (root === wd && !filter) {\n throw new Error('root path is workspace root, please provide a filter')\n // TODO inquirer prompt support user select packages\n }\n if (root !== wd && !filter) {\n const packageJSONIsExist = fs.existsSync(path.resolve(root, 'package.json'))\n if (!packageJSONIsExist) {\n throw new Error('root path is not workspace root, please provide a filter')\n }\n const packageJSON = JSON.parse(fs.readFileSync(path.resolve(root, 'package.json'), 'utf-8'))\n if (!packageJSON.name) {\n throw new Error('root path is not workspace root, please provide a filter')\n }\n filter = packageJSON.name\n }\n const { selectedProjectsGraph } = await filterPackagesFromDir(wd, [{\n filter: filter ?? '',\n followProdDepsOnly: true\n }], {\n prefix: root,\n workspaceDir: wd,\n patterns: pnpmWorkspace.packages\n })\n return {\n wd, root,\n value: Object.entries(selectedProjectsGraph)\n .reduce((acc, [key, value]) => {\n acc[key] = value.package.manifest\n return acc\n }, {} as NonNullable<ProjectsGraph['value']>)\n }\n }\n return {\n wd, root,\n value: {\n [wd]: JSON.parse(fs.readFileSync(path.resolve(wd, 'package.json'), 'utf-8'))\n }\n }\n}\n"],"names":["type","require","resolve","async","getSelectedProjectsGraph","filter","program","getOptionValue","root","getRoot","wd","notWorkspace","getWD","pnpmWorkspaceFilePath","path","pnpmWorkspaceFileContent","fs","readFileSync","pnpmWorkspace","load","Error","existsSync","packageJSON","JSON","parse","name","selectedProjectsGraph","filterPackagesFromDir","followProdDepsOnly","prefix","workspaceDir","patterns","packages","value","Object","entries","reduce","acc","key","package","manifest","option"],"mappings":"qRAUO,IAAIA,EAAO,GAElB,IACEC,QAAQC,QAAQ,mCACTF,EAAA,MACT,CAAQ,MAAc,CActBG,eAAsBC,IAChB,IAAAC,EAASC,EAAQC,eAAe,UACpC,MAAMC,EAAOC,KACPC,GAAEA,EAAAC,aAAIA,GAAiBC,IACzB,IAACD,GAAyB,SAATX,EAAiB,CACpC,MAAMa,EAAwBC,EAAKZ,QAAQQ,EAAI,uBACzCK,EAA2BC,EAAGC,aAAaJ,EAAuB,SAClEK,EAAgBC,EAAKJ,GAGvB,GAAAP,IAASE,IAAOL,EACZ,MAAA,IAAIe,MAAM,wDAGd,GAAAZ,IAASE,IAAOL,EAAQ,CAE1B,IAD2BW,EAAGK,WAAWP,EAAKZ,QAAQM,EAAM,iBAEpD,MAAA,IAAIY,MAAM,4DAEZ,MAAAE,EAAcC,KAAKC,MAAMR,EAAGC,aAAaH,EAAKZ,QAAQM,EAAM,gBAAiB,UAC/E,IAACc,EAAYG,KACT,MAAA,IAAIL,MAAM,4DAElBf,EAASiB,EAAYG,IACvB,CACA,MAAMC,sBAAEA,SAAgCC,EAAsBjB,EAAI,CAAC,CACjEL,OAAQA,GAAU,GAClBuB,oBAAoB,IAClB,CACFC,OAAQrB,EACRsB,aAAcpB,EACdqB,SAAUb,EAAcc,WAEnB,MAAA,CACLtB,KAAIF,OACJyB,MAAOC,OAAOC,QAAQT,GACnBU,QAAO,CAACC,GAAMC,EAAKL,MACdI,EAAAC,GAAOL,EAAMM,QAAQC,SAClBH,IACN,IAET,CACO,MAAA,CACL3B,KAAIF,OACJyB,MAAO,CACLvB,CAACA,GAAKa,KAAKC,MAAMR,EAAGC,aAAaH,EAAKZ,QAAQQ,EAAI,gBAAiB,WAGzE,CA7Da,KAATV,GAECM,EAAAmC,OAAO,wBAAyB"}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import path from 'node:path';
|
2
|
-
import { program } from 'commander';
|
3
|
-
|
4
|
-
let root;
|
5
|
-
function getRoot() {
|
6
|
-
if (root)
|
7
|
-
return root;
|
8
|
-
const rootOption = program.getOptionValue("root");
|
9
|
-
root = rootOption ? path.isAbsolute(rootOption) ? rootOption : path.resolve(process.cwd(), rootOption) : void 0;
|
10
|
-
return root;
|
11
|
-
}
|
12
|
-
|
13
|
-
export { getRoot };
|
14
|
-
//# sourceMappingURL=getRoot.esm.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getRoot.esm.js","sources":["../../src/utils/getRoot.ts"],"sourcesContent":["import path from 'node:path'\n\nimport { program } from 'commander'\n\nlet root: string\nexport function getRoot() {\n if (root) return root\n\n const rootOption = program.getOptionValue('root')\n root = rootOption\n ? path.isAbsolute(rootOption)\n ? rootOption\n : path.resolve(process.cwd(), rootOption)\n : undefined\n return root\n}\n"],"names":[],"mappings":";;;AAIA,IAAI,IAAA,CAAA;AACG,SAAS,OAAU,GAAA;AACxB,EAAI,IAAA,IAAA;AAAM,IAAO,OAAA,IAAA,CAAA;AAEjB,EAAM,MAAA,UAAA,GAAa,OAAQ,CAAA,cAAA,CAAe,MAAM,CAAA,CAAA;AAChD,EAAA,IAAA,GAAO,UACH,GAAA,IAAA,CAAK,UAAW,CAAA,UAAU,CACxB,GAAA,UAAA,GACA,IAAK,CAAA,OAAA,CAAQ,OAAQ,CAAA,GAAA,EAAO,EAAA,UAAU,CACxC,GAAA,KAAA,CAAA,CAAA;AACJ,EAAO,OAAA,IAAA,CAAA;AACT;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getRoot.esm.min.js","sources":["../../src/utils/getRoot.ts"],"sourcesContent":["import path from 'node:path'\n\nimport { program } from 'commander'\n\nlet root: string\nexport function getRoot() {\n if (root) return root\n\n const rootOption = program.getOptionValue('root')\n root = rootOption\n ? path.isAbsolute(rootOption)\n ? rootOption\n : path.resolve(process.cwd(), rootOption)\n : undefined\n return root\n}\n"],"names":["root","getRoot","rootOption","program","getOptionValue","path","isAbsolute","resolve","process","cwd"],"mappings":"6DAIA,IAAIA,EACG,SAASC,IACV,GAAAD,EAAa,OAAAA,EAEX,MAAAE,EAAaC,EAAQC,eAAe,QAMnC,OALPJ,EAAOE,EACHG,EAAKC,WAAWJ,GACdA,EACAG,EAAKE,QAAQC,QAAQC,MAAOP,QAC9B,EACGF,CACT"}
|
package/dist/utils/getWD.esm.js
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
import { isWorkspaceDir, 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
|
-
if (root !== void 0) {
|
12
|
-
const isWorkspace = isWorkspaceDir(root, type);
|
13
|
-
notWorkspace = !isWorkspace;
|
14
|
-
wd = root;
|
15
|
-
return { wd, notWorkspace };
|
16
|
-
}
|
17
|
-
try {
|
18
|
-
wd = getWorkspaceDir(type);
|
19
|
-
} catch (e) {
|
20
|
-
if ("message" in e && e.message === "workspace root not found") {
|
21
|
-
wd = root;
|
22
|
-
notWorkspace = true;
|
23
|
-
} else {
|
24
|
-
throw e;
|
25
|
-
}
|
26
|
-
}
|
27
|
-
return { wd, notWorkspace };
|
28
|
-
}
|
29
|
-
|
30
|
-
export { getWD };
|
31
|
-
//# sourceMappingURL=getWD.esm.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getWD.esm.js","sources":["../../src/utils/getWD.ts"],"sourcesContent":["import { getWorkspaceDir, isWorkspaceDir } 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 if (root !== undefined) {\n const isWorkspace = isWorkspaceDir(root, type)\n notWorkspace = !isWorkspace\n wd = root\n return { wd, notWorkspace }\n }\n try {\n wd = getWorkspaceDir(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,EAAA,IAAI,SAAS,KAAW,CAAA,EAAA;AACtB,IAAM,MAAA,WAAA,GAAc,cAAe,CAAA,IAAA,EAAM,IAAI,CAAA,CAAA;AAC7C,IAAA,YAAA,GAAe,CAAC,WAAA,CAAA;AAChB,IAAK,EAAA,GAAA,IAAA,CAAA;AACL,IAAO,OAAA,EAAE,IAAI,YAAa,EAAA,CAAA;AAAA,GAC5B;AACA,EAAI,IAAA;AACF,IAAA,EAAA,GAAK,gBAAgB,IAAI,CAAA,CAAA;AAAA,WAClB,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;;;;"}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{isWorkspaceDir as o,getWorkspaceDir as t}from"@jiek/utils/getWorkspaceDir";import{type as r}from"./filterSupport.esm.min.js";import{getRoot as e}from"./getRoot.esm.min.js";let s,i=!1;function n(){if(s)return{wd:s,notWorkspace:i};const n=e();if(void 0!==n){const t=o(n,r);return i=!t,s=n,{wd:s,notWorkspace:i}}try{s=t(r)}catch(o){if(!("message"in o)||"workspace root not found"!==o.message)throw o;s=n,i=!0}return{wd:s,notWorkspace:i}}export{n as getWD};
|
2
|
-
//# sourceMappingURL=getWD.esm.min.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getWD.esm.min.js","sources":["../../src/utils/getWD.ts"],"sourcesContent":["import { getWorkspaceDir, isWorkspaceDir } 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 if (root !== undefined) {\n const isWorkspace = isWorkspaceDir(root, type)\n notWorkspace = !isWorkspace\n wd = root\n return { wd, notWorkspace }\n }\n try {\n wd = getWorkspaceDir(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","isWorkspace","isWorkspaceDir","type","getWorkspaceDir","e","message"],"mappings":"mLAKA,IAAIA,EACAC,GAAe,EAEZ,SAASC,IACV,GAAAF,EAAW,MAAA,CAAEA,KAAIC,gBAErB,MAAME,EAAOC,IACb,QAAa,IAATD,EAAoB,CAChB,MAAAE,EAAcC,EAAeH,EAAMI,GAGlC,OAFPN,GAAgBI,EACXL,EAAAG,EACE,CAAEH,KAAIC,eACf,CACI,IACFD,EAAKQ,EAAgBD,SACdE,GAEP,KAAI,YAAaA,IAAmB,6BAAdA,EAAEC,QAIhB,MAAAD,EAHDT,EAAAG,EACUF,GAAA,CAInB,CACO,MAAA,CAAED,KAAIC,eACf"}
|
@@ -1,75 +0,0 @@
|
|
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
|
@@ -1 +0,0 @@
|
|
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,CAAA,EAAI,GAAG,CAAE,CAAA,CAAA;AAAA,MACzC,KAAK,OAAQ,CAAA,IAAA,EAAM,IAAI,UAAU,CAAA,CAAA,EAAI,GAAG,CAAE,CAAA,CAAA;AAAA,KAC5C,CAAA;AACA,IAAA,KAAA,MAAW,YAAY,SAAW,EAAA;AAChC,MACE,IAAA,EAAA,CAAG,WAAW,QAAQ,CAAA,IACtB,GAAG,SAAU,CAAA,QAAQ,CAClB,CAAA,MAAA,EACH,EAAA;AACA,QAAO,OAAA,QAAA,CAAA;AAAA,OACT;AAAA,KACF;AACA,IAAA,OAAA;AAAA,GACF;AACA,EAAa,UAAA,GAAA,oBAAA,CAAqB,IAAI,CAAK,IAAA,UAAA,CAAA;AAC3C,EAAa,UAAA,GAAA,oBAAA,CAAqB,MAAM,CAAK,IAAA,UAAA,CAAA;AAC7C,EAAa,UAAA,GAAA,oBAAA,CAAqB,MAAM,CAAK,IAAA,UAAA,CAAA;AAC7C,EAAA,IAAI,iBAAmB,EAAA;AACrB,IAAa,UAAA,GAAA,oBAAA,CAAqB,IAAI,CAAK,IAAA,UAAA,CAAA;AAAA,GAC7C;AACA,EAAO,OAAA,IAAA,CAAK,OAAQ,CAAA,IAAA,EAAM,UAAU,CAAA,CAAA;AACtC,CAAA;AAEO,SAAS,UAAa,GAAA;AAC3B,EAAA,MAAM,EAAE,EAAA,EAAI,IAAM,EAAA,YAAA,KAAiB,KAAM,EAAA,CAAA;AACzC,EAAI,IAAA,YAAA;AACF,IAAM,MAAA,IAAI,MAAM,kBAAkB,CAAA,CAAA;AAEpC,EAAI,IAAA,UAAA,GAAa,OAAQ,CAAA,cAAA,CAAe,YAAY,CAAA,CAAA;AAEpD,EAAA,IAAI,CAAC,UAAY,EAAA;AACf,IAAA,UAAA,GAAa,cAAc,IAAI,CAAA,CAAA;AAAA,GAC1B,MAAA;AACL,IAAI,IAAA,CAAC,EAAG,CAAA,UAAA,CAAW,UAAU,CAAA;AAC3B,MAAA,MAAM,IAAI,KAAA,CAAM,CAA0B,uBAAA,EAAA,UAAU,CAAE,CAAA,CAAA,CAAA;AACxD,IAAI,IAAA,CAAC,IAAK,CAAA,UAAA,CAAW,UAAU,CAAA;AAC7B,MAAa,UAAA,GAAA,IAAA,CAAK,OAAQ,CAAA,IAAA,EAAM,UAAU,CAAA,CAAA;AAAA,GAC9C;AACA,EAAM,MAAA,GAAA,GAAM,IAAK,CAAA,OAAA,CAAQ,UAAU,CAAA,CAAA;AAEnC,EAAI,IAAA,MAAA,CAAA;AACJ,EAAA,QAAQ,GAAK;AAAA,IACX,KAAK,KAAA;AACH,MAAA,MAAA,GAAS,QAAQ,UAAU,CAAA,CAAA;AAC3B,MAAA,MAAA;AAAA,IACF,KAAK,OAAA;AACH,MAAA,OAAO,QAAQ,UAAU,CAAA,CAAA;AAAA,IAC3B,KAAK,OAAA;AACH,MAAA,OAAO,IAAK,CAAA,EAAA,CAAG,YAAa,CAAA,UAAA,EAAY,OAAO,CAAC,CAAA,CAAA;AAAA,IAClD,KAAK,KAAA;AACH,MAAA,IAAI,cAAgB,EAAA;AAClB,QAAA,OAAA,CAAQ,cAAc,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,KAAK,SAAA;AACH,MAAA,MAAA,GAAS,EAAC,CAAA;AACV,MAAA,MAAA;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;;;;"}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import e from"node:fs";import r from"node: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
|
@@ -1 +0,0 @@
|
|
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"}
|
@@ -1,24 +0,0 @@
|
|
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
|
@@ -1 +0,0 @@
|
|
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;;;;"}
|
@@ -1,2 +0,0 @@
|
|
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
|
@@ -1 +0,0 @@
|
|
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"}
|