Vauxs
Vauxs
TTyphonJS
Created by TyphonJS (Michael) on 10/26/2024 in #typhonjs-runtime
TRL `0.2.0` Release
Make a const entryPoint or such
125 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/26/2024 in #typhonjs-runtime
TRL `0.2.0` Release
I guess worth noting for future @TyphonJS (Michael)
125 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/26/2024 in #typhonjs-runtime
TRL `0.2.0` Release
Its a redirect to index.js at root
125 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/26/2024 in #typhonjs-runtime
TRL `0.2.0` Release
No description
125 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/26/2024 in #typhonjs-runtime
TRL `0.2.0` Release
125 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/26/2024 in #typhonjs-runtime
TRL `0.2.0` Release
otherwise add an index and change it to just index.js
125 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/26/2024 in #typhonjs-runtime
TRL `0.2.0` Release
Change your entry to not be with ./, that's probably the thing breaking it
125 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/26/2024 in #typhonjs-runtime
TRL `0.2.0` Release
Yeah, I can see that
125 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/26/2024 in #typhonjs-runtime
TRL `0.2.0` Release
No description
125 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/26/2024 in #typhonjs-runtime
TRL `0.2.0` Release
No description
125 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/26/2024 in #typhonjs-runtime
TRL `0.2.0` Release
Otherwise you can also just add an index.js directly at src and import it there
125 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/26/2024 in #typhonjs-runtime
TRL `0.2.0` Release
Where does the module begin? the ckl-advanced-templates.pf1.js? @david aka claudekennilol
125 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/26/2024 in #typhonjs-runtime
TRL `0.2.0` Release
you need to change your input, vite just doesn't see any code here
125 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/26/2024 in #typhonjs-runtime
TRL `0.2.0` Release
oh, you dont have an index.js in your src
125 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/26/2024 in #typhonjs-runtime
TRL `0.2.0` Release
after your mod id
125 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/26/2024 in #typhonjs-runtime
TRL `0.2.0` Release
Initially made by pf2e system devs and later slightly improved by myself, this lets you do a quick symlink between the module and Foundry
// ./scripts/link.mjs
// ran using npm run link (node scripts/link.mjs)
import { lstatSync, rmSync, symlinkSync, unlinkSync } from "node:fs";
import { resolve } from "node:path";
import process from "node:process";
import prompts from "prompts";
import moduleJSON from "../module.json" with { type: "json" };

const windowsInstructions = process.platform === "win32" ? " Start with a drive letter (\"C:\\\")." : "";
const dataPath = (
await prompts({
type: "text",
name: "value",
format: v => v.replace(/\W*$/, "").trim(),
message: `Enter the full path to your Foundry data folder.${windowsInstructions}`,
})
).value;
if (!dataPath || !/\bData$/.test(dataPath)) {
console.error(`"${dataPath}" does not look like a Foundry data folder.`);
process.exit(1);
}
const dataPathStats = lstatSync(dataPath, { throwIfNoEntry: false });
if (!dataPathStats?.isDirectory()) {
console.error(`No folder found at "${dataPath}"`);
process.exit(1);
}

const symlinkPath = resolve(dataPath, "modules", moduleJSON.id);
const symlinkStats = lstatSync(symlinkPath, { throwIfNoEntry: false });
if (symlinkStats) {
const atPath = symlinkStats.isDirectory() ? "folder" : symlinkStats.isSymbolicLink() ? "symlink" : "file";
const proceed = (
await prompts({
type: "confirm",
name: "value",
initial: false,
message: `A "${moduleJSON.id}" ${atPath} already exists in the "modules" subfolder. Replace with new symlink?`,
})
).value;
if (!proceed) {
console.log("Aborting.");
process.exit();
}
}

try {
if (symlinkStats?.isDirectory()) {
rmSync(symlinkPath, { recursive: true, force: true });
} else if (symlinkStats) {
unlinkSync(symlinkPath);
}
symlinkSync(resolve(process.cwd()), symlinkPath);
} catch (error) {
if (error instanceof Error) {
console.error(`An error was encountered trying to create a symlink: ${error.message}`);
process.exit(1);
}
}

console.log(`Symlink successfully created at "${symlinkPath}"!`);
// ./scripts/link.mjs
// ran using npm run link (node scripts/link.mjs)
import { lstatSync, rmSync, symlinkSync, unlinkSync } from "node:fs";
import { resolve } from "node:path";
import process from "node:process";
import prompts from "prompts";
import moduleJSON from "../module.json" with { type: "json" };

const windowsInstructions = process.platform === "win32" ? " Start with a drive letter (\"C:\\\")." : "";
const dataPath = (
await prompts({
type: "text",
name: "value",
format: v => v.replace(/\W*$/, "").trim(),
message: `Enter the full path to your Foundry data folder.${windowsInstructions}`,
})
).value;
if (!dataPath || !/\bData$/.test(dataPath)) {
console.error(`"${dataPath}" does not look like a Foundry data folder.`);
process.exit(1);
}
const dataPathStats = lstatSync(dataPath, { throwIfNoEntry: false });
if (!dataPathStats?.isDirectory()) {
console.error(`No folder found at "${dataPath}"`);
process.exit(1);
}

const symlinkPath = resolve(dataPath, "modules", moduleJSON.id);
const symlinkStats = lstatSync(symlinkPath, { throwIfNoEntry: false });
if (symlinkStats) {
const atPath = symlinkStats.isDirectory() ? "folder" : symlinkStats.isSymbolicLink() ? "symlink" : "file";
const proceed = (
await prompts({
type: "confirm",
name: "value",
initial: false,
message: `A "${moduleJSON.id}" ${atPath} already exists in the "modules" subfolder. Replace with new symlink?`,
})
).value;
if (!proceed) {
console.log("Aborting.");
process.exit();
}
}

try {
if (symlinkStats?.isDirectory()) {
rmSync(symlinkPath, { recursive: true, force: true });
} else if (symlinkStats) {
unlinkSync(symlinkPath);
}
symlinkSync(resolve(process.cwd()), symlinkPath);
} catch (error) {
if (error instanceof Error) {
console.error(`An error was encountered trying to create a symlink: ${error.message}`);
process.exit(1);
}
}

console.log(`Symlink successfully created at "${symlinkPath}"!`);
125 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/26/2024 in #typhonjs-runtime
TRL `0.2.0` Release
Right, I should probably PR another thing to the template however
125 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/26/2024 in #typhonjs-runtime
TRL `0.2.0` Release
(And it cannot)
125 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/26/2024 in #typhonjs-runtime
TRL `0.2.0` Release
It does not
125 replies
TTyphonJS
Created by TyphonJS (Michael) on 10/26/2024 in #typhonjs-runtime
TRL `0.2.0` Release
And of course the module has to be in the module folder :indeed:
125 replies