-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ed4f9f6
Showing
67 changed files
with
24,167 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
dist | ||
system-packs | ||
node_modules | ||
package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
dist | ||
package | ||
node_modules | ||
system-packs | ||
packs | ||
|
||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"trailingComma": "es5", | ||
"tabWidth": 4, | ||
"semi": true, | ||
"singleQuote": true, | ||
"useTabs": true, | ||
"bracketSameLine": false, | ||
"endOfLine": "lf" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Kulkodar's shared compendia | ||
A simple module that holds various things. | ||
|
||
## Content | ||
- Scene setups for maps made by [Paizo](https://paizo.com/) | ||
- Basic setups for one-shots made by [Paizo](https://paizo.com/) | ||
|
||
## installation | ||
Manifest URL: https://github.com/Kulkodar/shared-compendia/releases/latest/download/module.json | ||
|
||
### Additional installations | ||
To use the prepared scenes/adventure made by [Paizo](https://paizo.com/) you need to place the content of the art assets into the following folder `<FoundryDataFolder>/proprietary-assets/<ProductId-ProductName>/`. The `ProductId` is the offical store id found on the store page. The `ProductName` is the title of the book/pdf excluding Pathfinder. For the one-shot Sundered Waves it would be `<FoundryDataFolder>/proprietary-assets/PZO1001E-Sundered-Waves/` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package | ||
packs | ||
system.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
import url from 'url'; | ||
import { | ||
CompendiumMetadata, | ||
CompendiumPack, | ||
PackError, | ||
} from './lib/compendium-pack'; | ||
import systemJSON from './system.json'; | ||
|
||
const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); | ||
|
||
// Loads all system packs into memory for the sake of making all document name/id mappings available | ||
const systemPacksMetadata = systemJSON.packs as unknown as CompendiumMetadata[]; | ||
|
||
const systemPacksDataPath = path.resolve(__dirname, '../system-packs'); | ||
const systemPackDirPaths = fs | ||
.readdirSync(systemPacksDataPath) | ||
.map((dirName) => path.resolve(__dirname, systemPacksDataPath, dirName)) | ||
.filter((filePath) => | ||
systemPacksMetadata.find( | ||
(p) => path.basename(p.path) === path.basename(filePath) | ||
) | ||
); | ||
|
||
systemPackDirPaths.map((p) => CompendiumPack.loadJSON(p)); | ||
|
||
// Loads all packs into memory for the sake of making all document name/id mappings available | ||
const packsDataPath = path.resolve(__dirname, '../packs'); | ||
const packDirPaths = fs | ||
.readdirSync(packsDataPath) | ||
.map((dirName) => path.resolve(__dirname, packsDataPath, dirName)); | ||
|
||
const packs = packDirPaths.map((p) => CompendiumPack.loadJSON(p)); | ||
|
||
const documentCounts = await Promise.all( | ||
packs.map(function (p) { | ||
return p.save(); | ||
}) | ||
); | ||
const total = documentCounts.reduce((total, c) => total + c, 0); | ||
|
||
if (documentCounts.length > 0) { | ||
console.log( | ||
`Created ${documentCounts.length} packs with ${total} documents.` | ||
); | ||
} else { | ||
throw PackError('No data available to build packs.'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
|
||
const outDir = path.resolve(process.cwd(), 'dist'); | ||
if (fs.existsSync(outDir)) { | ||
const filesToClean = fs | ||
.readdirSync(outDir) | ||
.map((dirName) => path.resolve(outDir, dirName)); | ||
for (const file of filesToClean) { | ||
fs.rmSync(file, { recursive: true }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import process from 'process'; | ||
import { PackExtractor } from './lib/extractor'; | ||
|
||
const extractor = new PackExtractor(); | ||
|
||
try { | ||
await extractor.run('dist', 'packs', true); | ||
console.log(`Extraction complete.`); | ||
} catch (error) { | ||
console.error(error); | ||
process.exit(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import process from 'process'; | ||
import { PackExtractor } from './lib/extractor'; | ||
|
||
const extractor = new PackExtractor(); | ||
|
||
try { | ||
await extractor.run('build', 'system-packs', false); | ||
console.log(`Extraction complete.`); | ||
} catch (error) { | ||
console.error(error); | ||
process.exit(1); | ||
} |
Oops, something went wrong.