Added prettier with automatic useage on pre-commit to avoid style breakage

This commit is contained in:
WBHarry 2025-05-23 17:40:15 +02:00
parent 30a3b5fa55
commit f8a48fad32
6 changed files with 894 additions and 473 deletions

1
.husky/pre-commit Normal file
View file

@ -0,0 +1 @@
npx lint-staged

3
.prettierignore Normal file
View file

@ -0,0 +1,3 @@
node_modules
package-lock.json
package.json

13
.prettierrc Normal file
View file

@ -0,0 +1,13 @@
{
"trailingComma": "none",
"tabWidth": 4,
"useTabs": false,
"semi": true,
"singleQuote": true,
"quoteProps": "consistent",
"bracketSpacing": true,
"arrowParens": "avoid",
"printWidth": 30,
"endOfLine": "lf",
"bracketSameLine": true
}

View file

@ -1,27 +1,47 @@
# Daggerheart
#### For Foundry VTT
This is a repo for a Foundry VTT implementation of daggerheart. It is not associated with critical role
or darrington press.
# Table Of Contents
- [Overview](#overview)
- [Developer Guide](#developer-guide)
# Overview
# Developer Guide
#### Coding Practises
##### Branches And Pull Requests
During pre-release development, we are making use of `main` as the development branch. Once release is getting closer we will instead be making a `dev` branch to base development from to make `main` more stable.
When you work on an issue or feature, start from `main` and make a new branch. Branches should be topically named and with the associated Issue number if it relates to an Issue. EX: `#6/Level-Up-Bugginess`.
---
Once you're finished with an issue or feature, open a Pull Request on Github for that branch.
The Reviewers Team will be approving submissions. This is mainly since we have a wide spread of experience with system building and the system itself, and we do want the system to become something great. As time goes on, more collaborators are likely to be added as reviewers.
#### Setup
- Open a terminal in the directory with the repo `cd <path>/<to>/<repo>`
- NOTE: The repo should be placed in the system files are or somewhere else and a link (if on linux) is placed in the system directory
- NOTE: The repo should be placed in the system files are or somewhere else and a link (if on linux) is placed in the system directory
- NOTE: Linux link can be made using `ln -snf <path to development folder> daggerheart` inside the system folder
- Install npm `npm install`
- Update package.json to match your profile
```
"start": "concurrently \"rollup -c --watch\" \"node C:/FoundryDev/resources/app/main.js --dataPath=C:/FoundryDevFiles --noupnp\" \"gulp\"",
"start-test": "node C:/FoundryDev/resources/app/main.js --dataPath=C:/FoundryDevFiles && rollup -c --watch && gulp",
```
- Replace `C:/FoundryDev/resources/app/main.js` with `<your>/<path>/<to>/<foundry>/<main.js>`
- The main is likely in `<Foundry Install Location>/resouces/app/main.js`
- Replace `--dataPath=C:/FoundryDevFiles` with `<your>/<path>/<to>/<foundry>/<data>`
@ -29,5 +49,4 @@ or darrington press.
Now you should be able to build the app using `npm start`
[Foundry VTT Website][1]
[1]: https://foundryvtt.com/

1278
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,22 +1,29 @@
{
"dependencies": {
"@yaireo/tagify": "^4.17.9",
"gulp": "^5.0.0",
"gulp-less": "^5.0.0",
"rollup": "^4.40.0"
},
"scripts": {
"start": "concurrently \"rollup -c --watch\" \"node ../../../../FoundryDev/main.js --dataPath=../../../ --noupnp\" \"gulp\"",
"start-test": "node ./resources/app/main.js --dataPath=./ && rollup -c --watch && gulp",
"pushLDBtoYML": "node ./tools/pushLDBtoYML.mjs",
"pullYMLtoLDB": "node ./tools/pullYMLtoLDB.mjs"
},
"devDependencies": {
"@foundryvtt/foundryvtt-cli": "^1.0.2",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"concurrently": "^8.2.2",
"postcss": "^8.4.32",
"rollup-plugin-postcss": "^4.0.2"
}
"dependencies": {
"@yaireo/tagify": "^4.17.9",
"gulp": "^5.0.0",
"gulp-less": "^5.0.0",
"rollup": "^4.40.0"
},
"scripts": {
"start": "concurrently \"rollup -c --watch\" \"node ../../../../FoundryDev/resources/app/main.js --dataPath=../../../ --noupnp\" \"gulp\"",
"start-test": "node ./resources/app/main.js --dataPath=./ && rollup -c --watch && gulp",
"pushLDBtoYML": "node ./tools/pushLDBtoYML.mjs",
"pullYMLtoLDB": "node ./tools/pullYMLtoLDB.mjs",
"prepare": "husky"
},
"devDependencies": {
"@foundryvtt/foundryvtt-cli": "^1.0.2",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"concurrently": "^8.2.2",
"husky": "^9.1.5",
"lint-staged": "^15.2.10",
"postcss": "^8.4.32",
"prettier": "^3.5.3",
"rollup-plugin-postcss": "^4.0.2"
},
"lint-staged": {
"**/*": "prettier --write --ignore-unknown"
}
}