@uniweb/unipress 0.2.2 → 0.2.4
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 +97 -8
- package/README.md +18 -8
- package/RELEASING.md +3 -1
- package/docs/for-developers.md +113 -0
- package/docs/templates/book.md +2 -3
- package/docs/templates/data-report.md +2 -2
- package/docs/templates/directory.md +3 -3
- package/docs/templates/monograph.md +1 -2
- package/docs/templates/report.md +2 -3
- package/package.json +6 -6
- package/src/content-loader.js +101 -1
- package/src/foundation-loader.js +19 -2
- package/src/foundations-data.js +32 -18
- package/src/templates-data.js +42 -35
package/src/foundations-data.js
CHANGED
|
@@ -10,6 +10,25 @@
|
|
|
10
10
|
* different `book.structure:` defaults, and different sample chapters.
|
|
11
11
|
*
|
|
12
12
|
* ─────────────────────────────────────────────────────────────────────────
|
|
13
|
+
* Distribution
|
|
14
|
+
* ─────────────────────────────────────────────────────────────────────────
|
|
15
|
+
*
|
|
16
|
+
* Foundations are deployed as static artifacts to the unipress repo's
|
|
17
|
+
* GitHub Pages site. URL pattern:
|
|
18
|
+
*
|
|
19
|
+
* https://uniweb.github.io/unipress/foundations/<name>/<version>/foundation.js
|
|
20
|
+
*
|
|
21
|
+
* On every push to main, `.github/workflows/deploy-foundations.yml`
|
|
22
|
+
* builds each `foundations/<name>/` and layers the resulting `dist/` into
|
|
23
|
+
* the gh-pages branch under `foundations/<name>/<version>/`. Versions
|
|
24
|
+
* accumulate; older versions stay reachable indefinitely.
|
|
25
|
+
*
|
|
26
|
+
* GH Pages serves `Access-Control-Allow-Origin: *` on static files, so
|
|
27
|
+
* cross-origin imports work for browser hosts (Uniweb editor preview).
|
|
28
|
+
* The unipress CLI fetches the URL directly and caches at
|
|
29
|
+
* `~/.cache/unipress/foundations/...`.
|
|
30
|
+
*
|
|
31
|
+
* ─────────────────────────────────────────────────────────────────────────
|
|
13
32
|
* Resolution path
|
|
14
33
|
* ─────────────────────────────────────────────────────────────────────────
|
|
15
34
|
*
|
|
@@ -17,15 +36,15 @@
|
|
|
17
36
|
* 1. catalog lookup (this file) → entry.foundation.ref + entry.scaffold.
|
|
18
37
|
* 2. scaffold copies templates-data.js[entry.scaffold] into my-doc/. The
|
|
19
38
|
* bundled document.yml has `foundation: <entry.foundation.ref>` (the
|
|
20
|
-
* registry-ref form, e.g., '@uniweb/book@0.1.
|
|
39
|
+
* registry-ref form, e.g., '@uniweb/book@0.1.1' — rewritten from the
|
|
21
40
|
* committed dev path-ref by scripts/generate-templates-data.js).
|
|
22
41
|
*
|
|
23
42
|
* `unipress compile my-doc`:
|
|
24
|
-
* 1. document.yml `foundation: '@uniweb/book@0.1.
|
|
43
|
+
* 1. document.yml `foundation: '@uniweb/book@0.1.1'` is parsed as a
|
|
25
44
|
* registry ref by foundation-loader.js.
|
|
26
45
|
* 2. The loader constructs a URL from the registry base
|
|
27
|
-
* (UNIWEB_REGISTRY_URL or the
|
|
28
|
-
*
|
|
46
|
+
* (UNIWEB_REGISTRY_URL env override or the default GH Pages base) →
|
|
47
|
+
* fetches + caches.
|
|
29
48
|
*
|
|
30
49
|
* ─────────────────────────────────────────────────────────────────────────
|
|
31
50
|
* source.url
|
|
@@ -33,14 +52,9 @@
|
|
|
33
52
|
*
|
|
34
53
|
* Each entry's `foundation.source.url` is the human-meaningful "where this
|
|
35
54
|
* foundation lives" pointer shown in `list-templates` output and post-create
|
|
36
|
-
* messages. It
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* v0.2 entries pin local-registry URLs (http://localhost:4001/...) so
|
|
41
|
-
* foundation devs running `uniweb publish --local` can verify resolution
|
|
42
|
-
* end-to-end. TF8 of the unipress-foundations-and-templates plan switches
|
|
43
|
-
* these to the production registry once the foundations publish there.
|
|
55
|
+
* messages. It mirrors the URL the loader builds at compile time, but does
|
|
56
|
+
* not itself drive resolution — the loader builds its own URL from
|
|
57
|
+
* `foundation.ref` + the configured base.
|
|
44
58
|
*
|
|
45
59
|
* ─────────────────────────────────────────────────────────────────────────
|
|
46
60
|
* Storage format
|
|
@@ -51,20 +65,20 @@
|
|
|
51
65
|
* runtime reads.
|
|
52
66
|
*/
|
|
53
67
|
|
|
54
|
-
const
|
|
68
|
+
const PUBLIC_FOUNDATIONS_BASE = 'https://uniweb.github.io/unipress/foundations'
|
|
55
69
|
|
|
56
|
-
function
|
|
57
|
-
return `${
|
|
70
|
+
function publicUrl(name, version) {
|
|
71
|
+
return `${PUBLIC_FOUNDATIONS_BASE}/${name}/${version}/foundation.js`
|
|
58
72
|
}
|
|
59
73
|
|
|
60
74
|
const BOOK_FOUNDATION = {
|
|
61
|
-
ref: '@uniweb/book@0.
|
|
62
|
-
source: { url:
|
|
75
|
+
ref: '@uniweb/book@0.2.0',
|
|
76
|
+
source: { url: publicUrl('book', '0.2.0') },
|
|
63
77
|
}
|
|
64
78
|
|
|
65
79
|
const DATA_FOUNDATION = {
|
|
66
80
|
ref: '@uniweb/data@0.1.0',
|
|
67
|
-
source: { url:
|
|
81
|
+
source: { url: publicUrl('data', '0.1.0') },
|
|
68
82
|
}
|
|
69
83
|
|
|
70
84
|
export const FOUNDATIONS = [
|