@stacksjs/actions 0.75.4 → 0.75.6
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.js +1 -1
- package/package.json +38 -38
package/dist/build/desktop.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createHash}from"node:crypto";import{chmodSync,copyFileSync,existsSync,mkdirSync,readFileSync,rmSync,writeFileSync}from"node:fs";import{join}from"node:path";import process from"node:process";import{log}from"@stacksjs/cli";import{corePath,projectPath,storagePath}from"@stacksjs/path";import{assertDesktopReleaseChannel,hasUserlandDesktopLauncher,resolveCraftExecutable,resolveDesktopLauncher}from"@stacksjs/desktop-build";import{runBuildStep}from"./run-build-step";const outputDir=storagePath("framework/desktop-dist"),launcherName=process.platform==="win32"?"stacks-desktop.exe":"stacks-desktop",runtimeName=process.platform==="win32"?"craft-runtime.exe":"craft-runtime",appUrl=process.env.DESKTOP_URL||process.env.APP_URL,releaseChannel=process.env.DESKTOP_RELEASE_CHANNEL==="stable"?"stable":"experimental",support=assertDesktopReleaseChannel(releaseChannel),ownsLauncher=hasUserlandDesktopLauncher(projectPath());if(!appUrl&&!ownsLauncher)throw Error("Desktop builds require APP_URL or DESKTOP_URL so the native app knows which Stacks application to open. An app that opens something local instead can supply its own app/Desktop/launcher.ts.");const url=appUrl?new URL(/^https?:\/\//.test(appUrl)?appUrl:`https://${appUrl}`):null,craftBinary=resolveCraftExecutable();if(readFileSync(craftBinary).subarray(0,2).toString()==="#!")throw Error(`CRAFT_BIN points at a script, not a native binary: ${craftBinary}. Point it at the compiled Craft executable (packages/zig/zig-out/bin/craft).`);if(existsSync(outputDir))rmSync(outputDir,{recursive:!0});mkdirSync(outputDir,{recursive:!0});const desktopSource=corePath("desktop");if(existsSync(join(desktopSource,"package.json"))&&existsSync(join(desktopSource,"src")))await runBuildStep("bun run build",{cwd:desktopSource,describe:"The desktop package build"});const minify=process.env.DESKTOP_MINIFY!=="false",launcherEntry=resolveDesktopLauncher(projectPath());await runBuildStep(["bun"
|
|
1
|
+
import{createHash}from"node:crypto";import{chmodSync,copyFileSync,existsSync,mkdirSync,readFileSync,rmSync,writeFileSync}from"node:fs";import{join}from"node:path";import process from"node:process";import{log}from"@stacksjs/cli";import{corePath,projectPath,storagePath}from"@stacksjs/path";import{assertDesktopReleaseChannel,desktopLauncherCompileArgs,hasUserlandDesktopLauncher,resolveCraftExecutable,resolveDesktopLauncher}from"@stacksjs/desktop-build";import{runBuildStep}from"./run-build-step";const outputDir=storagePath("framework/desktop-dist"),launcherName=process.platform==="win32"?"stacks-desktop.exe":"stacks-desktop",runtimeName=process.platform==="win32"?"craft-runtime.exe":"craft-runtime",appUrl=process.env.DESKTOP_URL||process.env.APP_URL,releaseChannel=process.env.DESKTOP_RELEASE_CHANNEL==="stable"?"stable":"experimental",support=assertDesktopReleaseChannel(releaseChannel),ownsLauncher=hasUserlandDesktopLauncher(projectPath());if(!appUrl&&!ownsLauncher)throw Error("Desktop builds require APP_URL or DESKTOP_URL so the native app knows which Stacks application to open. An app that opens something local instead can supply its own app/Desktop/launcher.ts.");const url=appUrl?new URL(/^https?:\/\//.test(appUrl)?appUrl:`https://${appUrl}`):null,craftBinary=resolveCraftExecutable();if(readFileSync(craftBinary).subarray(0,2).toString()==="#!")throw Error(`CRAFT_BIN points at a script, not a native binary: ${craftBinary}. Point it at the compiled Craft executable (packages/zig/zig-out/bin/craft).`);if(existsSync(outputDir))rmSync(outputDir,{recursive:!0});mkdirSync(outputDir,{recursive:!0});const desktopSource=corePath("desktop");if(existsSync(join(desktopSource,"package.json"))&&existsSync(join(desktopSource,"src")))await runBuildStep("bun run build",{cwd:desktopSource,describe:"The desktop package build"});const minify=process.env.DESKTOP_MINIFY!=="false",launcherEntry=resolveDesktopLauncher(projectPath());await runBuildStep(["bun",...desktopLauncherCompileArgs({entry:launcherEntry,outfile:join(outputDir,launcherName),minify})],{cwd:projectPath(),describe:"Compiling the desktop launcher"});copyFileSync(craftBinary,join(outputDir,runtimeName));if(process.platform!=="win32"){chmodSync(join(outputDir,launcherName),493);chmodSync(join(outputDir,runtimeName),493)}writeFileSync(join(outputDir,"desktop.json"),`${JSON.stringify({url:url?url.toString().replace(/\/$/,""):"",title:process.env.APP_NAME||"Stacks",width:1400,height:900,darkMode:!1,systemTray:!0,hideDockIcon:!1,releaseChannel,platform:process.platform,architecture:process.arch,launcher:ownsLauncher?"userland":"framework"},null,2)}
|
|
2
2
|
`);const gitResult=Bun.spawnSync(["git","rev-parse","HEAD"],{cwd:projectPath()});if(gitResult.exitCode!==0)throw Error("Desktop builds require an exact Git source revision");const sourceRevision=gitResult.stdout.toString().trim(),remoteResult=Bun.spawnSync(["git","remote","get-url","origin"],{cwd:projectPath()}),sourceRepository=remoteResult.exitCode===0?remoteResult.stdout.toString().trim().replace(/\.git$/,""):"unknown",artifacts=[launcherName,runtimeName,"desktop.json"].map((name)=>{const contents=readFileSync(join(outputDir,name));return{name,bytes:contents.byteLength,sha256:createHash("sha256").update(contents).digest("hex")}});writeFileSync(join(outputDir,"provenance.json"),`${JSON.stringify({schemaVersion:"1.0.0",sourceRepository,sourceRevision,builtWith:{bun:Bun.version,craftSha256:artifacts.find((artifact)=>artifact.name===runtimeName)?.sha256},target:{platform:process.platform,architecture:process.arch,status:support.status,osVersions:support.osVersions},releaseChannel,artifacts},null,2)}
|
|
3
3
|
`);writeFileSync(join(outputDir,"checksums.sha256"),`${artifacts.map((artifact)=>`${artifact.sha256} ${artifact.name}`).join(`
|
|
4
4
|
`)}
|
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.6",
|
|
6
6
|
"description": "The Stacks actions.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -60,52 +60,52 @@
|
|
|
60
60
|
"prepublishOnly": "bun run build"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@stacksjs/action-runner": "0.75.
|
|
64
|
-
"@stacksjs/ai": "0.75.
|
|
65
|
-
"@stacksjs/analytics": "0.75.
|
|
66
|
-
"@stacksjs/api": "0.75.
|
|
67
|
-
"@stacksjs/auth": "0.75.
|
|
68
|
-
"@stacksjs/build": "0.75.
|
|
63
|
+
"@stacksjs/action-runner": "0.75.6",
|
|
64
|
+
"@stacksjs/ai": "0.75.6",
|
|
65
|
+
"@stacksjs/analytics": "0.75.6",
|
|
66
|
+
"@stacksjs/api": "0.75.6",
|
|
67
|
+
"@stacksjs/auth": "0.75.6",
|
|
68
|
+
"@stacksjs/build": "0.75.6",
|
|
69
69
|
"@stacksjs/bumpx": "^0.2.6",
|
|
70
70
|
"@stacksjs/bunpress": "^0.2.8",
|
|
71
|
-
"@stacksjs/cli": "0.75.
|
|
72
|
-
"@stacksjs/cloud": "0.75.
|
|
73
|
-
"@stacksjs/cms": "0.75.
|
|
71
|
+
"@stacksjs/cli": "0.75.6",
|
|
72
|
+
"@stacksjs/cloud": "0.75.6",
|
|
73
|
+
"@stacksjs/cms": "0.75.6",
|
|
74
74
|
"@stacksjs/components": "^0.2.307",
|
|
75
|
-
"@stacksjs/config": "0.75.
|
|
76
|
-
"@stacksjs/database": "0.75.
|
|
77
|
-
"@stacksjs/desktop-build": "0.75.
|
|
78
|
-
"@stacksjs/dns": "0.75.
|
|
79
|
-
"@stacksjs/enums": "0.75.
|
|
80
|
-
"@stacksjs/env": "0.75.
|
|
81
|
-
"@stacksjs/error-handling": "0.75.
|
|
75
|
+
"@stacksjs/config": "0.75.6",
|
|
76
|
+
"@stacksjs/database": "0.75.6",
|
|
77
|
+
"@stacksjs/desktop-build": "0.75.6",
|
|
78
|
+
"@stacksjs/dns": "0.75.6",
|
|
79
|
+
"@stacksjs/enums": "0.75.6",
|
|
80
|
+
"@stacksjs/env": "0.75.6",
|
|
81
|
+
"@stacksjs/error-handling": "0.75.6",
|
|
82
82
|
"@stacksjs/gitit": "^0.2.5",
|
|
83
|
-
"@stacksjs/i18n": "0.75.
|
|
84
|
-
"@stacksjs/image": "0.75.
|
|
85
|
-
"@stacksjs/logging": "0.75.
|
|
83
|
+
"@stacksjs/i18n": "0.75.6",
|
|
84
|
+
"@stacksjs/image": "0.75.6",
|
|
85
|
+
"@stacksjs/logging": "0.75.6",
|
|
86
86
|
"@stacksjs/logsmith": "^0.2.3",
|
|
87
|
-
"@stacksjs/orm": "0.75.
|
|
88
|
-
"@stacksjs/path": "0.75.
|
|
89
|
-
"@stacksjs/payments": "0.75.
|
|
90
|
-
"@stacksjs/queue": "0.75.
|
|
91
|
-
"@stacksjs/registry": "0.75.
|
|
92
|
-
"@stacksjs/router": "0.75.
|
|
87
|
+
"@stacksjs/orm": "0.75.6",
|
|
88
|
+
"@stacksjs/path": "0.75.6",
|
|
89
|
+
"@stacksjs/payments": "0.75.6",
|
|
90
|
+
"@stacksjs/queue": "0.75.6",
|
|
91
|
+
"@stacksjs/registry": "0.75.6",
|
|
92
|
+
"@stacksjs/router": "0.75.6",
|
|
93
93
|
"@stacksjs/rpx": "^0.11.54",
|
|
94
|
-
"@stacksjs/scheduler": "0.75.
|
|
95
|
-
"@stacksjs/search-engine": "0.75.
|
|
96
|
-
"@stacksjs/security": "0.75.
|
|
97
|
-
"@stacksjs/server": "0.75.
|
|
98
|
-
"@stacksjs/sites": "0.75.
|
|
99
|
-
"@stacksjs/storage": "0.75.
|
|
100
|
-
"@stacksjs/strings": "0.75.
|
|
94
|
+
"@stacksjs/scheduler": "0.75.6",
|
|
95
|
+
"@stacksjs/search-engine": "0.75.6",
|
|
96
|
+
"@stacksjs/security": "0.75.6",
|
|
97
|
+
"@stacksjs/server": "0.75.6",
|
|
98
|
+
"@stacksjs/sites": "0.75.6",
|
|
99
|
+
"@stacksjs/storage": "0.75.6",
|
|
100
|
+
"@stacksjs/strings": "0.75.6",
|
|
101
101
|
"@stacksjs/stx": "^0.2.307",
|
|
102
102
|
"@stacksjs/tlsx": "^0.13.19",
|
|
103
103
|
"@stacksjs/ts-cloud": "^0.16.11",
|
|
104
104
|
"@stacksjs/ts-md": "^0.1.1",
|
|
105
|
-
"@stacksjs/tunnel": "0.75.
|
|
106
|
-
"@stacksjs/types": "0.75.
|
|
107
|
-
"@stacksjs/utils": "0.75.
|
|
108
|
-
"@stacksjs/whois": "0.75.
|
|
105
|
+
"@stacksjs/tunnel": "0.75.6",
|
|
106
|
+
"@stacksjs/types": "0.75.6",
|
|
107
|
+
"@stacksjs/utils": "0.75.6",
|
|
108
|
+
"@stacksjs/whois": "0.75.6",
|
|
109
109
|
"bun-plugin-stx": "^0.2.307"
|
|
110
110
|
},
|
|
111
111
|
"peerDependencies": {
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|
|
124
|
-
"@stacksjs/validation": "0.75.
|
|
124
|
+
"@stacksjs/validation": "0.75.6",
|
|
125
125
|
"better-dx": "^0.2.24"
|
|
126
126
|
}
|
|
127
127
|
}
|