vite-plugin-fvtt 0.2.6 → 0.2.8
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 +19 -5
- package/dist/{index.js → index.mjs} +6 -12
- package/package.json +13 -12
- /package/dist/{index.d.ts → index.d.mts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
[0.2.
|
|
3
|
+
## [0.2.8] - 2025-11-15
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Bump @foundryvtt/foundryvtt-cli to version 3.0.2
|
|
8
|
+
|
|
9
|
+
## [0.2.7] - 2025-11-07
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Use `pnpm` as the package manager.
|
|
14
|
+
- Bump @foundryvtt/foundryvtt-cli to version 3.0.1
|
|
15
|
+
|
|
16
|
+
## [0.2.6] - 2025-10-01
|
|
4
17
|
|
|
5
18
|
### Added
|
|
6
19
|
|
|
7
20
|
- CI now tests against Node.js Latest, 20 LTS, and 22 LTS, ensuring Foundry projects compile across
|
|
8
21
|
supported environments.
|
|
9
|
-
- Badges were added to the README
|
|
22
|
+
- Badges were added to the README because they look neat.
|
|
10
23
|
- Dependabot now tracks GitHub Actions, not just NPM dependencies.
|
|
11
24
|
|
|
12
25
|
### Changed
|
|
@@ -17,8 +30,7 @@
|
|
|
17
30
|
regret.)_
|
|
18
31
|
- ESLint configuration significantly tightened:
|
|
19
32
|
- Added sonarjs and unicorn plugins for deeper static analysis.
|
|
20
|
-
- Upgraded TypeScript ESLint rules from recommended to strict
|
|
21
|
-
accuracy.
|
|
33
|
+
- Upgraded TypeScript ESLint rules from recommended to strict.
|
|
22
34
|
- Test suite refactored to reduce duplication and simplify onboarding for future test additions.
|
|
23
35
|
|
|
24
36
|
## [0.2.5] - 2025-09-24
|
|
@@ -124,7 +136,9 @@
|
|
|
124
136
|
|
|
125
137
|
- Initial Release
|
|
126
138
|
|
|
127
|
-
[unreleased]: https://github.com/MatyeusM/vite-plugin-fvtt/compare/v0.2.
|
|
139
|
+
[unreleased]: https://github.com/MatyeusM/vite-plugin-fvtt/compare/v0.2.8...HEAD
|
|
140
|
+
[0.2.8]: https://github.com/MatyeusM/vite-plugin-fvtt/compare/v0.2.7...v0.2.8
|
|
141
|
+
[0.2.7]: https://github.com/MatyeusM/vite-plugin-fvtt/compare/v0.2.6...v0.2.7
|
|
128
142
|
[0.2.6]: https://github.com/MatyeusM/vite-plugin-fvtt/compare/v0.2.5...v0.2.6
|
|
129
143
|
[0.2.5]: https://github.com/MatyeusM/vite-plugin-fvtt/compare/v0.2.4...v0.2.5
|
|
130
144
|
[0.2.4]: https://github.com/MatyeusM/vite-plugin-fvtt/compare/v0.2.3...v0.2.4
|
|
@@ -12,8 +12,7 @@ const context = {};
|
|
|
12
12
|
//#region src/utils/fs-utilities.ts
|
|
13
13
|
async function checkType(p, check) {
|
|
14
14
|
try {
|
|
15
|
-
|
|
16
|
-
return check(stats);
|
|
15
|
+
return check(await fs.stat(p));
|
|
17
16
|
} catch {
|
|
18
17
|
return false;
|
|
19
18
|
}
|
|
@@ -142,8 +141,7 @@ async function loadManifest(config) {
|
|
|
142
141
|
const foundPath = await resolveManifestPath(publicDirectory);
|
|
143
142
|
if (!foundPath) fail(`Could not find a manifest file (system.json or module.json) in project root or ${publicDirectory}/.`);
|
|
144
143
|
try {
|
|
145
|
-
|
|
146
|
-
return validateManifest(rawData, foundPath);
|
|
144
|
+
return validateManifest(await readJson(foundPath), foundPath);
|
|
147
145
|
} catch (error$1) {
|
|
148
146
|
if (error$1 instanceof Error) fail(`Failed to read manifest at ${foundPath}: ${error$1.message}`);
|
|
149
147
|
fail(`Failed to read manifest at ${foundPath}: ${String(error$1)}`);
|
|
@@ -432,8 +430,7 @@ function getFirstMapValueOrWarn(map, contextDescription) {
|
|
|
432
430
|
}
|
|
433
431
|
async function validator() {
|
|
434
432
|
const manifest = context.manifest;
|
|
435
|
-
const
|
|
436
|
-
const base = getFirstMapValueOrWarn(baseLanguageData, "Base language \"en\"");
|
|
433
|
+
const base = getFirstMapValueOrWarn(await loadLanguage("en", true), "Base language \"en\"");
|
|
437
434
|
if (!base) {
|
|
438
435
|
error("Base language \"en\" not found or could not be loaded.");
|
|
439
436
|
return;
|
|
@@ -441,8 +438,7 @@ async function validator() {
|
|
|
441
438
|
const baseFlattened = flattenKeys(base);
|
|
442
439
|
for (const lang of manifest.languages) {
|
|
443
440
|
if (lang.lang === "en") continue;
|
|
444
|
-
const
|
|
445
|
-
const current = getFirstMapValueOrWarn(currentLanguageData, `Language "${lang.lang}"`);
|
|
441
|
+
const current = getFirstMapValueOrWarn(await loadLanguage(lang.lang, true), `Language "${lang.lang}"`);
|
|
446
442
|
if (!current) continue;
|
|
447
443
|
const currentFlattened = flattenKeys(current);
|
|
448
444
|
const missing = Object.keys(baseFlattened).filter((key) => !(key in currentFlattened));
|
|
@@ -515,8 +511,7 @@ function httpMiddlewareHook(server) {
|
|
|
515
511
|
const languages = context.manifest.languages.filter((lang) => localToFoundryVTTUrl(lang.path) === path.posix.normalize(request.url ?? ""));
|
|
516
512
|
if (languages.length === 1) {
|
|
517
513
|
const lang = languages[0].lang;
|
|
518
|
-
const
|
|
519
|
-
const jsonData = transform(language);
|
|
514
|
+
const jsonData = transform(await loadLanguage(lang));
|
|
520
515
|
response.setHeader("Content-Type", "application/json");
|
|
521
516
|
response.end(JSON.stringify(jsonData, void 0, 2));
|
|
522
517
|
return;
|
|
@@ -692,8 +687,7 @@ async function foundryVTTPlugin({ buildPacks = true } = {}) {
|
|
|
692
687
|
getLocalLanguageFiles(language.lang).then((langFiles) => {
|
|
693
688
|
for (const file of langFiles) this.addWatchFile(file);
|
|
694
689
|
});
|
|
695
|
-
const
|
|
696
|
-
const languageData = transform(languageDataRaw);
|
|
690
|
+
const languageData = transform(await loadLanguage(language.lang));
|
|
697
691
|
this.emitFile({
|
|
698
692
|
type: "asset",
|
|
699
693
|
fileName: path.join(language.path),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-fvtt",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"description": "A Vite plugin for module and system development for Foundry VTT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vite",
|
|
@@ -35,25 +35,26 @@
|
|
|
35
35
|
"test": "vitest"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@eslint/js": "^9.
|
|
39
|
-
"@types/node": "^24.
|
|
40
|
-
"eslint": "^9.
|
|
38
|
+
"@eslint/js": "^9.39.1",
|
|
39
|
+
"@types/node": "^24.10.1",
|
|
40
|
+
"eslint": "^9.39.1",
|
|
41
41
|
"eslint-plugin-sonarjs": "^3.0.5",
|
|
42
|
-
"eslint-plugin-unicorn": "^
|
|
42
|
+
"eslint-plugin-unicorn": "^62.0.0",
|
|
43
43
|
"prettier": "^3.6.2",
|
|
44
|
-
"tsdown": "^0.
|
|
45
|
-
"typescript": "^5.9.
|
|
46
|
-
"typescript-eslint": "^8.
|
|
47
|
-
"vite": "
|
|
48
|
-
"vitest": "^
|
|
44
|
+
"tsdown": "^0.16.4",
|
|
45
|
+
"typescript": "^5.9.3",
|
|
46
|
+
"typescript-eslint": "^8.46.4",
|
|
47
|
+
"vite": "^7.2.2",
|
|
48
|
+
"vitest": "^4.0.9"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@foundryvtt/foundryvtt-cli": "^3.0.
|
|
51
|
+
"@foundryvtt/foundryvtt-cli": "^3.0.2",
|
|
52
52
|
"socket.io": "^4.8.1",
|
|
53
53
|
"socket.io-client": "^4.8.1",
|
|
54
54
|
"tinyglobby": "^0.2.15"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"vite": "^7.0.0"
|
|
58
|
-
}
|
|
58
|
+
},
|
|
59
|
+
"packageManager": "pnpm@10.22.0"
|
|
59
60
|
}
|
|
File without changes
|