@stackone/cli 1.1.1 → 1.2.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.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const e=require(`./cliCore-
|
|
2
|
+
const e=require(`./cliCore-BxOV5Evf.cjs`),t=new e.CLI;t.run();
|
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{CLI as e}from"./cliCore-
|
|
2
|
+
import{CLI as e}from"./cliCore-B4dGs2_5.js";const t=new e;t.run();
|
|
@@ -2,4 +2,4 @@ import e from"chalk";import{Argument as t,Command as n}from"commander";import{va
|
|
|
2
2
|
`))};if(r){try{o(r)}catch{d.error(`File or directory not found: ${r}`),process.exit(1)}if(n){let{watch:t}=await import(`./esm-BenXeAeS.js`),n=await import(`readline`),o=n.createInterface({input:process.stdin,output:process.stdout});process.stdin.setRawMode(!0),process.stdin.resume(),process.stdin.setEncoding(`utf8`);let s=()=>{console.info(e.grey(`
|
|
3
3
|
|
|
4
4
|
Exiting watch mode...`)),c.close(),i.stop(),o.close(),process.exit(0)};a(),console.info(e.blue(`Running connector(s) validations...`)),await p(r),i.start();let c=t(r||`.`,{ignored:/(^|[/\\])\../,persistent:!0});c.on(`change`,async t=>{a(),i.stop(),console.info(e.blue(`File change detected. Running connector(s) validations...`)),await p(r),i.start()}),process.stdin.on(`data`,e=>{e.toString()===`q`&&s()}),process.on(`SIGINT`,()=>{s()})}else await p(r),process.exit(0)}}};const p=async e=>{let t=o(e);if(t.isDirectory()){let t=a(e),n=t.filter(e=>e.endsWith(`.s1.yaml`));if(n.length===0){d.error(`No StackOne connectors found in directory: ${e}. Connector files need to have the extension .s1.yaml.\n`);return}let r=0,i=0;for(let t of n){let n=`${e}/${t}`,a=o(n);if(a.isFile()){let e=await m(n);e?r++:i++}}d.info(`Validation completed: ${r} valid, ${i} invalid connectors.\n`)}else t.isFile()&&e.endsWith(`s1.yaml`)?await m(e):d.error(`No StackOne connector found: ${e}. Connector files need to have the extension .s1.yaml.\n`)},m=async t=>{let n=i(t,`utf8`),a=r(n),o=a?.errors??[];if(a.success){let e=t.split(`/`).pop()||t;return d.success(`Connector ${e} is valid!\n`),!0}else if(o.length>0)return d.error(`Connector ${t} is not valid. Please fix the following errors:\n`),o.forEach(t=>{console.info(e.red(`- ${t.message} | Line: ${t.line}`))}),console.info(`
|
|
5
|
-
`),!1;else return d.error(`Connector ${t} is not valid. Please check the file for errors.`),!1},h=()=>{try{let e=u(import.meta.url),t=c(e),n=l(t,`..`,`package.json`),r=JSON.parse(i(n,`utf8`));return r.version}catch{return`unknown`}};var g=class{constructor(e=new n,t=h()){this.program=e,this.version=t,this.setupProgram(),this.registerCommands()}setupProgram(){this.program.name(`stackone`).description(`StackOne
|
|
5
|
+
`),!1;else return d.error(`Connector ${t} is not valid. Please check the file for errors.`),!1},h=()=>{try{let e=u(import.meta.url),t=c(e),n=l(t,`..`,`package.json`),r=JSON.parse(i(n,`utf8`));return r.version}catch{return`unknown`}};var g=class{constructor(e=new n,t=h()){this.program=e,this.version=t,this.setupProgram(),this.registerCommands()}setupProgram(){this.program.name(`stackone`).description(`StackOne CLI`).version(this.version)}registerCommands(){let n=new f;this.program.configureOutput({writeOut:e=>process.stdout.write(e),writeErr:e=>process.stderr.write(e),outputError:(t,n)=>{n(e.red(t))}}),this.program.command(`validate`).option(`-w, --watch`,`Run in watch mode`).addArgument(new t(`<path>`,`Connector file or directory with connectors to validate`)).description(`Validate a StackOne connector`).action((e,t)=>{n.execute({watchMode:t.watch,fileOrDir:e})}),this.program.command(`version`).description(`Show version information`).action(()=>{console.info(`${e.greenBright(`StackOne`)} ${e.grey(`CLI`)} ${e.whiteBright(this.version)}`),process.exit(0)})}run(){this.program.parse(process.argv)}};export{g as CLI};
|
|
@@ -2,4 +2,4 @@ const e=require(`./chunk-CUT6urMc.cjs`),t=e.__toESM(require(`chalk`)),n=e.__toES
|
|
|
2
2
|
`))};if(r){try{(0,i.statSync)(r)}catch{c.error(`File or directory not found: ${r}`),process.exit(1)}if(n){let{watch:e}=await Promise.resolve().then(()=>require(`./esm-Chmlhd00.cjs`)),n=await import(`readline`),i=n.createInterface({input:process.stdin,output:process.stdout});process.stdin.setRawMode(!0),process.stdin.resume(),process.stdin.setEncoding(`utf8`);let a=()=>{console.info(t.default.grey(`
|
|
3
3
|
|
|
4
4
|
Exiting watch mode...`)),c.close(),o.stop(),i.close(),process.exit(0)};s(),console.info(t.default.blue(`Running connector(s) validations...`)),await u(r),o.start();let c=e(r||`.`,{ignored:/(^|[/\\])\../,persistent:!0});c.on(`change`,async e=>{s(),o.stop(),console.info(t.default.blue(`File change detected. Running connector(s) validations...`)),await u(r),o.start()}),process.stdin.on(`data`,e=>{e.toString()===`q`&&a()}),process.on(`SIGINT`,()=>{a()})}else await u(r),process.exit(0)}}};const u=async e=>{let t=(0,i.statSync)(e);if(t.isDirectory()){let t=(0,i.readdirSync)(e),n=t.filter(e=>e.endsWith(`.s1.yaml`));if(n.length===0){c.error(`No StackOne connectors found in directory: ${e}. Connector files need to have the extension .s1.yaml.\n`);return}let r=0,a=0;for(let t of n){let n=`${e}/${t}`,o=(0,i.statSync)(n);if(o.isFile()){let e=await d(n);e?r++:a++}}c.info(`Validation completed: ${r} valid, ${a} invalid connectors.\n`)}else t.isFile()&&e.endsWith(`s1.yaml`)?await d(e):c.error(`No StackOne connector found: ${e}. Connector files need to have the extension .s1.yaml.\n`)},d=async e=>{let n=(0,i.readFileSync)(e,`utf8`),a=(0,r.validateYamlConnector)(n),o=a?.errors??[];if(a.success){let t=e.split(`/`).pop()||e;return c.success(`Connector ${t} is valid!\n`),!0}else if(o.length>0)return c.error(`Connector ${e} is not valid. Please fix the following errors:\n`),o.forEach(e=>{console.info(t.default.red(`- ${e.message} | Line: ${e.line}`))}),console.info(`
|
|
5
|
-
`),!1;else return c.error(`Connector ${e} is not valid. Please check the file for errors.`),!1},f=()=>{try{let e=(0,s.fileURLToPath)(require(`url`).pathToFileURL(__filename).href),t=(0,o.dirname)(e),n=(0,o.join)(t,`..`,`package.json`),r=JSON.parse((0,i.readFileSync)(n,`utf8`));return r.version}catch{return`unknown`}};var p=class{constructor(e=new n.Command,t=f()){this.program=e,this.version=t,this.setupProgram(),this.registerCommands()}setupProgram(){this.program.name(`stackone`).description(`StackOne
|
|
5
|
+
`),!1;else return c.error(`Connector ${e} is not valid. Please check the file for errors.`),!1},f=()=>{try{let e=(0,s.fileURLToPath)(require(`url`).pathToFileURL(__filename).href),t=(0,o.dirname)(e),n=(0,o.join)(t,`..`,`package.json`),r=JSON.parse((0,i.readFileSync)(n,`utf8`));return r.version}catch{return`unknown`}};var p=class{constructor(e=new n.Command,t=f()){this.program=e,this.version=t,this.setupProgram(),this.registerCommands()}setupProgram(){this.program.name(`stackone`).description(`StackOne CLI`).version(this.version)}registerCommands(){let e=new l;this.program.configureOutput({writeOut:e=>process.stdout.write(e),writeErr:e=>process.stderr.write(e),outputError:(e,n)=>{n(t.default.red(e))}}),this.program.command(`validate`).option(`-w, --watch`,`Run in watch mode`).addArgument(new n.Argument(`<path>`,`Connector file or directory with connectors to validate`)).description(`Validate a StackOne connector`).action((t,n)=>{e.execute({watchMode:n.watch,fileOrDir:t})}),this.program.command(`version`).description(`Show version information`).action(()=>{console.info(`${t.default.greenBright(`StackOne`)} ${t.default.grey(`CLI`)} ${t.default.whiteBright(this.version)}`),process.exit(0)})}run(){this.program.parse(process.argv)}};Object.defineProperty(exports,`CLI`,{enumerable:!0,get:function(){return p}});
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./cliCore-
|
|
1
|
+
const e=require(`./cliCore-BxOV5Evf.cjs`);exports.CLI=e.CLI;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CLI as e}from"./cliCore-
|
|
1
|
+
import{CLI as e}from"./cliCore-B4dGs2_5.js";export{e as CLI};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackone/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "StackOne Connect CLI tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"lint:fix": "npm run code:check:fix",
|
|
31
31
|
"test": "FORCE_COLOR=1 vitest run",
|
|
32
32
|
"test:watch": "FORCE_COLOR=1 vitest watch --silent",
|
|
33
|
+
"test:typecheck": "tsc --noEmit --project tsconfig.tests.json",
|
|
33
34
|
"publish-release": "npm publish --access=public"
|
|
34
35
|
},
|
|
35
36
|
"keywords": [
|
|
@@ -42,10 +43,10 @@
|
|
|
42
43
|
"license": "ISC",
|
|
43
44
|
"dependencies": {
|
|
44
45
|
"@stackone/connect-sdk": "*",
|
|
45
|
-
"chalk": "
|
|
46
|
-
"commander": "
|
|
47
|
-
"inquirer": "
|
|
48
|
-
"ora": "
|
|
46
|
+
"chalk": "5.4.1",
|
|
47
|
+
"commander": "14.0.0",
|
|
48
|
+
"inquirer": "12.7.0",
|
|
49
|
+
"ora": "8.2.0"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
52
|
"tsdown": "^0.12.9"
|