@heroiclands/package-build 0.6.1 → 3.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-content-build.md +965 -0
- package/CHANGELOG.md +58 -0
- package/CONTENT.md +824 -0
- package/MIGRATING.md +127 -0
- package/README.md +29 -17
- package/bin/content-build.mjs +1082 -0
- package/bin/package-build.mjs +2 -2
- package/bin/report.mjs +2 -2
- package/config.mjs +21 -18
- package/content-config.mjs +1424 -0
- package/coverage.mjs +1 -1
- package/e2e.mjs +1 -1
- package/engine/abbreviations.mjs +0 -0
- package/engine/base-compiler.mjs +608 -0
- package/engine/code-fences.mjs +311 -0
- package/engine/compendiums.mjs +353 -0
- package/engine/content-address.mjs +141 -0
- package/engine/content-links.mjs +438 -0
- package/engine/content-lint.mjs +204 -0
- package/engine/content-package.mjs +67 -0
- package/engine/content-slug.mjs +169 -0
- package/engine/content-tables.mjs +1216 -0
- package/engine/content-tree.mjs +56 -0
- package/engine/diagnostics.mjs +270 -0
- package/engine/field-reference.mjs +242 -0
- package/engine/field-spec.mjs +218 -0
- package/engine/foreign-catalog.mjs +450 -0
- package/engine/foreign-manifests.mjs +129 -0
- package/engine/frontmatter-lint.mjs +343 -0
- package/engine/frontmatter.mjs +258 -0
- package/engine/generate.mjs +305 -0
- package/engine/helpers.mjs +809 -0
- package/engine/ids.mjs +192 -0
- package/engine/index.mjs +142 -0
- package/engine/item-docs.mjs +153 -0
- package/engine/item-registry.mjs +129 -0
- package/engine/journals.mjs +374 -0
- package/engine/kb-manifest.mjs +473 -0
- package/engine/macros.mjs +333 -0
- package/engine/manifest-emit.mjs +339 -0
- package/engine/map-notes.mjs +1302 -0
- package/engine/pack-config.mjs +479 -0
- package/engine/pack-router.mjs +254 -0
- package/engine/prose-config.mjs +238 -0
- package/engine/prose-lint.mjs +294 -0
- package/engine/region-events.mjs +79 -0
- package/engine/scene-levels.mjs +420 -0
- package/engine/scenes.mjs +528 -0
- package/engine/site-build.mjs +778 -0
- package/engine/site-index.mjs +332 -0
- package/engine/web-wikilinks.mjs +330 -0
- package/engine/wikilink-syntax.mjs +105 -0
- package/engine/wikilinks.mjs +645 -0
- package/index.mjs +42 -25
- package/lang.mjs +1 -1
- package/manifest.mjs +79 -5
- package/markdownlint-config.mjs +45 -0
- package/package.json +78 -35
- package/prettier-config.mjs +34 -0
- package/sohl/actors.mjs +581 -0
- package/sohl/affiliation-standings.mjs +44 -0
- package/sohl/being-info.mjs +173 -0
- package/sohl/default-item-art.mjs +82 -0
- package/sohl/index.mjs +55 -0
- package/sohl/item-builders.mjs +114 -0
- package/sohl/item-fields.mjs +867 -0
- package/sohl/items.mjs +197 -0
- package/sohl/kb-passes.mjs +207 -0
- package/sohl/note-schemas.mjs +322 -0
- package/templates.mjs +1 -1
- package/types/config.d.mts +1 -1
- package/types/content-config.d.mts +571 -0
- package/types/engine/abbreviations.d.mts +44 -0
- package/types/engine/base-compiler.d.mts +320 -0
- package/types/engine/code-fences.d.mts +102 -0
- package/types/engine/compendiums.d.mts +77 -0
- package/types/engine/content-address.d.mts +61 -0
- package/types/engine/content-links.d.mts +87 -0
- package/types/engine/content-lint.d.mts +47 -0
- package/types/engine/content-package.d.mts +36 -0
- package/types/engine/content-slug.d.mts +59 -0
- package/types/engine/content-tables.d.mts +131 -0
- package/types/engine/content-tree.d.mts +12 -0
- package/types/engine/diagnostics.d.mts +152 -0
- package/types/engine/field-reference.d.mts +20 -0
- package/types/engine/field-spec.d.mts +181 -0
- package/types/engine/foreign-catalog.d.mts +103 -0
- package/types/engine/foreign-manifests.d.mts +43 -0
- package/types/engine/frontmatter-lint.d.mts +74 -0
- package/types/engine/frontmatter.d.mts +99 -0
- package/types/engine/generate.d.mts +56 -0
- package/types/engine/helpers.d.mts +348 -0
- package/types/engine/ids.d.mts +126 -0
- package/types/engine/index.d.mts +33 -0
- package/types/engine/item-docs.d.mts +73 -0
- package/types/engine/item-registry.d.mts +57 -0
- package/types/engine/journals.d.mts +121 -0
- package/types/engine/kb-manifest.d.mts +214 -0
- package/types/engine/macros.d.mts +201 -0
- package/types/engine/manifest-emit.d.mts +137 -0
- package/types/engine/map-notes.d.mts +283 -0
- package/types/engine/pack-config.d.mts +77 -0
- package/types/engine/pack-router.d.mts +53 -0
- package/types/engine/prose-config.d.mts +121 -0
- package/types/engine/prose-lint.d.mts +59 -0
- package/types/engine/region-events.d.mts +43 -0
- package/types/engine/scene-levels.d.mts +36 -0
- package/types/engine/scenes.d.mts +48 -0
- package/types/engine/site-build.d.mts +214 -0
- package/types/engine/site-index.d.mts +141 -0
- package/types/engine/web-wikilinks.d.mts +67 -0
- package/types/engine/wikilink-syntax.d.mts +101 -0
- package/types/engine/wikilinks.d.mts +172 -0
- package/types/index.d.mts +3 -0
- package/types/manifest.d.mts +52 -4
- package/types/markdownlint-config.d.mts +8 -0
- package/types/prettier-config.d.mts +1 -0
- package/types/sohl/actors.d.mts +65 -0
- package/types/sohl/affiliation-standings.d.mts +22 -0
- package/types/sohl/being-info.d.mts +78 -0
- package/types/sohl/default-item-art.d.mts +28 -0
- package/types/sohl/index.d.mts +7 -0
- package/types/sohl/item-builders.d.mts +11 -0
- package/types/sohl/item-fields.d.mts +20 -0
- package/types/sohl/items.d.mts +19 -0
- package/types/sohl/kb-passes.d.mts +71 -0
- package/types/sohl/note-schemas.d.mts +7 -0
package/MIGRATING.md
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Migrating to `@heroiclands/package-build` 2.0.0
|
|
2
|
+
|
|
3
|
+
`@heroiclands/content-build` and `@heroiclands/package-build` are one package.
|
|
4
|
+
The content half now ships inside `@heroiclands/package-build` at 2.0.0;
|
|
5
|
+
`@heroiclands/content-build` is deprecated and receives no further releases.
|
|
6
|
+
|
|
7
|
+
Nothing about how a build _works_ changed. This is a packaging change: the same
|
|
8
|
+
modules, the same CLI commands, the same configuration keys, reachable under one
|
|
9
|
+
name.
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
The two packages split by input — content-build read `assets/content/**`,
|
|
14
|
+
package-build read `lang/`, `styles/`, `src/` and the manifest template — on the
|
|
15
|
+
theory that a module would use one or the other. No consumer ever did. All three
|
|
16
|
+
installed both, and package-build depended on content-build besides, so the
|
|
17
|
+
packaging half dragged the content half in regardless.
|
|
18
|
+
|
|
19
|
+
What the boundary cost was real: one configuration file with two owners, two
|
|
20
|
+
CLIs with a colliding `manifest` command, and a two-repository dance for changes
|
|
21
|
+
that touched a single idea.
|
|
22
|
+
|
|
23
|
+
## 1. Dependencies
|
|
24
|
+
|
|
25
|
+
Drop `@heroiclands/content-build` and move to 2.0.0:
|
|
26
|
+
|
|
27
|
+
```diff
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
- "@heroiclands/content-build": "^1.8.2",
|
|
30
|
+
- "@heroiclands/package-build": "^0.6.1"
|
|
31
|
+
+ "@heroiclands/package-build": "^2.0.0"
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 2. Import specifiers
|
|
36
|
+
|
|
37
|
+
Every `@heroiclands/content-build/*` specifier becomes
|
|
38
|
+
`@heroiclands/package-build/*`. Subpaths are otherwise unchanged — `engine/*`,
|
|
39
|
+
`sohl/*`, `prettier` and `markdownlint` all keep their names:
|
|
40
|
+
|
|
41
|
+
```diff
|
|
42
|
+
-import { positionOfLiteral } from "@heroiclands/content-build/engine/diagnostics";
|
|
43
|
+
+import { positionOfLiteral } from "@heroiclands/package-build/engine/diagnostics";
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**One subpath moved.** Both packages exported a `./config`, meaning different
|
|
47
|
+
things, so the content one is now `./content-config`. `./config` remains the
|
|
48
|
+
packaging configuration it always was, and consumers of it need no change:
|
|
49
|
+
|
|
50
|
+
```diff
|
|
51
|
+
-import { defineConfig } from "@heroiclands/content-build/config";
|
|
52
|
+
+import { defineConfig } from "@heroiclands/package-build/content-config";
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`defineConfig` is also re-exported from the package root, so
|
|
56
|
+
`import { defineConfig } from "@heroiclands/package-build"` works too.
|
|
57
|
+
|
|
58
|
+
A mechanical pass over a consumer:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
git ls-files -z '*.mjs' '*.ts' | xargs -0 perl -pi -e \
|
|
62
|
+
's{\@heroiclands/content-build/config}{\@heroiclands/package-build/content-config}g;
|
|
63
|
+
s{\@heroiclands/content-build}{\@heroiclands/package-build}g'
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Review the result rather than trusting it — a changelog or a historical comment
|
|
67
|
+
that names the old package is usually meant to keep naming it.
|
|
68
|
+
|
|
69
|
+
## 3. The CLI
|
|
70
|
+
|
|
71
|
+
**Both commands still exist and behave identically.** `content-build` and
|
|
72
|
+
`package-build` are both bin entries of the merged package, so scripts calling
|
|
73
|
+
either keep working:
|
|
74
|
+
|
|
75
|
+
```jsonc
|
|
76
|
+
"scripts": {
|
|
77
|
+
"build:compiledb": "content-build package compile", // unchanged
|
|
78
|
+
"build:manifest": "package-build manifest" // unchanged
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Unifying the two into one noun-namespaced CLI — and resolving the `manifest`
|
|
83
|
+
collision, where `content-build manifest` emits the cross-package link manifest
|
|
84
|
+
and `package-build manifest` generates `module.json` — is deliberately _not_
|
|
85
|
+
part of this release. It is a behavior change and gets its own.
|
|
86
|
+
|
|
87
|
+
## 4. Rename the configuration file
|
|
88
|
+
|
|
89
|
+
**Required.** The config stem follows the package:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
git mv content-build.config.yaml package-build.config.yaml # or .yml / .mjs
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The old stem is **not** accepted. A deprecation window would let a repository
|
|
96
|
+
sit indefinitely on a filename naming a package that no longer exists, and this
|
|
97
|
+
upgrade already requires touching the manifest and the imports — one more `git
|
|
98
|
+
mv` is not what makes it expensive.
|
|
99
|
+
|
|
100
|
+
If a build cannot find the file it says so by name:
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
package-build: no package-build.config.yaml or package-build.config.yml or
|
|
104
|
+
package-build.config.mjs found at or above …
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Two configs in one directory is still an error rather than a precedence
|
|
108
|
+
question, so a half-finished rename fails loudly instead of quietly building
|
|
109
|
+
from the file you stopped editing.
|
|
110
|
+
|
|
111
|
+
**Every key inside the file is unchanged**, including the `packageBuild:`
|
|
112
|
+
section — which is no longer a block reserved for a separate toolchain, just a
|
|
113
|
+
section.
|
|
114
|
+
|
|
115
|
+
The `CONTENT_BUILD_CONFIG` environment variable, which names the file
|
|
116
|
+
explicitly when a repository keeps it somewhere else, is now
|
|
117
|
+
`PACKAGE_BUILD_CONFIG`. The old name is not read.
|
|
118
|
+
|
|
119
|
+
## What did not change
|
|
120
|
+
|
|
121
|
+
- Every configuration key, and the shape of the whole file — only its name moved.
|
|
122
|
+
- Every CLI command, flag and exit code.
|
|
123
|
+
- Every engine and `sohl` module, and what it exports.
|
|
124
|
+
- The Foundry manifest, the packs it declares, and every compiled document id.
|
|
125
|
+
|
|
126
|
+
A world that resolved `Compendium.<package>.<pack>.<Type>.<id>` before resolves
|
|
127
|
+
it after; nothing about compiled output moved.
|
package/README.md
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
# @heroiclands/package-build
|
|
2
2
|
|
|
3
3
|
The shared toolchain for building and shipping a HeroicLands **Foundry
|
|
4
|
-
package** — the parts Foundry loads
|
|
5
|
-
content.
|
|
4
|
+
package** — its compendium content and the parts Foundry loads besides.
|
|
6
5
|
|
|
7
|
-
It
|
|
8
|
-
[`@heroiclands/content-build`](https://github.com/HeroicLands/content-build), and
|
|
9
|
-
the two split by **input**:
|
|
6
|
+
It has two halves, split by **input**:
|
|
10
7
|
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
|
8
|
+
| Half | Reads | Produces |
|
|
9
|
+
| ------------- | ------------------------------------------------------------ | -------------------------------------------------------------- |
|
|
10
|
+
| **content** | `assets/content/**` | compendium packs, site content, link manifest |
|
|
11
|
+
| **packaging** | `lang/`, `styles/`, `src/`, `assets/`, the manifest template | `system.json` / `module.json`, styles, bundle, release archive |
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
The content half is documented separately in **[CONTENT.md](CONTENT.md)** — the
|
|
14
|
+
note format, the pack pipeline, and the configuration contract a content tree
|
|
15
|
+
declares itself with.
|
|
16
|
+
|
|
17
|
+
> **This package was two.** Until 2.0.0 the content half shipped as
|
|
18
|
+
> `@heroiclands/content-build`. No consumer ever installed one without the
|
|
19
|
+
> other, and the packaging half depended on the content half besides, so the
|
|
20
|
+
> boundary bought nothing and cost a configuration file with two owners and a
|
|
21
|
+
> two-repository dance for single changes. See
|
|
22
|
+
> [MIGRATING.md](MIGRATING.md) to move a consumer from 1.x.
|
|
20
23
|
|
|
21
24
|
## Install
|
|
22
25
|
|
|
@@ -72,9 +75,9 @@ The whole of assemble → validate → ship, one subpath each:
|
|
|
72
75
|
|
|
73
76
|
## Configure
|
|
74
77
|
|
|
75
|
-
A repository declares its build in **one** file — `
|
|
76
|
-
|
|
77
|
-
the
|
|
78
|
+
A repository declares its build in **one** file — `package-build.config.yaml`.
|
|
79
|
+
The content half reads its top level; the packaging half takes its settings from
|
|
80
|
+
the `packageBuild:` section:
|
|
78
81
|
|
|
79
82
|
```yaml
|
|
80
83
|
# Read from the top level, not restated below.
|
|
@@ -239,7 +242,7 @@ package forever; the build says so, naming the key and where the value actually
|
|
|
239
242
|
comes from.
|
|
240
243
|
|
|
241
244
|
`packs` is derived from the **one** pack list at the top level of
|
|
242
|
-
`
|
|
245
|
+
`package-build.config.yaml` — each entry's `label`, `type`, `name` and
|
|
243
246
|
`private`, plus a `system` from `stats.systemId` and a `path` of
|
|
244
247
|
`packs/<name>`. Companions are flattened in, because Foundry sees no difference:
|
|
245
248
|
a companion is only a pack written by another pass rather than one of its own.
|
|
@@ -250,6 +253,15 @@ shared configuration, not from this section — content-build consumes them
|
|
|
250
253
|
(`supportedCoreVersion`, and a module'''s `stats.systemVersion`) and the
|
|
251
254
|
dependency runs one way.
|
|
252
255
|
|
|
256
|
+
**A relationship's build-only keys are not published.** `relationships` is the
|
|
257
|
+
one block with a second reader, and content-build takes directives there:
|
|
258
|
+
`itemCatalog: true` on a dependency selects that package's Item packs as a
|
|
259
|
+
resolution source for the actors pass. That says how the package is _built_, not
|
|
260
|
+
what it depends on, so it is dropped on the way into the manifest — Foundry's
|
|
261
|
+
relationship schema does not define it, and someone reading a published manifest
|
|
262
|
+
cannot tell a build directive from a declaration. Every other key is copied,
|
|
263
|
+
including one this package has never heard of.
|
|
264
|
+
|
|
253
265
|
**Why one file and not two.** Two of the values this package needs —
|
|
254
266
|
`packageKind` and `foundryPackage` — are already declared for `content-build`. A
|
|
255
267
|
second config file would restate them, which is two places for one fact; that is
|