Skip to content

Commit

Permalink
update packs from nedb to level db and exported the sources
Browse files Browse the repository at this point in the history
  • Loading branch information
p4535992 committed May 1, 2024
1 parent 8751679 commit 2b557c2
Show file tree
Hide file tree
Showing 17 changed files with 375 additions and 22 deletions.
22 changes: 11 additions & 11 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.yml]
indent_size = 2
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.yml]
indent_size = 2
14 changes: 7 additions & 7 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.github export-ignore
FUNDING.yml export-ignore

.gitattributes export-ignore
README.md export-ignore
preview.jpg export-ignore
patchnotes.md export-ignore
.github export-ignore
FUNDING.yml export-ignore

.gitattributes export-ignore
README.md export-ignore
preview.jpg export-ignore
patchnotes.md export-ignore
1 change: 0 additions & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,4 @@ foundry.js
/dist
/package
/.vite-cache
/package-lock.json
/dist
/package-lock.json
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@
"scripts": {
"build": "node ./utils/clean.mjs && vite build",
"build:watch": "node ./utils/clean.mjs && vite build --watch --mode development",
"build:watchWithDb": "node ./utils/clean.mjs && npm run build:db && vite build --watch --mode development",
"dev": "vite serve",
"build:clean": "node ./utils/packs.mjs package clean",
"build:db": "node ./utils/packs.mjs package pack",
"build:json": "node ./utils/packs.mjs package unpack",
"eslint": "eslint .",
"prepare": "husky install",
"prettier-format": "prettier --config .prettierrc.json --write \"./src/**/*.{js,mjs,json,scss,css}\"",
Expand Down
2 changes: 1 addition & 1 deletion src/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
{
"name": "theatre-inserts-macros",
"label": "Theatre Inserts Macros",
"path": "packs/theatre-inserts-macros.db",
"path": "packs/theatre-inserts-macros",
"type": "Macro",
"private": false,
"ownership": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "Add Owned Tokens to Stage",
"type": "script",
"author": "2eCcEi9HdTwCxqFx",
"img": "icons/svg/dice-target.svg",
"scope": "global",
"command": "const ownedActors = game.actors.filter(a => a.permission === 3);\nconst ownedTokens = ownedActors.map(a => a.getActiveTokens());\n\nfor (const tokenArray of ownedTokens) {\n tokenArray.forEach(t => Theatre.addToNavBar(t.actor));\n}",
"folder": null,
"sort": 0,
"permission": {
"default": 0,
"2eCcEi9HdTwCxqFx": 3
},
"flags": {},
"_id": "O4bIjZLeC6KYwdj2",
"_key": "!macros!O4bIjZLeC6KYwdj2"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "Add Selected Tokens to Stage",
"type": "script",
"author": "2eCcEi9HdTwCxqFx",
"img": "icons/svg/dice-target.svg",
"scope": "global",
"command": "for (const tkn of canvas.tokens.controlled) {\n Theatre.addToNavBar(tkn.actor);\n}",
"folder": null,
"sort": 0,
"permission": {
"default": 0,
"2eCcEi9HdTwCxqFx": 3
},
"flags": {},
"_id": "SiNOxyDFzz7V1ptf",
"_key": "!macros!SiNOxyDFzz7V1ptf"
}
Binary file added src/packs/theatre-inserts-macros/000013.ldb
Binary file not shown.
1 change: 1 addition & 0 deletions src/packs/theatre-inserts-macros/CURRENT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MANIFEST-000009
Empty file.
14 changes: 14 additions & 0 deletions src/packs/theatre-inserts-macros/LOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
2024/05/01-11:03:44.884 419c Recovering log #8
2024/05/01-11:03:44.962 419c Delete type=0 #8
2024/05/01-11:03:44.963 419c Delete type=3 #7
2024/05/01-11:03:45.000 2378 Level-0 table #12: started
2024/05/01-11:03:45.044 2378 Level-0 table #12: 688 bytes OK
2024/05/01-11:03:45.085 2378 Delete type=0 #10
2024/05/01-11:03:45.085 2378 Manual compaction at level-0 from '!macros!O4bIjZLeC6KYwdj2' @ 72057594037927935 : 1 .. '!macros!SiNOxyDFzz7V1ptf' @ 0 : 0; will stop at '!macros!SiNOxyDFzz7V1ptf' @ 2 : 1
2024/05/01-11:03:45.085 2378 Compacting 2@0 + 0@1 files
2024/05/01-11:03:45.126 2378 Generated table #13@0: 2 keys, 688 bytes
2024/05/01-11:03:45.126 2378 Compacted 2@0 + 0@1 files => 688 bytes
2024/05/01-11:03:45.161 2378 compacted to: files[ 0 1 0 0 0 0 0 ]
2024/05/01-11:03:45.161 2378 Delete type=2 #5
2024/05/01-11:03:45.161 2378 Delete type=2 #12
2024/05/01-11:03:45.161 2378 Manual compaction at level-0 from '!macros!SiNOxyDFzz7V1ptf' @ 2 : 1 .. '!macros!SiNOxyDFzz7V1ptf' @ 0 : 0; will stop at (end)
3 changes: 3 additions & 0 deletions src/packs/theatre-inserts-macros/LOG.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
2024/05/01-11:03:26.864 356c Recovering log #6
2024/05/01-11:03:26.938 356c Delete type=0 #6
2024/05/01-11:03:26.938 356c Delete type=3 #4
Binary file added src/packs/theatre-inserts-macros/MANIFEST-000009
Binary file not shown.
17 changes: 17 additions & 0 deletions utils/clean.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import fs from "fs";
import path from "path";

// Clean output directory, or create build directory
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 });
}
} else {
fs.mkdirSync(outDir);
}

// Delete static/packs dir to prevent overwrite during rebuilds (temporary backwards compatibility)
// const oldPacksDir = path.resolve(process.cwd(), "static/packs");
// fs.rmSync(oldPacksDir, { recursive: true, force: true });
Loading

0 comments on commit 2b557c2

Please sign in to comment.