reset-framework-cli 0.2.1 → 1.0.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.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Command-line tooling for Reset Framework.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"node": ">=20.19.0"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@reset-framework/native": "0.
|
|
15
|
-
"@reset-framework/schema": "0.
|
|
16
|
-
"@reset-framework/sdk": "0.
|
|
14
|
+
"@reset-framework/native": "1.0.1",
|
|
15
|
+
"@reset-framework/schema": "1.0.1",
|
|
16
|
+
"@reset-framework/sdk": "1.0.1"
|
|
17
17
|
},
|
|
18
18
|
"bin": {
|
|
19
19
|
"reset-framework-cli": "src/index.js"
|
package/src/lib/project.js
CHANGED
|
@@ -120,21 +120,42 @@ function resolvePackageInfo(packageName, fallbackRoot) {
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
function resolveWorkspacePackageInfo(packageName, workspaceRoot, fallbackInfo) {
|
|
124
|
+
const packageJsonPath = path.join(workspaceRoot, "package.json")
|
|
125
|
+
|
|
126
|
+
if (!existsSync(packageJsonPath)) {
|
|
127
|
+
return fallbackInfo
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const manifest = readJsonFile(packageJsonPath)
|
|
131
|
+
|
|
132
|
+
return {
|
|
133
|
+
packageName: manifest.name ?? packageName,
|
|
134
|
+
packageRoot: workspaceRoot,
|
|
135
|
+
packageJsonPath,
|
|
136
|
+
version: manifest.version ?? fallbackInfo.version,
|
|
137
|
+
localFallback: true
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
123
141
|
export function resolveFrameworkPaths() {
|
|
124
142
|
const moduleDir = path.dirname(fileURLToPath(import.meta.url))
|
|
125
143
|
const cliDir = path.resolve(moduleDir, "../..")
|
|
126
144
|
const packagesDir = path.resolve(cliDir, "..")
|
|
127
|
-
const nativePackage =
|
|
145
|
+
const nativePackage = resolveWorkspacePackageInfo(
|
|
128
146
|
"@reset-framework/native",
|
|
129
|
-
path.join(packagesDir, "native")
|
|
147
|
+
path.join(packagesDir, "native"),
|
|
148
|
+
resolvePackageInfo("@reset-framework/native", path.join(packagesDir, "native"))
|
|
130
149
|
)
|
|
131
|
-
const sdkPackage =
|
|
150
|
+
const sdkPackage = resolveWorkspacePackageInfo(
|
|
132
151
|
"@reset-framework/sdk",
|
|
133
|
-
path.join(packagesDir, "sdk")
|
|
152
|
+
path.join(packagesDir, "sdk"),
|
|
153
|
+
resolvePackageInfo("@reset-framework/sdk", path.join(packagesDir, "sdk"))
|
|
134
154
|
)
|
|
135
|
-
const schemaPackage =
|
|
155
|
+
const schemaPackage = resolveWorkspacePackageInfo(
|
|
136
156
|
"@reset-framework/schema",
|
|
137
|
-
path.join(packagesDir, "schema")
|
|
157
|
+
path.join(packagesDir, "schema"),
|
|
158
|
+
resolvePackageInfo("@reset-framework/schema", path.join(packagesDir, "schema"))
|
|
138
159
|
)
|
|
139
160
|
const isWorkspaceLayout = [nativePackage, sdkPackage, schemaPackage].every((pkg) =>
|
|
140
161
|
isPathInside(packagesDir, pkg.packageRoot)
|
|
@@ -254,6 +275,7 @@ export function validateResetConfig(rawConfig) {
|
|
|
254
275
|
const frontend = optionalObject(rawConfig, "frontend")
|
|
255
276
|
const build = optionalObject(rawConfig, "build")
|
|
256
277
|
const project = optionalObject(rawConfig, "project")
|
|
278
|
+
const security = optionalObject(rawConfig, "security")
|
|
257
279
|
const windowConfig = optionalObject(rawConfig, "window")
|
|
258
280
|
|
|
259
281
|
return {
|
|
@@ -276,6 +298,17 @@ export function validateResetConfig(rawConfig) {
|
|
|
276
298
|
},
|
|
277
299
|
build: {
|
|
278
300
|
outputDir: optionalString(build, "outputDir", ".reset/build")
|
|
301
|
+
},
|
|
302
|
+
security: {
|
|
303
|
+
permissions: Array.isArray(security.permissions)
|
|
304
|
+
? security.permissions.map((value) => {
|
|
305
|
+
if (typeof value !== "string" || value.trim() === "") {
|
|
306
|
+
throw new Error("Missing or invalid string field 'security.permissions'")
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
return value
|
|
310
|
+
})
|
|
311
|
+
: []
|
|
279
312
|
}
|
|
280
313
|
}
|
|
281
314
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
4
|
+
"baseUrl": ".",
|
|
4
5
|
"target": "ES2023",
|
|
5
6
|
"useDefineForClassFields": true,
|
|
6
7
|
"lib": ["ES2023", "DOM", "DOM.Iterable"],
|
|
@@ -18,7 +19,10 @@
|
|
|
18
19
|
"noUnusedParameters": true,
|
|
19
20
|
"erasableSyntaxOnly": true,
|
|
20
21
|
"noFallthroughCasesInSwitch": true,
|
|
21
|
-
"noUncheckedSideEffectImports": true
|
|
22
|
+
"noUncheckedSideEffectImports": true,
|
|
23
|
+
"paths": {
|
|
24
|
+
"@reset-framework/sdk": ["../../../../sdk/src/index.d.ts"]
|
|
25
|
+
}
|
|
22
26
|
},
|
|
23
27
|
"include": ["src"]
|
|
24
28
|
}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import path from 'node:path'
|
|
2
|
+
import { fileURLToPath } from 'node:url'
|
|
2
3
|
import react from '@vitejs/plugin-react'
|
|
4
|
+
import { defineConfig } from 'vite'
|
|
5
|
+
|
|
6
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
3
7
|
|
|
4
8
|
export default defineConfig({
|
|
5
9
|
plugins: [react()],
|
|
10
|
+
resolve: {
|
|
11
|
+
alias: {
|
|
12
|
+
'@reset-framework/sdk': path.resolve(__dirname, '../../../../sdk/src/index.js'),
|
|
13
|
+
},
|
|
14
|
+
},
|
|
6
15
|
})
|
|
@@ -25,5 +25,31 @@
|
|
|
25
25
|
},
|
|
26
26
|
"build": {
|
|
27
27
|
"outputDir": ".reset/build"
|
|
28
|
+
},
|
|
29
|
+
"security": {
|
|
30
|
+
"permissions": [
|
|
31
|
+
"app.*",
|
|
32
|
+
"runtime.*",
|
|
33
|
+
"window.*",
|
|
34
|
+
"dialog.*",
|
|
35
|
+
"fs.*",
|
|
36
|
+
"path.*",
|
|
37
|
+
"shell.*",
|
|
38
|
+
"clipboard.*",
|
|
39
|
+
"notification.*",
|
|
40
|
+
"screen.*",
|
|
41
|
+
"storage.*",
|
|
42
|
+
"webview.*",
|
|
43
|
+
"event.*",
|
|
44
|
+
"crypto.*",
|
|
45
|
+
"process.*",
|
|
46
|
+
"power.*",
|
|
47
|
+
"menu.*",
|
|
48
|
+
"tray.*",
|
|
49
|
+
"shortcut.*",
|
|
50
|
+
"protocol.*",
|
|
51
|
+
"updater.*",
|
|
52
|
+
"net.*"
|
|
53
|
+
]
|
|
28
54
|
}
|
|
29
55
|
}
|