plusui-native 0.2.76 → 0.2.78

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": "plusui-native",
3
- "version": "0.2.76",
3
+ "version": "0.2.78",
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.75",
31
- "plusui-native-connect": "^0.1.75"
30
+ "plusui-native-builder": "^0.1.77",
31
+ "plusui-native-connect": "^0.1.77"
32
32
  },
33
33
  "peerDependencies": {
34
- "plusui-native-connect": "^0.1.75"
34
+ "plusui-native-connect": "^0.1.77"
35
35
  },
36
36
  "publishConfig": {
37
37
  "access": "public"
@@ -81,7 +81,16 @@ export class TemplateManager {
81
81
  const template = options.template || 'react';
82
82
  const templatePath = join(this.templatesDir, template);
83
83
 
84
- console.log(chalk.bold(`\nCreating PlusUI project: ${projectName}\n`));
84
+ // Determine target path and actual project name
85
+ let targetDirName = projectName;
86
+ let projectPath = resolve(projectName);
87
+
88
+ if (projectName === '.') {
89
+ targetDirName = require('path').basename(process.cwd());
90
+ projectPath = process.cwd();
91
+ }
92
+
93
+ console.log(chalk.bold(`\nCreating PlusUI project: ${targetDirName}\n`));
85
94
 
86
95
  // 1. Check environment first
87
96
  console.log(chalk.blue('Checking environment...'));
@@ -98,21 +107,24 @@ export class TemplateManager {
98
107
 
99
108
  // 2. Create project directory
100
109
  console.log(chalk.blue('Creating project structure...'));
101
- const projectPath = resolve(projectName);
102
110
 
103
- if (existsSync(projectPath)) {
104
- throw new Error(`Directory ${projectName} already exists`);
111
+ if (projectName !== '.') {
112
+ if (existsSync(projectPath)) {
113
+ throw new Error(`Directory ${projectName} already exists`);
114
+ }
115
+ await mkdir(projectPath, { recursive: true });
116
+ } else {
117
+ // Warn but proceed if using current directory
118
+ console.log(chalk.yellow(`Initializing in current directory...`));
105
119
  }
106
120
 
107
- await mkdir(projectPath, { recursive: true });
108
-
109
121
  // 3. Resolve package versions for generated app dependencies
110
122
  const resolvedVersions = await this.resolveTemplatePackageVersions();
111
-
123
+
112
124
  // 4. Prepare template variables
113
125
  const variables = {
114
- PROJECT_NAME: projectName,
115
- PROJECT_NAME_LOWER: projectName.toLowerCase(),
126
+ PROJECT_NAME: targetDirName,
127
+ PROJECT_NAME_LOWER: targetDirName.toLowerCase(),
116
128
  PROJECT_VERSION: '0.1.0',
117
129
  PLUSUI_CLI_VERSION: resolvedVersions.cli,
118
130
  PLUSUI_CORE_VERSION: resolvedVersions.core,
@@ -192,7 +204,7 @@ export class TemplateManager {
192
204
  async runNpmInstall(projectPath) {
193
205
  return new Promise((resolve, reject) => {
194
206
  const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';
195
-
207
+
196
208
  // Install root dependencies
197
209
  const rootProc = spawn(npm, ['install'], {
198
210
  cwd: projectPath,
@@ -1,7 +1,6 @@
1
1
  import { useState, useEffect } from 'react';
2
- import plusui, { formatFileSize } from 'plusui-native-core';
2
+ import plusui from 'plusui';
3
3
  // Generated by `plusui connect` — channel objects auto-created from name.on / name.emit usage:
4
- import { customFileDrop } from '../Connections/connections.gen';
5
4
 
6
5
  function App() {
7
6
  const [windowSize, setWindowSize] = useState({ width: 0, height: 0 });
@@ -174,7 +173,7 @@ function App() {
174
173
  <div className="filedrop-file-icon">📄</div>
175
174
  <div className="filedrop-file-info">
176
175
  <div className="filedrop-file-name">{file.name}</div>
177
- <div className="filedrop-file-meta">{formatFileSize(file.size)} • {file.type}</div>
176
+ <div className="filedrop-file-meta">{plusui.formatFileSize(file.size)} • {file.type}</div>
178
177
  </div>
179
178
  </div>
180
179
  ))}
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import ReactDOM from 'react-dom/client';
3
3
  import App from './App';
4
4
  import './styles/app.css';
5
- import 'plusui-native-core/Core/Features/FileDrop/filedrop.css';
5
+ import 'plusui/Core/Features/FileDrop/filedrop.css';
6
6
 
7
7
 
8
8
  ReactDOM.createRoot(document.getElementById('root')!).render(
@@ -1,5 +1,5 @@
1
1
  import { createSignal, onMount, onCleanup, Show, For } from 'solid-js';
2
- import plusui, { formatFileSize } from 'plusui-native-core';
2
+ import plusui from 'plusui';
3
3
  // Generated by `plusui connect` — channel objects auto-created from name.on / name.emit usage:
4
4
  import { customFileDrop } from '../Connections/connections.gen';
5
5
 
@@ -167,7 +167,7 @@ function App() {
167
167
  <div class="filedrop-file-icon">📄</div>
168
168
  <div class="filedrop-file-info">
169
169
  <div class="filedrop-file-name">{file.name}</div>
170
- <div class="filedrop-file-meta">{formatFileSize(file.size)} • {file.type}</div>
170
+ <div class="filedrop-file-meta">{plusui.formatFileSize(file.size)} • {file.type}</div>
171
171
  </div>
172
172
  </div>
173
173
  )}
@@ -1,6 +1,6 @@
1
1
  import { render } from 'solid-js/web';
2
2
  import App from './App';
3
3
  import './styles/app.css';
4
- import 'plusui-native-core/Core/Features/FileDrop/filedrop.css';
4
+ import 'plusui/Core/Features/FileDrop/filedrop.css';
5
5
 
6
6
  render(() => <App />, document.getElementById('root')!);