@balancy/cli
Advanced tools
Comparing version 1.0.0-rc.7 to 1.0.0-rc.8
@@ -1,2 +0,2 @@ | ||
"use strict";const D=require("commander"),f=require("@balancy/core"),i=require("node:path"),t=require("node:fs"),w=require("node:util"),c=require("mkdirp"),S=require("fs"),y=require("rimraf"),F="1.0.0-rc.4",v="todo";class g{constructor(e){this.array=e}size(){return this.array.length}set(e){throw new Error("readonly array")}push_back(e){this.array.unshift(e)}get(e){return this.array[e]}resize(e,r){throw new Error("not implemented")}reserve(e){throw new Error("not implemented")}}class C{constructor(e,r){this.balancy=e,this.root=r,this.cacheDir=i.resolve(this.root,".cache"),this.cacheBinaryDir=i.resolve(this.root,".cache_binary"),this.codeDir=i.resolve(this.root,"models"),this.resourcesDir=i.resolve(this.root,"resources"),!t.existsSync(this.root)&&c.mkdirpSync(this.root),!t.existsSync(this.cacheDir)&&c.mkdirpSync(this.cacheDir),!t.existsSync(this.cacheBinaryDir)&&c.mkdirpSync(this.cacheBinaryDir),!t.existsSync(this.codeDir)&&c.mkdirpSync(this.codeDir),!t.existsSync(this.resourcesDir)&&c.mkdirpSync(this.resourcesDir)}saveFileToDir(e,r,a){const o=i.resolve(e,r),{dir:p}=i.parse(o);c.mkdirpSync(p),t.writeFileSync(o,a)}clearDir(e){t.readdirSync(e).forEach(r=>{t.lstatSync(i.resolve(e,r)).isDirectory()?y.rimrafSync(i.resolve(e,r)):t.unlinkSync(i.resolve(e,r))})}readFileFromDir(e,r){return S.readFileSync(i.resolve(e,r)).toString("utf-8")}getFilesInFolderCallback(e){const r=t.readdirSync(i.resolve(this.root,e));return new g(r)}createSubDirectoryInCacheCallback(e){c.mkdirpSync(i.resolve(this.cacheDir,e))}saveFileInCacheCallback(e,r){this.saveFileToDir(this.cacheDir,e,r)}saveFileInCacheBinaryCallback(e,r){this.saveFileToDir(this.cacheBinaryDir,e,r)}saveFileInResourcesCallback(e,r){this.saveFileToDir(this.resourcesDir,e,r)}cleanUpResourcesFolderCallback(){this.clearDir(this.resourcesDir)}cleanGeneratedCodeFolderCallback(){this.clearDir(this.codeDir)}saveGeneratedCodeCallback(e,r){this.saveFileToDir(this.codeDir,e,r)}loadFileFromCacheCallback(e){return this.readFileFromDir(this.cacheDir,e)}loadFileFromResourcesCallback(e){return this.readFileFromDir(this.resourcesDir,e)}deleteFolderCallback(e){y.rimrafSync(i.resolve(this.root,e))}deleteCachedFolderCallback(e){y.rimrafSync(i.resolve(this.cacheDir,e))}deleteCachedFileCallback(e){t.unlinkSync(i.resolve(this.cacheDir,e))}getFilesInCachedFolderCallback(e){return new g(t.readdirSync(this.cacheDir))}applyTempFolderCallback(e){throw new Error("not implemented")}}const n=i.resolve(__dirname,"../.cache");t.existsSync(n)||t.mkdirSync(n);async function k(s,e){await w.promisify(t.writeFile).bind(t.writeFile)(i.resolve(n,`${s}.json`),JSON.stringify(e,null,2))}async function b(s){t.unlinkSync(i.resolve(n,`${s}.json`))}async function q(s){if(!t.existsSync(i.resolve(n,`${s}.json`)))return null;const e=await w.promisify(t.readFile).bind(t.readFile)(i.resolve(n,`${s}.json`));return JSON.parse(e.toString())}const m=new D.Command;let d,l,u;function h(s,e){s&&(u==="json"?process.stderr.write(JSON.stringify(s)):(process.stderr.write(s.title),process.stderr.write(` | ||
"use strict";const D=require("commander"),f=require("@balancy/core"),i=require("node:path"),t=require("node:fs"),w=require("node:util"),c=require("mkdirp"),S=require("fs"),y=require("rimraf"),F="1.0.0-rc.7",v="todo";class g{constructor(e){this.array=e}size(){return this.array.length}set(e){throw new Error("readonly array")}push_back(e){this.array.unshift(e)}get(e){return this.array[e]}resize(e,r){throw new Error("not implemented")}reserve(e){throw new Error("not implemented")}}class C{constructor(e,r){this.balancy=e,this.root=r,this.cacheDir=i.resolve(this.root,".cache"),this.cacheBinaryDir=i.resolve(this.root,".cache_binary"),this.codeDir=i.resolve(this.root,"models"),this.resourcesDir=i.resolve(this.root,"resources"),!t.existsSync(this.root)&&c.mkdirpSync(this.root),!t.existsSync(this.cacheDir)&&c.mkdirpSync(this.cacheDir),!t.existsSync(this.cacheBinaryDir)&&c.mkdirpSync(this.cacheBinaryDir),!t.existsSync(this.codeDir)&&c.mkdirpSync(this.codeDir),!t.existsSync(this.resourcesDir)&&c.mkdirpSync(this.resourcesDir)}saveFileToDir(e,r,a){const o=i.resolve(e,r),{dir:p}=i.parse(o);c.mkdirpSync(p),t.writeFileSync(o,a)}clearDir(e){t.readdirSync(e).forEach(r=>{t.lstatSync(i.resolve(e,r)).isDirectory()?y.rimrafSync(i.resolve(e,r)):t.unlinkSync(i.resolve(e,r))})}readFileFromDir(e,r){return S.readFileSync(i.resolve(e,r)).toString("utf-8")}getFilesInFolderCallback(e){const r=t.readdirSync(i.resolve(this.root,e));return new g(r)}createSubDirectoryInCacheCallback(e){c.mkdirpSync(i.resolve(this.cacheDir,e))}saveFileInCacheCallback(e,r){this.saveFileToDir(this.cacheDir,e,r)}saveFileInCacheBinaryCallback(e,r){this.saveFileToDir(this.cacheBinaryDir,e,r)}saveFileInResourcesCallback(e,r){this.saveFileToDir(this.resourcesDir,e,r)}cleanUpResourcesFolderCallback(){this.clearDir(this.resourcesDir)}cleanGeneratedCodeFolderCallback(){this.clearDir(this.codeDir)}saveGeneratedCodeCallback(e,r){this.saveFileToDir(this.codeDir,e,r)}loadFileFromCacheCallback(e){return this.readFileFromDir(this.cacheDir,e)}loadFileFromResourcesCallback(e){return this.readFileFromDir(this.resourcesDir,e)}deleteFolderCallback(e){y.rimrafSync(i.resolve(this.root,e))}deleteCachedFolderCallback(e){y.rimrafSync(i.resolve(this.cacheDir,e))}deleteCachedFileCallback(e){t.unlinkSync(i.resolve(this.cacheDir,e))}getFilesInCachedFolderCallback(e){return new g(t.readdirSync(this.cacheDir))}applyTempFolderCallback(e){throw new Error("not implemented")}}const n=i.resolve(__dirname,"../.cache");t.existsSync(n)||t.mkdirSync(n);async function k(s,e){await w.promisify(t.writeFile).bind(t.writeFile)(i.resolve(n,`${s}.json`),JSON.stringify(e,null,2))}async function b(s){t.unlinkSync(i.resolve(n,`${s}.json`))}async function q(s){if(!t.existsSync(i.resolve(n,`${s}.json`)))return null;const e=await w.promisify(t.readFile).bind(t.readFile)(i.resolve(n,`${s}.json`));return JSON.parse(e.toString())}const m=new D.Command;let d,l,u;function h(s,e){s&&(u==="json"?process.stderr.write(JSON.stringify(s)):(process.stderr.write(s.title),process.stderr.write(` | ||
`+s.message)),process.exit(s.code||1)),e&&(u==="json"?process.stdout.write(JSON.stringify(e)):(process.stdout.write(e.title),e.message&&process.stdout.write(` | ||
@@ -3,0 +3,0 @@ `+e.message),e.list&&e.list.forEach(({id:r,name:a})=>{process.stdout.write(` |
{ | ||
"name": "@balancy/cli", | ||
"version": "1.0.0-rc.7", | ||
"version": "1.0.0-rc.8", | ||
"homepage": "https://balancy.co", | ||
@@ -40,3 +40,3 @@ "repository": { | ||
"dependencies": { | ||
"@balancy/core": "~1.0.0-rc.7", | ||
"@balancy/core": "~1.0.0-rc.8", | ||
"commander": "^12.1.0", | ||
@@ -43,0 +43,0 @@ "mkdirp": "^3.0.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Updated@balancy/core@~1.0.0-rc.8