@stacksjs/actions 0.70.34 → 0.70.36
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/src/lint/fix.js +4 -3
- package/dist/src/upgrade.js +1 -1
- package/package.json +1 -1
package/dist/src/lint/fix.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import H from"process";import{execSync as I,log as A
|
|
3
|
-
${
|
|
4
|
-
`).map((
|
|
2
|
+
import H from"process";import{execSync as I,log as A}from"@stacksjs/cli";import{projectPath as Q}from"@stacksjs/path";A.info("Ensuring Code Style...");var E=Q(),K=await M(["."],E);if(!K.ok){let m=await U(E),v=m.length>0?m:await V(E);if(v.length===0)A.warn("Full-project lint failed, and no lintable source files were found for a targeted fallback."),console.error(K.error),H.exit(1);let q=m.length>0?"changed":"tracked";A.warn(`Full-project lint failed; retrying ${v.length} ${q} file(s) without globbing.`);let z=await R(v,E);if(!z.ok)A.error("There was an error fixing your code style."),console.error(z.error),H.exit(1)}A.success("Linted");async function R(m,v){for(let z=0;z<m.length;z+=100){let G=m.slice(z,z+100),J=await M(G,v);if(!J.ok)return J}return{ok:!0}}async function M(m,v){let z=await Bun.spawn(["bunx","--bun","pickier",...m,"--fix"],{cwd:v,env:{...H.env},stdin:"inherit",stdout:"inherit",stderr:"inherit"}).exited;if(z===0)return{ok:!0};return{ok:!1,error:Error(`pickier exited with code ${z??"unknown"} for ${m.join(", ")}`)}}async function U(m){let v=await I("git diff --name-only --diff-filter=ACMR",{cwd:m,silent:!0}),q=await I("git ls-files --others --exclude-standard",{cwd:m,silent:!0}),z=`${v}
|
|
3
|
+
${q}`.split(`
|
|
4
|
+
`).map((G)=>G.trim()).filter(Boolean);return N(z)}async function V(m){let v=await I("git ls-files",{cwd:m,silent:!0});return N(v.split(`
|
|
5
|
+
`).map((q)=>q.trim()).filter(Boolean))}function N(m){let v=new Set;for(let q of m){if(!/\.(?:ts|js|json|md|ya?ml)$/.test(q))continue;if(q.includes("/dist/")||q.startsWith("dist/")||q.startsWith("node_modules/")||q.startsWith("pantry/")||q.includes("/storage/framework/cache/"))continue;v.add(q)}return[...v]}
|
package/dist/src/upgrade.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"../chunk-96b7fcmd.js";import r from"process";import{intro as b,outro as e,runCommand as d}from"@stacksjs/cli";import{NpmScript as j}from"@stacksjs/enums";import{log as k}from"@stacksjs/logging";import{projectPath as u}from"@stacksjs/path";import*as c from"@stacksjs/storage";import{ExitCode as n}from"@stacksjs/types";var i="0.70.
|
|
2
|
+
import"../chunk-96b7fcmd.js";import r from"process";import{intro as b,outro as e,runCommand as d}from"@stacksjs/cli";import{NpmScript as j}from"@stacksjs/enums";import{log as k}from"@stacksjs/logging";import{projectPath as u}from"@stacksjs/path";import*as c from"@stacksjs/storage";import{ExitCode as n}from"@stacksjs/types";var i="0.70.36";function v(s){try{console.log("checkForUncommittedChanges",s)}catch(t){console.error(t)}}async function f(s){let a=u("updates");if(c.doesFolderExist(a))await c.deleteFolder(a);k.info("Downloading framework updates..."),await d("giget stacks updates",s),k.success(`Your framework updated correctly to version: v${i}`)}async function B(){let s=await b("buddy upgrade:dependencies"),t=await d(j.UpgradeDependencies,{cwd:u()});if(t.isErr)await e("While running the upgrade:dependencies command, there was an issue",{startTime:s,useSeconds:!0},t.error),r.exit(n.FatalError);await e("Freshly updated your dependencies.",{startTime:s,useSeconds:!0}),r.exit(n.Success)}export{B as updateDependencies,f as downloadFrameworkUpdate,v as checkForUncommittedChanges};
|