Skip to content

Commit 7edab87

Browse files
committed
chore(pkg): prep @bloomengine/engine for npm publish
Rename from bloom to @bloomengine/engine (Perry FFI module ref updated to match) and add a files: allowlist so the tarball ships just TS sources, Rust crates, shaders/assets, the bloom_jolt shim, and JoltPhysics/Jolt — vendored at publish time rather than fetched at install so installs stay self-contained and reproducible. .npmignore is belt-and-suspenders against target/, pkg/, build/, and the multi-MB Jolt extras (Samples/Docs/UnitTests/Assets/…). scripts/prepack.sh refuses to publish if the Jolt submodule isn't initialised — deliberately not auto-initing so we don't silently publish stale refs. Root MIT LICENSE added so the legal terms travel with the package.
1 parent eadf596 commit 7edab87

4 files changed

Lines changed: 181 additions & 2 deletions

File tree

.npmignore

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# The `files:` field in package.json is the source of truth for what
2+
# ships. This .npmignore is belt-and-suspenders — it strips artifacts
3+
# from globbed directories that `files:` pulls in, so we never ship
4+
# build output, IDE state, or local caches even by accident.
5+
6+
# Rust build output
7+
target/
8+
**/target/
9+
*.rlib
10+
*.rmeta
11+
12+
# wasm-pack output (built per consumer; not part of the package)
13+
native/web/pkg/
14+
15+
# Native build dirs
16+
native/third_party/bloom_jolt/build/
17+
native/third_party/JoltPhysics/Build/
18+
19+
# Jolt submodule extras we don't need at consumer build time.
20+
# We only ship JoltPhysics/Jolt/ (the actual sources our cmake builds
21+
# against) plus LICENSE + README. Everything else is samples, viewer,
22+
# docs, assets, tests — multi-MB and irrelevant for embedding.
23+
native/third_party/JoltPhysics/.git
24+
native/third_party/JoltPhysics/.github/
25+
native/third_party/JoltPhysics/Assets/
26+
native/third_party/JoltPhysics/Build/
27+
native/third_party/JoltPhysics/Docs/
28+
native/third_party/JoltPhysics/HelloWorld/
29+
native/third_party/JoltPhysics/JoltViewer/
30+
native/third_party/JoltPhysics/PerformanceTest/
31+
native/third_party/JoltPhysics/Samples/
32+
native/third_party/JoltPhysics/TestFramework/
33+
native/third_party/JoltPhysics/UnitTests/
34+
native/third_party/JoltPhysics/Doxyfile
35+
native/third_party/JoltPhysics/run_doxygen.bat
36+
native/third_party/JoltPhysics/sonar-project.properties
37+
native/third_party/JoltPhysics/ContributorAgreement.md
38+
39+
# Perry build artifacts
40+
*.ts.o
41+
*_ts.o
42+
.perry-cache/
43+
dist/
44+
45+
# OS / editor junk
46+
.DS_Store
47+
.vscode/
48+
.idea/
49+
*.swp
50+
51+
# Local-only state never meant for the registry
52+
.claude/
53+
node_modules/
54+
package-lock.json

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Bloom Engine
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

package.json

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "bloom",
2+
"name": "@bloomengine/engine",
33
"version": "0.3.1",
44
"description": "Bloom Engine: native TypeScript game engine compiled by Perry",
55
"main": "src/index.ts",
@@ -18,10 +18,83 @@
1818
"./physics": "./src/physics/index.ts",
1919
"./world": "./src/world/index.ts"
2020
},
21+
"files": [
22+
"src/",
23+
"perry.config.ts",
24+
"native/shared/Cargo.toml",
25+
"native/shared/Cargo.lock",
26+
"native/shared/build.rs",
27+
"native/shared/src/**",
28+
"native/shared/shaders/**",
29+
"native/shared/assets/**",
30+
"native/macos/Cargo.toml",
31+
"native/macos/Cargo.lock",
32+
"native/macos/src/**",
33+
"native/ios/Cargo.toml",
34+
"native/ios/Cargo.lock",
35+
"native/ios/src/**",
36+
"native/tvos/Cargo.toml",
37+
"native/tvos/Cargo.lock",
38+
"native/tvos/src/**",
39+
"native/watchos/Cargo.toml",
40+
"native/watchos/Cargo.lock",
41+
"native/watchos/src/**",
42+
"native/watchos/shaders/**",
43+
"native/windows/Cargo.toml",
44+
"native/windows/Cargo.lock",
45+
"native/windows/src/**",
46+
"native/linux/Cargo.toml",
47+
"native/linux/Cargo.lock",
48+
"native/linux/src/**",
49+
"native/android/Cargo.toml",
50+
"native/android/Cargo.lock",
51+
"native/android/src/**",
52+
"native/web/Cargo.toml",
53+
"native/web/Cargo.lock",
54+
"native/web/src/**",
55+
"native/web/build.sh",
56+
"native/web/index.html",
57+
"native/web/bloom_glue.js",
58+
"native/web/jolt_bridge.js",
59+
"native/third_party/bloom_jolt/CMakeLists.txt",
60+
"native/third_party/bloom_jolt/include/**",
61+
"native/third_party/bloom_jolt/src/**",
62+
"native/third_party/JoltPhysics/Jolt/**",
63+
"native/third_party/JoltPhysics/LICENSE",
64+
"native/third_party/JoltPhysics/README.md"
65+
],
66+
"scripts": {
67+
"prepack": "scripts/prepack.sh"
68+
},
69+
"keywords": [
70+
"bloom",
71+
"game-engine",
72+
"perry",
73+
"typescript",
74+
"native",
75+
"wgpu",
76+
"metal",
77+
"directx",
78+
"vulkan",
79+
"webgpu",
80+
"jolt",
81+
"physics"
82+
],
2183
"license": "MIT",
84+
"repository": {
85+
"type": "git",
86+
"url": "git+https://github.com/bloomengine/engine.git"
87+
},
88+
"bugs": {
89+
"url": "https://github.com/bloomengine/engine/issues"
90+
},
91+
"homepage": "https://github.com/bloomengine/engine#readme",
92+
"publishConfig": {
93+
"access": "public"
94+
},
2295
"perry": {
2396
"nativeLibrary": {
24-
"module": "bloom",
97+
"module": "@bloomengine/engine",
2598
"functions": [
2699
{ "name": "bloom_init_window", "params": ["f64", "f64", "i64", "f64"], "returns": "void" },
27100
{ "name": "bloom_close_window", "params": [], "returns": "void" },

scripts/prepack.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
# Runs immediately before `npm pack` / `npm publish` assembles the
3+
# tarball. Its job is to verify the working tree contains everything
4+
# the published package needs — most importantly, the JoltPhysics
5+
# submodule materialised on disk, since the tarball vendors its
6+
# sources rather than relying on a postinstall `git clone`.
7+
#
8+
# We deliberately do NOT auto-init the submodule here: doing so would
9+
# silently publish whatever ref the submodule happens to point at,
10+
# even if it's stale or uncommitted. A loud failure forces a
11+
# deliberate `git submodule update --init` before publishing.
12+
13+
set -euo pipefail
14+
15+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
16+
JOLT_DIR="$ROOT/native/third_party/JoltPhysics"
17+
JOLT_SRC="$JOLT_DIR/Jolt"
18+
19+
if [ ! -d "$JOLT_SRC" ] || [ -z "$(ls -A "$JOLT_SRC" 2>/dev/null)" ]; then
20+
echo "prepack: JoltPhysics submodule is not initialised." >&2
21+
echo " Expected sources at: $JOLT_SRC" >&2
22+
echo " Run: git submodule update --init --recursive" >&2
23+
exit 1
24+
fi
25+
26+
if [ ! -f "$JOLT_DIR/LICENSE" ]; then
27+
echo "prepack: JoltPhysics/LICENSE missing — refusing to publish without upstream license." >&2
28+
exit 1
29+
fi
30+
31+
echo "prepack: JoltPhysics sources present ($(du -sh "$JOLT_SRC" | cut -f1)). OK."

0 commit comments

Comments
 (0)