Skip to content

Commit

Permalink
Update for Flarum 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaucau committed Jan 20, 2022
1 parent a9cf36f commit 787dff7
Show file tree
Hide file tree
Showing 5 changed files with 351 additions and 3,267 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"forum": "https://discuss.flarum.org/d/29475-litespeed-cache-for-flarum"
},
"require": {
"flarum/core": "^1.0.0",
"flarum/core": "^1.2",
"php": "^7.4||^8.0",
"guzzlehttp/guzzle": "^7.4"
},
Expand Down
40 changes: 20 additions & 20 deletions js/package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"name": "@acpl/flarum-lscache",
"packageManager": "[email protected]",
"private": true,
"prettier": "@flarum/prettier-config",
"dependencies": {
"flarum-webpack-config": "^1.0.0",
"webpack": "^4.46.0",
"webpack-cli": "^4.9.1"
},
"devDependencies": {
"@flarum/prettier-config": "^1.0.0",
"flarum-tsconfig": "^1.0.2",
"prettier": "^2.5.1"
},
"scripts": {
"dev": "webpack --mode development --watch",
"build": "webpack --mode production",
"format": "prettier --write src",
"format-check": "prettier --check src"
}
"name": "@acpl/flarum-lscache",
"packageManager": "[email protected]",
"private": true,
"prettier": "@flarum/prettier-config",
"dependencies": {
"flarum-webpack-config": "^2.0.0",
"webpack": "^5.66.0",
"webpack-cli": "^4.9.1"
},
"devDependencies": {
"@flarum/prettier-config": "^1.0.0",
"flarum-tsconfig": "^1.0.2",
"prettier": "^2.5.1"
},
"scripts": {
"dev": "webpack --mode development --watch",
"build": "webpack --mode production",
"format": "prettier --write src",
"format-check": "prettier --check src"
}
}
8 changes: 4 additions & 4 deletions js/src/admin/addPurgeLSCacheButton.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import app from 'flarum/admin/app';
import { extend } from 'flarum/common/extend';
import StatusWidget from 'flarum/admin/components/StatusWidget';
import ItemList from 'flarum/common/utils/ItemList';
import Button from 'flarum/common/components/Button';
import type ItemList from 'flarum/common/utils/ItemList';
import type { Children } from 'mithril';

function handleClearLSCache() {
app
Expand All @@ -16,8 +17,7 @@ function handleClearLSCache() {
}

export default () => {
extend(StatusWidget.prototype, 'toolsItems', (items: ItemList) => {

items.add('clearLSCache', <Button onclick={handleClearLSCache}>{app.translator.trans('acpl-lscache.admin.purge_all')}</Button>)
extend(StatusWidget.prototype, 'toolsItems', (items: ItemList<Children>) => {
items.add('clearLSCache', <Button onclick={handleClearLSCache}>{app.translator.trans('acpl-lscache.admin.purge_all')}</Button>);
});
};
5 changes: 5 additions & 0 deletions js/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
// Use Flarum's tsconfig as a starting point
"extends": "flarum-tsconfig",
// This will match all .ts, .tsx, .d.ts, .js, .jsx files in your `src` folder
// and also tells your Typescript server to read core's global typings for
// access to `dayjs` and `$` in the global namespace.
"include": ["src/**/*", "../vendor/flarum/core/js/dist-typings/@types/**/*"],
"compilerOptions": {
// This will output typings to `dist-typings`
"declarationDir": "./dist-typings",
"baseUrl": ".",
"paths": {
Expand Down
Loading

0 comments on commit 787dff7

Please sign in to comment.