@forgeax/engine-pack 0.1.7 → 0.1.19
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/dist/.tsbuildinfo +1 -1
- package/dist/build.d.ts +1 -1
- package/dist/build.d.ts.map +1 -1
- package/dist/build.mjs +24 -10
- package/dist/build.mjs.map +1 -1
- package/dist/catalog-builder.d.ts +12 -0
- package/dist/catalog-builder.d.ts.map +1 -1
- package/dist/cli-asset.mjs +1 -1
- package/dist/cli-asset.mjs.map +1 -1
- package/dist/scanner.mjs +1 -1
- package/dist/scanner.mjs.map +1 -1
- package/dist/scriptable-pack-node.d.ts.map +1 -1
- package/dist/scriptable-pack-node.mjs +1 -1
- package/dist/scriptable-pack-node.mjs.map +1 -1
- package/package.json +3 -3
- package/src/__tests__/material-cook-dependencies.unit.test.ts +44 -0
- package/src/build.ts +1 -0
- package/src/catalog-builder.ts +42 -5
- package/src/scriptable-pack-node.ts +4 -1
package/dist/build.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ok, err, catalogOperationsFor, authoringCapabilityForAssetKind, PACK_ERROR_HINTS, MATERIAL_TEXTURE_SLOTS, projectCookProductEvidence, projectAssetEvidence, validateSourceOverrideMap, catalogEntryDigest, AssetError, ImportError } from '@forgeax/engine-types';
|
|
2
|
-
import { join, dirname, resolve,
|
|
2
|
+
import { join, dirname, resolve, isAbsolute, posix, relative, basename, extname } from 'path';
|
|
3
3
|
import { uuidv7obj } from 'uuidv7';
|
|
4
4
|
import { readFileSync, existsSync } from 'fs';
|
|
5
5
|
import { createHash } from 'crypto';
|
|
@@ -8552,7 +8552,7 @@ function buildTimeoutFailure(sourcePath, timeoutMs) {
|
|
|
8552
8552
|
};
|
|
8553
8553
|
}
|
|
8554
8554
|
async function loadScriptablePack(sourcePath, options = {}) {
|
|
8555
|
-
const timeoutMs = options.timeoutMs ??
|
|
8555
|
+
const timeoutMs = options.timeoutMs ?? 15e3;
|
|
8556
8556
|
const buildTimeoutMs = options.buildTimeoutMs ?? 5e3;
|
|
8557
8557
|
const executor = options.executor ?? new WorkerScriptablePackExecutor();
|
|
8558
8558
|
let disposeReason;
|
|
@@ -9047,6 +9047,11 @@ async function scanInventory(roots, opts = {}) {
|
|
|
9047
9047
|
function sourcePathFor(cwd, path) {
|
|
9048
9048
|
return relative(cwd, path).replace(/\\/g, "/");
|
|
9049
9049
|
}
|
|
9050
|
+
function catalogSourcePathFor(cwd, path, sourceIdentityFor) {
|
|
9051
|
+
const projected = sourceIdentityFor?.(path);
|
|
9052
|
+
const catalogPath = projected === void 0 || isAbsolute(projected) ? sourcePathFor(cwd, path) : projected;
|
|
9053
|
+
return catalogPath.replaceAll("\\", "/").replace(/^\.\//, "");
|
|
9054
|
+
}
|
|
9050
9055
|
function metaPathForGuid(declarations, guid) {
|
|
9051
9056
|
const lower = guid.toLowerCase();
|
|
9052
9057
|
for (const [path, declaration] of declarations) {
|
|
@@ -9065,7 +9070,7 @@ function unsupportedPolicyError(path, importer, policy) {
|
|
|
9065
9070
|
subjects: [path]
|
|
9066
9071
|
};
|
|
9067
9072
|
}
|
|
9068
|
-
function projectMeta(rawPath, cwd, base, assetPaths, importerPolicy, sourceDeclaration) {
|
|
9073
|
+
function projectMeta(rawPath, cwd, base, assetPaths, importerPolicy, sourceDeclaration, sourceIdentityFor) {
|
|
9069
9074
|
const meta = sourceDeclaration.value;
|
|
9070
9075
|
const policy = importerPolicy(meta.importer);
|
|
9071
9076
|
if (policy.disposition !== "publish") {
|
|
@@ -9082,7 +9087,7 @@ function projectMeta(rawPath, cwd, base, assetPaths, importerPolicy, sourceDecla
|
|
|
9082
9087
|
}
|
|
9083
9088
|
};
|
|
9084
9089
|
}
|
|
9085
|
-
const sourcePath =
|
|
9090
|
+
const sourcePath = catalogSourcePathFor(cwd, resolved.value, sourceIdentityFor);
|
|
9086
9091
|
const packageUrl2 = `${base}/__forgeax-ddc/${meta.subAssets[0]?.guid?.toLowerCase() ?? "pack"}.pack.json`;
|
|
9087
9092
|
const declaration = {
|
|
9088
9093
|
importer: meta.importer,
|
|
@@ -9124,14 +9129,14 @@ function projectMeta(rawPath, cwd, base, assetPaths, importerPolicy, sourceDecla
|
|
|
9124
9129
|
)
|
|
9125
9130
|
};
|
|
9126
9131
|
}
|
|
9127
|
-
function projectSource(path, cwd, base, assetPaths, importerPolicy, visibility, sourceDeclaration, declarations) {
|
|
9132
|
+
function projectSource(path, cwd, base, assetPaths, importerPolicy, visibility, sourceDeclaration, declarations, sourceIdentityFor) {
|
|
9128
9133
|
if (sourceDeclaration.format === "pack.ts") {
|
|
9129
9134
|
const meta = { ...sourceDeclaration.meta, source: sourcePathFor(cwd, path) };
|
|
9130
9135
|
const anchorGuid = meta.subAssets.map((asset) => asset.guid.toLowerCase()).sort()[0];
|
|
9131
9136
|
return anchorGuid === void 0 ? { entries: [] } : {
|
|
9132
9137
|
entries: projectExternalCatalogEntries(
|
|
9133
9138
|
meta,
|
|
9134
|
-
|
|
9139
|
+
catalogSourcePathFor(cwd, path, sourceIdentityFor),
|
|
9135
9140
|
`${base}/__forgeax-ddc/${anchorGuid}.pack.json`,
|
|
9136
9141
|
meta.subAssets,
|
|
9137
9142
|
(output) => deriveAssetName(path, meta.subAssets.length, output.name)
|
|
@@ -9147,12 +9152,20 @@ function projectSource(path, cwd, base, assetPaths, importerPolicy, visibility,
|
|
|
9147
9152
|
}) === false) {
|
|
9148
9153
|
return { entries: [] };
|
|
9149
9154
|
}
|
|
9150
|
-
const projected = projectMeta(
|
|
9155
|
+
const projected = projectMeta(
|
|
9156
|
+
path,
|
|
9157
|
+
cwd,
|
|
9158
|
+
base,
|
|
9159
|
+
assetPaths,
|
|
9160
|
+
importerPolicy,
|
|
9161
|
+
sourceDeclaration,
|
|
9162
|
+
sourceIdentityFor
|
|
9163
|
+
);
|
|
9151
9164
|
if (projected.declaration !== void 0) declarations.set(path, projected.declaration);
|
|
9152
9165
|
return projected;
|
|
9153
9166
|
}
|
|
9154
9167
|
const parsed = sourceDeclaration.value;
|
|
9155
|
-
const sourcePath =
|
|
9168
|
+
const sourcePath = catalogSourcePathFor(cwd, path, sourceIdentityFor);
|
|
9156
9169
|
const provenance = parsed.provenance ?? { provider: "pack", version: parsed.schemaVersion };
|
|
9157
9170
|
return {
|
|
9158
9171
|
entries: projectPackageCatalog(
|
|
@@ -9218,7 +9231,8 @@ async function buildCatalogProjection(roots, options) {
|
|
|
9218
9231
|
options.importerPolicy,
|
|
9219
9232
|
options.visibility,
|
|
9220
9233
|
sourceDeclaration,
|
|
9221
|
-
declarations
|
|
9234
|
+
declarations,
|
|
9235
|
+
options.sourceIdentityFor
|
|
9222
9236
|
);
|
|
9223
9237
|
entries.push(...projected.entries);
|
|
9224
9238
|
if (projected.error !== void 0) errors.push(projected.error);
|
|
@@ -10198,6 +10212,6 @@ function createRuntimePackPublication(input) {
|
|
|
10198
10212
|
};
|
|
10199
10213
|
}
|
|
10200
10214
|
|
|
10201
|
-
export { MESH_BIN_DIGEST_BYTES, MESH_BIN_HEADER_V4_BYTES, MESH_BIN_PROJECTION_VERSION, MESH_BIN_VERSION, SCRIPTABLE_PACK_ASSET_KINDS, SCRIPTABLE_PACK_CAPABILITY_MANIFEST, STANDARD_SCRIPTABLE_PACK_SCAN_OPTIONS, buildCatalogProjection, buildOfflineAssetEvidence, calculateCatalogDelta, calculateTopologyDiff, catalogProjectionFor, collectMaterialCookRefs, createMaterialArtifactDigest, createRuntimePackPublication, currentProjectionFor, decodeMeshBinHeader, diffTopology, finalizePackageProduct, finalizePackageTransportSource, findReservedAssetKindConflict, isScriptablePackAssetKind, loadAssetConfig, metaPathForGuid, packageTransportRevision, packageVerification, parsePackV2, projectCookedMaterialRecord, projectCookedPackageEntry, projectExternalCatalogEntries, projectPackageCatalog, projectRuntimeCatalogRow, projectScriptablePackMeta, projectScriptablePackSceneComponents, resolveAssetSource, scanInventory, serializeCookedMaterialRecord, serializeMaterialCookReceipt, upgradeLegacyAuthoredPack, validateArtifactPath, validateCookedMaterialRecord, validateMaterialCookReceipt, validateMeta, validatePack, validatePackV2, validateProducerContract, validateProducerOutputs, validateScriptablePackDefinition, writeMeshBinHeader };
|
|
10215
|
+
export { MESH_BIN_DIGEST_BYTES, MESH_BIN_HEADER_V4_BYTES, MESH_BIN_PROJECTION_VERSION, MESH_BIN_VERSION, SCRIPTABLE_PACK_ASSET_KINDS, SCRIPTABLE_PACK_CAPABILITY_MANIFEST, STANDARD_SCRIPTABLE_PACK_SCAN_OPTIONS, buildCatalogProjection, buildOfflineAssetEvidence, calculateCatalogDelta, calculateTopologyDiff, catalogProjectionFor, catalogSourcePathFor, collectMaterialCookRefs, createMaterialArtifactDigest, createRuntimePackPublication, currentProjectionFor, decodeMeshBinHeader, diffTopology, finalizePackageProduct, finalizePackageTransportSource, findReservedAssetKindConflict, isScriptablePackAssetKind, loadAssetConfig, metaPathForGuid, packageTransportRevision, packageVerification, parsePackV2, projectCookedMaterialRecord, projectCookedPackageEntry, projectExternalCatalogEntries, projectPackageCatalog, projectRuntimeCatalogRow, projectScriptablePackMeta, projectScriptablePackSceneComponents, resolveAssetSource, scanInventory, serializeCookedMaterialRecord, serializeMaterialCookReceipt, upgradeLegacyAuthoredPack, validateArtifactPath, validateCookedMaterialRecord, validateMaterialCookReceipt, validateMeta, validatePack, validatePackV2, validateProducerContract, validateProducerOutputs, validateScriptablePackDefinition, writeMeshBinHeader };
|
|
10202
10216
|
//# sourceMappingURL=build.mjs.map
|
|
10203
10217
|
//# sourceMappingURL=build.mjs.map
|