@heroiclands/package-build 24.1.0 → 25.0.0
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 +32 -0
- package/README.md +2 -0
- package/bin/content-commands.mjs +183 -15
- package/bin/package-build.mjs +5 -170
- package/docs/api.md +23 -11
- package/docs/authoring/links-and-markup.md +8 -0
- package/docs/commands.md +91 -0
- package/docs/guides/writing-in-invented-scripts.md +23 -15
- package/docs/reference/format-details.md +25 -0
- package/docs/reference/note-types.md +1 -0
- package/engine/build-assets.mjs +179 -0
- package/engine/calendar-artifacts.mjs +7 -3
- package/engine/compendiums.mjs +16 -11
- package/engine/content-charset.mjs +12 -4
- package/engine/content-format.yaml +1 -0
- package/engine/content-scripts.mjs +94 -14
- package/engine/content-session.mjs +62 -14
- package/engine/content-timings.mjs +67 -0
- package/engine/index.mjs +3 -0
- package/engine/language-data.mjs +4 -1
- package/engine/language-terms.mjs +10 -0
- package/engine/map-lexicon.mjs +12 -1
- package/engine/roman-characters.mjs +113 -0
- package/engine/script-font-delivery.mjs +22 -15
- package/package.json +1 -1
- package/types/engine/build-assets.d.mts +23 -0
- package/types/engine/calendar-artifacts.d.mts +5 -1
- package/types/engine/content-charset.d.mts +8 -0
- package/types/engine/content-scripts.d.mts +5 -0
- package/types/engine/content-session.d.mts +19 -1
- package/types/engine/content-timings.d.mts +14 -0
- package/types/engine/index.d.mts +1 -0
- package/types/engine/roman-characters.d.mts +45 -0
- package/types/engine/script-font-delivery.d.mts +8 -4
|
@@ -76,14 +76,15 @@ const FRONTMATTER = /^\uFEFF?---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/;
|
|
|
76
76
|
*
|
|
77
77
|
* @param {string} source - The note's file.
|
|
78
78
|
* @param {import("./script-fonts.mjs").ScriptFonts} installed - The fonts package.
|
|
79
|
+
* @param {import("./content-session.mjs").ContentNoteSource} [parsed] - Already parsed authored note.
|
|
79
80
|
* @returns {string|undefined} The face's slug.
|
|
80
81
|
*/
|
|
81
|
-
function writtenInFace(source, installed) {
|
|
82
|
+
function writtenInFace(source, installed, parsed) {
|
|
82
83
|
const yaml = FRONTMATTER.exec(source)?.[1];
|
|
83
84
|
if (yaml === undefined) return undefined;
|
|
84
85
|
let fm;
|
|
85
86
|
try {
|
|
86
|
-
fm = YAML.parse(yaml);
|
|
87
|
+
fm = parsed ? parsed.frontmatter : YAML.parse(yaml);
|
|
87
88
|
} catch {
|
|
88
89
|
return undefined;
|
|
89
90
|
}
|
|
@@ -102,10 +103,12 @@ function writtenInFace(source, installed) {
|
|
|
102
103
|
*
|
|
103
104
|
* @param {DeliveryConfig} config - The resolved configuration.
|
|
104
105
|
* @param {import("./script-fonts.mjs").ScriptFonts} installed - The fonts package.
|
|
106
|
+
* @param {import("./content-session.mjs").ContentSession} [session] - Captured sources when staging within a content build.
|
|
105
107
|
* @returns {ReadonlySet<string>} The slugs of the faces used.
|
|
106
108
|
*/
|
|
107
|
-
export function facesUsed(config, installed) {
|
|
108
|
-
const
|
|
109
|
+
export function facesUsed(config, installed, session) {
|
|
110
|
+
const cacheKey = session ?? config;
|
|
111
|
+
const known = usedFaces.get(cacheKey);
|
|
109
112
|
if (known) return known;
|
|
110
113
|
const used = new Set();
|
|
111
114
|
const content =
|
|
@@ -119,9 +122,9 @@ export function facesUsed(config, installed) {
|
|
|
119
122
|
const full = path.join(dir, entry.name);
|
|
120
123
|
if (entry.isDirectory()) walk(full);
|
|
121
124
|
else if (entry.isFile() && entry.name.endsWith(".md")) {
|
|
122
|
-
const source = fs.readFileSync(full, "utf8");
|
|
125
|
+
const source = session?.sources.get(full)?.raw ?? fs.readFileSync(full, "utf8");
|
|
123
126
|
if (/^\s*writtenIn:/m.test(source)) {
|
|
124
|
-
const face = writtenInFace(source, installed);
|
|
127
|
+
const face = writtenInFace(source, installed, session?.parsed.get(full));
|
|
125
128
|
if (face) used.add(face);
|
|
126
129
|
}
|
|
127
130
|
if (!/\bfont=/.test(source)) continue;
|
|
@@ -135,7 +138,7 @@ export function facesUsed(config, installed) {
|
|
|
135
138
|
}
|
|
136
139
|
};
|
|
137
140
|
if (content && fs.existsSync(content)) walk(content);
|
|
138
|
-
usedFaces.set(
|
|
141
|
+
usedFaces.set(cacheKey, used);
|
|
139
142
|
return used;
|
|
140
143
|
}
|
|
141
144
|
|
|
@@ -143,15 +146,16 @@ export function facesUsed(config, installed) {
|
|
|
143
146
|
* The installed package, when this consumer is to ship it.
|
|
144
147
|
*
|
|
145
148
|
* @param {DeliveryConfig} config - The resolved configuration.
|
|
149
|
+
* @param {import("./content-session.mjs").ContentSession} [session] - Captured sources.
|
|
146
150
|
* @returns {import("./script-fonts.mjs").ScriptFonts|undefined} The package, or
|
|
147
151
|
* `undefined` without a root, an install, a manifest, or a note that sets
|
|
148
152
|
* text in one of its faces.
|
|
149
153
|
*/
|
|
150
|
-
function delivered(config) {
|
|
154
|
+
function delivered(config, session) {
|
|
151
155
|
if (!config?.rootDir) return undefined;
|
|
152
156
|
const installed = resolveScriptFonts(config.rootDir);
|
|
153
157
|
if (!installed?.manifest) return undefined;
|
|
154
|
-
return facesUsed(config, installed).size ? installed : undefined;
|
|
158
|
+
return facesUsed(config, installed, session).size ? installed : undefined;
|
|
155
159
|
}
|
|
156
160
|
|
|
157
161
|
/**
|
|
@@ -159,12 +163,13 @@ function delivered(config) {
|
|
|
159
163
|
*
|
|
160
164
|
* @param {DeliveryConfig} config - The resolved configuration.
|
|
161
165
|
* @param {string[]} formats - The font formats the target uses: `woff2`, `ttf`.
|
|
166
|
+
* @param {import("./content-session.mjs").ContentSession} [session] - Captured sources when staging within a content build.
|
|
162
167
|
* @returns {{root: string, version: string, files: string[]}|undefined} The
|
|
163
168
|
* files, sorted: `fonts.css`, `LICENSE` and every file in `fonts/` of a
|
|
164
169
|
* listed format. `undefined` when the consumer ships none.
|
|
165
170
|
*/
|
|
166
|
-
export function scriptFontFiles(config, formats) {
|
|
167
|
-
const installed = delivered(config);
|
|
171
|
+
export function scriptFontFiles(config, formats, session) {
|
|
172
|
+
const installed = delivered(config, session);
|
|
168
173
|
if (!installed) return undefined;
|
|
169
174
|
const fontsDir = path.join(installed.root, "fonts");
|
|
170
175
|
const fonts =
|
|
@@ -250,10 +255,11 @@ export function stagedStylesheet(css, staged) {
|
|
|
250
255
|
* @param {string} dest - The directory to fill; created when there is
|
|
251
256
|
* something to put in it.
|
|
252
257
|
* @param {string[]} formats - The font formats the target uses.
|
|
258
|
+
* @param {import("./content-session.mjs").ContentSession} [session] - Captured sources when staging within a content build.
|
|
253
259
|
* @returns {number} How many files were written; 0 when the consumer ships none.
|
|
254
260
|
*/
|
|
255
|
-
export function copyScriptFonts(config, dest, formats) {
|
|
256
|
-
const found = scriptFontFiles(config, formats);
|
|
261
|
+
export function copyScriptFonts(config, dest, formats, session) {
|
|
262
|
+
const found = scriptFontFiles(config, formats, session);
|
|
257
263
|
if (!found) return 0;
|
|
258
264
|
const staged = new Set(found.files);
|
|
259
265
|
for (const file of found.files) {
|
|
@@ -274,11 +280,12 @@ export function copyScriptFonts(config, dest, formats) {
|
|
|
274
280
|
* stylesheet, the licence and every file the manifest lists.
|
|
275
281
|
*
|
|
276
282
|
* @param {DeliveryConfig} config - The resolved configuration.
|
|
283
|
+
* @param {import("./content-session.mjs").ContentSession} [session] - Captured sources when staging within a content build.
|
|
277
284
|
* @returns {{file: string, severity: "error", message: string}[]} One finding
|
|
278
285
|
* per missing file, located at the manifest; empty when the consumer ships none.
|
|
279
286
|
*/
|
|
280
|
-
export function checkScriptFonts(config) {
|
|
281
|
-
const installed = delivered(config);
|
|
287
|
+
export function checkScriptFonts(config, session) {
|
|
288
|
+
const installed = delivered(config, session);
|
|
282
289
|
if (!installed) return [];
|
|
283
290
|
const manifest = path.join(installed.root, FONTS_MANIFEST);
|
|
284
291
|
const wanted = new Set([STYLESHEET, LICENSE]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heroiclands/package-build",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.0.0",
|
|
4
4
|
"description": "Shared toolchain for building and shipping a HeroicLands Foundry VTT package — content compilation, manifest, localization, staging, bundle, release and deployment.",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
6
6
|
"type": "module",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The repository's `packageBuild.assetTransform`, loaded.
|
|
3
|
+
*
|
|
4
|
+
* One loader for every command that writes a picture, so the stage and the CDN
|
|
5
|
+
* hold the same bytes for the same file.
|
|
6
|
+
*
|
|
7
|
+
* @param {object} config - The resolved package-build configuration.
|
|
8
|
+
* @returns {Promise<((sourcePath: string) => string|null|undefined)|undefined>}
|
|
9
|
+
* The transform, or `undefined` when the repository names none.
|
|
10
|
+
*/
|
|
11
|
+
export function loadAssetTransform(config: object): Promise<((sourcePath: string) => string | null | undefined) | undefined>;
|
|
12
|
+
/**
|
|
13
|
+
* Stage static files, provenance-filtered pictures, base styles and fonts.
|
|
14
|
+
* @param {object} [options]
|
|
15
|
+
* @param {ReturnType<typeof loadPackageBuildConfig>} [options.config]
|
|
16
|
+
* @param {import("../content-config.mjs").ContentBuildConfig} [options.packConfig]
|
|
17
|
+
* @param {import("./content-session.mjs").ContentSession} [options.session]
|
|
18
|
+
*/
|
|
19
|
+
export function stagePackageBuildAssets({ config, packConfig, session, }?: {
|
|
20
|
+
config?: Readonly<import("../config.mjs").PackageBuildConfig> | undefined;
|
|
21
|
+
packConfig?: import("../content-config.mjs").ContentBuildConfig | undefined;
|
|
22
|
+
session?: import("./content-session.mjs").ContentSession | undefined;
|
|
23
|
+
}): Promise<void>;
|
|
@@ -3,11 +3,15 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @param {object} opts
|
|
5
5
|
* @param {object} opts.config - Resolved content configuration.
|
|
6
|
+
* @param {Map<string, {raw: string}>} [opts.sources] - Captured authored text for diagnostics.
|
|
6
7
|
* @param {string} opts.calendariaVersion - Version whose import format is targeted.
|
|
7
8
|
* @returns {{directory: string, calendars: number, files: number}}
|
|
8
9
|
*/
|
|
9
|
-
export function emitCalendarArtifacts({ config, calendariaVersion }?: {
|
|
10
|
+
export function emitCalendarArtifacts({ config, calendariaVersion, sources }?: {
|
|
10
11
|
config: object;
|
|
12
|
+
sources?: Map<string, {
|
|
13
|
+
raw: string;
|
|
14
|
+
}> | undefined;
|
|
11
15
|
calendariaVersion: string;
|
|
12
16
|
}): {
|
|
13
17
|
directory: string;
|
|
@@ -9,6 +9,14 @@
|
|
|
9
9
|
* @returns {boolean} Whether Tier 1 admits it.
|
|
10
10
|
*/
|
|
11
11
|
export function isLetterTier(cp: number): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Whether a code point belongs to a declared setting-script encoding block.
|
|
14
|
+
* This identifies native input independently of a language's Roman inventory;
|
|
15
|
+
* a selected native face must still draw the individual character.
|
|
16
|
+
* @param {number} cp - A Unicode code point.
|
|
17
|
+
* @returns {boolean}
|
|
18
|
+
*/
|
|
19
|
+
export function isSettingScriptCodePoint(cp: number): boolean;
|
|
12
20
|
/**
|
|
13
21
|
* Whether the charset admits a code point anywhere in a note.
|
|
14
22
|
*
|
|
@@ -254,6 +254,11 @@ export type RunContext = {
|
|
|
254
254
|
* {@link module :engine/verse-metre.metreBooksFromRecords}.
|
|
255
255
|
*/
|
|
256
256
|
metreBooks?: ReadonlyMap<string, import("./verse-metre.mjs").MetreBook> | undefined;
|
|
257
|
+
/**
|
|
258
|
+
* -
|
|
259
|
+
* Exact Roman source inventories by configured alias and BCP 47 tag.
|
|
260
|
+
*/
|
|
261
|
+
romanInventories?: ReadonlyMap<string, import("./roman-characters.mjs").RomanInventory> | undefined;
|
|
257
262
|
/**
|
|
258
263
|
* -
|
|
259
264
|
* Each face's emphasis conventions, from the script notes, by
|
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
* @param {string} [options.assetsBase] - Assets root, defaulting to configuration.
|
|
9
9
|
* @param {readonly string[]} [options.skipDirectories] - Resolved content scope.
|
|
10
10
|
* @param {ReturnType<typeof routerFor>} [options.router] - One router shared by this session's compile.
|
|
11
|
+
* @param {boolean} [options.trackChanges] - Snapshot physical input metadata for build phase guards.
|
|
12
|
+
* @param {ReturnType<typeof createContentTimings>} [options.timings] - Invocation stage accounting.
|
|
11
13
|
* @returns {Promise<ContentSession>} Captured sources and lazy prepared views; dispose after use.
|
|
12
14
|
*/
|
|
13
|
-
export function createContentSession({ config, contentBase, assetsBase, skipDirectories, router, }?: {
|
|
15
|
+
export function createContentSession({ config, contentBase, assetsBase, skipDirectories, router, timings, trackChanges, }?: {
|
|
14
16
|
config?: import("../content-config.mjs").ContentBuildConfig | undefined;
|
|
15
17
|
contentBase?: string | undefined;
|
|
16
18
|
assetsBase?: string | undefined;
|
|
@@ -21,6 +23,17 @@ export function createContentSession({ config, contentBase, assetsBase, skipDire
|
|
|
21
23
|
packsOfType: (docType: string) => string[];
|
|
22
24
|
defaultOf: (docType: string) => string | undefined;
|
|
23
25
|
} | undefined;
|
|
26
|
+
trackChanges?: boolean | undefined;
|
|
27
|
+
timings?: {
|
|
28
|
+
sync<T>(name: string, work: () => T): T;
|
|
29
|
+
measure<T>(name: string, work: () => Promise<T> | T): Promise<T>;
|
|
30
|
+
hit(name: string): void;
|
|
31
|
+
snapshot(): {
|
|
32
|
+
totalMs: number;
|
|
33
|
+
stages: any;
|
|
34
|
+
hits: any;
|
|
35
|
+
};
|
|
36
|
+
} | undefined;
|
|
24
37
|
}): Promise<ContentSession>;
|
|
25
38
|
/**
|
|
26
39
|
* @typedef {"index"|"lint"|"links"|"compile"} ContentTarget
|
|
@@ -47,6 +60,8 @@ export function createContentSession({ config, contentBase, assetsBase, skipDire
|
|
|
47
60
|
* @property {() => Promise<import("./content-index.mjs").PreparedContentIndex>} publication
|
|
48
61
|
* @property {() => ReturnType<import("./compile-corpus.mjs").buildCompileCorpus>} compileCorpus
|
|
49
62
|
* @property {(targets: readonly ContentTarget[]) => Promise<ContentSession>} prepare
|
|
63
|
+
* @property {ReturnType<typeof createContentTimings>} timings
|
|
64
|
+
* @property {() => void} assertUnchanged
|
|
50
65
|
* @property {() => void} dispose
|
|
51
66
|
*/
|
|
52
67
|
/**
|
|
@@ -96,6 +111,8 @@ export type ContentSession = {
|
|
|
96
111
|
publication: () => Promise<import("./content-index.mjs").PreparedContentIndex>;
|
|
97
112
|
compileCorpus: () => ReturnType<typeof import("./compile-corpus.mjs").buildCompileCorpus>;
|
|
98
113
|
prepare: (targets: readonly ContentTarget[]) => Promise<ContentSession>;
|
|
114
|
+
timings: ReturnType<typeof createContentTimings>;
|
|
115
|
+
assertUnchanged: () => void;
|
|
99
116
|
dispose: () => void;
|
|
100
117
|
};
|
|
101
118
|
import * as blocks from "./content-blocks.mjs";
|
|
@@ -106,3 +123,4 @@ import { captureContentSources } from "./content-sources.mjs";
|
|
|
106
123
|
import { loadForeignIndexes } from "./metadata-index.mjs";
|
|
107
124
|
import * as sql from "./sql-tables.mjs";
|
|
108
125
|
import { buildLinkIndex } from "./content-links.mjs";
|
|
126
|
+
import { createContentTimings } from "./content-timings.mjs";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Sequential, nested stage accounting for one content invocation. */
|
|
2
|
+
export function createContentTimings(): {
|
|
3
|
+
/** @template T @param {string} name @param {() => T} work @returns {T} */
|
|
4
|
+
sync<T>(name: string, work: () => T): T;
|
|
5
|
+
/** @template T @param {string} name @param {() => Promise<T>|T} work @returns {Promise<T>} */
|
|
6
|
+
measure<T>(name: string, work: () => Promise<T> | T): Promise<T>;
|
|
7
|
+
/** @param {string} name */
|
|
8
|
+
hit(name: string): void;
|
|
9
|
+
snapshot(): {
|
|
10
|
+
totalMs: number;
|
|
11
|
+
stages: any;
|
|
12
|
+
hits: any;
|
|
13
|
+
};
|
|
14
|
+
};
|
package/types/engine/index.d.mts
CHANGED
|
@@ -65,6 +65,7 @@ export * as previewIndex from "./preview-index.mjs";
|
|
|
65
65
|
export * as contentRender from "./content-render.mjs";
|
|
66
66
|
export * as contentLint from "./content-lint.mjs";
|
|
67
67
|
export * as contentCharset from "./content-charset.mjs";
|
|
68
|
+
export * as romanCharacters from "./roman-characters.mjs";
|
|
68
69
|
export * as pathCharset from "./path-charset.mjs";
|
|
69
70
|
export * as contentIcons from "./content-icons.mjs";
|
|
70
71
|
export * as contentHtml from "./content-html.mjs";
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Semantic problems in a supplied inventory. Shape belongs to the vocabulary.
|
|
3
|
+
* An empty string explicitly declares no written characters.
|
|
4
|
+
* @param {unknown} value - The authored `data.roman`.
|
|
5
|
+
* @returns {string[]} Findings at that field.
|
|
6
|
+
*/
|
|
7
|
+
export function romanInventoryProblems(value: unknown): string[];
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {object} RomanInventory
|
|
10
|
+
* @property {string} language - The configured language name.
|
|
11
|
+
* @property {ReadonlySet<string>|undefined} characters - Exact code points, absent for a missing declaration.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Each configured language note's own inventory, by alias and BCP 47 tag.
|
|
15
|
+
* Language-family ancestry does not supply an inventory. Unassociated external
|
|
16
|
+
* tags have no entry and keep their ordinary behavior.
|
|
17
|
+
* @param {ReadonlyMap<string, Record<string, any>>} records - Configured language notes.
|
|
18
|
+
* @param {Readonly<Record<string, {tag: string}>>} languages - Language configuration.
|
|
19
|
+
* @returns {Map<string, RomanInventory>}
|
|
20
|
+
*/
|
|
21
|
+
export function romanInventoriesOf(records: ReadonlyMap<string, Record<string, any>>, languages?: Readonly<Record<string, {
|
|
22
|
+
tag: string;
|
|
23
|
+
}>>): Map<string, RomanInventory>;
|
|
24
|
+
/**
|
|
25
|
+
* Invalid source characters, retaining offsets in the supplied unescaped text.
|
|
26
|
+
* No punctuation, case or normalization repair is performed.
|
|
27
|
+
* @param {string} text - Visible Roman source.
|
|
28
|
+
* @param {RomanInventory} inventory - Its language's declared characters.
|
|
29
|
+
* @param {(char: string) => boolean} [native] - Whether a directly typed native sign is drawn in the selected native face.
|
|
30
|
+
* @returns {Array<{offset: number, message: string}>}
|
|
31
|
+
*/
|
|
32
|
+
export function romanTextProblems(text: string, inventory: RomanInventory, native?: (char: string) => boolean): Array<{
|
|
33
|
+
offset: number;
|
|
34
|
+
message: string;
|
|
35
|
+
}>;
|
|
36
|
+
export type RomanInventory = {
|
|
37
|
+
/**
|
|
38
|
+
* - The configured language name.
|
|
39
|
+
*/
|
|
40
|
+
language: string;
|
|
41
|
+
/**
|
|
42
|
+
* - Exact code points, absent for a missing declaration.
|
|
43
|
+
*/
|
|
44
|
+
characters: ReadonlySet<string> | undefined;
|
|
45
|
+
};
|
|
@@ -7,19 +7,21 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @param {DeliveryConfig} config - The resolved configuration.
|
|
9
9
|
* @param {import("./script-fonts.mjs").ScriptFonts} installed - The fonts package.
|
|
10
|
+
* @param {import("./content-session.mjs").ContentSession} [session] - Captured sources when staging within a content build.
|
|
10
11
|
* @returns {ReadonlySet<string>} The slugs of the faces used.
|
|
11
12
|
*/
|
|
12
|
-
export function facesUsed(config: DeliveryConfig, installed: import("./script-fonts.mjs").ScriptFonts): ReadonlySet<string>;
|
|
13
|
+
export function facesUsed(config: DeliveryConfig, installed: import("./script-fonts.mjs").ScriptFonts, session?: import("./content-session.mjs").ContentSession): ReadonlySet<string>;
|
|
13
14
|
/**
|
|
14
15
|
* The files a target receives, as paths relative to the fonts package root.
|
|
15
16
|
*
|
|
16
17
|
* @param {DeliveryConfig} config - The resolved configuration.
|
|
17
18
|
* @param {string[]} formats - The font formats the target uses: `woff2`, `ttf`.
|
|
19
|
+
* @param {import("./content-session.mjs").ContentSession} [session] - Captured sources when staging within a content build.
|
|
18
20
|
* @returns {{root: string, version: string, files: string[]}|undefined} The
|
|
19
21
|
* files, sorted: `fonts.css`, `LICENSE` and every file in `fonts/` of a
|
|
20
22
|
* listed format. `undefined` when the consumer ships none.
|
|
21
23
|
*/
|
|
22
|
-
export function scriptFontFiles(config: DeliveryConfig, formats: string[]): {
|
|
24
|
+
export function scriptFontFiles(config: DeliveryConfig, formats: string[], session?: import("./content-session.mjs").ContentSession): {
|
|
23
25
|
root: string;
|
|
24
26
|
version: string;
|
|
25
27
|
files: string[];
|
|
@@ -46,18 +48,20 @@ export function stagedStylesheet(css: string, staged: ReadonlySet<string>): stri
|
|
|
46
48
|
* @param {string} dest - The directory to fill; created when there is
|
|
47
49
|
* something to put in it.
|
|
48
50
|
* @param {string[]} formats - The font formats the target uses.
|
|
51
|
+
* @param {import("./content-session.mjs").ContentSession} [session] - Captured sources when staging within a content build.
|
|
49
52
|
* @returns {number} How many files were written; 0 when the consumer ships none.
|
|
50
53
|
*/
|
|
51
|
-
export function copyScriptFonts(config: DeliveryConfig, dest: string, formats: string[]): number;
|
|
54
|
+
export function copyScriptFonts(config: DeliveryConfig, dest: string, formats: string[], session?: import("./content-session.mjs").ContentSession): number;
|
|
52
55
|
/**
|
|
53
56
|
* Whether the package ships what its manifest and stylesheet promise: the
|
|
54
57
|
* stylesheet, the licence and every file the manifest lists.
|
|
55
58
|
*
|
|
56
59
|
* @param {DeliveryConfig} config - The resolved configuration.
|
|
60
|
+
* @param {import("./content-session.mjs").ContentSession} [session] - Captured sources when staging within a content build.
|
|
57
61
|
* @returns {{file: string, severity: "error", message: string}[]} One finding
|
|
58
62
|
* per missing file, located at the manifest; empty when the consumer ships none.
|
|
59
63
|
*/
|
|
60
|
-
export function checkScriptFonts(config: DeliveryConfig): {
|
|
64
|
+
export function checkScriptFonts(config: DeliveryConfig, session?: import("./content-session.mjs").ContentSession): {
|
|
61
65
|
file: string;
|
|
62
66
|
severity: "error";
|
|
63
67
|
message: string;
|