plusui-native 0.2.54 → 0.2.56
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/README.md +4 -4
- package/package.json +4 -4
- package/src/index.js +42 -17
- package/templates/base/README.md.template +10 -13
- package/templates/manager.js +3 -3
- package/templates/react/CMakeLists.txt.template +2 -2
- package/templates/react/package.json.template +2 -1
- package/templates/solid/CMakeLists.txt.template +2 -2
- package/templates/solid/package.json.template +2 -1
package/README.md
CHANGED
|
@@ -117,12 +117,12 @@ npm run build
|
|
|
117
117
|
# Run built app
|
|
118
118
|
npm run start
|
|
119
119
|
|
|
120
|
-
# Regenerate bindings manually (app-level)
|
|
121
|
-
npm run
|
|
120
|
+
# Regenerate connection bindings manually (app-level)
|
|
121
|
+
npm run connect
|
|
122
122
|
```
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
`dev` and all `build` commands auto-refresh bindings first
|
|
124
|
+
Connection generation runs per app project and scans for `connect.emit()` / `connect.on()` usage.
|
|
125
|
+
`dev` and all `build` commands auto-refresh connection bindings first.
|
|
126
126
|
|
|
127
127
|
## Requirements
|
|
128
128
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plusui-native",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.56",
|
|
4
4
|
"description": "PlusUI CLI - Build C++ desktop apps modern UI ",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"semver": "^7.6.0",
|
|
28
28
|
"which": "^4.0.0",
|
|
29
29
|
"execa": "^8.0.1",
|
|
30
|
-
"plusui-native-builder": "^0.1.
|
|
31
|
-
"plusui-native-
|
|
30
|
+
"plusui-native-builder": "^0.1.55",
|
|
31
|
+
"plusui-native-connect": "^0.1.55"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"plusui-native-
|
|
34
|
+
"plusui-native-connect": "^0.1.55"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
package/src/index.js
CHANGED
|
@@ -135,9 +135,9 @@ ${COLORS.bright}Usage:${COLORS.reset}
|
|
|
135
135
|
plusui build:frontend Build frontend only
|
|
136
136
|
plusui build:backend Build C++ backend only
|
|
137
137
|
plusui build:all Build for all platforms
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
plusui run Run the built application
|
|
139
|
+
plusui clean Clean build artifacts
|
|
140
|
+
plusui connect Generate connection bindings for current app (aliases: bind, bindgen)
|
|
141
141
|
plusui update Update all PlusUI packages to latest versions
|
|
142
142
|
plusui help Show this help message
|
|
143
143
|
|
|
@@ -260,7 +260,7 @@ function showVersionInfo() {
|
|
|
260
260
|
cliPackageJson.name,
|
|
261
261
|
'plusui-native-core',
|
|
262
262
|
'plusui-native-builder',
|
|
263
|
-
'plusui-native-
|
|
263
|
+
'plusui-native-connect'
|
|
264
264
|
];
|
|
265
265
|
|
|
266
266
|
logSection('PlusUI Package Versions');
|
|
@@ -290,7 +290,7 @@ async function updatePlusUIPackages() {
|
|
|
290
290
|
cliPackageJson.name,
|
|
291
291
|
'plusui-native-core',
|
|
292
292
|
'plusui-native-builder',
|
|
293
|
-
'plusui-native-
|
|
293
|
+
'plusui-native-connect'
|
|
294
294
|
];
|
|
295
295
|
|
|
296
296
|
log('Checking for updates...\n', 'blue');
|
|
@@ -301,12 +301,30 @@ async function updatePlusUIPackages() {
|
|
|
301
301
|
if (isInProject) {
|
|
302
302
|
let updatedCount = 0;
|
|
303
303
|
let upToDateCount = 0;
|
|
304
|
+
let installedCount = 0;
|
|
304
305
|
|
|
305
306
|
for (const pkg of packages) {
|
|
306
307
|
const currentVersion = getInstalledPackageVersion(pkg);
|
|
307
308
|
|
|
308
309
|
if (!currentVersion) {
|
|
309
|
-
|
|
310
|
+
const latestVersion = getLatestPackageVersion(pkg);
|
|
311
|
+
|
|
312
|
+
if (!latestVersion) {
|
|
313
|
+
log(`${COLORS.yellow}${pkg}: not installed (couldn't resolve latest version)${COLORS.reset}`);
|
|
314
|
+
continue;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
try {
|
|
318
|
+
log(`${COLORS.blue}${pkg}: not installed → ${latestVersion}${COLORS.reset}`);
|
|
319
|
+
execSync(`npm install ${pkg}@${latestVersion}`, {
|
|
320
|
+
stdio: ['ignore', 'ignore', 'pipe'],
|
|
321
|
+
encoding: 'utf8'
|
|
322
|
+
});
|
|
323
|
+
log(`${COLORS.green}✓ ${pkg} installed${COLORS.reset}`);
|
|
324
|
+
installedCount++;
|
|
325
|
+
} catch (e) {
|
|
326
|
+
log(`${COLORS.red}✗ ${pkg} install failed${COLORS.reset}`);
|
|
327
|
+
}
|
|
310
328
|
continue;
|
|
311
329
|
}
|
|
312
330
|
|
|
@@ -344,6 +362,9 @@ async function updatePlusUIPackages() {
|
|
|
344
362
|
if (updatedCount > 0) {
|
|
345
363
|
log(`Updated ${updatedCount} package${updatedCount !== 1 ? 's' : ''}`, 'green');
|
|
346
364
|
}
|
|
365
|
+
if (installedCount > 0) {
|
|
366
|
+
log(`Installed ${installedCount} missing package${installedCount !== 1 ? 's' : ''}`, 'green');
|
|
367
|
+
}
|
|
347
368
|
if (upToDateCount > 0) {
|
|
348
369
|
log(`${upToDateCount} package${upToDateCount !== 1 ? 's' : ''} already up to date`, 'dim');
|
|
349
370
|
}
|
|
@@ -449,13 +470,16 @@ function getDevBuildDir() {
|
|
|
449
470
|
|
|
450
471
|
function resolveBindgenScriptPath() {
|
|
451
472
|
const candidates = [
|
|
452
|
-
resolve(__dirname, '../../plusui-
|
|
453
|
-
resolve(__dirname, '../../plusui-
|
|
454
|
-
resolve(__dirname, '../../plusui-native-
|
|
473
|
+
resolve(__dirname, '../../plusui-connect/src/connect.js'),
|
|
474
|
+
resolve(__dirname, '../../plusui-connect/src/index.js'),
|
|
475
|
+
resolve(__dirname, '../../plusui-native-connect/src/connect.js'),
|
|
476
|
+
resolve(__dirname, '../../plusui-native-connect/src/index.js'),
|
|
455
477
|
resolve(__dirname, '../../plusui-native-bindgen/src/index.js'),
|
|
456
|
-
resolve(__dirname, '../../../plusui-native-
|
|
478
|
+
resolve(__dirname, '../../../plusui-native-connect/src/connect.js'),
|
|
479
|
+
resolve(__dirname, '../../../plusui-native-connect/src/index.js'),
|
|
457
480
|
resolve(__dirname, '../../../plusui-native-bindgen/src/index.js'),
|
|
458
|
-
resolve(process.cwd(), 'node_modules', 'plusui-native-
|
|
481
|
+
resolve(process.cwd(), 'node_modules', 'plusui-native-connect', 'src', 'connect.js'),
|
|
482
|
+
resolve(process.cwd(), 'node_modules', 'plusui-native-connect', 'src', 'index.js'),
|
|
459
483
|
resolve(process.cwd(), 'node_modules', 'plusui-native-bindgen', 'src', 'index.js'),
|
|
460
484
|
];
|
|
461
485
|
|
|
@@ -1041,24 +1065,24 @@ async function clean() {
|
|
|
1041
1065
|
}
|
|
1042
1066
|
|
|
1043
1067
|
// ============================================================
|
|
1044
|
-
//
|
|
1068
|
+
// CONNECT GENERATOR FUNCTION
|
|
1045
1069
|
// ============================================================
|
|
1046
1070
|
|
|
1047
1071
|
async function runBindgen(providedArgs = null, options = {}) {
|
|
1048
1072
|
ensureProjectRoot('bindgen');
|
|
1049
|
-
logSection('Running
|
|
1073
|
+
logSection('Running Connection Generator');
|
|
1050
1074
|
|
|
1051
1075
|
const { skipIfNoInput = false, source = 'manual' } = options;
|
|
1052
1076
|
|
|
1053
1077
|
const scriptPath = resolveBindgenScriptPath();
|
|
1054
1078
|
|
|
1055
1079
|
if (!scriptPath) {
|
|
1056
|
-
error(`
|
|
1080
|
+
error(`Connection generator script not found. Please ensure plusui-native-connect is installed.`);
|
|
1057
1081
|
}
|
|
1058
1082
|
|
|
1059
|
-
log(`Using
|
|
1083
|
+
log(`Using connect generator: ${scriptPath}`, 'dim');
|
|
1060
1084
|
|
|
1061
|
-
// plusui
|
|
1085
|
+
// plusui connect [projectRoot] [outputDir]
|
|
1062
1086
|
// Defaults to app-local paths when available.
|
|
1063
1087
|
const args = providedArgs ?? process.argv.slice(3);
|
|
1064
1088
|
let bindgenArgs = [...args];
|
|
@@ -1095,7 +1119,7 @@ async function runBindgen(providedArgs = null, options = {}) {
|
|
|
1095
1119
|
reject(syncErr);
|
|
1096
1120
|
}
|
|
1097
1121
|
} else {
|
|
1098
|
-
reject(new Error(`
|
|
1122
|
+
reject(new Error(`Connection generator failed with code ${code}`));
|
|
1099
1123
|
}
|
|
1100
1124
|
});
|
|
1101
1125
|
});
|
|
@@ -1173,6 +1197,7 @@ async function main() {
|
|
|
1173
1197
|
case 'clean':
|
|
1174
1198
|
await clean();
|
|
1175
1199
|
break;
|
|
1200
|
+
case 'connect':
|
|
1176
1201
|
case 'bind':
|
|
1177
1202
|
case 'bindgen':
|
|
1178
1203
|
await runBindgen();
|
|
@@ -29,26 +29,23 @@ This will:
|
|
|
29
29
|
|
|
30
30
|
Dev build intermediates are stored in `.plusui/dev/...` so your `build/` folder stays focused on release/platform outputs.
|
|
31
31
|
|
|
32
|
-
Note: You can
|
|
32
|
+
Note: You can run `npm run connect` manually anytime.
|
|
33
33
|
|
|
34
|
-
##
|
|
34
|
+
## Connection Generation (App-level)
|
|
35
35
|
|
|
36
|
-
Generate
|
|
36
|
+
Generate project connection bindings from real `connect.emit()`/`connect.on()` usage:
|
|
37
37
|
```bash
|
|
38
|
-
npm run
|
|
38
|
+
npm run connect
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
Default
|
|
41
|
+
Default connect generator paths:
|
|
42
42
|
- Input: project root scan (frontend + backend files)
|
|
43
43
|
- Output: `src/Bindings`
|
|
44
44
|
|
|
45
45
|
Generated structure:
|
|
46
|
-
- `src/Bindings/
|
|
47
|
-
- `src/Bindings/
|
|
48
|
-
- `src/Bindings/
|
|
49
|
-
- `src/Bindings/CustomBindings/WEB_IO`
|
|
50
|
-
- `include/Bindings/NativeBindings/CPP_IO` (generated `.hpp` headers)
|
|
51
|
-
- `include/Bindings/CustomBindings/CPP_IO` (generated `.hpp` headers)
|
|
46
|
+
- `src/Bindings/bindings.gen.ts`
|
|
47
|
+
- `src/Bindings/bindings.gen.hpp`
|
|
48
|
+
- `src/Bindings/connect.manifest.json`
|
|
52
49
|
|
|
53
50
|
Scan extensions:
|
|
54
51
|
- `WEB_IO`: `.ts`, `.tsx`, `.js`, `.jsx`, `.mts`, `.cts`, `.html`
|
|
@@ -60,11 +57,11 @@ Custom binding kinds detected:
|
|
|
60
57
|
- `stream`
|
|
61
58
|
- `event`
|
|
62
59
|
|
|
63
|
-
`plusui
|
|
60
|
+
`plusui connect` scans your project structure and does not require a schema file.
|
|
64
61
|
|
|
65
62
|
You can also pass custom paths:
|
|
66
63
|
```bash
|
|
67
|
-
plusui
|
|
64
|
+
plusui connect <projectRoot> <outputDir>
|
|
68
65
|
```
|
|
69
66
|
|
|
70
67
|
## Assets & Icons
|
package/templates/manager.js
CHANGED
|
@@ -64,9 +64,9 @@ export class TemplateManager {
|
|
|
64
64
|
// Core version follows 0.1.x pattern when CLI is 0.2.x
|
|
65
65
|
const coreVersionRange = `^${major}.1.0`;
|
|
66
66
|
|
|
67
|
-
// Builder and
|
|
67
|
+
// Builder and connect generator also follow 0.1.x pattern
|
|
68
68
|
const builderVersionRange = `^${major}.1.0`;
|
|
69
|
-
const
|
|
69
|
+
const connectVersionRange = `^${major}.1.0`;
|
|
70
70
|
|
|
71
71
|
// 4. Prepare template variables
|
|
72
72
|
const variables = {
|
|
@@ -76,7 +76,7 @@ export class TemplateManager {
|
|
|
76
76
|
PLUSUI_CLI_VERSION: cliVersionRange,
|
|
77
77
|
PLUSUI_CORE_VERSION: coreVersionRange,
|
|
78
78
|
PLUSUI_BUILDER_VERSION: builderVersionRange,
|
|
79
|
-
|
|
79
|
+
PLUSUI_CONNECT_VERSION: connectVersionRange
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
// 5. Copy template files
|
|
@@ -27,7 +27,7 @@ set(PLUSUI_CORE_DIR "")
|
|
|
27
27
|
|
|
28
28
|
# Location 1: Project-local Core directory
|
|
29
29
|
set(PLUSUI_CORE_LOCAL "${CMAKE_SOURCE_DIR}/Core")
|
|
30
|
-
if(EXISTS "${PLUSUI_CORE_LOCAL}/CMakeLists.txt")
|
|
30
|
+
if(NOT PLUSUI_FOUND AND EXISTS "${PLUSUI_CORE_LOCAL}/CMakeLists.txt")
|
|
31
31
|
message(STATUS "Found PlusUI Core at: ${PLUSUI_CORE_LOCAL}")
|
|
32
32
|
add_subdirectory("${PLUSUI_CORE_LOCAL}" "${CMAKE_BINARY_DIR}/plusui-core")
|
|
33
33
|
set(PLUSUI_FOUND TRUE)
|
|
@@ -36,7 +36,7 @@ endif()
|
|
|
36
36
|
|
|
37
37
|
# Location 2: Local development (sibling to project inside PlusUI repo)
|
|
38
38
|
set(PLUSUI_CORE_DEV "${CMAKE_SOURCE_DIR}/../Core")
|
|
39
|
-
if(EXISTS "${PLUSUI_CORE_DEV}/CMakeLists.txt")
|
|
39
|
+
if(NOT PLUSUI_FOUND AND EXISTS "${PLUSUI_CORE_DEV}/CMakeLists.txt")
|
|
40
40
|
message(STATUS "Found PlusUI Core at: ${PLUSUI_CORE_DEV}")
|
|
41
41
|
add_subdirectory("${PLUSUI_CORE_DEV}" "${CMAKE_BINARY_DIR}/plusui-core")
|
|
42
42
|
set(PLUSUI_FOUND TRUE)
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"dev": "plusui dev",
|
|
8
8
|
"dev:frontend": "plusui dev:frontend",
|
|
9
9
|
"dev:backend": "plusui dev:backend",
|
|
10
|
+
"connect": "plusui connect",
|
|
10
11
|
"bind": "plusui bind",
|
|
11
12
|
"bindgen": "plusui bindgen",
|
|
12
13
|
"build": "plusui build",
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
25
|
"plusui-native-builder": "{{PLUSUI_BUILDER_VERSION}}",
|
|
25
|
-
"plusui-native-
|
|
26
|
+
"plusui-native-connect": "{{PLUSUI_CONNECT_VERSION}}"
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
|
|
@@ -27,7 +27,7 @@ set(PLUSUI_CORE_DIR "")
|
|
|
27
27
|
|
|
28
28
|
# Location 1: Project-local Core directory
|
|
29
29
|
set(PLUSUI_CORE_LOCAL "${CMAKE_SOURCE_DIR}/Core")
|
|
30
|
-
if(EXISTS "${PLUSUI_CORE_LOCAL}/CMakeLists.txt")
|
|
30
|
+
if(NOT PLUSUI_FOUND AND EXISTS "${PLUSUI_CORE_LOCAL}/CMakeLists.txt")
|
|
31
31
|
message(STATUS "Found PlusUI Core at: ${PLUSUI_CORE_LOCAL}")
|
|
32
32
|
add_subdirectory("${PLUSUI_CORE_LOCAL}" "${CMAKE_BINARY_DIR}/plusui-core")
|
|
33
33
|
set(PLUSUI_FOUND TRUE)
|
|
@@ -36,7 +36,7 @@ endif()
|
|
|
36
36
|
|
|
37
37
|
# Location 2: Local development (sibling to project inside PlusUI repo)
|
|
38
38
|
set(PLUSUI_CORE_DEV "${CMAKE_SOURCE_DIR}/../Core")
|
|
39
|
-
if(EXISTS "${PLUSUI_CORE_DEV}/CMakeLists.txt")
|
|
39
|
+
if(NOT PLUSUI_FOUND AND EXISTS "${PLUSUI_CORE_DEV}/CMakeLists.txt")
|
|
40
40
|
message(STATUS "Found PlusUI Core at: ${PLUSUI_CORE_DEV}")
|
|
41
41
|
add_subdirectory("${PLUSUI_CORE_DEV}" "${CMAKE_BINARY_DIR}/plusui-core")
|
|
42
42
|
set(PLUSUI_FOUND TRUE)
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"dev": "plusui dev",
|
|
8
8
|
"dev:frontend": "plusui dev:frontend",
|
|
9
9
|
"dev:backend": "plusui dev:backend",
|
|
10
|
+
"connect": "plusui connect",
|
|
10
11
|
"bind": "plusui bind",
|
|
11
12
|
"bindgen": "plusui bindgen",
|
|
12
13
|
"build": "plusui build",
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
25
|
"plusui-native-builder": "{{PLUSUI_BUILDER_VERSION}}",
|
|
25
|
-
"plusui-native-
|
|
26
|
+
"plusui-native-connect": "{{PLUSUI_CONNECT_VERSION}}"
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
|