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.
Files changed (35) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +25 -25
  3. package/package.json +8 -6
  4. package/src/commands/build.js +144 -126
  5. package/src/commands/dev.js +195 -174
  6. package/src/commands/doctor.js +140 -133
  7. package/src/commands/init.js +946 -866
  8. package/src/commands/package.js +68 -68
  9. package/src/index.js +195 -195
  10. package/src/lib/backend.js +123 -0
  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 -268
  15. package/src/lib/process.js +303 -303
  16. package/src/lib/project.js +897 -833
  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
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Jan Kordoš
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to do so, subject to the
10
- following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jan Kordoš
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to do so, subject to the
10
+ following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
package/README.md CHANGED
@@ -1,21 +1,21 @@
1
- # reset-framework-cli
2
-
3
- `reset-framework-cli` is the developer-facing command-line interface for Reset Framework.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install -g reset-framework-cli
9
- ```
10
-
11
- ## Commands
12
-
13
- - `reset-framework-cli create-app my-app`
14
- - `reset-framework-cli dev`
15
- - `reset-framework-cli build`
16
- - `reset-framework-cli package`
17
- - `reset-framework-cli doctor`
18
-
1
+ # reset-framework-cli
2
+
3
+ `reset-framework-cli` is the developer-facing command-line interface for Reset Framework.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g reset-framework-cli
9
+ ```
10
+
11
+ ## Commands
12
+
13
+ - `reset-framework-cli create-app my-app`
14
+ - `reset-framework-cli dev`
15
+ - `reset-framework-cli build`
16
+ - `reset-framework-cli package`
17
+ - `reset-framework-cli doctor`
18
+
19
19
  ## Package boundary
20
20
 
21
21
  - `reset-framework-cli` orchestrates the framework.
@@ -23,7 +23,7 @@ npm install -g reset-framework-cli
23
23
  - `@reset-framework/native` provides the CMake-based runtime source package.
24
24
  - `@reset-framework/sdk` provides the frontend bridge package.
25
25
  - `@reset-framework/schema` provides the config schema package.
26
-
26
+
27
27
  ## How it works
28
28
 
29
29
  - `reset-framework-cli dev` and `reset-framework-cli build` use the bundled runtime package for the current platform by default.
@@ -47,11 +47,11 @@ Source build requirements:
47
47
 
48
48
  ## Publish model
49
49
 
50
- `reset-framework-cli` should be published only after:
50
+ `reset-framework-cli` belongs to the `core` release target and should be published only after:
51
51
 
52
52
  1. `@reset-framework/schema`
53
- 2. `@reset-framework/sdk`
54
- 3. `@reset-framework/runtime-darwin-arm64`
55
- 4. `@reset-framework/runtime-darwin-x64`
56
- 5. `@reset-framework/runtime-win32-x64`
57
- 6. `@reset-framework/native`
53
+ 2. `@reset-framework/backend`
54
+ 3. `@reset-framework/sdk`
55
+ 4. `reset-framework-cli`
56
+
57
+ Runtime packages and `@reset-framework/native` can be published independently when only a single binary target changes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reset-framework-cli",
3
- "version": "1.2.1",
3
+ "version": "1.2.4",
4
4
  "type": "module",
5
5
  "description": "Command-line tooling for Reset Framework.",
6
6
  "license": "MIT",
@@ -11,13 +11,15 @@
11
11
  "node": ">=20.19.0"
12
12
  },
13
13
  "dependencies": {
14
- "@reset-framework/schema": "1.2.1",
15
- "@reset-framework/sdk": "1.2.1"
14
+ "@reset-framework/backend": "1.2.4",
15
+ "@reset-framework/schema": "1.2.4",
16
+ "@reset-framework/sdk": "1.2.4",
17
+ "esbuild": "^0.25.10"
16
18
  },
17
19
  "optionalDependencies": {
18
- "@reset-framework/runtime-darwin-arm64": "1.2.1",
19
- "@reset-framework/runtime-darwin-x64": "1.2.1",
20
- "@reset-framework/runtime-win32-x64": "1.2.1"
20
+ "@reset-framework/runtime-darwin-arm64": ">=1.0.0 <2.0.0",
21
+ "@reset-framework/runtime-darwin-x64": ">=1.0.0 <2.0.0",
22
+ "@reset-framework/runtime-win32-x64": ">=1.0.0 <2.0.0"
21
23
  },
22
24
  "bin": {
23
25
  "reset-framework-cli": "src/index.js"
@@ -1,131 +1,149 @@
1
- import { prepareFrameworkRuntime } from "../lib/framework.js"
2
- import { stageMacOSAppBundle, stageWindowsAppBundle } from "../lib/output.js"
3
- import { resolvePackageManagerCommand, runCommand } from "../lib/process.js"
4
- import {
5
- assertAppProject,
6
- assertFrameworkInstall,
7
- loadResetConfig,
8
- resolveAppOutputPaths,
9
- resolveAppPaths,
10
- resolveAppPackageManager,
11
- resolveConfigPath,
12
- resolveFrontendDir,
13
- resolveFrameworkBuildPaths,
14
- resolveFrameworkRuntimeStrategy,
15
- resolveFrameworkPaths
16
- } from "../lib/project.js"
17
- import {
18
- createProgress,
19
- printBanner,
20
- printKeyValueTable,
21
- printSection,
22
- printStatusTable
23
- } from "../lib/ui.js"
24
-
25
- export const description = "Build the frontend, runtime, and final desktop app bundle"
26
-
27
- export async function run(context) {
28
- const dryRun = Boolean(context.flags["dry-run"])
29
- const skipFrontend = Boolean(context.flags["skip-frontend"])
30
- const skipRuntime = Boolean(context.flags["skip-runtime"])
31
- const skipStage = Boolean(context.flags["skip-stage"])
1
+ import { prepareFrameworkRuntime } from "../lib/framework.js"
2
+ import { prepareAppBackend } from "../lib/backend.js"
3
+ import { stageMacOSAppBundle, stageWindowsAppBundle } from "../lib/output.js"
4
+ import { resolvePackageManagerCommand, runCommand } from "../lib/process.js"
5
+ import {
6
+ assertAppProject,
7
+ assertFrameworkInstall,
8
+ loadResetConfig,
9
+ resolveAppOutputPaths,
10
+ resolveAppPaths,
11
+ resolveAppPackageManager,
12
+ resolveConfigPath,
13
+ resolveFrontendDir,
14
+ resolveFrameworkBuildPaths,
15
+ resolveFrameworkRuntimeStrategy,
16
+ resolveFrameworkPaths,
17
+ resolveOptionalBackendEntry
18
+ } from "../lib/project.js"
19
+ import {
20
+ createProgress,
21
+ printBanner,
22
+ printKeyValueTable,
23
+ printSection,
24
+ printStatusTable
25
+ } from "../lib/ui.js"
26
+
27
+ export const description = "Build the frontend, runtime, and final desktop app bundle"
28
+
29
+ export async function run(context) {
30
+ const dryRun = Boolean(context.flags["dry-run"])
31
+ const skipFrontend = Boolean(context.flags["skip-frontend"])
32
+ const skipRuntime = Boolean(context.flags["skip-runtime"])
33
+ const skipStage = Boolean(context.flags["skip-stage"])
32
34
  const preferSource = Boolean(context.flags["runtime-source"])
33
35
 
34
36
  const appPaths = resolveAppPaths(context.projectRoot)
35
- const frameworkPaths = resolveFrameworkPaths()
37
+ const frameworkPaths = resolveFrameworkPaths({ appRoot: context.projectRoot })
36
38
  assertAppProject(appPaths)
37
39
  assertFrameworkInstall(frameworkPaths)
38
- const config = loadResetConfig(appPaths)
39
- assertAppProject(appPaths, config)
40
- const packageManager = resolveAppPackageManager(appPaths, config)
41
- const outputPaths = resolveAppOutputPaths(appPaths, config)
42
- const configPath = resolveConfigPath(appPaths)
43
- const frontendDir = resolveFrontendDir(appPaths, config)
44
- const frameworkBuildPaths = resolveFrameworkBuildPaths(appPaths)
45
- const runtimeStrategy = resolveFrameworkRuntimeStrategy(frameworkPaths, { preferSource })
46
- const steps = [
47
- !skipFrontend ? "Build frontend" : null,
48
- !skipRuntime ? "Prepare runtime" : null,
49
- !skipStage ? "Stage desktop bundle" : null
50
- ].filter(Boolean)
51
-
52
- printBanner("reset-framework-cli build", description)
53
- printSection("Project")
54
- printKeyValueTable([
55
- ["Config", configPath],
56
- ["Frontend", frontendDir],
57
- ["Package manager", packageManager],
58
- ["Output", outputPaths.appBundlePath],
59
- ["Runtime", `${runtimeStrategy.kind === "prebuilt" ? "bundled" : "source"} (${runtimeStrategy.label})`]
60
- ])
61
- console.log("")
62
-
63
- printSection("Plan")
64
- printStatusTable([
65
- [skipFrontend ? "skip" : "ready", "Frontend", skipFrontend ? "Skipping frontend build" : "Build static frontend assets"],
66
- [
67
- skipRuntime ? "skip" : "ready",
68
- "Runtime",
69
- skipRuntime
70
- ? (runtimeStrategy.kind === "prebuilt" ? "Reuse the bundled runtime package" : "Skip the source runtime build")
71
- : (runtimeStrategy.kind === "prebuilt" ? "Use the bundled runtime package" : "Configure and build the runtime from source")
72
- ],
73
- [skipStage ? "skip" : "ready", "Bundle", skipStage ? "Skipping app bundle staging" : "Assemble the final desktop app bundle"]
74
- ])
75
-
76
- if (dryRun) {
77
- console.log("")
78
- printSection("Dry run")
79
- printStatusTable(
80
- steps.length > 0
81
- ? steps.map((step) => ["plan", step, "No changes will be written"])
82
- : [["warn", "Nothing to do", "All build phases were skipped"]]
83
- )
84
- return
85
- }
86
-
87
- if (steps.length === 0) {
88
- console.log("")
89
- printSection("Result")
90
- printStatusTable([["warn", "Nothing to do", "All build phases were skipped"]])
91
- return
92
- }
93
-
94
- console.log("")
95
- const progress = createProgress(steps.length, "Build")
96
-
97
- if (!skipFrontend) {
98
- await runCommand(resolvePackageManagerCommand(packageManager), ["run", "build"], {
99
- cwd: frontendDir,
100
- dryRun
101
- })
102
- progress.tick("Frontend assets built")
103
- }
104
-
105
- if (!skipRuntime) {
106
- const preparedRuntime = await prepareFrameworkRuntime(frameworkPaths, frameworkBuildPaths, "release", {
107
- cwd: appPaths.appRoot,
108
- dryRun,
109
- preferSource
110
- })
111
- progress.tick(preparedRuntime.kind === "prebuilt" ? "Bundled runtime ready" : "Native runtime built")
112
- }
113
-
114
- if (!skipStage) {
115
- const stageBundle = process.platform === "win32" ? stageWindowsAppBundle : stageMacOSAppBundle
116
- await stageBundle(frameworkPaths, frameworkBuildPaths, config, {
117
- dryRun,
118
- outputPaths,
119
- configPath,
120
- preferSource
121
- })
122
- progress.tick("Desktop app bundle staged")
123
- }
124
-
125
- console.log("")
126
- printSection("Result")
127
- printStatusTable([
128
- ["done", "Build output", outputPaths.outputRoot],
129
- ["done", "Desktop app", outputPaths.appBundlePath]
130
- ])
131
- }
40
+ const config = loadResetConfig(appPaths)
41
+ assertAppProject(appPaths, config)
42
+ const packageManager = resolveAppPackageManager(appPaths, config)
43
+ const outputPaths = resolveAppOutputPaths(appPaths, config)
44
+ const configPath = resolveConfigPath(appPaths)
45
+ const frontendDir = resolveFrontendDir(appPaths, config)
46
+ const backendEntry = resolveOptionalBackendEntry(appPaths)
47
+ const frameworkBuildPaths = resolveFrameworkBuildPaths(appPaths)
48
+ const runtimeStrategy = resolveFrameworkRuntimeStrategy(frameworkPaths, { preferSource })
49
+ const steps = [
50
+ !skipFrontend ? "Build frontend" : null,
51
+ !skipRuntime ? "Prepare runtime" : null,
52
+ !skipStage && backendEntry ? "Bundle backend sidecar" : null,
53
+ !skipStage ? "Stage desktop bundle" : null
54
+ ].filter(Boolean)
55
+
56
+ printBanner("reset-framework-cli build", description)
57
+ printSection("Project")
58
+ printKeyValueTable([
59
+ ["Config", configPath],
60
+ ["Frontend", frontendDir],
61
+ ["Backend", backendEntry ?? "not configured"],
62
+ ["Package manager", packageManager],
63
+ ["Output", outputPaths.appBundlePath],
64
+ ["Runtime", `${runtimeStrategy.kind === "prebuilt" ? "bundled" : "source"} (${runtimeStrategy.label})`]
65
+ ])
66
+ console.log("")
67
+
68
+ printSection("Plan")
69
+ printStatusTable([
70
+ [skipFrontend ? "skip" : "ready", "Frontend", skipFrontend ? "Skipping frontend build" : "Build static frontend assets"],
71
+ [
72
+ skipRuntime ? "skip" : "ready",
73
+ "Runtime",
74
+ skipRuntime
75
+ ? (runtimeStrategy.kind === "prebuilt" ? "Reuse the bundled runtime package" : "Skip the source runtime build")
76
+ : (runtimeStrategy.kind === "prebuilt" ? "Use the bundled runtime package" : "Configure and build the runtime from source")
77
+ ],
78
+ [
79
+ backendEntry && !skipStage ? "ready" : "skip",
80
+ "Backend",
81
+ backendEntry && !skipStage ? "Bundle the optional TypeScript sidecar backend" : "No backend staging is required"
82
+ ],
83
+ [skipStage ? "skip" : "ready", "Bundle", skipStage ? "Skipping app bundle staging" : "Assemble the final desktop app bundle"]
84
+ ])
85
+
86
+ if (dryRun) {
87
+ console.log("")
88
+ printSection("Dry run")
89
+ printStatusTable(
90
+ steps.length > 0
91
+ ? steps.map((step) => ["plan", step, "No changes will be written"])
92
+ : [["warn", "Nothing to do", "All build phases were skipped"]]
93
+ )
94
+ return
95
+ }
96
+
97
+ if (steps.length === 0) {
98
+ console.log("")
99
+ printSection("Result")
100
+ printStatusTable([["warn", "Nothing to do", "All build phases were skipped"]])
101
+ return
102
+ }
103
+
104
+ console.log("")
105
+ const progress = createProgress(steps.length, "Build")
106
+
107
+ let backendArtifact = null
108
+
109
+ if (!skipFrontend) {
110
+ await runCommand(resolvePackageManagerCommand(packageManager), ["run", "build"], {
111
+ cwd: frontendDir,
112
+ dryRun
113
+ })
114
+ progress.tick("Frontend assets built")
115
+ }
116
+
117
+ if (!skipRuntime) {
118
+ const preparedRuntime = await prepareFrameworkRuntime(frameworkPaths, frameworkBuildPaths, "release", {
119
+ cwd: appPaths.appRoot,
120
+ dryRun,
121
+ preferSource
122
+ })
123
+ progress.tick(preparedRuntime.kind === "prebuilt" ? "Bundled runtime ready" : "Native runtime built")
124
+ }
125
+
126
+ if (!skipStage && backendEntry) {
127
+ backendArtifact = await prepareAppBackend(frameworkPaths, appPaths, "release")
128
+ progress.tick("Backend sidecar bundled")
129
+ }
130
+
131
+ if (!skipStage) {
132
+ const stageBundle = process.platform === "win32" ? stageWindowsAppBundle : stageMacOSAppBundle
133
+ await stageBundle(frameworkPaths, frameworkBuildPaths, config, {
134
+ dryRun,
135
+ outputPaths,
136
+ configPath,
137
+ preferSource,
138
+ backendArtifact
139
+ })
140
+ progress.tick("Desktop app bundle staged")
141
+ }
142
+
143
+ console.log("")
144
+ printSection("Result")
145
+ printStatusTable([
146
+ ["done", "Build output", outputPaths.outputRoot],
147
+ ["done", "Desktop app", outputPaths.appBundlePath]
148
+ ])
149
+ }