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.
Files changed (35) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +25 -25
  3. package/package.json +7 -7
  4. package/src/commands/build.js +144 -144
  5. package/src/commands/dev.js +195 -195
  6. package/src/commands/doctor.js +140 -140
  7. package/src/commands/init.js +946 -946
  8. package/src/commands/package.js +68 -68
  9. package/src/index.js +195 -195
  10. package/src/lib/backend.js +123 -123
  11. package/src/lib/context.js +66 -66
  12. package/src/lib/framework.js +57 -57
  13. package/src/lib/logger.js +11 -11
  14. package/src/lib/output.js +283 -283
  15. package/src/lib/process.js +303 -303
  16. package/src/lib/project.js +893 -866
  17. package/src/lib/toolchain.js +62 -62
  18. package/src/lib/ui.js +244 -244
  19. package/templates/basic/README.md +15 -15
  20. package/templates/basic/frontend/README.md +73 -73
  21. package/templates/basic/frontend/eslint.config.js +23 -23
  22. package/templates/basic/frontend/index.html +13 -13
  23. package/templates/basic/frontend/package.json +31 -31
  24. package/templates/basic/frontend/public/icons.svg +24 -24
  25. package/templates/basic/frontend/src/App.css +216 -216
  26. package/templates/basic/frontend/src/App.tsx +77 -77
  27. package/templates/basic/frontend/src/assets/vite.svg +1 -1
  28. package/templates/basic/frontend/src/index.css +111 -111
  29. package/templates/basic/frontend/src/lib/reset.ts +1 -1
  30. package/templates/basic/frontend/src/main.tsx +10 -10
  31. package/templates/basic/frontend/tsconfig.app.json +28 -28
  32. package/templates/basic/frontend/tsconfig.json +7 -7
  33. package/templates/basic/frontend/tsconfig.node.json +26 -26
  34. package/templates/basic/frontend/vite.config.ts +16 -16
  35. package/templates/basic/reset.config.json +58 -58
@@ -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
+ }