initx 0.1.2 → 0.1.4

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.
Files changed (2) hide show
  1. package/dist/cli.mjs +1 -1
  2. package/package.json +8 -4
package/dist/cli.mjs CHANGED
@@ -1 +1 @@
1
- import i from"node:process";import{detectManager as h,installManager as u,loadPlugins as d,matchPlugins as f}from"@initx-plugin/core";import{log as o,loadingFunction as r,inquirer as x}from"@initx-plugin/utils";import w from"cac";const v={version:"0.1.2"},g=w("initx");g.help().command("<something>","see https://github.com/initx-collective/initx").usage("").option("-v, --version","Display version number");const{args:y,options:e}=g.parse();(e.h||e.help)&&i.exit(0),(e.v||e.version)&&(console.log(v.version),i.exit(0));const[s,...b]=y;(!s||typeof s!="string")&&(o.error("Please enter something"),i.exit(0)),(async function(){let l;await r("initx",async()=>{l=await h()}),l||await r("Installing manager plugin",u);const c=await r("Loading plugins",d);c.length===0&&(o.error("No plugin installed"),i.exit(0));const p={key:s,cliOptions:e,optionsList:Object.keys(e).filter(t=>e[t]===!0).map(t=>`--${t}`)},n=await f(c,p,...b);if(n.length===0&&(o.warn("No handler found"),i.exit(0)),n.length===1){const[{handler:t}]=n;await t(),i.exit(0)}const a=await x.select("Which handler do you want to run?",n.map(({description:t,packageInfo:m})=>`[${m.name.replace(/^@?initx-plugin[-/]/,"")}] ${t}`));(!n[a]||typeof n[a].handler!="function")&&(o.error("Handler not found"),i.exit(0)),await n[a].handler()})();
1
+ import i from"node:process";import{detectManager as h,installManager as u,loadPlugins as d,matchPlugins as f}from"@initx-plugin/core";import{log as o,loadingFunction as r,inquirer as x}from"@initx-plugin/utils";import w from"cac";const v={version:"0.1.4"},g=w("initx");g.help().command("<something>","see https://github.com/initx-collective/initx").usage("").option("-v, --version","Display version number");const{args:y,options:e}=g.parse();(e.h||e.help)&&i.exit(0),(e.v||e.version)&&(console.log(v.version),i.exit(0));const[s,...b]=y;(!s||typeof s!="string")&&(o.error("Please enter something"),i.exit(0)),(async function(){let l;await r("initx",async()=>{l=await h()}),l||await r("Installing manager plugin",u);const c=await r("Loading plugins",d);c.length===0&&(o.error("No plugin installed"),i.exit(0));const p={key:s,cliOptions:e,optionsList:Object.keys(e).filter(t=>e[t]===!0).map(t=>`--${t}`)},n=await f(c,p,...b);if(n.length===0&&(o.warn("No handler found"),i.exit(0)),n.length===1){const[{handler:t}]=n;await t(),i.exit(0)}const a=await x.select("Which handler do you want to run?",n.map(({description:t,packageInfo:m})=>`[${m.name.replace(/^@?initx-plugin[-/]/,"")}] ${t}`));(!n[a]||typeof n[a].handler!="function")&&(o.error("Handler not found"),i.exit(0)),await n[a].handler()})();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "initx",
3
3
  "type": "module",
4
- "version": "0.1.2",
4
+ "version": "0.1.4",
5
5
  "description": "A more convenient scripting engine",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/initx-collective/initx#readme",
@@ -18,14 +18,18 @@
18
18
  "main": "dist/index.mjs",
19
19
  "module": "dist/index.mjs",
20
20
  "types": "dist/index.d.ts",
21
- "bin": "bin/initx.mjs",
21
+ "bin": {
22
+ "initx": "bin/initx.mjs",
23
+ "ix": "bin/initx.mjs"
24
+ },
22
25
  "files": [
26
+ "bin",
23
27
  "dist"
24
28
  ],
25
29
  "dependencies": {
26
30
  "cac": "^6.7.14",
27
- "@initx-plugin/core": "0.1.2",
28
- "@initx-plugin/utils": "0.1.2"
31
+ "@initx-plugin/core": "0.1.4",
32
+ "@initx-plugin/utils": "0.1.4"
29
33
  },
30
34
  "scripts": {
31
35
  "stub": "unbuild --stub",