vite-plugin-fvtt 0.2.6 → 0.2.7

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 CHANGED
@@ -1,12 +1,19 @@
1
1
  # Changelog
2
2
 
3
- [0.2.6] - 2025-10-01
3
+ ## [0.2.7] - 2025-11-07
4
+
5
+ ### Changed
6
+
7
+ - Use `pnpm` as the package manager.
8
+ - Bump @foundryvtt/foundryvtt-cli to version 3.0.1
9
+
10
+ ## [0.2.6] - 2025-10-01
4
11
 
5
12
  ### Added
6
13
 
7
14
  - CI now tests against Node.js Latest, 20 LTS, and 22 LTS, ensuring Foundry projects compile across
8
15
  supported environments.
9
- - Badges were added to the README for improved project visibility.
16
+ - Badges were added to the README because they look neat.
10
17
  - Dependabot now tracks GitHub Actions, not just NPM dependencies.
11
18
 
12
19
  ### Changed
@@ -17,8 +24,7 @@
17
24
  regret.)_
18
25
  - ESLint configuration significantly tightened:
19
26
  - Added sonarjs and unicorn plugins for deeper static analysis.
20
- - Upgraded TypeScript ESLint rules from recommended to strict, increasing development signal
21
- accuracy.
27
+ - Upgraded TypeScript ESLint rules from recommended to strict.
22
28
  - Test suite refactored to reduce duplication and simplify onboarding for future test additions.
23
29
 
24
30
  ## [0.2.5] - 2025-09-24
@@ -124,7 +130,8 @@
124
130
 
125
131
  - Initial Release
126
132
 
127
- [unreleased]: https://github.com/MatyeusM/vite-plugin-fvtt/compare/v0.2.6...HEAD
133
+ [unreleased]: https://github.com/MatyeusM/vite-plugin-fvtt/compare/v0.2.7...HEAD
134
+ [0.2.7]: https://github.com/MatyeusM/vite-plugin-fvtt/compare/v0.2.6...v0.2.7
128
135
  [0.2.6]: https://github.com/MatyeusM/vite-plugin-fvtt/compare/v0.2.5...v0.2.6
129
136
  [0.2.5]: https://github.com/MatyeusM/vite-plugin-fvtt/compare/v0.2.4...v0.2.5
130
137
  [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
- const stats = await fs.stat(p);
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
- const rawData = await readJson(foundPath);
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 baseLanguageData = await loadLanguage("en", true);
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 currentLanguageData = await loadLanguage(lang.lang, true);
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 language = await loadLanguage(lang);
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 languageDataRaw = await loadLanguage(language.lang);
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.6",
3
+ "version": "0.2.7",
4
4
  "description": "A Vite plugin for module and system development for Foundry VTT",
5
5
  "keywords": [
6
6
  "vite",
@@ -39,13 +39,13 @@
39
39
  "@types/node": "^24.3.0",
40
40
  "eslint": "^9.34.0",
41
41
  "eslint-plugin-sonarjs": "^3.0.5",
42
- "eslint-plugin-unicorn": "^61.0.2",
42
+ "eslint-plugin-unicorn": "^62.0.0",
43
43
  "prettier": "^3.6.2",
44
- "tsdown": "^0.15.1",
44
+ "tsdown": "^0.16.0",
45
45
  "typescript": "^5.9.2",
46
46
  "typescript-eslint": "^8.41.0",
47
47
  "vite": "*",
48
- "vitest": "^3.2.4"
48
+ "vitest": "^4.0.3"
49
49
  },
50
50
  "dependencies": {
51
51
  "@foundryvtt/foundryvtt-cli": "^3.0.0",
@@ -55,5 +55,6 @@
55
55
  },
56
56
  "peerDependencies": {
57
57
  "vite": "^7.0.0"
58
- }
58
+ },
59
+ "packageManager": "pnpm@10.17.1"
59
60
  }
File without changes