Skip to content

Commit

Permalink
Merge remote-tracking branch 'extensions_pusher/REWRITE'
Browse files Browse the repository at this point in the history
  • Loading branch information
askvortsov1 committed Mar 11, 2022
2 parents 105acba + c942e36 commit fecb58d
Show file tree
Hide file tree
Showing 35 changed files with 3,744 additions and 0 deletions.
19 changes: 19 additions & 0 deletions extensions/pusher/.editorconfig
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
18 changes: 18 additions & 0 deletions extensions/pusher/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.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/* linguist-generated
js/yarn.lock -diff

* text=auto eol=lf
15 changes: 15 additions & 0 deletions extensions/pusher/.github/workflows/backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Pusher PHP

on: [workflow_dispatch, push, pull_request]

# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.

jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_backend.yml@main
with:
enable_backend_testing: false

backend_directory: .
21 changes: 21 additions & 0 deletions extensions/pusher/.github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Pusher JS

on: [workflow_dispatch, push, pull_request]

# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.

jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_frontend.yml@main
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: true

frontend_directory: ./js
main_git_branch: master

secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
12 changes: 12 additions & 0 deletions extensions/pusher/.gitignore
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
14 changes: 14 additions & 0 deletions extensions/pusher/.styleci.yml
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
65 changes: 65 additions & 0 deletions extensions/pusher/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Changelog

## [1.2.0](https://github.com/flarum/pusher/compare/v1.1.0...v1.2.0)

### Changed
- Convert to TypeScript (https://github.com/flarum/pusher/pull/34).
- Replace jQuery with vanilla JS (https://github.com/flarum/pusher/pull/35).

### Fixed
- Discussion list pagination breaks when clicking on the update button (https://github.com/flarum/pusher/pull/33).

## [1.1.0](https://github.com/flarum/pusher/compare/v1.0.0...v1.1.0)

No changes.

## [1.0.0](https://github.com/flarum/pusher/compare/v0.1.0-beta.16...v1.0.0)

### Added
- Make non public discussions realtime (https://github.com/flarum/pusher/pull/17)

### Changed
- Compatibility with Flarum v1.0.0.

## [0.1.0-beta.16](https://github.com/flarum/pusher/compare/v0.1.0-beta.15...v0.1.0-beta.16)

### Changed
- Moved locale files from translation pack to extension (https://github.com/flarum/pusher/pull/26)

## [0.1.0-beta.15](https://github.com/flarum/pusher/compare/v0.1.0-beta.14.1...v0.1.0-beta.15)

### Changed
- Updated composer.json and admin javascript for new admin area.
- Updated to use newest extenders.

## [0.1.0-beta.14.1](https://github.com/flarum/pusher/compare/v0.1.0-beta.14...v0.1.0-beta.14.1)

### Fixed
- Children were incorrectly passed to show update highlight
- Update discussion list caused an error (#27)

## [0.1.0-beta.14](https://github.com/flarum/pusher/compare/v0.1.0-beta.13...v0.1.0-beta.14)

### Changed
- Updated mithril to version 2
- Load language strings correctly on en-/disable
- Updated JS dependencies

### Fixed
- Publish no events for tags when flarum/tags isn't installed (#25)

## [0.1.0-beta.13](https://github.com/flarum/pusher/compare/v0.1.0-beta.12...v0.1.0-beta.13)

### Changed
- Use different CDN for loading Pusher JS library (#20)
- Updated JS dependencies

## [0.1.0-beta.9](https://github.com/flarum/pusher/compare/v0.1.0-beta.8.1...v0.1.0-beta.9)

### Changed
- Replace event subscribers (that resolve services too early) with listeners ([da0f0af](https://github.com/flarum/pusher/commit/da0f0afb24bae39535b4beaf750f311c403adef1) and [28a70ff](https://github.com/flarum/pusher/commit/28a70ff074014bc75acee6eff7a74faecf5ae341))

## [0.1.0-beta.8.1](https://github.com/flarum/pusher/compare/v0.1.0-beta.8...v0.1.0-beta.8.1)

### Fixed
- Fix broken functionality ([00b127c](https://github.com/flarum/pusher/commit/00b127c576e5554bc04b491ec47ae57f8525fac3))
22 changes: 22 additions & 0 deletions extensions/pusher/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2019-2021 Stichting Flarum (Flarum Foundation)
Copyright (c) 2014-2019 Toby Zerner (toby.zerner@gmail.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
64 changes: 64 additions & 0 deletions extensions/pusher/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"name": "flarum/pusher",
"description": "See new discussions and posts in real-time using Pusher.",
"type": "flarum-extension",
"keywords": [
"discussion"
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"source": "https://github.com/flarum/pusher",
"forum": "https://discuss.flarum.org"
},
"homepage": "https://flarum.org",
"funding": [
{
"type": "website",
"url": "https://flarum.org/donate/"
}
],
"require": {
"flarum/core": "^1.2",
"pusher/pusher-php-server": "^2.2"
},
"autoload": {
"psr-4": {
"Flarum\\Pusher\\": "src/"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
},
"flarum-extension": {
"title": "Pusher",
"category": "feature",
"icon": {
"image": "icon.png",
"backgroundSize": "46% 63%",
"backgroundPosition": "center",
"backgroundRepeat": "no-repeat",
"backgroundColor": "#40bad8",
"color": "#fff"
}
},
"flarum-cli": {
"modules": {
"admin": true,
"forum": true,
"js": true,
"jsCommon": false,
"css": true,
"gitConf": true,
"githubActions": true,
"prettier": true,
"typescript": true,
"bundlewatch": false,
"backendTesting": false,
"editorConfig": true,
"styleci": true
}
}
}
}
42 changes: 42 additions & 0 deletions extensions/pusher/extend.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/

use Flarum\Extend;
use Flarum\Post\Event\Posted;
use Flarum\Pusher\Api\Controller\AuthController;
use Flarum\Pusher\Listener;
use Flarum\Pusher\Provider\PusherProvider;
use Flarum\Pusher\PusherNotificationDriver;

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'),

(new Extend\Routes('api'))
->post('/pusher/auth', 'pusher.auth', AuthController::class),

new Extend\Locales(__DIR__.'/locale'),

(new Extend\Notification())
->driver('pusher', PusherNotificationDriver::class),

(new Extend\Settings())
->serializeToForum('pusherKey', 'flarum-pusher.app_key')
->serializeToForum('pusherCluster', 'flarum-pusher.app_cluster'),

(new Extend\Event())
->listen(Posted::class, Listener\PushNewPost::class),

(new Extend\ServiceProvider())
->register(PusherProvider::class),
];
Binary file added extensions/pusher/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions extensions/pusher/js/.gitignore
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
1 change: 1 addition & 0 deletions extensions/pusher/js/admin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './src/admin';
1 change: 1 addition & 0 deletions extensions/pusher/js/dist-typings/admin/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
8 changes: 8 additions & 0 deletions extensions/pusher/js/dist-typings/forum/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import * as PusherTypes from 'pusher-js';
export declare type PusherBinding = {
channels: {
main: PusherTypes.Channel;
user: PusherTypes.Channel | null;
};
pusher: PusherTypes.default;
};
2 changes: 2 additions & 0 deletions extensions/pusher/js/dist/admin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions extensions/pusher/js/dist/admin.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fecb58d

Please sign in to comment.