-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8a47e47
Showing
28 changed files
with
3,467 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.{diff,md}] | ||
trim_trailing_whitespace = false | ||
|
||
[*.{php,xml,json}] | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
**/.gitattributes export-ignore | ||
**/.gitignore export-ignore | ||
**/.gitmodules export-ignore | ||
**/.github export-ignore | ||
**/.travis export-ignore | ||
**/.travis.yml export-ignore | ||
**/.editorconfig export-ignore | ||
**/.styleci.yml export-ignore | ||
|
||
**/phpunit.xml export-ignore | ||
**/tests export-ignore | ||
|
||
**/js/dist/**/* -diff | ||
**/js/dist/**/* linguist-generated | ||
**/js/dist-typings/**/* -diff | ||
**/js/dist-typings/**/* linguist-generated | ||
**/js/yarn.lock -diff | ||
**/js/package-lock.json -diff | ||
|
||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: Spam Alert PHP | ||
|
||
on: [workflow_dispatch, push, pull_request] | ||
|
||
jobs: | ||
run: | ||
uses: flarum/framework/.github/workflows/REUSABLE_backend.yml@main | ||
with: | ||
enable_backend_testing: true | ||
|
||
backend_directory: . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Spam Alert JS | ||
|
||
on: [workflow_dispatch, push, pull_request] | ||
|
||
jobs: | ||
run: | ||
uses: flarum/framework/.github/workflows/REUSABLE_frontend.yml@main | ||
with: | ||
enable_bundlewatch: false | ||
enable_prettier: true | ||
enable_typescript: true | ||
|
||
frontend_directory: ./js | ||
backend_directory: . | ||
js_package_manager: npm | ||
main_git_branch: main | ||
secrets: | ||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/vendor | ||
composer.lock | ||
composer.phar | ||
|
||
.DS_Store | ||
Thumbs.db | ||
tests/.phpunit.result.cache | ||
/tests/integration/tmp | ||
.vagrant | ||
.idea/* | ||
.vscode | ||
js/coverage-ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
preset: recommended | ||
|
||
enabled: | ||
- logical_not_operators_with_successor_space | ||
|
||
disabled: | ||
- align_double_arrow | ||
- blank_line_after_opening_tag | ||
- multiline_array_trailing_comma | ||
- new_with_braces | ||
- phpdoc_align | ||
- phpdoc_order | ||
- phpdoc_separation | ||
- phpdoc_types |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Spam Alert | ||
|
||
![License](https://img.shields.io/badge/license-GPL-2.0-blue.svg) [![Latest Stable Version](https://img.shields.io/packagist/v/imdong/flarum-ext-spam-alert.svg)](https://packagist.org/packages/imdong/flarum-ext-spam-alert) [![Total Downloads](https://img.shields.io/packagist/dt/imdong/flarum-ext-spam-alert.svg)](https://packagist.org/packages/imdong/flarum-ext-spam-alert) | ||
|
||
A [Flarum](http://flarum.org) extension. Please don't post meaningless content. | ||
|
||
## Installation | ||
|
||
Install with composer: | ||
|
||
```sh | ||
composer require imdong/flarum-ext-spam-alert:"*" | ||
``` | ||
|
||
## Updating | ||
|
||
```sh | ||
composer update imdong/flarum-ext-spam-alert:"*" | ||
php flarum migrate | ||
php flarum cache:clear | ||
``` | ||
|
||
## Links | ||
|
||
- [Packagist](https://packagist.org/packages/imdong/flarum-ext-spam-alert) | ||
- [GitHub](https://github.com/imdong/flarum-ext-spam-alert) | ||
- [Discuss](https://discuss.flarum.org/d/PUT_DISCUSS_SLUG_HERE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{ | ||
"name": "imdong/flarum-ext-spam-alert", | ||
"description": "Please don't post meaningless content.", | ||
"keywords": [ | ||
"flarum" | ||
], | ||
"type": "flarum-extension", | ||
"license": "GPL-2.0", | ||
"require": { | ||
"flarum/core": "^1.2.0" | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "ImDong", | ||
"email": "[email protected]", | ||
"role": "Developer" | ||
} | ||
], | ||
"autoload": { | ||
"psr-4": { | ||
"ImDong\\SpamAlert\\": "src/" | ||
} | ||
}, | ||
"extra": { | ||
"flarum-extension": { | ||
"title": "Spam Alert", | ||
"category": "", | ||
"icon": { | ||
"name": "", | ||
"color": "", | ||
"backgroundColor": "" | ||
} | ||
}, | ||
"flarum-cli": { | ||
"modules": { | ||
"admin": true, | ||
"forum": true, | ||
"js": true, | ||
"jsCommon": true, | ||
"css": true, | ||
"locale": true, | ||
"gitConf": true, | ||
"githubActions": true, | ||
"prettier": true, | ||
"typescript": true, | ||
"bundlewatch": false, | ||
"backendTesting": true, | ||
"editorConfig": true, | ||
"styleci": true | ||
} | ||
} | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"ImDong\\SpamAlert\\Tests\\": "tests/" | ||
} | ||
}, | ||
"scripts": { | ||
"test": [ | ||
"@test:unit", | ||
"@test:integration" | ||
], | ||
"test:unit": "phpunit -c tests/phpunit.unit.xml", | ||
"test:integration": "phpunit -c tests/phpunit.integration.xml", | ||
"test:setup": "@php tests/integration/setup.php" | ||
}, | ||
"scripts-descriptions": { | ||
"test": "Runs all tests.", | ||
"test:unit": "Runs all unit tests.", | ||
"test:integration": "Runs all integration tests.", | ||
"test:setup": "Sets up a database for use with integration tests. Execute this only once." | ||
}, | ||
"require-dev": { | ||
"flarum/testing": "^1.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of imdong/flarum-ext-spam-alert. | ||
* | ||
* Copyright (c) 2023 ImDong. | ||
* | ||
* For the full copyright and license information, please view the LICENSE.md | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace ImDong\SpamAlert; | ||
|
||
use Flarum\Extend; | ||
|
||
return [ | ||
(new Extend\Frontend('forum')) | ||
->js(__DIR__.'/js/dist/forum.js') | ||
->css(__DIR__.'/less/forum.less'), | ||
(new Extend\Frontend('admin')) | ||
->js(__DIR__.'/js/dist/admin.js') | ||
->css(__DIR__.'/less/admin.less'), | ||
new Extend\Locales(__DIR__.'/locale'), | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.pnp.* | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions | ||
|
||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './src/common'; | ||
export * from './src/admin'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './src/common'; | ||
export * from './src/forum'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "@imdong/flarum-ext-spam-alert", | ||
"private": true, | ||
"version": "0.0.0", | ||
"devDependencies": { | ||
"flarum-webpack-config": "^2.0.0", | ||
"webpack": "^5.65.0", | ||
"webpack-cli": "^4.9.1", | ||
"prettier": "^2.5.1", | ||
"@flarum/prettier-config": "^1.0.0", | ||
"flarum-tsconfig": "^1.0.2", | ||
"typescript": "^4.5.4", | ||
"typescript-coverage-report": "^0.6.1" | ||
}, | ||
"scripts": { | ||
"dev": "webpack --mode development --watch", | ||
"build": "webpack --mode production", | ||
"analyze": "cross-env ANALYZER=true npm run build", | ||
"format": "prettier --write src", | ||
"format-check": "prettier --check src", | ||
"clean-typings": "npx rimraf dist-typings && mkdir dist-typings", | ||
"build-typings": "npm run clean-typings && ([ -e src/@types ] && cp -r src/@types dist-typings/@types || true) && tsc && npm run post-build-typings", | ||
"post-build-typings": "find dist-typings -type f -name '*.d.ts' -print0 | xargs -0 sed -i 's,../src/@types,@types,g'", | ||
"check-typings": "tsc --noEmit --emitDeclarationOnly false", | ||
"check-typings-coverage": "typescript-coverage-report" | ||
}, | ||
"prettier": "@flarum/prettier-config" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import app from 'flarum/admin/app'; | ||
|
||
app.initializers.add('imdong/flarum-ext-spam-alert', () => { | ||
console.log('[imdong/flarum-ext-spam-alert] Hello, admin!'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import app from 'flarum/common/app'; | ||
|
||
app.initializers.add('imdong/flarum-ext-spam-alert', () => { | ||
console.log('[imdong/flarum-ext-spam-alert] Hello, forum and admin!'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import app from 'flarum/forum/app'; | ||
|
||
app.initializers.add('imdong/flarum-ext-spam-alert', () => { | ||
console.log('[imdong/flarum-ext-spam-alert] Hello, forum!'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
// 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/*/*/js/dist-typings/@types/**/*", | ||
// <CUSTOM-1> | ||
// </CUSTOM-1> | ||
"@types/**/*" | ||
], | ||
"compilerOptions": { | ||
// This will output typings to `dist-typings` | ||
"declarationDir": "./dist-typings", | ||
"baseUrl": ".", | ||
"paths": { | ||
"flarum/*": ["../vendor/flarum/core/js/dist-typings/*"], | ||
// <CUSTOM-2> | ||
// </CUSTOM-2> | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('flarum-webpack-config')(); |
Oops, something went wrong.