reset-framework-cli 0.2.0 → 0.2.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reset-framework-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Command-line tooling for Reset Framework.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@reset-framework/sdk": "0.2.0"
|
|
17
17
|
},
|
|
18
18
|
"bin": {
|
|
19
|
-
"reset-framework-cli": "
|
|
19
|
+
"reset-framework-cli": "src/index.js"
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
22
|
"src",
|
package/src/commands/init.js
CHANGED
|
@@ -25,22 +25,7 @@ import {
|
|
|
25
25
|
withPromptSession
|
|
26
26
|
} from "../lib/ui.js"
|
|
27
27
|
|
|
28
|
-
const sdkRuntimeReexport = `export
|
|
29
|
-
createResetClient,
|
|
30
|
-
getResetRuntime,
|
|
31
|
-
invoke,
|
|
32
|
-
invokeRaw,
|
|
33
|
-
isResetRuntimeAvailable,
|
|
34
|
-
ResetRuntimeUnavailableError,
|
|
35
|
-
} from '@reset-framework/sdk'
|
|
36
|
-
|
|
37
|
-
export type {
|
|
38
|
-
ResetInvokeError,
|
|
39
|
-
ResetInvokeResponse,
|
|
40
|
-
ResetInvokeSuccess,
|
|
41
|
-
ResetRuntime,
|
|
42
|
-
ResetRuntimeWindow,
|
|
43
|
-
} from '@reset-framework/sdk'
|
|
28
|
+
const sdkRuntimeReexport = `export * from '@reset-framework/sdk'
|
|
44
29
|
`
|
|
45
30
|
|
|
46
31
|
const standaloneViteConfig = `import { defineConfig } from 'vite'
|
|
@@ -100,29 +85,33 @@ body {
|
|
|
100
85
|
`
|
|
101
86
|
|
|
102
87
|
const tailwindAppTsx = `import { useEffect, useState } from 'react'
|
|
103
|
-
import {
|
|
88
|
+
import { reset } from './lib/reset'
|
|
104
89
|
|
|
105
90
|
function App() {
|
|
106
91
|
const [count, setCount] = useState(0)
|
|
107
92
|
const [appName, setAppName] = useState('Reset App')
|
|
93
|
+
const [appVersion, setAppVersion] = useState('0.0.0')
|
|
108
94
|
const [platform, setPlatform] = useState('unknown')
|
|
95
|
+
const [bridgeVersion, setBridgeVersion] = useState('1')
|
|
109
96
|
|
|
110
97
|
useEffect(() => {
|
|
111
98
|
let cancelled = false
|
|
112
99
|
|
|
113
100
|
async function loadRuntimeInfo() {
|
|
114
101
|
try {
|
|
115
|
-
const [
|
|
116
|
-
|
|
117
|
-
|
|
102
|
+
const [appInfo, runtimeInfo] = await Promise.all([
|
|
103
|
+
reset.app.getInfo(),
|
|
104
|
+
reset.runtime.getInfo(),
|
|
118
105
|
])
|
|
119
106
|
|
|
120
107
|
if (cancelled) {
|
|
121
108
|
return
|
|
122
109
|
}
|
|
123
110
|
|
|
124
|
-
setAppName(name)
|
|
125
|
-
|
|
111
|
+
setAppName(appInfo.name)
|
|
112
|
+
setAppVersion(appInfo.version)
|
|
113
|
+
setPlatform(runtimeInfo.platform)
|
|
114
|
+
setBridgeVersion(runtimeInfo.bridgeVersion)
|
|
126
115
|
} catch (error) {
|
|
127
116
|
console.error('Failed to load runtime info', error)
|
|
128
117
|
}
|
|
@@ -139,7 +128,7 @@ function App() {
|
|
|
139
128
|
<main className="min-h-screen bg-stone-950 text-stone-100">
|
|
140
129
|
<div className="mx-auto flex min-h-screen max-w-6xl flex-col px-6 py-12 lg:px-10">
|
|
141
130
|
<div className="inline-flex w-fit items-center rounded-full border border-white/10 bg-white/5 px-4 py-2 text-sm tracking-[0.18em] text-stone-300 uppercase">
|
|
142
|
-
{appName} on {platform}
|
|
131
|
+
{appName} v{appVersion} on {platform}
|
|
143
132
|
</div>
|
|
144
133
|
|
|
145
134
|
<div className="mt-12 grid gap-12 lg:grid-cols-[minmax(0,1.4fr)_minmax(20rem,0.8fr)] lg:items-end">
|
|
@@ -158,8 +147,8 @@ function App() {
|
|
|
158
147
|
|
|
159
148
|
<section className="rounded-[2rem] border border-white/10 bg-white/5 p-6 shadow-2xl shadow-black/20 backdrop-blur">
|
|
160
149
|
<div className="flex items-center justify-between text-sm text-stone-400">
|
|
161
|
-
<span>
|
|
162
|
-
<span>
|
|
150
|
+
<span>Runtime bridge</span>
|
|
151
|
+
<span>bridge v{bridgeVersion}</span>
|
|
163
152
|
</div>
|
|
164
153
|
<div className="mt-6 rounded-2xl border border-white/10 bg-black/30 p-5">
|
|
165
154
|
<div className="text-xs uppercase tracking-[0.24em] text-stone-500">
|
|
@@ -1,28 +1,32 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react'
|
|
2
2
|
import './App.css'
|
|
3
|
-
import {
|
|
3
|
+
import { reset } from './lib/reset'
|
|
4
4
|
|
|
5
5
|
function App() {
|
|
6
6
|
const [count, setCount] = useState(0)
|
|
7
7
|
const [appName, setAppName] = useState('Reset Framework')
|
|
8
|
+
const [appVersion, setAppVersion] = useState('0.0.0')
|
|
8
9
|
const [platform, setPlatform] = useState('unknown')
|
|
10
|
+
const [bridgeVersion, setBridgeVersion] = useState('1')
|
|
9
11
|
|
|
10
12
|
useEffect(() => {
|
|
11
13
|
let cancelled = false
|
|
12
14
|
|
|
13
15
|
async function loadRuntimeInfo() {
|
|
14
16
|
try {
|
|
15
|
-
const [
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
const [appInfo, runtimeInfo] = await Promise.all([
|
|
18
|
+
reset.app.getInfo(),
|
|
19
|
+
reset.runtime.getInfo(),
|
|
18
20
|
])
|
|
19
21
|
|
|
20
22
|
if (cancelled) {
|
|
21
23
|
return
|
|
22
24
|
}
|
|
23
25
|
|
|
24
|
-
setAppName(name)
|
|
25
|
-
|
|
26
|
+
setAppName(appInfo.name)
|
|
27
|
+
setAppVersion(appInfo.version)
|
|
28
|
+
setPlatform(runtimeInfo.platform)
|
|
29
|
+
setBridgeVersion(runtimeInfo.bridgeVersion)
|
|
26
30
|
} catch (error) {
|
|
27
31
|
console.error('Failed to load runtime info', error)
|
|
28
32
|
}
|
|
@@ -40,7 +44,7 @@ function App() {
|
|
|
40
44
|
<div className="ambient-background"></div>
|
|
41
45
|
|
|
42
46
|
<div className="content-wrapper">
|
|
43
|
-
<div className="badge">{appName} on {platform}</div>
|
|
47
|
+
<div className="badge">{appName} v{appVersion} on {platform}</div>
|
|
44
48
|
|
|
45
49
|
<h1 className="title">
|
|
46
50
|
Native performance.<br />
|
|
@@ -57,12 +61,12 @@ function App() {
|
|
|
57
61
|
Count is {count}
|
|
58
62
|
</button>
|
|
59
63
|
<a href="#" className="secondary-btn">
|
|
60
|
-
|
|
64
|
+
Bridge v{bridgeVersion}
|
|
61
65
|
</a>
|
|
62
66
|
</div>
|
|
63
67
|
|
|
64
68
|
<div className="terminal-snippet">
|
|
65
|
-
<code>
|
|
69
|
+
<code>reset-framework-cli create-app my-app</code>
|
|
66
70
|
</div>
|
|
67
71
|
</div>
|
|
68
72
|
</main>
|
|
@@ -1,16 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
createResetClient,
|
|
3
|
-
getResetRuntime,
|
|
4
|
-
invoke,
|
|
5
|
-
invokeRaw,
|
|
6
|
-
isResetRuntimeAvailable,
|
|
7
|
-
ResetRuntimeUnavailableError,
|
|
8
|
-
} from '@reset-framework/sdk'
|
|
9
|
-
|
|
10
|
-
export type {
|
|
11
|
-
ResetInvokeError,
|
|
12
|
-
ResetInvokeResponse,
|
|
13
|
-
ResetInvokeSuccess,
|
|
14
|
-
ResetRuntime,
|
|
15
|
-
ResetRuntimeWindow,
|
|
16
|
-
} from '@reset-framework/sdk'
|
|
1
|
+
export * from '@reset-framework/sdk'
|