initx 0.2.0 → 0.3.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/dist/cli.mjs +1 -1
- package/package.json +3 -3
package/dist/cli.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"node:process";import{detectManager as m,installManager as b,loadPlugins as f,matchPlugins as x}from"@initx-plugin/core";import{logger as n,loadingFunction as d,inquirer as v}from"@initx-plugin/utils";import w from"cac";const $={version:"0.
|
|
1
|
+
import o from"node:process";import{detectManager as m,installManager as b,loadPlugins as f,matchPlugins as x}from"@initx-plugin/core";import{logger as n,loadingFunction as d,inquirer as v}from"@initx-plugin/utils";import w from"cac";const $={version:"0.3.1"},y=/^@?initx-plugin[-/]/,u=w("initx");u.help().command("<something>","see https://github.com/initx-collective/initx").usage("").option("-v, --version","Display version number").option("-d, --debug","Debug mode");const{args:M,options:e}=u.parse();(e.h||e.help)&&o.exit(0),(e.v||e.version)&&(console.log($.version),o.exit(0)),(e.d||e.debug)&&(n.setLevel("debug"),n.debug("Debug mode enabled"));const[a,...I]=M;(!a||typeof a!="string")&&(n.error("Please enter something"),o.exit(0)),n.debug(`Input: ${a}`),(async function(){let r;await d("initx",async()=>{r=await m()}),n.debug(`Manager: ${r?"installed":"not found"}`),r||await d("Installing manager plugin",b);const s=await d("Loading plugins",f);s.length===0&&(n.error("No plugin installed"),o.exit(0)),n.debug(`Loaded ${s.length} plugins`);const c={key:a,cliOptions:e,optionsList:Object.keys(e).filter(i=>e[i]===!0).map(i=>`--${i}`)},t=await x(s,c,...I);if(n.debug(`Matched ${t.length} handlers`),t.length===0&&(n.warn("No handler found"),o.exit(0)),t.length===1){const[{handler:i,description:g}]=t;n.debug(`Running: ${g}`),await i(),o.exit(0)}const l=await v.select("Which handler do you want to run?",t.map(({description:i,packageInfo:g})=>`[${g.name.replace(y,"")}] ${i}`));(!t[l]||typeof t[l].handler!="function")&&(n.error("Handler not found"),o.exit(0));const{handler:p,description:h}=t[l];n.debug(`Running: ${h}`),await p()})();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "initx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.1",
|
|
5
5
|
"description": "A more convenient scripting engine",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/initx-collective/initx#readme",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"cac": "^7.0.0",
|
|
31
|
-
"@initx-plugin/core": "0.
|
|
32
|
-
"@initx-plugin/utils": "0.
|
|
31
|
+
"@initx-plugin/core": "0.3.1",
|
|
32
|
+
"@initx-plugin/utils": "0.3.1"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"stub": "unbuild --stub",
|