@stacksjs/actions 0.74.16 → 0.74.18
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/build/core.js +1 -1
- package/dist/domains/add.js +1 -1
- package/dist/make.js +1 -1
- package/dist/queue/work.js +1 -1
- package/dist/release.js +1 -1
- package/package.json +40 -40
package/dist/build/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$}from"bun";import{existsSync,readFileSync,statSync}from"node:fs";import{basename}from"node:path";import process from"node:process";import{dim,italic,log}from"@stacksjs/cli";import{feature}from"@stacksjs/config";import{corePath}from"@stacksjs/path";import{glob}from"@stacksjs/storage";import{ExitCode}from"@stacksjs/types";log.info("Building core packages");const FEATURE_GATED_PACKAGES={cms:"cms",commerce:"commerce",queue:"queue",realtime:"realtime"},allEntries=(await glob([corePath("*")],{onlyFiles:!1})).sort(),dirs=allEntries.filter((entry)=>{if(!existsSync(entry)||!statSync(entry).isDirectory())return!1;const pkgPath=`${entry}/package.json`;if(!existsSync(pkgPath))return!1;const name=basename(entry),gate=FEATURE_GATED_PACKAGES[name];if(gate&&!feature(gate)){log.info(`Skipping ${italic(dim(entry))} - feature '${gate}' is disabled`);return!1}try{return typeof JSON.parse(readFileSync(pkgPath,"utf8")).scripts?.build==="string"}catch(error){log.warn(`Skipping ${italic(dim(entry))}: package.json could not be read`);return!1}});if(dirs.length===0){await log.info("No core packages found");process.exit(ExitCode.FatalError)}const failed=[];for(const folder of dirs){log.info(`\uD83C\uDFD7\uFE0F Building ${italic(dim(folder))}`);try{$.cwd(folder);await $`bun run build`;log.success(`${italic(dim(folder))} built`)}catch(error){log.warn(`Failed to build ${italic(dim(folder))}, continuing with the rest...`);failed.push(folder)}console.log("")}if(failed.length>0){await log.error(`${failed.length} package(s) failed to build:`);for(const f of failed)await log.error(` - ${f}`);process.exit(ExitCode.FatalError)}
|
|
1
|
+
import{$}from"bun";import{existsSync,readFileSync,statSync}from"node:fs";import{basename}from"node:path";import process from"node:process";import{dim,italic,log}from"@stacksjs/cli";import{feature}from"@stacksjs/config";import{corePath}from"@stacksjs/path";import{glob}from"@stacksjs/storage";import{ExitCode}from"@stacksjs/types";log.info("Building core packages");const FEATURE_GATED_PACKAGES={cms:"cms",commerce:"commerce",queue:"queue",realtime:"realtime"},allEntries=(await glob([corePath("*")],{onlyFiles:!1})).sort(),dirs=allEntries.filter((entry)=>{if(!existsSync(entry)||!statSync(entry).isDirectory())return!1;const pkgPath=`${entry}/package.json`;if(!existsSync(pkgPath))return!1;const name=basename(entry),gate=FEATURE_GATED_PACKAGES[name];if(gate&&!feature(gate)){log.info(`Skipping ${italic(dim(entry))} - feature '${gate}' is disabled`);return!1}try{return typeof JSON.parse(readFileSync(pkgPath,"utf8")).scripts?.build==="string"}catch(error){log.warn(`Skipping ${italic(dim(entry))}: package.json could not be read`);return!1}});if(dirs.length===0){await log.flush();await log.info("No core packages found");process.exit(ExitCode.FatalError)}const failed=[];for(const folder of dirs){log.info(`\uD83C\uDFD7\uFE0F Building ${italic(dim(folder))}`);try{$.cwd(folder);await $`bun run build`;log.success(`${italic(dim(folder))} built`)}catch(error){log.warn(`Failed to build ${italic(dim(folder))}, continuing with the rest...`);failed.push(folder)}console.log("")}if(failed.length>0){await log.error(`${failed.length} package(s) failed to build:`);for(const f of failed)await log.error(` - ${f}`);process.exit(ExitCode.FatalError)}
|
package/dist/domains/add.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import process from"node:process";import{italic,log,parseOptions,runCommand}from"@stacksjs/cli";import{createHostedZone,getHostedZoneNameservers,updateNameservers}from"@stacksjs/dns";import{loadEnv}from"@stacksjs/env";import{handleError}from"@stacksjs/error-handling";import{projectConfigPath}from"@stacksjs/path";import{whois}from"@stacksjs/whois";loadEnv({path:[".env",".env.production"],overload:!0});const options=parseOptions();function normalizeDomain(url){if(!url)return;return url.replace(/^https?:\/\//,"").replace(/\/$/,"")}const domain=normalizeDomain(options.domain??process.env.APP_URL);if(!domain){await log.error("There was no Domain or App URL provided. Please provide a domain using the --domain flag or add a url to your app config.");process.exit(1)}const result=await createHostedZone(domain);if(result.isErr){handleError(result.error);process.exit(1)}const nameServers=await getHostedZoneNameservers(domain);if(!nameServers||nameServers.length===0){handleError(`No nameservers found for domain: ${domain}. Please ensure the Hosted Zone exists in Route53.`);process.exit(1)}await updateNameservers(nameServers);const registrar=(await whois(domain,!0)).parsedData.Registrar;if(registrar.includes("Amazon")){if(options.deploy)await runCommand("buddy deploy");else{log.info("");log.info("You can now continue your deployment process by re-running:");log.info("");log.info(` \u27A1\uFE0F ${italic("buddy deploy")}`);log.info("")}process.exit(0)}log.info("");log.info("\u2139\uFE0F Please note, before continuing your deployment process,");log.info(` update your ${registrar} nameservers to the following:`);const emojis=["1\uFE0F\u20E3","2\uFE0F\u20E3","3\uFE0F\u20E3","4\uFE0F\u20E3"];log.info("");nameServers.forEach((nameserver,index)=>{log.info(` ${emojis[index]} Nameserver: ${nameserver}`)});log.info("");log.info(italic(`stored in ${projectConfigPath("dns.ts")}`));log.info("");log.info("Once the nameservers have been updated, re-run the following command:");log.info("");log.info(` \u27A1\uFE0F ${italic("buddy deploy")}`);log.info("");
|
|
1
|
+
import process from"node:process";import{italic,log,parseOptions,runCommand}from"@stacksjs/cli";import{createHostedZone,getHostedZoneNameservers,updateNameservers}from"@stacksjs/dns";import{loadEnv}from"@stacksjs/env";import{handleError}from"@stacksjs/error-handling";import{projectConfigPath}from"@stacksjs/path";import{whois}from"@stacksjs/whois";loadEnv({path:[".env",".env.production"],overload:!0});const options=parseOptions();function normalizeDomain(url){if(!url)return;return url.replace(/^https?:\/\//,"").replace(/\/$/,"")}const domain=normalizeDomain(options.domain??process.env.APP_URL);if(!domain){await log.error("There was no Domain or App URL provided. Please provide a domain using the --domain flag or add a url to your app config.");process.exit(1)}const result=await createHostedZone(domain);if(result.isErr){handleError(result.error);process.exit(1)}const nameServers=await getHostedZoneNameservers(domain);if(!nameServers||nameServers.length===0){handleError(`No nameservers found for domain: ${domain}. Please ensure the Hosted Zone exists in Route53.`);process.exit(1)}await updateNameservers(nameServers);const registrar=(await whois(domain,!0)).parsedData.Registrar;if(registrar.includes("Amazon")){if(options.deploy)await runCommand("buddy deploy");else{log.info("");log.info("You can now continue your deployment process by re-running:");log.info("");log.info(` \u27A1\uFE0F ${italic("buddy deploy")}`);log.info("")}await log.flush();process.exit(0)}log.info("");log.info("\u2139\uFE0F Please note, before continuing your deployment process,");log.info(` update your ${registrar} nameservers to the following:`);const emojis=["1\uFE0F\u20E3","2\uFE0F\u20E3","3\uFE0F\u20E3","4\uFE0F\u20E3"];log.info("");nameServers.forEach((nameserver,index)=>{log.info(` ${emojis[index]} Nameserver: ${nameserver}`)});log.info("");log.info(italic(`stored in ${projectConfigPath("dns.ts")}`));log.info("");log.info("Once the nameservers have been updated, re-run the following command:");log.info("");log.info(` \u27A1\uFE0F ${italic("buddy deploy")}`);log.info("");
|
package/dist/make.js
CHANGED
|
@@ -21,4 +21,4 @@ export function ${factoryName}(): Partial<${modelName}Model> {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export default ${factoryName}
|
|
24
|
-
`;await writeOrPreview(factoryPath,content);log.success(`Created factory: ${factoryPath}`)}catch(error){log.error(`Failed to create factory ${factoryName}`,error);throw error}}export async function makeNotification(options){try{const name=requireName(options,"notification");log.info(`Creating your ${italic(name)} notification...`);await createNotification(options);log.success(`Created ${italic(name)} notification`)}catch(error){await log.error("There was an error creating your notification",error);process.exit(ExitCode.FatalError)}}export async function createMail(options){const rawName=String(options.name||"").trim();if(!rawName){log.error("A mail name is required (e.g. `buddy make:mail OrderShipped`).");return!1}const className=pascalCase(rawName),kebabName=kebabCase(rawName),mailPath=p.userMailPath(`${className}.ts`),templatePath=p.userEmailsPath(`${kebabName}.stx`);if(!options.force){if(existsSync(mailPath)){console.error(`${italic(mailPath)} already exists - re-run with --force to overwrite.`);return!1}if(existsSync(templatePath)){console.error(`${italic(templatePath)} already exists - re-run with --force to overwrite.`);return!1}}if(!doesFolderExist(p.userMailPath()))await createFolder(p.userMailPath());if(!doesFolderExist(p.userEmailsPath()))await createFolder(p.userEmailsPath());try{await createFileWithTemplate(mailPath,"mail",className,kebabName);await createFileWithTemplate(templatePath,"mailTemplate",className,kebabName);return!0}catch(error){handleError("Error creating mailable",error);return!1}}export async function makeMail(options){try{const name=requireName(options,"mail");log.info(`Creating your ${italic(name)} mailable...`);if(!await createMail(options))process.exit(ExitCode.FatalError);log.success(`Created ${italic(pascalCase(name))} mailable + ${italic(kebabCase(name))}.stx template`)}catch(error){await log.error("There was an error creating your mailable",error);process.exit(ExitCode.FatalError)}}export async function makePage(options){try{const name=requireName(options,"page");log.info("Creating your page...");await createPage(options);log.success(`Created ${name} page`)}catch(error){await log.error("There was an error creating your page",error);process.exit(ExitCode.FatalError)}}export async function createPage(options){const name=requireName(options,"page");await createFileWithTemplate(p.userViewsPath(pageFileName(name)),"page",name)}export function pageFileName(name){return`${name}.stx`}export async function makeFunction(options){try{const name=requireName(options,"function");log.info("Creating your function...");await createFunction(options);log.success(`Created ${name} function`)}catch(error){await log.error("There was an error creating your function",error);process.exit(ExitCode.FatalError)}}export async function createFunction(options){const name=requireName(options,"function");await createFileWithTemplate(p.userFunctionsPath(`${name}.ts`),"function",camelCase(name))}export async function makeLanguage(options){try{const name=requireName(options,"language");log.info("Creating your translation file...");await createLanguage(options);log.success(`Created ${name} translation file`)}catch(error){await log.error("There was an error creating your language.",error);process.exit(ExitCode.FatalError)}}export async function createLanguage(options){const name=requireName(options,"language");await createFileWithTemplate(p.resourcesPath(`lang/${name}.yml`),"language",name)}export async function makeStack(options){try{const name=requireName(options,"stack");log.info(`Creating your ${name} stack...`);const stackDir=resolve(process.cwd(),name);if(doesFolderExist(stackDir)){await log.error(`Directory "${name}" already exists`);process.exit(ExitCode.FatalError)}await createFolder(stackDir);const dirs=["app/Actions","app/Models","config","database/migrations","resources/views","resources/components","resources/functions","resources/partials","routes","public"];for(const dir of dirs)await createFolder(resolve(stackDir,dir));const shortName=name.replace(/^@[^/]+\//,"").replace(/-stack$/,"");await createFileWithTemplate(resolve(stackDir,"package.json"),"stackPackageJson",name,shortName);log.success(`Successfully scaffolded your "${name}" stack`);log.info("");log.info(` cd ${name}`);log.info(" # Add your models, actions, views, etc.");log.info(" # Push the repository, then submit its GitHub source to the Stacks registry.");log.info("");log.info(" Users install it with:");log.info(` buddy add ${shortName}`)}catch(error){await log.error("There was an error creating your stack",error);process.exit(ExitCode.FatalError)}}export async function createNotification(options){const name=requireName(options,"stack");try{let importOption="EmailOptions";if(!doesFolderExist("notifications"))await createFolder("./notifications");if(options.chat)importOption="ChatOptions";if(options.sms)importOption="SMSOptions";await createFileWithTemplate(p.userNotificationsPath(`${name}.ts`),"notification",importOption);return!0}catch(error){handleError("Error creating notification",error);return!1}}export async function createMigration(options){const optionName=options.name;if(!optionName)throw Error("options.name is required and cannot be empty");const fileName=`${Date.now()}-${kebabCase(optionName)}.sql`,path=p.userMigrationsPath(fileName),snake=kebabCase(optionName).replace(/-/g,"_"),table=/^create_(.+)_table$/.exec(snake)?.[1]??"table_name",driver=(process.env.DB_CONNECTION||"sqlite").toLowerCase(),mysqlLike=driver==="mysql"||driver==="singlestore",tableIdentifier=mysqlLike?`\`${table}\``:`"${table}"`,primaryKey=driver==="postgres"?'"id" BIGSERIAL PRIMARY KEY':mysqlLike?"`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY":'"id" INTEGER PRIMARY KEY AUTOINCREMENT';try{await createFileWithTemplate(path,"migration",tableIdentifier,primaryKey);log.success(`Migration created: ${italic(`database/migrations/${fileName}`)}`)}catch(error){log.error(error)}}export async function makeQueueTable(){await runAction(Action.QueueTable)}export async function makeCertificate(){const domain=await localUrl();log.info("Creating SSL certificate...");await runCommand(`tlsx ${domain}`,{cwd:p.storagePath("keys")});log.success("Certificate created");log.info("Installing SSL certificate...");await runCommand("tlsx -install",{cwd:p.storagePath("keys")});log.success("Certificate installed")}export async function createModel(options){const optionName=options.name;if(!optionName)throw Error("options.name is required and cannot be empty");const name=optionName.charAt(0).toUpperCase()+optionName.slice(1),tableName=name.replace(/([A-Z])/g,"_$1").toLowerCase().replace(/^_/,"").replace(/([^s])$/,"$1s"),path=p.userModelsPath(`${name}.ts`);try{await createFileWithTemplate(path,"model",name,tableName);log.success(`Model created: ${italic(`app/Models/${name}.ts`)}`)}catch(error){log.error(error)}}export async function createMiddleware(options){const name=requireName(options,"certificate");await createFileWithTemplate(p.userMiddlewarePath(`${name}.ts`),"middleware",name)}
|
|
24
|
+
`;await writeOrPreview(factoryPath,content);log.success(`Created factory: ${factoryPath}`)}catch(error){log.error(`Failed to create factory ${factoryName}`,error);throw error}}export async function makeNotification(options){try{const name=requireName(options,"notification");log.info(`Creating your ${italic(name)} notification...`);await createNotification(options);log.success(`Created ${italic(name)} notification`)}catch(error){await log.error("There was an error creating your notification",error);process.exit(ExitCode.FatalError)}}export async function createMail(options){const rawName=String(options.name||"").trim();if(!rawName){log.error("A mail name is required (e.g. `buddy make:mail OrderShipped`).");return!1}const className=pascalCase(rawName),kebabName=kebabCase(rawName),mailPath=p.userMailPath(`${className}.ts`),templatePath=p.userEmailsPath(`${kebabName}.stx`);await log.flush();if(!options.force){if(existsSync(mailPath)){console.error(`${italic(mailPath)} already exists - re-run with --force to overwrite.`);return!1}if(existsSync(templatePath)){console.error(`${italic(templatePath)} already exists - re-run with --force to overwrite.`);return!1}}if(!doesFolderExist(p.userMailPath()))await createFolder(p.userMailPath());if(!doesFolderExist(p.userEmailsPath()))await createFolder(p.userEmailsPath());try{await createFileWithTemplate(mailPath,"mail",className,kebabName);await createFileWithTemplate(templatePath,"mailTemplate",className,kebabName);return!0}catch(error){handleError("Error creating mailable",error);return!1}}export async function makeMail(options){try{const name=requireName(options,"mail");log.info(`Creating your ${italic(name)} mailable...`);if(!await createMail(options))process.exit(ExitCode.FatalError);log.success(`Created ${italic(pascalCase(name))} mailable + ${italic(kebabCase(name))}.stx template`)}catch(error){await log.error("There was an error creating your mailable",error);process.exit(ExitCode.FatalError)}}export async function makePage(options){try{const name=requireName(options,"page");log.info("Creating your page...");await createPage(options);log.success(`Created ${name} page`)}catch(error){await log.error("There was an error creating your page",error);process.exit(ExitCode.FatalError)}}export async function createPage(options){const name=requireName(options,"page");await createFileWithTemplate(p.userViewsPath(pageFileName(name)),"page",name)}export function pageFileName(name){return`${name}.stx`}export async function makeFunction(options){try{const name=requireName(options,"function");log.info("Creating your function...");await createFunction(options);log.success(`Created ${name} function`)}catch(error){await log.error("There was an error creating your function",error);process.exit(ExitCode.FatalError)}}export async function createFunction(options){const name=requireName(options,"function");await createFileWithTemplate(p.userFunctionsPath(`${name}.ts`),"function",camelCase(name))}export async function makeLanguage(options){try{const name=requireName(options,"language");log.info("Creating your translation file...");await createLanguage(options);log.success(`Created ${name} translation file`)}catch(error){await log.error("There was an error creating your language.",error);process.exit(ExitCode.FatalError)}}export async function createLanguage(options){const name=requireName(options,"language");await createFileWithTemplate(p.resourcesPath(`lang/${name}.yml`),"language",name)}export async function makeStack(options){try{const name=requireName(options,"stack");log.info(`Creating your ${name} stack...`);const stackDir=resolve(process.cwd(),name);if(doesFolderExist(stackDir)){await log.error(`Directory "${name}" already exists`);process.exit(ExitCode.FatalError)}await createFolder(stackDir);const dirs=["app/Actions","app/Models","config","database/migrations","resources/views","resources/components","resources/functions","resources/partials","routes","public"];for(const dir of dirs)await createFolder(resolve(stackDir,dir));const shortName=name.replace(/^@[^/]+\//,"").replace(/-stack$/,"");await createFileWithTemplate(resolve(stackDir,"package.json"),"stackPackageJson",name,shortName);log.success(`Successfully scaffolded your "${name}" stack`);log.info("");log.info(` cd ${name}`);log.info(" # Add your models, actions, views, etc.");log.info(" # Push the repository, then submit its GitHub source to the Stacks registry.");log.info("");log.info(" Users install it with:");log.info(` buddy add ${shortName}`)}catch(error){await log.error("There was an error creating your stack",error);process.exit(ExitCode.FatalError)}}export async function createNotification(options){const name=requireName(options,"stack");try{let importOption="EmailOptions";if(!doesFolderExist("notifications"))await createFolder("./notifications");if(options.chat)importOption="ChatOptions";if(options.sms)importOption="SMSOptions";await createFileWithTemplate(p.userNotificationsPath(`${name}.ts`),"notification",importOption);return!0}catch(error){handleError("Error creating notification",error);return!1}}export async function createMigration(options){const optionName=options.name;if(!optionName)throw Error("options.name is required and cannot be empty");const fileName=`${Date.now()}-${kebabCase(optionName)}.sql`,path=p.userMigrationsPath(fileName),snake=kebabCase(optionName).replace(/-/g,"_"),table=/^create_(.+)_table$/.exec(snake)?.[1]??"table_name",driver=(process.env.DB_CONNECTION||"sqlite").toLowerCase(),mysqlLike=driver==="mysql"||driver==="singlestore",tableIdentifier=mysqlLike?`\`${table}\``:`"${table}"`,primaryKey=driver==="postgres"?'"id" BIGSERIAL PRIMARY KEY':mysqlLike?"`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY":'"id" INTEGER PRIMARY KEY AUTOINCREMENT';try{await createFileWithTemplate(path,"migration",tableIdentifier,primaryKey);log.success(`Migration created: ${italic(`database/migrations/${fileName}`)}`)}catch(error){log.error(error)}}export async function makeQueueTable(){await runAction(Action.QueueTable)}export async function makeCertificate(){const domain=await localUrl();log.info("Creating SSL certificate...");await runCommand(`tlsx ${domain}`,{cwd:p.storagePath("keys")});log.success("Certificate created");log.info("Installing SSL certificate...");await runCommand("tlsx -install",{cwd:p.storagePath("keys")});log.success("Certificate installed")}export async function createModel(options){const optionName=options.name;if(!optionName)throw Error("options.name is required and cannot be empty");const name=optionName.charAt(0).toUpperCase()+optionName.slice(1),tableName=name.replace(/([A-Z])/g,"_$1").toLowerCase().replace(/^_/,"").replace(/([^s])$/,"$1s"),path=p.userModelsPath(`${name}.ts`);try{await createFileWithTemplate(path,"model",name,tableName);log.success(`Model created: ${italic(`app/Models/${name}.ts`)}`)}catch(error){log.error(error)}}export async function createMiddleware(options){const name=requireName(options,"certificate");await createFileWithTemplate(p.userMiddlewarePath(`${name}.ts`),"middleware",name)}
|
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(()=>{
|
|
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}
|
package/dist/release.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOptions}from"@stacksjs/cli";import{app}from"@stacksjs/config";import{Action}from"@stacksjs/enums";import{log}from"@stacksjs/logging";import{projectPath}from"@stacksjs/path";import{runActions}from".";import{BYPASS_ENV,formatPreflightFailure,runPinnedChecks}from"./release-preflight";const raw=parseOptions()??{},passthrough={};for(const[k,v]of Object.entries(raw)){if(k==="--"||k==="_")continue;passthrough[k]=v}const isDryRun=passthrough.dryRun===!0||passthrough.dryRun==="true",actions=[Action.GenerateLibraryEntries,Action.Bump],preflight=await runPinnedChecks({cwd:projectPath()});if(preflight.bypassed)log.warn(`${BYPASS_ENV} is set, so the pinned checks were skipped for this release.`);else if(preflight.failures.length>0)await log.exit(formatPreflightFailure(preflight.failures),1)
|
|
1
|
+
import{parseOptions}from"@stacksjs/cli";import{app}from"@stacksjs/config";import{Action}from"@stacksjs/enums";import{log}from"@stacksjs/logging";import{projectPath}from"@stacksjs/path";import{runActions}from".";import{BYPASS_ENV,formatPreflightFailure,runPinnedChecks}from"./release-preflight";const raw=parseOptions()??{},passthrough={};for(const[k,v]of Object.entries(raw)){if(k==="--"||k==="_")continue;passthrough[k]=v}const isDryRun=passthrough.dryRun===!0||passthrough.dryRun==="true",actions=[Action.GenerateLibraryEntries,Action.Bump],preflight=await runPinnedChecks({cwd:projectPath()});if(preflight.bypassed)log.warn(`${BYPASS_ENV} is set, so the pinned checks were skipped for this release.`);else if(preflight.failures.length>0){await log.flush();await log.exit(formatPreflightFailure(preflight.failures),1)}const result=await runActions(actions,{cwd:projectPath(),...passthrough});if(result&&result.isErr)await log.exit(`Release failed: ${result.error?.message??String(result.error)}`,1);log.success(isDryRun?`Dry run complete for ${app.name}. Nothing was committed, tagged or pushed.`:`Successfully released ${app.name}`);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/actions",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.74.
|
|
5
|
+
"version": "0.74.18",
|
|
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.74.
|
|
64
|
-
"@stacksjs/ai": "0.74.
|
|
65
|
-
"@stacksjs/analytics": "0.74.
|
|
66
|
-
"@stacksjs/api": "0.74.
|
|
67
|
-
"@stacksjs/auth": "0.74.
|
|
68
|
-
"@stacksjs/build": "0.74.
|
|
63
|
+
"@stacksjs/action-runner": "0.74.18",
|
|
64
|
+
"@stacksjs/ai": "0.74.18",
|
|
65
|
+
"@stacksjs/analytics": "0.74.18",
|
|
66
|
+
"@stacksjs/api": "0.74.18",
|
|
67
|
+
"@stacksjs/auth": "0.74.18",
|
|
68
|
+
"@stacksjs/build": "0.74.18",
|
|
69
69
|
"@stacksjs/bumpx": "^0.2.6",
|
|
70
70
|
"@stacksjs/bunpress": "^0.2.8",
|
|
71
|
-
"@stacksjs/cli": "0.74.
|
|
72
|
-
"@stacksjs/cloud": "0.74.
|
|
73
|
-
"@stacksjs/cms": "0.74.
|
|
74
|
-
"@stacksjs/config": "0.74.
|
|
75
|
-
"@stacksjs/database": "0.74.
|
|
76
|
-
"@stacksjs/desktop-build": "0.74.
|
|
77
|
-
"@stacksjs/dns": "0.74.
|
|
78
|
-
"@stacksjs/enums": "0.74.
|
|
79
|
-
"@stacksjs/env": "0.74.
|
|
80
|
-
"@stacksjs/error-handling": "0.74.
|
|
71
|
+
"@stacksjs/cli": "0.74.18",
|
|
72
|
+
"@stacksjs/cloud": "0.74.18",
|
|
73
|
+
"@stacksjs/cms": "0.74.18",
|
|
74
|
+
"@stacksjs/config": "0.74.18",
|
|
75
|
+
"@stacksjs/database": "0.74.18",
|
|
76
|
+
"@stacksjs/desktop-build": "0.74.18",
|
|
77
|
+
"@stacksjs/dns": "0.74.18",
|
|
78
|
+
"@stacksjs/enums": "0.74.18",
|
|
79
|
+
"@stacksjs/env": "0.74.18",
|
|
80
|
+
"@stacksjs/error-handling": "0.74.18",
|
|
81
81
|
"@stacksjs/gitit": "^0.2.5",
|
|
82
|
-
"@stacksjs/i18n": "0.74.
|
|
83
|
-
"@stacksjs/image": "0.74.
|
|
84
|
-
"@stacksjs/logging": "0.74.
|
|
82
|
+
"@stacksjs/i18n": "0.74.18",
|
|
83
|
+
"@stacksjs/image": "0.74.18",
|
|
84
|
+
"@stacksjs/logging": "0.74.18",
|
|
85
85
|
"@stacksjs/logsmith": "^0.2.3",
|
|
86
|
-
"@stacksjs/orm": "0.74.
|
|
87
|
-
"@stacksjs/path": "0.74.
|
|
88
|
-
"@stacksjs/payments": "0.74.
|
|
89
|
-
"@stacksjs/queue": "0.74.
|
|
90
|
-
"@stacksjs/registry": "0.74.
|
|
91
|
-
"@stacksjs/router": "0.74.
|
|
86
|
+
"@stacksjs/orm": "0.74.18",
|
|
87
|
+
"@stacksjs/path": "0.74.18",
|
|
88
|
+
"@stacksjs/payments": "0.74.18",
|
|
89
|
+
"@stacksjs/queue": "0.74.18",
|
|
90
|
+
"@stacksjs/registry": "0.74.18",
|
|
91
|
+
"@stacksjs/router": "0.74.18",
|
|
92
92
|
"@stacksjs/rpx": "^0.11.42",
|
|
93
|
-
"@stacksjs/scheduler": "0.74.
|
|
94
|
-
"@stacksjs/search-engine": "0.74.
|
|
95
|
-
"@stacksjs/security": "0.74.
|
|
96
|
-
"@stacksjs/server": "0.74.
|
|
97
|
-
"@stacksjs/sites": "0.74.
|
|
98
|
-
"@stacksjs/storage": "0.74.
|
|
99
|
-
"@stacksjs/strings": "0.74.
|
|
100
|
-
"@stacksjs/stx": "^0.2.
|
|
93
|
+
"@stacksjs/scheduler": "0.74.18",
|
|
94
|
+
"@stacksjs/search-engine": "0.74.18",
|
|
95
|
+
"@stacksjs/security": "0.74.18",
|
|
96
|
+
"@stacksjs/server": "0.74.18",
|
|
97
|
+
"@stacksjs/sites": "0.74.18",
|
|
98
|
+
"@stacksjs/storage": "0.74.18",
|
|
99
|
+
"@stacksjs/strings": "0.74.18",
|
|
100
|
+
"@stacksjs/stx": "^0.2.272",
|
|
101
101
|
"@stacksjs/tlsx": "^0.13.19",
|
|
102
102
|
"@stacksjs/ts-cloud": "^0.12.10",
|
|
103
103
|
"@stacksjs/ts-md": "^0.1.1",
|
|
104
|
-
"@stacksjs/tunnel": "0.74.
|
|
105
|
-
"@stacksjs/types": "0.74.
|
|
106
|
-
"@stacksjs/utils": "0.74.
|
|
107
|
-
"@stacksjs/whois": "0.74.
|
|
108
|
-
"bun-plugin-stx": "^0.2.
|
|
104
|
+
"@stacksjs/tunnel": "0.74.18",
|
|
105
|
+
"@stacksjs/types": "0.74.18",
|
|
106
|
+
"@stacksjs/utils": "0.74.18",
|
|
107
|
+
"@stacksjs/whois": "0.74.18",
|
|
108
|
+
"bun-plugin-stx": "^0.2.272"
|
|
109
109
|
},
|
|
110
110
|
"peerDependencies": {
|
|
111
111
|
"craft-native": ">=0.0.72",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
}
|
|
121
121
|
},
|
|
122
122
|
"devDependencies": {
|
|
123
|
-
"@stacksjs/validation": "0.74.
|
|
123
|
+
"@stacksjs/validation": "0.74.18",
|
|
124
124
|
"better-dx": "^0.2.24"
|
|
125
125
|
}
|
|
126
126
|
}
|