@coreframe/scripts 0.1.40 → 0.1.41
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/coreframe.d.ts +4 -4
- package/dist/coreframe.js +2 -2
- package/dist/dev.d.ts +0 -2
- package/dist/dev.js +1 -1
- package/dist/runner.d.ts +1 -1
- package/dist/runner.js +1 -1
- package/package.json +4 -3
package/dist/coreframe.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region coreframe.d.ts
|
|
2
|
-
declare const coreframeCli: Partial<import("cmd-ts/dist/cjs/argparser").Register> & {
|
|
3
|
-
parse(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<{
|
|
2
|
+
declare const coreframeCli: Partial<import("@alloc/cmd-ts/dist/cjs/argparser").Register> & {
|
|
3
|
+
parse(context: import("@alloc/cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("@alloc/cmd-ts/dist/cjs/argparser").ParsingResult<{
|
|
4
4
|
command: "assets";
|
|
5
5
|
args: {
|
|
6
6
|
command: "configure";
|
|
@@ -206,7 +206,7 @@ declare const coreframeCli: Partial<import("cmd-ts/dist/cjs/argparser").Register
|
|
|
206
206
|
args: {};
|
|
207
207
|
};
|
|
208
208
|
}>>;
|
|
209
|
-
} & import("cmd-ts/dist/cjs/helpdoc").Named & Partial<import("cmd-ts/dist/cjs/helpdoc").Descriptive & import("cmd-ts/dist/cjs/helpdoc").Versioned> & import("cmd-ts/dist/cjs/helpdoc").PrintHelp & Partial<import("cmd-ts/dist/cjs/helpdoc").Versioned> & import("cmd-ts/dist/cjs/argparser").Register & import("cmd-ts/dist/cjs/runner").Handling<{
|
|
209
|
+
} & import("@alloc/cmd-ts/dist/cjs/helpdoc").Named & Partial<import("@alloc/cmd-ts/dist/cjs/helpdoc").Descriptive & import("@alloc/cmd-ts/dist/cjs/helpdoc").Versioned> & import("@alloc/cmd-ts/dist/cjs/helpdoc").PrintHelp & Partial<import("@alloc/cmd-ts/dist/cjs/helpdoc").Versioned> & import("@alloc/cmd-ts/dist/cjs/argparser").Register & import("@alloc/cmd-ts/dist/cjs/runner").Handling<{
|
|
210
210
|
command: "assets";
|
|
211
211
|
args: {
|
|
212
212
|
command: "configure";
|
|
@@ -526,7 +526,7 @@ declare const coreframeCli: Partial<import("cmd-ts/dist/cjs/argparser").Register
|
|
|
526
526
|
value: Promise<void>;
|
|
527
527
|
};
|
|
528
528
|
}> & {
|
|
529
|
-
run(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<{
|
|
529
|
+
run(context: import("@alloc/cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("@alloc/cmd-ts/dist/cjs/argparser").ParsingResult<{
|
|
530
530
|
command: "assets";
|
|
531
531
|
value: {
|
|
532
532
|
command: "configure";
|
package/dist/coreframe.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{assertAssetCredentialProfile as e,configureAssetCredentials as t}from"./assets/credentials.js";import{addAsset as n,buildAssets as r,checkAssets as i,printAssetResult as a,publishAssets as o}from"./assets/workflows.js";import"./assets.js";import{runDrizzleKitCommand as s}from"./db/drizzle-kit.js";import{seedLocalDb as c}from"./db/seed.js";import{migrateLocalDb as l}from"./db/migrate.js";import{resetLocalDb as u}from"./db/reset.js";import{setupLocalDb as d}from"./db/setup.js";import{ensureLocalDb as f}from"./db/ensure.js";import{formatDbErrorMessage as p}from"./db/error.js";import{migrateHeldMigrations as m}from"./db/migrate-held.js";import{checkSchemaPush as h}from"./db/schema-check.js";import{rotateAccessTokenSigningSecret as g}from"./deploy/access-token-secret.js";import{deployEnvironments as _,tauriReleasePlatforms as v}from"./deploy/config.js";import{discoverStagingUrl as y,reassignStagingHostname as b}from"./staging.js";import{discardPendingWorkerSecret as ee,inspectWorkerEnvironment as te,queueWorkerSecret as x}from"./worker-environment.js";import{deployProject as S}from"./deploy.js";import{checkDeployMigrations as C}from"./deploy/check-migrations.js";import{devDebugFeatures as ne,devPlatforms as w,runDevServer as re}from"./dev.js";import{validateRecipeName as ie}from"./recipes/manifest.js";import{ensureTemplateRemote as T}from"./upgrade/ensure-template-remote.js";import{applyRecipe as E,printAppliedRecipe as D}from"./recipes/apply.js";import{listRecipes as O,printRecipeCatalog as k}from"./recipes/list.js";import{run as A}from"./runner.js";import{typecheckProject as j}from"./typecheck.js";import{checkUpgradeSkillCurrent as M}from"./upgrade/check-skill-current.js";import{fastForwardTemplateFiles as N}from"./upgrade/fast-forward-template-files.js";import{syncCoreframePackages as P}from"./upgrade/sync-coreframe-packages.js";import*as F from"@clack/prompts";import{array as I,command as L,extendType as R,flag as z,multioption as B,number as V,oneOf as H,option as U,optional as W,positional as G,rest as K,string as q,subcommands as J}from"cmd-ts";const Y=R(H(ne),{displayName:`feature`,from:async e=>e}),X=[`Cookies and sessions are origin-scoped.`,`Exact-host passkeys may require re-registration unless a stable eligible parent RP ID was configured in advance.`,`External OAuth callbacks such as Google may need updating.`,`Database data and private backend resources are unchanged.`],Z=[`Use a B2 Multi-Bucket Application Key restricted to the configured private source and public generated-assets buckets.`,`Required capabilities: listAllBucketNames, readFiles, and writeFiles.`,`Deletion, bucket-management, and key-management capabilities are not needed.`].join(` `),ae=R(q,{displayName:`widths`,description:`Comma-separated responsive variant widths.`,async from(e){let t=e.split(`,`).map(e=>Number(e));if(t.length===0||t.some(e=>!Number.isInteger(e)||e<=0)||t.some((e,n)=>n>0&&e<=t[n-1]))throw Error(`Widths must be positive, unique, strictly ascending integers.`);return t}}),oe=R(q,{displayName:`recipe`,description:`Coreframe recipe name, such as yam-db.`,async from(e){return ie(e)}}),se=R(q,{displayName:`profile`,async from(t){return e(t)}}),Q=R(q,{displayName:`pack`,description:`Asset pack name, such as training-videos.`,async from(e){if(!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e))throw Error(`Asset pack names must use lowercase hyphen-separated segments.`);return e}}),$=J({name:`coreframe`,cmds:{assets:J({name:`assets`,cmds:{configure:L({name:`configure`,description:`Store a Backblaze B2 asset key in the operating system credential store. ${Z}`,args:{profile:G({type:se,displayName:`profile`,description:`Credential profile named by coreframe.config.ts.`})},handler:async({profile:e})=>{F.note(Z,`Required B2 key access`);let n=await F.text({message:`Backblaze B2 application key ID`,validate:e=>e?.trim()?void 0:`The application key ID is required.`});if(F.isCancel(n))throw Error(`Asset credential configuration was cancelled.`);let r=await F.password({message:`Backblaze B2 application key`,validate:e=>e?void 0:`The application key is required.`});if(F.isCancel(r))throw Error(`Asset credential configuration was cancelled.`);await t({applicationKey:r,applicationKeyId:n.trim(),profile:e}),console.log(`Stored Coreframe asset credential profile "${e}".`)}}),add:L({name:`add`,args:{file:G({type:q,displayName:`file`,description:`Source raster image, SVG, MP3, MP4, or Lottie JSON to add to the asset library.`}),id:U({long:`id`,type:q,description:`Logical asset ID, such as blog/my-post/hero.`}),alt:U({long:`alt`,type:W(q),description:`Required alt text for raster image and SVG assets.`}),pack:U({long:`pack`,type:W(Q),description:`Place the asset in a named, lazily loaded pack.`}),variantWidths:U({long:`widths`,type:W(ae),description:`Generate exactly these raster-image widths instead of the default ladder.`}),json:z({long:`json`,description:`Print machine-readable JSON.`,defaultValue:()=>!1})},handler:async({alt:e,file:t,id:r,json:i,pack:o,variantWidths:s})=>a(await n({alt:e,file:t,id:r,pack:o,variantWidths:s}),i)}),build:L({name:`build`,args:{id:U({long:`id`,type:W(q),description:`Build only one logical asset ID.`}),pack:U({long:`pack`,type:W(Q),description:`Build only one named asset pack.`}),json:z({long:`json`,description:`Print machine-readable JSON.`,defaultValue:()=>!1})},handler:async({id:e,json:t,pack:n})=>a(await r({id:e,pack:n}),t)}),check:L({name:`check`,args:{fix:z({long:`fix`,description:`Migrate asset state and build missing generated output when possible.`,defaultValue:()=>!1}),pack:U({long:`pack`,type:W(Q),description:`Check only one named asset pack.`}),json:z({long:`json`,description:`Print machine-readable JSON.`,defaultValue:()=>!1})},handler:async({fix:e,json:t,pack:n})=>{let r=await i({fix:e,pack:n});a(r,t),r.ok||(process.exitCode=1)}}),publish:L({name:`publish`,args:{pack:U({long:`pack`,type:W(Q),description:`Publish only one named asset pack.`}),json:z({long:`json`,description:`Print machine-readable JSON.`,defaultValue:()=>!1})},handler:async({json:e,pack:t})=>{let n=await o({pack:t});a(n,e),n.ok||(process.exitCode=1)}}),status:L({name:`status`,args:{pack:U({long:`pack`,type:W(Q),description:`Report status for only one named asset pack.`}),json:z({long:`json`,description:`Print machine-readable JSON.`,defaultValue:()=>!1})},handler:async({json:e,pack:t})=>{let n=await i({pack:t});a(n,e),n.ok||(process.exitCode=1)}})}}),deploy:L({name:`deploy`,args:{environment:G({type:H(_),displayName:`environment`,description:`Deploy to the staging or production environment.`}),runMigrations:z({long:`run-migrations`,description:`Run pending deploy-safe database migrations before deploying.`,defaultValue:()=>!1}),skipMigrations:z({long:`skip-migrations`,description:`Deploy without running pending deploy-safe database migrations.`,defaultValue:()=>!1}),skipPostDeployChecks:z({long:`skip-post-deploy-checks`,description:`Skip post-deploy checks after Cloudflare deployment.`,defaultValue:()=>!1}),tauriLocalPlatforms:B({long:`tauri-local-platform`,type:I(H(v)),description:`Build one Tauri release platform locally. Repeat for multiple platforms.`,defaultValue:()=>[]}),tauriWorkflowName:U({long:`tauri-workflow-name`,type:W(q),description:`GitHub Actions workflow file or name for remote Tauri release builds.`}),tauriWorkflowPlatforms:B({long:`tauri-workflow-platform`,type:I(H(v)),description:`Build one Tauri release platform with GitHub Actions. Repeat for multiple platforms.`,defaultValue:()=>[]}),tauriWorkflowRef:U({long:`tauri-workflow-ref`,type:W(q),description:`Git ref used when dispatching remote Tauri release builds.`}),yes:z({long:`yes`,short:`y`,description:`Approve the production deployment confirmation.`,defaultValue:()=>!1})},handler:({environment:e,runMigrations:t,skipMigrations:n,skipPostDeployChecks:r,tauriLocalPlatforms:i,tauriWorkflowName:a,tauriWorkflowPlatforms:o,tauriWorkflowRef:s,yes:c})=>S([e,...t?[`--run-migrations`]:[],...n?[`--skip-migrations`]:[],...r?[`--skip-post-deploy-checks`]:[],...i.flatMap(e=>[`--tauri-local-platform`,e]),...a?[`--tauri-workflow-name`,a]:[],...o.flatMap(e=>[`--tauri-workflow-platform`,e]),...s?[`--tauri-workflow-ref`,s]:[],...c?[`--yes`]:[]])}),staging:J({name:`staging`,cmds:{reassign:L({name:`reassign`,args:{json:z({long:`json`,description:`Print machine-readable JSON.`,defaultValue:()=>!1})},handler:async({json:e})=>{let t=await b();if(e){console.log(JSON.stringify({...t,notices:X}));return}console.log(t.url),console.error(`Staging hostname reassigned. ${X.join(` `)}`)}}),url:L({name:`url`,args:{json:z({long:`json`,description:`Print machine-readable JSON.`,defaultValue:()=>!1})},handler:async({json:e})=>{let t=await y();console.log(e?JSON.stringify({url:t}):t)}})}}),secrets:J({name:`secrets`,cmds:{"rotate-access-token":L({name:`rotate-access-token`,args:{environment:G({type:H(_),displayName:`environment`,description:`Worker environment whose access JWTs should be invalidated.`}),yes:z({long:`yes`,short:`y`,description:`Confirm immediate signing-secret replacement and invalidation of outstanding access JWTs.`,defaultValue:()=>!1})},handler:async({environment:e,yes:t})=>{if(!t)throw Error(`Access-token signing-secret rotation requires --yes because it immediately invalidates outstanding access JWTs.`);await g({environment:e}),console.log(`Rotated Coreframe access-token signing material for ${e}. Clients must remint outstanding access JWTs.`)}}),status:L({name:`status`,args:{environment:G({type:W(H(_)),displayName:`environment`,description:`Inspect staging, production, or both when omitted.`}),json:z({long:`json`,description:`Print machine-readable JSON.`,defaultValue:()=>!1})},handler:async({environment:e,json:t})=>{let n=await te({environment:e});console.log(t?JSON.stringify(n):ce(n))}}),set:L({name:`set`,args:{environment:G({type:H(_),displayName:`environment`,description:`Worker environment to update on its next deploy.`}),name:G({type:q,displayName:`name`,description:`Declared Worker secret name.`})},handler:async({environment:e,name:t})=>{await x({environment:e,name:t,value:await le(t)}),console.log(`Queued ${t} for ${e}. Run coreframe deploy ${e} to apply.`)}}),discard:L({name:`discard`,args:{environment:G({type:H(_),displayName:`environment`,description:`Worker environment with a queued secret update.`}),name:G({type:q,displayName:`name`,description:`Declared Worker secret name.`})},handler:async({environment:e,name:t})=>{let n=await ee({environment:e,name:t});console.log(n?`Discarded the queued ${t} update for ${e}.`:`No ${t} update is queued for ${e}.`)}})}}),typecheck:L({name:`typecheck`,args:{},handler:j}),dev:L({name:`dev`,args:{debug:U({long:`debug`,type:W(Y),description:`Launch a development feature in isolated debug mode.`}),https:z({long:`https`,description:`Serve the web app over locally trusted HTTPS.`,defaultValue:()=>!1}),host:U({long:`host`,type:W(q),description:`Host address for the web development server.`}),managed:z({long:`managed`,description:`Run managed checkout synchronization even without an interactive terminal.`,defaultValue:()=>!1}),noManaged:z({long:`no-managed`,description:`Run without managed checkout synchronization for this invocation.`,defaultValue:()=>!1}),platform:G({type:W(H(w)),displayName:`platform`,description:`Development target platform. Defaults to web.`}),device:G({type:W(q),displayName:`device`,description:`Device name or ID for iOS or Android development.`}),port:U({long:`port`,type:W(V),description:`Port for the web development server.`}),verbose:z({long:`verbose`,description:`Show the full native development output.`,defaultValue:()=>!1})},handler:({debug:e,device:t,host:n,https:r,managed:i,noManaged:a,platform:o,port:s,verbose:c})=>re({debug:e,device:t,host:n,https:r,managed:i,noManaged:a,platform:o??`web`,verbose:c,webPort:s})}),upgrade:J({name:`upgrade`,cmds:{"ensure-template-remote":L({name:`ensure-template-remote`,args:{remote:U({long:`remote`,type:q,defaultValue:()=>`template`,description:`Remote name to ensure.`}),noFetch:z({long:`no-fetch`,description:`Do not fetch the remote after ensuring it exists.`,defaultValue:()=>!1})},handler:({noFetch:e,remote:t})=>T({fetch:!e,remote:t})}),"check-skill-current":L({name:`check-skill-current`,args:{target:U({long:`target`,type:q,description:`Target Coreframe template git ref.`}),apply:z({long:`apply`,description:`Replace the local upgrade skill with the target version when it differs.`,defaultValue:()=>!1})},handler:({apply:e,target:t})=>{process.exitCode=M({apply:e,target:t})}}),"fast-forward-template-files":L({name:`fast-forward-template-files`,args:{target:U({long:`target`,type:q,description:`Target Coreframe template git ref.`}),base:U({long:`base`,type:W(q),description:`Previous Coreframe template git ref. Defaults to package.json engines.coreframe.`}),apply:z({long:`apply`,description:`Write clean fast-forwards to the worktree.`,defaultValue:()=>!1})},handler:({apply:e,base:t,target:n})=>N({apply:e,base:t,target:n})}),"sync-coreframe-packages":L({name:`sync-coreframe-packages`,args:{target:U({long:`target`,type:q,description:`Target Coreframe template git ref.`}),apply:z({long:`apply`,description:`Update existing published Coreframe dependency specifications.`,defaultValue:()=>!1})},handler:({apply:e,target:t})=>P({apply:e,target:t})})}}),recipes:J({name:`recipes`,cmds:{apply:L({name:`apply`,args:{recipe:G({type:oe,displayName:`recipe`,description:`Recipe to prepare and apply.`}),target:U({long:`target`,type:W(q),description:`Coreframe Git ref. Defaults to package.json engines.coreframe.`}),remote:U({long:`remote`,type:q,defaultValue:()=>`template`,description:`Coreframe Git remote name.`}),noFetch:z({long:`no-fetch`,description:`Use already-fetched recipe refs without fetching the remote.`,defaultValue:()=>!1})},handler:({noFetch:e,recipe:t,remote:n,target:r})=>D(E({fetch:!e,name:t,remote:n,target:r}))}),list:L({name:`list`,args:{target:U({long:`target`,type:W(q),description:`Coreframe Git ref. Defaults to package.json engines.coreframe.`}),remote:U({long:`remote`,type:q,defaultValue:()=>`template`,description:`Coreframe Git remote name.`}),noFetch:z({long:`no-fetch`,description:`Use already-fetched recipe refs without fetching the remote.`,defaultValue:()=>!1})},handler:({noFetch:e,remote:t,target:n})=>k(O({fetch:!e,remote:t,target:n}))})}}),db:J({name:`db`,cmds:{ensure:L({name:`ensure`,args:{},handler:f}),generate:L({name:`generate`,args:{args:K({displayName:`drizzle-kit args`,description:`Additional arguments passed to drizzle-kit generate.`})},handler:({args:e})=>s(`generate`,e)}),migrate:L({name:`migrate`,args:{args:K({displayName:`drizzle-kit args`,description:`Additional arguments passed to drizzle-kit migrate.`})},handler:({args:e})=>s(`migrate`,e)}),"migrate-held":L({name:`migrate-held`,args:{confirm:U({long:`confirm`,type:W(H([`run-held-migrations`])),description:`Required confirmation value for held migrations.`})},handler:({confirm:e})=>m({argv:e?[`--confirm=${e}`]:[]})}),"migrate-local":L({name:`migrate-local`,args:{},handler:l}),"migrations-check":L({name:`migrations-check`,args:{},handler:C}),reset:L({name:`reset`,args:{},handler:u}),seed:L({name:`seed`,args:{},handler:()=>c()}),"schema-check":L({name:`schema-check`,args:{seed:z({long:`seed`,description:`Run the configured project seed against the throwaway database.`,defaultValue:()=>!1})},handler:({seed:e})=>h({seed:e})}),setup:L({name:`setup`,args:{},handler:()=>d()}),studio:L({name:`studio`,args:{args:K({displayName:`drizzle-kit args`,description:`Additional arguments passed to drizzle-kit studio.`})},handler:({args:e})=>s(`studio`,e)})}})}});import.meta.main&&A($,{formatMessage:process.argv[2]===`db`?p:void 0});function ce(e){if(e.entries.length===0)return`No Worker environment values are declared in coreframe.config.ts.`;let t=e.entries.map(e=>[e.name,e.kind,e.local===`override`?`override`:`built-in default`,e.deployed.staging.replaceAll(`_`,` `),e.deployed.production.replaceAll(`_`,` `)]),n=[`Name`,`Kind`,`Local`,`Staging`,`Production`],r=n.map((e,n)=>Math.max(e.length,...t.map(e=>e[n].length))),i=e=>e.map((e,t)=>e.padEnd(r[t])).join(` `).trimEnd();return[i(n),i(r.map(e=>`-`.repeat(e))),...t].join(`
|
|
3
|
-
`)}async function le(e){if(!process.stdin.isTTY){let e=``;for await(let t of process.stdin)e+=t.toString();return e.replace(/\r?\n$/,``)}let t=await
|
|
2
|
+
import{assertAssetCredentialProfile as e,configureAssetCredentials as t}from"./assets/credentials.js";import{addAsset as n,buildAssets as r,checkAssets as i,printAssetResult as a,publishAssets as o}from"./assets/workflows.js";import"./assets.js";import{runDrizzleKitCommand as s}from"./db/drizzle-kit.js";import{seedLocalDb as c}from"./db/seed.js";import{migrateLocalDb as l}from"./db/migrate.js";import{resetLocalDb as u}from"./db/reset.js";import{setupLocalDb as d}from"./db/setup.js";import{ensureLocalDb as f}from"./db/ensure.js";import{formatDbErrorMessage as p}from"./db/error.js";import{migrateHeldMigrations as m}from"./db/migrate-held.js";import{checkSchemaPush as h}from"./db/schema-check.js";import{rotateAccessTokenSigningSecret as g}from"./deploy/access-token-secret.js";import{deployEnvironments as _,tauriReleasePlatforms as v}from"./deploy/config.js";import{discoverStagingUrl as y,reassignStagingHostname as b}from"./staging.js";import{discardPendingWorkerSecret as ee,inspectWorkerEnvironment as te,queueWorkerSecret as x}from"./worker-environment.js";import{deployProject as S}from"./deploy.js";import{checkDeployMigrations as C}from"./deploy/check-migrations.js";import{devDebugFeatures as w,devPlatforms as T,runDevServer as ne}from"./dev.js";import{validateRecipeName as re}from"./recipes/manifest.js";import{ensureTemplateRemote as E}from"./upgrade/ensure-template-remote.js";import{applyRecipe as D,printAppliedRecipe as O}from"./recipes/apply.js";import{listRecipes as k,printRecipeCatalog as A}from"./recipes/list.js";import{run as j}from"./runner.js";import{typecheckProject as M}from"./typecheck.js";import{checkUpgradeSkillCurrent as N}from"./upgrade/check-skill-current.js";import{fastForwardTemplateFiles as P}from"./upgrade/fast-forward-template-files.js";import{syncCoreframePackages as F}from"./upgrade/sync-coreframe-packages.js";import{array as I,command as L,extendType as R,flag as z,multioption as B,number as ie,oneOf as V,option as H,optional as U,positional as W,rest as G,string as K,subcommands as q}from"@alloc/cmd-ts";import*as J from"@clack/prompts";const Y=R(V(w),{displayName:`feature`,from:async e=>e}),X=[`Cookies and sessions are origin-scoped.`,`Exact-host passkeys may require re-registration unless a stable eligible parent RP ID was configured in advance.`,`External OAuth callbacks such as Google may need updating.`,`Database data and private backend resources are unchanged.`],Z=[`Use a B2 Multi-Bucket Application Key restricted to the configured private source and public generated-assets buckets.`,`Required capabilities: listAllBucketNames, readFiles, and writeFiles.`,`Deletion, bucket-management, and key-management capabilities are not needed.`].join(` `),ae=R(K,{displayName:`widths`,description:`Comma-separated responsive variant widths.`,async from(e){let t=e.split(`,`).map(e=>Number(e));if(t.length===0||t.some(e=>!Number.isInteger(e)||e<=0)||t.some((e,n)=>n>0&&e<=t[n-1]))throw Error(`Widths must be positive, unique, strictly ascending integers.`);return t}}),oe=R(K,{displayName:`recipe`,description:`Coreframe recipe name, such as yam-db.`,async from(e){return re(e)}}),se=R(K,{displayName:`profile`,async from(t){return e(t)}}),Q=R(K,{displayName:`pack`,description:`Asset pack name, such as training-videos.`,async from(e){if(!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e))throw Error(`Asset pack names must use lowercase hyphen-separated segments.`);return e}}),$=q({name:`coreframe`,cmds:{assets:q({name:`assets`,cmds:{configure:L({name:`configure`,description:`Store a Backblaze B2 asset key in the operating system credential store. ${Z}`,args:{profile:W({type:se,displayName:`profile`,description:`Credential profile named by coreframe.config.ts.`})},handler:async({profile:e})=>{J.note(Z,`Required B2 key access`);let n=await J.text({message:`Backblaze B2 application key ID`,validate:e=>e?.trim()?void 0:`The application key ID is required.`});if(J.isCancel(n))throw Error(`Asset credential configuration was cancelled.`);let r=await J.password({message:`Backblaze B2 application key`,validate:e=>e?void 0:`The application key is required.`});if(J.isCancel(r))throw Error(`Asset credential configuration was cancelled.`);await t({applicationKey:r,applicationKeyId:n.trim(),profile:e}),console.log(`Stored Coreframe asset credential profile "${e}".`)}}),add:L({name:`add`,args:{file:W({type:K,displayName:`file`,description:`Source raster image, SVG, MP3, MP4, or Lottie JSON to add to the asset library.`}),id:H({long:`id`,type:K,description:`Logical asset ID, such as blog/my-post/hero.`}),alt:H({long:`alt`,type:U(K),description:`Required alt text for raster image and SVG assets.`}),pack:H({long:`pack`,type:U(Q),description:`Place the asset in a named, lazily loaded pack.`}),variantWidths:H({long:`widths`,type:U(ae),description:`Generate exactly these raster-image widths instead of the default ladder.`}),json:z({long:`json`,description:`Print machine-readable JSON.`,defaultValue:()=>!1})},handler:async({alt:e,file:t,id:r,json:i,pack:o,variantWidths:s})=>a(await n({alt:e,file:t,id:r,pack:o,variantWidths:s}),i)}),build:L({name:`build`,args:{id:H({long:`id`,type:U(K),description:`Build only one logical asset ID.`}),pack:H({long:`pack`,type:U(Q),description:`Build only one named asset pack.`}),json:z({long:`json`,description:`Print machine-readable JSON.`,defaultValue:()=>!1})},handler:async({id:e,json:t,pack:n})=>a(await r({id:e,pack:n}),t)}),check:L({name:`check`,args:{fix:z({long:`fix`,description:`Migrate asset state and build missing generated output when possible.`,defaultValue:()=>!1}),pack:H({long:`pack`,type:U(Q),description:`Check only one named asset pack.`}),json:z({long:`json`,description:`Print machine-readable JSON.`,defaultValue:()=>!1})},handler:async({fix:e,json:t,pack:n})=>{let r=await i({fix:e,pack:n});a(r,t),r.ok||(process.exitCode=1)}}),publish:L({name:`publish`,args:{pack:H({long:`pack`,type:U(Q),description:`Publish only one named asset pack.`}),json:z({long:`json`,description:`Print machine-readable JSON.`,defaultValue:()=>!1})},handler:async({json:e,pack:t})=>{let n=await o({pack:t});a(n,e),n.ok||(process.exitCode=1)}}),status:L({name:`status`,args:{pack:H({long:`pack`,type:U(Q),description:`Report status for only one named asset pack.`}),json:z({long:`json`,description:`Print machine-readable JSON.`,defaultValue:()=>!1})},handler:async({json:e,pack:t})=>{let n=await i({pack:t});a(n,e),n.ok||(process.exitCode=1)}})}}),deploy:L({name:`deploy`,args:{environment:W({type:V(_),displayName:`environment`,description:`Deploy to the staging or production environment.`}),runMigrations:z({long:`run-migrations`,description:`Run pending deploy-safe database migrations before deploying.`,defaultValue:()=>!1}),skipMigrations:z({long:`skip-migrations`,description:`Deploy without running pending deploy-safe database migrations.`,defaultValue:()=>!1}),skipPostDeployChecks:z({long:`skip-post-deploy-checks`,description:`Skip post-deploy checks after Cloudflare deployment.`,defaultValue:()=>!1}),tauriLocalPlatforms:B({long:`tauri-local-platform`,type:I(V(v)),description:`Build one Tauri release platform locally. Repeat for multiple platforms.`,defaultValue:()=>[]}),tauriWorkflowName:H({long:`tauri-workflow-name`,type:U(K),description:`GitHub Actions workflow file or name for remote Tauri release builds.`}),tauriWorkflowPlatforms:B({long:`tauri-workflow-platform`,type:I(V(v)),description:`Build one Tauri release platform with GitHub Actions. Repeat for multiple platforms.`,defaultValue:()=>[]}),tauriWorkflowRef:H({long:`tauri-workflow-ref`,type:U(K),description:`Git ref used when dispatching remote Tauri release builds.`}),yes:z({long:`yes`,short:`y`,description:`Approve the production deployment confirmation.`,defaultValue:()=>!1})},handler:({environment:e,runMigrations:t,skipMigrations:n,skipPostDeployChecks:r,tauriLocalPlatforms:i,tauriWorkflowName:a,tauriWorkflowPlatforms:o,tauriWorkflowRef:s,yes:c})=>S([e,...t?[`--run-migrations`]:[],...n?[`--skip-migrations`]:[],...r?[`--skip-post-deploy-checks`]:[],...i.flatMap(e=>[`--tauri-local-platform`,e]),...a?[`--tauri-workflow-name`,a]:[],...o.flatMap(e=>[`--tauri-workflow-platform`,e]),...s?[`--tauri-workflow-ref`,s]:[],...c?[`--yes`]:[]])}),staging:q({name:`staging`,cmds:{reassign:L({name:`reassign`,args:{json:z({long:`json`,description:`Print machine-readable JSON.`,defaultValue:()=>!1})},handler:async({json:e})=>{let t=await b();if(e){console.log(JSON.stringify({...t,notices:X}));return}console.log(t.url),console.error(`Staging hostname reassigned. ${X.join(` `)}`)}}),url:L({name:`url`,args:{json:z({long:`json`,description:`Print machine-readable JSON.`,defaultValue:()=>!1})},handler:async({json:e})=>{let t=await y();console.log(e?JSON.stringify({url:t}):t)}})}}),secrets:q({name:`secrets`,cmds:{"rotate-access-token":L({name:`rotate-access-token`,args:{environment:W({type:V(_),displayName:`environment`,description:`Worker environment whose access JWTs should be invalidated.`}),yes:z({long:`yes`,short:`y`,description:`Confirm immediate signing-secret replacement and invalidation of outstanding access JWTs.`,defaultValue:()=>!1})},handler:async({environment:e,yes:t})=>{if(!t)throw Error(`Access-token signing-secret rotation requires --yes because it immediately invalidates outstanding access JWTs.`);await g({environment:e}),console.log(`Rotated Coreframe access-token signing material for ${e}. Clients must remint outstanding access JWTs.`)}}),status:L({name:`status`,args:{environment:W({type:U(V(_)),displayName:`environment`,description:`Inspect staging, production, or both when omitted.`}),json:z({long:`json`,description:`Print machine-readable JSON.`,defaultValue:()=>!1})},handler:async({environment:e,json:t})=>{let n=await te({environment:e});console.log(t?JSON.stringify(n):ce(n))}}),set:L({name:`set`,args:{environment:W({type:V(_),displayName:`environment`,description:`Worker environment to update on its next deploy.`}),name:W({type:K,displayName:`name`,description:`Declared Worker secret name.`})},handler:async({environment:e,name:t})=>{await x({environment:e,name:t,value:await le(t)}),console.log(`Queued ${t} for ${e}. Run coreframe deploy ${e} to apply.`)}}),discard:L({name:`discard`,args:{environment:W({type:V(_),displayName:`environment`,description:`Worker environment with a queued secret update.`}),name:W({type:K,displayName:`name`,description:`Declared Worker secret name.`})},handler:async({environment:e,name:t})=>{let n=await ee({environment:e,name:t});console.log(n?`Discarded the queued ${t} update for ${e}.`:`No ${t} update is queued for ${e}.`)}})}}),typecheck:L({name:`typecheck`,args:{},handler:M}),dev:L({name:`dev`,args:{debug:H({long:`debug`,type:U(Y),description:`Launch a development feature in isolated debug mode.`}),https:z({long:`https`,description:`Serve the web app over locally trusted HTTPS.`,defaultValue:()=>!1}),host:H({long:`host`,type:U(K),implicitValue:`0.0.0.0`,description:`Host address for the web development server. Pass without an address to use 0.0.0.0.`}),managed:z({long:`managed`,description:`Run managed checkout synchronization even without an interactive terminal.`,defaultValue:()=>!1}),noManaged:z({long:`no-managed`,description:`Run without managed checkout synchronization for this invocation.`,defaultValue:()=>!1}),platform:W({type:U(V(T)),displayName:`platform`,description:`Development target platform. Defaults to web.`}),device:W({type:U(K),displayName:`device`,description:`Device name or ID for iOS or Android development.`}),port:H({long:`port`,type:U(ie),description:`Port for the web development server.`}),verbose:z({long:`verbose`,description:`Show the full native development output.`,defaultValue:()=>!1})},handler:({debug:e,device:t,host:n,https:r,managed:i,noManaged:a,platform:o,port:s,verbose:c})=>ne({debug:e,device:t,host:n,https:r,managed:i,noManaged:a,platform:o??`web`,verbose:c,webPort:s})}),upgrade:q({name:`upgrade`,cmds:{"ensure-template-remote":L({name:`ensure-template-remote`,args:{remote:H({long:`remote`,type:K,defaultValue:()=>`template`,description:`Remote name to ensure.`}),noFetch:z({long:`no-fetch`,description:`Do not fetch the remote after ensuring it exists.`,defaultValue:()=>!1})},handler:({noFetch:e,remote:t})=>E({fetch:!e,remote:t})}),"check-skill-current":L({name:`check-skill-current`,args:{target:H({long:`target`,type:K,description:`Target Coreframe template git ref.`}),apply:z({long:`apply`,description:`Replace the local upgrade skill with the target version when it differs.`,defaultValue:()=>!1})},handler:({apply:e,target:t})=>{process.exitCode=N({apply:e,target:t})}}),"fast-forward-template-files":L({name:`fast-forward-template-files`,args:{target:H({long:`target`,type:K,description:`Target Coreframe template git ref.`}),base:H({long:`base`,type:U(K),description:`Previous Coreframe template git ref. Defaults to package.json engines.coreframe.`}),apply:z({long:`apply`,description:`Write clean fast-forwards to the worktree.`,defaultValue:()=>!1})},handler:({apply:e,base:t,target:n})=>P({apply:e,base:t,target:n})}),"sync-coreframe-packages":L({name:`sync-coreframe-packages`,args:{target:H({long:`target`,type:K,description:`Target Coreframe template git ref.`}),apply:z({long:`apply`,description:`Update existing published Coreframe dependency specifications.`,defaultValue:()=>!1})},handler:({apply:e,target:t})=>F({apply:e,target:t})})}}),recipes:q({name:`recipes`,cmds:{apply:L({name:`apply`,args:{recipe:W({type:oe,displayName:`recipe`,description:`Recipe to prepare and apply.`}),target:H({long:`target`,type:U(K),description:`Coreframe Git ref. Defaults to package.json engines.coreframe.`}),remote:H({long:`remote`,type:K,defaultValue:()=>`template`,description:`Coreframe Git remote name.`}),noFetch:z({long:`no-fetch`,description:`Use already-fetched recipe refs without fetching the remote.`,defaultValue:()=>!1})},handler:({noFetch:e,recipe:t,remote:n,target:r})=>O(D({fetch:!e,name:t,remote:n,target:r}))}),list:L({name:`list`,args:{target:H({long:`target`,type:U(K),description:`Coreframe Git ref. Defaults to package.json engines.coreframe.`}),remote:H({long:`remote`,type:K,defaultValue:()=>`template`,description:`Coreframe Git remote name.`}),noFetch:z({long:`no-fetch`,description:`Use already-fetched recipe refs without fetching the remote.`,defaultValue:()=>!1})},handler:({noFetch:e,remote:t,target:n})=>A(k({fetch:!e,remote:t,target:n}))})}}),db:q({name:`db`,cmds:{ensure:L({name:`ensure`,args:{},handler:f}),generate:L({name:`generate`,args:{args:G({displayName:`drizzle-kit args`,description:`Additional arguments passed to drizzle-kit generate.`})},handler:({args:e})=>s(`generate`,e)}),migrate:L({name:`migrate`,args:{args:G({displayName:`drizzle-kit args`,description:`Additional arguments passed to drizzle-kit migrate.`})},handler:({args:e})=>s(`migrate`,e)}),"migrate-held":L({name:`migrate-held`,args:{confirm:H({long:`confirm`,type:U(V([`run-held-migrations`])),description:`Required confirmation value for held migrations.`})},handler:({confirm:e})=>m({argv:e?[`--confirm=${e}`]:[]})}),"migrate-local":L({name:`migrate-local`,args:{},handler:l}),"migrations-check":L({name:`migrations-check`,args:{},handler:C}),reset:L({name:`reset`,args:{},handler:u}),seed:L({name:`seed`,args:{},handler:()=>c()}),"schema-check":L({name:`schema-check`,args:{seed:z({long:`seed`,description:`Run the configured project seed against the throwaway database.`,defaultValue:()=>!1})},handler:({seed:e})=>h({seed:e})}),setup:L({name:`setup`,args:{},handler:()=>d()}),studio:L({name:`studio`,args:{args:G({displayName:`drizzle-kit args`,description:`Additional arguments passed to drizzle-kit studio.`})},handler:({args:e})=>s(`studio`,e)})}})}});import.meta.main&&j($,{formatMessage:process.argv[2]===`db`?p:void 0});function ce(e){if(e.entries.length===0)return`No Worker environment values are declared in coreframe.config.ts.`;let t=e.entries.map(e=>[e.name,e.kind,e.local===`override`?`override`:`built-in default`,e.deployed.staging.replaceAll(`_`,` `),e.deployed.production.replaceAll(`_`,` `)]),n=[`Name`,`Kind`,`Local`,`Staging`,`Production`],r=n.map((e,n)=>Math.max(e.length,...t.map(e=>e[n].length))),i=e=>e.map((e,t)=>e.padEnd(r[t])).join(` `).trimEnd();return[i(n),i(r.map(e=>`-`.repeat(e))),...t].join(`
|
|
3
|
+
`)}async function le(e){if(!process.stdin.isTTY){let e=``;for await(let t of process.stdin)e+=t.toString();return e.replace(/\r?\n$/,``)}let t=await J.password({message:`Enter the new value for ${e}`});if(J.isCancel(t))throw J.cancel(`Secret update cancelled.`),Error(`Secret update cancelled.`);return t}export{$ as coreframeCli};
|
package/dist/dev.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ type DevServerOptions = {
|
|
|
8
8
|
env?: NodeJS.ProcessEnv;
|
|
9
9
|
host?: string | true;
|
|
10
10
|
https?: boolean;
|
|
11
|
-
input?: NodeJS.ReadableStream;
|
|
12
11
|
interactive?: boolean;
|
|
13
12
|
managed?: boolean;
|
|
14
13
|
noManaged?: boolean;
|
|
@@ -29,7 +28,6 @@ declare function runDevServer({
|
|
|
29
28
|
env,
|
|
30
29
|
host,
|
|
31
30
|
https,
|
|
32
|
-
input,
|
|
33
31
|
interactive,
|
|
34
32
|
managed,
|
|
35
33
|
noManaged,
|
package/dist/dev.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{readProjectConfig as e}from"./config.js";import{fs as t,net as n}from"./environment.js";import{ProjectPostgresAlreadyRunningError as r,startProjectPostgres as i,stopProjectPostgres as a}from"./db/local-postgres.js";import{resolveMobileDevHost as o,selectMobileDevDevice as s}from"./dev-device.js";import{devHttpsCertEnv as ee,devHttpsKeyEnv as
|
|
2
|
+
import{readProjectConfig as e}from"./config.js";import{fs as t,net as n}from"./environment.js";import{ProjectPostgresAlreadyRunningError as r,startProjectPostgres as i,stopProjectPostgres as a}from"./db/local-postgres.js";import{resolveMobileDevHost as o,selectMobileDevDevice as s}from"./dev-device.js";import{devHttpsCertEnv as ee,devHttpsKeyEnv as te,prepareDevHttps as ne}from"./dev-https.js";import{acquireDevLock as c}from"./dev-lock.js";import{managedDevEnv as l}from"./managed-dev-protocol.js";import{isManagedDevCheckout as re,isPrimaryCheckout as ie}from"./managed-dev.js";import{createTauriDevOutput as u}from"./tauri-dev-output.js";import d from"node:path";import f from"nano-spawn";import{finished as p}from"node:stream/promises";import*as m from"@clack/prompts";import h from"node:process";import{once as g}from"node:events";import{determineAgent as ae}from"@vercel/detect-agent";import{createPrefixStream as _,supervise as v}from"procband";const y=[`web`,`desktop`,`ios`,`android`],b=[`managed-dev-overlay`],x=`VITE_COREFRAME_MANAGED_DEV_OVERLAY_DEBUG`;function S(e){let t=e.dev?.platforms??[`web`];for(let e of t)if(!y.includes(e))throw Error(`Invalid development platform "${String(e)}". Expected one of: ${y.join(`, `)}.`);return[...new Set(t)]}const C=d.resolve(`node_modules`,`.bin`),w=h.platform===`win32`?`pnpm.cmd`:`pnpm`,T=h.platform===`win32`?`portless.cmd`:`portless`,oe=h.platform===`win32`?`react-router.cmd`:`react-router`,se=h.platform===`win32`?`turso.cmd`:`turso`;async function E({cwd:r=h.cwd(),debug:i,device:a,env:g=h.env,host:y,https:b=!1,interactive:S=h.stdin.isTTY===!0,managed:E=!1,noManaged:P=!1,platform:F=`web`,verbose:I=!1,webPort:L}={}){let R=g.PATH??g.Path??``,z=F===`web`?N(L??g.COREFRAME_WEB_PORT):void 0,B,V,H,U,W,G=!1,K,q=g;if(E&&P)throw Error(`Cannot use --managed and --no-managed together.`);if(i===`managed-dev-overlay`&&E)throw Error(`Cannot use --managed with --debug managed-dev-overlay.`);if(b&&F!==`web`)throw Error(`Local HTTPS is only supported for the web development platform.`);if(a!==void 0&&F!==`ios`&&F!==`android`)throw Error(`A device name or ID is only supported for iOS or Android development.`);if(F===`web`&&g.TAURI_ENV_PLATFORM!==void 0&&g.COREFRAME_TAURI_DEV!==`1`){let e=g.TAURI_ENV_PLATFORM===`ios`||g.TAURI_ENV_PLATFORM===`android`?g.TAURI_ENV_PLATFORM:`desktop`;throw Error(`Direct Tauri development is not supported. Run \`pnpm dev ${e}\` instead.`)}let J=await c({cwd:r,interactive:S});if(!J)return;let Y=()=>{G||(G=!0,V?.kill(`SIGTERM`),W?.nodeChildProcess.then(e=>e.kill(`SIGTERM`)).catch(()=>void 0),B?.nodeChildProcess.then(e=>e.kill(`SIGTERM`)).catch(()=>void 0),U?.kill(`SIGTERM`))},X=[`SIGINT`,`SIGTERM`].map(e=>{let t=()=>{K??=e,Y()};return h.on(e,t),{handler:t,signal:e}}),Z=async e=>{let t=v(e);V=t;try{await t.expectSuccess()}catch(e){if(!G)throw e}finally{V===t&&(V=void 0)}};try{let c=F===`ios`||F===`android`?F:void 0,O=c?await s({env:g,interactive:S,platform:c,target:a}):void 0,N=c&&O?await o({device:O,host:y,interactive:S,platform:c}):void 0,L=N?!0:y,V=await e({cwd:r}),K=F===`web`&&g.PORTLESS!==`0`&&g.TAURI_ENV_PLATFORM===void 0&&!(await ae()).isAgent&&await ie(r),X=b&&!K?await ne({cwd:r}):void 0;q={...g,...i===`managed-dev-overlay`?{[x]:`1`}:void 0,...F===`web`?void 0:{COREFRAME_TAURI_DEV:`1`,TAURI_ENV_PLATFORM:le(F),...N?{TAURI_DEV_HOST:N}:void 0},...X?{[ee]:X.cert,[te]:X.key}:void 0};let Q=async()=>{let e=_({label:`web`}),t=_({color:`red`,label:`web`});e.pipe(h.stdout,{end:!1}),t.pipe(h.stderr,{end:!1}),W=f(K?T:oe,K?M({host:L,port:z}):j({host:L,port:z}),{cwd:r,env:{...q,CLOUDFLARE_ENV:`development`,PATH:C+d.delimiter+R},stdin:`inherit`});let n=Promise.allSettled([D(W.stdout,e),D(W.stderr,t)]);try{await W;let e=(await n).find(e=>e.status===`rejected`);if(e)throw e.reason}catch(e){if(!G)throw e}finally{await n,e.end(),t.end(),await Promise.allSettled([p(e),p(t)]),W=void 0}},$=async()=>{if(F===`web`){await Q();return}let e=Q().then(()=>{if(!G)throw Error(`The Vite development server stopped while Tauri was still running.`)}),t,n;if(F===`ios`&&!I){n=_({label:`ios`}),n.pipe(h.stdout,{end:!1});try{t=await u({output:n}),m.log.info(`Full iOS log: ${t.logFile}`)}catch{n.end(),n=void 0,m.log.warn(`Could not create the temporary iOS log; showing full Tauri output.`)}}B=f(w,ce(F,O?.name,N),{cwd:r,env:g,stdio:t?[`inherit`,`pipe`,`pipe`]:`inherit`});let i=t?.consume(B),a=B.catch(async e=>{throw G||(await i,await t?.reportFailure()),e});try{await Promise.race([e,a])}finally{Y(),await Promise.allSettled([e,B,i]),await t?.close(),n?.end(),B=void 0}};if(i!==`managed-dev-overlay`&&(E||S&&!P)&&await re(r)&&(q={...q,[l]:`1`}),G)return;if(V.database?.dialect===`sqlite`){let e=await n.getAvailablePort(),i=d.resolve(r,`.coreframe`),a=d.join(i,`turso.db`);if(await t.mkdir(i,{recursive:!0}),q={...q,TURSO_DATABASE_URL:`http://127.0.0.1:${e}`,TURSO_AUTH_TOKEN:`dev`},U=v({name:`turso`,command:se,args:[`dev`,`--port`,String(e),`--db-file`,a],cwd:r,env:g}),await U.waitFor(`listening`),await Z({name:`db`,command:w,args:[`db`,`ensure`],cwd:r,env:q,prefix:!1}),G)return}if(A(V)){let e=_({label:`postgres`});e.pipe(h.stdout,{end:!1});try{let t=await k({config:V,cwd:r,env:q,failIfRunning:!0,interactive:S,isStopping:()=>G,postgresOutput:e,takeoverApproved:J.takeoverApproved});if(!t)return;H=t,q=t.env;try{G||await Z({name:`db`,command:w,args:[`db`,`ensure`],cwd:r,env:q,prefix:!1}),G||await $()}finally{await t[Symbol.asyncDispose](),H===t&&(H=void 0)}}finally{e.end()}return}await $()}finally{Y();let e;try{await H?.[Symbol.asyncDispose]()}catch(t){e=t}finally{for(let{handler:e,signal:t}of X)h.off(t,e);K&&(h.exitCode??=K===`SIGINT`?130:143)}O(e),await J.release()}}async function D(e,t){for await(let n of e)t.write(`${n}\n`)||await g(t,`drain`)}function O(e){if(e)throw e}async function k({interactive:e,isStopping:t,takeoverApproved:n,...o}){try{return await i(o)}catch(s){if(!(s instanceof r)||!e)throw s;if(!n){let e=await m.confirm({initialValue:!1,message:`PostgreSQL is already running for this project (PID ${s.pid}). Stop it and start here?`});if(m.isCancel(e)||!e){m.cancel(`Keeping the existing PostgreSQL process.`);return}}return await a(s),t()?void 0:i(o)}}function A(e){return(e.database?.dialect??`postgres`)===`postgres`}function ce(e,t,n){return[`exec`,`tauri`,...e===`desktop`?[]:[e],`dev`,`--config`,JSON.stringify({build:{beforeDevCommand:``}}),...n===void 0?[]:[`--host=${n}`],...t===void 0?[]:[t]]}function le(e){return e===`desktop`?h.platform===`win32`?`windows`:h.platform:e}function j({host:e,port:t}){return[`dev`,...e===void 0?[]:[`--host`,e===!0?`0.0.0.0`:e],...t===void 0?[]:[`--port`,String(t)]]}function M({host:e,port:t}){return[`run`,...t===void 0?[]:[`--app-port`,String(t)],`react-router`,...j({host:e,port:void 0})]}function N(e){if(e===void 0)return;let t=Number(e);if(!Number.isInteger(t)||t<=0||t>65535)throw Error(`COREFRAME_WEB_PORT must be a valid TCP port.`);return t}export{b as devDebugFeatures,y as devPlatforms,x as managedDevOverlayDebugEnv,S as resolveDevPlatforms,E as runDevServer};
|
package/dist/runner.d.ts
CHANGED
package/dist/runner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join as e}from"node:path";import{mkdtempSync as t,writeFileSync as n}from"node:fs";import{tmpdir as r}from"node:os";import*as i from"cmd-ts";import{inspect as a}from"node:util";function o(i,{formatMessage:a,temporaryDirectory:o=r(),write:s=e=>console.error(e)}={}){let u=f(i),d=m(c(i,a),u);try{let r=e(t(e(o,`coreframe-error-`)),`error.log`);return n(r,`${m(l(i),u)}\n`,{mode:384}),s(`Error: ${d}\nFull diagnostic: ${r}`),r}catch{s(`Error: ${d}\nThe full diagnostic could not be written to the temporary directory.`);return}}function s(e,t={}){let n=typeof e==`function`?e:()=>i.run(i.binary(e),process.argv),r=!1,a=e=>{r||(r=!0,o(e,t),process.exit(1))};process.once(`uncaughtException`,a),process.once(`unhandledRejection`,a),Promise.resolve().then(n).catch(a)}function c(e,t){try{return t?.(e)||(e instanceof Error?e.message:String(e)).split(/\r?\n/,1)[0]||`Unknown error`}catch{return`Unknown error`}}function l(e){try{let t=u(e);if(!(e instanceof Error)||!d(t))return a(t,{customInspect:!1,depth:10});let n=typeof t.stack==`string`?t.stack:`${e.name}: ${e.message}`;return delete t.name,delete t.message,delete t.stack,`${n}${Reflect.ownKeys(t).length?`\n${a(t,{customInspect:!1,depth:10})}`:``}`}catch{return`The thrown value could not be inspected.`}}function u(e,t=new WeakMap){if((typeof e!=`object`||!e)&&typeof e!=`function`)return e;let n=e,r=t.get(n);if(r)return r;if(typeof e==`function`)return`[Function${e.name?`: ${e.name}`:``}]`;let i=Array.isArray(e)?[]:{};t.set(n,i),e instanceof Error&&(i.name=e.name,i.message=e.message,i.stack=e.stack??`${e.name}: ${e.message}`);for(let r of Reflect.ownKeys(n)){if(typeof r!=`string`||r.toLowerCase()===`env`||Array.isArray(e)&&r===`length`||e instanceof Error&&(r===`name`||r===`message`||r===`stack`))continue;let a=Object.getOwnPropertyDescriptor(n,r);!a||!(`value`in a)||Object.defineProperty(i,r,{configurable:!0,enumerable:!0,value:u(a.value,t),writable:!0})}return i}function d(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function f(e,t=new WeakSet){let n=new Set;function r(e){if((typeof e!=`object`||!e)&&typeof e!=`function`)return;let i=e;if(!t.has(i)){t.add(i);for(let e of Reflect.ownKeys(i)){if(typeof e!=`string`)continue;let t=Object.getOwnPropertyDescriptor(i,e);!t||!(`value`in t)||(e.toLowerCase()===`env`?p(t.value,n):r(t.value))}}}try{r(e)}catch{}return n}function p(e,t){if(!(typeof e!=`object`||!e))for(let n of Reflect.ownKeys(e)){let r=Object.getOwnPropertyDescriptor(e,n);r&&`value`in r&&typeof r.value==`string`&&r.value&&t.add(r.value)}}function m(e,t){return[...t].sort((e,t)=>t.length-e.length).reduce((e,t)=>e.replaceAll(t,`[redacted environment value]`),e)}export{o as reportCliError,s as run};
|
|
1
|
+
import{join as e}from"node:path";import{mkdtempSync as t,writeFileSync as n}from"node:fs";import{tmpdir as r}from"node:os";import*as i from"@alloc/cmd-ts";import{inspect as a}from"node:util";function o(i,{formatMessage:a,temporaryDirectory:o=r(),write:s=e=>console.error(e)}={}){let u=f(i),d=m(c(i,a),u);try{let r=e(t(e(o,`coreframe-error-`)),`error.log`);return n(r,`${m(l(i),u)}\n`,{mode:384}),s(`Error: ${d}\nFull diagnostic: ${r}`),r}catch{s(`Error: ${d}\nThe full diagnostic could not be written to the temporary directory.`);return}}function s(e,t={}){let n=typeof e==`function`?e:()=>i.run(i.binary(e),process.argv),r=!1,a=e=>{r||(r=!0,o(e,t),process.exit(1))};process.once(`uncaughtException`,a),process.once(`unhandledRejection`,a),Promise.resolve().then(n).catch(a)}function c(e,t){try{return t?.(e)||(e instanceof Error?e.message:String(e)).split(/\r?\n/,1)[0]||`Unknown error`}catch{return`Unknown error`}}function l(e){try{let t=u(e);if(!(e instanceof Error)||!d(t))return a(t,{customInspect:!1,depth:10});let n=typeof t.stack==`string`?t.stack:`${e.name}: ${e.message}`;return delete t.name,delete t.message,delete t.stack,`${n}${Reflect.ownKeys(t).length?`\n${a(t,{customInspect:!1,depth:10})}`:``}`}catch{return`The thrown value could not be inspected.`}}function u(e,t=new WeakMap){if((typeof e!=`object`||!e)&&typeof e!=`function`)return e;let n=e,r=t.get(n);if(r)return r;if(typeof e==`function`)return`[Function${e.name?`: ${e.name}`:``}]`;let i=Array.isArray(e)?[]:{};t.set(n,i),e instanceof Error&&(i.name=e.name,i.message=e.message,i.stack=e.stack??`${e.name}: ${e.message}`);for(let r of Reflect.ownKeys(n)){if(typeof r!=`string`||r.toLowerCase()===`env`||Array.isArray(e)&&r===`length`||e instanceof Error&&(r===`name`||r===`message`||r===`stack`))continue;let a=Object.getOwnPropertyDescriptor(n,r);!a||!(`value`in a)||Object.defineProperty(i,r,{configurable:!0,enumerable:!0,value:u(a.value,t),writable:!0})}return i}function d(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function f(e,t=new WeakSet){let n=new Set;function r(e){if((typeof e!=`object`||!e)&&typeof e!=`function`)return;let i=e;if(!t.has(i)){t.add(i);for(let e of Reflect.ownKeys(i)){if(typeof e!=`string`)continue;let t=Object.getOwnPropertyDescriptor(i,e);!t||!(`value`in t)||(e.toLowerCase()===`env`?p(t.value,n):r(t.value))}}}try{r(e)}catch{}return n}function p(e,t){if(!(typeof e!=`object`||!e))for(let n of Reflect.ownKeys(e)){let r=Object.getOwnPropertyDescriptor(e,n);r&&`value`in r&&typeof r.value==`string`&&r.value&&t.add(r.value)}}function m(e,t){return[...t].sort((e,t)=>t.length-e.length).reduce((e,t)=>e.replaceAll(t,`[redacted environment value]`),e)}export{o as reportCliError,s as run};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coreframe/scripts",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.41",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/airlock-labs/coreframe.git",
|
|
@@ -21,9 +21,10 @@
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
+
"@alloc/cmd-ts": "0.17.1",
|
|
24
25
|
"@aws-sdk/client-s3": "^3.1090.0",
|
|
25
26
|
"@clack/prompts": "^1.6.0",
|
|
26
|
-
"
|
|
27
|
+
"@vercel/detect-agent": "^1.2.3",
|
|
27
28
|
"cross-keychain": "1.1.0",
|
|
28
29
|
"drizzle-orm": "1.0.0-rc.4",
|
|
29
30
|
"import-meta-resolve": "^4.2.0",
|
|
@@ -31,7 +32,7 @@
|
|
|
31
32
|
"mp4box": "^2.4.1",
|
|
32
33
|
"music-metadata": "^11.14.0",
|
|
33
34
|
"nano-spawn": "^2.1.0",
|
|
34
|
-
"procband": "^0.3.
|
|
35
|
+
"procband": "^0.3.8",
|
|
35
36
|
"saxes": "^6.0.0",
|
|
36
37
|
"tinyglobby": "^0.2.17",
|
|
37
38
|
"yaml": "^2.9.0"
|