@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.
@@ -1,4 +1,5 @@
1
1
  // @bun
2
- import H from"process";import{execSync as I,log as A,parseOptions as V,runCommand as K}from"@stacksjs/cli";import{NpmScript as W}from"@stacksjs/enums";import{projectPath as E}from"@stacksjs/path";A.info("Ensuring Code Style...");var M=V(),J=await K(W.LintFix,{cwd:E(),...M});if(J.isErr){let z=await X(E());if(z.length===0)A.warn("Full-project lint failed, and no changed source files were found for a targeted fallback."),console.error(J.error),H.exit(1);A.warn(`Full-project lint failed; retrying only ${z.length} changed file(s).`);let B=await K(`bunx --bun pickier ${z.map(Y).join(" ")} --fix`,{cwd:E(),...M});if(B.isErr)A.error("There was an error fixing your code style."),console.error(B.error),H.exit(1)}A.success("Linted");async function X(z){let B=await I("git diff --name-only --diff-filter=ACMR",{cwd:z,silent:!0}),R=await I("git ls-files --others --exclude-standard",{cwd:z,silent:!0}),U=`${B}
3
- ${R}`.split(`
4
- `).map((q)=>q.trim()).filter(Boolean),G=new Set;for(let q of U){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;G.add(q)}return[...G]}function Y(z){return`'${z.replaceAll("'","'\\''")}'`}
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]}
@@ -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.34";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};
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};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/actions",
3
3
  "type": "module",
4
- "version": "0.70.34",
4
+ "version": "0.70.36",
5
5
  "description": "The Stacks actions.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": [