@makefully/adaptfully 5.0.7 → 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 +6 -0
- package/lib/node/artifacts.js +4 -3
- package/lib/node/deploy.js +2 -1
- package/lib/node/fs-name.js +29 -0
- package/lib/node/index.js +1 -0
- package/lib/node/pipeline.js +2 -1
- package/lib/node/prebuild.js +2 -1
- package/lib/node/report.js +2 -1
- package/package.json +1 -1
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
|
+
## 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
|
+
|
|
5
11
|
## 5.0.7 — 2026-10-07
|
|
6
12
|
|
|
7
13
|
### Added
|
package/lib/node/artifacts.js
CHANGED
|
@@ -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 =
|
|
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>.',
|
package/lib/node/deploy.js
CHANGED
|
@@ -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
|
|
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 {
|
package/lib/node/pipeline.js
CHANGED
|
@@ -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 =
|
|
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 = [];
|
package/lib/node/prebuild.js
CHANGED
|
@@ -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
|
/**
|
package/lib/node/report.js
CHANGED
|
@@ -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
|
|
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)) {
|