DEV: Update linting config and run gjs-codemod

This commit is contained in:
Jarek Radosz 2025-06-04 17:53:24 +02:00
parent 8ded9fd43a
commit 682890a3c2
No known key found for this signature in database
GPG Key ID: 98C198E7019429B3
6 changed files with 485 additions and 1011 deletions

View File

@ -1,3 +1,4 @@
< 3.5.0.beta5-dev: 8ded9fd43a5b010579c54b0de1f674f23596cfc4
< 3.5.0.beta3-dev: 5ad224e3b3a369fe1cbacd19733f647654dcbb49
< 3.5.0.beta1-dev: 2cab4e99e04cd6a9067abb1115b1de29a968f1f7
< 3.4.0.beta2-dev: ba7630cd78bf2a50981cafc0a613df9439cb5968

View File

@ -14,30 +14,31 @@ GEM
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
ast (2.4.2)
base64 (0.2.0)
benchmark (0.4.0)
bigdecimal (3.1.9)
ast (2.4.3)
base64 (0.3.0)
benchmark (0.4.1)
bigdecimal (3.2.2)
concurrent-ruby (1.3.5)
connection_pool (2.5.0)
drb (2.2.1)
connection_pool (2.5.3)
drb (2.2.3)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
json (2.10.2)
language_server-protocol (3.17.0.4)
json (2.12.2)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
logger (1.6.6)
logger (1.7.0)
minitest (5.25.5)
parallel (1.26.3)
parser (3.3.7.1)
parallel (1.27.0)
parser (3.3.8.0)
ast (~> 2.4.1)
racc
prettier_print (1.2.1)
prism (1.4.0)
racc (1.8.1)
rack (3.1.12)
rack (3.1.15)
rainbow (3.1.1)
regexp_parser (2.10.0)
rubocop (1.74.0)
rubocop (1.76.0)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
@ -45,11 +46,12 @@ GEM
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.38.0, < 2.0)
rubocop-ast (>= 1.45.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.39.0)
parser (>= 3.3.1.0)
rubocop-ast (1.45.0)
parser (>= 3.3.7.2)
prism (~> 1.4)
rubocop-capybara (2.22.1)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
@ -65,13 +67,13 @@ GEM
rubocop-factory_bot (2.27.1)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-rails (2.30.3)
rubocop-rails (2.32.0)
activesupport (>= 4.2.0)
lint_roller (~> 1.1)
rack (>= 1.1)
rubocop (>= 1.72.1, < 2.0)
rubocop-ast (>= 1.38.0, < 2.0)
rubocop-rspec (3.5.0)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.44.0, < 2.0)
rubocop-rspec (3.6.0)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-rspec_rails (2.31.0)
@ -98,4 +100,4 @@ DEPENDENCIES
syntax_tree
BUNDLED WITH
2.6.6
2.6.9

View File

@ -1,8 +1,15 @@
import Component from "@glimmer/component";
import { concat } from "@ember/helper";
import { action } from "@ember/object";
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
import willDestroy from "@ember/render-modifiers/modifiers/will-destroy";
import { service } from "@ember/service";
import PluginOutlet from "discourse/components/plugin-outlet";
import SearchMenu from "discourse/components/search-menu";
import htmlSafe from "discourse/helpers/html-safe";
import { defaultHomepage } from "discourse/lib/utilities";
import { i18n } from "discourse-i18n";
import SearchIcon from "./search-icon";
export default class SearchBanner extends Component {
@service router;
@ -68,4 +75,38 @@ export default class SearchBanner extends Component {
// but we need it for backwards compatibility
document.documentElement.classList.add("display-search-banner");
}
<template>
{{#if this.shouldDisplay}}
<div
class="{{concat settings.plugin_outlet '-outlet'}}
search-banner welcome-banner"
>
<div
class="custom-search-banner welcome-banner__inner-wrapper"
{{didInsert this.didInsert}}
{{willDestroy this.willDestroy}}
>
<div class="wrap custom-search-banner-wrap welcome-banner__wrap">
<h1>{{htmlSafe (i18n (themePrefix "search_banner.headline"))}}</h1>
<PluginOutlet @name="search-banner-below-headline" />
<p>{{htmlSafe (i18n (themePrefix "search_banner.subhead"))}}</p>
<div class="search-menu welcome-banner__search-menu">
{{#unless this.buttonText}}
<SearchIcon />
{{/unless}}
<SearchMenu @searchInputId="custom-search-input" />
{{#if this.buttonText}}
<SearchIcon
@buttonText={{this.buttonText}}
@buttonClass="has-search-button-text"
/>
{{/if}}
</div>
<PluginOutlet @name="search-banner-below-input" />
</div>
</div>
</div>
{{/if}}
</template>
}

View File

@ -1,31 +0,0 @@
{{#if this.shouldDisplay}}
<div
class="{{concat (theme-setting 'plugin_outlet') '-outlet'}}
search-banner welcome-banner"
>
<div
class="custom-search-banner welcome-banner__inner-wrapper"
{{did-insert this.didInsert}}
{{will-destroy this.willDestroy}}
>
<div class="wrap custom-search-banner-wrap welcome-banner__wrap">
<h1>{{html-safe (theme-i18n "search_banner.headline")}}</h1>
<PluginOutlet @name="search-banner-below-headline" />
<p>{{html-safe (theme-i18n "search_banner.subhead")}}</p>
<div class="search-menu welcome-banner__search-menu">
{{#unless this.buttonText}}
<SearchIcon />
{{/unless}}
<SearchMenu @searchInputId="custom-search-input" />
{{#if this.buttonText}}
<SearchIcon
@buttonText={{this.buttonText}}
@buttonClass="has-search-button-text"
/>
{{/if}}
</div>
<PluginOutlet @name="search-banner-below-input" />
</div>
</div>
</div>
{{/if}}

View File

@ -1,11 +1,11 @@
{
"private": true,
"devDependencies": {
"@discourse/lint-configs": "2.11.1",
"ember-template-lint": "7.0.1",
"eslint": "9.22.0",
"@discourse/lint-configs": "2.25.0",
"ember-template-lint": "7.8.1",
"eslint": "9.28.0",
"prettier": "3.5.3",
"stylelint": "16.16.0"
"stylelint": "16.20.0"
},
"engines": {
"node": ">= 22",

File diff suppressed because it is too large Load Diff