Skip to content

Commit fe17e18

Browse files
authored
Merge pull request #40 from camrun91/staging
Staging
2 parents 6e40c74 + 972595c commit fe17e18

24 files changed

Lines changed: 6267 additions & 3751 deletions

.eslintignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules/
2+
dist/
3+
coverage/
4+
build/
5+
*.min.js
6+
**/*.min.js
7+
templates/
8+
styles/
9+
10+

.eslintrc.cjs

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/** @type {import('eslint').Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
env: {
5+
browser: true,
6+
es2022: true,
7+
node: true
8+
},
9+
parserOptions: {
10+
ecmaVersion: "latest",
11+
sourceType: "module"
12+
},
13+
extends: [
14+
"eslint:recommended",
15+
"plugin:prettier/recommended"
16+
],
17+
plugins: [
18+
"prettier"
19+
],
20+
// Foundry VTT globals (v13) used throughout the module
21+
globals: {
22+
foundry: "readonly",
23+
game: "readonly",
24+
ui: "readonly",
25+
CONFIG: "readonly",
26+
Hooks: "readonly",
27+
canvas: "readonly",
28+
Actor: "readonly",
29+
Item: "readonly",
30+
Scene: "readonly",
31+
fromUuid: "readonly",
32+
CONST: "readonly",
33+
// Additional Foundry/core globals referenced in legacy areas
34+
JournalEntry: "readonly",
35+
Folder: "readonly",
36+
DocumentSheetConfig: "readonly",
37+
jQuery: "readonly"
38+
},
39+
rules: {
40+
"prettier/prettier": "warn",
41+
"no-unused-vars": ["warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
42+
// Allow empty catch blocks (common in Foundry-safe guards) but warn elsewhere
43+
"no-empty": ["warn", { "allowEmptyCatch": true }],
44+
// Many code paths intentionally use constant conditions for guards; keep as warn
45+
"no-constant-condition": ["warn", { "checkLoops": false }],
46+
// Strings built for regexes sometimes intentionally escape chars; treat as warn
47+
"no-useless-escape": "warn"
48+
},
49+
env: {
50+
browser: true,
51+
es2022: true,
52+
node: true,
53+
jquery: true
54+
},
55+
ignorePatterns: [
56+
"node_modules/",
57+
"dist/",
58+
"coverage/"
59+
]
60+
};
61+
62+

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ All notable changes to the Archivist Sync module will be documented in this file
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
### Fixed
11+
- Restored compatibility with PopOut! by cloning sidebar base options before overriding defaults so Combat Tracker and other stock tabs keep their pop-out buttons when realtime sync is enabled.
12+
13+
### Changed
14+
- Recap custom sheet now displays the session date as MM/DD/YYYY.
15+
- After importing Recaps via the Sync dialog, Recaps in the Recaps folder are normalized to sort by the `sessionDate` flag ascending (oldest → newest); undated Recaps are placed at the end.
16+
17+
## [1.3.9] - 2025-12-06
18+
19+
### Fixed
20+
- Recap “lock” (save) action could wipe the summary in Foundry and on the Archivist API if the editor selector failed to resolve; editor detection has been made robust for the Recap layout, local page updates only occur when content is actually read, and the API summary field is only included when content is present.
21+
822
## [1.3.7] - 2025-12-05
923

1024
### Fixed

module.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"email": "cameron.b.llewellyn@gmail.com"
99
}
1010
],
11-
"version": "1.3.7",
11+
"version": "1.3.9",
1212
"compatibility": {
1313
"minimum": "13.341",
1414
"verified": "13.346"

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "archivist-sync",
3-
"version": "1.3.7",
3+
"version": "1.3.9",
44
"description": "A simple Foundry VTT module for fetching world data from an API endpoint using an API key.",
55
"type": "module",
66
"scripts": {
@@ -29,4 +29,4 @@
2929
"eslint-plugin-prettier": "^5.1.3",
3030
"prettier": "^3.2.5"
3131
}
32-
}
32+
}

scripts/archivist-sync.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,14 +1196,30 @@ function installRealtimeSyncListeners() {
11961196
const html = Utils.extractPageHtml(page);
11971197
const payload = { description: Utils.toMarkdownIfHtml?.(html) || html };
11981198

1199-
if (sheetType === 'pc' || sheetType === 'npc' || sheetType === 'character') {
1200-
res = await archivistApi.updateCharacter(apiKey, flags.archivistId, payload);
1199+
if (
1200+
sheetType === 'pc' ||
1201+
sheetType === 'npc' ||
1202+
sheetType === 'character'
1203+
) {
1204+
res = await archivistApi.updateCharacter(
1205+
apiKey,
1206+
flags.archivistId,
1207+
payload
1208+
);
12011209
} else if (sheetType === 'item') {
12021210
res = await archivistApi.updateItem(apiKey, flags.archivistId, payload);
12031211
} else if (sheetType === 'location') {
1204-
res = await archivistApi.updateLocation(apiKey, flags.archivistId, payload);
1212+
res = await archivistApi.updateLocation(
1213+
apiKey,
1214+
flags.archivistId,
1215+
payload
1216+
);
12051217
} else if (sheetType === 'faction') {
1206-
res = await archivistApi.updateFaction(apiKey, flags.archivistId, payload);
1218+
res = await archivistApi.updateFaction(
1219+
apiKey,
1220+
flags.archivistId,
1221+
payload
1222+
);
12071223
} else if (sheetType === 'recap') {
12081224
await archivistApi.updateSession(apiKey, flags.archivistId, {
12091225
title: parent?.name || page.name,

0 commit comments

Comments
 (0)