Merge branch 'master' into 015-spells

This commit is contained in:
Gesina Schwalbe 2021-01-09 23:44:48 +01:00
commit c1f77e1a66
6 changed files with 187 additions and 108 deletions

View file

@ -5,6 +5,7 @@ stages:
- test - test
- build - build
- deploy - deploy
- release
cache: &global_cache cache: &global_cache
key: key:
@ -66,3 +67,46 @@ deploy:
only: only:
- master - master
resource_group: production resource_group: production
.release-template: &release-template
stage: release
before_script:
- apt update
- apt install --yes jq
- REPOSITORY_URL=$(echo "${CI_REPOSITORY_URL}" | sed -e "s|gitlab-ci-token:.*@|${RELEASE_TOKEN}:${RELEASE_TOKEN_SECRET}@|g")
- git remote set-url origin $REPOSITORY_URL
- git config user.name $GITLAB_USER_LOGIN
- git config user.email $GITLAB_USER_EMAIL
- git branch -D ci-processing || true
- git checkout -b ci-processing
cache:
<<: *global_cache
script: |
npm run updateManifest -- --update=${RELEASE_TYPE}
RELEASE_VERSION=$(jq -r '.version' < package.json)
git add package.json package-lock.json src/system.json
git --no-pager diff
git commit -m "release version ${RELEASE_VERSION}"
git tag -f latest
git tag -f ${RELEASE_VERSION}
git push origin ci-processing:${CI_BUILD_REF_NAME}
git push origin latest -f
git push origin ${RELEASE_VERSION}
only:
- master
when: manual
release-patch:
variables:
RELEASE_TYPE: patch
<<: *release-template
release-minor:
variables:
RELEASE_TYPE: minor
<<: *release-template
release-major:
variables:
RELEASE_TYPE: major
<<: *release-template

View file

@ -2,14 +2,11 @@ const gulp = require("gulp");
const fs = require("fs-extra"); const fs = require("fs-extra");
const path = require("path"); const path = require("path");
const chalk = require("chalk"); const chalk = require("chalk");
const archiver = require("archiver");
const stringify = require("json-stringify-pretty-compact"); const stringify = require("json-stringify-pretty-compact");
const typescript = require("typescript"); const typescript = require("typescript");
const ts = require("gulp-typescript"); const ts = require("gulp-typescript");
const less = require("gulp-less");
const sass = require("gulp-sass"); const sass = require("gulp-sass");
const git = require("gulp-git");
const argv = require("yargs").argv; const argv = require("yargs").argv;
@ -127,13 +124,6 @@ function buildTS() {
return gulp.src("src/**/*.ts").pipe(tsConfig()).pipe(gulp.dest("dist")); return gulp.src("src/**/*.ts").pipe(tsConfig()).pipe(gulp.dest("dist"));
} }
/**
* Build Less
*/
function buildLess() {
return gulp.src("src/*.less").pipe(less()).pipe(gulp.dest("dist"));
}
/** /**
* Build SASS * Build SASS
*/ */
@ -163,7 +153,6 @@ async function copyFiles() {
*/ */
function buildWatch() { function buildWatch() {
gulp.watch("src/**/*.ts", { ignoreInitial: false }, buildTS); gulp.watch("src/**/*.ts", { ignoreInitial: false }, buildTS);
gulp.watch("src/**/*.less", { ignoreInitial: false }, buildLess);
gulp.watch("src/**/*.scss", { ignoreInitial: false }, buildSASS); gulp.watch("src/**/*.scss", { ignoreInitial: false }, buildSASS);
gulp.watch(["src/fonts", "src/lang", "src/templates", "src/*.json"], { ignoreInitial: false }, copyFiles); gulp.watch(["src/fonts", "src/lang", "src/templates", "src/*.json"], { ignoreInitial: false }, copyFiles);
} }
@ -194,8 +183,8 @@ async function clean() {
); );
} }
// If the project uses Less or SASS // If the project uses SASS
if (fs.existsSync(path.join("src", `${name}.less`)) || fs.existsSync(path.join("src", `${name}.scss`))) { if (fs.existsSync(path.join("src", `${name}.scss`))) {
files.push("fonts", `${name}.css`); files.push("fonts", `${name}.css`);
} }
@ -268,69 +257,15 @@ async function linkUserData() {
/* PACKAGE */ /* PACKAGE */
/*********************/ /*********************/
/**
* Package build
*/
async function packageBuild() {
const manifest = getManifest();
return new Promise((resolve, reject) => {
try {
// Remove the package dir without doing anything else
if (argv.clean || argv.c) {
console.log(chalk.yellow("Removing all packaged files"));
fs.removeSync("package");
return;
}
// Ensure there is a directory to hold all the packaged versions
fs.ensureDirSync("package");
// Initialize the zip file
const zipName = `${manifest.file.name}-v${manifest.file.version}.zip`;
const zipFile = fs.createWriteStream(path.join("package", zipName));
const zip = archiver("zip", { zlib: { level: 9 } });
zipFile.on("close", () => {
console.log(chalk.green(zip.pointer() + " total bytes"));
console.log(chalk.green(`Zip file ${zipName} has been written`));
return resolve();
});
zip.on("error", (err) => {
throw err;
});
zip.pipe(zipFile);
// Add the directory with the final code
zip.directory("dist/", manifest.file.name);
zip.finalize();
} catch (err) {
return reject(err);
}
});
}
/*********************/
/* PACKAGE */
/*********************/
/** /**
* Update version and URLs in the manifest JSON * Update version and URLs in the manifest JSON
*/ */
function updateManifest(cb) { function updateManifest(cb) {
const packageJson = fs.readJSONSync("package.json"); const packageJson = fs.readJSONSync("package.json");
const config = getConfig(), const packageLockJson = fs.readJSONSync("package-lock.json");
manifest = getManifest(), const manifest = getManifest();
rawURL = config.rawURL,
repoURL = config.repository,
manifestRoot = manifest.root;
if (!config) cb(Error(chalk.red("foundryconfig.json not found")));
if (!manifest) cb(Error(chalk.red("Manifest JSON not found"))); if (!manifest) cb(Error(chalk.red("Manifest JSON not found")));
if (!rawURL || !repoURL) cb(Error(chalk.red("Repository URLs not configured in foundryconfig.json")));
try { try {
const version = argv.update || argv.u; const version = argv.update || argv.u;
@ -372,22 +307,22 @@ function updateManifest(cb) {
console.log(`Updating version number to '${targetVersion}'`); console.log(`Updating version number to '${targetVersion}'`);
packageJson.version = targetVersion; packageJson.version = targetVersion;
packageLockJson.version = targetVersion;
manifest.file.version = targetVersion; manifest.file.version = targetVersion;
/* Update URLs */ /* Update URL */
const result = `https://git.f3l.de/dungeonslayers/ds4/-/jobs/artifacts/${targetVersion}/download?job=build`;
const result = `${rawURL}/v${manifest.file.version}/package/${manifest.file.name}-v${manifest.file.version}.zip`;
manifest.file.url = repoURL;
manifest.file.manifest = `${rawURL}/master/${manifestRoot}/${manifest.name}`;
manifest.file.download = result; manifest.file.download = result;
const prettyProjectJson = stringify(manifest.file, { const prettyProjectJson =
maxLength: 35, stringify(manifest.file, {
indent: "\t", maxLength: 40,
}); indent: 4,
}) + "\n";
fs.writeJSONSync("package.json", packageJson, { spaces: "\t" }); fs.writeJSONSync("package.json", packageJson, { spaces: 4 });
fs.writeJSONSync("package-lock.json", packageLockJson, { spaces: 4 });
fs.writeFileSync(path.join(manifest.root, manifest.name), prettyProjectJson, "utf8"); fs.writeFileSync(path.join(manifest.root, manifest.name), prettyProjectJson, "utf8");
return cb(); return cb();
@ -396,34 +331,10 @@ function updateManifest(cb) {
} }
} }
function gitAdd() { const execBuild = gulp.parallel(buildTS, buildSASS, copyFiles);
return gulp.src("package").pipe(git.add({ args: "--no-all" }));
}
function gitCommit() {
return gulp.src("./*").pipe(
git.commit(`v${getManifest().file.version}`, {
args: "-a",
disableAppendPaths: true,
}),
);
}
function gitTag() {
const manifest = getManifest();
return git.tag(`v${manifest.file.version}`, `Updated to ${manifest.file.version}`, (err) => {
if (err) throw err;
});
}
const execGit = gulp.series(gitAdd, gitCommit, gitTag);
const execBuild = gulp.parallel(buildTS, buildLess, buildSASS, copyFiles);
exports.build = gulp.series(clean, execBuild); exports.build = gulp.series(clean, execBuild);
exports.watch = buildWatch; exports.watch = buildWatch;
exports.clean = clean; exports.clean = clean;
exports.link = linkUserData; exports.link = linkUserData;
exports.package = packageBuild; exports.updateManifest = updateManifest;
exports.update = updateManifest;
exports.publish = gulp.series(clean, updateManifest, execBuild, packageBuild, execGit);

View file

@ -27,12 +27,12 @@
} }
], ],
"scripts": { "scripts": {
"package": "gulp package",
"build": "gulp build", "build": "gulp build",
"build:watch": "gulp watch", "build:watch": "gulp watch",
"link": "gulp link", "link": "gulp link",
"clean": "gulp clean && gulp link --clean", "clean": "gulp clean && gulp link --clean",
"update": "npm install --save-dev git+https://git.f3l.de/dungeonslayers/foundry-pc-types.git#f3l-fixes", "update": "npm install --save-dev git+https://git.f3l.de/dungeonslayers/foundry-pc-types.git#f3l-fixes",
"updateManifest": "gulp updateManifest",
"lint": "eslint 'src/**/*.ts' --cache", "lint": "eslint 'src/**/*.ts' --cache",
"lint:fix": "eslint 'src/**/*.ts' --cache --fix", "lint:fix": "eslint 'src/**/*.ts' --cache --fix",
"test": "ts-node ./node_modules/jasmine/bin/jasmine", "test": "ts-node ./node_modules/jasmine/bin/jasmine",

119
src/lang/de.json Normal file
View file

@ -0,0 +1,119 @@
{
"DS4.UserInteractionAddItem": "Neu",
"DS4.NotOwned": "Nicht besessen",
"DS4.HeadingDescription": "Beschreibung",
"DS4.HeadingDetails": "Details",
"DS4.HeadingEffects": "Effekte",
"DS4.HeadingInventory": "Inventar",
"DS4.HeadingProfile": "Profil",
"DS4.HeadingTalents": "Talente & Fähigkeiten",
"DS4.AttackType": "Angriffs Typ",
"DS4.AttackTypeAbbr": "AT",
"DS4.WeaponBonus": "Waffen Bonus",
"DS4.WeaponBonusAbbr": "WB",
"DS4.OpponentDefense": "Gegner Abwehr",
"DS4.OpponentDefenseAbbr": "GA",
"DS4.AttackTypeMelee": "Schlagen",
"DS4.AttackTypeRanged": "Schießen",
"DS4.AttackTypeMeleeRanged": "Schlagen + Schießen",
"DS4.Quantity": "Menge",
"DS4.PriceGold": "Preis (Gold)",
"DS4.StorageLocation": "Wo gelagert",
"DS4.ItemEquipped": "Ausgerüstet",
"DS4.ItemOwner": "Eigentümer",
"DS4.ItemAvailability": "Verfügbarkeit",
"DS4.ItemAvailabilityHamlet": "Dorf",
"DS4.ItemAvailabilityVilage": "Kleinstadt",
"DS4.ItemAvailabilityCity": "Großstadt",
"DS4.ItemAvailabilityElves": "Elfen",
"DS4.ItemAvailabilityDwarves": "Zwerge",
"DS4.ItemAvailabilityUnset": "nicht gesetzt",
"DS4.ItemAvailabilityNowhere": "nirgendwo",
"DS4.ItemName": "Name",
"DS4.ItemTypeWeapon": "Waffe",
"DS4.ItemTypeWeaponPlural": "Waffen",
"DS4.ItemTypeArmor": "Panzerung",
"DS4.ItemTypeArmorPlural": "Panzerungen",
"DS4.ItemTypeShield": "Schild",
"DS4.ItemTypeShieldPlural": "Schilde",
"DS4.ItemTypeTrinket": "Schmuckstück",
"DS4.ItemTypeTrinketPlural": "Schmuckstücke",
"DS4.ItemTypeEquipment": "Ausrüstung",
"DS4.ItemTypeEquipmentPlural": "Ausrüstung",
"DS4.ItemTypeTalent": "Talent",
"DS4.ItemTypeTalentPlural": "Talente",
"DS4.ItemTypeRacialAbility": "Volksfähigkeit",
"DS4.ItemTypeRacialAbilityPlural": "Volksfähigkeiten",
"DS4.ItemTypeLanguage": "Sprache",
"DS4.ItemTypeLanguagePlural": "Sprachen",
"DS4.ItemTypeAlphabet": "Schriftzeichen",
"DS4.ItemTypeAlphabetPlural": "Schriftzeichen",
"DS4.ArmorType": "Panzerungstyp",
"DS4.ArmorTypeAbbr": "PAT",
"DS4.ArmorMaterialType": "Material Typ",
"DS4.ArmorMaterialTypeAbbr": "Mat.",
"DS4.ArmorValue": "Panzerungs Wert",
"DS4.ArmorValueAbbr": "PA",
"DS4.ArmorTypeBody": "Körper",
"DS4.ArmorTypeBodyAbbr": "Körper",
"DS4.ArmorTypeHelmet": "Helm",
"DS4.ArmorTypeHelmetAbbr": "Helm",
"DS4.ArmorTypeVambrace": "Armschienen",
"DS4.ArmorTypeVambraceAbbr": "Arm",
"DS4.ArmorTypeGreaves": "Beinschienen",
"DS4.ArmorTypeGreavesAbbr": "Bein",
"DS4.ArmorTypeVambraceGreaves": "Armschienen + Beinschienen",
"DS4.ArmorTypeVambraceGreavesAbbr": "A+B",
"DS4.ArmorMaterialTypeCloth": "Stoff",
"DS4.ArmorMaterialTypeClothAbbr": "Stoff",
"DS4.ArmorMaterialTypeLeather": "Leder",
"DS4.ArmorMaterialTypeLeatherAbbr": "Leder",
"DS4.ArmorMaterialTypeChain": "Ketten",
"DS4.ArmorMaterialTypeChainAbbr": "Ketten",
"DS4.ArmorMaterialTypePlate": "Platten",
"DS4.ArmorMaterialTypePlateAbbr": "Platten",
"DS4.AttributeBody": "Körper",
"DS4.AttributeMobility": "Agilität",
"DS4.AttributeMind": "Geist",
"DS4.TraitStrength": "Stärke",
"DS4.TraitConstitution": "Härte",
"DS4.TraitAgility": "Bewegung",
"DS4.TraitDexterity": "Geschick",
"DS4.TraitIntellect": "Verstand",
"DS4.TraitAura": "Aura",
"DS4.CombatValuesHitPoints": "Lebenskraft",
"DS4.CombatValuesDefense": "Abwehr",
"DS4.CombatValuesInitiative": "Initiative",
"DS4.CombatValuesMovement": "Laufen",
"DS4.CombatValuesMeleeAttack": "Schlagen",
"DS4.CombatValuesRangedAttack": "Schießen",
"DS4.CombatValuesSpellcasting": "Zaubern",
"DS4.CombatValuesTargetedSpellcasting": "Zielzaubern",
"DS4.BaseInfoRace": "Volk",
"DS4.BaseInfoClass": "Klasse",
"DS4.BaseInfoHeroClass": "Helden Klasse",
"DS4.BaseInfoCulture": "Kultur",
"DS4.ProgressionLevel": "Stufe",
"DS4.ProgressionExperiencePoints": "Erfahrungspunkte",
"DS4.ProgressionTalentPoints": "Talentpunkte",
"DS4.ProgressionProgressPoints": "Lernpunkte",
"DS4.TalentRank": "Rang",
"DS4.TalentRankBase": "Erworbener Rang",
"DS4.TalentRankMax": "Maximaler Rang",
"DS4.TalentRankMod": "Zusätzlicher Rang",
"DS4.TalentRankTotal": "Gesamter Rang",
"DS4.LanguageLanguages": "Sprachen",
"DS4.LanguageAlphabets": "Schriftzeichen",
"DS4.ProfileGender": "Geschlecht",
"DS4.ProfileBirthday": "Geburtstag",
"DS4.ProfileBirthplace": "Geburtsort",
"DS4.ProfileAge": "Alter",
"DS4.ProfileHeight": "Größe",
"DS4.ProfilHairColor": "Haarfarbe",
"DS4.ProfileWeight": "Gewicht",
"DS4.ProfileEyeColor": "Augenfarbe",
"DS4.ProfileSpecialCharacteristics": "Besondere Eigenschaften",
"DS4.WarningManageActiveEffectOnOwnedItem": "Das Verwalten von aktiven Effekten innerhalb eines besessen Items wird derzeit nicht unterstützt und wird in einem nachfolgenden Update hinzugefügt.",
"DS4.ErrorDiceCritOverlap": "Es gibt eine Überlappung zwischen Patzern und Immersiegen.",
"DS4.ErrorExplodingRecursionLimitExceeded": "Die maximale Rekursionstiefe für slayende Würfelwürfe wurde überschritten."
}

View file

@ -30,7 +30,7 @@ export class DS4ActorSheet extends ActorSheet<DS4ActorDataType, DS4Actor, DS4Ite
return mergeObject(super.defaultOptions, { return mergeObject(super.defaultOptions, {
classes: ["ds4", "sheet", "actor"], classes: ["ds4", "sheet", "actor"],
template: "systems/ds4/templates/actor/actor-sheet.hbs", template: "systems/ds4/templates/actor/actor-sheet.hbs",
width: 725, width: 745,
height: 600, height: 600,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "inventory" }], tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "inventory" }],
}); });

View file

@ -16,13 +16,18 @@
"lang": "en", "lang": "en",
"name": "English", "name": "English",
"path": "lang/en.json" "path": "lang/en.json"
},
{
"lang": "de",
"name": "Deutsch",
"path": "lang/de.json"
} }
], ],
"gridDistance": 1, "gridDistance": 1,
"gridUnits": "m", "gridUnits": "m",
"primaryTokenAttribute": "combatValues.hitPoints", "primaryTokenAttribute": "combatValues.hitPoints",
"url": "https://git.f3l.de/dungeonslayers/ds4", "url": "https://git.f3l.de/dungeonslayers/ds4",
"manifest": "https://git.f3l.de/dungeonslayers/ds4/-/raw/master/src/system.json?inline=false", "manifest": "https://git.f3l.de/dungeonslayers/ds4/-/raw/latest/src/system.json?inline=false",
"download": "https://git.f3l.de/dungeonslayers/ds4/-/jobs/artifacts/0.1.0/download?job=build", "download": "https://git.f3l.de/dungeonslayers/ds4/-/jobs/artifacts/0.1.0/download?job=build",
"license": "MIT" "license": "MIT"
} }