* chore: merge the app with the container & implement the ApplicationContract
Illuminate components always expect the app to be the container, but also expect the app to be implementing the laravel app contract. This means that very often between minor illuminate updates we get a call to a method on the app that doesn't exist in the Flarum app. This fixes the issue once and for all.
* chore: improve concern implementation readability
* chore: service provider no longer has to change app type
* chore: unimplement `terminat(e/ing)`
* Apply fixes from StyleCI
* chore: recover `container` prop
* chore: return types
* fix: phpstan errors
* Do not catch exceptions when testing Console commands
This allows to easily test a case where a command should throw using `$this->expectException()`.
* Rewrite ConsoleTest to use expectException
Now that the ConsoleApplication is set to not catch exceptions.
---------
Co-authored-by: IanM <16573496+imorland@users.noreply.github.com>
* feat: add tag search
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* feat(mentions): tag mentions backend
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* feat: tag mention design
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* refactor: revamp mentions autocomplete
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* fix: unauthorized mention of hidden groups
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* feat(mentions,tags): use hash format for tag mentions
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* refactor: frontend mention format API with mentionable models
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* feat: implement tag search on the frontend
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* fix: tag color contrast
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* fix: tag suggestions styling
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* test: works with disabled tags extension
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* chore: move `MentionFormats` to `formats`
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* fix: mentions preview bad styling
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* docs: further migration location clarification
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* Apply fixes from StyleCI
* fix: bad test namespace
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* fix: phpstan
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* fix: conditionally add tag related extenders
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* Apply fixes from StyleCI
* feat(phpstan): evaluate conditional extenders
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* feat: use mithril routing for tag mentions
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
---------
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
* feat(phpstan): pick up extended model relations typings
* feat(phpstan): pick up extended model date attributes
* feat(core): introduce `castAttribute` extender
Stops using `dates` as it's deprecated in laravel 8
* feat(phpstan): pick up extended model attributes through casts
* fix: extenders not resolved when declared namespace
* fix(phpstan): new model attributes are always nullable
* chore(phpstan): add helpful cache clearing command
* Apply fixes from StyleCI
* chore: improve extend files provider logic
* chore: rename `castAttribute` to just `cast`
* chore: update phpstan package to detect `cast` method
* Update framework/core/src/Extend/Model.php
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
We can't update to larastan v2 until we update to laravel v9 which has to wait for Flarum v2, so we need to stay on phpstan v1.8
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* Make it possible to extend Flarum\Testing\integration\Setup\SetupScript and added public methods to add settings or extensions to in initial installation pipeline
* Fix syntax error, unexpected 'static'
* Remove `addExtensions` method and document `addSettings`
* test: password tokens are generated and deleted on password change
* chore: delete all password tokens when the password is changed
* test: email tokens are generated and deleted on email change
* test: email tokens are deleted after password reset
* chore: delete email tokens after password change
* test: password tokens are deleted after email change
* chore: delete password tokens after email change
* chore: syntactic sugar
* chore: unify event listening
With all the commits below, we resolve all outstanding typing issues in the repo, and CI jobs run green.
* fix: Convert DashboardPage and DashboardWidget to TypeScript
* fix: fix type errors in package manager ext
* fix: Convert Post component to TypeScript
* fix: avatar typings should accept null user
* fix: convert Notification component to TypeScript
* fix: properly use `typeof` in ForumApplication
* feat: make Notification content attr generic
* chore: format Notification component
* fix: Convert DiscussionRenamedNotification to TypeScript
* fix(pusher) move shims to a location where they get applied
* fix(pusher): fix some typing errors
* fix(akismet): fix some typing issues
* chore: update core dist typings
* chore(pusher): format
* fix: anchorScroll should accept string selectors
* fix: more accurately represent ApiQueryParamsPlural
* fix: convert PostStreamState to TypeScript
* chore(core): rebuild typings
* feat: allow extending app.routes
* fix: more flexible typings for highlight.ts
* fix: use primitive `number` type for Discussion typings
* fix: convert DiscussionListItem to TypeScript
* chore: rebuild core typings
* fix: final pusher type fixes
* feat: start tags TypeScript conversion
* fix: require-dev tags in pusher for CI TypeScript purposes.
* chore(core): format
* chore(tags): build dist typings
* feat(pusher): use dist types from tags.
* feat: convert flags to TypeScript
* chore(flags): generate dist typings
* fix(akismet): last type errors
* chore: update .yarn-integrity
* chore: partially run flarum-cli audit infra --fix
The tsconfig changes from that command are ignored, since we don't yet support "replacable sections" that would let us add custom config.
* chore: use type imports
* fix: broader gitattributes
* chore: run flarum-cli audit infra --monorepo --fix
* feat: make `app.data` typings extensible
* chore(core): format
* chore: boost tags TypeScript coverage
* fix(tags): further increase type coverage.
In normal Flarum, extensions are only enabled during requests. Here, however, we enable some during boot. This resolves the FilesystemManager early, which resolves the Url Generator early. To fix this, we directly provide a filesystem disk for assets instead of getting it from the filesystem manager.
This ensures a clean state for the extension currently being tested. The alternative requires the user to create and keep track of multiple test databases, or manually delete/re-recreate the database every time they switch between extensions being tested. Now, a simple `composer test:setup` will always reset the test environment to the original state.
Since we're making changes for the dev version of core, we should test against that too.
For now, this fixes issues with the `extensions` method of `Installation` being undefined.
This allows adding settings before the app is booted. In the past we've used hacky workarounds like manually resetting a binding to override singletons to use custom setting values. It makes sense to support this through `TestCase`.