pf2e-primer 0.1.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/LICENSE +31 -0
- package/README.md +106 -0
- package/bin/cli.mjs +86 -0
- package/data/reference.generated.js +6 -0
- package/dist/icon.svg +6 -0
- package/dist/index.html +2275 -0
- package/dist/manifest.webmanifest +13 -0
- package/dist/sw.js +60 -0
- package/notice.md +124 -0
- package/package.json +47 -0
- package/src/content.js +547 -0
- package/src/engine.js +1210 -0
- package/src/icon.svg +6 -0
- package/src/manifest.webmanifest +13 -0
- package/src/styles.css +445 -0
- package/src/sw.js +60 -0
- package/src/template.html +67 -0
- package/tools/build.py +60 -0
- package/tools/build_reference.py +249 -0
- package/tools/test.mjs +277 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "PF2e Primer",
|
|
3
|
+
"short_name": "PF2e Primer",
|
|
4
|
+
"description": "A hands-on introduction to Pathfinder 2e: the three pillars of play, with live demos of every core rule.",
|
|
5
|
+
"start_url": ".",
|
|
6
|
+
"scope": ".",
|
|
7
|
+
"display": "standalone",
|
|
8
|
+
"background_color": "#14161b",
|
|
9
|
+
"theme_color": "#14161b",
|
|
10
|
+
"icons": [
|
|
11
|
+
{ "src": "icon.svg", "sizes": "any", "type": "image/svg+xml", "purpose": "any maskable" }
|
|
12
|
+
]
|
|
13
|
+
}
|
package/dist/sw.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* Service worker — offline support for the hosted (GitHub Pages) PWA.
|
|
2
|
+
Network-first for the app page (fresh when online, cached when offline),
|
|
3
|
+
cache-first for static assets. Cache version is stamped at build time so a
|
|
4
|
+
redeploy refreshes clients automatically. */
|
|
5
|
+
const CACHE = "pf2e-primer-20260914005112";
|
|
6
|
+
/* Every cache this app has ever made starts with PREFIX. The sweep below is
|
|
7
|
+
scoped to it on purpose: the three PF2e tools share an origin when they are
|
|
8
|
+
served from one host (GitHub Pages does it, and so does the toolbox), and an
|
|
9
|
+
unscoped sweep would delete the other two apps' offline caches every time
|
|
10
|
+
this one activated. */
|
|
11
|
+
const PREFIX = "pf2e-primer-";
|
|
12
|
+
const SHELL = ["./", "./index.html", "./manifest.webmanifest", "./icon.svg"];
|
|
13
|
+
|
|
14
|
+
self.addEventListener("install", (e) => {
|
|
15
|
+
e.waitUntil(
|
|
16
|
+
caches.open(CACHE)
|
|
17
|
+
.then((c) => c.addAll(SHELL).catch(() => {}))
|
|
18
|
+
.then(() => self.skipWaiting())
|
|
19
|
+
);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
self.addEventListener("activate", (e) => {
|
|
23
|
+
e.waitUntil(
|
|
24
|
+
caches.keys()
|
|
25
|
+
.then((keys) => Promise.all(keys.filter((k) => k.startsWith(PREFIX) && k !== CACHE)
|
|
26
|
+
.map((k) => caches.delete(k))))
|
|
27
|
+
.then(() => self.clients.claim())
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
self.addEventListener("fetch", (e) => {
|
|
32
|
+
const req = e.request;
|
|
33
|
+
if (req.method !== "GET") return;
|
|
34
|
+
|
|
35
|
+
if (req.mode === "navigate") {
|
|
36
|
+
e.respondWith(
|
|
37
|
+
fetch(req)
|
|
38
|
+
.then((res) => {
|
|
39
|
+
const copy = res.clone();
|
|
40
|
+
caches.open(CACHE).then((c) => c.put("./index.html", copy));
|
|
41
|
+
return res;
|
|
42
|
+
})
|
|
43
|
+
.catch(() => caches.match("./index.html").then((r) => r || caches.match("./")))
|
|
44
|
+
);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
e.respondWith(
|
|
49
|
+
caches.match(req).then((r) =>
|
|
50
|
+
r ||
|
|
51
|
+
fetch(req).then((res) => {
|
|
52
|
+
if (res.ok && new URL(req.url).origin === self.location.origin) {
|
|
53
|
+
const copy = res.clone();
|
|
54
|
+
caches.open(CACHE).then((c) => c.put(req, copy));
|
|
55
|
+
}
|
|
56
|
+
return res;
|
|
57
|
+
}).catch(() => r)
|
|
58
|
+
)
|
|
59
|
+
);
|
|
60
|
+
});
|
package/notice.md
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Third-Party Notices & Attribution
|
|
2
|
+
|
|
3
|
+
**pf2e-primer**
|
|
4
|
+
|
|
5
|
+
This file records the licensing of the two distinct kinds of material in this
|
|
6
|
+
package: the application **code**, and the Pathfinder **rules text** it bundles
|
|
7
|
+
(condition and action descriptions). They are covered by different licenses and
|
|
8
|
+
the distinction below is intentional.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 1. Application code
|
|
13
|
+
|
|
14
|
+
All original source code in this package is released under the **MIT License**.
|
|
15
|
+
See the [`LICENSE`](./LICENSE) file for the full text.
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
Copyright (c) 2026 Whyte Erminae
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The MIT License covers only the code authored for this project. It does **not**
|
|
22
|
+
cover the Pathfinder game content described in section 2, which carries its own
|
|
23
|
+
license and notice. The two pregenerated characters and the teaching NPC shown by this app are
|
|
24
|
+
original fiction, not Paizo content; every number on them is derived arithmetic.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 2. Pathfinder rules content (ORC License)
|
|
29
|
+
|
|
30
|
+
The bundled reference data consists of the **rules expressions of Pathfinder
|
|
31
|
+
Second Edition conditions and actions** — their names and functional effect text.
|
|
32
|
+
Under the Open RPG Creative License this is **Licensed Material** (the copyrighted
|
|
33
|
+
expression of game mechanics), used here under that license. It originates with
|
|
34
|
+
**Paizo Inc.** and is derived from the open-source [Foundry VTT `pf2e`
|
|
35
|
+
system](https://github.com/foundryvtt/pf2e) data.
|
|
36
|
+
|
|
37
|
+
### ORC Notice
|
|
38
|
+
|
|
39
|
+
This product is licensed under the ORC License located at the Library of Congress
|
|
40
|
+
at TX 9-307-067 and available online at various locations including
|
|
41
|
+
paizo.com/orclicense, azoralaw.com/orclicense, and others. All warranties are
|
|
42
|
+
disclaimed as set forth therein.
|
|
43
|
+
|
|
44
|
+
### Attribution
|
|
45
|
+
|
|
46
|
+
This product is based on the following Licensed Material:
|
|
47
|
+
|
|
48
|
+
Pathfinder Player Core © 2023 Paizo Inc., Designed by Logan Bonner, Jason
|
|
49
|
+
Bulmahn, Stephen Radney-MacFarland, and Mark Seifter.
|
|
50
|
+
|
|
51
|
+
Pathfinder Player Core 2 © 2024 Paizo Inc.
|
|
52
|
+
|
|
53
|
+
Pathfinder GM Core © 2023 Paizo Inc., Designed by Logan Bonner and Mark Seifter.
|
|
54
|
+
|
|
55
|
+
Pathfinder Treasure Vault (Remastered) © 2025 Paizo Inc.
|
|
56
|
+
|
|
57
|
+
Pathfinder Dark Archive (Remastered) © 2025 Paizo Inc.
|
|
58
|
+
|
|
59
|
+
> NOTE — The precise list of source books is generated into `GENERATED_REF_META`
|
|
60
|
+
> in `data/reference.generated.js` from the licenses recorded in the Foundry pf2e
|
|
61
|
+
> data. Re-sync this section whenever the reference data is rebuilt
|
|
62
|
+
> (`npm run build:ref`).
|
|
63
|
+
|
|
64
|
+
### Reserved Material
|
|
65
|
+
|
|
66
|
+
Reserved Material elements are excluded from this product. To avoid confusion,
|
|
67
|
+
such items include all trademarks, registered trademarks, and proper nouns,
|
|
68
|
+
artwork, dialogue, organizations, plots, and storylines. Where a rule's mechanics
|
|
69
|
+
are included, any such Reserved Material has been omitted or genericized.
|
|
70
|
+
|
|
71
|
+
### Crediting this work downstream
|
|
72
|
+
|
|
73
|
+
pf2e-primer © 2026 Whyte Erminae.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## 3. Pathfinder rules content (OGL)
|
|
78
|
+
|
|
79
|
+
Three of the bundled action descriptions originate in pre-Remaster books that
|
|
80
|
+
were published under the **Open Game License v1.0a** rather than the ORC License
|
|
81
|
+
(2 from *Pathfinder Secrets of Magic*, 1 from *Pathfinder Gamemastery Guide*).
|
|
82
|
+
They are included here as Open Game Content under that license.
|
|
83
|
+
|
|
84
|
+
### OGL Section 15
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
Open Game License v 1.0a © 2000, Wizards of the Coast, Inc.
|
|
88
|
+
|
|
89
|
+
System Reference Document © 2000, Wizards of the Coast, Inc.; Authors Jonathan
|
|
90
|
+
Tweet, Monte Cook, and Skip Williams, based on material by E. Gary Gygax and
|
|
91
|
+
Dave Arneson.
|
|
92
|
+
|
|
93
|
+
Pathfinder Secrets of Magic © 2021, Paizo Inc.; Authors: Amirali Attar Olyaee,
|
|
94
|
+
Alexander Augunas, Kate Baker, James Case, Jeff Collins, Vanessa Hoskins,
|
|
95
|
+
James Jacobs, Jason Keeley, Lyz Liddell, Ron Lundeen, Patchen Mortimer, Stephen
|
|
96
|
+
Radney-MacFarland, David N. Ross, Michael Sayre, Owen K.C. Stephens, Mark
|
|
97
|
+
Seifter, Ashton Sperry, Andrew White.
|
|
98
|
+
|
|
99
|
+
Pathfinder Gamemastery Guide © 2020, Paizo Inc.; Authors: Alexander Augunas,
|
|
100
|
+
Jesse Benner, John Bennett, Logan Bonner, Clinton J. Boomer, Jason Bulmahn,
|
|
101
|
+
James Case, Paris Crenshaw, Jesse Decker, Robert N. Emerson, Eleanor Ferron,
|
|
102
|
+
Jaym Gates, Matthew Goetz, T.H. Gulliver, Kev Hamilton, Sasha Laranoa Harving,
|
|
103
|
+
BJ Hensley, Vanessa Hoskins, Brian R. James, Jason LeMaitre, Lyz Liddell, Luis
|
|
104
|
+
Loza, Ron Lundeen, Colm Lundberg, Stephen Radney-MacFarland, Jessica Redekop,
|
|
105
|
+
Patrick Renie, Mikhail Rekun, Alistair Rigg, David N. Ross, David Schwartz,
|
|
106
|
+
Michael Sayre, Amber Stewart, Christina Stiles, Landon Winkler, Linda Zayas-Palmer.
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
> NOTE — Regenerate this list from `GENERATED_REF_META` whenever the reference
|
|
110
|
+
> data is rebuilt (`npm run build:ref`); the licence recorded per entry decides
|
|
111
|
+
> which section it belongs in.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## 4. Compatibility / trademark notice
|
|
116
|
+
|
|
117
|
+
Pathfinder and all associated marks and logos are trademarks of Paizo Inc.
|
|
118
|
+
This package is an independent work, is **not** published, endorsed, sponsored,
|
|
119
|
+
or affiliated with Paizo Inc., and no such association is implied. Any reference
|
|
120
|
+
to Pathfinder is made under nominative fair use solely to identify the game
|
|
121
|
+
system with which this material is compatible.
|
|
122
|
+
|
|
123
|
+
The explanatory prose, the two pregenerated characters, the teaching NPC and all
|
|
124
|
+
the interactive demos are original work by the author of this package.
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pf2e-primer",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A hands-on introduction to Pathfinder 2e for players who already know tabletop RPGs — the three pillars of play, with live demos (single self-contained HTML).",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"pathfinder",
|
|
7
|
+
"pf2e",
|
|
8
|
+
"beginner",
|
|
9
|
+
"primer",
|
|
10
|
+
"teaching",
|
|
11
|
+
"ttrpg"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://thewhytewolf.github.io/pf2eprimer/",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/TheWhyteWolf/pf2eprimer.git"
|
|
17
|
+
},
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/TheWhyteWolf/pf2eprimer/issues"
|
|
20
|
+
},
|
|
21
|
+
"author": "Whyte",
|
|
22
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
23
|
+
"type": "module",
|
|
24
|
+
"bin": {
|
|
25
|
+
"pf2e-primer": "bin/cli.mjs"
|
|
26
|
+
},
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=18"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"bin/",
|
|
32
|
+
"src/",
|
|
33
|
+
"tools/",
|
|
34
|
+
"data/",
|
|
35
|
+
"dist/",
|
|
36
|
+
"notice.md"
|
|
37
|
+
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "python3 tools/build.py",
|
|
40
|
+
"build:ref": "python3 tools/build_reference.py --src \"$PF2E_DATA/packs/pf2e\" --out data/reference.generated.js",
|
|
41
|
+
"test": "node tools/test.mjs",
|
|
42
|
+
"check": "npm run build && npm test"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"jsdom": "^24.0.0"
|
|
46
|
+
}
|
|
47
|
+
}
|