create-lt-adventure 0.0.16 → 0.1.3
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/README.md +85 -85
- package/addons/github-workflow/addon.json +5 -5
- package/addons/github-workflow/main.yml +96 -48
- package/addons/github-workflow/{setup.ts → setup.mjs} +115 -112
- package/addons/sf2e-pf2e-redirects/addon.json +5 -0
- package/addons/sf2e-pf2e-redirects/setup.mjs +119 -0
- package/dist/bin.js +223 -84
- package/dist/bin.js.map +1 -1
- package/dist/migrate.d.ts +2 -0
- package/dist/migrate.d.ts.map +1 -0
- package/dist/migrate.js +169 -0
- package/dist/migrate.js.map +1 -0
- package/dist/options.d.ts +5 -2
- package/dist/options.d.ts.map +1 -1
- package/dist/options.js +14 -5
- package/dist/options.js.map +1 -1
- package/package.json +68 -66
- package/templates/vite/.env.example +1 -1
- package/templates/vite/CHANGELOG +1 -0
- package/templates/vite/gitignore +37 -37
- package/templates/vite/module.json +37 -36
- package/templates/vite/package.json +3 -2
- package/templates/vite/scripts/extractPacks.mjs +54 -49
- package/templates/vite/scripts/jsonReplacer.mjs +11 -0
- package/templates/vite/scripts/onCreate.mjs +41 -13
- package/templates/vite/scripts/symlink.mjs +78 -78
- package/templates/vite/src/adventureSheet/index.js +497 -497
- package/templates/vite/src/hooks.ts +22 -0
- package/templates/vite/src/index.js +4 -4
- package/templates/vite/src/lib/utils.ts +1 -0
- package/templates/vite/src/misc/prosemirror.js +46 -46
- package/templates/vite/src/module.css +306 -306
- package/templates/vite/src/types.d.ts +7 -7
- package/templates/vite/tsconfig.json +33 -29
- package/templates/vite/vite.config.ts +129 -128
- package/templates/vite/bun.lock +0 -802
package/dist/migrate.js
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import * as p from "@clack/prompts";
|
|
2
|
+
import { mkdir, readdir, rm, readFile, writeFile, stat, copyFile, cp } from "fs/promises";
|
|
3
|
+
import { existsSync, readdirSync, statSync } from "fs";
|
|
4
|
+
import { tmpdir } from "os";
|
|
5
|
+
import { join } from "path";
|
|
6
|
+
import AdmZip from "adm-zip";
|
|
7
|
+
import { extractPack } from "@foundryvtt/foundryvtt-cli";
|
|
8
|
+
import { yellow, cyan } from "kolorist";
|
|
9
|
+
function isUrl(input) {
|
|
10
|
+
return input.startsWith("http://") || input.startsWith("https://");
|
|
11
|
+
}
|
|
12
|
+
async function readModuleJson(source) {
|
|
13
|
+
if (isUrl(source)) {
|
|
14
|
+
const spinner = p.spinner();
|
|
15
|
+
spinner.start(`Fetching module.json from ${cyan(source)}...`);
|
|
16
|
+
const response = await fetch(source);
|
|
17
|
+
if (!response.ok) {
|
|
18
|
+
throw new Error(`Failed to fetch module.json: ${response.status} ${response.statusText}`);
|
|
19
|
+
}
|
|
20
|
+
const text = await response.text();
|
|
21
|
+
const parsed = JSON.parse(text);
|
|
22
|
+
spinner.stop(`module.json fetched successfully`);
|
|
23
|
+
return parsed;
|
|
24
|
+
}
|
|
25
|
+
if (!existsSync(source)) {
|
|
26
|
+
throw new Error(`Path does not exist: ${source}`);
|
|
27
|
+
}
|
|
28
|
+
const sourceStat = await stat(source);
|
|
29
|
+
const jsonPath = sourceStat.isDirectory() ? join(source, "module.json") : source;
|
|
30
|
+
if (!existsSync(jsonPath)) {
|
|
31
|
+
throw new Error(`module.json not found at ${source}`);
|
|
32
|
+
}
|
|
33
|
+
const content = await readFile(jsonPath, "utf8");
|
|
34
|
+
return JSON.parse(content);
|
|
35
|
+
}
|
|
36
|
+
async function downloadZipBuffer(url) {
|
|
37
|
+
const response = await fetch(url);
|
|
38
|
+
if (!response.ok) {
|
|
39
|
+
throw new Error(`Failed to download zip: ${response.status} ${response.statusText}`);
|
|
40
|
+
}
|
|
41
|
+
return Buffer.from(await response.arrayBuffer());
|
|
42
|
+
}
|
|
43
|
+
function findModuleRoot(extractDir) {
|
|
44
|
+
const entries = readdirSync(extractDir);
|
|
45
|
+
const moduleJsonCandidates = entries.filter((e) => e === "module.json");
|
|
46
|
+
if (moduleJsonCandidates.length > 0) {
|
|
47
|
+
return extractDir;
|
|
48
|
+
}
|
|
49
|
+
for (const entry of entries) {
|
|
50
|
+
const entryPath = join(extractDir, entry);
|
|
51
|
+
try {
|
|
52
|
+
const entryStat = statSync(entryPath);
|
|
53
|
+
if (entryStat.isDirectory()) {
|
|
54
|
+
const subEntries = readdirSync(entryPath);
|
|
55
|
+
if (subEntries.includes("module.json")) {
|
|
56
|
+
return entryPath;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
// skip
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return extractDir;
|
|
65
|
+
}
|
|
66
|
+
async function isLevelDBFolder(folderPath) {
|
|
67
|
+
if (!existsSync(folderPath))
|
|
68
|
+
return false;
|
|
69
|
+
const statResult = await stat(folderPath);
|
|
70
|
+
if (!statResult.isDirectory())
|
|
71
|
+
return false;
|
|
72
|
+
const entries = await readdir(folderPath);
|
|
73
|
+
const levelDBMarkers = ["CURRENT", "LOCK", "MANIFEST-000001", "MANIFEST-000002"];
|
|
74
|
+
return entries.some((e) => levelDBMarkers.some((m) => e === m || e.endsWith(".ldb") || e.endsWith(".log")));
|
|
75
|
+
}
|
|
76
|
+
export async function migrateFrom(source, modulePath) {
|
|
77
|
+
const sourceModuleJson = await readModuleJson(source);
|
|
78
|
+
if (!sourceModuleJson.download) {
|
|
79
|
+
throw new Error("No download URL found in module.json. The source module does not have a download property.");
|
|
80
|
+
}
|
|
81
|
+
if (!sourceModuleJson.packs || sourceModuleJson.packs.length === 0) {
|
|
82
|
+
p.log.warn("No packs found in the source module.json.");
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
p.log.step(`Downloading module from ${cyan(sourceModuleJson.download)}`);
|
|
86
|
+
const tempDir = join(tmpdir(), `fvtt-migrate-${Date.now()}`);
|
|
87
|
+
const extractDir = join(tempDir, "extracted");
|
|
88
|
+
try {
|
|
89
|
+
await mkdir(tempDir, { recursive: true });
|
|
90
|
+
const zipBuffer = await downloadZipBuffer(sourceModuleJson.download);
|
|
91
|
+
const zip = new AdmZip(zipBuffer);
|
|
92
|
+
zip.extractAllTo(extractDir, true);
|
|
93
|
+
const moduleRoot = findModuleRoot(extractDir);
|
|
94
|
+
p.log.step(`Found ${sourceModuleJson.packs.length} pack(s) in module.json: ${sourceModuleJson.packs.map((p) => p.name).join(", ")}`);
|
|
95
|
+
const targetPacksDir = join(modulePath, "packs");
|
|
96
|
+
const targetDataDir = join(modulePath, "data");
|
|
97
|
+
await mkdir(targetPacksDir, { recursive: true });
|
|
98
|
+
await mkdir(targetDataDir, { recursive: true });
|
|
99
|
+
const newPacks = [];
|
|
100
|
+
const newPackNames = [];
|
|
101
|
+
for (const pack of sourceModuleJson.packs) {
|
|
102
|
+
const sourcePackPath = join(moduleRoot, pack.path);
|
|
103
|
+
const dbFileName = `${pack.name}.db`;
|
|
104
|
+
const sourceDbFile = join(sourcePackPath, dbFileName);
|
|
105
|
+
let sourceInputPath = null;
|
|
106
|
+
let isFolder = false;
|
|
107
|
+
if (await isLevelDBFolder(sourcePackPath)) {
|
|
108
|
+
sourceInputPath = sourcePackPath;
|
|
109
|
+
isFolder = true;
|
|
110
|
+
}
|
|
111
|
+
else if (existsSync(sourceDbFile)) {
|
|
112
|
+
sourceInputPath = sourceDbFile;
|
|
113
|
+
}
|
|
114
|
+
if (!sourceInputPath) {
|
|
115
|
+
p.log.warn(`Pack not found at ${sourcePackPath} or ${sourceDbFile}. Skipping ${pack.name}.`);
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
p.log.step(`Extracting ${yellow(pack.name)}...`);
|
|
119
|
+
if (isFolder) {
|
|
120
|
+
await cp(sourceInputPath, join(targetPacksDir, pack.name), { recursive: true });
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
await copyFile(sourceInputPath, join(targetPacksDir, dbFileName));
|
|
124
|
+
}
|
|
125
|
+
const targetDataPath = join(targetDataDir, pack.name);
|
|
126
|
+
await mkdir(targetDataPath, { recursive: true });
|
|
127
|
+
const extractInput = isFolder ? join(targetPacksDir, pack.name) : join(targetPacksDir, dbFileName);
|
|
128
|
+
await extractPack(extractInput, targetDataPath, {
|
|
129
|
+
expandAdventures: true,
|
|
130
|
+
omitVolatile: true,
|
|
131
|
+
folders: true,
|
|
132
|
+
clean: true,
|
|
133
|
+
jsonOptions: {
|
|
134
|
+
space: "\t",
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
newPacks.push({
|
|
138
|
+
label: pack.label || pack.name.charAt(0).toUpperCase() + pack.name.slice(1).replace(/-/g, " "),
|
|
139
|
+
name: pack.name,
|
|
140
|
+
path: `packs/${pack.name}`,
|
|
141
|
+
system: pack.system || "",
|
|
142
|
+
type: pack.type,
|
|
143
|
+
ownership: pack.ownership || {
|
|
144
|
+
PLAYER: "OBSERVER",
|
|
145
|
+
ASSISTANT: "OBSERVER",
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
newPackNames.push(pack.name);
|
|
149
|
+
}
|
|
150
|
+
if (newPacks.length > 0) {
|
|
151
|
+
const targetModuleJsonPath = join(modulePath, "module.json");
|
|
152
|
+
if (existsSync(targetModuleJsonPath)) {
|
|
153
|
+
const content = await readFile(targetModuleJsonPath, "utf8");
|
|
154
|
+
const targetModuleJson = JSON.parse(content);
|
|
155
|
+
targetModuleJson.packs = newPacks;
|
|
156
|
+
if (sourceModuleJson.packFolders) {
|
|
157
|
+
targetModuleJson.packFolders = sourceModuleJson.packFolders;
|
|
158
|
+
}
|
|
159
|
+
await writeFile(targetModuleJsonPath, JSON.stringify(targetModuleJson, null, "\t"));
|
|
160
|
+
p.log.step("Updated module.json with migrated packs");
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
p.log.info(`Migration complete! ${newPacks.length} pack(s) processed.`);
|
|
164
|
+
}
|
|
165
|
+
finally {
|
|
166
|
+
await rm(tempDir, { recursive: true, force: true });
|
|
167
|
+
}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AE,CAAC,CAAC;IACrD,CAAC;AACF,CAAC"}
|
package/dist/options.d.ts
CHANGED
|
@@ -12,10 +12,13 @@ declare const packs: {
|
|
|
12
12
|
declare const systems: {
|
|
13
13
|
id: string;
|
|
14
14
|
type: string;
|
|
15
|
-
manifest: string;
|
|
16
15
|
compatibility: {
|
|
17
16
|
minimum: string;
|
|
18
17
|
};
|
|
19
18
|
}[];
|
|
20
|
-
|
|
19
|
+
declare const foundryVersions: {
|
|
20
|
+
label: string;
|
|
21
|
+
value: string;
|
|
22
|
+
}[];
|
|
23
|
+
export { packs, systems, foundryVersions };
|
|
21
24
|
//# sourceMappingURL=options.d.ts.map
|
package/dist/options.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,KAAK;;;;;;;;;;GA6CV,CAAC;AAEF,QAAA,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,KAAK;;;;;;;;;;GA6CV,CAAC;AAEF,QAAA,MAAM,OAAO;;;;;;GAsBZ,CAAC;AAEF,QAAA,MAAM,eAAe;;;GAGpB,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
package/dist/options.js
CHANGED
|
@@ -48,19 +48,28 @@ const systems = [
|
|
|
48
48
|
{
|
|
49
49
|
id: "dnd5e",
|
|
50
50
|
type: "system",
|
|
51
|
-
manifest: "https://github.com/foundryvtt/dnd5e/releases/latest/download/system.json",
|
|
52
51
|
compatibility: {
|
|
53
|
-
minimum: "5
|
|
52
|
+
minimum: "5",
|
|
54
53
|
},
|
|
55
54
|
},
|
|
56
55
|
{
|
|
57
56
|
id: "pf2e",
|
|
58
57
|
type: "system",
|
|
59
|
-
manifest: "https://github.com/foundryvtt/pf2e/releases/latest/download/system.json",
|
|
60
58
|
compatibility: {
|
|
61
|
-
minimum: "
|
|
59
|
+
minimum: "8",
|
|
62
60
|
},
|
|
63
61
|
},
|
|
62
|
+
{
|
|
63
|
+
id: "sf2e",
|
|
64
|
+
type: "system",
|
|
65
|
+
compatibility: {
|
|
66
|
+
minimum: "1",
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
const foundryVersions = [
|
|
71
|
+
{ label: "V13", value: "13" },
|
|
72
|
+
{ label: "V14", value: "14" },
|
|
64
73
|
];
|
|
65
|
-
export { packs, systems };
|
|
74
|
+
export { packs, systems, foundryVersions };
|
|
66
75
|
//# sourceMappingURL=options.js.map
|
package/dist/options.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG;IACb;QACC,KAAK,EAAE,YAAY;QACnB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE;YACV,MAAM,EAAE,UAAU;YAClB,SAAS,EAAE,UAAU;SACrB;KACD;IACD;QACC,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE;YACV,MAAM,EAAE,UAAU;YAClB,SAAS,EAAE,UAAU;SACrB;KACD;IACD;QACC,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,gBAAgB;QACtB,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,cAAc;QACpB,SAAS,EAAE;YACV,MAAM,EAAE,UAAU;YAClB,SAAS,EAAE,UAAU;SACrB;KACD;IACD;QACC,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,OAAO;QACb,SAAS,EAAE;YACV,MAAM,EAAE,UAAU;YAClB,SAAS,EAAE,OAAO;SAClB;KACD;CACD,CAAC;AAEF,MAAM,OAAO,GAAG;IACf;QACC,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,QAAQ;QACd,
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG;IACb;QACC,KAAK,EAAE,YAAY;QACnB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE;YACV,MAAM,EAAE,UAAU;YAClB,SAAS,EAAE,UAAU;SACrB;KACD;IACD;QACC,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE;YACV,MAAM,EAAE,UAAU;YAClB,SAAS,EAAE,UAAU;SACrB;KACD;IACD;QACC,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,gBAAgB;QACtB,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,cAAc;QACpB,SAAS,EAAE;YACV,MAAM,EAAE,UAAU;YAClB,SAAS,EAAE,UAAU;SACrB;KACD;IACD;QACC,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,OAAO;QACb,SAAS,EAAE;YACV,MAAM,EAAE,UAAU;YAClB,SAAS,EAAE,OAAO;SAClB;KACD;CACD,CAAC;AAEF,MAAM,OAAO,GAAG;IACf;QACC,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,QAAQ;QACd,aAAa,EAAE;YACd,OAAO,EAAE,GAAG;SACZ;KACD;IACD;QACC,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,QAAQ;QACd,aAAa,EAAE;YACd,OAAO,EAAE,GAAG;SACZ;KACD;IACD;QACC,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,QAAQ;QACd,aAAa,EAAE;YACd,OAAO,EAAE,GAAG;SACZ;KACD;CACD,CAAC;AAEF,MAAM,eAAe,GAAG;IACvB,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE;IAC7B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE;CAC7B,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,66 +1,68 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "create-lt-adventure",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "A CLI tool to scaffold Foundry VTT modules",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"foundry-vtt",
|
|
7
|
-
"module",
|
|
8
|
-
"scaffold",
|
|
9
|
-
"cli"
|
|
10
|
-
],
|
|
11
|
-
"license": "MIT",
|
|
12
|
-
"author": "mrvauxs",
|
|
13
|
-
"repository": {
|
|
14
|
-
"type": "git",
|
|
15
|
-
"url": "https://github.com/
|
|
16
|
-
},
|
|
17
|
-
"homepage": "https://github.com/
|
|
18
|
-
"bugs": {
|
|
19
|
-
"url": "https://github.com/
|
|
20
|
-
},
|
|
21
|
-
"type": "module",
|
|
22
|
-
"main": "./dist/index.js",
|
|
23
|
-
"exports": {
|
|
24
|
-
".": {
|
|
25
|
-
"import": "./dist/index.js",
|
|
26
|
-
"types": "./dist/index.d.ts"
|
|
27
|
-
},
|
|
28
|
-
"./bin": {
|
|
29
|
-
"import": "./dist/bin.js",
|
|
30
|
-
"types": "./dist/bin.d.ts"
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
"bin": {
|
|
34
|
-
"create-lt-adventure": "./dist/bin.js"
|
|
35
|
-
},
|
|
36
|
-
"files": [
|
|
37
|
-
"dist/",
|
|
38
|
-
"templates/",
|
|
39
|
-
"addons/",
|
|
40
|
-
"LICENSE",
|
|
41
|
-
"README.md"
|
|
42
|
-
],
|
|
43
|
-
"scripts": {
|
|
44
|
-
"create": "bun src/bin.ts",
|
|
45
|
-
"build": "tsc",
|
|
46
|
-
"build:watch": "tsc --watch",
|
|
47
|
-
"prepublishOnly": "npm run build",
|
|
48
|
-
"prepack": "npm run build",
|
|
49
|
-
"dev": "bun src/bin.ts \"My New Module\" --auto-id"
|
|
50
|
-
},
|
|
51
|
-
"dependencies": {
|
|
52
|
-
"kolorist": "^1.8.0",
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "create-lt-adventure",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "A CLI tool to scaffold Foundry VTT modules",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"foundry-vtt",
|
|
7
|
+
"module",
|
|
8
|
+
"scaffold",
|
|
9
|
+
"cli"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"author": "mrvauxs",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/Loot-Foundry/create-lt-adventure"
|
|
16
|
+
},
|
|
17
|
+
"homepage": "https://github.com/Loot-Foundry/create-lt-adventure#readme",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/Loot-Foundry/create-lt-adventure/issues"
|
|
20
|
+
},
|
|
21
|
+
"type": "module",
|
|
22
|
+
"main": "./dist/index.js",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"import": "./dist/index.js",
|
|
26
|
+
"types": "./dist/index.d.ts"
|
|
27
|
+
},
|
|
28
|
+
"./bin": {
|
|
29
|
+
"import": "./dist/bin.js",
|
|
30
|
+
"types": "./dist/bin.d.ts"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"bin": {
|
|
34
|
+
"create-lt-adventure": "./dist/bin.js"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"dist/",
|
|
38
|
+
"templates/",
|
|
39
|
+
"addons/",
|
|
40
|
+
"LICENSE",
|
|
41
|
+
"README.md"
|
|
42
|
+
],
|
|
43
|
+
"scripts": {
|
|
44
|
+
"create": "bun src/bin.ts",
|
|
45
|
+
"build": "tsc",
|
|
46
|
+
"build:watch": "tsc --watch",
|
|
47
|
+
"prepublishOnly": "npm run build",
|
|
48
|
+
"prepack": "npm run build",
|
|
49
|
+
"dev": "bun src/bin.ts \"My New Module\" --auto-id"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"kolorist": "^1.8.0",
|
|
53
|
+
"adm-zip": "^0.5.16",
|
|
54
|
+
"@foundryvtt/foundryvtt-cli": "^1.0.0",
|
|
55
|
+
"@clack/prompts": "^1.0.0-alpha.9"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@types/adm-zip": "^0.5.7",
|
|
59
|
+
"@types/node": "^20.19.39",
|
|
60
|
+
"typescript": "^5"
|
|
61
|
+
},
|
|
62
|
+
"peerDependencies": {
|
|
63
|
+
"typescript": "^5"
|
|
64
|
+
},
|
|
65
|
+
"engines": {
|
|
66
|
+
"node": ">=18.0.0"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
FOUNDRY_PORT=30000 # Which port your FoundryVTT instance is hosted at.
|
|
1
|
+
FOUNDRY_PORT=30000 # Which port your FoundryVTT instance is hosted at.
|
|
2
2
|
DEV_PORT=30001 # Which port you want to use for development.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# 1.0.0
|
package/templates/vite/gitignore
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
packs
|
|
2
|
-
|
|
3
|
-
# dependencies (bun install)
|
|
4
|
-
node_modules
|
|
5
|
-
|
|
6
|
-
# output
|
|
7
|
-
out
|
|
8
|
-
dist
|
|
9
|
-
*.tgz
|
|
10
|
-
|
|
11
|
-
# code coverage
|
|
12
|
-
coverage
|
|
13
|
-
*.lcov
|
|
14
|
-
|
|
15
|
-
# logs
|
|
16
|
-
logs
|
|
17
|
-
_.log
|
|
18
|
-
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
|
|
19
|
-
|
|
20
|
-
# dotenv environment variable files
|
|
21
|
-
.env
|
|
22
|
-
.env.development.local
|
|
23
|
-
.env.test.local
|
|
24
|
-
.env.production.local
|
|
25
|
-
.env.local
|
|
26
|
-
|
|
27
|
-
# caches
|
|
28
|
-
.eslintcache
|
|
29
|
-
.cache
|
|
30
|
-
*.tsbuildinfo
|
|
31
|
-
.vite-cache
|
|
32
|
-
|
|
33
|
-
# IntelliJ based IDEs
|
|
34
|
-
.idea
|
|
35
|
-
|
|
36
|
-
# Finder (MacOS) folder config
|
|
37
|
-
.DS_Store
|
|
1
|
+
packs
|
|
2
|
+
|
|
3
|
+
# dependencies (bun install)
|
|
4
|
+
node_modules
|
|
5
|
+
|
|
6
|
+
# output
|
|
7
|
+
out
|
|
8
|
+
dist
|
|
9
|
+
*.tgz
|
|
10
|
+
|
|
11
|
+
# code coverage
|
|
12
|
+
coverage
|
|
13
|
+
*.lcov
|
|
14
|
+
|
|
15
|
+
# logs
|
|
16
|
+
logs
|
|
17
|
+
_.log
|
|
18
|
+
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
|
|
19
|
+
|
|
20
|
+
# dotenv environment variable files
|
|
21
|
+
.env
|
|
22
|
+
.env.development.local
|
|
23
|
+
.env.test.local
|
|
24
|
+
.env.production.local
|
|
25
|
+
.env.local
|
|
26
|
+
|
|
27
|
+
# caches
|
|
28
|
+
.eslintcache
|
|
29
|
+
.cache
|
|
30
|
+
*.tsbuildinfo
|
|
31
|
+
.vite-cache
|
|
32
|
+
|
|
33
|
+
# IntelliJ based IDEs
|
|
34
|
+
.idea
|
|
35
|
+
|
|
36
|
+
# Finder (MacOS) folder config
|
|
37
|
+
.DS_Store
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "module-template",
|
|
3
|
-
"title": "Module Template",
|
|
4
|
-
"description": "",
|
|
5
|
-
"authors": [
|
|
6
|
-
{
|
|
7
|
-
"name": "Vauxs",
|
|
8
|
-
"discord": "vauxs",
|
|
9
|
-
"twitter": "@ThatVauxs",
|
|
10
|
-
"email": "mrvauxs@gmail.com",
|
|
11
|
-
"ko-fi": "MrVauxs",
|
|
12
|
-
"patreon": "MrVauxs"
|
|
13
|
-
}
|
|
14
|
-
],
|
|
15
|
-
"version": "dev",
|
|
16
|
-
"compatibility": {
|
|
17
|
-
"minimum": "13",
|
|
18
|
-
"verified": "13"
|
|
19
|
-
},
|
|
20
|
-
"esmodules": [],
|
|
21
|
-
"styles": [],
|
|
22
|
-
"relationships": {},
|
|
23
|
-
"packs": [],
|
|
24
|
-
"packFolders": [],
|
|
25
|
-
"flags": {
|
|
26
|
-
"canUpload": true,
|
|
27
|
-
"hotReload": {
|
|
28
|
-
"extensions": ["css", "json"],
|
|
29
|
-
"paths": ["
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"url": "",
|
|
33
|
-
"bugs": "",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
1
|
+
{
|
|
2
|
+
"id": "module-template",
|
|
3
|
+
"title": "Module Template",
|
|
4
|
+
"description": "",
|
|
5
|
+
"authors": [
|
|
6
|
+
{
|
|
7
|
+
"name": "Vauxs",
|
|
8
|
+
"discord": "vauxs",
|
|
9
|
+
"twitter": "@ThatVauxs",
|
|
10
|
+
"email": "mrvauxs@gmail.com",
|
|
11
|
+
"ko-fi": "MrVauxs",
|
|
12
|
+
"patreon": "MrVauxs"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"version": "dev",
|
|
16
|
+
"compatibility": {
|
|
17
|
+
"minimum": "13",
|
|
18
|
+
"verified": "13"
|
|
19
|
+
},
|
|
20
|
+
"esmodules": [],
|
|
21
|
+
"styles": [],
|
|
22
|
+
"relationships": {},
|
|
23
|
+
"packs": [],
|
|
24
|
+
"packFolders": [],
|
|
25
|
+
"flags": {
|
|
26
|
+
"canUpload": true,
|
|
27
|
+
"hotReload": {
|
|
28
|
+
"extensions": ["css", "json"],
|
|
29
|
+
"paths": ["dist"]
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"url": "https://github.com/AUTHOR/REPO",
|
|
33
|
+
"bugs": "https://github.com/AUTHOR/REPO/issues",
|
|
34
|
+
"changelog": "https://github.com/AUTHOR/REPO/blob/main/CHANGELOG",
|
|
35
|
+
"manifest": "https://raw.githubusercontent.com/AUTHOR/REPO/latest/releases/module.json",
|
|
36
|
+
"download": "https://raw.githubusercontent.com/AUTHOR/REPO/latest/releases/module.zip"
|
|
37
|
+
}
|
|
@@ -1,50 +1,55 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { existsSync } from "node:fs";
|
|
4
|
-
import fs from "node:fs/promises";
|
|
5
|
-
import path from "node:path";
|
|
6
|
-
import * as p from "@clack/prompts";
|
|
7
|
-
import { extractPack } from "@foundryvtt/foundryvtt-cli";
|
|
8
|
-
import { yellow } from "kolorist";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
);
|
|
49
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import fs from "node:fs/promises";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import * as p from "@clack/prompts";
|
|
7
|
+
import { extractPack } from "@foundryvtt/foundryvtt-cli";
|
|
8
|
+
import { yellow } from "kolorist";
|
|
9
|
+
import { replacer } from "./jsonReplacer.mjs";
|
|
10
|
+
// import moduleJSON from "../module.json" with { type: "json" };
|
|
11
|
+
|
|
12
|
+
const foundryDataDir = "packs/";
|
|
13
|
+
const jsonDataDir = "data/";
|
|
14
|
+
|
|
15
|
+
p.intro(`Extracting ${foundryDataDir} into ${jsonDataDir}...`)
|
|
16
|
+
|
|
17
|
+
const outDir = path.resolve(process.cwd());
|
|
18
|
+
const packsCompiled = path.resolve(outDir, foundryDataDir);
|
|
19
|
+
if (!existsSync(packsCompiled)) {
|
|
20
|
+
p.log.warn("Packs directory does not exist in the build!")
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const packFolders = await fs.readdir(packsCompiled);
|
|
24
|
+
|
|
25
|
+
if (packFolders.length === 0) p.log.info("No packs to extract!")
|
|
26
|
+
|
|
27
|
+
await p.tasks(
|
|
28
|
+
packFolders.map(pack => ({
|
|
29
|
+
title: `Extracting ${pack}...`,
|
|
30
|
+
task: async () => {
|
|
31
|
+
if (!existsSync(`${jsonDataDir}/${pack}`)) {
|
|
32
|
+
await fs.mkdir(`${jsonDataDir}/${pack}`);
|
|
33
|
+
}
|
|
34
|
+
await extractPack(
|
|
35
|
+
path.resolve(packsCompiled, pack),
|
|
36
|
+
`${jsonDataDir}/${pack}`,
|
|
37
|
+
{
|
|
38
|
+
expandAdventures: true, // If false, you can remove ignoreAdventureHMR in vite.config
|
|
39
|
+
omitVolatile: true,
|
|
40
|
+
folders: true,
|
|
41
|
+
clean: true,
|
|
42
|
+
log: false,
|
|
43
|
+
jsonOptions: {
|
|
44
|
+
replacer,
|
|
45
|
+
space: "\t"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
);
|
|
49
|
+
return `Extracted ${yellow(pack)}!`
|
|
50
|
+
}
|
|
51
|
+
})),
|
|
52
|
+
{}
|
|
53
|
+
);
|
|
54
|
+
|
|
50
55
|
p.outro("Finished!");
|