Files
headroom/frontend/node_modules/enhanced-resolve/lib/util/fs.js
Santhosh Janardhanan de2d83092e feat: Reinitialize frontend with SvelteKit and TypeScript
- Delete old Vite+Svelte frontend
- Initialize new SvelteKit project with TypeScript
- Configure Tailwind CSS v4 + DaisyUI
- Implement JWT authentication with auto-refresh
- Create login page with form validation (Zod)
- Add protected route guards
- Update Docker configuration for single-stage build
- Add E2E tests with Playwright (6/11 passing)
- Fix Svelte 5 reactivity with $state() runes

Known issues:
- 5 E2E tests failing (timing/async issues)
- Token refresh implementation needs debugging
- Validation error display timing
2026-02-17 16:19:59 -05:00

39 lines
932 B
JavaScript

/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Natsu @xiaoxiaojx
*/
"use strict";
/** @typedef {import("../Resolver").FileSystem} FileSystem */
/**
* Read and parse JSON file
* @template T
* @param {FileSystem} fileSystem the file system
* @param {string} jsonFilePath absolute path to JSON file
* @returns {Promise<T>} parsed JSON content
*/
async function readJson(fileSystem, jsonFilePath) {
const { readJson } = fileSystem;
if (readJson) {
return new Promise((resolve, reject) => {
readJson(jsonFilePath, (err, content) => {
if (err) return reject(err);
resolve(/** @type {T} */ (content));
});
});
}
const buf = await new Promise((resolve, reject) => {
fileSystem.readFile(jsonFilePath, (err, data) => {
if (err) return reject(err);
resolve(data);
});
});
return JSON.parse(/** @type {string} */ (buf.toString()));
}
module.exports.readJson = readJson;