@stacksjs/actions 0.75.36 → 0.75.38
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/bump.js +4 -2
- package/dist/pantry-lock.d.ts +8 -0
- package/dist/pantry-lock.js +1 -0
- package/dist/queue/work.js +1 -1
- package/dist/schedule/run.js +1 -1
- package/package.json +38 -38
package/dist/bump.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import{execSync,log,parseOptions}from"@stacksjs/cli";import{path as p}from"@stacksjs/path";import{versionBump}from"@stacksjs/bumpx";import{isCalendarBump,nextCalendarVersion}from"./calendar-version";import{generateChangelog,loadLogsmithConfig}from"@stacksjs/logsmith";import{existsSync,readdirSync,readFileSync,unlinkSync,writeFileSync}from"node:fs";import{join,relative}from"node:path";const options=parseOptions(),allowedBumps=new Set(["patch","minor","major","prepatch","preminor","premajor","prerelease"]),rawBump=options?.bump?.toString(),bumpArg=rawBump?allowedBumps.has(rawBump)||isCalendarBump(rawBump)||/^\d+\.\d+\.\d+(?:-[\w.]+)?$/.test(rawBump)?rawBump:null:null;if(rawBump&&!bumpArg)log.warn(`Ignoring invalid --bump "${rawBump}"; expected patch|minor|major, calendar, or x.y.z`);const isDryRun=options?.dryRun===!0,isVerbose=options?.verbose===!0;async function readPackage(file){if(!existsSync(file))return;return await Bun.file(file).json()}const rootManifest=p.projectPath("package.json"),rootPkg=await readPackage(rootManifest),isFrameworkRelease=rootPkg?.name==="stacks"&&existsSync(p.frameworkPath("core/package.json")),bumpCwd=isFrameworkRelease?p.frameworkPath("core"):p.projectPath(),primaryManifest=isFrameworkRelease?p.frameworkPath("core/package.json"):rootManifest;async function resolveBumpArg(bump){if(!bump||/^\d+\.\d+\.\d+(?:-[\w.]+)?$/.test(bump))return bump;if(isCalendarBump(bump)){const pkg=await readPackage(primaryManifest);return nextCalendarVersion(pkg?.version)}if(!["patch","minor","major"].includes(bump))return bump;const match=(await readPackage(primaryManifest))?.version?.match(/^(\d+)\.(\d+)\.(\d+)$/);if(!match)return bump;const major=Number(match[1]),minor=Number(match[2]),patch=Number(match[3]);if(bump==="major")return`${major+1}.0.0`;if(bump==="minor")return`${major}.${minor+1}.0`;return`${major}.${minor}.${patch+1}`}const resolvedBumpArg=await resolveBumpArg(bumpArg);async function git(args,cwd=p.projectPath(),options={}){return await execSync(["git",...args],{cwd,stdin:"inherit",stderr:"pipe",throwOnError:options.throwOnError??!0})}async function isGitIgnored(file){return(await git(["check-ignore","--",file],p.projectPath(),{throwOnError:!1})).trim().length>0}async function readVersion(file){const pkg=await readPackage(file);if(!pkg?.version||!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(pkg.version))throw Error(`Invalid version in ${file}: ${pkg?.version??"<missing>"}`);return pkg.version}function lockfileVersion(contents){const match=contents.match(/"lockfileVersion"\s*:\s*(\d+)/);return match?Number(match[1]):null}async function packageFilesFor(pattern,cwd){const glob=new Bun.Glob(pattern),files=[];for await(const file of glob.scan({cwd,absolute:!0,onlyFiles:!0})){if(file.includes("/node_modules/")||file.includes("/dist/")||file.includes("/pantry/"))continue;files.push(`./${relative(bumpCwd,file)}`)}return files}async function existingPackageFiles(files){const existing=[];for(const file of files){const absolutePath=join(bumpCwd,file);if(await Bun.file(absolutePath).exists())existing.push(file)}return existing}async function frameworkBumpFiles(){return Array.from(new Set([...await packageFilesFor("package.json",bumpCwd),...await packageFilesFor("*/package.json",bumpCwd),...await packageFilesFor("*/*/package.json",bumpCwd),...await existingPackageFiles(["../package.json","../defaults/ide/vscode/package.json","../api/package.json","../cloud/package.json","../docs/package.json","../orm/package.json","../server/package.json"]),...await packageFilesFor("../libs/**/package.json",bumpCwd)]))}const bumpFiles=isFrameworkRelease?await frameworkBumpFiles():["./package.json"];log.debug(`Release mode: ${isFrameworkRelease?"framework monorepo":"consumer app"} (${rootPkg?.name??"unknown"})`);log.debug(`Bumping ${bumpFiles.length} package manifest(s) in ${bumpCwd}`);await versionBump({release:resolvedBumpArg??void 0,files:bumpFiles,cwd:bumpCwd,recursive:!1,commit:!1,tag:!1,push:!1,changelog:!1,noGitCheck:!0,dryRun:isDryRun,yes:Boolean(resolvedBumpArg),verbose:isVerbose});const nextVersion=isDryRun&&resolvedBumpArg&&/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(resolvedBumpArg)?resolvedBumpArg:await readVersion(primaryManifest),latestTag=(await git(["describe","--abbrev=0","--tags"],p.projectPath(),{throwOnError:!1}).catch(()=>"")).trim();async function writeChangelog(){const config=await loadLogsmithConfig({dir:p.projectPath(),from:latestTag||void 0,to:"HEAD",output:isDryRun?!1:"CHANGELOG.md",theme:"github",verbose:isVerbose}),result=await generateChangelog(config);if(isDryRun){log.info(result.content);return}const changelogPath=p.projectPath("CHANGELOG.md");if(!existsSync(changelogPath))return;let content=readFileSync(changelogPath,"utf-8");const versionSeen=new RegExp(`\\bv?${nextVersion.replace(/\./g,"\\.")}\\b`);if(/\/compare\/[^)\s]+\.\.\.HEAD\)/.test(content))content=content.replace(/(\/compare\/[^)\s]+\.\.\.)HEAD(\))/,`$1v${nextVersion}$2`);else if(!versionSeen.test(content.split(`
|
|
1
|
+
import{execSync,log,parseOptions}from"@stacksjs/cli";import{path as p}from"@stacksjs/path";import{versionBump}from"@stacksjs/bumpx";import{isCalendarBump,nextCalendarVersion}from"./calendar-version";import{pantryLockViolations}from"./pantry-lock";import{generateChangelog,loadLogsmithConfig}from"@stacksjs/logsmith";import{existsSync,readdirSync,readFileSync,unlinkSync,writeFileSync}from"node:fs";import{join,relative}from"node:path";const options=parseOptions(),allowedBumps=new Set(["patch","minor","major","prepatch","preminor","premajor","prerelease"]),rawBump=options?.bump?.toString(),bumpArg=rawBump?allowedBumps.has(rawBump)||isCalendarBump(rawBump)||/^\d+\.\d+\.\d+(?:-[\w.]+)?$/.test(rawBump)?rawBump:null:null;if(rawBump&&!bumpArg)log.warn(`Ignoring invalid --bump "${rawBump}"; expected patch|minor|major, calendar, or x.y.z`);const isDryRun=options?.dryRun===!0,isVerbose=options?.verbose===!0;async function readPackage(file){if(!existsSync(file))return;return await Bun.file(file).json()}const rootManifest=p.projectPath("package.json"),rootPkg=await readPackage(rootManifest),isFrameworkRelease=rootPkg?.name==="stacks"&&existsSync(p.frameworkPath("core/package.json")),bumpCwd=isFrameworkRelease?p.frameworkPath("core"):p.projectPath(),primaryManifest=isFrameworkRelease?p.frameworkPath("core/package.json"):rootManifest;async function resolveBumpArg(bump){if(!bump||/^\d+\.\d+\.\d+(?:-[\w.]+)?$/.test(bump))return bump;if(isCalendarBump(bump)){const pkg=await readPackage(primaryManifest);return nextCalendarVersion(pkg?.version)}if(!["patch","minor","major"].includes(bump))return bump;const match=(await readPackage(primaryManifest))?.version?.match(/^(\d+)\.(\d+)\.(\d+)$/);if(!match)return bump;const major=Number(match[1]),minor=Number(match[2]),patch=Number(match[3]);if(bump==="major")return`${major+1}.0.0`;if(bump==="minor")return`${major}.${minor+1}.0`;return`${major}.${minor}.${patch+1}`}const resolvedBumpArg=await resolveBumpArg(bumpArg);async function git(args,cwd=p.projectPath(),options={}){return await execSync(["git",...args],{cwd,stdin:"inherit",stderr:"pipe",throwOnError:options.throwOnError??!0})}async function isGitIgnored(file){return(await git(["check-ignore","--",file],p.projectPath(),{throwOnError:!1})).trim().length>0}async function readVersion(file){const pkg=await readPackage(file);if(!pkg?.version||!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(pkg.version))throw Error(`Invalid version in ${file}: ${pkg?.version??"<missing>"}`);return pkg.version}function lockfileVersion(contents){const match=contents.match(/"lockfileVersion"\s*:\s*(\d+)/);return match?Number(match[1]):null}async function packageFilesFor(pattern,cwd){const glob=new Bun.Glob(pattern),files=[];for await(const file of glob.scan({cwd,absolute:!0,onlyFiles:!0})){if(file.includes("/node_modules/")||file.includes("/dist/")||file.includes("/pantry/"))continue;files.push(`./${relative(bumpCwd,file)}`)}return files}async function existingPackageFiles(files){const existing=[];for(const file of files){const absolutePath=join(bumpCwd,file);if(await Bun.file(absolutePath).exists())existing.push(file)}return existing}async function frameworkBumpFiles(){return Array.from(new Set([...await packageFilesFor("package.json",bumpCwd),...await packageFilesFor("*/package.json",bumpCwd),...await packageFilesFor("*/*/package.json",bumpCwd),...await existingPackageFiles(["../package.json","../defaults/ide/vscode/package.json","../api/package.json","../cloud/package.json","../docs/package.json","../orm/package.json","../server/package.json"]),...await packageFilesFor("../libs/**/package.json",bumpCwd)]))}const bumpFiles=isFrameworkRelease?await frameworkBumpFiles():["./package.json"];log.debug(`Release mode: ${isFrameworkRelease?"framework monorepo":"consumer app"} (${rootPkg?.name??"unknown"})`);log.debug(`Bumping ${bumpFiles.length} package manifest(s) in ${bumpCwd}`);await versionBump({release:resolvedBumpArg??void 0,files:bumpFiles,cwd:bumpCwd,recursive:!1,commit:!1,tag:!1,push:!1,changelog:!1,noGitCheck:!0,dryRun:isDryRun,yes:Boolean(resolvedBumpArg),verbose:isVerbose});const nextVersion=isDryRun&&resolvedBumpArg&&/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(resolvedBumpArg)?resolvedBumpArg:await readVersion(primaryManifest),latestTag=(await git(["describe","--abbrev=0","--tags"],p.projectPath(),{throwOnError:!1}).catch(()=>"")).trim();async function writeChangelog(){const config=await loadLogsmithConfig({dir:p.projectPath(),from:latestTag||void 0,to:"HEAD",output:isDryRun?!1:"CHANGELOG.md",theme:"github",verbose:isVerbose}),result=await generateChangelog(config);if(isDryRun){log.info(result.content);return}const changelogPath=p.projectPath("CHANGELOG.md");if(!existsSync(changelogPath))return;let content=readFileSync(changelogPath,"utf-8");const versionSeen=new RegExp(`\\bv?${nextVersion.replace(/\./g,"\\.")}\\b`);if(/\/compare\/[^)\s]+\.\.\.HEAD\)/.test(content))content=content.replace(/(\/compare\/[^)\s]+\.\.\.)HEAD(\))/,`$1v${nextVersion}$2`);else if(!versionSeen.test(content.split(`
|
|
2
2
|
`).slice(0,4).join(`
|
|
3
3
|
`)))content=content.replace(/^(#\s.*\n+)?/,(match)=>`${match??""}## v${nextVersion}
|
|
4
4
|
|
|
5
|
-
`);writeFileSync(changelogPath,content)}await writeChangelog();if(!isDryRun&&isFrameworkRelease)pinLockstepDeps(nextVersion);async function refreshPantryLock(){const lockPath=p.projectPath("pantry.lock");if(!existsSync(lockPath))return;const previousLock=readFileSync(lockPath);try{await execSync(["pantry","install","--ignore-scripts","--quiet"],{cwd:p.projectPath(),stdin:"inherit"});if(!existsSync(lockPath))throw Error("Pantry completed without writing pantry.lock")}catch(error){writeFileSync(lockPath,previousLock);throw Error("Release aborted: Pantry could not refresh pantry.lock without lifecycle scripts. The previous lockfile was restored.",{cause:error})}
|
|
5
|
+
`);writeFileSync(changelogPath,content)}await writeChangelog();if(!isDryRun&&isFrameworkRelease)pinLockstepDeps(nextVersion);async function refreshPantryLock(){const lockPath=p.projectPath("pantry.lock");if(!existsSync(lockPath))return;const previousLock=readFileSync(lockPath);try{await execSync(["pantry","install","--ignore-scripts","--quiet"],{cwd:p.projectPath(),stdin:"inherit"});if(!existsSync(lockPath))throw Error("Pantry completed without writing pantry.lock")}catch(error){writeFileSync(lockPath,previousLock);throw Error("Release aborted: Pantry could not refresh pantry.lock without lifecycle scripts. The previous lockfile was restored.",{cause:error})}const violations=pantryLockViolations(readFileSync(lockPath,"utf8"),previousLock.toString("utf8"));if(violations.length>0){writeFileSync(lockPath,previousLock);throw Error(`Release aborted: refreshing pantry.lock produced a lockfile that does not describe this workspace, so the previous one has been restored.
|
|
6
|
+
`+violations.map((violation)=>` - ${violation}`).join(`
|
|
7
|
+
`)+"\n\nThis is platform divergence in `pantry install`, not something the version bump did. Regenerate pantry.lock on the platform CI validates against, commit that on its own, then re-run the release.")}}const bunLockPath=p.projectPath("bun.lock"),pantryLockPath=p.projectPath("pantry.lock"),committedBunLock=existsSync(bunLockPath)?readFileSync(bunLockPath):null,committedPantryLock=existsSync(pantryLockPath)?readFileSync(pantryLockPath):null;function restoreCommittedLockfiles(){if(committedBunLock)writeFileSync(bunLockPath,committedBunLock);if(committedPantryLock)writeFileSync(pantryLockPath,committedPantryLock)}if(!isDryRun)await refreshPantryLock();if(!isDryRun&&committedBunLock){const lockPath=bunLockPath,previousLock=committedBunLock;unlinkSync(lockPath);try{await execSync(["bun","install","--lockfile-only"],{cwd:p.projectPath(),stdin:"inherit"})}catch(error){restoreCommittedLockfiles();throw error}if(!existsSync(lockPath)){restoreCommittedLockfiles();throw Error("Release aborted: `bun install --lockfile-only` wrote no lockfile, so the previous one has been restored. This usually means a dependency range this bump just raised names a version that is not published yet - release that package first, then re-run.")}const expectedLockfileVersion=lockfileVersion(previousLock.toString("utf8")),regeneratedLock=readFileSync(lockPath,"utf8"),producedVersion=lockfileVersion(regeneratedLock);if(expectedLockfileVersion==null||producedVersion!==expectedLockfileVersion){restoreCommittedLockfiles();const remedy=producedVersion!=null&&expectedLockfileVersion!=null&&producedVersion>expectedLockfileVersion?"the committed lockfile predates the Bun this repository declares. Regenerate it once with that toolchain (`bun install --lockfile-only`) and commit the result as its own change, then re-run the release.":"this machine's Bun is older than the one that wrote the committed lockfile. Re-run the release with the repository's declared Bun toolchain through `pantry install`.";throw Error(`Release aborted: regenerating bun.lock produced lockfileVersion ${producedVersion??"unknown"}, but the committed one is v${expectedLockfileVersion??"unknown"} \u2014 ${remedy}`)}}function lockstepPackages(version){const names=new Set;for(const entry of readdirSync(p.frameworkPath("core"),{withFileTypes:!0})){if(!entry.isDirectory())continue;const manifest=p.frameworkPath(`core/${entry.name}/package.json`);if(!existsSync(manifest))continue;const pkg=JSON.parse(readFileSync(manifest,"utf-8"));if(pkg.name?.startsWith("@stacksjs/")&&pkg.version===version)names.add(pkg.name)}return names}function pinLockstepDeps(version){const lockstep=lockstepPackages(version),next=`^${version}`,manifests=[p.frameworkPath("core/package.json"),...readdirSync(p.frameworkPath("core"),{withFileTypes:!0}).filter((entry)=>entry.isDirectory()).map((entry)=>p.frameworkPath(`core/${entry.name}/package.json`)).filter((path)=>existsSync(path))];let pinned=0;for(const manifestPath of manifests){const manifest=JSON.parse(readFileSync(manifestPath,"utf-8"));let changed=!1;for(const field of["dependencies","devDependencies"]){const deps=manifest[field];if(!deps)continue;for(const name of Object.keys(deps)){if(!lockstep.has(name)||deps[name].startsWith("workspace:")||deps[name]===next)continue;deps[name]=next;changed=!0;pinned++}}if(changed)writeFileSync(manifestPath,`${JSON.stringify(manifest,null,2)}
|
|
6
8
|
`)}if(pinned>0)log.debug(`Pinned ${pinned} lockstep core dep(s) to ^${version}`)}async function stageReleaseArtifacts(){const pathspecs=isFrameworkRelease?[":(glob)storage/framework/**/package.json","package.json"]:["package.json"];for(const file of["CHANGELOG.md","bun.lock","pantry.lock"]){if(!existsSync(p.projectPath(file)))continue;if(await isGitIgnored(file))continue;pathspecs.push(file)}await git(["add","--",...pathspecs]);const leftover=(await git(["status","--porcelain"])).split(`
|
|
7
9
|
`).map((line)=>line.trimEnd()).filter((line)=>line&&!line.startsWith("A ")&&!line.startsWith("M "));if(leftover.length)log.warn(`Kept ${leftover.length} change(s) out of the release commit:
|
|
8
10
|
${leftover.slice(0,20).join(`
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why this lockfile must not be committed, or an empty list when it is sound.
|
|
3
|
+
*
|
|
4
|
+
* Returns messages rather than throwing so the caller can report every problem
|
|
5
|
+
* at once. An operator who fixes one pin, re-runs a long release and hits the
|
|
6
|
+
* next one learns to distrust the check.
|
|
7
|
+
*/
|
|
8
|
+
export declare function pantryLockViolations(lock: string, baseline: string | null): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const DEPENDENCY_FIELDS=["dependencies","devDependencies","peerDependencies","optionalDependencies"],UNCOMPARABLE_RANGE=/^(?:workspace|file|link|git|github|npm|catalog):/;function splitPackageKey(key){const at=key.lastIndexOf("@");if(at<=0)return null;return{name:key.slice(0,at),version:key.slice(at+1)}}function resolvedVersions(packages){const resolved=new Map;for(const key of Object.keys(packages)){const parsed=splitPackageKey(key);if(!parsed)continue;const versions=resolved.get(parsed.name);if(versions)versions.push(parsed.version);else resolved.set(parsed.name,[parsed.version])}return resolved}function systemBlockProblems(root,baseline){if(!baseline)return[];let baselineSystem;try{baselineSystem=JSON.parse(baseline).workspaces?.[""]?.system}catch{return[]}if(!baselineSystem||typeof baselineSystem!=="object")return[];const expected=baselineSystem,system=root?.system;if(!system||typeof system!=="object")return[`the root "system" block was dropped (it pinned ${Object.keys(expected).join(", ")}), so CI would have no toolchain to provision`];const present=system;return Object.keys(expected).filter((pin)=>!(pin in present)).map((pin)=>`the root "system" block lost its "${pin}" pin`)}export function pantryLockViolations(lock,baseline){let parsed;try{parsed=JSON.parse(lock)}catch(error){return[`it is not valid JSON (${error instanceof Error?error.message:String(error)})`]}const problems=[],workspaces=parsed.workspaces??{},resolved=resolvedVersions(parsed.packages??{});for(const[workspacePath,workspace]of Object.entries(workspaces))for(const field of DEPENDENCY_FIELDS){const declared=workspace[field];if(!declared||typeof declared!=="object")continue;for(const[name,range]of Object.entries(declared)){if(typeof range!=="string"||UNCOMPARABLE_RANGE.test(range))continue;const versions=resolved.get(name);if(!versions)continue;if(!versions.some((version)=>Bun.semver.satisfies(version,range)))problems.push(`${name} is pinned at ${versions.join(", ")}, which does not satisfy "${range}" declared by ${workspacePath||"the workspace root"} (${field})`)}}problems.push(...systemBlockProblems(workspaces[""],baseline));return problems}
|
package/dist/queue/work.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import process from"node:process";import{log}from"@stacksjs/logging";import{startProcessor,stopProcessor}from"@stacksjs/queue";process.on("unhandledRejection",(reason)=>{log.error(`Unhandled Rejection in queue worker: ${reason}`)});process.on("uncaughtException",(error)=>{log.error(`Uncaught Exception in queue worker: ${error.message}`)});const SHUTDOWN_GRACE_MS=Number(process.env.STACKS_QUEUE_SHUTDOWN_GRACE_MS)||1e4;let shuttingDown=!1;async function gracefulShutdown(signal){if(shuttingDown)return;shuttingDown=!0;log.info(`[queue] Worker received ${signal}, draining in-flight jobs (max ${SHUTDOWN_GRACE_MS/1000}s)\u2026`);setTimeout(()=>{console.error("[queue] Drain window exceeded - forcing worker exit.");process.exit(1)},SHUTDOWN_GRACE_MS+2000).unref();try{await stopProcessor({graceMs:SHUTDOWN_GRACE_MS})}catch(error){await log.error("[queue] Error while draining worker on shutdown:",error)}process.exit(0)}process.on("SIGTERM",()=>{gracefulShutdown("SIGTERM")});process.on("SIGINT",()=>{gracefulShutdown("SIGINT")});const options=parseArgs(),queue=options.queue,concurrency=Number(options.concurrency)||1;log.info(`Starting queue worker with ${concurrency} concurrent worker(s)...`);const result=await startProcessor(queue,{concurrency});if(result.isErr){await log.error("Failed to start queue worker:",result.error);process.exit(1)}log.success("Queue worker started successfully!");await new Promise(()=>{});function parseArgs(){const args={},argv=process.argv;for(let index=0;index<argv.length;index++){const arg=argv[index];if(!arg?.startsWith("--"))continue;const[key,inline]=arg.slice(2).split("=");if(!key)continue;if(inline!==void 0){args[key]=inline;continue}const next=argv[index+1];if(next!==void 0&&!next.startsWith("-")){args[key]=next;index++;continue}args[key]="true"}return args}
|
|
1
|
+
import process from"node:process";import{log}from"@stacksjs/logging";import{startProcessor,stopProcessor}from"@stacksjs/queue";import{injectGlobalAutoImports}from"@stacksjs/server";process.on("unhandledRejection",(reason)=>{log.error(`Unhandled Rejection in queue worker: ${reason}`)});process.on("uncaughtException",(error)=>{log.error(`Uncaught Exception in queue worker: ${error.message}`)});const SHUTDOWN_GRACE_MS=Number(process.env.STACKS_QUEUE_SHUTDOWN_GRACE_MS)||1e4;let shuttingDown=!1;async function gracefulShutdown(signal){if(shuttingDown)return;shuttingDown=!0;log.info(`[queue] Worker received ${signal}, draining in-flight jobs (max ${SHUTDOWN_GRACE_MS/1000}s)\u2026`);setTimeout(()=>{console.error("[queue] Drain window exceeded - forcing worker exit.");process.exit(1)},SHUTDOWN_GRACE_MS+2000).unref();try{await stopProcessor({graceMs:SHUTDOWN_GRACE_MS})}catch(error){await log.error("[queue] Error while draining worker on shutdown:",error)}process.exit(0)}process.on("SIGTERM",()=>{gracefulShutdown("SIGTERM")});process.on("SIGINT",()=>{gracefulShutdown("SIGINT")});const options=parseArgs(),queue=options.queue,concurrency=Number(options.concurrency)||1;await injectGlobalAutoImports();log.info(`Starting queue worker with ${concurrency} concurrent worker(s)...`);const result=await startProcessor(queue,{concurrency});if(result.isErr){await log.error("Failed to start queue worker:",result.error);process.exit(1)}log.success("Queue worker started successfully!");await new Promise(()=>{});function parseArgs(){const args={},argv=process.argv;for(let index=0;index<argv.length;index++){const arg=argv[index];if(!arg?.startsWith("--"))continue;const[key,inline]=arg.slice(2).split("=");if(!key)continue;if(inline!==void 0){args[key]=inline;continue}const next=argv[index+1];if(next!==void 0&&!next.startsWith("-")){args[key]=next;index++;continue}args[key]="true"}return args}
|
package/dist/schedule/run.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{log}from"@stacksjs/logging";import{runScheduler}from"@stacksjs/scheduler";const result=await runScheduler();if(result?.isErr){console.error(result.error);log.error("Schedule run failed",result.error)}
|
|
1
|
+
import{log}from"@stacksjs/logging";import{runScheduler}from"@stacksjs/scheduler";import{injectGlobalAutoImports}from"@stacksjs/server";await injectGlobalAutoImports();const result=await runScheduler();if(result?.isErr){console.error(result.error);log.error("Schedule run failed",result.error)}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/actions",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.38",
|
|
6
6
|
"description": "The Stacks actions.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -60,52 +60,52 @@
|
|
|
60
60
|
"prepublishOnly": "bun run build"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@stacksjs/action-runner": "0.75.
|
|
64
|
-
"@stacksjs/ai": "0.75.
|
|
65
|
-
"@stacksjs/analytics": "0.75.
|
|
66
|
-
"@stacksjs/api": "0.75.
|
|
67
|
-
"@stacksjs/auth": "0.75.
|
|
68
|
-
"@stacksjs/build": "0.75.
|
|
63
|
+
"@stacksjs/action-runner": "0.75.38",
|
|
64
|
+
"@stacksjs/ai": "0.75.38",
|
|
65
|
+
"@stacksjs/analytics": "0.75.38",
|
|
66
|
+
"@stacksjs/api": "0.75.38",
|
|
67
|
+
"@stacksjs/auth": "0.75.38",
|
|
68
|
+
"@stacksjs/build": "0.75.38",
|
|
69
69
|
"@stacksjs/bumpx": "^0.2.6",
|
|
70
70
|
"@stacksjs/bunpress": "^0.2.8",
|
|
71
|
-
"@stacksjs/cli": "0.75.
|
|
72
|
-
"@stacksjs/cloud": "0.75.
|
|
73
|
-
"@stacksjs/cms": "0.75.
|
|
71
|
+
"@stacksjs/cli": "0.75.38",
|
|
72
|
+
"@stacksjs/cloud": "0.75.38",
|
|
73
|
+
"@stacksjs/cms": "0.75.38",
|
|
74
74
|
"@stacksjs/components": "^0.2.343",
|
|
75
|
-
"@stacksjs/config": "0.75.
|
|
76
|
-
"@stacksjs/database": "0.75.
|
|
77
|
-
"@stacksjs/desktop-build": "0.75.
|
|
78
|
-
"@stacksjs/dns": "0.75.
|
|
79
|
-
"@stacksjs/enums": "0.75.
|
|
80
|
-
"@stacksjs/env": "0.75.
|
|
81
|
-
"@stacksjs/error-handling": "0.75.
|
|
75
|
+
"@stacksjs/config": "0.75.38",
|
|
76
|
+
"@stacksjs/database": "0.75.38",
|
|
77
|
+
"@stacksjs/desktop-build": "0.75.38",
|
|
78
|
+
"@stacksjs/dns": "0.75.38",
|
|
79
|
+
"@stacksjs/enums": "0.75.38",
|
|
80
|
+
"@stacksjs/env": "0.75.38",
|
|
81
|
+
"@stacksjs/error-handling": "0.75.38",
|
|
82
82
|
"@stacksjs/gitit": "^0.2.5",
|
|
83
|
-
"@stacksjs/i18n": "0.75.
|
|
84
|
-
"@stacksjs/image": "0.75.
|
|
85
|
-
"@stacksjs/logging": "0.75.
|
|
83
|
+
"@stacksjs/i18n": "0.75.38",
|
|
84
|
+
"@stacksjs/image": "0.75.38",
|
|
85
|
+
"@stacksjs/logging": "0.75.38",
|
|
86
86
|
"@stacksjs/logsmith": "^0.2.3",
|
|
87
|
-
"@stacksjs/orm": "0.75.
|
|
88
|
-
"@stacksjs/path": "0.75.
|
|
89
|
-
"@stacksjs/payments": "0.75.
|
|
90
|
-
"@stacksjs/queue": "0.75.
|
|
91
|
-
"@stacksjs/registry": "0.75.
|
|
92
|
-
"@stacksjs/router": "0.75.
|
|
87
|
+
"@stacksjs/orm": "0.75.38",
|
|
88
|
+
"@stacksjs/path": "0.75.38",
|
|
89
|
+
"@stacksjs/payments": "0.75.38",
|
|
90
|
+
"@stacksjs/queue": "0.75.38",
|
|
91
|
+
"@stacksjs/registry": "0.75.38",
|
|
92
|
+
"@stacksjs/router": "0.75.38",
|
|
93
93
|
"@stacksjs/rpx": "^0.11.54",
|
|
94
|
-
"@stacksjs/scheduler": "0.75.
|
|
95
|
-
"@stacksjs/search-engine": "0.75.
|
|
96
|
-
"@stacksjs/security": "0.75.
|
|
97
|
-
"@stacksjs/server": "0.75.
|
|
98
|
-
"@stacksjs/sites": "0.75.
|
|
99
|
-
"@stacksjs/storage": "0.75.
|
|
100
|
-
"@stacksjs/strings": "0.75.
|
|
94
|
+
"@stacksjs/scheduler": "0.75.38",
|
|
95
|
+
"@stacksjs/search-engine": "0.75.38",
|
|
96
|
+
"@stacksjs/security": "0.75.38",
|
|
97
|
+
"@stacksjs/server": "0.75.38",
|
|
98
|
+
"@stacksjs/sites": "0.75.38",
|
|
99
|
+
"@stacksjs/storage": "0.75.38",
|
|
100
|
+
"@stacksjs/strings": "0.75.38",
|
|
101
101
|
"@stacksjs/stx": "^0.2.343",
|
|
102
102
|
"@stacksjs/tlsx": "^0.13.19",
|
|
103
103
|
"@stacksjs/ts-cloud": "^0.16.15",
|
|
104
104
|
"@stacksjs/ts-md": "^0.1.1",
|
|
105
|
-
"@stacksjs/tunnel": "0.75.
|
|
106
|
-
"@stacksjs/types": "0.75.
|
|
107
|
-
"@stacksjs/utils": "0.75.
|
|
108
|
-
"@stacksjs/whois": "0.75.
|
|
105
|
+
"@stacksjs/tunnel": "0.75.38",
|
|
106
|
+
"@stacksjs/types": "0.75.38",
|
|
107
|
+
"@stacksjs/utils": "0.75.38",
|
|
108
|
+
"@stacksjs/whois": "0.75.38",
|
|
109
109
|
"bun-plugin-stx": "^0.2.343"
|
|
110
110
|
},
|
|
111
111
|
"peerDependencies": {
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|
|
124
|
-
"@stacksjs/validation": "0.75.
|
|
124
|
+
"@stacksjs/validation": "0.75.38",
|
|
125
125
|
"better-dx": "^0.2.24"
|
|
126
126
|
}
|
|
127
127
|
}
|