fix(import): make effects and figure/clothing import work on deployment
- resolveGamedataFile: detect Windows drive/UNC paths explicitly instead of path.win32.isAbsolute (which is true for any /-prefixed path on Linux), so /nitro-assets URLs are no longer returned verbatim; add deployment gamedata root fallback (/var/www/Gamedata/config) and keep public/Gamedata/config. - effect/figure import dirs now resolve via site settings then the gamedata root bundled dir, instead of hardcoded public paths. - effect list falls back to the local EffectMap when the official habbo.com endpoint is unreachable, keeping the admin import page usable. - update staff smoke contract for db:migrate and instant=false (Cache Components migration).
This commit is contained in:
1 parent
694a24c791
commit
dd708a64fb
10 files changed
+172
-56
No files matched your search
@@ -61,7 +61,7 @@ describe("staff smoke contract", () => {
|
||||
expect(pkg).not.toContain("prisma:generate");
|
||||
expect(pkg).toContain('"db:generate": "drizzle-kit generate"');
|
||||
expect(pkg).toContain('"db:studio": "drizzle-kit studio"');
|
||||
expect(pkg).toContain('"db:introspect": "drizzle-kit introspect"');
|
||||
expect(pkg).toContain('"db:migrate": "drizzle-kit migrate"');
|
||||
expect(readFileSync("drizzle.config.ts", "utf8")).toContain(
|
||||
"./drizzle/drafts",
|
||||
);
|
||||
@@ -90,8 +90,10 @@ describe("staff smoke contract", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("keeps force-dynamic only on admin/mod layouts", () => {
|
||||
const hits: string[] = [];
|
||||
it("opts admin/mod out of static caching via instant=false", () => {
|
||||
// The Cache Components migration replaced `force-dynamic` with
|
||||
// `export const instant = false` — the legacy export must not survive.
|
||||
let legacyHits = 0;
|
||||
function walk(dir: string) {
|
||||
for (const name of readdirSync(dir)) {
|
||||
const p = join(dir, name);
|
||||
@@ -101,17 +103,22 @@ describe("staff smoke contract", () => {
|
||||
if (
|
||||
/export\s+const\s+dynamic\s*=\s*["']force-dynamic["']/.test(src)
|
||||
) {
|
||||
hits.push(p.replace(/\\/g, "/"));
|
||||
legacyHits++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
walk("src/app/admin");
|
||||
walk("src/app/mod");
|
||||
expect(hits.sort()).toEqual([
|
||||
"src/app/admin/layout.tsx",
|
||||
"src/app/mod/layout.tsx",
|
||||
]);
|
||||
expect(legacyHits).toBe(0);
|
||||
|
||||
// Both staff layouts opt out of Cache Components (was force-dynamic).
|
||||
expect(readFileSync("src/app/admin/layout.tsx", "utf8")).toContain(
|
||||
"export const instant = false",
|
||||
);
|
||||
expect(readFileSync("src/app/mod/layout.tsx", "utf8")).toContain(
|
||||
"export const instant = false",
|
||||
);
|
||||
});
|
||||
|
||||
it("caches analytics via redisCache", () => {
|
||||
|
||||
Reference in new issue
Block a user