@makefully/adaptfully 5.0.6 → 5.0.8

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,19 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## 5.0.8 — 2026-10-22
6
+
7
+ ### Fixed
8
+
9
+ - **Scoped package gameIds** — `buildGameId()` / `sanitizeFsSegment()` flatten `@scope/name` (and `\`) so Yap `gameId`, extract/prebuild folder segments, and saved zip/report names stay single path segments (e.g. `makefully-fancifully-0.1.0`).
10
+
11
+ ## 5.0.7 — 2026-10-07
12
+
13
+ ### Added
14
+
15
+ - Gitignore patterns for `assets/meta/deployments/**/s3.json` and `**/showfully.json`.
16
+ - Docs for web deploy via SFTP (atomic `cleanRemote`), AWS S3, and Showfully folder (credential shapes consumed by Wrapfully).
17
+
5
18
  ## 5.0.6 — 2026-10-07
6
19
 
7
20
  ### Changed
package/README.md CHANGED
@@ -437,11 +437,17 @@ mygame/
437
437
  │ └── sftp.json
438
438
  ├── web-prod/
439
439
  │ └── sftp.json
440
+ ├── web-s3-prod/
441
+ │ ├── manifest.json # { "type": "s3" }
442
+ │ └── s3.json
443
+ ├── web-showfully/
444
+ │ ├── manifest.json # { "type": "showfully" }
445
+ │ └── showfully.json
440
446
  └── steam/ # default deployment for the `steam` platform
441
447
  └── steam.json
442
448
  ```
443
449
 
444
- The selected deployment's folder is shipped as `meta/publish/` in the zip, so per-platform credential file names (`build.json`, `sftp.json`, `steam.json`, `apple.json`, `google.json`, `ms.json`, `android/`, `ms/`) live inside `assets/meta/deployments/<key>/`.
450
+ The selected deployment's folder is shipped as `meta/publish/` in the zip, so per-platform credential file names (`build.json`, `sftp.json`, `s3.json`, `showfully.json`, `steam.json`, `apple.json`, `google.json`, `ms.json`, `android/`, `ms/`) live inside `assets/meta/deployments/<key>/`.
445
451
 
446
452
  Icons (`icon-foreground.png`, `icon-background.png`) are required for mobile, desktop, and Steam builds. If either file is missing from `assets/meta/`, Adaptfully **warns** and ships packaged placeholder icons for that build so Wrapfully can still run.
447
453
 
@@ -718,7 +724,9 @@ Release `win` builds can be signed with `assets/meta/deployments/<deployment>/ms
718
724
 
719
725
  #### Web (`web` / `webapp`)
720
726
 
721
- `adaptfully deploy web` prebuilds and POSTs to the Wrapfully **`webapp`** builder (same conduit as Steam). Put an `sftp.json` in each web deployment folder (e.g. `assets/meta/deployments/web-prod/sftp.json`); the selected deployment is zipped as `meta/publish/sftp.json` for Wrapfully to deploy via SFTP. The inner key stays the builder name (`webapp`).
727
+ `adaptfully deploy web` prebuilds and POSTs to the Wrapfully **`webapp`** builder (same conduit as Steam). Each web deployment folder under `assets/meta/deployments/<key>/` is zipped as `meta/publish/` for Wrapfully. Set `manifest.json` `"type"` to `sftp`, `s3`, or `showfully` (or rely on the credential filename). The inner settings key stays the builder name (`webapp`).
728
+
729
+ **SFTP** — `sftp.json`:
722
730
 
723
731
  ```json
724
732
  {
@@ -736,7 +744,42 @@ Release `win` builds can be signed with `assets/meta/deployments/<deployment>/ms
736
744
  }
737
745
  ```
738
746
 
739
- See [Wrapfully README](https://github.com/Makefully-Studios/wrapfully-client) for `uploadMode`, `serviceWorker`, `metaWeb`, and `cleanRemote`.
747
+ `path` is the remote site root or a longer subfolder path. With `uploadMode: "direct"` and `cleanRemote: true`, Wrapfully uploads to `[path]-temp`, then deletes the live directory and renames temp → `path` (atomic replace). `cleanRemote` is ignored for `versioned` uploads.
748
+
749
+ **AWS S3** — `s3.json` + `manifest.json` `{ "type": "s3" }`:
750
+
751
+ ```json
752
+ {
753
+ "webapp": {
754
+ "region": "us-east-1",
755
+ "bucket": "my-games-cdn",
756
+ "prefix": "",
757
+ "uploadMode": "direct",
758
+ "cleanRemote": false,
759
+ "accessKeyId": "(iam access key)",
760
+ "secretAccessKey": "(iam secret)"
761
+ }
762
+ }
763
+ ```
764
+
765
+ `prefix: ""` deploys to the bucket root; `"games/mygame"` deploys under that key prefix. `cleanRemote: true` uses an atomic `prefix-temp` swap (refuses empty prefix unless `allowBucketRootWipe: true`).
766
+
767
+ **Showfully folder** — `showfully.json` + `manifest.json` `{ "type": "showfully" }`:
768
+
769
+ ```json
770
+ {
771
+ "webapp": {
772
+ "server": "https://make.makefullystudios.com/",
773
+ "folder": "MyGame",
774
+ "path": "",
775
+ "accessToken": "sfpat_…"
776
+ }
777
+ }
778
+ ```
779
+
780
+ `folder` is a top-level Showfully folder name. `path: ""` writes at that folder’s root; `"web"` (or nested) prefixes zip entries under a subfolder. `accessToken` is required (Wrapfully workers cannot reuse the Yap submit PAT).
781
+
782
+ See [Wrapfully README](https://github.com/Makefully-Studios/wrapfully-client) for `uploadMode`, `serviceWorker`, `metaWeb`, and deployer details.
740
783
 
741
784
  #### Windows (`win`, `win-dev`, `uwp`)
742
785
 
@@ -1,5 +1,6 @@
1
1
  import fs from 'node:fs';
2
2
  import path from 'node:path';
3
+ import {buildGameId, sanitizeFsSegment} from './fs-name.js';
3
4
 
4
5
  const
5
6
  MANIFEST_NAME = 'wrapfully-build.json',
@@ -28,7 +29,7 @@ export function buildOutputDir(pkg, outputRoot = 'output') {
28
29
  export function resolveExtractRoot(outputRoot, platformKey) {
29
30
  const root = path.resolve(outputRoot);
30
31
  if (platformKey) {
31
- return path.join(root, platformKey);
32
+ return path.join(root, sanitizeFsSegment(platformKey));
32
33
  }
33
34
  return root;
34
35
  }
@@ -95,8 +96,8 @@ export function resolveBuildArtifactDir(pkg, options = {}) {
95
96
  throw new Error(`Unable to read ${manifestPath}`);
96
97
  }
97
98
 
98
- const gameId = `${pkg.name}-${pkg.version}`;
99
- if (manifest.gameId && manifest.gameId !== gameId) {
99
+ const gameId = buildGameId(pkg.name, pkg.version);
100
+ if (manifest.gameId && sanitizeFsSegment(manifest.gameId) !== gameId) {
100
101
  throw new Error(
101
102
  `Build artifact is for "${manifest.gameId}" but package.json is ${gameId}. `
102
103
  + 'Run a fresh build or pass --artifact <path>.',
@@ -14,6 +14,7 @@ import {
14
14
  resolveEncryptPublicKey,
15
15
  } from './choreCrypto.js';
16
16
  import {extractZipFile, fileLooksLikeZip} from './unzip-file.js';
17
+ import {buildGameId} from './fs-name.js';
17
18
 
18
19
  const POLL_MS = 5000;
19
20
 
@@ -382,7 +383,7 @@ export async function send (
382
383
  } else {
383
384
  const destZip = path.join(
384
385
  extractRoot,
385
- `${pkg.name}-${pkg.version}-${stage}-${family}.zip`,
386
+ `${buildGameId(pkg.name, pkg.version)}-${stage}-${family}.zip`,
386
387
  );
387
388
 
388
389
  await pipeline(
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Make a single filesystem / URL path segment safe.
3
+ * Strips `@`, turns `/` and `\` into `-`, and removes other Windows-illegal chars
4
+ * so scoped npm names like `@makefully/fancifully` stay flat.
5
+ *
6
+ * @param {unknown} value
7
+ * @param {string} [fallback='app']
8
+ * @returns {string}
9
+ */
10
+ export function sanitizeFsSegment(value, fallback = 'app') {
11
+ const cleaned = String(value ?? '')
12
+ .replace(/@/g, '')
13
+ .replace(/[/\\]+/g, '-')
14
+ .replace(/[<>:"|?*\u0000-\u001f]/g, '-')
15
+ .replace(/-+/g, '-')
16
+ .replace(/^-+|-+$/g, '');
17
+
18
+ return cleaned || fallback;
19
+ }
20
+
21
+ /**
22
+ * Build the Adaptfully/Wrapfully gameId from package name + version.
23
+ * @param {string} name
24
+ * @param {string} version
25
+ * @returns {string}
26
+ */
27
+ export function buildGameId(name, version) {
28
+ return sanitizeFsSegment(`${name}-${version}`, 'app');
29
+ }
package/lib/node/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export { buildOutputDir, clearStaleBuildExtract, parsePlatformList, resolveBuildArtifactDir, resolveExtractRoot } from './artifacts.js';
2
+ export { buildGameId, sanitizeFsSegment } from './fs-name.js';
2
3
  export { createArchive, createDeployArchive, createReleaseArchive, createSourceArchive } from './archive.js';
3
4
  export { loadProjectConfig, resolveServerUrl } from './config.js';
4
5
  export {
@@ -19,6 +19,7 @@ import { googlePublishFromCli } from './google-publish.js';
19
19
  import { applePublishFromCli } from './apple-publish.js';
20
20
  import { androidKeystoreFromCli } from './android-keystore.js';
21
21
  import { appleSigningFromCli } from './apple-signing.js';
22
+ import { buildGameId } from './fs-name.js';
22
23
 
23
24
  /** @typedef {'prebuild' | 'build' | 'deploy' | 'release'} AdaptfullyStage */
24
25
 
@@ -99,7 +100,7 @@ export async function runAdaptfullyStage(stage, platformKey, options) {
99
100
  return { prebuiltDir, platformKey, buildSpec, extractRoot };
100
101
  }
101
102
 
102
- const gameId = `${pkg.name}-${pkg.version}`;
103
+ const gameId = buildGameId(pkg.name, pkg.version);
103
104
  const contents = JSON.stringify(pkg);
104
105
  /** @type {{ deploymentKey: string, stage: string, family: string }[]} */
105
106
  const sent = [];
@@ -6,6 +6,7 @@ import {
6
6
  } from './registrations.js';
7
7
  import { createPackagerForPlatform } from './packagers.js';
8
8
  import { copyRecursiveSync, emptyDirSync } from './fs-utils.js';
9
+ import { sanitizeFsSegment } from './fs-name.js';
9
10
 
10
11
  /** @typedef {'prebuild' | 'build' | 'deploy'} AdaptfullyStage */
11
12
 
@@ -38,7 +39,7 @@ export function resolveHtmlInjections(pkg) {
38
39
  */
39
40
  export function prebuildOutputDir(platformKey, pkg, outputRoot = 'output') {
40
41
  const outputFolder = pkg.config?.outputFolder || outputRoot;
41
- return path.resolve(outputFolder, `${platformKey}-prebuild`);
42
+ return path.resolve(outputFolder, `${sanitizeFsSegment(platformKey)}-prebuild`);
42
43
  }
43
44
 
44
45
  /**
@@ -6,6 +6,8 @@ import { stdin as input, stdout as output } from 'node:process';
6
6
  /** Patterns that should never be committed from deployment credential folders. */
7
7
  export const PUBLISH_CREDENTIAL_GITIGNORE_PATTERNS = [
8
8
  'assets/meta/deployments/**/sftp.json',
9
+ 'assets/meta/deployments/**/s3.json',
10
+ 'assets/meta/deployments/**/showfully.json',
9
11
  'assets/meta/deployments/**/steam.json',
10
12
  'assets/meta/deployments/**/build.json',
11
13
  'assets/meta/deployments/**/google.json',
@@ -1,5 +1,6 @@
1
1
  import fs from 'node:fs';
2
2
  import path from 'node:path';
3
+ import {buildGameId} from './fs-name.js';
3
4
 
4
5
  /**
5
6
  * @param {string} builder
@@ -9,7 +10,7 @@ import path from 'node:path';
9
10
  export function printBuildReport(builder, pkg, options = {}) {
10
11
  const extractRoot = path.resolve(options.extractRoot || './output');
11
12
  const statusPath = path.join(extractRoot, 'wrapfully-status.json');
12
- const legacyPath = path.join(extractRoot, `${pkg.name}-${pkg.version}-${builder}.txt`);
13
+ const legacyPath = path.join(extractRoot, `${buildGameId(pkg.name, pkg.version)}-${builder}.txt`);
13
14
 
14
15
  let status = null;
15
16
  if (fs.existsSync(statusPath)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makefully/adaptfully",
3
- "version": "5.0.6",
3
+ "version": "5.0.8",
4
4
  "description": "Platform abstraction and Wrapfully deploy client for Makefully games",
5
5
  "type": "module",
6
6
  "main": "./lib/node/index.js",