@makefully/adaptfully 3.8.0 → 3.8.1

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.8.1 — 2026-07-14
6
+
7
+ ### Fixed
8
+
9
+ - **Extract mode** clears stale `output/artifacts/`, `wrapfully-build.json`, and `wrapfully-status.json` before unpacking a Wrapfully response so nested `artifacts/artifacts` leftovers cannot accumulate across runs.
10
+
5
11
  ## 3.8.0 — 2026-07-10
6
12
 
7
13
  ### Changed
@@ -2,6 +2,7 @@ import fs from 'node:fs';
2
2
  import path from 'node:path';
3
3
 
4
4
  const MANIFEST_NAME = 'wrapfully-build.json';
5
+ const STATUS_NAME = 'wrapfully-status.json';
5
6
 
6
7
  /**
7
8
  * Directory where build responses are extracted (contains wrapfully-build.json).
@@ -14,6 +15,25 @@ export function buildOutputDir(pkg, outputRoot = 'output') {
14
15
  return path.resolve(outputFolder);
15
16
  }
16
17
 
18
+ /**
19
+ * Remove prior Wrapfully extract artifacts so zip responses do not stack
20
+ * nested `artifacts/` directories across runs.
21
+ *
22
+ * @param {string} [outputRoot='output']
23
+ */
24
+ export function clearStaleBuildExtract(outputRoot = 'output') {
25
+ const root = path.resolve(outputRoot);
26
+ const stalePaths = [
27
+ path.join(root, 'artifacts'),
28
+ path.join(root, MANIFEST_NAME),
29
+ path.join(root, STATUS_NAME),
30
+ ];
31
+
32
+ for (const stalePath of stalePaths) {
33
+ fs.rmSync(stalePath, { recursive: true, force: true });
34
+ }
35
+ }
36
+
17
37
  /**
18
38
  * Resolve the artifact directory from a prior `adaptfully build` (or compatible zip extract).
19
39
  *
@@ -4,6 +4,7 @@ import path from 'node:path';
4
4
  import { pipeline } from 'node:stream/promises';
5
5
  import unzipper from 'unzip-stream';
6
6
  import { createDeployArchive, createReleaseArchive, createSourceArchive } from './archive.js';
7
+ import { clearStaleBuildExtract } from './artifacts.js';
7
8
  import { listHtmlFilesRecursive } from './fs-utils.js';
8
9
  import { printBuildReport } from './report.js';
9
10
 
@@ -47,9 +48,15 @@ function resolveWrapfullyUrl(server, stage, family, gameId, platformKey, deploym
47
48
  export async function send(gameId, contents, server, stage, family, deployFolder, pkg, mode = 'extract', options = {}) {
48
49
  const log = options.log ?? console.log;
49
50
  const platformKey = options.platformKey ?? family;
51
+ const outputRoot = pkg.config?.outputFolder || 'output';
52
+
53
+ if (mode === 'extract') {
54
+ clearStaleBuildExtract(outputRoot);
55
+ }
56
+
50
57
  const destination = mode === 'extract'
51
- ? unzipper.Extract({ path: './output/', concurrency: 1 })
52
- : fs.createWriteStream(`./output/${pkg.name}-${pkg.version}-${stage}-${family}.zip`);
58
+ ? unzipper.Extract({ path: `${outputRoot}/`, concurrency: 1 })
59
+ : fs.createWriteStream(`${outputRoot}/${pkg.name}-${pkg.version}-${stage}-${family}.zip`);
53
60
 
54
61
  let archiveStream;
55
62
 
package/lib/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { buildOutputDir, resolveBuildArtifactDir } from './artifacts.js';
1
+ export { buildOutputDir, clearStaleBuildExtract, resolveBuildArtifactDir } from './artifacts.js';
2
2
  export { createArchive, createDeployArchive, createReleaseArchive, createSourceArchive } from './archive.js';
3
3
  export { loadProjectConfig, resolveServerUrl } from './config.js';
4
4
  export { send } from './deploy.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makefully/adaptfully",
3
- "version": "3.8.0",
3
+ "version": "3.8.1",
4
4
  "description": "Platform abstraction and Wrapfully deploy client for Makefully games",
5
5
  "type": "module",
6
6
  "main": "./lib/node/index.js",