@playcraft/build 0.2.19-test-a → 0.2.21
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/base-builder.js +2 -42
- package/dist/engines/engine-detector.js +0 -4
- package/dist/engines/generic-adapter.js +19 -14
- package/dist/engines/playable-scripts-adapter.js +5 -2
- package/dist/index.d.ts +6 -19
- package/dist/index.js +3 -11
- package/dist/platforms/adikteev.js +0 -1
- package/dist/platforms/applovin.js +0 -1
- package/dist/platforms/base.js +6 -33
- package/dist/platforms/bigo.js +0 -1
- package/dist/platforms/facebook.js +0 -1
- package/dist/platforms/google.js +0 -1
- package/dist/platforms/inmobi.js +0 -1
- package/dist/platforms/ironsource.js +0 -1
- package/dist/platforms/liftoff.js +0 -1
- package/dist/platforms/mintegral.js +0 -1
- package/dist/platforms/moloco.js +0 -1
- package/dist/platforms/playcraft.js +0 -1
- package/dist/platforms/remerge.js +0 -1
- package/dist/platforms/snapchat.js +0 -1
- package/dist/platforms/tiktok.js +0 -1
- package/dist/platforms/unity.js +0 -1
- package/dist/redirect-artifact.d.ts +30 -0
- package/dist/redirect-artifact.js +83 -0
- package/dist/types.d.ts +2 -9
- package/dist/validation/html-validator.d.ts +0 -5
- package/dist/validation/html-validator.js +17 -19
- package/dist/validation/index.d.ts +0 -5
- package/dist/validation/index.js +0 -5
- package/dist/validation/package-validator.d.ts +0 -2
- package/dist/validation/package-validator.js +64 -25
- package/dist/validation/profiles.d.ts +1 -13
- package/dist/validation/profiles.js +0 -27
- package/dist/validation/source-scanner.d.ts +0 -11
- package/dist/validation/source-scanner.js +2 -32
- package/dist/validation/types.d.ts +2 -201
- package/dist/validation/types.js +1 -1
- package/dist/validation/validation-runner.d.ts +2 -22
- package/dist/validation/validation-runner.js +3 -64
- package/dist/validation/zip-reader.d.ts +0 -7
- package/dist/validation/zip-reader.js +26 -159
- package/dist/vite/config-builder-generic.d.ts +1 -3
- package/dist/vite/config-builder-generic.js +7 -9
- package/dist/vite/config-builder.js +1 -1
- package/dist/vite/plugin-platform.js +30 -16
- package/dist/vite/plugin-source-builder.d.ts +14 -2
- package/dist/vite/plugin-source-builder.js +997 -61
- package/dist/vite-builder.d.ts +5 -4
- package/dist/vite-builder.js +34 -33
- package/package.json +4 -30
- package/templates/patches/one-page-mraid-resize-canvas.js +2 -0
- package/templates/patches/playcraft-redirect-policy.js +17 -1
- package/dist/audio-source-files.d.ts +0 -5
- package/dist/audio-source-files.js +0 -135
- package/dist/delivery/agent-build-runner.d.ts +0 -44
- package/dist/delivery/agent-build-runner.js +0 -365
- package/dist/delivery/agent-build-source.d.ts +0 -8
- package/dist/delivery/agent-build-source.js +0 -25
- package/dist/delivery/artifact-descriptor.d.ts +0 -31
- package/dist/delivery/artifact-descriptor.js +0 -237
- package/dist/delivery/artifact-package.d.ts +0 -43
- package/dist/delivery/artifact-package.js +0 -283
- package/dist/delivery/build-plan.d.ts +0 -4
- package/dist/delivery/build-plan.js +0 -189
- package/dist/delivery/build-plan.types.d.ts +0 -51
- package/dist/delivery/build-plan.types.js +0 -1
- package/dist/delivery/command-isolation.d.ts +0 -21
- package/dist/delivery/command-isolation.js +0 -327
- package/dist/delivery/commands.d.ts +0 -5
- package/dist/delivery/commands.js +0 -146
- package/dist/delivery/files.d.ts +0 -9
- package/dist/delivery/files.js +0 -144
- package/dist/delivery/git-source-fingerprint.d.ts +0 -2
- package/dist/delivery/git-source-fingerprint.js +0 -58
- package/dist/delivery/isolated-source.d.ts +0 -5
- package/dist/delivery/isolated-source.js +0 -148
- package/dist/delivery/output-publication.d.ts +0 -21
- package/dist/delivery/output-publication.js +0 -444
- package/dist/delivery/project-delivery.d.ts +0 -6
- package/dist/delivery/project-delivery.js +0 -287
- package/dist/delivery/recipe-build-plan.d.ts +0 -4
- package/dist/delivery/recipe-build-plan.js +0 -53
- package/dist/delivery/recipe.d.ts +0 -20
- package/dist/delivery/recipe.js +0 -211
- package/dist/delivery/safe-path.d.ts +0 -2
- package/dist/delivery/safe-path.js +0 -18
- package/dist/delivery/types.d.ts +0 -81
- package/dist/delivery/types.js +0 -1
- package/dist/production-animation-presence.d.ts +0 -2
- package/dist/production-animation-presence.js +0 -146
- package/dist/production-inputs.d.ts +0 -30
- package/dist/production-inputs.js +0 -262
- package/dist/production-source-paths.d.ts +0 -5
- package/dist/production-source-paths.js +0 -27
- package/dist/validation/artifact-qa.d.ts +0 -36
- package/dist/validation/artifact-qa.js +0 -263
- package/dist/validation/artifact-rules.d.ts +0 -39
- package/dist/validation/artifact-rules.js +0 -451
- package/dist/validation/artifact.d.ts +0 -14
- package/dist/validation/artifact.js +0 -188
- package/dist/validation/playwright-driver.d.ts +0 -37
- package/dist/validation/playwright-driver.js +0 -302
- package/dist/validation/runtime-cover.d.ts +0 -32
- package/dist/validation/runtime-cover.js +0 -120
- package/dist/validation/runtime-load.d.ts +0 -141
- package/dist/validation/runtime-load.js +0 -812
- package/dist/vite/source-builder-asset-paths.d.ts +0 -25
- package/dist/vite/source-builder-asset-paths.js +0 -154
- package/dist/vite/source-builder-esm.d.ts +0 -7
- package/dist/vite/source-builder-esm.js +0 -877
- package/dist/vite/source-builder-types.d.ts +0 -14
- package/dist/vite/source-builder-types.js +0 -1
- package/dist/vite/workspace.d.ts +0 -6
- package/dist/vite/workspace.js +0 -41
- package/dist/workspace-css-imports.d.ts +0 -2
- package/dist/workspace-css-imports.js +0 -139
- package/dist/workspace-model-source.d.ts +0 -14
- package/dist/workspace-model-source.js +0 -184
- package/dist/workspace-public-imports.d.ts +0 -11
- package/dist/workspace-public-imports.js +0 -232
- package/dist/workspace-public-source.d.ts +0 -15
- package/dist/workspace-public-source.js +0 -564
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs/promises';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { BASE_OUTPUT_RULE_IDS, runStaticArtifactChecks, } from './artifact-rules.js';
|
|
4
|
-
import { RUNTIME_LOAD_RULE_IDS, runRuntimeLoadChecks, runtimeViewportNames, } from './runtime-load.js';
|
|
5
|
-
import { findSourcePatterns, scanSourceForCompliance } from './source-scanner.js';
|
|
6
|
-
import { idleStageReport, ranStageReport, runPlayableValidation, summarize, } from './validation-runner.js';
|
|
7
|
-
import { QA_STAGES, } from './types.js';
|
|
8
|
-
export const ARTIFACT_QA_REPORT_VERSION = '0.3.0';
|
|
9
|
-
/** Bump when an artifact rule, its severity, its matching or its step changes. */
|
|
10
|
-
export const ARTIFACT_QA_RULES_VERSION = '2026-11-11.1';
|
|
11
|
-
const B = BASE_OUTPUT_RULE_IDS;
|
|
12
|
-
const R = RUNTIME_LOAD_RULE_IDS;
|
|
13
|
-
/** The step of every channel-independent rule. */
|
|
14
|
-
const COMMON_RULE_STEPS = {
|
|
15
|
-
[B.entryParsable]: 'code',
|
|
16
|
-
[B.viewportMeta]: 'code',
|
|
17
|
-
[B.debugResidue]: 'code',
|
|
18
|
-
[B.devAddress]: 'code',
|
|
19
|
-
[B.persistentStorage]: 'code',
|
|
20
|
-
[B.localReference]: 'resources',
|
|
21
|
-
[B.inlineData]: 'resources',
|
|
22
|
-
[B.externalResource]: 'resources',
|
|
23
|
-
[R.requests]: 'resources',
|
|
24
|
-
[R.csp]: 'resources',
|
|
25
|
-
[R.pageLoads]: 'launch',
|
|
26
|
-
[R.errors]: 'launch',
|
|
27
|
-
[R.firstFrame]: 'launch',
|
|
28
|
-
[R.viewportErrors]: 'launch',
|
|
29
|
-
[R.viewportContent]: 'launch',
|
|
30
|
-
[R.viewportCanvasFit]: 'launch',
|
|
31
|
-
[R.viewportOverflow]: 'launch',
|
|
32
|
-
[B.sizeBudget]: 'size',
|
|
33
|
-
[B.sizeBreakdown]: 'size',
|
|
34
|
-
[B.directRedirect]: 'cta',
|
|
35
|
-
[R.noAutoRedirect]: 'cta',
|
|
36
|
-
[R.ctaEntry]: 'cta',
|
|
37
|
-
[R.ctaRouted]: 'cta',
|
|
38
|
-
[R.ctaStoreUrl]: 'cta',
|
|
39
|
-
[R.startSignal]: 'cta',
|
|
40
|
-
[R.firstTap]: 'launch',
|
|
41
|
-
[R.webgl]: 'launch',
|
|
42
|
-
};
|
|
43
|
-
/** Rule id segments (after the channel) that place channel rules and source hints in a step. */
|
|
44
|
-
const STEP_SEGMENTS = [
|
|
45
|
-
['size', ['size']],
|
|
46
|
-
['cta', ['cta', 'lifecycle', 'mraid', 'sdk', 'redirect', 'click-pixel-url', 'adsdk', 'start-signal']],
|
|
47
|
-
['resources', ['external-resource', 'network', 'local-reference', 'inline-data', 'requests', 'csp']],
|
|
48
|
-
['launch', ['page', 'errors', 'first-frame', 'viewport', 'audio', 'layout']],
|
|
49
|
-
];
|
|
50
|
-
/** Step a rule belongs to; channel package and entry rules not matched otherwise are `code`. */
|
|
51
|
-
export function qaStageOfRule(ruleId) {
|
|
52
|
-
const common = COMMON_RULE_STEPS[ruleId];
|
|
53
|
-
if (common)
|
|
54
|
-
return common;
|
|
55
|
-
const segments = new Set(ruleId.split('.').slice(1));
|
|
56
|
-
return STEP_SEGMENTS.find(([, names]) => names.some((name) => segments.has(name)))?.[0] ?? 'code';
|
|
57
|
-
}
|
|
58
|
-
/** Steps that open the artifact in the headless browser. */
|
|
59
|
-
const BROWSER_STEPS = new Set(['resources', 'launch', 'cta']);
|
|
60
|
-
const ENTRY_UNPARSABLE = 'The entry HTML could not be read as HTML; fix the code step first';
|
|
61
|
-
const PAGE_DID_NOT_LOAD = 'The browser checks of this step did not run because the artifact did not load; see the launch step';
|
|
62
|
-
/**
|
|
63
|
-
* Judges a built artifact step by step, in the order of `QA_STAGES`. Static checks, channel rules
|
|
64
|
-
* and the headless browser each run once; every result is reported under the step its rule belongs
|
|
65
|
-
* to. The browser opens in the first step that needs it. Results depend only on the artifact and
|
|
66
|
-
* the options, never on how the artifact was built.
|
|
67
|
-
*/
|
|
68
|
-
export async function runArtifactQa(artifact, options = {}) {
|
|
69
|
-
const profile = options.profile ?? 'playcraft';
|
|
70
|
-
const requested = new Set(options.stages ?? QA_STAGES);
|
|
71
|
-
const steps = QA_STAGES.filter((step) => requested.has(step));
|
|
72
|
-
const statics = await runStaticArtifactChecks(artifact, {
|
|
73
|
-
profile,
|
|
74
|
-
...(options.sizeLimitBytes !== undefined ? { sizeLimitBytes: options.sizeLimitBytes } : {}),
|
|
75
|
-
});
|
|
76
|
-
const channel = await runChannelRules(artifact, profile);
|
|
77
|
-
const hints = options.projectRoot
|
|
78
|
-
? await collectSourceHints(options.projectRoot, profile, options.sourceGlobs)
|
|
79
|
-
: undefined;
|
|
80
|
-
let runtime;
|
|
81
|
-
const runtimeOutcome = () => (runtime ?? (runtime = options.driver
|
|
82
|
-
? runRuntimeLoadChecks(artifact, {
|
|
83
|
-
driver: options.driver,
|
|
84
|
-
profile,
|
|
85
|
-
...options.runtime,
|
|
86
|
-
}).then((results) => ({
|
|
87
|
-
results,
|
|
88
|
-
loaded: results.find((item) => item.ruleId === R.pageLoads)?.status === 'pass',
|
|
89
|
-
}))
|
|
90
|
-
: Promise.resolve({
|
|
91
|
-
unavailable: options.driverUnavailableReason ?? 'No headless browser driver was provided',
|
|
92
|
-
})));
|
|
93
|
-
const stages = [];
|
|
94
|
-
for (const [index, step] of steps.entries()) {
|
|
95
|
-
const position = { stage: step, index: index + 1, total: steps.length };
|
|
96
|
-
await options.onProgress?.({ type: 'step-start', ...position });
|
|
97
|
-
const startedAt = Date.now();
|
|
98
|
-
const stepHints = (hints ?? []).filter((hint) => qaStageOfRule(hint.ruleId) === step);
|
|
99
|
-
// Without a channel, size is analysis only: the playcraft preview has no hard limit.
|
|
100
|
-
const advisory = step === 'size' && !statics.sizeLimitStrict;
|
|
101
|
-
let report;
|
|
102
|
-
if (!statics.entryParsable && step !== 'code' && step !== 'size') {
|
|
103
|
-
report = { ...idleStageReport(step, 'skipped', ENTRY_UNPARSABLE, advisory), hints: stepHints };
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
const inStep = (item) => qaStageOfRule(item.ruleId) === step;
|
|
107
|
-
const results = [...statics.results, ...channel.results].filter(inStep);
|
|
108
|
-
let status = 'ran';
|
|
109
|
-
let reason;
|
|
110
|
-
const details = {};
|
|
111
|
-
if (step === 'size') {
|
|
112
|
-
details.sizeLimitBytes = statics.sizeLimitBytes;
|
|
113
|
-
details.sizeLimitStrict = statics.sizeLimitStrict;
|
|
114
|
-
}
|
|
115
|
-
if (BROWSER_STEPS.has(step)) {
|
|
116
|
-
const outcome = await runtimeOutcome();
|
|
117
|
-
if ('unavailable' in outcome) {
|
|
118
|
-
status = 'partial';
|
|
119
|
-
reason = `Browser checks did not run: ${outcome.unavailable}`;
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
results.push(...outcome.results.filter(inStep));
|
|
123
|
-
if (step === 'launch')
|
|
124
|
-
details.viewports = runtimeViewportNames(options.runtime?.viewports);
|
|
125
|
-
else if (!outcome.loaded) {
|
|
126
|
-
status = 'partial';
|
|
127
|
-
reason = PAGE_DID_NOT_LOAD;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
report =
|
|
132
|
-
results.length === 0 && status === 'partial'
|
|
133
|
-
? { ...idleStageReport(step, 'skipped', reason ?? '', advisory), hints: stepHints }
|
|
134
|
-
: ranStageReport(step, startedAt, results, {
|
|
135
|
-
status,
|
|
136
|
-
...(reason ? { reason } : {}),
|
|
137
|
-
advisory,
|
|
138
|
-
hints: stepHints,
|
|
139
|
-
...(Object.keys(details).length > 0 ? { details } : {}),
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
stages.push(report);
|
|
143
|
-
await options.onProgress?.({ type: 'step-end', ...position, report });
|
|
144
|
-
}
|
|
145
|
-
const counted = stages.filter((stage) => !stage.advisory);
|
|
146
|
-
return {
|
|
147
|
-
version: ARTIFACT_QA_REPORT_VERSION,
|
|
148
|
-
rulesVersion: ARTIFACT_QA_RULES_VERSION,
|
|
149
|
-
profile,
|
|
150
|
-
artifact: {
|
|
151
|
-
sourcePath: artifact.sourcePath,
|
|
152
|
-
container: artifact.container,
|
|
153
|
-
layout: artifact.layout,
|
|
154
|
-
entry: artifact.entry,
|
|
155
|
-
digest: artifact.digest,
|
|
156
|
-
totalSize: artifact.totalSize,
|
|
157
|
-
fileCount: artifact.files.length,
|
|
158
|
-
},
|
|
159
|
-
summary: summarize(counted.flatMap((stage) => stage.results), channel.manualChecklist, channel.externalChecklist),
|
|
160
|
-
incomplete: counted.some((stage) => stage.status === 'skipped' || stage.status === 'partial'),
|
|
161
|
-
stages,
|
|
162
|
-
sourceHints: hints
|
|
163
|
-
? { status: 'ran' }
|
|
164
|
-
: { status: 'skipped', reason: 'No project root was provided' },
|
|
165
|
-
manualChecklist: channel.manualChecklist,
|
|
166
|
-
externalChecklist: channel.externalChecklist,
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* The channel's existing `html-artifact` / `delivery-package` rules, the same rules export
|
|
171
|
-
* validation uses. The `playcraft` profile has none.
|
|
172
|
-
*/
|
|
173
|
-
async function runChannelRules(artifact, profile) {
|
|
174
|
-
if (profile === 'playcraft')
|
|
175
|
-
return { results: [], manualChecklist: [], externalChecklist: [] };
|
|
176
|
-
const report = await runPlayableValidation({
|
|
177
|
-
projectRoot: path.dirname(artifact.sourcePath),
|
|
178
|
-
channel: profile,
|
|
179
|
-
engine: 'unknown',
|
|
180
|
-
buildChain: 'generic',
|
|
181
|
-
...channelPaths(artifact),
|
|
182
|
-
}, stagesFor(artifact));
|
|
183
|
-
return {
|
|
184
|
-
results: report.results,
|
|
185
|
-
manualChecklist: report.manualChecklist,
|
|
186
|
-
externalChecklist: report.externalChecklist,
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
const ADSDK_PACKAGE = '@playcraft/adsdk';
|
|
190
|
-
/** Published adsdk methods are `playcraftInit` etc.; the short names appear in skills and templates. */
|
|
191
|
-
const ADSDK_CALLS = {
|
|
192
|
-
init: /\bsdk\s*\.\s*(?:init|playcraftInit)\s*\(/g,
|
|
193
|
-
start: /\bsdk\s*\.\s*(?:start|playcraftStart)\s*\(/g,
|
|
194
|
-
interactive: /\bsdk\s*\.\s*(?:interactive|playcraftInteractive)\s*\(/g,
|
|
195
|
-
finish: /\bsdk\s*\.\s*(?:finish|playcraftFinish)\s*\(/g,
|
|
196
|
-
install: /\bsdk\s*\.\s*(?:install|playcraftInstall)\s*\(/g,
|
|
197
|
-
};
|
|
198
|
-
/** Same stage choice as the workspace delivery re-check: HTML artifacts, or the delivery package. */
|
|
199
|
-
function stagesFor(artifact) {
|
|
200
|
-
if (artifact.container === 'html')
|
|
201
|
-
return ['html-artifact'];
|
|
202
|
-
if (artifact.container === 'zip')
|
|
203
|
-
return ['delivery-package'];
|
|
204
|
-
return ['html-artifact', 'delivery-package'];
|
|
205
|
-
}
|
|
206
|
-
function channelPaths(artifact) {
|
|
207
|
-
if (artifact.container === 'html')
|
|
208
|
-
return { htmlPath: artifact.sourcePath };
|
|
209
|
-
if (artifact.container === 'zip')
|
|
210
|
-
return { packagePath: artifact.sourcePath };
|
|
211
|
-
return {
|
|
212
|
-
htmlPath: path.join(artifact.sourcePath, artifact.entry),
|
|
213
|
-
packagePath: artifact.sourcePath,
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
async function collectSourceHints(projectRoot, profile, sourceGlobs) {
|
|
217
|
-
const root = path.resolve(projectRoot);
|
|
218
|
-
const relative = (file) => file && path.isAbsolute(file) ? path.relative(root, file).replace(/\\/g, '/') : file;
|
|
219
|
-
const hints = (await scanSourceForCompliance({
|
|
220
|
-
projectRoot: root,
|
|
221
|
-
channel: profile,
|
|
222
|
-
engine: 'unknown',
|
|
223
|
-
buildChain: 'generic',
|
|
224
|
-
...(sourceGlobs ? { sourceGlobs } : {}),
|
|
225
|
-
})).filter((hint) => hint.status !== 'pass');
|
|
226
|
-
hints.push(...(await adsdkHints(root, sourceGlobs)));
|
|
227
|
-
return hints.map((hint) => ({
|
|
228
|
-
...hint,
|
|
229
|
-
...(hint.file ? { file: relative(hint.file) } : {}),
|
|
230
|
-
}));
|
|
231
|
-
}
|
|
232
|
-
async function adsdkHints(root, sourceGlobs) {
|
|
233
|
-
const hint = (ruleId, message, recommendation) => ({
|
|
234
|
-
ruleId,
|
|
235
|
-
channel: 'common',
|
|
236
|
-
stage: 'prebuild-source',
|
|
237
|
-
severity: 'warning',
|
|
238
|
-
status: 'warning',
|
|
239
|
-
message,
|
|
240
|
-
recommendation,
|
|
241
|
-
owner: 'playcraft-build',
|
|
242
|
-
confidence: 'medium',
|
|
243
|
-
});
|
|
244
|
-
if (!(await dependsOn(root, ADSDK_PACKAGE)))
|
|
245
|
-
return [
|
|
246
|
-
hint('common.adsdk.dependency.missing', `The project does not depend on ${ADSDK_PACKAGE}.`, `Install ${ADSDK_PACKAGE} and wire sdk.init, start, interactive, finish and install, so CTA and lifecycle signals reach every channel.`),
|
|
247
|
-
];
|
|
248
|
-
const found = await findSourcePatterns(root, ADSDK_CALLS, sourceGlobs);
|
|
249
|
-
return Object.keys(ADSDK_CALLS)
|
|
250
|
-
.filter((call) => !found.has(call))
|
|
251
|
-
.map((call) => hint(`common.adsdk.${call}.missing`, `No sdk.${call}() call was found in the project source.`, call === 'install'
|
|
252
|
-
? 'Call sdk.install() from the download / CTA button.'
|
|
253
|
-
: `Call sdk.${call}() at the matching lifecycle point (init → start → interactive → finish → install).`));
|
|
254
|
-
}
|
|
255
|
-
async function dependsOn(root, name) {
|
|
256
|
-
try {
|
|
257
|
-
const manifest = JSON.parse(await fs.readFile(path.join(root, 'package.json'), 'utf-8'));
|
|
258
|
-
return Boolean(manifest.dependencies?.[name] ?? manifest.devDependencies?.[name]);
|
|
259
|
-
}
|
|
260
|
-
catch {
|
|
261
|
-
return false;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { Platform } from '../types.js';
|
|
2
|
-
import type { PlayableArtifact, ValidationResult } from './types.js';
|
|
3
|
-
/**
|
|
4
|
-
* `base-output` rules: channel-independent checks that read the built artifact only. They do not
|
|
5
|
-
* depend on the engine or the build tool that produced the artifact.
|
|
6
|
-
*/
|
|
7
|
-
export declare const BASE_OUTPUT_RULE_IDS: {
|
|
8
|
-
readonly entryParsable: "common.artifact.entry.parsable";
|
|
9
|
-
readonly sizeBudget: "common.artifact.size.budget";
|
|
10
|
-
readonly localReference: "common.artifact.local-reference.resolvable";
|
|
11
|
-
readonly externalResource: "common.artifact.external-resource.forbidden";
|
|
12
|
-
readonly devAddress: "common.artifact.dev-address.forbidden";
|
|
13
|
-
readonly inlineData: "common.artifact.inline-data.valid";
|
|
14
|
-
readonly sizeBreakdown: "common.artifact.size.breakdown";
|
|
15
|
-
readonly debugResidue: "common.artifact.debug-residue.review";
|
|
16
|
-
readonly directRedirect: "common.artifact.redirect.direct.review";
|
|
17
|
-
readonly persistentStorage: "common.artifact.storage.persistent.review";
|
|
18
|
-
readonly viewportMeta: "common.artifact.viewport-meta.present";
|
|
19
|
-
};
|
|
20
|
-
export type BaseOutputRuleId = (typeof BASE_OUTPUT_RULE_IDS)[keyof typeof BASE_OUTPUT_RULE_IDS];
|
|
21
|
-
export interface StaticArtifactCheckOptions {
|
|
22
|
-
/** Profile whose external-resource allowlist applies; default `playcraft`. */
|
|
23
|
-
profile?: Platform;
|
|
24
|
-
/**
|
|
25
|
-
* Size limit of a channel profile, e.g. from the channel's platform adapter; default 5 MB, the
|
|
26
|
-
* cap every channel uses. The `playcraft` profile has no hard limit and uses it as a reference.
|
|
27
|
-
*/
|
|
28
|
-
sizeLimitBytes?: number;
|
|
29
|
-
}
|
|
30
|
-
export interface StaticArtifactChecks {
|
|
31
|
-
results: ValidationResult[];
|
|
32
|
-
/** False when the entry HTML cannot be read as HTML; only the entry result is returned then. */
|
|
33
|
-
entryParsable: boolean;
|
|
34
|
-
sizeLimitBytes: number;
|
|
35
|
-
/** A channel's limit is enforced; the `playcraft` profile only warns above the reference. */
|
|
36
|
-
sizeLimitStrict: boolean;
|
|
37
|
-
}
|
|
38
|
-
/** Every static check of the artifact files, run once; QA steps pick their rules from it. */
|
|
39
|
-
export declare function runStaticArtifactChecks(artifact: PlayableArtifact, options?: StaticArtifactCheckOptions): Promise<StaticArtifactChecks>;
|