reset-framework-cli 1.2.2 → 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 +7 -7
- package/src/commands/build.js +144 -144
- package/src/commands/dev.js +195 -195
- package/src/commands/doctor.js +140 -140
- package/src/commands/init.js +946 -946
- package/src/commands/package.js +68 -68
- package/src/index.js +195 -195
- package/src/lib/backend.js +123 -123
- 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 -283
- package/src/lib/process.js +303 -303
- package/src/lib/project.js +893 -866
- 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/doctor.js
CHANGED
|
@@ -1,144 +1,144 @@
|
|
|
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
|
-
|
|
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
|
+
|
|
26
26
|
export async function run(context) {
|
|
27
27
|
const appPaths = resolveAppPaths(context.projectRoot)
|
|
28
|
-
const frameworkPaths = resolveFrameworkPaths()
|
|
28
|
+
const frameworkPaths = resolveFrameworkPaths({ appRoot: context.projectRoot })
|
|
29
29
|
let runtimeMode = null
|
|
30
30
|
let runtimeModeError = null
|
|
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
|
-
}
|
|
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
|
+
}
|