Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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<ienaga@next2d.app>",
Expand Down
7 changes: 5 additions & 2 deletions template.json
Original file line number Diff line number Diff line change
Expand Up @@ -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\""
}
}
}
5 changes: 3 additions & 2 deletions template/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ dist-ssr

src/Packages.js
src/config/Config.js
electron/resources
electron/package-lock.json

# Xbox: builder が生成する C++/CMake ホスト一式 (MicrosoftGame.config はルートで管理)
/xbox
40 changes: 40 additions & 0 deletions template/MicrosoftGame.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Microsoft GDK ゲーム構成ファイル (Xbox 書き出し用)。
capacitor.config.json と同様、各ゲーム固有の設定はこのファイルで管理する。
`npx @next2d/builder --platform xbox` 実行時に xbox/ ホストへ注入される。

ID@Xbox で発行される TitleId / StoreId / MSAAppId 等を Partner Center の値に置き換え、
ストアロゴ画像 (assets\*.png) を用意すること。
詳細: https://learn.microsoft.com/gaming/gdk/_content/gc/system/overviews/microsoft-game-config
-->
<Game configVersion="1">

<Identity Name="Next2DGame"
Publisher="CN=Next2D"
Version="1.0.0.0" />

<ExecutableList>
<Executable Name="Next2DXboxHost.exe"
Id="Game"
TargetDeviceFamily="XboxOne;Scarlett" />
</ExecutableList>

<ShellVisuals DefaultDisplayName="Example-Product-Name"
PublisherDisplayName="Next2D"
StoreLogo="assets\StoreLogo.png"
Square150x150Logo="assets\Square150x150Logo.png"
Square44x44Logo="assets\Square44x44Logo.png"
SplashScreenImage="assets\SplashScreen.png"
Description="A game built with Next2D." />

<!-- ID@Xbox 発行値に置き換える -->
<MSAAppId>00000000000000000000000000000000</MSAAppId>
<TitleId>00000000</TitleId>
<StoreId>0000000000000000</StoreId>

<VirtualMachineList>
<VirtualMachine SandboxId="XDKS.1" TitleId="00000000" />
</VirtualMachineList>

</Game>
133 changes: 120 additions & 13 deletions template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 以上

---

Expand Down Expand Up @@ -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 |

---

Expand Down Expand Up @@ -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

Expand All @@ -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` を参照してください。
Expand Down Expand Up @@ -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/<env>/`
contents (including `steam-package.json`) in `dist/steam/<OS>/build/<env>/`, 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/<env>/depot-<ID>/`; 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.
34 changes: 34 additions & 0 deletions template/electron.config.json
Original file line number Diff line number Diff line change
@@ -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
}
}
79 changes: 0 additions & 79 deletions template/electron/README.md

This file was deleted.

7 changes: 0 additions & 7 deletions template/electron/icons/README.md

This file was deleted.

Loading
Loading