@stacksjs/actions 0.75.597 → 0.75.598
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/desktop-macos.js +3 -3
- package/dist/build/desktop-release-macos.d.ts +1 -0
- package/dist/build/desktop-release-macos.js +3 -0
- package/dist/build/desktop-release-shared.d.ts +59 -0
- package/dist/build/desktop-release-shared.js +5 -0
- package/dist/build/desktop-release.js +1 -5
- package/dist/build/dmg-macos.js +1 -1
- package/dist/build/macos-native.d.ts +14 -1
- package/dist/build/macos-native.js +2 -2
- package/dist/build/notarize.d.ts +24 -0
- package/dist/build/notarize.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +42 -42
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createHash}from"node:crypto";import{existsSync,readFileSync,writeFileSync}from"node:fs";import{join}from"node:path";import process from"node:process";import{log}from"@stacksjs/cli";import{assembleMacosApp,findDevelopmentIdentity,loadMacosDesktop,renderAgentEntry}from"@stacksjs/desktop-build";import{projectPath}from"@stacksjs/path";import{macosAgentDevFiles,macosAgentDevManifest,macosAgentEntry,prepareMacosAgent,prepareMacosNative}from"./macos-native";process.exitCode=1;const root=projectPath();const pkg=existsSync(join(root,"package.json"))?JSON.parse(readFileSync(join(root,"package.json"),"utf8")):{};const config=await loadMacosDesktop(root,pkg.version);if(!config)throw new Error("config/desktop.ts has no macos section. Add one, or build the Craft web-view app with `buddy build:desktop` without it.");const
|
|
2
|
-
`);await log.info(`Starting ${config.appName} with its agent (Ctrl-C quits)`);const child=Bun.spawn(["bun",files.entry],{cwd:root,env:{...process.env,STACKS_DESKTOP_AGENT_MANIFEST:files.manifest},stdio:["inherit","inherit","inherit"]});process.exitCode=await child.exited;process.exit()}const agent=config.agent?await prepareMacosAgent(config,prepared,
|
|
3
|
-
`);await log.success(`Built ${assembled.appPath}`);if(
|
|
1
|
+
import{createHash}from"node:crypto";import{existsSync,readFileSync,writeFileSync}from"node:fs";import{join}from"node:path";import process from"node:process";import{log}from"@stacksjs/cli";import{assembleMacosApp,developerIdProblem,findDeveloperIdIdentity,findDevelopmentIdentity,loadMacosDesktop,macosBuildRecordFile,macosSelfUpdates,renderAgentEntry}from"@stacksjs/desktop-build";import{projectPath}from"@stacksjs/path";import{macosAgentDevFiles,macosAgentDevManifest,macosAgentEntry,prepareMacosAgent,prepareMacosNative}from"./macos-native";process.exitCode=1;const root=projectPath();const pkg=existsSync(join(root,"package.json"))?JSON.parse(readFileSync(join(root,"package.json"),"utf8")):{};const config=await loadMacosDesktop(root,pkg.version);if(!config)throw new Error("config/desktop.ts has no macos section. Add one, or build the Craft web-view app with `buddy build:desktop` without it.");const requested=process.env.DESKTOP_DISTRIBUTION||"development";if(requested!=="development"&&requested!=="developer-id")throw new Error(`DESKTOP_DISTRIBUTION is "${requested}". It is development or developer-id; the Mac App Store app is \`buddy desktop:apple:package\`.`);const distribution=requested;const launching=process.env.STACKS_DESKTOP_LAUNCH==="1";if(distribution==="developer-id"&&launching)throw new Error("A Developer ID build is what a release ships, not what `buddy dev:desktop` runs. Unset DESKTOP_DISTRIBUTION.");const packageOnly=process.env.DESKTOP_RELEASE_PACKAGE_ONLY==="1";const rehearsal=distribution==="developer-id"&&(process.env.DESKTOP_RELEASE_DRY_RUN==="1"||packageOnly);const prepared=await prepareMacosNative(config,{root,distribution});if(config.agent&&launching){const files=macosAgentDevFiles(prepared);writeFileSync(files.entry,renderAgentEntry({agentEntry:macosAgentEntry(root,config)}));writeFileSync(files.manifest,`${JSON.stringify(macosAgentDevManifest(config,prepared),null,2)}
|
|
2
|
+
`);await log.info(`Starting ${config.appName} with its agent (Ctrl-C quits)`);const child=Bun.spawn(["bun",files.entry],{cwd:root,env:{...process.env,STACKS_DESKTOP_AGENT_MANIFEST:files.manifest},stdio:["inherit","inherit","inherit"]});process.exitCode=await child.exited;process.exit()}const agent=config.agent?await prepareMacosAgent(config,prepared,distribution):undefined;const identity=distribution==="developer-id"?process.env.DESKTOP_SIGNING_IDENTITY||process.env.APPLE_SIGNING_IDENTITY||findDeveloperIdIdentity()||(rehearsal?"-":undefined):process.env.DESKTOP_SIGNING_IDENTITY||process.env.APPLE_DEVELOPMENT_IDENTITY||findDevelopmentIdentity()||"-";if(!identity)throw new Error("A Developer ID build needs a Developer ID Application certificate, and this keychain has none. Pass --identity (or DESKTOP_SIGNING_IDENTITY) with its name or hash; https://developer.apple.com/account/resources/certificates issues one.");const sandboxed=distribution==="development"&&process.env.DESKTOP_SANDBOX==="1";const assembled=assembleMacosApp({config,root,host:prepared.host,nativeBundle:prepared.nativeBundle,output:prepared.output,distribution,signingIdentity:identity,unsandboxed:!sandboxed,agent,rehearsal});for(const note of assembled.notes)await log.warn(note);for(const key of assembled.ignoredPlistKeys)await log.warn(`macos.infoPlist: ${key} is set by the build and was ignored`);if(distribution==="developer-id"){if(process.env.DESKTOP_SANDBOX==="1")await log.warn("DESKTOP_SANDBOX is ignored: a Developer ID build is not sandboxed, so the app can replace its own bundle when it updates.");if(rehearsal&&identity==="-"){await log.warn(packageOnly?"Signed ad hoc: no signing identity was given and this keychain has no Developer ID Application certificate. Good for a check; no other Mac opens it, and Pantry refuses to release it.":"Signed ad hoc for the dry run: there is no Developer ID Application certificate here. The release itself needs one.")}else{const signature=Bun.spawnSync(["codesign","-dvv",assembled.appPath],{stderr:"pipe"});const problem=developerIdProblem(`${signature.stdout.toString()}${signature.stderr.toString()}`);if(problem)throw new Error(`${assembled.appPath} is not a Developer ID build: ${problem} It was signed with "${identity}".`)}}const revision=Bun.spawnSync(["git","rev-parse","HEAD"],{cwd:root,stdout:"pipe",stderr:"ignore"});const record={appName:config.appName,bundleId:config.bundleId,version:config.version,buildNumber:config.buildNumber,url:config.agent?null:config.url,agent:Boolean(config.agent),webkit:config.webkit===true,host:{key:prepared.hostKey,sha256:createHash("sha256").update(readFileSync(prepared.host)).digest("hex")},signedWith:identity==="-"?"ad hoc":identity,sandboxed,distribution,updater:prepared.updater&&macosSelfUpdates(config,distribution),architecture:process.arch,sourceRevision:revision.exitCode===0?revision.stdout.toString().trim():null};writeFileSync(macosBuildRecordFile(prepared.output,config.appName),`${JSON.stringify(record,null,2)}
|
|
3
|
+
`);await log.success(`Built ${assembled.appPath}`);if(launching){await log.info(config.agent?`Opening ${config.appName} with its agent`:`Opening ${config.appName} against ${config.url}`);Bun.spawn(["open","-n",assembled.appPath],{stdout:"inherit",stderr:"inherit"})}process.exitCode=0;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{existsSync,mkdirSync,mkdtempSync,readFileSync,rmSync}from"node:fs";import{tmpdir}from"node:os";import{join,resolve}from"node:path";import process from"node:process";import{log}from"@stacksjs/cli";import{DEFAULT_UPDATE_PREFIX,desktopUpdatesCollision,developerIdProblem,loadDesktopConfig,loadMacosDesktop,macosOutputDirectory,macosReleasePlan,readMacosBuildRecord,resolveDmgPackaging,validateMacosDesktop}from"@stacksjs/desktop-build";import{projectPath}from"@stacksjs/path";import{assertReleasable,assertReleaseSource,publishPlannedReleases,releaseSigningKey,releaseStore}from"./desktop-release-shared";import{notaryArguments,packageMacRelease}from"./notarize";process.exitCode=1;if(process.platform!=="darwin")throw new Error("A native macOS app is signed and notarized on macOS. Run this release on a Mac.");const root=projectPath();const pkg=existsSync(join(root,"package.json"))?JSON.parse(readFileSync(join(root,"package.json"),"utf8")):{};const config=await loadMacosDesktop(root,pkg.version);if(!config)throw new Error("config/desktop.ts has no macos section.");const errors=validateMacosDesktop(config);if(errors.length)throw new Error(`config/desktop.ts macos cannot be released:
|
|
2
|
+
${errors.map((error)=>` - ${error}`).join(`
|
|
3
|
+
`)}`);const dryRun=process.env.DESKTOP_RELEASE_DRY_RUN==="1";const packageOnly=process.env.DESKTOP_RELEASE_PACKAGE_ONLY==="1";if(dryRun&&packageOnly)throw new Error("--package-only publishes nothing, so there is nothing for --dry-run to hold back. Pass one of them.");const updates=config.updates;if(!updates&&!packageOnly)throw new Error("config/desktop.ts has no macos.updates: a release needs the feed URL and the public keys the app trusts. `--package-only` makes the signed app and DMG without a feed.");if(updates&&!packageOnly){const collision=desktopUpdatesCollision(await loadDesktopConfig(root)??{});if(collision)throw new Error(collision)}const output=macosOutputDirectory(root,config);const app=join(output,`${config.appName}.app`);const build=readMacosBuildRecord(output,config.appName);if(!build||!existsSync(app))throw new Error("Nothing was built. Run this without --skip-build, which builds the Developer ID app first.");if(build.version!==config.version)throw new Error(`The build is ${build.version} but the config says ${config.version}. Build again.`);if(build.distribution!=="developer-id")throw new Error(`${app} was built for ${build.distribution}, not for release. Drop --skip-build: the release builds the Developer ID app itself.`);if(updates&&!packageOnly&&!build.updater)throw new Error(`${app} was built without the updater, so the release it published would be the last one it ever installed. Build again with a craft-native that has it.`);const{target,staged,update,dmg}=macosReleasePlan({output,appName:config.appName,version:config.version,architecture:build.architecture});const releaseDir=join(output,"release");let sourceRevision="";if(!packageOnly){if(!build.sourceRevision||!/^[0-9a-f]{40}$/.test(build.sourceRevision))throw new Error("A release names the commit it was built from, and this build has none. Build from a Git checkout.");sourceRevision=build.sourceRevision;assertReleaseSource(root,sourceRevision)}const unsignedPackage=packageOnly&&build.signedWith==="ad hoc";if(!dryRun&&!unsignedPackage){const signature=Bun.spawnSync(["codesign","-dvv",app],{stderr:"pipe"});const problem=developerIdProblem(`${signature.stdout.toString()}${signature.stderr.toString()}`);if(problem)throw new Error(`${app} cannot be released: ${problem} Build again with --identity (or DESKTOP_SIGNING_IDENTITY) naming a Developer ID Application certificate.`)}const signingIdentity=process.env.DESKTOP_SIGNING_IDENTITY||process.env.APPLE_SIGNING_IDENTITY||(build.signedWith==="ad hoc"?undefined:build.signedWith);const notary=dryRun||packageOnly?undefined:resolveDmgPackaging({flags:{notarize:true},env:process.env}).notary;const planned={target,directory:staged,update,downloads:[dmg]};const publishing=updates&&!packageOnly?{updates,key:releaseSigningKey(updates,"macos.updates"),destination:{store:await releaseStore(updates,dryRun),updates,channel:process.env.DESKTOP_RELEASE_CHANNEL||updates.channel||"stable",prefix:updates.prefix??DEFAULT_UPDATE_PREFIX,dryRun},notes:process.env.DESKTOP_RELEASE_NOTES?readFileSync(resolve(root,process.env.DESKTOP_RELEASE_NOTES),"utf8").trim():undefined}:undefined;if(publishing)await assertReleasable(publishing.destination,"macos.updates",planned.target,config.version,update);rmSync(staged,{recursive:true,force:true});mkdirSync(staged,{recursive:true});await log.info(`Preparing ${target}`);const scratch=mkdtempSync(join(tmpdir(),"stacks-desktop-release-"));try{await packageMacRelease({app,appName:config.appName,dmg,scratch,...packageOnly?{}:{updateZip:update},...dryRun?{}:{signingIdentity,...notary?{auth:notaryArguments(notary)}:{}}})}finally{rmSync(scratch,{recursive:true,force:true})}if(publishing){await publishPlannedReleases({...publishing.destination,planned:[planned],appName:config.appName,version:config.version,sourceRevision,privateKey:publishing.key.privateKey,keyId:publishing.key.keyId,notes:publishing.notes,releaseDir})}else{await log.success(`Packaged ${dmg}`);if(unsignedPackage)await log.warn("Signed ad hoc, so this package can be checked and cannot be released. Give the build a Developer ID Application identity (APPLE_SIGNING_IDENTITY, DESKTOP_SIGNING_IDENTITY or --identity).");else await log.info("Signed with Developer ID, not notarized and not published: `--package-only` leaves both to what runs it (Pantry's native app pipeline).")}process.exitCode=0;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { DesktopTargetName, DesktopUpdatesConfig } from '@stacksjs/types';
|
|
2
|
+
import type { DesktopUpdateManifest, ReleaseRecordDownload, UpdateStore } from '@stacksjs/desktop-build';
|
|
3
|
+
/** The key a release signs with: `DESKTOP_UPDATE_PRIVATE_KEY`, which has to be the private half of a key the app trusts. */
|
|
4
|
+
export declare function releaseSigningKey(updates: DesktopUpdatesConfig, section: string, privateKey?: string | undefined): { privateKey: string, keyId: string };
|
|
5
|
+
/** The disk a release is written to. A dry run writes nowhere and names its URLs on a host that cannot resolve. */
|
|
6
|
+
export declare function releaseStore(updates: DesktopUpdatesConfig, dryRun: boolean): Promise<UpdateStore>;
|
|
7
|
+
/**
|
|
8
|
+
* Why a target cannot be released at this version, thrown before anything is
|
|
9
|
+
* built into an artifact: the URL its manifest would name is on this machine
|
|
10
|
+
* (`DESKTOP_RELEASE_ALLOW_LOCAL_URL=1` lets one through, for rehearsing
|
|
11
|
+
* against a local server), or the feed already serves this version or a newer
|
|
12
|
+
* one. A feed never goes backwards and never serves two builds under one number.
|
|
13
|
+
*/
|
|
14
|
+
export declare function assertReleasable(destination: ReleaseDestination, section: string, target: DesktopTargetName, version: string, updateFile: string): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Publish every planned target: its other downloads, then the artifact an app
|
|
17
|
+
* updates from with the signed manifest that names it, then the channel's
|
|
18
|
+
* `release.json`. Called only once every target's artifacts are made and
|
|
19
|
+
* verified, so a failure on the last one does not leave the first in the feed.
|
|
20
|
+
*/
|
|
21
|
+
export declare function publishPlannedReleases(options: PublishReleaseOptions): Promise<Array<{ target: DesktopTargetName, manifest: DesktopUpdateManifest, downloads: ReleaseRecordDownload[] }>>;
|
|
22
|
+
/**
|
|
23
|
+
* Refuse a release whose build did not come out of a clean checkout of HEAD:
|
|
24
|
+
* an uncommitted edit would ship with nothing naming it.
|
|
25
|
+
* `DESKTOP_RELEASE_ALLOW_DIRTY=1` (`--allow-dirty`) lets it through.
|
|
26
|
+
*/
|
|
27
|
+
export declare function assertReleaseSource(root: string, sourceRevision: string): void;
|
|
28
|
+
/**
|
|
29
|
+
* The half of `buddy release:desktop` that is the same for a web view app
|
|
30
|
+
* (build/desktop-release.ts) and a native macOS one
|
|
31
|
+
* (build/desktop-release-macos.ts): which key signs, where a release is
|
|
32
|
+
* stored, what refuses it before anything is uploaded, and the publish itself.
|
|
33
|
+
* One storage layout and one manifest format, so the feed and a download page
|
|
34
|
+
* read either kind of app the same way.
|
|
35
|
+
*/
|
|
36
|
+
/** One target's artifacts, made and ready to publish. */
|
|
37
|
+
export declare interface PlannedRelease {
|
|
38
|
+
target: DesktopTargetName
|
|
39
|
+
directory: string
|
|
40
|
+
update: string
|
|
41
|
+
downloads: string[]
|
|
42
|
+
}
|
|
43
|
+
export declare interface ReleaseDestination {
|
|
44
|
+
store: UpdateStore
|
|
45
|
+
updates: DesktopUpdatesConfig
|
|
46
|
+
channel: string
|
|
47
|
+
prefix: string
|
|
48
|
+
dryRun: boolean
|
|
49
|
+
}
|
|
50
|
+
export declare interface PublishReleaseOptions extends ReleaseDestination {
|
|
51
|
+
planned: PlannedRelease[]
|
|
52
|
+
appName: string
|
|
53
|
+
version: string
|
|
54
|
+
sourceRevision: string
|
|
55
|
+
privateKey: string
|
|
56
|
+
keyId: string
|
|
57
|
+
notes?: string
|
|
58
|
+
releaseDir: string
|
|
59
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{existsSync,mkdirSync,readFileSync,writeFileSync}from"node:fs";import{basename,join}from"node:path";import process from"node:process";import{log}from"@stacksjs/cli";import{artifactUrlProblem,compareVersions,describeArtifact,mergeReleaseRecord,publishDesktopUpdate,publishedArtifactUrl,releaseArtifactFormat,releaseRecordKey,releaseVersionProblem,splitDesktopTarget,storageUpdateStore,updateArtifactKey,updateManifestKey,updatePublicKey,validateUpdateManifest}from"@stacksjs/desktop-build";export function releaseSigningKey(updates,section,privateKey=process.env.DESKTOP_UPDATE_PRIVATE_KEY){if(!privateKey)throw new Error("DESKTOP_UPDATE_PRIVATE_KEY is not set. It is the private half `buddy desktop:update:keypair` printed.");const publicKey=updatePublicKey(privateKey);const keyId=Object.entries(updates.publicKeys).find(([,key])=>key===publicKey)?.[0];if(!keyId)throw new Error(`DESKTOP_UPDATE_PRIVATE_KEY does not match any key in ${section}.publicKeys: installed apps would refuse what it signs.`);return{privateKey,keyId}}export async function releaseStore(updates,dryRun){return dryRun?{read:async()=>null,write:async()=>{},publicUrl:async(key)=>`https://dry-run.invalid/${key}`}:storageUpdateStore(updates.disk)}export async function assertReleasable(destination,section,target,version,updateFile){const{platform,architecture}=splitDesktopTarget(target);const location={platform,architecture,channel:destination.channel,prefix:destination.prefix};const{updates,store}=destination;const existing=await store.read(updateManifestKey(location));const url=await publishedArtifactUrl({store,artifactBaseUrl:updates.artifactBaseUrl,feedUrl:updates.feedUrl,...location},version,basename(updateFile));const unreachable=artifactUrlProblem(url);if(unreachable&&process.env.DESKTOP_RELEASE_ALLOW_LOCAL_URL!=="1")throw new Error(`${target}: ${unreachable}. Set ${section}.${updates.artifactBaseUrl?"artifactBaseUrl":"feedUrl"} to the address the app is served from.`);const problem=releaseVersionProblem(version,existing?validateUpdateManifest(JSON.parse(existing)).version:null,compareVersions);if(problem)throw new Error(`${target}: ${problem}`)}export async function publishPlannedReleases(options){const{store,updates,channel,prefix,dryRun,version}=options;const published=[];for(const item of options.planned){const{platform,architecture}=splitDesktopTarget(item.target);const location={platform,architecture,channel,prefix};const others=new Map;for(const file of item.downloads){if(file===item.update)continue;const key=updateArtifactKey(location,version,basename(file));await store.write(key,readFileSync(file));const{sha256,size}=await describeArtifact(file);const url=await publishedArtifactUrl({store,artifactBaseUrl:updates.artifactBaseUrl,feedUrl:updates.feedUrl,...location},version,basename(file));others.set(file,{name:basename(file),format:releaseArtifactFormat(file),url,sha256,bytes:size})}const manifest=await publishDesktopUpdate({store,artifact:item.update,version,sourceRevision:options.sourceRevision,privateKey:options.privateKey,keyId:options.keyId,notes:options.notes,artifactBaseUrl:updates.artifactBaseUrl,feedUrl:updates.feedUrl,...location});writeFileSync(join(item.directory,"latest.json"),`${JSON.stringify(manifest,null,2)}
|
|
2
|
+
`);const downloads=item.downloads.map((file)=>others.get(file)??{name:basename(file),format:releaseArtifactFormat(file),url:manifest.url,sha256:manifest.sha256,bytes:manifest.size});published.push({target:item.target,manifest,downloads});await log.success(`${item.target}: ${dryRun?"would publish":"published"} ${basename(item.update)} (${manifest.size} bytes, sha256 ${manifest.sha256})`)}const thisRun={version,channel,sourceRevision:options.sourceRevision,publishedAt:new Date().toISOString(),targets:published.map((item)=>({target:item.target,update:{name:basename(item.manifest.url),format:releaseArtifactFormat(item.manifest.url),url:item.manifest.url,sha256:item.manifest.sha256,bytes:item.manifest.size},downloads:item.downloads}))};const recordKey=releaseRecordKey({channel,prefix});const localRecord=join(options.releaseDir,"release.json");const stored=dryRun?existsSync(localRecord)?readFileSync(localRecord,"utf8"):null:await store.read(recordKey);const summary=mergeReleaseRecord(stored,thisRun);mkdirSync(options.releaseDir,{recursive:true});writeFileSync(localRecord,`${JSON.stringify(summary,null,2)}
|
|
3
|
+
`);if(!dryRun)await store.write(recordKey,`${JSON.stringify(summary,null,2)}
|
|
4
|
+
`);await log.success(dryRun?`Dry run: nothing was notarized or uploaded. See ${options.releaseDir}`:`Released ${options.appName} ${version} on ${channel} for ${published.map((item)=>item.target).join(", ")}`);return published}export function assertReleaseSource(root,sourceRevision){if(process.env.DESKTOP_RELEASE_ALLOW_DIRTY==="1")return;const dirty=Bun.spawnSync(["git","status","--porcelain"],{cwd:root,stdout:"pipe"}).stdout.toString().trim();const head=Bun.spawnSync(["git","rev-parse","HEAD"],{cwd:root,stdout:"pipe"}).stdout.toString().trim();if(dirty)throw new Error(`The working tree is not clean, and the build came out of it. Commit these first:
|
|
5
|
+
${dirty}`);if(head!==sourceRevision)throw new Error(`The build is from ${sourceRevision.slice(0,12)} but HEAD is ${head.slice(0,12)}. Build again.`)}
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
import{copyFileSync,
|
|
2
|
-
${dirty}`);if(head!==sourceRevision)throw new Error(`The build is from ${sourceRevision.slice(0,12)} but HEAD is ${head.slice(0,12)}. Build again.`)}const privateKey=process.env.DESKTOP_UPDATE_PRIVATE_KEY;if(!privateKey)throw new Error("DESKTOP_UPDATE_PRIVATE_KEY is not set. It is the private half `buddy desktop:update:keypair` printed.");const publicKey=updatePublicKey(privateKey);const keyId=Object.entries(config.updates.publicKeys).find(([,key])=>key===publicKey)?.[0];if(!keyId)throw new Error("DESKTOP_UPDATE_PRIVATE_KEY does not match any key in webview.updates.publicKeys: installed apps would refuse what it signs.");const notes=process.env.DESKTOP_RELEASE_NOTES?readFileSync(resolve(root,process.env.DESKTOP_RELEASE_NOTES),"utf8").trim():undefined;const{signingIdentity,notary}=resolveDmgPackaging({flags:{},env:process.env});const store=dryRun?{read:async()=>null,write:async()=>{},publicUrl:async(key)=>`https://dry-run.invalid/${key}`}:await storageUpdateStore(config.updates.disk);const artifactUrl=(location,file)=>publishedArtifactUrl({store,artifactBaseUrl:updates.artifactBaseUrl,feedUrl:updates.feedUrl,...location},config.version,basename(file));const planned=[];for(const item of build.targets){const{platform,architecture}=splitDesktopTarget(item.target);const directory=join(output,item.directory);const names=releaseArtifactNames(config,item.target);const staged=join(releaseDir,item.target);const location={platform,architecture,channel,prefix};const existing=await store.read(updateManifestKey(location));const unreachable=artifactUrlProblem(await artifactUrl(location,names.update));if(unreachable&&process.env.DESKTOP_RELEASE_ALLOW_LOCAL_URL!=="1"){throw new Error(`${item.target}: ${unreachable}. Set webview.updates.${updates.artifactBaseUrl?"artifactBaseUrl":"feedUrl"} to the address the app is served from.`)}const problem=releaseVersionProblem(config.version,existing?validateUpdateManifest(JSON.parse(existing)).version:null,compareVersions);if(problem)throw new Error(`${item.target}: ${problem}`);if(platform==="darwin"){const app=join(directory,`${config.appName}.app`);if(process.platform!=="darwin"||!existsSync(app))throw new Error(`${item.target}: the .app is signed and notarized on macOS. Run this release on a Mac.`);if(!dryRun){if(!signingIdentity||!notary)throw new Error(`${item.target}: a release needs a Developer ID identity and notary credentials: --identity and --notary-profile (or DESKTOP_SIGNING_IDENTITY / DESKTOP_NOTARY_PROFILE).`);const signatureProblem=()=>{const signature=Bun.spawnSync(["codesign","-dvv",app],{stderr:"pipe"});return developerIdProblem(`${signature.stdout.toString()}${signature.stderr.toString()}`)};if(signatureProblem()){await log.info(`${item.target}: signing ${config.appName}.app with ${signingIdentity}`);resignWebviewMacosApp({appPath:app,config,signingIdentity,entitlementsPath:join(directory,`${config.appName}.entitlements`)})}const unsigned=signatureProblem();if(unsigned)throw new Error(`${item.target}: ${app} cannot be notarized: ${unsigned} It was signed with "${signingIdentity}": --identity (or DESKTOP_SIGNING_IDENTITY) must name a Developer ID Application certificate.`)}const dmg=join(staged,names.downloads[0]);planned.push({target:item.target,directory:staged,update:join(staged,names.update),downloads:[dmg],prepare:async()=>{const scratch=mkdtempSync(join(tmpdir(),"stacks-desktop-release-"));try{const auth=!dryRun&¬ary?notaryArguments(notary):undefined;if(auth)await notarizeAndStaple(app,`${config.appName}.app`,auth,scratch);run(["ditto","-c","-k","--keepParent",app,join(staged,names.update)]);const staging=join(scratch,"dmg");mkdirSync(staging,{recursive:true});cpSync(app,join(staging,`${config.appName}.app`),{recursive:true,verbatimSymlinks:true});await imageDmg({staging,volumeName:config.appName,dmgPath:dmg,...dryRun?{}:{signingIdentity}});if(auth){await notarizeAndStaple(dmg,"the DMG",auth,scratch);run(["codesign","--verify","--deep","--strict",app]);run(["spctl","-a","-t","open","--context","context:primary-signature",dmg]);run(["xcrun","stapler","validate",dmg])}}finally{rmSync(scratch,{recursive:true,force:true})}}});continue}const packages=join(directory,"packages");const made=item.artifacts.map((artifact)=>join(directory,artifact.name));const find=(extension)=>made.find((file)=>file.toLowerCase().endsWith(extension)&&existsSync(file));const wanted=platform==="win32"?".msi":".appimage";const installer=find(wanted);if(!installer){throw new Error(`${item.target}: there is no ${platform==="win32"?"MSI":"AppImage"} in ${packages}. Run \`buddy build:desktop --target ${item.target} --package\` on ${platform==="win32"?"Windows":"Linux"}, then release with --skip-build.`)}const staging=names.downloads.map((name)=>({name,from:name===names.update?installer:find(name.slice(name.lastIndexOf(".")).toLowerCase())})).filter((entry)=>Boolean(entry.from));planned.push({target:item.target,directory:staged,update:join(staged,names.update),downloads:staging.map((entry)=>join(staged,entry.name)),prepare:async()=>{copyFileSync(installer,join(staged,names.update));for(const entry of staging)if(entry.name!==names.update)copyFileSync(entry.from,join(staged,entry.name))}})}if(!planned.length)throw new Error("The build has no targets to release.");function run(command){console.log(`> ${command.join(" ")}`);const result=Bun.spawnSync(command,{stdout:"inherit",stderr:"inherit"});if(result.exitCode!==0)throw new Error(`${command[0]} exited with ${result.exitCode}`)}for(const item of planned){rmSync(item.directory,{recursive:true,force:true});mkdirSync(item.directory,{recursive:true});await log.info(`Preparing ${item.target}`);await item.prepare()}const published=[];for(const item of planned){const{platform,architecture}=splitDesktopTarget(item.target);const location={platform,architecture,channel,prefix};const others=new Map;for(const file of item.downloads){if(file===item.update)continue;const key=updateArtifactKey(location,config.version,basename(file));await store.write(key,readFileSync(file));const{sha256,size}=await describeArtifact(file);others.set(file,{name:basename(file),format:releaseArtifactFormat(file),url:await artifactUrl(location,file),sha256,bytes:size})}const manifest=await publishDesktopUpdate({store,artifact:item.update,version:config.version,sourceRevision,privateKey,keyId,notes,artifactBaseUrl:updates.artifactBaseUrl,feedUrl:updates.feedUrl,...location});writeFileSync(join(item.directory,"latest.json"),`${JSON.stringify(manifest,null,2)}
|
|
3
|
-
`);const downloads=item.downloads.map((file)=>others.get(file)??{name:basename(file),format:releaseArtifactFormat(file),url:manifest.url,sha256:manifest.sha256,bytes:manifest.size});published.push({target:item.target,manifest,downloads});await log.success(`${item.target}: ${dryRun?"would publish":"published"} ${basename(item.update)} (${manifest.size} bytes, sha256 ${manifest.sha256})`)}const thisRun={version:config.version,channel,sourceRevision,publishedAt:new Date().toISOString(),targets:published.map((item)=>({target:item.target,update:{name:basename(item.manifest.url),format:releaseArtifactFormat(item.manifest.url),url:item.manifest.url,sha256:item.manifest.sha256,bytes:item.manifest.size},downloads:item.downloads}))};const recordKey=releaseRecordKey({channel,prefix});const localRecord=join(releaseDir,"release.json");const stored=dryRun?existsSync(localRecord)?readFileSync(localRecord,"utf8"):null:await store.read(recordKey);const summary=mergeReleaseRecord(stored,thisRun);mkdirSync(releaseDir,{recursive:true});writeFileSync(localRecord,`${JSON.stringify(summary,null,2)}
|
|
4
|
-
`);if(!dryRun)await store.write(recordKey,`${JSON.stringify(summary,null,2)}
|
|
5
|
-
`);await log.success(dryRun?`Dry run: nothing was notarized or uploaded. See ${releaseDir}`:`Released ${config.appName} ${config.version} on ${channel} for ${published.map((item)=>item.target).join(", ")}`);process.exitCode=0;
|
|
1
|
+
import{copyFileSync,existsSync,mkdirSync,mkdtempSync,readFileSync,rmSync}from"node:fs";import{tmpdir}from"node:os";import{join,resolve}from"node:path";import process from"node:process";import{log}from"@stacksjs/cli";import{DEFAULT_UPDATE_PREFIX,desktopUpdatesCollision,developerIdProblem,loadDesktopConfig,loadWebviewDesktop,releaseArtifactNames,resignWebviewMacosApp,resolveDmgPackaging,splitDesktopTarget}from"@stacksjs/desktop-build";import{projectPath}from"@stacksjs/path";import{assertReleasable,assertReleaseSource,publishPlannedReleases,releaseSigningKey,releaseStore}from"./desktop-release-shared";import{notaryArguments,packageMacRelease}from"./notarize";process.exitCode=1;const root=projectPath();const pkg=existsSync(join(root,"package.json"))?JSON.parse(readFileSync(join(root,"package.json"),"utf8")):{};const config=await loadWebviewDesktop(root,pkg.version);if(!config)throw new Error("config/desktop.ts has no webview section.");if(!config.updates)throw new Error("config/desktop.ts has no webview.updates: a release needs the feed URL and the public keys the app trusts.");const collision=desktopUpdatesCollision(await loadDesktopConfig(root)??{});if(collision)throw new Error(collision);const dryRun=process.env.DESKTOP_RELEASE_DRY_RUN==="1";const updates=config.updates;const channel=process.env.DESKTOP_RELEASE_CHANNEL||config.updates.channel||"stable";const prefix=config.updates.prefix??DEFAULT_UPDATE_PREFIX;const output=resolve(root,config.output);const releaseDir=join(output,"release");const buildFile=join(output,"build.json");if(!existsSync(buildFile))throw new Error("Nothing was built. Run `buddy build:desktop` first, or drop --skip-build.");const build=JSON.parse(readFileSync(buildFile,"utf8"));if(build.version!==config.version)throw new Error(`The build is ${build.version} but the config says ${config.version}. Build again.`);if(!build.sourceRevision||!/^[0-9a-f]{40}$/.test(build.sourceRevision))throw new Error("A release names the commit it was built from, and this build has none. Build from a Git checkout.");const sourceRevision=build.sourceRevision;assertReleaseSource(root,sourceRevision);const{privateKey,keyId}=releaseSigningKey(updates,"webview.updates");const notes=process.env.DESKTOP_RELEASE_NOTES?readFileSync(resolve(root,process.env.DESKTOP_RELEASE_NOTES),"utf8").trim():undefined;const{signingIdentity,notary}=resolveDmgPackaging({flags:{},env:process.env});const destination={store:await releaseStore(updates,dryRun),updates,channel,prefix,dryRun};const planned=[];for(const item of build.targets){const{platform}=splitDesktopTarget(item.target);const directory=join(output,item.directory);const names=releaseArtifactNames(config,item.target);const staged=join(releaseDir,item.target);await assertReleasable(destination,"webview.updates",item.target,config.version,names.update);if(platform==="darwin"){const app=join(directory,`${config.appName}.app`);if(process.platform!=="darwin"||!existsSync(app))throw new Error(`${item.target}: the .app is signed and notarized on macOS. Run this release on a Mac.`);if(!dryRun){if(!signingIdentity||!notary)throw new Error(`${item.target}: a release needs a Developer ID identity and notary credentials: --identity and --notary-profile (or DESKTOP_SIGNING_IDENTITY / DESKTOP_NOTARY_PROFILE).`);const signatureProblem=()=>{const signature=Bun.spawnSync(["codesign","-dvv",app],{stderr:"pipe"});return developerIdProblem(`${signature.stdout.toString()}${signature.stderr.toString()}`)};if(signatureProblem()){await log.info(`${item.target}: signing ${config.appName}.app with ${signingIdentity}`);resignWebviewMacosApp({appPath:app,config,signingIdentity,entitlementsPath:join(directory,`${config.appName}.entitlements`)})}const unsigned=signatureProblem();if(unsigned)throw new Error(`${item.target}: ${app} cannot be notarized: ${unsigned} It was signed with "${signingIdentity}": --identity (or DESKTOP_SIGNING_IDENTITY) must name a Developer ID Application certificate.`)}const dmg=join(staged,names.downloads[0]);planned.push({target:item.target,directory:staged,update:join(staged,names.update),downloads:[dmg],prepare:async()=>{const scratch=mkdtempSync(join(tmpdir(),"stacks-desktop-release-"));try{await packageMacRelease({app,appName:config.appName,updateZip:join(staged,names.update),dmg,scratch,...dryRun?{}:{signingIdentity,...notary?{auth:notaryArguments(notary)}:{}}})}finally{rmSync(scratch,{recursive:true,force:true})}}});continue}const packages=join(directory,"packages");const made=item.artifacts.map((artifact)=>join(directory,artifact.name));const find=(extension)=>made.find((file)=>file.toLowerCase().endsWith(extension)&&existsSync(file));const wanted=platform==="win32"?".msi":".appimage";const installer=find(wanted);if(!installer){throw new Error(`${item.target}: there is no ${platform==="win32"?"MSI":"AppImage"} in ${packages}. Run \`buddy build:desktop --target ${item.target} --package\` on ${platform==="win32"?"Windows":"Linux"}, then release with --skip-build.`)}const staging=names.downloads.map((name)=>({name,from:name===names.update?installer:find(name.slice(name.lastIndexOf(".")).toLowerCase())})).filter((entry)=>Boolean(entry.from));planned.push({target:item.target,directory:staged,update:join(staged,names.update),downloads:staging.map((entry)=>join(staged,entry.name)),prepare:async()=>{copyFileSync(installer,join(staged,names.update));for(const entry of staging)if(entry.name!==names.update)copyFileSync(entry.from,join(staged,entry.name))}})}if(!planned.length)throw new Error("The build has no targets to release.");for(const item of planned){rmSync(item.directory,{recursive:true,force:true});mkdirSync(item.directory,{recursive:true});await log.info(`Preparing ${item.target}`);await item.prepare()}await publishPlannedReleases({...destination,planned,appName:config.appName,version:config.version,sourceRevision,privateKey,keyId,notes,releaseDir});process.exitCode=0;
|
package/dist/build/dmg-macos.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync,mkdirSync,mkdtempSync,readFileSync,rmSync}from"node:fs";import{tmpdir}from"node:os";import{join}from"node:path";import process from"node:process";import{log,parseOptions}from"@stacksjs/cli";import{developerIdProblem,loadMacosDesktop,macosOutputDirectory,resolveDmgPackaging}from"@stacksjs/desktop-build";import{projectPath,storagePath}from"@stacksjs/path";import{imageDmg,notarizeAndStaple,notaryArguments}from"./notarize";import{runBuildStep}from"./run-build-step";if(process.platform!=="darwin")throw new Error("DMG packaging only runs on macOS");const root=projectPath();const pkg=existsSync(join(root,"package.json"))?JSON.parse(readFileSync(join(root,"package.json"),"utf8")):{};const config=await loadMacosDesktop(root,pkg.version);if(!config)throw new Error("config/desktop.ts has no macos section, so build:dmg packages the Craft web-view app instead.");const flags=parseOptions();for(const[flag,name]of[["appName","--app-name"],["bundleId","--bundle-id"],["appVersion","--app-version"]]){if(flags[flag]!==undefined)await log.warn(`${name} is ignored: config/desktop.ts names, identifies and versions a macos app.`)}const{volumeName,signingIdentity,notary}=resolveDmgPackaging({flags:{...flags,appName:undefined,bundleId:undefined,appVersion:undefined},env:{...process.env,DESKTOP_APP_NAME:undefined,DESKTOP_BUNDLE_ID:undefined,DESKTOP_APP_VERSION:undefined},manifestTitle:config.appName,declaredVersion:config.version});if(notary&&!signingIdentity)throw new Error("Notarizing needs a Developer ID identity (--signing-identity or DESKTOP_SIGNING_IDENTITY): Apple only notarizes signed code.");if(signingIdentity)process.env.DESKTOP_SIGNING_IDENTITY=signingIdentity;await import("./desktop-macos");const app=join(macosOutputDirectory(root,config),`${config.appName}.app`);if(!existsSync(app))throw new Error(`build:desktop did not produce ${app}`);if(notary){const signature=Bun.spawnSync(["codesign","-dvv",app],{stderr:"pipe"});const problem=developerIdProblem(`${signature.stdout.toString()}${signature.stderr.toString()}`);if(problem)throw new Error(`${app} cannot be notarized: ${problem}`)}const outputDir=storagePath("framework/desktop-dmg");rmSync(outputDir,{recursive:true,force:true});mkdirSync(outputDir,{recursive:true});const staging=mkdtempSync(join(tmpdir(),"stacks-dmg-"));const scratch=mkdtempSync(join(tmpdir(),"stacks-dmg-work-"));process.on("exit",()=>{rmSync(staging,{recursive:true,force:true});rmSync(scratch,{recursive:true,force:true})});const auth=notary&¬aryArguments(notary);if(auth)await notarizeAndStaple(app,`${config.appName}.app`,auth,scratch);await runBuildStep(["ditto",app,join(staging,`${config.appName}.app`)],{cwd:staging,describe:`Staging ${config.appName}.app`});const dmgPath=join(outputDir,`${config.appName}-${config.version}.dmg`);await imageDmg({staging,volumeName,dmgPath,signingIdentity});if(auth){await notarizeAndStaple(dmgPath,"the DMG",auth,scratch);await log.success("Notarized and stapled")}await log.success(`Built ${dmgPath}`);if(!signingIdentity)await log.info("Signed for development only: other Macs refuse it. Pass --signing-identity with a Developer ID identity, and --notarize, before distributing.");else if(!auth)await log.info("Signed but not notarized: other Macs still warn on first open. Pass --notary-profile, or --notarize with an App Store Connect API key.");
|
|
1
|
+
import{existsSync,mkdirSync,mkdtempSync,readFileSync,rmSync}from"node:fs";import{tmpdir}from"node:os";import{join}from"node:path";import process from"node:process";import{log,parseOptions}from"@stacksjs/cli";import{developerIdProblem,loadMacosDesktop,macosOutputDirectory,resolveDmgPackaging}from"@stacksjs/desktop-build";import{projectPath,storagePath}from"@stacksjs/path";import{imageDmg,notarizeAndStaple,notaryArguments}from"./notarize";import{runBuildStep}from"./run-build-step";if(process.platform!=="darwin")throw new Error("DMG packaging only runs on macOS");const root=projectPath();const pkg=existsSync(join(root,"package.json"))?JSON.parse(readFileSync(join(root,"package.json"),"utf8")):{};const config=await loadMacosDesktop(root,pkg.version);if(!config)throw new Error("config/desktop.ts has no macos section, so build:dmg packages the Craft web-view app instead.");const flags=parseOptions();for(const[flag,name]of[["appName","--app-name"],["bundleId","--bundle-id"],["appVersion","--app-version"]]){if(flags[flag]!==undefined)await log.warn(`${name} is ignored: config/desktop.ts names, identifies and versions a macos app.`)}const{volumeName,signingIdentity,notary}=resolveDmgPackaging({flags:{...flags,appName:undefined,bundleId:undefined,appVersion:undefined},env:{...process.env,DESKTOP_APP_NAME:undefined,DESKTOP_BUNDLE_ID:undefined,DESKTOP_APP_VERSION:undefined},manifestTitle:config.appName,declaredVersion:config.version});if(notary&&!signingIdentity)throw new Error("Notarizing needs a Developer ID identity (--signing-identity or DESKTOP_SIGNING_IDENTITY): Apple only notarizes signed code.");if(signingIdentity){process.env.DESKTOP_SIGNING_IDENTITY=signingIdentity;process.env.DESKTOP_DISTRIBUTION="developer-id"}await import("./desktop-macos");const app=join(macosOutputDirectory(root,config),`${config.appName}.app`);if(!existsSync(app))throw new Error(`build:desktop did not produce ${app}`);if(notary){const signature=Bun.spawnSync(["codesign","-dvv",app],{stderr:"pipe"});const problem=developerIdProblem(`${signature.stdout.toString()}${signature.stderr.toString()}`);if(problem)throw new Error(`${app} cannot be notarized: ${problem}`)}const outputDir=storagePath("framework/desktop-dmg");rmSync(outputDir,{recursive:true,force:true});mkdirSync(outputDir,{recursive:true});const staging=mkdtempSync(join(tmpdir(),"stacks-dmg-"));const scratch=mkdtempSync(join(tmpdir(),"stacks-dmg-work-"));process.on("exit",()=>{rmSync(staging,{recursive:true,force:true});rmSync(scratch,{recursive:true,force:true})});const auth=notary&¬aryArguments(notary);if(auth)await notarizeAndStaple(app,`${config.appName}.app`,auth,scratch);await runBuildStep(["ditto",app,join(staging,`${config.appName}.app`)],{cwd:staging,describe:`Staging ${config.appName}.app`});const dmgPath=join(outputDir,`${config.appName}-${config.version}.dmg`);await imageDmg({staging,volumeName,dmgPath,signingIdentity});if(auth){await notarizeAndStaple(dmgPath,"the DMG",auth,scratch);await log.success("Notarized and stapled")}await log.success(`Built ${dmgPath}`);if(!signingIdentity)await log.info("Signed for development only: other Macs refuse it. Pass --signing-identity with a Developer ID identity, and --notarize, before distributing.");else if(!auth)await log.info("Signed but not notarized: other Macs still warn on first open. Pass --notary-profile, or --notarize with an App Store Connect API key.");
|
|
@@ -6,7 +6,15 @@ import type { DesktopAgentManifest, MacosAgentBundle, MacosDistribution, Resolve
|
|
|
6
6
|
* without WebKit and say nothing, leaving every `<WebView>` blank.
|
|
7
7
|
*/
|
|
8
8
|
export declare function craftSupportsWebkit(source: string): boolean;
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Whether this Craft's `buildMacOSNative` takes `updater`, which compiles the
|
|
11
|
+
* in-app updater into the host (Craft's `CRAFT_UPDATER` compile flag, as
|
|
12
|
+
* `webkit` is its `CRAFT_WEBKIT`). Read from its source for the same reason:
|
|
13
|
+
* a Craft that does not know the option would build a host that never
|
|
14
|
+
* updates, and a release would ship it without a word.
|
|
15
|
+
*/
|
|
16
|
+
export declare function craftSupportsUpdater(source: string): boolean;
|
|
17
|
+
export declare function prepareMacosNative(config: ResolvedMacosDesktop, options?: PrepareMacosNativeOptions): Promise<PreparedMacosNative>;
|
|
10
18
|
/** Where the agent's own routes are: `macos.agent.entry`, else `app/Desktop/Agent.ts` when the project has one. */
|
|
11
19
|
export declare function macosAgentEntry(root: string, config: Pick<ResolvedMacosDesktop, 'agent'>): string | undefined;
|
|
12
20
|
/**
|
|
@@ -45,6 +53,11 @@ export declare interface PreparedMacosNative {
|
|
|
45
53
|
nativeBundle: string
|
|
46
54
|
host: string
|
|
47
55
|
hostKey: string
|
|
56
|
+
updater: boolean
|
|
57
|
+
}
|
|
58
|
+
export declare interface PrepareMacosNativeOptions {
|
|
59
|
+
root?: string
|
|
60
|
+
distribution?: MacosDistribution
|
|
48
61
|
}
|
|
49
62
|
declare type CompileNativeBundle = (options: {
|
|
50
63
|
screens: Record<string, string>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createHash}from"node:crypto";import{existsSync,mkdirSync,readdirSync,readFileSync,writeFileSync}from"node:fs";import{dirname,join,resolve}from"node:path";import process from"node:process";import{pathToFileURL}from"node:url";import{log}from"@stacksjs/cli";import{AGENT_MANIFEST,agentHostArguments,desktopLauncherCompileArgs,macosOutputDirectory,macosScreens,renderAgentEntry,validateMacosDesktop}from"@stacksjs/desktop-build";import{projectPath,storagePath}from"@stacksjs/path";import{craftBuilderVersion}from"./craft-entry";function entryFile(entry,root){try{return entry.startsWith("file:")?new URL(entry).pathname:Bun.resolveSync(entry,root)}catch{return null}}export function craftSupportsWebkit(source){return/\.webkit\b|[{,]\s*webkit\s*[,}=]/.test(source)}function craftMacosEntry(root){if(process.env.CRAFT_MACOS_SRC)return pathToFileURL(process.env.CRAFT_MACOS_SRC).href;try{const desktop=Bun.resolveSync("@stacksjs/desktop-build/package.json",root);return pathToFileURL(Bun.resolveSync("craft-native/macos",dirname(desktop))).href}catch{return"craft-native/macos"}}function hostKey(entry,root,webkit=false){const hash=createHash("sha256");if(webkit)hash.update("webkit");const path=entry.startsWith("file:")?new URL(entry).pathname:entry;const version=craftBuilderVersion(entry,root)?.version;hash.update(version??"unversioned");if(process.env.CRAFT_MACOS_SRC||!version){const templates=join(dirname(path),"../templates");if(existsSync(templates))for(const file of readdirSync(templates).sort())hash.update(readFileSync(join(templates,file)))}return hash.digest("hex").slice(0,16)}export async function prepareMacosNative(config,options={}){const root=options.root??projectPath();const errors=validateMacosDesktop(config);if(errors.length)throw new Error(`config/desktop.ts macos is not buildable:
|
|
1
|
+
import{createHash}from"node:crypto";import{existsSync,mkdirSync,readdirSync,readFileSync,writeFileSync}from"node:fs";import{dirname,join,resolve}from"node:path";import process from"node:process";import{pathToFileURL}from"node:url";import{log}from"@stacksjs/cli";import{AGENT_MANIFEST,agentHostArguments,desktopLauncherCompileArgs,macosOutputDirectory,macosScreens,macosSelfUpdates,renderAgentEntry,validateMacosDesktop}from"@stacksjs/desktop-build";import{projectPath,storagePath}from"@stacksjs/path";import{craftBuilderVersion}from"./craft-entry";function entryFile(entry,root){try{return entry.startsWith("file:")?new URL(entry).pathname:Bun.resolveSync(entry,root)}catch{return null}}export function craftSupportsWebkit(source){return/\.webkit\b|[{,]\s*webkit\s*[,}=]/.test(source)}export function craftSupportsUpdater(source){return/\.updater\b|[{,]\s*updater\s*[,}=]/.test(source)}function craftMacosEntry(root){if(process.env.CRAFT_MACOS_SRC)return pathToFileURL(process.env.CRAFT_MACOS_SRC).href;try{const desktop=Bun.resolveSync("@stacksjs/desktop-build/package.json",root);return pathToFileURL(Bun.resolveSync("craft-native/macos",dirname(desktop))).href}catch{return"craft-native/macos"}}function hostKey(entry,root,webkit=false,updater=false){const hash=createHash("sha256");if(webkit)hash.update("webkit");if(updater)hash.update("updater");const path=entry.startsWith("file:")?new URL(entry).pathname:entry;const version=craftBuilderVersion(entry,root)?.version;hash.update(version??"unversioned");if(process.env.CRAFT_MACOS_SRC||!version){const templates=join(dirname(path),"../templates");if(existsSync(templates))for(const file of readdirSync(templates).sort())hash.update(readFileSync(join(templates,file)))}return hash.digest("hex").slice(0,16)}export async function prepareMacosNative(config,options={}){const root=options.root??projectPath();const errors=validateMacosDesktop(config);if(errors.length)throw new Error(`config/desktop.ts macos is not buildable:
|
|
2
2
|
${errors.map((error)=>` - ${error}`).join(`
|
|
3
|
-
`)}`);if(process.platform!=="darwin")throw new Error("The native macOS app builds on macOS");const output=macosOutputDirectory(root,config);const work=join(output,".build");mkdirSync(work,{recursive:true});const screens=Object.fromEntries(Object.entries(macosScreens(config)).map(([name,file])=>[name,join(root,file)]));for(const[name,file]of Object.entries(screens))if(!existsSync(file))throw new Error(`macos.nativeScreens: screen "${name}" is ${file}, which does not exist`);const{compileNativeBundle}=await(process.env.STX_NATIVE_SRC?import(pathToFileURL(process.env.STX_NATIVE_SRC).href):import("@stacksjs/stx/native"));const app=config.nativeApp?join(root,config.nativeApp):undefined;const compiled=await compileNativeBundle({screens,initialScreen:config.initialScreen,minify:true,outFile:join(work,"native-screen.js"),root,...app?{app}:{},...config.shareStorage&&Object.keys(config.shareStorage).length?{shareStorage:{...config.shareStorage}}:{}});const problems=(compiled.diagnostics??[]).filter((item)=>item.message!=="dropped-subtree: script");for(const item of problems)await log.warn(`${item.file?`${item.file}: `:""}${item.message}`);if(problems.some((item)=>item.level==="error"))throw new Error("The native screens did not compile");const nativeBundle=compiled.outFile??join(work,"native-screen.js");const entry=craftMacosEntry(root);const webkit=config.webkit===true;if(webkit){const file=entryFile(entry,root);if(!file||!existsSync(file)||!craftSupportsWebkit(readFileSync(file,"utf8")))throw new Error(`macos.webkit needs a Craft whose buildMacOSNative links WebKit, and ${file??entry} does not. Upgrade craft-native, or point CRAFT_MACOS_SRC at a Craft checkout that has it.`)}const key=hostKey(entry,root,webkit);const hostDirectory=storagePath(`framework/desktop/host/${key}`);const host=join(hostDirectory,"craft-native-macos");if(!existsSync(host)){await log.info(`Building the AppKit host${
|
|
3
|
+
`)}`);if(process.platform!=="darwin")throw new Error("The native macOS app builds on macOS");const output=macosOutputDirectory(root,config);const work=join(output,".build");mkdirSync(work,{recursive:true});const screens=Object.fromEntries(Object.entries(macosScreens(config)).map(([name,file])=>[name,join(root,file)]));for(const[name,file]of Object.entries(screens))if(!existsSync(file))throw new Error(`macos.nativeScreens: screen "${name}" is ${file}, which does not exist`);const{compileNativeBundle}=await(process.env.STX_NATIVE_SRC?import(pathToFileURL(process.env.STX_NATIVE_SRC).href):import("@stacksjs/stx/native"));const app=config.nativeApp?join(root,config.nativeApp):undefined;const compiled=await compileNativeBundle({screens,initialScreen:config.initialScreen,minify:true,outFile:join(work,"native-screen.js"),root,...app?{app}:{},...config.shareStorage&&Object.keys(config.shareStorage).length?{shareStorage:{...config.shareStorage}}:{}});const problems=(compiled.diagnostics??[]).filter((item)=>item.message!=="dropped-subtree: script");for(const item of problems)await log.warn(`${item.file?`${item.file}: `:""}${item.message}`);if(problems.some((item)=>item.level==="error"))throw new Error("The native screens did not compile");const nativeBundle=compiled.outFile??join(work,"native-screen.js");const entry=craftMacosEntry(root);const webkit=config.webkit===true;if(webkit){const file=entryFile(entry,root);if(!file||!existsSync(file)||!craftSupportsWebkit(readFileSync(file,"utf8")))throw new Error(`macos.webkit needs a Craft whose buildMacOSNative links WebKit, and ${file??entry} does not. Upgrade craft-native, or point CRAFT_MACOS_SRC at a Craft checkout that has it.`)}let updater=macosSelfUpdates(config,options.distribution);if(updater){const file=entryFile(entry,root);if(!file||!existsSync(file)||!craftSupportsUpdater(readFileSync(file,"utf8"))){const reason=`macos.updates needs a Craft whose buildMacOSNative compiles the updater, and ${file??entry} does not. Upgrade craft-native, or point CRAFT_MACOS_SRC at a Craft checkout that has it.`;if(options.distribution==="developer-id")throw new Error(reason);await log.warn(`${reason} This development build has no updater.`);updater=false}}const key=hostKey(entry,root,webkit,updater);const hostDirectory=storagePath(`framework/desktop/host/${key}`);const host=join(hostDirectory,"craft-native-macos");if(!existsSync(host)){const parts=[webkit&&"WebKit",updater&&"the updater"].filter(Boolean);await log.info(`Building the AppKit host${parts.length?` with ${parts.join(" and ")}`:""} (first build for this Craft; the toolchain installs through Pantry)`);const builder=await import(entry);mkdirSync(hostDirectory,{recursive:true});await builder.buildMacOSNative({outdir:hostDirectory,nativeBundle,...webkit?{webkit:true}:{},...updater?{updater:true}:{}})}return{root,output,nativeBundle,host,hostKey:key,updater}}export function macosAgentEntry(root,config){if(!config.agent)return;if(config.agent.entry){const entry=resolve(root,config.agent.entry);if(!existsSync(entry))throw new Error(`macos.agent.entry does not exist: ${entry}`);return entry}const conventional=join(root,"app/Desktop/Agent.ts");return existsSync(conventional)?conventional:undefined}function agentResources(config,root){const resources=config.agent?.resources;return resources&&Object.keys(resources).length?{resources:Object.fromEntries(Object.entries(resources).map(([name,path])=>[name,resolve(root,path)]))}:{}}export function macosAgentDevManifest(config,prepared){return{appName:config.appName,bundleId:config.bundleId,version:config.version,host:prepared.host,nativeBundle:prepared.nativeBundle,hostArguments:agentHostArguments(config),...config.agent?.port?{port:config.agent.port}:{},...config.agent?.staticDir?{staticDir:resolve(prepared.root,config.agent.staticDir)}:{},...agentResources(config,prepared.root),projectRoot:prepared.root,appRoutes:config.agent?.appRoutes!==false}}export async function macosAgentRouteFiles(root){const manifest=join(root,"app/Routes.ts");const loaded=existsSync(manifest)?(await import(pathToFileURL(manifest).href)).default:undefined;const registry=loaded&&typeof loaded==="object"&&Object.keys(loaded).length?loaded:{api:"api"};const files=[];for(const[key,definition]of Object.entries(registry)){const config=typeof definition==="string"?{path:definition}:definition;const file=[".ts",".js"].map((extension)=>join(root,"routes",`${config.path}${extension}`)).find((candidate)=>existsSync(candidate));if(!file)continue;const prefix=config.prefix!==undefined?config.prefix?config.prefix.startsWith("/")?config.prefix:`/${config.prefix}`:undefined:key==="web"?undefined:`/${key}`;const middleware=config.middleware===undefined?[]:Array.isArray(config.middleware)?config.middleware:[config.middleware];files.push({file,...prefix?{prefix}:{},...middleware.length?{middleware}:{}})}return files}export function macosAgentActionFiles(root,sources){const actions={};for(const source of sources){if(!existsSync(source))continue;for(const match of readFileSync(source,"utf8").matchAll(/['"`](Actions\/[\w/-]+?)(?:\.ts)?['"`]/g)){const name=match[1];if(actions[name])continue;const file=[join(root,"app",`${name}.ts`),join(root,"storage/framework/defaults/app",`${name}.ts`)].find((candidate)=>existsSync(candidate));if(file)actions[name]=file}}return actions}export async function prepareMacosAgent(config,prepared,_distribution){if(!config.agent)throw new Error("config/desktop.ts has no macos.agent");const work=join(prepared.output,".build");const entry=join(work,"agent-entry.ts");const routes=config.agent.appRoutes===false?[]:await macosAgentRouteFiles(prepared.root);const agentEntry=macosAgentEntry(prepared.root,config);const actions=macosAgentActionFiles(prepared.root,[...routes.map((route)=>route.file),...agentEntry?[agentEntry]:[]]);writeFileSync(entry,renderAgentEntry({agentEntry,routes,actions}));const launcher=join(work,`${config.executable}-agent`);const compile=Bun.spawnSync(["bun",...desktopLauncherCompileArgs({entry,outfile:launcher})],{cwd:prepared.root,stdout:"pipe",stderr:"pipe"});if(compile.exitCode!==0)throw new Error(`Compiling the agent launcher failed:
|
|
4
4
|
${compile.stderr.toString().trim()||compile.stdout.toString().trim()}`);return{launcher,manifest:{appName:config.appName,bundleId:config.bundleId,version:config.version,hostArguments:agentHostArguments(config),...config.agent.port?{port:config.agent.port}:{},...config.agent.staticDir?{staticDir:resolve(prepared.root,config.agent.staticDir)}:{},...agentResources(config,prepared.root),appRoutes:false}}}export function macosAgentDevFiles(prepared){const work=join(prepared.output,".build");return{entry:join(work,"agent-entry.ts"),manifest:join(work,AGENT_MANIFEST)}}
|
package/dist/build/notarize.d.ts
CHANGED
|
@@ -27,3 +27,27 @@ export declare function notarizeAndStaple(target: string, what: string, auth: st
|
|
|
27
27
|
* Gatekeeper checks the DMG a person opens before it ever looks at the app.
|
|
28
28
|
*/
|
|
29
29
|
export declare function imageDmg(options: { staging: string, volumeName: string, dmgPath: string, signingIdentity?: string }): Promise<void>;
|
|
30
|
+
/** Whether a notarization ticket is already stapled to `target` (an `.app` or a DMG). */
|
|
31
|
+
export declare function hasStapledTicket(target: string): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* What a direct-distribution Mac release is made of, from a Developer ID
|
|
34
|
+
* signed `.app`, shared by a web view app's release and a native macOS one's:
|
|
35
|
+
* the app notarized and stapled, zipped for the updater, and imaged into a
|
|
36
|
+
* signed, notarized DMG, each checked as the file that gets uploaded.
|
|
37
|
+
*
|
|
38
|
+
* The order matters: the zip is made after the app is stapled, so the ticket
|
|
39
|
+
* travels inside the update and Gatekeeper accepts the new bundle offline.
|
|
40
|
+
* `ditto` keeps the signature and the ticket; `zip` does not. An app that
|
|
41
|
+
* already carries a ticket (one Pantry's native pipeline stapled, released
|
|
42
|
+
* here with `--skip-build`) is not sent to Apple a second time.
|
|
43
|
+
*/
|
|
44
|
+
export declare function packageMacRelease(options: PackageMacReleaseOptions): Promise<void>;
|
|
45
|
+
export declare interface PackageMacReleaseOptions {
|
|
46
|
+
app: string
|
|
47
|
+
appName: string
|
|
48
|
+
updateZip?: string
|
|
49
|
+
dmg: string
|
|
50
|
+
signingIdentity?: string
|
|
51
|
+
auth?: string[]
|
|
52
|
+
scratch: string
|
|
53
|
+
}
|
package/dist/build/notarize.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{mkdtempSync,rmSync,symlinkSync,writeFileSync}from"node:fs";import{tmpdir}from"node:os";import{basename,dirname,join}from"node:path";import process from"node:process";import{log,runCommand}from"@stacksjs/cli";import{notarizationOutcome,notarytoolAuthArgs}from"@stacksjs/desktop-build";import{runBuildStep}from"./run-build-step";export function notaryArguments(credentials){if(!("keyPem"in credentials))return notarytoolAuthArgs(credentials);const directory=mkdtempSync(join(tmpdir(),"stacks-notary-key-"));const keyPath=join(directory,`AuthKey_${credentials.keyId}.p8`);writeFileSync(keyPath,`${credentials.keyPem}
|
|
2
|
-
`,{mode:384});process.on("exit",()=>rmSync(directory,{recursive:true,force:true}));return notarytoolAuthArgs({keyId:credentials.keyId,issuerId:credentials.issuerId,keyPath})}export async function notarizeAndStaple(target,what,auth,scratch){const upload=target.endsWith(".app")?join(scratch,`${basename(target)}.zip`):target;if(upload!==target)await runBuildStep(["ditto","-c","-k","--keepParent",target,upload],{cwd:scratch,describe:`Zipping ${basename(target)} for notarization`});log.info(`Notarizing ${what} (Apple usually answers within a few minutes)...`);const submitted=Bun.spawnSync(["xcrun","notarytool","submit",upload,...auth,"--wait"],{stderr:"pipe"});const report=`${submitted.stdout.toString()}${submitted.stderr.toString()}`;const outcome=notarizationOutcome(report,submitted.exitCode);if(!outcome.accepted){console.error(report.trim());throw new Error(`Notarization of ${what} ${outcome.status??"failed"}${outcome.id?` - see \`xcrun notarytool log ${outcome.id} ${auth.join(" ")}\``:""}`)}await runBuildStep(["xcrun","stapler","staple",target],{cwd:dirname(target),describe:`Stapling the notarization ticket to ${what}`})}export async function imageDmg(options){symlinkSync("/Applications",join(options.staging,"Applications"));const created=await runCommand(["hdiutil","create","-volname",options.volumeName,"-srcfolder",options.staging,"-ov","-format","UDZO",options.dmgPath],{cwd:options.staging});if(created.isErr)throw new Error(`hdiutil failed to create ${options.dmgPath}`);if(options.signingIdentity){await runBuildStep(["codesign","--force","--timestamp","--sign",options.signingIdentity,options.dmgPath],{cwd:dirname(options.dmgPath),describe:"Signing the DMG"})}}
|
|
1
|
+
import{cpSync,mkdirSync,mkdtempSync,rmSync,symlinkSync,writeFileSync}from"node:fs";import{tmpdir}from"node:os";import{basename,dirname,join}from"node:path";import process from"node:process";import{log,runCommand}from"@stacksjs/cli";import{notarizationOutcome,notarytoolAuthArgs}from"@stacksjs/desktop-build";import{runBuildStep}from"./run-build-step";export function notaryArguments(credentials){if(!("keyPem"in credentials))return notarytoolAuthArgs(credentials);const directory=mkdtempSync(join(tmpdir(),"stacks-notary-key-"));const keyPath=join(directory,`AuthKey_${credentials.keyId}.p8`);writeFileSync(keyPath,`${credentials.keyPem}
|
|
2
|
+
`,{mode:384});process.on("exit",()=>rmSync(directory,{recursive:true,force:true}));return notarytoolAuthArgs({keyId:credentials.keyId,issuerId:credentials.issuerId,keyPath})}export async function notarizeAndStaple(target,what,auth,scratch){const upload=target.endsWith(".app")?join(scratch,`${basename(target)}.zip`):target;if(upload!==target)await runBuildStep(["ditto","-c","-k","--keepParent",target,upload],{cwd:scratch,describe:`Zipping ${basename(target)} for notarization`});log.info(`Notarizing ${what} (Apple usually answers within a few minutes)...`);const submitted=Bun.spawnSync(["xcrun","notarytool","submit",upload,...auth,"--wait"],{stderr:"pipe"});const report=`${submitted.stdout.toString()}${submitted.stderr.toString()}`;const outcome=notarizationOutcome(report,submitted.exitCode);if(!outcome.accepted){console.error(report.trim());throw new Error(`Notarization of ${what} ${outcome.status??"failed"}${outcome.id?` - see \`xcrun notarytool log ${outcome.id} ${auth.join(" ")}\``:""}`)}await runBuildStep(["xcrun","stapler","staple",target],{cwd:dirname(target),describe:`Stapling the notarization ticket to ${what}`})}export async function imageDmg(options){symlinkSync("/Applications",join(options.staging,"Applications"));const created=await runCommand(["hdiutil","create","-volname",options.volumeName,"-srcfolder",options.staging,"-ov","-format","UDZO",options.dmgPath],{cwd:options.staging});if(created.isErr)throw new Error(`hdiutil failed to create ${options.dmgPath}`);if(options.signingIdentity){await runBuildStep(["codesign","--force","--timestamp","--sign",options.signingIdentity,options.dmgPath],{cwd:dirname(options.dmgPath),describe:"Signing the DMG"})}}export function hasStapledTicket(target){return Bun.spawnSync(["xcrun","stapler","validate",target],{stdout:"ignore",stderr:"ignore"}).exitCode===0}function runReleaseCommand(command){console.log(`> ${command.join(" ")}`);const result=Bun.spawnSync(command,{stdout:"inherit",stderr:"inherit"});if(result.exitCode!==0)throw new Error(`${command[0]} exited with ${result.exitCode}`)}export async function packageMacRelease(options){const{app,appName,auth,scratch}=options;if(auth){if(hasStapledTicket(app))log.info(`${appName}.app already carries its notarization ticket`);else await notarizeAndStaple(app,`${appName}.app`,auth,scratch)}if(options.updateZip)runReleaseCommand(["ditto","-c","-k","--keepParent",app,options.updateZip]);const staging=join(scratch,"dmg");mkdirSync(staging,{recursive:true});cpSync(app,join(staging,`${appName}.app`),{recursive:true,verbatimSymlinks:true});await imageDmg({staging,volumeName:appName,dmgPath:options.dmg,...options.signingIdentity?{signingIdentity:options.signingIdentity}:{}});if(auth){await notarizeAndStaple(options.dmg,"the DMG",auth,scratch);runReleaseCommand(["codesign","--verify","--deep","--strict",app]);runReleaseCommand(["spctl","-a","-t","open","--context","context:primary-signature",options.dmg]);runReleaseCommand(["xcrun","stapler","validate",options.dmg])}}
|
package/dist/index.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export { validateReleaseEvidencePlan, verifyReleaseEvidence } from './release-ev
|
|
|
45
45
|
export { evaluateReviewOsEvidence, inspectReviewOsEvidence } from './reviewos-evidence';
|
|
46
46
|
export { assertPublicationAllowed, PUBLICATION_CHECK_SCRIPT, publicationChannels } from './publication-preflight';
|
|
47
47
|
export { DEFAULT_IOS_DEPENDENCIES, IosToolchainError, loadIosDependencies, pantryExecutable, pantryInstallArgs, resolveXcodegen, XCODE_NOTE, xcodeDeveloperDir } from './build/ios-toolchain';
|
|
48
|
-
export { craftSupportsWebkit, macosAgentActionFiles, macosAgentDevFiles, macosAgentDevManifest, macosAgentEntry, macosAgentRouteFiles, prepareMacosAgent, prepareMacosNative } from './build/macos-native';
|
|
48
|
+
export { craftSupportsUpdater, craftSupportsWebkit, macosAgentActionFiles, macosAgentDevFiles, macosAgentDevManifest, macosAgentEntry, macosAgentRouteFiles, prepareMacosAgent, prepareMacosNative } from './build/macos-native';
|
|
49
49
|
// stx conformance checks behind `buddy lint --stx`. Pure - returns a report
|
|
50
50
|
// and never exits, so the command owns rendering and the exit code.
|
|
51
51
|
export { DEFAULT_STX_LINT_CONFIG, loadStxLintConfig, runStxLint } from './lint/stx-gate';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{setActionRunner}from"@stacksjs/action-runner";import{runAction}from"./helpers";setActionRunner((action,options)=>runAction(action,options));export*from"./action";export{add as runAdd}from"./add";export{BlogAdminError,deleteBlogPost,getBlogPost,listBlogPosts,saveBlogPost,slugify as blogSlugify}from"./blog-admin";export{commit as runCommit}from"./commit";export*from"./dev";export*from"./generate";export*from"./helpers";export*from"./library";export{formatProject,lintFix,lintProject}from"./lint/lint";export{describeGitHubRelease,parseGitHubRemote,publishGitHubRelease}from"./github-release";export{validateReleaseEvidencePlan,verifyReleaseEvidence}from"./release-evidence";export{evaluateReviewOsEvidence,inspectReviewOsEvidence}from"./reviewos-evidence";export{assertPublicationAllowed,PUBLICATION_CHECK_SCRIPT,publicationChannels}from"./publication-preflight";export{DEFAULT_IOS_DEPENDENCIES,IosToolchainError,loadIosDependencies,pantryExecutable,pantryInstallArgs,resolveXcodegen,XCODE_NOTE,xcodeDeveloperDir}from"./build/ios-toolchain";export{craftSupportsWebkit,macosAgentActionFiles,macosAgentDevFiles,macosAgentDevManifest,macosAgentEntry,macosAgentRouteFiles,prepareMacosAgent,prepareMacosNative}from"./build/macos-native";export{DEFAULT_STX_LINT_CONFIG,loadStxLintConfig,runStxLint}from"./lint/stx-gate";export{measureDefaultsDrift,summarizeStructureChanges}from"./upgrade/package-project";export{describeDanglingRouteActions,findDanglingRouteActions}from"./upgrade/route-actions";export*from"./setup";export{createComponent,createDatabase,createFactory,createFunction,createLanguage,createMiddleware,createMigration,createModel,createMail,createNotification,createPage,isDryRunActive,makeAction,makeCertificate,makeComponent,makeDatabase,makeFunction,makeLanguage,makeMail,makeNotification,makePage,makeQueueTable,makeStack,make as runMake,setDryRun}from"./make";export{discoverPackages,ensureDiscoveredPackages}from"./discover-packages";export{parseFields,scaffoldCrud}from"./scaffold-crud";export{installStack,uninstallStack,listStacks}from"./stacks";export{makeJob}from"./make-job";export{makeCommand}from"./make-command";export{makePolicy}from"./make-policy";export{makeResource}from"./make-resource";export{resolveStxSource}from"./stx-source";
|
|
1
|
+
import{setActionRunner}from"@stacksjs/action-runner";import{runAction}from"./helpers";setActionRunner((action,options)=>runAction(action,options));export*from"./action";export{add as runAdd}from"./add";export{BlogAdminError,deleteBlogPost,getBlogPost,listBlogPosts,saveBlogPost,slugify as blogSlugify}from"./blog-admin";export{commit as runCommit}from"./commit";export*from"./dev";export*from"./generate";export*from"./helpers";export*from"./library";export{formatProject,lintFix,lintProject}from"./lint/lint";export{describeGitHubRelease,parseGitHubRemote,publishGitHubRelease}from"./github-release";export{validateReleaseEvidencePlan,verifyReleaseEvidence}from"./release-evidence";export{evaluateReviewOsEvidence,inspectReviewOsEvidence}from"./reviewos-evidence";export{assertPublicationAllowed,PUBLICATION_CHECK_SCRIPT,publicationChannels}from"./publication-preflight";export{DEFAULT_IOS_DEPENDENCIES,IosToolchainError,loadIosDependencies,pantryExecutable,pantryInstallArgs,resolveXcodegen,XCODE_NOTE,xcodeDeveloperDir}from"./build/ios-toolchain";export{craftSupportsUpdater,craftSupportsWebkit,macosAgentActionFiles,macosAgentDevFiles,macosAgentDevManifest,macosAgentEntry,macosAgentRouteFiles,prepareMacosAgent,prepareMacosNative}from"./build/macos-native";export{DEFAULT_STX_LINT_CONFIG,loadStxLintConfig,runStxLint}from"./lint/stx-gate";export{measureDefaultsDrift,summarizeStructureChanges}from"./upgrade/package-project";export{describeDanglingRouteActions,findDanglingRouteActions}from"./upgrade/route-actions";export*from"./setup";export{createComponent,createDatabase,createFactory,createFunction,createLanguage,createMiddleware,createMigration,createModel,createMail,createNotification,createPage,isDryRunActive,makeAction,makeCertificate,makeComponent,makeDatabase,makeFunction,makeLanguage,makeMail,makeNotification,makePage,makeQueueTable,makeStack,make as runMake,setDryRun}from"./make";export{discoverPackages,ensureDiscoveredPackages}from"./discover-packages";export{parseFields,scaffoldCrud}from"./scaffold-crud";export{installStack,uninstallStack,listStacks}from"./stacks";export{makeJob}from"./make-job";export{makeCommand}from"./make-command";export{makePolicy}from"./make-policy";export{makeResource}from"./make-resource";export{resolveStxSource}from"./stx-source";
|
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.598",
|
|
6
6
|
"description": "The Stacks actions.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -68,60 +68,60 @@
|
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@babel/parser": "^8.1.2",
|
|
70
70
|
"@babel/types": "^8.1.2",
|
|
71
|
-
"@stacksjs/action-runner": "0.75.
|
|
72
|
-
"@stacksjs/ai": "0.75.
|
|
73
|
-
"@stacksjs/analytics": "0.75.
|
|
74
|
-
"@stacksjs/api": "0.75.
|
|
75
|
-
"@stacksjs/auth": "0.75.
|
|
76
|
-
"@stacksjs/build": "0.75.
|
|
71
|
+
"@stacksjs/action-runner": "0.75.598",
|
|
72
|
+
"@stacksjs/ai": "0.75.598",
|
|
73
|
+
"@stacksjs/analytics": "0.75.598",
|
|
74
|
+
"@stacksjs/api": "0.75.598",
|
|
75
|
+
"@stacksjs/auth": "0.75.598",
|
|
76
|
+
"@stacksjs/build": "0.75.598",
|
|
77
77
|
"@stacksjs/bumpx": "^0.2.26",
|
|
78
78
|
"@stacksjs/bunpress": "^0.2.15",
|
|
79
|
-
"@stacksjs/cli": "0.75.
|
|
80
|
-
"@stacksjs/cloud": "0.75.
|
|
81
|
-
"@stacksjs/cms": "0.75.
|
|
79
|
+
"@stacksjs/cli": "0.75.598",
|
|
80
|
+
"@stacksjs/cloud": "0.75.598",
|
|
81
|
+
"@stacksjs/cms": "0.75.598",
|
|
82
82
|
"@stacksjs/components": "^0.2.889",
|
|
83
|
-
"@stacksjs/config": "0.75.
|
|
84
|
-
"@stacksjs/database": "0.75.
|
|
85
|
-
"@stacksjs/desktop-build": "0.75.
|
|
86
|
-
"@stacksjs/dns": "0.75.
|
|
87
|
-
"@stacksjs/docs": "0.75.
|
|
88
|
-
"@stacksjs/enums": "0.75.
|
|
89
|
-
"@stacksjs/env": "0.75.
|
|
90
|
-
"@stacksjs/error-handling": "0.75.
|
|
91
|
-
"@stacksjs/github": "0.75.
|
|
83
|
+
"@stacksjs/config": "0.75.598",
|
|
84
|
+
"@stacksjs/database": "0.75.598",
|
|
85
|
+
"@stacksjs/desktop-build": "0.75.598",
|
|
86
|
+
"@stacksjs/dns": "0.75.598",
|
|
87
|
+
"@stacksjs/docs": "0.75.598",
|
|
88
|
+
"@stacksjs/enums": "0.75.598",
|
|
89
|
+
"@stacksjs/env": "0.75.598",
|
|
90
|
+
"@stacksjs/error-handling": "0.75.598",
|
|
91
|
+
"@stacksjs/github": "0.75.598",
|
|
92
92
|
"@stacksjs/gitit": "^0.2.5",
|
|
93
|
-
"@stacksjs/i18n": "0.75.
|
|
94
|
-
"@stacksjs/image": "0.75.
|
|
95
|
-
"@stacksjs/logging": "0.75.
|
|
93
|
+
"@stacksjs/i18n": "0.75.598",
|
|
94
|
+
"@stacksjs/image": "0.75.598",
|
|
95
|
+
"@stacksjs/logging": "0.75.598",
|
|
96
96
|
"@stacksjs/logsmith": "^0.2.11",
|
|
97
|
-
"@stacksjs/mobile": "0.75.
|
|
98
|
-
"@stacksjs/orm": "0.75.
|
|
99
|
-
"@stacksjs/path": "0.75.
|
|
100
|
-
"@stacksjs/payments": "0.75.
|
|
101
|
-
"@stacksjs/queue": "0.75.
|
|
102
|
-
"@stacksjs/registry": "0.75.
|
|
103
|
-
"@stacksjs/router": "0.75.
|
|
97
|
+
"@stacksjs/mobile": "0.75.598",
|
|
98
|
+
"@stacksjs/orm": "0.75.598",
|
|
99
|
+
"@stacksjs/path": "0.75.598",
|
|
100
|
+
"@stacksjs/payments": "0.75.598",
|
|
101
|
+
"@stacksjs/queue": "0.75.598",
|
|
102
|
+
"@stacksjs/registry": "0.75.598",
|
|
103
|
+
"@stacksjs/router": "0.75.598",
|
|
104
104
|
"@stacksjs/rpx": "^0.11.54",
|
|
105
|
-
"@stacksjs/scheduler": "0.75.
|
|
106
|
-
"@stacksjs/search-engine": "0.75.
|
|
107
|
-
"@stacksjs/security": "0.75.
|
|
108
|
-
"@stacksjs/server": "0.75.
|
|
109
|
-
"@stacksjs/sites": "0.75.
|
|
110
|
-
"@stacksjs/storage": "0.75.
|
|
111
|
-
"@stacksjs/strings": "0.75.
|
|
105
|
+
"@stacksjs/scheduler": "0.75.598",
|
|
106
|
+
"@stacksjs/search-engine": "0.75.598",
|
|
107
|
+
"@stacksjs/security": "0.75.598",
|
|
108
|
+
"@stacksjs/server": "0.75.598",
|
|
109
|
+
"@stacksjs/sites": "0.75.598",
|
|
110
|
+
"@stacksjs/storage": "0.75.598",
|
|
111
|
+
"@stacksjs/strings": "0.75.598",
|
|
112
112
|
"@stacksjs/stx": "^0.2.889",
|
|
113
113
|
"@stacksjs/tlsx": "^0.13.19",
|
|
114
114
|
"@stacksjs/ts-cloud": "^0.16.129",
|
|
115
115
|
"@stacksjs/ts-md": "^0.1.1",
|
|
116
|
-
"@stacksjs/tunnel": "0.75.
|
|
117
|
-
"@stacksjs/types": "0.75.
|
|
118
|
-
"@stacksjs/utils": "0.75.
|
|
119
|
-
"@stacksjs/whois": "0.75.
|
|
116
|
+
"@stacksjs/tunnel": "0.75.598",
|
|
117
|
+
"@stacksjs/types": "0.75.598",
|
|
118
|
+
"@stacksjs/utils": "0.75.598",
|
|
119
|
+
"@stacksjs/whois": "0.75.598",
|
|
120
120
|
"bun-plugin-stx": "^0.2.889",
|
|
121
121
|
"pickier": "^0.1.92"
|
|
122
122
|
},
|
|
123
123
|
"peerDependencies": {
|
|
124
|
-
"craft-native": ">=0.0.
|
|
124
|
+
"craft-native": ">=0.0.505"
|
|
125
125
|
},
|
|
126
126
|
"peerDependenciesMeta": {
|
|
127
127
|
"craft-native": {
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
}
|
|
130
130
|
},
|
|
131
131
|
"devDependencies": {
|
|
132
|
-
"@stacksjs/validation": "0.75.
|
|
132
|
+
"@stacksjs/validation": "0.75.598",
|
|
133
133
|
"better-dx": "^0.2.39"
|
|
134
134
|
}
|
|
135
135
|
}
|