@playcraft/cli 0.0.34 → 0.0.36
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/dist/commands/prefab.js +5 -5
- package/package.json +3 -3
package/dist/commands/prefab.js
CHANGED
|
@@ -2,7 +2,7 @@ import { inspect } from 'node:util';
|
|
|
2
2
|
import { readFileSync, writeFileSync, readdirSync, statSync, existsSync } from 'fs';
|
|
3
3
|
import { join, resolve } from 'path';
|
|
4
4
|
import JSON5 from 'json5';
|
|
5
|
-
import { THEME_SCHEMA_PATH, THEME_INDEX_PATH, THEME_DIR, DEFAULT_GAME_PATH, MANIFEST_PATH, ASSETS_JSON_PATH, LITE_CREATOR_EXTENSIONS_DIR, themeDataPath, scenePath, defaultValueFromJsonSchemaProperty, buildThemeIndexTs, parseThemeIndexImportPath, parseThemePrefabs, mergeThemeDataKey, deleteThemeDataKey, parseExtensionMetaData, parseGameConfig, buildExtensionPrefabs, updateGameConfigValue, updateGameConfigExtensions, findConfigKeyCaseInsensitive, parseConfigKey, listScenesFromManifest, listScenesWithGameConfig, resolveGameConfigPath,
|
|
5
|
+
import { THEME_SCHEMA_PATH, THEME_INDEX_PATH, THEME_DIR, DEFAULT_GAME_PATH, MANIFEST_PATH, ASSETS_JSON_PATH, LITE_CREATOR_EXTENSIONS_DIR, themeDataPath, scenePath, defaultValueFromJsonSchemaProperty, buildThemeIndexTs, parseThemeIndexImportPath, parseThemePrefabs, mergeThemeDataKey, deleteThemeDataKey, parseExtensionMetaData, parseGameConfig, buildExtensionPrefabs, updateGameConfigValue, updateGameConfigExtensions, findConfigKeyCaseInsensitive, parseConfigKey, listScenesFromManifest, listScenesWithGameConfig, resolveGameConfigPath, reorderManifestDefaultScene, validateThemeValue, validateConfigValue, describeJsonSchemaFields, describeConfigSchemaFields, getPrefabFieldDescriptors, getPrefabFieldDiffs, prefabHasSchemaDiff, } from '@playcraft/common/prefab';
|
|
6
6
|
const DEFAULT_PAGE_LIMIT = 50;
|
|
7
7
|
/** 场景在 manifest / CLI 中列出但解析不到 GameConfig 时的人读标签 */
|
|
8
8
|
const NO_SCENE_GAMECONFIG_LABEL = '(无场景级 GameConfig)';
|
|
@@ -243,16 +243,16 @@ function resolveThemeId(projectDir, opts) {
|
|
|
243
243
|
}
|
|
244
244
|
// ─── PlayCanvas / LiteCreator helpers ────────────────────────────────────────
|
|
245
245
|
/**
|
|
246
|
-
* 当前活跃场景 ID = manifest.scenes[0]
|
|
247
|
-
*
|
|
248
|
-
* 与 Remix 编辑器和后端 `setDefaultScene`(将目标场景移到首位)的 SSOT 一致。
|
|
246
|
+
* 当前活跃场景 ID = manifest.scenes[0](与 `@playcraft/common` 中 `getActiveSceneIdFromManifest` 一致)。
|
|
247
|
+
* 用 `listScenesFromManifest` 组合实现,避免依赖较新 common 包才提供的命名导出。
|
|
249
248
|
*/
|
|
250
249
|
function getMainSceneId(projectDir) {
|
|
251
250
|
if (!fileExists(projectDir, MANIFEST_PATH))
|
|
252
251
|
return null;
|
|
253
252
|
try {
|
|
254
253
|
const manifestJson = JSON.parse(readLocalFile(projectDir, MANIFEST_PATH));
|
|
255
|
-
|
|
254
|
+
const scenes = listScenesFromManifest(manifestJson);
|
|
255
|
+
return scenes.length > 0 ? scenes[0].id : null;
|
|
256
256
|
}
|
|
257
257
|
catch {
|
|
258
258
|
return null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@playcraft/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.36",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"release": "node scripts/release.js"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@playcraft/build": "^0.0.
|
|
27
|
-
"@playcraft/common": "^0.0.
|
|
26
|
+
"@playcraft/build": "^0.0.36",
|
|
27
|
+
"@playcraft/common": "^0.0.24",
|
|
28
28
|
"chokidar": "^4.0.3",
|
|
29
29
|
"commander": "^13.1.0",
|
|
30
30
|
"cors": "^2.8.6",
|