@makefully/adaptfully 3.0.1 → 3.0.2

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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## 3.0.2 — 2026-06-18
6
+
7
+ ### Fixed
8
+
9
+ - Deploy script paths without a leading `/` are emitted as page-relative `script src` values (for subdirectory hosting).
10
+
5
11
  ## 3.0.1 — 2026-06-17
6
12
 
7
13
  ### Added
package/README.md CHANGED
@@ -68,7 +68,7 @@ Use plugin keys in `config.platforms.<platform>.registrations`. Custom deploy sc
68
68
  "web": {
69
69
  "registrations": {
70
70
  "auth": "google-auth",
71
- "storage": "/javascript/adaptfully-bridge.js"
71
+ "storage": "javascript/adaptfully-bridge.js"
72
72
  }
73
73
  },
74
74
  "dev": {
@@ -81,7 +81,7 @@ Use plugin keys in `config.platforms.<platform>.registrations`. Custom deploy sc
81
81
  }
82
82
  ```
83
83
 
84
- Standard plugin keys load bundled Adaptfully runtime scripts and emit an inline `adaptfully.register()` call. Path values add a `<script src="...">` tag — the script is expected to call `adaptfully.register()` itself (for example a bridge that wires `storage` and `config`).
84
+ Standard plugin keys load bundled Adaptfully runtime scripts and emit an inline `adaptfully.register()` call. Path values add a `<script src="...">` tag — the script is expected to call `adaptfully.register()` itself (for example a bridge that wires `storage` and `config`). Use a leading `/` for site-root URLs; omit it for paths relative to each HTML page (required when the game is hosted in a subdirectory).
85
85
 
86
86
  Wrapfully builders (`steam`, `win`, `mac`, `android`, etc.) map to platform keys via defaults (`win` → `steam`) or an explicit `builders` array on the platform config.
87
87
 
@@ -284,13 +284,13 @@ Standard npm fields (`name`, `version`, `description`) are used directly. Add a
284
284
  "web": {
285
285
  "registrations": {
286
286
  "auth": "google-auth",
287
- "storage": "/javascript/adaptfully-bridge.js"
287
+ "storage": "javascript/adaptfully-bridge.js"
288
288
  }
289
289
  },
290
290
  "steam": {
291
291
  "registrations": {
292
292
  "auth": "steam-auth",
293
- "storage": "/javascript/adaptfully-bridge.js"
293
+ "storage": "javascript/adaptfully-bridge.js"
294
294
  }
295
295
  }
296
296
  },
@@ -83,7 +83,7 @@ export function collectRegistrationParts(registrations) {
83
83
  }
84
84
 
85
85
  if (isDeployPath(value)) {
86
- const src = value.startsWith('/') ? value : `/${value.replace(/^\.\//, '')}`;
86
+ const src = normalizeDeployScriptSrc(value);
87
87
  deployScripts.push({ key: registerKey, src });
88
88
  continue;
89
89
  }
@@ -130,6 +130,17 @@ function isDeployPath(value) {
130
130
  return value.startsWith('/') || value.startsWith('./') || value.includes('/');
131
131
  }
132
132
 
133
+ /**
134
+ * @param {string} value Deploy-relative script path from config
135
+ * @returns {string} Value for HTML script src (leading `/` = site root; otherwise page-relative)
136
+ */
137
+ function normalizeDeployScriptSrc(value) {
138
+ if (value.startsWith('/')) {
139
+ return value;
140
+ }
141
+ return value.replace(/^\.\//, '');
142
+ }
143
+
133
144
  /**
134
145
  * @param {string} builder
135
146
  * @param {Record<string, { builders?: string[], registrations?: RegistrationMap }>} [platforms]
@@ -178,8 +189,7 @@ export function buildAdaptfullyInjection(registrations, options = {}) {
178
189
 
179
190
  for (const [registerKey, value] of Object.entries(registrations)) {
180
191
  if (isDeployPath(value)) {
181
- const src = value.startsWith('/') ? value : `/${value.replace(/^\.\//, '')}`;
182
- log(`adaptfully: registering ${registerKey} ← ${src}`);
192
+ log(`adaptfully: registering ${registerKey} ${normalizeDeployScriptSrc(value)}`);
183
193
  } else {
184
194
  log(`adaptfully: registering ${registerKey} ← ${value}`);
185
195
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makefully/adaptfully",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "Platform abstraction and Wrapfully deploy client for Makefully games",
5
5
  "type": "module",
6
6
  "main": "./lib/node/index.js",