@directivegames/genesys.sdk 3.3.4 → 3.3.6

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.
@@ -119,7 +119,6 @@ export function getProjectFolderAndFile(projectPath, logger) {
119
119
  const testProjectFile = `${folderName}${ENGINE.GAME_PROJECT_FILE_EXT}`;
120
120
  if (fs.existsSync(path.join(folder, testProjectFile))) {
121
121
  projectFile = testProjectFile;
122
- logger.log(`Using existing project file: ${projectFile}`);
123
122
  }
124
123
  // check for any existing project files in the folder, and use the latest one
125
124
  if (!projectFile) {
@@ -137,7 +136,6 @@ export function getProjectFolderAndFile(projectPath, logger) {
137
136
  }
138
137
  if (latestFile) {
139
138
  projectFile = latestFile;
140
- logger.log(`Using latest project file: ${projectFile}`);
141
139
  }
142
140
  else {
143
141
  logger.warn(`No project files found in folder: ${folder}`);
@@ -178,31 +178,31 @@ export async function newProject(parentPath, projectName, templateId, logger, ha
178
178
  const totalSteps = 5;
179
179
  // Step 1: Creating directories (0-5%)
180
180
  logger.log('Creating default scene and game code...');
181
- handler?.ui.showLoadingOverlay('Creating project 0%\nStep 1/5 Creating directories...');
181
+ handler?.ui.showLoadingOverlay('Creating project 0%\nStep 1/5 Creating directories...');
182
182
  await new Promise(resolve => setTimeout(resolve, 300));
183
- handler?.ui.showLoadingOverlay('Creating project 2%\nStep 1/5 Creating directories...');
183
+ handler?.ui.showLoadingOverlay('Creating project 2%\nStep 1/5 Creating directories...');
184
184
  await Promise.all([
185
185
  mkdirAsync(path.join(projectPath, `${ENGINE.ASSETS_FOLDER}/models`), { recursive: true }),
186
186
  mkdirAsync(path.join(projectPath, `${ENGINE.ASSETS_FOLDER}/textures`), { recursive: true }),
187
187
  mkdirAsync(path.join(projectPath, `${ENGINE.ASSETS_FOLDER}/sounds`), { recursive: true })
188
188
  ]);
189
189
  overallProgress = 5;
190
- handler?.ui.showLoadingOverlay('Creating project 5%\nStep 1/5 Directories created');
190
+ handler?.ui.showLoadingOverlay('Creating project 5%\nStep 1/5 Directories created');
191
191
  await new Promise(resolve => setTimeout(resolve, 300));
192
192
  // Step 2: Creating project files (5-10%)
193
193
  logger.log('Creating project files...');
194
- handler?.ui.showLoadingOverlay('Creating project 5%\nStep 2/5 Generating project files...');
194
+ handler?.ui.showLoadingOverlay('Creating project 5%\nStep 2/5 Generating project files...');
195
195
  await new Promise(resolve => setTimeout(resolve, 300));
196
196
  const packageJson = { ...projectFiles.packageJson }; // Create a copy to avoid mutation
197
197
  packageJson.name = projectName;
198
- handler?.ui.showLoadingOverlay('Creating project 7%\nStep 2/5 Generating project files...');
198
+ handler?.ui.showLoadingOverlay('Creating project 7%\nStep 2/5 Generating project files...');
199
199
  const [, , projectFileFullPath] = await Promise.all([
200
200
  writeFileAsync(path.join(projectPath, 'package.json'), JSON.stringify(packageJson, null, 2)),
201
201
  writeFileAsync(path.join(projectPath, `${projectName}.code-workspace`), JSON.stringify(projectFiles.codeWorkspace, null, 2)),
202
202
  createGenesysProjectFile(projectPath)
203
203
  ]);
204
204
  overallProgress = 8;
205
- handler?.ui.showLoadingOverlay('Creating project 8%\nStep 2/5 Copying template files...');
205
+ handler?.ui.showLoadingOverlay('Creating project 8%\nStep 2/5 Copying template files...');
206
206
  // Copy template files
207
207
  logger.log('Copying other project files...');
208
208
  const individualTemplatePath = path.join(templatePackagePath, template.path);
@@ -211,11 +211,11 @@ export async function newProject(parentPath, projectName, templateId, logger, ha
211
211
  copyAsync(individualTemplatePath, projectPath, { recursive: true })
212
212
  ]);
213
213
  overallProgress = 10;
214
- handler?.ui.showLoadingOverlay('Creating project 10%\nStep 2/5 Project files created');
214
+ handler?.ui.showLoadingOverlay('Creating project 10%\nStep 2/5 Project files created');
215
215
  await new Promise(resolve => setTimeout(resolve, 300));
216
216
  // Step 3: Installing dependencies (10-70%)
217
217
  logger.log('Running pnpm install...');
218
- handler?.ui.showLoadingOverlay('Creating project 10%\nStep 3/5 Installing dependencies...');
218
+ handler?.ui.showLoadingOverlay('Creating project 10%\nStep 3/5 Installing dependencies...');
219
219
  const installStartTime = Date.now();
220
220
  const estimatedInstallTime = 35; // seconds
221
221
  let installComplete = false;
@@ -228,7 +228,7 @@ export async function newProject(parentPath, projectName, templateId, logger, ha
228
228
  // Asymptotic progress: approaches 70% but never quite reaches it
229
229
  const installProgress = Math.min(0.95, elapsed / estimatedInstallTime);
230
230
  overallProgress = 10 + Math.floor(installProgress * 60);
231
- handler?.ui.showLoadingOverlay(`Creating project ${overallProgress}%\nStep 3/5 Installing dependencies...`);
231
+ handler?.ui.showLoadingOverlay(`Creating project ${overallProgress}%\nStep 3/5 Installing dependencies...`);
232
232
  }, 1000);
233
233
  await runCommandAsync('pnpm install', projectPath, logger, (progressMsg) => {
234
234
  // Detect completion - pnpm uses different output format
@@ -242,11 +242,11 @@ export async function newProject(parentPath, projectName, templateId, logger, ha
242
242
  installComplete = true;
243
243
  clearInterval(installInterval);
244
244
  overallProgress = 70;
245
- handler?.ui.showLoadingOverlay(`Creating project 70%\nStep 3/5 Installed ${packageCount} packages ✅`);
245
+ handler?.ui.showLoadingOverlay(`Creating project 70%\nStep 3/5 Installed ${packageCount} packages`);
246
246
  await new Promise(resolve => setTimeout(resolve, 500));
247
247
  // Step 4: Building project (70-90%)
248
248
  logger.log('Running pnpm build...');
249
- handler?.ui.showLoadingOverlay('Creating project 70%\nStep 4/5 Building project...');
249
+ handler?.ui.showLoadingOverlay('Creating project 70%\nStep 4/5 Building project...');
250
250
  const buildStartTime = Date.now();
251
251
  const estimatedBuildTime = 10; // seconds
252
252
  let buildComplete = false;
@@ -258,22 +258,22 @@ export async function newProject(parentPath, projectName, templateId, logger, ha
258
258
  // Asymptotic progress: approaches 90% but never quite reaches it
259
259
  const buildProgress = Math.min(0.95, elapsed / estimatedBuildTime);
260
260
  overallProgress = 70 + Math.floor(buildProgress * 20);
261
- handler?.ui.showLoadingOverlay(`Creating project ${overallProgress}%\nStep 4/5 Building project...`);
261
+ handler?.ui.showLoadingOverlay(`Creating project ${overallProgress}%\nStep 4/5 Building project...`);
262
262
  }, 1000);
263
263
  await runCommandAsync('pnpm build', projectPath, logger);
264
264
  buildComplete = true;
265
265
  clearInterval(buildInterval);
266
266
  overallProgress = 90;
267
- handler?.ui.showLoadingOverlay('Creating project 90%\nStep 4/5 Build complete');
267
+ handler?.ui.showLoadingOverlay('Creating project 90%\nStep 4/5 Build complete');
268
268
  await new Promise(resolve => setTimeout(resolve, 500));
269
269
  // Step 5: Finalizing (90-100%)
270
- handler?.ui.showLoadingOverlay('Creating project 95%\nStep 5/5 Finalizing...');
270
+ handler?.ui.showLoadingOverlay('Creating project 95%\nStep 5/5 Finalizing...');
271
271
  // open the project in the file explorer
272
272
  handler?.os.openPath(projectPath);
273
273
  await new Promise(resolve => setTimeout(resolve, 500));
274
274
  overallProgress = 100;
275
275
  logger.log('Project created successfully');
276
- handler?.ui.showLoadingOverlay('Creating project 100%\n✅ Project created successfully!');
276
+ handler?.ui.showLoadingOverlay('Creating project 100%\nProject created successfully!');
277
277
  await new Promise(resolve => setTimeout(resolve, 1000));
278
278
  return {
279
279
  success: true,
@@ -1,5 +1,5 @@
1
1
  import { app, Menu } from 'electron';
2
- import { buildProject, checkUpdates, openAppLog, showAbout, showInExplorer } from './actions.js';
2
+ import { checkUpdates, openAppLog, showAbout, showInExplorer } from './actions.js';
3
3
  export function buildAppMenu(mainWindow) {
4
4
  const isMac = process.platform === 'darwin';
5
5
  if (isMac) {
@@ -38,12 +38,6 @@ function buildMacMenu(mainWindow) {
38
38
  {
39
39
  label: 'Project',
40
40
  submenu: [
41
- {
42
- label: 'Build Project',
43
- accelerator: 'Cmd+B',
44
- click: () => buildProject(true)
45
- },
46
- { type: 'separator' },
47
41
  {
48
42
  label: 'Show in Finder',
49
43
  accelerator: 'Cmd+E',
@@ -115,12 +109,6 @@ function buildWindowsMenu(mainWindow) {
115
109
  {
116
110
  label: 'Project',
117
111
  submenu: [
118
- {
119
- label: 'Build Project',
120
- accelerator: 'Ctrl+B',
121
- click: () => buildProject(true)
122
- },
123
- { type: 'separator' },
124
112
  {
125
113
  label: 'Show in Explorer',
126
114
  accelerator: 'Ctrl+E',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@directivegames/genesys.sdk",
3
- "version": "3.3.4",
3
+ "version": "3.3.6",
4
4
  "description": "Genesys SDK - A development toolkit for game development",
5
5
  "author": "Directive Games",
6
6
  "main": "index.js",
@@ -56,6 +56,16 @@
56
56
  - **Do not** create documentation or test/example code unless specifically asked to.
57
57
  - Be **very brief** on the summary when the implementation is completed.
58
58
 
59
+ ## Engine Source Reference
60
+ - The engine source code is available in the **`.engine`** folder at the project root.
61
+ - Use the engine source as the **primary reference** when implementing game code to understand:
62
+ - Class hierarchies and inheritance patterns
63
+ - Available methods, properties, and their signatures
64
+ - Engine conventions and coding patterns
65
+ - How built-in features are implemented
66
+ - When extending engine classes or implementing similar functionality, **study the existing engine code** to ensure consistency and proper integration.
67
+ - The `.engine` folder mirrors the structure of the engine package — search here first when you need to understand how a particular system works.
68
+
59
69
  ## UI
60
70
  - Any HTML UI you create **MUST NOT** be added to the document root directly. Add them to the game UI container, which can be accessed through `world.gameContainer`.
61
71