diff --git a/.npmignore b/.npmignore index a81b581..179ccb3 100644 --- a/.npmignore +++ b/.npmignore @@ -3,4 +3,11 @@ .gitignore template/ios template/android +template/xbox +template/dist template/package.json +template/package-lock.json +template/src/Packages.js +template/src/Packages.ts +template/src/config/Config.js +template/src/config/Config.ts diff --git a/package.json b/package.json index 807695a..90b4861 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@next2d/framework-template", "description": "Next2D Framework default JavaScript template.", - "version": "5.0.1", + "version": "6.0.0", "homepage": "https://next2d.app", "bugs": "https://github.com/Next2D/framework-template/issues/new", "author": "Toshiyuki Ienaga", diff --git a/template.json b/template.json index ae12728..484356c 100644 --- a/template.json +++ b/template.json @@ -2,9 +2,12 @@ "package": { "devDependencies": { "eslint": "*", - "eslint-plugin-unused-imports": "*", "@eslint/eslintrc": "*", - "@eslint/js": "*" + "@eslint/js": "*", + "globals": "*" + }, + "scripts": { + "lint": "eslint src --ignore-pattern \"src/**/*.test.js\"" } } } diff --git a/template/.gitignore b/template/.gitignore index a4504dd..a9d5887 100644 --- a/template/.gitignore +++ b/template/.gitignore @@ -25,5 +25,6 @@ dist-ssr src/Packages.js src/config/Config.js -electron/resources -electron/package-lock.json \ No newline at end of file + +# Xbox: builder が生成する C++/CMake ホスト一式 (MicrosoftGame.config はルートで管理) +/xbox diff --git a/template/MicrosoftGame.config b/template/MicrosoftGame.config new file mode 100644 index 0000000..6afc28a --- /dev/null +++ b/template/MicrosoftGame.config @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + 00000000000000000000000000000000 + 00000000 + 0000000000000000 + + + + + + diff --git a/template/README.md b/template/README.md index 5335505..c93b0b5 100644 --- a/template/README.md +++ b/template/README.md @@ -25,7 +25,7 @@ This project was bootstrapped with [Create Next2D App](https://github.com/Next2D | ツール / Tool | バージョン / Version | |--------------|---------------------| -| Node.js | 22.x 以上 / 22.x or higher | +| Node.js | 22.12 以上 / 22.12 or higher | | npm | 10.x 以上 / 10.x or higher | ### オプション / Optional @@ -36,6 +36,7 @@ For iOS/Android builds, the following are also required: - **iOS**: Xcode 14 以上、macOS - **Android**: Android Studio、JDK 21 以上 +- **Xbox (試作 / prototype)**: Windows、Visual Studio 2022、Microsoft GDK、CMake 3.26 以上 --- @@ -146,11 +147,12 @@ You can specify the environment with the `--env` option (`dev`, `stg`, `prd`, et | コマンド / Command | プラットフォーム / Platform | |-------------------|---------------------------| -| `npm run preview:windows -- --env prd` | Windows | -| `npm run preview:macos -- --env prd` | macOS | -| `npm run preview:linux -- --env prd` | Linux | -| `npm run preview:ios -- --env prd` | iOS | -| `npm run preview:android -- --env prd` | Android | +| `npm run preview:web` | Web (HTML) | +| `npm run preview:windows` | Windows | +| `npm run preview:macos` | macOS | +| `npm run preview:linux` | Linux | +| `npm run preview:ios` | iOS | +| `npm run preview:android` | Android | --- @@ -185,12 +187,29 @@ You can specify the environment with the `--env` option. | コマンド / Command | プラットフォーム / Platform | 出力先 / Output | |-------------------|---------------------------|----------------| -| `npm run build:web -- --env prd` | Web (HTML) | `dist/web/prd/` | -| `npm run build:steam:windows -- --env prd` | Windows (Steam) | `dist/steam/windows/` | -| `npm run build:steam:macos -- --env prd` | macOS (Steam) | `dist/steam/macos/` | -| `npm run build:steam:linux -- --env prd` | Linux (Steam) | `dist/steam/linux/` | -| `npm run build:ios -- --env prd` | iOS | Xcode project | -| `npm run build:android -- --env prd` | Android | Android Studio project | +| `npm run build:web` | Web (HTML) | `dist/web/prd/` | +| `npm run build:steam:windows` | Windows (Steam) | `dist/steam/windows/build/prd/` | +| `npm run build:steam:macos` | macOS (Steam) | `dist/steam/macos/build/prd/` | +| `npm run build:steam:linux` | Linux (Steam) | `dist/steam/linux/build/prd/` | +| `npm run build:steam:manifest` | Steam 共有Depot / Shared depot | `dist/steam/shared/prd/` | +| `npm run build:ios` | iOS | `ios/` (Xcode) | +| `npm run build:android` | Android | `android/` (Android Studio) | +| `npm run build:xbox` | Xbox (試作 / prototype) | `xbox/` (GDK host) | + +各スクリプトの既定環境は `prd` です。別の環境は `npm run build:web -- --env dev` のように上書きします。 + +Each script defaults to the `prd` environment. Override it like `npm run build:web -- --env dev`. + +### Steam アップロード / Steam upload + +```bash +npm run upload:steam:dry-run # ローカル検証のみ / Local validation only +npm run upload:steam # 全OSの成果物をSteamPipeへアップロード / Upload all OS packages +``` + +`electron.config.json` の `steam.appId` / `steam.depots` と、環境変数 `STEAM_USERNAME`(任意で `STEAMCMD`)が必要です。 + +Requires `steam.appId` / `steam.depots` in `electron.config.json` and the `STEAM_USERNAME` (optionally `STEAMCMD`) environment variable. ### 環境設定 / Environment Configuration @@ -213,9 +232,16 @@ src/ │ ├── animation/ # アニメーション定義 / Animation definitions │ ├── component/ │ │ ├── atom/ # 最小コンポーネント / Smallest components -│ │ └── molecule/ # 複合コンポーネント / Composite components +│ │ ├── molecule/ # 複合コンポーネント / Composite components +│ │ ├── organism/ # Moleculeの組み合わせ / Combinations of molecules +│ │ ├── page/ # ページ / Pages +│ │ └── template/ # ページテンプレート / Page templates │ └── content/ # Animation Tool 生成 / Generated content └── view/ # View & ViewModel + +capacitor.config.json # iOS / Android 設定 / iOS / Android settings +electron.config.json # Electron / Steam 設定 / Electron / Steam settings +MicrosoftGame.config # Xbox (GDK) 設定 / Xbox (GDK) settings ``` 各ディレクトリの詳細は、ディレクトリ内の `README.md` を参照してください。 @@ -275,3 +301,84 @@ MIT License - [Next2D Framework](https://github.com/Next2D/framework) - フレームワーク / Framework - [Create Next2D App](https://github.com/Next2D/create-next2d-app) - プロジェクト生成ツール / Project generator - [Next2D Animation Tool](https://tool.next2d.app/) - アニメーション作成ツール / Animation creation tool + + +## iOS / Android dependencies + +Capacitor's CLI, core and platform SDKs are managed by `@next2d/builder`. +The npm scripts invoke the builder through `npx`; neither the builder nor Capacitor +packages are added as game dependencies. Keep `capacitor.config.json`, native projects and +game-specific plugins in the game. Use `npm run open:ios` or +`npm run open:android` to sync and open the native project. +Both the template and generated apps use the published builder package through `npx`. + +## Electron / Steam configuration + +`electron.config.json` manages the app name, bundle ID, executable name, icons, +CPU architectures, window settings and Steam IDs. `create-next2d-app` initializes +`appId`, `appName`, `executableName` and `companyName` from the project name. +For example, `my-game` uses `app.example.my-game` and the app name `my-game`. +Replace the example bundle ID and company name before distribution. + +| Platform | Default architecture | Supported architectures | +|---|---|---| +| Windows | `x64` | `x64`, `arm64` | +| macOS | `universal` | `x64`, `arm64`, `universal` | +| Linux | `x64` | `x64`, `arm64` | + +32-bit Windows (`ia32`) is not supported. The `win32` in an output directory such +as `My Game-win32-x64` is Electron's Windows platform name; this is a **64-bit** build. +Use `architectures.windows` or a CLI override to select ARM64: + +```sh +npm run build:steam:windows # x64 by default +npm run build:steam:windows -- --arch arm64 # ARM64 override +``` + +Steam exports default to `prd`; append `-- --env dev` to override the environment. +macOS universal packages must be built on macOS. Preview uses the host OS and CPU. + +Platform icons are included as Next2D placeholders in `src/assets/icons/` and are +referenced by `electron.config.json`: `icon.ico` for Windows, `icon.icns` for macOS, +and `icon.png` for Linux. Replace these images for your game. Paths are relative +to the project root. Omitting an icon path uses the builder's bundled placeholder. + +`steam.appId` and `steam.depots` are `null` until you enter the IDs assigned in +Steamworks. Local packaging works without IDs. Multiple operating systems may use +the same Depot ID. The builder maps their packages to `windows/`, `macos/`, and +`linux/` in the shared depot, generating combined VDFs once every required OS's +package is available. Separate Depot IDs still produce separate upload scripts. + +When collecting exports from separate machines, keep each OS's `build//` +contents (including `steam-package.json`) in `dist/steam//build//`, then run: + +```sh +npm run build:steam:manifest +``` + +This generates shared depot manifests without rebuilding any application, on any +host OS. Shared VDFs and launch settings are in +`dist/steam/shared//depot-/`; preserve the entire `dist/steam/` tree when +moving them. Configure Steamworks launch options from `launch.json`, including the +OS-specific path prefixes for shared depots. The command fails if required packages +are missing or their metadata does not match the project. + +`macos.sign` and `macos.notarize` default to `false` for local testing. Enable both +for distribution and supply `APPLE_SIGNING_IDENTITY` / `APPLE_NOTARY_PROFILE` via +the environment. The builder never uploads or publishes to Steam automatically. + +Use a version of `@next2d/builder` that supports the generated host and shared depot +manifests. Only `electron.config.json` is needed for Electron configuration. The +builder owns the host and runtime version, generates a temporary host for each +export, then removes it. No `electron/` directory, Electron install, or Electron +lockfile is needed in the game. + +## Xbox configuration (prototype) + +`MicrosoftGame.config` holds the game-specific Microsoft GDK settings, in the same way +`capacitor.config.json` does for iOS / Android. Replace `TitleId`, `StoreId`, `MSAAppId` +and the store logo paths with the values issued by ID@Xbox / Partner Center. +`npm run build:xbox` generates the C++ / CMake host in `xbox/` (ignored by git) from the +builder's template and injects this file. On macOS / Linux only host generation and asset +packing run; building the executable requires Windows with Visual Studio 2022 and the GDK. +Xbox support in `@next2d/builder` is still a prototype. diff --git a/template/electron.config.json b/template/electron.config.json new file mode 100644 index 0000000..a8a43c0 --- /dev/null +++ b/template/electron.config.json @@ -0,0 +1,34 @@ +{ + "appId": "app.example.appId", + "appName": "Example-Product-Name", + "executableName": "example-product-name", + "companyName": "Example Company", + "icons": { + "windows": "src/assets/icons/icon.ico", + "macos": "src/assets/icons/icon.icns", + "linux": "src/assets/icons/icon.png" + }, + "architectures": { + "windows": "x64", + "macos": "universal", + "linux": "x64" + }, + "window": { + "width": 1280, + "height": 720, + "fullscreen": false + }, + "steam": { + "appId": null, + "branch": "internal", + "depots": { + "windows": null, + "macos": null, + "linux": null + } + }, + "macos": { + "sign": false, + "notarize": false + } +} diff --git a/template/electron/README.md b/template/electron/README.md deleted file mode 100644 index a438d3b..0000000 --- a/template/electron/README.md +++ /dev/null @@ -1,79 +0,0 @@ -# Electron Configuration - -Windows、macOS、Linux向けのデスクトップアプリケーションビルドに使用するElectron設定ディレクトリです。 - -Directory for Electron configuration used to build desktop applications for Windows, macOS, and Linux. - -## ディレクトリ構造 / Directory Structure - -``` -electron/ -├── icons/ # アプリケーションアイコン -├── index.js # メインプロセス -└── package.json # 依存関係 -``` - -## ファイル説明 / File Description - -### index.js - -Electronのメインプロセスを定義します。ウィンドウの作成、アプリケーションのライフサイクル管理などを行います。 - -Defines the Electron main process. Handles window creation, application lifecycle management, etc. - -### package.json - -Electron用の依存関係と設定を管理します。 - -Manages Electron-specific dependencies and configuration. - -### icons/ - -各プラットフォーム向けのアプリケーションアイコンを格納します。詳細は [icons/README.md](./icons/README.md) を参照してください。 - -Contains application icons for each platform. See [icons/README.md](./icons/README.md) for details. - -## ビルドコマンド / Build Commands - -```bash -# Windows向けビルド / Build for Windows -npm run build:steam:windows -- --env prd - -# macOS向けビルド / Build for macOS -npm run build:steam:macos -- --env prd - -# Linux向けビルド / Build for Linux -npm run build:steam:linux -- --env prd -``` - -## エミュレーター / Emulator - -開発中にデスクトップアプリとしてプレビューできます。 - -Preview as a desktop application during development. - -```bash -# Windows / macOS / Linux エミュレーター -npm run preview:windows -- --env dev -npm run preview:macos -- --env dev -npm run preview:linux -- --env dev -``` - -## カスタマイズ / Customization - -### ウィンドウ設定 / Window Settings - -`index.js` でウィンドウのサイズや設定をカスタマイズできます。 - -Customize window size and settings in `index.js`. - -### アイコン変更 / Icon Change - -`icons/` ディレクトリ内の画像を置き換えてアプリケーションアイコンを変更します。 - -Replace images in the `icons/` directory to change application icons. - -## 関連ドキュメント / Related Documentation - -- [README.md](../README.md) - プロジェクト全体の説明 -- [icons/README.md](./icons/README.md) - アイコン設定 diff --git a/template/electron/icons/README.md b/template/electron/icons/README.md deleted file mode 100644 index 9080fdc..0000000 --- a/template/electron/icons/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# App Icons - -Windows、macOSのアプリケーションで利用するアイコン画像を格納してます。 -デフォルトはNext2Dのロゴを配置しているので、アプリケーションのイメージに合わせて上書きしてください。 - -Icon images used for Windows and macOS applications are stored. -The default is the Next2D logo, which can be overridden to match the image of the application. \ No newline at end of file diff --git a/template/electron/index.js b/template/electron/index.js deleted file mode 100644 index 6917120..0000000 --- a/template/electron/index.js +++ /dev/null @@ -1,53 +0,0 @@ -process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = "1"; - -const { app, BrowserWindow } = require("electron"); - -/** - * 自動生成ファイルの読み込み - * Loading of auto-generated files - */ -const config = require("./electron.index.json"); - -app.commandLine.appendSwitch("disable-http-cache"); - -const createWindow = () => -{ - const browserWindow = new BrowserWindow({ - "fullscreen": true, - "autoHideMenuBar": false, - "webPreferences": { - "nodeIntegration": false - } - }); - - /** - * Chrome Developer Tools - */ - // browserWindow.webContents.openDevTools(); - - browserWindow.loadFile(config.path); -}; - -app.whenReady().then(createWindow); - -app.on("window-all-closed", () => -{ - /** - * windowsならアプリを終了、macならdockに滞在 - * Exit apps if windows, stay in dock if mac - */ - if (process.platform !== "darwin") { - app.quit(); - } -}); - -app.on("activate", () => -{ - /** - * アプリで起動している画面がなければアプリを起動 - * If there is no screen running on the application, start the application. - */ - if (BrowserWindow.getAllWindows().length === 0) { - createWindow(); - } -}); \ No newline at end of file diff --git a/template/electron/package.json b/template/electron/package.json deleted file mode 100644 index bffc8fe..0000000 --- a/template/electron/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "example-product-name", - "version": "0.0.1", - "description": "Your Production Description", - "main": "index.js", - "config": { - "forge": { - "packagerConfig": { - "icon": "./electron/icons/icon.icns", - "asar": true - } - } - }, - "devDependencies": { - "electron": "*" - } -} diff --git a/template/package.json b/template/package.json index af0caa0..5d46507 100644 --- a/template/package.json +++ b/template/package.json @@ -2,40 +2,43 @@ "name": "@next2d/framework-template", "version": "0.0.1", "description": "Next2D Framework JavaScript template.", + "private": true, "type": "module", "scripts": { - "start": "vite --host", - "preview:ios": "npx @next2d/builder --platform ios --preview", - "preview:android": "npx @next2d/builder --platform android --preview", - "preview:macos": "npx @next2d/builder --platform macos --preview", - "preview:windows": "npx @next2d/builder --platform windows --preview", - "preview:linux": "npx @next2d/builder --platform linux --preview", - "open:ios": "npx @next2d/builder --platform ios --open", - "open:android": "npx @next2d/builder --platform android --open", - "build:steam:windows": "npx @next2d/builder --platform steam:windows", - "build:steam:macos": "npx @next2d/builder --platform steam:macos", - "build:steam:linux": "npx @next2d/builder --platform steam:linux", - "build:web": "npx @next2d/builder --platform web", - "build:ios": "npx @next2d/builder --platform ios --build", - "build:android": "npx @next2d/builder --platform android --build", - "build": "npx @next2d/builder", - "test": "npx vitest", - "generate": "npx @next2d/view-generator" + "start": "vite --host", + "preview:web": "npx @next2d/builder --platform web --env prd --preview", + "preview:ios": "npx @next2d/builder --platform ios --env prd --preview", + "preview:android": "npx @next2d/builder --platform android --env prd --preview", + "preview:macos": "npx @next2d/builder --platform macos --env prd --preview", + "preview:windows": "npx @next2d/builder --platform windows --env prd --preview", + "preview:linux": "npx @next2d/builder --platform linux --env prd --preview", + "open:ios": "npx @next2d/builder --platform ios --env prd --open", + "open:android": "npx @next2d/builder --platform android --env prd --open", + "open:xbox": "npx @next2d/builder --platform xbox --env prd --open", + "build:web": "npx @next2d/builder --platform web --env prd", + "build:ios": "npx @next2d/builder --platform ios --env prd --build", + "build:android": "npx @next2d/builder --platform android --env prd --build", + "build:xbox": "npx @next2d/builder --platform xbox --env prd", + "build:steam:windows": "npx @next2d/builder --platform steam:windows --env prd", + "build:steam:macos": "npx @next2d/builder --platform steam:macos --env prd", + "build:steam:linux": "npx @next2d/builder --platform steam:linux --env prd", + "build:steam:manifest": "npx @next2d/builder --platform steam:macos --env prd --steam-manifest", + "upload:steam": "npx @next2d/builder --steam-upload --env prd", + "upload:steam:dry-run": "npx @next2d/builder --steam-upload --env prd --dry-run", + "lint": "eslint src --ignore-pattern \"src/**/*.test.js\"", + "test": "npx vitest", + "generate": "npx @next2d/view-generator" }, "devDependencies": { - "@capacitor/android": "^8.1.0", - "@capacitor/cli": "^8.1.0", - "@capacitor/core": "^8.1.0", - "@capacitor/ios": "^8.1.0", - "@eslint/eslintrc": "^3.3.4", + "@eslint/eslintrc": "^3.3.7", "@eslint/js": "^10.0.1", - "@next2d/vite-plugin-next2d-auto-loader": "^3.1.13", - "@vitest/web-worker": "^4.0.18", - "eslint": "^10.0.2", - "globals": "^17.4.0", - "jsdom": "^28.1.0", - "vite": "^7.3.1", - "vitest": "^4.0.18", + "@next2d/vite-plugin-next2d-auto-loader": "^3.1.21", + "@vitest/web-worker": "^5.0.5", + "eslint": "^10.14.0", + "globals": "^17.14.0", + "jsdom": "^30.1.3", + "vite": "^8.3.5", + "vitest": "^5.0.5", "vitest-webgl-canvas-mock": "^1.1.0" }, "peerDependencies": { @@ -54,6 +57,7 @@ "@next2d/text": "file:../../player/packages/text", "@next2d/texture-packer": "file:../../player/packages/texture-packer", "@next2d/ui": "file:../../player/packages/ui", - "@next2d/webgl": "file:../../player/packages/webgl" + "@next2d/webgl": "file:../../player/packages/webgl", + "@next2d/webgpu": "file:../../player/packages/webgpu" } } diff --git a/template/specs/08-project.md b/template/specs/08-project.md index 96332ea..f785253 100644 --- a/template/specs/08-project.md +++ b/template/specs/08-project.md @@ -2,7 +2,7 @@ ## 要件 -Node.js 22.x以上、npm 10.x以上。iOS: Xcode 14+。Android: Android Studio + JDK 21+。 +Node.js 22.12以上、npm 10.x以上。iOS: Xcode 14+。Android: Android Studio + JDK 21+。Xbox(試作): Windows + Visual Studio 2022 + Microsoft GDK + CMake 3.26+。 ## セットアップ @@ -17,13 +17,30 @@ npm install && npm start # → http://localhost:5173 | `npm start` | 開発サーバー | | `npm test` | テスト (Vitest) | | `npm run generate` | routing設定からView/ViewModel自動生成 | -| `npm run build:web -- --env prd` | Webビルド | -| `npm run build:steam:windows -- --env prd` | Windows (Steam) | -| `npm run build:steam:macos -- --env prd` | macOS (Steam) | -| `npm run build:steam:linux -- --env prd` | Linux (Steam) | -| `npm run build:ios -- --env prd` | iOS (Xcodeプロジェクト) | -| `npm run build:android -- --env prd` | Android (Android Studioプロジェクト) | -| `npm run preview:{platform} -- --env {env}` | エミュレーター起動 | +| `npm run lint` | ESLint(テストファイルを除く) | +| `npm run build:web` | Webビルド | +| `npm run build:steam:windows` | Windows (Steam) | +| `npm run build:steam:macos` | macOS (Steam) | +| `npm run build:steam:linux` | Linux (Steam) | +| `npm run build:steam:manifest` | 既存のSteam成果物から共有Depotの設定を生成 | +| `npm run upload:steam` | Steamへアップロード(`upload:steam:dry-run` で事前検証) | +| `npm run open:ios` | iOSプロジェクトを同期してXcodeで開く | +| `npm run open:android` | Androidプロジェクトを同期してAndroid Studioで開く | +| `npm run build:ios` | iOSを同期・ビルド(Xcodeと署名設定が必要) | +| `npm run build:android` | Androidを同期・ビルド(SDK/JDKと署名設定が必要) | +| `npm run build:xbox` | Xbox(試作)GDKホストを `xbox/` に生成・ビルド | +| `npm run open:xbox` | Xbox(試作)Visual Studioで開く(Windowsのみ) | +| `npm run preview:{platform}` | エミュレーター起動(web / windows / macos / linux / ios / android) | + +全スクリプトの既定環境は `prd`。`npm run build:web -- --env dev` のように `--env` で上書きする。 + +## iOS / Androidの依存管理 + +`@capacitor/cli`・`@capacitor/core`・`@capacitor/ios`・`@capacitor/android` はbuilderが管理する。 +builderはnpmスクリプトから `npx` で起動し、builder・Capacitorともゲームの直接依存には追加しない。 +ゲーム側は `capacitor.config.json`、既存のネイティブプロジェクト、ゲーム固有のプラグインを管理する。 +builderは `webDir` を更新してからプロジェクトを生成・同期し、既存のネイティブ設定を維持する。 +ゲームのコードから `@capacitor/core` を直接importする場合だけ、互換バージョンの直接依存も宣言する。 ## エントリーポイント (index.js) @@ -74,3 +91,33 @@ export { packages }; ``` importエイリアスはパス区切りをアンダースコアに変換。View/ViewModelはクラス名をそのまま使用。 + +## Electron / Steam + +- Electron設定はルートの `electron.config.json` に集約。ホストとElectronバージョンはbuilderが管理し、`electron/` は不要。 +- Windowsは `x64` が既定、`arm64` も対応。32bit (`ia32`) は非対応。出力名の `win32-x64` は64bit版Windowsを意味する。 +- macOSは `universal`、Linuxは `x64` が既定。CPU設定はJSONまたは `--arch` で指定する。 +- アイコンは `src/assets/icons/icon.ico` / `icon.icns` / `icon.png` を参照。仮のNext2D画像を製品用に置き換える。 +- App ID・Depot IDは未発行なら `null`。複数OSで同一Depot IDを指定可能。 +- 共有Depotは全対象OSの成果物が揃うと `dist/steam/shared//depot-/` に統合VDFを生成する。 +- 別マシンの成果物を集めた場合は `npm run build:steam:manifest` で再ビルドせず統合する。共有Depotへの配置先はOS別サブフォルダ。 + +```sh +npm run build:steam:windows -- --arch arm64 +npm run build:steam:manifest -- --env prd +``` + +### Steamアップロード + +```sh +npm run upload:steam:dry-run # ローカル検証のみ +npm run upload:steam # 全OSの成果物を1回でアップロード(STEAM_USERNAME、任意でSTEAMCMDが必要) +``` + +反映先ブランチは `electron.config.json` の `steam.branch`(既定 `internal`)。`--steam-branch` で上書きできる。 + +## Xbox(試作) + +- GDK設定はルートの `MicrosoftGame.config` で管理する。`TitleId`・`StoreId`・`MSAAppId`・ストアロゴをPartner Centerの値に置き換える。 +- `npm run build:xbox` でbuilder同梱テンプレートから `xbox/`(C++/CMakeホスト、git管理外)を生成し、設定を注入する。 +- 実行ファイルのビルドはWindows + Visual Studio 2022 + Microsoft GDK + CMake 3.26以上が必要。macOS / Linuxはホスト生成とアセット準備まで。 diff --git a/template/electron/icons/icon.icns b/template/src/assets/icons/icon.icns similarity index 100% rename from template/electron/icons/icon.icns rename to template/src/assets/icons/icon.icns diff --git a/template/src/assets/icons/icon.ico b/template/src/assets/icons/icon.ico new file mode 100644 index 0000000..3d07c9d Binary files /dev/null and b/template/src/assets/icons/icon.ico differ diff --git a/template/electron/icons/icon.png b/template/src/assets/icons/icon.png similarity index 100% rename from template/electron/icons/icon.png rename to template/src/assets/icons/icon.png diff --git a/template/src/ui/component/organism/.gitkeep b/template/src/ui/component/organism/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/template/src/ui/component/template/.gitkeep b/template/src/ui/component/template/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/template/vite.config.js b/template/vite.config.js index 4f72248..c90e8a6 100644 --- a/template/vite.config.js +++ b/template/vite.config.js @@ -9,10 +9,11 @@ export default defineConfig({ "build": { "outDir": "dist", "target": "esnext", + "chunkSizeWarningLimit": 1024, "modulePreload": { "polyfill": false }, - "rollupOptions": { + "rolldownOptions": { "output": { "entryFileNames": "assets/js/app.js" } @@ -37,12 +38,18 @@ export default defineConfig({ }, "resolve": { "alias": { - "@": path.resolve(__dirname, "src") + "@": path.resolve(import.meta.dirname, "src") } }, "test": { "globals": true, "environment": "jsdom", + "server": { + "deps": { + // 公開版の @next2d/* は拡張子なしの ESM import を含むため Vite で変換する + "inline": [/\/node_modules\/@next2d\//] + } + }, "setupFiles": [ "@vitest/web-worker", "vitest-webgl-canvas-mock"