Skip to content

Commit

Permalink
Merge pull request #244 from aMediocreDad/refactor/v10-compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
aMediocreDad authored Nov 2, 2022
2 parents 806bc2a + b4588c2 commit 8c6f709
Show file tree
Hide file tree
Showing 94 changed files with 2,221 additions and 1,796 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist
node_modules
jsconfig.json
src/components/roll-engine/yzur.js
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.1
- name: Setup NodeJS 17
- name: Setup NodeJS 18
uses: actions/setup-node@v3
with:
node-version: "17"
node-version: "18"
cache: "pnpm"
- name: "Install Dependencies"
run: pnpm -recursive install
Expand All @@ -39,5 +39,5 @@ jobs:
uses: ncipollo/release-action@v1.9.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "./dist/system.json, fbl-fvtt_${{ steps.version.outputs.tag }}.zip"
artifacts: "fbl-fvtt_${{ steps.version.outputs.tag }}.zip"
body: ${{ steps.changelog.outputs.changelog }}
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,40 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [10.0.0-4](https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/compare/v10.0.0-3...v10.0.0-4) (2022-09-24)


### Bug Fixes

* 🐛 Fixes [#249](https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/issues/249) ([3b6df76](https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/commit/3b6df76414a10a11f284629689a276bd28e7a838))
* 🐛 Fixes [#262](https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/issues/262) ([ef270cf](https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/commit/ef270cf4280b49aabba83f8e59f7c0e713fd4e84))
* 🐛 Journal Sidebar CSS fix ([3b9a858](https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/commit/3b9a8584d60e1adf52b2287c4fe908bc3a16bfb6))

## [10.0.0-3](https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/compare/v10.0.0-2...v10.0.0-3) (2022-09-18)


### Bug Fixes

* 🐛 Fix editor issues in item/actor sheets ([0e92817](https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/commit/0e9281787b34425efff350eac5191ff77c9d872c)), closes [#261](https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/issues/261)
* 🐛 Revert to releases latest manifests ([0639b9a](https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/commit/0639b9a6cc3f35ec19d58b29db56b83d7ef191c8)), closes [#264](https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/issues/264)

## [10.0.0-2](https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/compare/v9.2.2...v10.0.0-2) (2022-09-11)


### Bug Fixes

* 🐛 Add alpha warning message, remove system.json from releases ([0492d4b](https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/commit/0492d4bd33b8c641dac82146489da000b39c9b89))
* 🐛 V9 compatible manifest ([8caff11](https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/commit/8caff11d15788c4b5d56b9d392e0722bbf95f7fd)), closes [#252](https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/issues/252)

## [10.0.0-1](https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/compare/v10.0.0-0...v10.0.0-1) (2022-08-11)


### Bug Fixes

* 🐛 V9 compatible manifest ([d227ab3](https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/commit/d227ab336ff1bca65ba8c237af66a6cdfbb90dd0)), closes [#252](https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/issues/252)

## [10.0.0-0](https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/compare/v9.2.2...v10.0.0-0) (2022-07-18)

### [9.2.2](https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/compare/v9.2.1...v9.2.2) (2022-07-18)


Expand Down
60 changes: 19 additions & 41 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ const production = process.env.NODE_ENV === "production";
const repoName = "forbidden-lands";
const sourceDirectory = "./src";
const distDirectory = "./dist";
const stdio = "inherit";
const templateExt = "hbs";
const staticFiles = ["lang", "assets", "fonts", "scripts", "system.json", "template.json", "LICENSE"];
const getDownloadURL = (version) =>
`https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/releases/download/v${version}/fbl-fvtt_v${version}.zip`;
const getDownloadURL = (tag) =>
`https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/releases/download/v${tag}/fbl-fvtt_v${tag}.zip`;
const packageJson = JSON.parse(fs.readFileSync("package.json"));

const stdio = "inherit";
const { version } = packageJson;
const majorVersion = version.split(".")[0];
const manifest = JSON.parse(fs.readFileSync(`manifests/v${majorVersion}/system.json`));
const staticFiles = fs.readdirSync(`./static`).map((file) => `static/${file}`);
staticFiles.push("README.md", "LICENSE", `manifests/v${majorVersion}/system.json`);

/********************/
/* BUILD */
Expand Down Expand Up @@ -54,16 +57,12 @@ async function pipeTemplates() {
*/
async function pipeStatics() {
for (const file of staticFiles) {
if (fs.existsSync(`static/${file}`)) {
await fs.copy(`static/${file}`, `${distDirectory}/${file}`);
}
await fs
.copy(file, `${distDirectory}/${file.replace(/static\/|manifests\/v\d+\//, "")}`, { recursive: true })
.catch((err) => {
console.log(err);
});
}
await fs.copy(`./README.md`, `${distDirectory}/README.md`).catch((err) => {
console.log(err);
});
await fs.copy(`./LICENSE`, `${distDirectory}/LICENSE`).catch((err) => {
console.log(err);
});
}

/**
Expand All @@ -72,11 +71,7 @@ async function pipeStatics() {
function buildWatch() {
buildSource({ watch: true });
gulp.watch(`${sourceDirectory}/**/*.${templateExt}`, { ignoreInitial: false }, pipeTemplates);
gulp.watch(
staticFiles.map((file) => `static/${file}`),
{ ignoreInitial: false },
pipeStatics,
);
gulp.watch(staticFiles, { ignoreInitial: false }, pipeStatics);
}

/********************/
Expand Down Expand Up @@ -116,7 +111,7 @@ function getDataPath() {
*/
async function linkUserData() {
let destinationDirectory;
if (fs.existsSync(path.resolve("static/system.json"))) {
if (fs.existsSync(path.resolve("manif/system.json"))) {
destinationDirectory = "systems";
} else {
throw new Error(`Could not find ${chalk.blueBright("system.json")}`);
Expand All @@ -139,20 +134,6 @@ async function linkUserData() {
/* VERSIONING */
/********************/

/**
* Get the contents of the manifest file as object.
*/
function getManifest() {
const manifestPath = `static/system.json`;

if (fs.existsSync(manifestPath)) {
return {
file: JSON.parse(fs.readFileSync(manifestPath)),
name: "system.json",
};
}
}

/**
* Get the target version based on on the current version and the argument passed as release.
*/
Expand All @@ -173,7 +154,6 @@ async function changelog() {
* Commit and push release to Github Upstream
*/
async function commitTagPush() {
const { version } = packageJson;
const commitMsg = `chore(release): Release ${version}`;
await execa("git", ["add", "-A"], { stdio });
await execa("git", ["commit", "--message", commitMsg], { stdio });
Expand All @@ -186,15 +166,13 @@ async function commitTagPush() {
* Update version and download URL.
*/
async function bumpVersion(cb) {
const manifest = getManifest();

if (!manifest) cb(Error(chalk.red("Manifest JSON not found")));

try {
// eslint-disable-next-line no-shadow
const release = argv.release || argv.r;

const currentVersion = packageJson.version;
const currentVersion = version;

if (!release) {
return cb(Error("Missing release type"));
Expand All @@ -215,9 +193,9 @@ async function bumpVersion(cb) {
packageJson.version = targetVersion;
fs.writeFileSync("package.json", JSON.stringify(packageJson, null, "\t"));

manifest.file.version = targetVersion;
manifest.file.download = getDownloadURL(targetVersion);
fs.writeFileSync(`static/${manifest.name}`, JSON.stringify(manifest.file, null, "\t"));
manifest.version = targetVersion;
manifest.download = getDownloadURL(targetVersion);
fs.writeFileSync(`manifests/v${majorVersion}/system.json`, JSON.stringify(manifest, null, "\t"));

return cb();
} catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion manifests/v10/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"minimumCoreVersion": 10,
"compatibility": {
"minimum": 10,
"verified": 10.285,
"verified": 10.288,
"maximum": 10
},
"contributors": "perfectro, patrys, Maxter, jimorie, giant-teapot, romelwell, roonel, moo-man, lasseborly",
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "forbidden-lands",
"version": "9.2.2",
"version": "10.0.0-4",
"type": "module",
"description": "<p align=\"center\">\r <a href=\"https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/releases/latest\" target=\"_blank\"><img alt=\"system version\" src=\"https://img.shields.io/badge/dynamic/json.svg?url=https%3A%2F%2Fraw.githubusercontent.com%2Ffvtt-fria-ligan%2Fforbidden-lands-foundry-vtt%2Fmain%2Fsystem.json&label=Version&query=$.version&colorB=blue\"/></a>\r <a href=\"https://foundryvtt.com\" target=\"_blank\">\r <img src=\"https://img.shields.io/badge/dynamic/json.svg?url=https%3A%2F%2Fraw.githubusercontent.com%2Ffvtt-fria-ligan%2Fforbidden-lands-foundry-vtt%2Fmain%2Fsystem.json&label=Foundry&query=$.compatibleCoreVersion&colorB=blue\" alt=\"foundry-compatibility-version\" style=\"max-width:100%;\"/>\r </a>\r <a href=\"https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/graphs/commit-activity\" target=\"_blank\">\r <img alt=\"Maintenance\" src=\"https://img.shields.io/badge/Maintained%3F-yes-green.svg\"/>\r </a>\r <a href=\"https://gitlocalize.com/repo/5750/whole_project?utm_source=badge\" target=\"_blank\"><img alt=\"Localization\" src=\"https://gitlocalize.com/repo/5750/whole_project/badge.svg\" /></a>\r <a href=\"https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/blob/main/LICENSE\" target=\"_blank\">\r <img alt=\"License: GPL\" src=\"https://img.shields.io/github/license/fvtt-fria-ligan/forbidden-lands-foundry-vtt\"/>\r </a>\r <br/>\r <br/>\r <img src=\"https://user-images.githubusercontent.com/9851733/108728684-1a954b00-752a-11eb-9138-6fab6f83b2a8.jpg\" alt=\"Logo\" style=\"max-width:100%;\" />\r </p>",
"license": "GPL-3.0-or-later",
Expand Down Expand Up @@ -36,15 +36,15 @@
},
"devDependencies": {
"@milahu/patch-package-with-pnpm-support": "6.4.8",
"@league-of-foundry-developers/foundry-vtt-types": "9.269.0",
"@league-of-foundry-developers/foundry-vtt-types": "9.280.0",
"@types/jquery": "3.5.14",
"@typhonjs-fvtt/eslint-config-foundry.js": "0.8.0",
"chalk": "5.0.1",
"cross-env": "7.0.3",
"devmoji": "2.3.0",
"esbuild": "0.14.49",
"esbuild-sass-plugin": "2.2.6",
"eslint": "8.19.0",
"esbuild": "0.15.9",
"esbuild-sass-plugin": "2.3.3",
"eslint": "8.24.0",
"eslint-config-jquery": "3.0.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-prettier": "4.2.1",
Expand All @@ -67,6 +67,6 @@
}
},
"volta": {
"node": "16.14.2"
"node": "18.9.0"
}
}
Loading

0 comments on commit 8c6f709

Please sign in to comment.