reset-framework-cli 1.2.1 → 1.2.4
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/LICENSE +20 -20
- package/README.md +25 -25
- package/package.json +8 -6
- package/src/commands/build.js +144 -126
- package/src/commands/dev.js +195 -174
- package/src/commands/doctor.js +140 -133
- package/src/commands/init.js +946 -866
- package/src/commands/package.js +68 -68
- package/src/index.js +195 -195
- package/src/lib/backend.js +123 -0
- package/src/lib/context.js +66 -66
- package/src/lib/framework.js +57 -57
- package/src/lib/logger.js +11 -11
- package/src/lib/output.js +283 -268
- package/src/lib/process.js +303 -303
- package/src/lib/project.js +897 -833
- package/src/lib/toolchain.js +62 -62
- package/src/lib/ui.js +244 -244
- package/templates/basic/README.md +15 -15
- package/templates/basic/frontend/README.md +73 -73
- package/templates/basic/frontend/eslint.config.js +23 -23
- package/templates/basic/frontend/index.html +13 -13
- package/templates/basic/frontend/package.json +31 -31
- package/templates/basic/frontend/public/icons.svg +24 -24
- package/templates/basic/frontend/src/App.css +216 -216
- package/templates/basic/frontend/src/App.tsx +77 -77
- package/templates/basic/frontend/src/assets/vite.svg +1 -1
- package/templates/basic/frontend/src/index.css +111 -111
- package/templates/basic/frontend/src/lib/reset.ts +1 -1
- package/templates/basic/frontend/src/main.tsx +10 -10
- package/templates/basic/frontend/tsconfig.app.json +28 -28
- package/templates/basic/frontend/tsconfig.json +7 -7
- package/templates/basic/frontend/tsconfig.node.json +26 -26
- package/templates/basic/frontend/vite.config.ts +16 -16
- package/templates/basic/reset.config.json +58 -58
package/src/commands/dev.js
CHANGED
|
@@ -1,179 +1,200 @@
|
|
|
1
|
-
import { prepareFrameworkRuntime } from "../lib/framework.js"
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
export
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
const
|
|
1
|
+
import { prepareFrameworkRuntime } from "../lib/framework.js"
|
|
2
|
+
import { prepareAppBackend } from "../lib/backend.js"
|
|
3
|
+
import {
|
|
4
|
+
registerChildCleanup,
|
|
5
|
+
resolvePackageManagerCommand,
|
|
6
|
+
spawnCommand,
|
|
7
|
+
waitForProcessExit,
|
|
8
|
+
waitForUrl
|
|
9
|
+
} from "../lib/process.js"
|
|
10
|
+
import {
|
|
11
|
+
assertAppProject,
|
|
12
|
+
assertFrameworkInstall,
|
|
13
|
+
loadResetConfig,
|
|
14
|
+
resolveAppPaths,
|
|
15
|
+
resolveAppPackageManager,
|
|
16
|
+
resolveConfigPath,
|
|
17
|
+
resolveDevServerOptions,
|
|
18
|
+
resolveFrontendDir,
|
|
19
|
+
resolveFrameworkBuildPaths,
|
|
20
|
+
resolveFrameworkRuntimeBinary,
|
|
21
|
+
resolveFrameworkRuntimeStrategy,
|
|
22
|
+
resolveFrameworkPaths,
|
|
23
|
+
resolveOptionalBackendEntry
|
|
24
|
+
} from "../lib/project.js"
|
|
25
|
+
import {
|
|
26
|
+
createProgress,
|
|
27
|
+
printBanner,
|
|
28
|
+
printKeyValueTable,
|
|
29
|
+
printSection,
|
|
30
|
+
printStatusTable
|
|
31
|
+
} from "../lib/ui.js"
|
|
32
|
+
|
|
33
|
+
export const description = "Run the frontend dev server and native host"
|
|
34
|
+
|
|
35
|
+
export async function run(context) {
|
|
36
|
+
const dryRun = Boolean(context.flags["dry-run"])
|
|
37
|
+
const skipFrontend = Boolean(context.flags["skip-frontend"])
|
|
38
|
+
const skipRuntime = Boolean(context.flags["skip-runtime"])
|
|
39
|
+
const noOpen = Boolean(context.flags["no-open"])
|
|
38
40
|
const preferSource = Boolean(context.flags["runtime-source"])
|
|
39
41
|
|
|
40
42
|
const appPaths = resolveAppPaths(context.projectRoot)
|
|
41
|
-
const frameworkPaths = resolveFrameworkPaths()
|
|
43
|
+
const frameworkPaths = resolveFrameworkPaths({ appRoot: context.projectRoot })
|
|
42
44
|
assertAppProject(appPaths)
|
|
43
45
|
assertFrameworkInstall(frameworkPaths)
|
|
44
|
-
const config = loadResetConfig(appPaths)
|
|
45
|
-
assertAppProject(appPaths, config)
|
|
46
|
-
const packageManager = resolveAppPackageManager(appPaths, config)
|
|
47
|
-
const devServer = resolveDevServerOptions(config)
|
|
48
|
-
const configPath = resolveConfigPath(appPaths)
|
|
49
|
-
const frontendDir = resolveFrontendDir(appPaths, config)
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
!
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
["
|
|
64
|
-
["
|
|
65
|
-
["
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
46
|
+
const config = loadResetConfig(appPaths)
|
|
47
|
+
assertAppProject(appPaths, config)
|
|
48
|
+
const packageManager = resolveAppPackageManager(appPaths, config)
|
|
49
|
+
const devServer = resolveDevServerOptions(config)
|
|
50
|
+
const configPath = resolveConfigPath(appPaths)
|
|
51
|
+
const frontendDir = resolveFrontendDir(appPaths, config)
|
|
52
|
+
const backendEntry = resolveOptionalBackendEntry(appPaths)
|
|
53
|
+
const frameworkBuildPaths = resolveFrameworkBuildPaths(appPaths)
|
|
54
|
+
const runtimeStrategy = resolveFrameworkRuntimeStrategy(frameworkPaths, { preferSource })
|
|
55
|
+
const steps = [
|
|
56
|
+
!skipRuntime ? "Prepare runtime" : null,
|
|
57
|
+
backendEntry ? "Bundle backend sidecar" : null,
|
|
58
|
+
!skipFrontend ? "Start frontend dev server" : null,
|
|
59
|
+
!noOpen ? "Launch desktop window" : null
|
|
60
|
+
].filter(Boolean)
|
|
61
|
+
|
|
62
|
+
printBanner("reset-framework-cli dev", description)
|
|
63
|
+
printSection("Project")
|
|
64
|
+
printKeyValueTable([
|
|
65
|
+
["Config", configPath],
|
|
66
|
+
["Frontend", frontendDir],
|
|
67
|
+
["Backend", backendEntry ?? "not configured"],
|
|
68
|
+
["Package manager", packageManager],
|
|
69
|
+
["Dev URL", config.frontend.devUrl],
|
|
70
|
+
["Runtime", `${runtimeStrategy.kind === "prebuilt" ? "bundled" : "source"} (${runtimeStrategy.label})`]
|
|
71
|
+
])
|
|
72
|
+
console.log("")
|
|
73
|
+
|
|
74
|
+
printSection("Plan")
|
|
75
|
+
printStatusTable([
|
|
76
|
+
[
|
|
77
|
+
skipRuntime ? "skip" : "ready",
|
|
78
|
+
"Runtime",
|
|
79
|
+
skipRuntime
|
|
80
|
+
? (runtimeStrategy.kind === "prebuilt" ? "Reuse the bundled runtime package" : "Reuse the existing source runtime build")
|
|
81
|
+
: (runtimeStrategy.kind === "prebuilt" ? "Use the bundled runtime package" : "Configure and build the runtime from source")
|
|
82
|
+
],
|
|
83
|
+
[backendEntry ? "ready" : "skip", "Backend", backendEntry ? "Bundle the optional TypeScript sidecar backend" : "No backend entry was found under backend/"],
|
|
84
|
+
[skipFrontend ? "skip" : "ready", "Frontend", skipFrontend ? "Expecting an already running dev server" : "Start the frontend dev server and wait for readiness"],
|
|
85
|
+
[noOpen ? "skip" : "ready", "Window", noOpen ? "Do not launch the desktop window" : "Start the native host with the active project config"]
|
|
86
|
+
])
|
|
87
|
+
|
|
88
|
+
if (dryRun) {
|
|
89
|
+
console.log("")
|
|
90
|
+
printSection("Dry run")
|
|
91
|
+
printStatusTable(
|
|
92
|
+
steps.length > 0
|
|
93
|
+
? steps.map((step) => ["plan", step, "No processes will be started"])
|
|
94
|
+
: [["warn", "Nothing to do", "All dev phases were skipped"]]
|
|
95
|
+
)
|
|
96
|
+
return
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (steps.length === 0) {
|
|
100
|
+
console.log("")
|
|
101
|
+
printSection("Result")
|
|
102
|
+
printStatusTable([["warn", "Nothing to do", "All dev phases were skipped"]])
|
|
103
|
+
return
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
console.log("")
|
|
107
|
+
const progress = createProgress(steps.length, "Dev")
|
|
108
|
+
|
|
109
|
+
if (!skipRuntime) {
|
|
110
|
+
const preparedRuntime = await prepareFrameworkRuntime(frameworkPaths, frameworkBuildPaths, "dev", {
|
|
111
|
+
cwd: appPaths.appRoot,
|
|
112
|
+
dryRun,
|
|
113
|
+
preferSource
|
|
114
|
+
})
|
|
115
|
+
progress.tick(preparedRuntime.kind === "prebuilt" ? "Bundled runtime ready" : "Native runtime built")
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const children = []
|
|
119
|
+
let backendArtifact = null
|
|
120
|
+
|
|
121
|
+
if (backendEntry) {
|
|
122
|
+
backendArtifact = await prepareAppBackend(frameworkPaths, appPaths, "dev")
|
|
123
|
+
progress.tick("Backend sidecar bundled")
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (!skipFrontend) {
|
|
127
|
+
const frontendProcess = spawnCommand(resolvePackageManagerCommand(packageManager), [
|
|
128
|
+
"run",
|
|
129
|
+
"dev",
|
|
130
|
+
"--",
|
|
131
|
+
"--host",
|
|
132
|
+
devServer.host,
|
|
133
|
+
"--port",
|
|
134
|
+
devServer.port,
|
|
135
|
+
"--strictPort"
|
|
136
|
+
], {
|
|
137
|
+
cwd: frontendDir,
|
|
138
|
+
dryRun
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
if (frontendProcess) {
|
|
142
|
+
children.push(frontendProcess)
|
|
143
|
+
await waitForUrl(config.frontend.devUrl)
|
|
144
|
+
progress.tick("Frontend dev server is reachable")
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (!noOpen) {
|
|
149
|
+
const appBinary = resolveFrameworkRuntimeBinary(frameworkPaths, frameworkBuildPaths, "dev", {
|
|
150
|
+
mustExist: !dryRun,
|
|
151
|
+
strategy: runtimeStrategy
|
|
152
|
+
})
|
|
153
|
+
const appProcess = spawnCommand(appBinary, [], {
|
|
154
|
+
cwd: appPaths.appRoot,
|
|
155
|
+
env: {
|
|
156
|
+
RESET_CONFIG_PATH: configPath,
|
|
157
|
+
RESET_FRONTEND_DEV_URL: config.frontend.devUrl,
|
|
158
|
+
...(backendArtifact
|
|
159
|
+
? {
|
|
160
|
+
RESET_BACKEND_EXECUTABLE: backendArtifact.runtimeExecutablePath,
|
|
161
|
+
RESET_BACKEND_RUNNER: backendArtifact.runnerPath,
|
|
162
|
+
RESET_BACKEND_ENTRY: backendArtifact.bundleEntryPath,
|
|
163
|
+
RESET_BACKEND_WORKING_DIRECTORY: backendArtifact.workingDirectory
|
|
164
|
+
}
|
|
165
|
+
: {})
|
|
166
|
+
},
|
|
167
|
+
dryRun
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
if (appProcess) {
|
|
171
|
+
children.push(appProcess)
|
|
172
|
+
progress.tick("Desktop window launched")
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (children.length === 0) {
|
|
177
|
+
return
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
console.log("")
|
|
181
|
+
printSection("Runtime")
|
|
182
|
+
printStatusTable([
|
|
183
|
+
["done", "Frontend", config.frontend.devUrl],
|
|
184
|
+
["done", "Config", configPath],
|
|
185
|
+
["done", "Backend", backendArtifact ? backendArtifact.bundleEntryPath : "disabled"]
|
|
186
|
+
])
|
|
187
|
+
console.log(" Press Ctrl+C to stop")
|
|
188
|
+
|
|
189
|
+
const cleanup = registerChildCleanup(children)
|
|
190
|
+
|
|
191
|
+
try {
|
|
192
|
+
await Promise.race([
|
|
193
|
+
...children.map((child, index) =>
|
|
194
|
+
waitForProcessExit(child, index === 0 ? "dev process" : "native host")
|
|
195
|
+
)
|
|
196
|
+
])
|
|
197
|
+
} finally {
|
|
198
|
+
await cleanup()
|
|
199
|
+
}
|
|
200
|
+
}
|
package/src/commands/doctor.js
CHANGED
|
@@ -1,137 +1,144 @@
|
|
|
1
|
-
import { existsSync } from "node:fs"
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
getAppChecks,
|
|
5
|
-
getFrameworkChecks,
|
|
6
|
-
getFrameworkRuntimeChecks,
|
|
7
|
-
getFrameworkRuntimeModeSummary,
|
|
8
|
-
hasFrameworkSourcePackage,
|
|
9
|
-
loadResetConfig,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { existsSync } from "node:fs"
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
getAppChecks,
|
|
5
|
+
getFrameworkChecks,
|
|
6
|
+
getFrameworkRuntimeChecks,
|
|
7
|
+
getFrameworkRuntimeModeSummary,
|
|
8
|
+
hasFrameworkSourcePackage,
|
|
9
|
+
loadResetConfig,
|
|
10
|
+
resolveOptionalBackendEntry,
|
|
11
|
+
resolveFrontendDir,
|
|
12
|
+
resolveAppPaths,
|
|
13
|
+
resolveConfigPath,
|
|
14
|
+
resolveFrameworkPaths
|
|
15
|
+
} from "../lib/project.js"
|
|
16
|
+
import { findVcpkgToolchainFile } from "../lib/toolchain.js"
|
|
17
|
+
import {
|
|
18
|
+
printBanner,
|
|
19
|
+
printKeyValueTable,
|
|
20
|
+
printSection,
|
|
21
|
+
printStatusTable
|
|
22
|
+
} from "../lib/ui.js"
|
|
23
|
+
|
|
24
|
+
export const description = "Inspect the current project layout"
|
|
25
|
+
|
|
25
26
|
export async function run(context) {
|
|
26
27
|
const appPaths = resolveAppPaths(context.projectRoot)
|
|
27
|
-
const frameworkPaths = resolveFrameworkPaths()
|
|
28
|
+
const frameworkPaths = resolveFrameworkPaths({ appRoot: context.projectRoot })
|
|
28
29
|
let runtimeMode = null
|
|
29
30
|
let runtimeModeError = null
|
|
30
|
-
|
|
31
|
-
let config = null
|
|
32
|
-
|
|
33
|
-
if (existsSync(resolveConfigPath(appPaths))) {
|
|
34
|
-
config = loadResetConfig(appPaths)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
try {
|
|
38
|
-
runtimeMode = getFrameworkRuntimeModeSummary(frameworkPaths)
|
|
39
|
-
} catch (error) {
|
|
40
|
-
runtimeModeError = error instanceof Error ? error.message : String(error)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
printBanner("reset-framework-cli doctor", description)
|
|
44
|
-
|
|
45
|
-
printSection("App project")
|
|
46
|
-
|
|
47
|
-
const appChecks = [...getAppChecks(appPaths)]
|
|
48
|
-
if (config) {
|
|
49
|
-
appChecks.unshift(["frontend", resolveFrontendDir(appPaths, config)])
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
appChecks.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
])
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
])
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
["
|
|
134
|
-
["
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
31
|
+
|
|
32
|
+
let config = null
|
|
33
|
+
|
|
34
|
+
if (existsSync(resolveConfigPath(appPaths))) {
|
|
35
|
+
config = loadResetConfig(appPaths)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
runtimeMode = getFrameworkRuntimeModeSummary(frameworkPaths)
|
|
40
|
+
} catch (error) {
|
|
41
|
+
runtimeModeError = error instanceof Error ? error.message : String(error)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
printBanner("reset-framework-cli doctor", description)
|
|
45
|
+
|
|
46
|
+
printSection("App project")
|
|
47
|
+
|
|
48
|
+
const appChecks = [...getAppChecks(appPaths)]
|
|
49
|
+
if (config) {
|
|
50
|
+
appChecks.unshift(["frontend", resolveFrontendDir(appPaths, config)])
|
|
51
|
+
}
|
|
52
|
+
const backendEntry = resolveOptionalBackendEntry(appPaths)
|
|
53
|
+
if (backendEntry) {
|
|
54
|
+
appChecks.splice(1, 0, ["backend", backendEntry])
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
printStatusTable(
|
|
58
|
+
appChecks.map(([label, filePath]) => [
|
|
59
|
+
existsSync(filePath) ? "ok" : "missing",
|
|
60
|
+
label,
|
|
61
|
+
filePath
|
|
62
|
+
])
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
console.log("")
|
|
66
|
+
printSection("Framework installation")
|
|
67
|
+
|
|
68
|
+
printStatusTable(
|
|
69
|
+
getFrameworkChecks(frameworkPaths).map(([label, filePath]) => [
|
|
70
|
+
existsSync(filePath) ? "ok" : "missing",
|
|
71
|
+
label,
|
|
72
|
+
filePath
|
|
73
|
+
])
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
console.log("")
|
|
77
|
+
printSection("Runtime installation")
|
|
78
|
+
|
|
79
|
+
const runtimeChecks = getFrameworkRuntimeChecks(frameworkPaths)
|
|
80
|
+
printStatusTable(
|
|
81
|
+
runtimeChecks.length > 0
|
|
82
|
+
? runtimeChecks.map(([label, filePath]) => [
|
|
83
|
+
existsSync(filePath) ? "ok" : "missing",
|
|
84
|
+
label,
|
|
85
|
+
filePath
|
|
86
|
+
])
|
|
87
|
+
: [["warn", "runtime", `No packaged runtime registered for ${process.platform}-${process.arch}`]]
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
console.log("")
|
|
91
|
+
printSection("Framework packages")
|
|
92
|
+
printKeyValueTable([
|
|
93
|
+
[
|
|
94
|
+
"Runtime",
|
|
95
|
+
frameworkPaths.runtimePackage?.packageInfo
|
|
96
|
+
? `${frameworkPaths.runtimePackage.packageInfo.packageName}@${frameworkPaths.runtimePackage.packageInfo.version}`
|
|
97
|
+
: `Not installed for ${process.platform}-${process.arch}`
|
|
98
|
+
],
|
|
99
|
+
[
|
|
100
|
+
"Native source",
|
|
101
|
+
frameworkPaths.frameworkPackage
|
|
102
|
+
? `${frameworkPaths.frameworkPackage.packageName}@${frameworkPaths.frameworkPackage.version}`
|
|
103
|
+
: "Not installed"
|
|
104
|
+
],
|
|
105
|
+
["Backend", `${frameworkPaths.backendPackage.packageName}@${frameworkPaths.backendPackage.version}`],
|
|
106
|
+
["SDK", `${frameworkPaths.sdkPackage.packageName}@${frameworkPaths.sdkPackage.version}`],
|
|
107
|
+
["Schema", `${frameworkPaths.schemaPackage.packageName}@${frameworkPaths.schemaPackage.version}`]
|
|
108
|
+
])
|
|
109
|
+
|
|
110
|
+
console.log("")
|
|
111
|
+
printSection("Runtime mode")
|
|
112
|
+
printStatusTable([
|
|
113
|
+
[
|
|
114
|
+
runtimeMode ? "ok" : "warn",
|
|
115
|
+
"Runtime mode",
|
|
116
|
+
runtimeMode ? `${runtimeMode.kind} (${runtimeMode.label})` : runtimeModeError
|
|
117
|
+
]
|
|
118
|
+
])
|
|
119
|
+
|
|
120
|
+
if (hasFrameworkSourcePackage(frameworkPaths)) {
|
|
121
|
+
console.log("")
|
|
122
|
+
printSection("Native toolchain")
|
|
123
|
+
const vcpkgToolchainFile = findVcpkgToolchainFile()
|
|
124
|
+
printStatusTable([
|
|
125
|
+
["ok", "Framework source", frameworkPaths.frameworkRoot],
|
|
126
|
+
[vcpkgToolchainFile ? "ok" : "warn", "vcpkg toolchain", vcpkgToolchainFile ?? "Will be bootstrapped on first source build"]
|
|
127
|
+
])
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (config) {
|
|
131
|
+
console.log("")
|
|
132
|
+
printSection("Config")
|
|
133
|
+
printKeyValueTable([
|
|
134
|
+
["Name", config.name],
|
|
135
|
+
["Product", config.productName],
|
|
136
|
+
["App ID", config.appId],
|
|
137
|
+
["Frontend", config.project.frontendDir],
|
|
138
|
+
["Backend", backendEntry ?? "disabled"],
|
|
139
|
+
["Styling", config.project.styling],
|
|
140
|
+
["Dev URL", config.frontend.devUrl],
|
|
141
|
+
["Output", config.build.outputDir]
|
|
142
|
+
])
|
|
143
|
+
}
|
|
144
|
+
}
|