From 98fa42f2e2db7360a83cf22ae029ddf27f388d3d Mon Sep 17 00:00:00 2001 From: David Taylor Date: Mon, 13 Jan 2025 15:29:26 +0000 Subject: [PATCH] DEV: Move `discourse-common/config/environment` to `discourse/lib` (#30738) --- .../admin/addon/components/admin-report.js | 2 +- .../addon/controllers/admin-dashboard-reports.js | 2 +- .../admin/addon/controllers/admin-email-bounced.js | 2 +- .../admin/addon/controllers/admin-email-received.js | 2 +- .../admin/addon/controllers/admin-email-rejected.js | 2 +- .../admin/addon/controllers/admin-email-sent.js | 2 +- .../admin/addon/controllers/admin-email-skipped.js | 2 +- .../controllers/admin-logs-screened-ip-addresses.js | 2 +- .../addon/controllers/admin-permalinks-index.js | 2 +- .../admin/addon/controllers/admin-site-settings.js | 2 +- .../admin/addon/controllers/admin-users-list-show.js | 2 +- .../admin/addon/controllers/admin-watched-words.js | 2 +- app/assets/javascripts/discourse/app/app.js | 2 +- .../discourse/app/components/ace-editor.gjs | 2 +- .../discourse/app/components/choose-topic.js | 2 +- .../discourse/app/components/composer-messages.js | 2 +- .../discourse/app/components/composer-title.js | 2 +- .../javascripts/discourse/app/components/d-editor.js | 2 +- .../app/components/emoji-picker/content.gjs | 2 +- .../discourse/app/components/glimmer-site-header.gjs | 2 +- .../components/header/hamburger-dropdown-wrapper.gjs | 2 +- .../app/components/header/user-menu-wrapper.gjs | 2 +- .../app/components/modal/avatar-selector.js | 2 +- .../discourse/app/components/post-text-selection.gjs | 2 +- .../edit-navigation-menu/categories-modal.gjs | 2 +- .../sidebar/edit-navigation-menu/tags-modal.gjs | 2 +- .../app/components/software-update-prompt.gjs | 2 +- .../discourse/app/components/topic-timer-info.js | 2 +- .../discourse/app/controllers/application.js | 2 +- .../discourse/app/controllers/groups-index.js | 2 +- .../javascripts/discourse/app/controllers/topic.js | 2 +- .../discourse/app/controllers/user-invited-show.js | 2 +- .../discourse/app/discourse-common-loader-shims.js | 3 +++ .../discourse/app/helpers/page-reloader.js | 2 +- .../discourse/app/helpers/route-action.js | 2 +- .../discourse/app/initializers/dev-tools.js | 2 +- .../app/initializers/discourse-bootstrap.js | 12 ++++++------ .../app/instance-initializers/component-templates.js | 2 +- .../app/instance-initializers/handle-cookies.js | 2 +- .../app/instance-initializers/message-bus.js | 2 +- .../subscribe-user-notifications.js | 2 +- app/assets/javascripts/discourse/app/lib/ajax.js | 2 +- .../javascripts/discourse/app/lib/autocomplete.js | 2 +- .../discourse/app/lib/category-tag-search.js | 2 +- .../javascripts/discourse/app/lib/click-track.js | 2 +- app/assets/javascripts/discourse/app/lib/debounce.js | 2 +- .../config => discourse/app/lib}/environment.js | 0 app/assets/javascripts/discourse/app/lib/eyeline.js | 2 +- .../discourse/app/lib/hashtag-autocomplete.js | 2 +- .../discourse/app/lib/highlight-syntax.js | 2 +- .../javascripts/discourse/app/lib/icon-library.js | 2 +- .../javascripts/discourse/app/lib/key-value-store.js | 2 +- .../discourse/app/lib/keyboard-shortcuts.js | 2 +- app/assets/javascripts/discourse/app/lib/later.js | 2 +- app/assets/javascripts/discourse/app/lib/lightbox.js | 2 +- .../discourse/app/lib/lightbox/constants.js | 2 +- app/assets/javascripts/discourse/app/lib/logout.js | 2 +- app/assets/javascripts/discourse/app/lib/mobile.js | 2 +- .../javascripts/discourse/app/lib/plugin-api.gjs | 2 +- .../javascripts/discourse/app/lib/swipe-events.js | 2 +- .../discourse/app/lib/textarea-text-manipulation.js | 2 +- .../javascripts/discourse/app/lib/transformer.js | 2 +- .../discourse/app/lib/uppy-plugin-base.js | 2 +- app/assets/javascripts/discourse/app/lib/url.js | 2 +- .../javascripts/discourse/app/lib/user-presence.js | 2 +- .../javascripts/discourse/app/lib/user-search.js | 2 +- .../javascripts/discourse/app/lib/zoom-check.js | 2 +- .../javascripts/discourse/app/mapping-router.js | 2 +- .../javascripts/discourse/app/mixins/scroll-top.js | 2 +- app/assets/javascripts/discourse/app/models/site.js | 2 +- app/assets/javascripts/discourse/app/models/user.js | 2 +- .../discourse/app/routes/topic-from-params.js | 2 +- .../javascripts/discourse/app/services/composer.js | 2 +- .../discourse/app/services/history-store.js | 2 +- .../javascripts/discourse/app/services/presence.js | 2 +- .../discourse/app/services/route-scroll-manager.js | 2 +- .../discourse/app/services/screen-track.js | 2 +- .../javascripts/discourse/app/services/user-tips.js | 2 +- app/assets/javascripts/discourse/app/widgets/glue.js | 2 +- app/assets/javascripts/discourse/app/widgets/post.js | 2 +- .../javascripts/discourse/app/widgets/widget.js | 2 +- .../assets/scripts/discourse-test-listen-boot.js | 2 +- .../float-kit/addon/components/d-float-portal.gjs | 2 +- .../float-kit/addon/components/d-menu.gjs | 2 +- .../float-kit/addon/lib/update-position.js | 2 +- .../select-kit/addon/components/icon-picker.js | 2 +- .../select-kit/addon/components/select-kit.js | 2 +- .../discourse/components/browse-channels.gjs | 2 +- .../discourse/components/chat/list/index.gjs | 2 +- .../chat/message-creator/members-selector.gjs | 2 +- .../components/chat/message-creator/search.gjs | 2 +- .../components/chat/routes/channel-info-members.gjs | 2 +- .../discourse/components/chat/selection-manager.gjs | 2 +- .../discourse/controllers/preferences-chat.js | 2 +- .../discourse/services/chat-audio-manager.js | 2 +- .../discourse/services/chat-notification-manager.js | 2 +- .../discourse/components/modal/local-dates-create.js | 2 +- 97 files changed, 103 insertions(+), 100 deletions(-) rename app/assets/javascripts/{discourse-common/addon/config => discourse/app/lib}/environment.js (100%) diff --git a/app/assets/javascripts/admin/addon/components/admin-report.js b/app/assets/javascripts/admin/addon/components/admin-report.js index f8853d2886f..72adb45c590 100644 --- a/app/assets/javascripts/admin/addon/components/admin-report.js +++ b/app/assets/javascripts/admin/addon/components/admin-report.js @@ -5,11 +5,11 @@ import { next } from "@ember/runloop"; import { isPresent } from "@ember/utils"; import { classNameBindings, classNames } from "@ember-decorators/component"; import discourseComputed from "discourse/lib/decorators"; +import { isTesting } from "discourse/lib/environment"; import { exportEntity } from "discourse/lib/export-csv"; import { outputExportResult } from "discourse/lib/export-result"; import { makeArray } from "discourse/lib/helpers"; import ReportLoader from "discourse/lib/reports-loader"; -import { isTesting } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; import Report, { DAILY_LIMIT_DAYS, SCHEMA_VERSION } from "admin/models/report"; diff --git a/app/assets/javascripts/admin/addon/controllers/admin-dashboard-reports.js b/app/assets/javascripts/admin/addon/controllers/admin-dashboard-reports.js index e81df3b80c1..b22a38fe685 100644 --- a/app/assets/javascripts/admin/addon/controllers/admin-dashboard-reports.js +++ b/app/assets/javascripts/admin/addon/controllers/admin-dashboard-reports.js @@ -2,7 +2,7 @@ import Controller from "@ember/controller"; import { action, get } from "@ember/object"; import discourseDebounce from "discourse/lib/debounce"; import discourseComputed from "discourse/lib/decorators"; -import { INPUT_DELAY } from "discourse-common/config/environment"; +import { INPUT_DELAY } from "discourse/lib/environment"; export default class AdminDashboardReportsController extends Controller { filter = null; diff --git a/app/assets/javascripts/admin/addon/controllers/admin-email-bounced.js b/app/assets/javascripts/admin/addon/controllers/admin-email-bounced.js index fbf706526c6..8702cbd8111 100644 --- a/app/assets/javascripts/admin/addon/controllers/admin-email-bounced.js +++ b/app/assets/javascripts/admin/addon/controllers/admin-email-bounced.js @@ -1,7 +1,7 @@ import { action } from "@ember/object"; import { observes } from "@ember-decorators/object"; import discourseDebounce from "discourse/lib/debounce"; -import { INPUT_DELAY } from "discourse-common/config/environment"; +import { INPUT_DELAY } from "discourse/lib/environment"; import AdminEmailLogsController from "admin/controllers/admin-email-logs"; export default class AdminEmailBouncedController extends AdminEmailLogsController { diff --git a/app/assets/javascripts/admin/addon/controllers/admin-email-received.js b/app/assets/javascripts/admin/addon/controllers/admin-email-received.js index e8306f3b17d..8153eb5cc35 100644 --- a/app/assets/javascripts/admin/addon/controllers/admin-email-received.js +++ b/app/assets/javascripts/admin/addon/controllers/admin-email-received.js @@ -1,7 +1,7 @@ import { action } from "@ember/object"; import { observes } from "@ember-decorators/object"; import discourseDebounce from "discourse/lib/debounce"; -import { INPUT_DELAY } from "discourse-common/config/environment"; +import { INPUT_DELAY } from "discourse/lib/environment"; import AdminEmailLogsController from "admin/controllers/admin-email-logs"; import IncomingEmail from "admin/models/incoming-email"; diff --git a/app/assets/javascripts/admin/addon/controllers/admin-email-rejected.js b/app/assets/javascripts/admin/addon/controllers/admin-email-rejected.js index a33112ed383..3df601957e3 100644 --- a/app/assets/javascripts/admin/addon/controllers/admin-email-rejected.js +++ b/app/assets/javascripts/admin/addon/controllers/admin-email-rejected.js @@ -1,7 +1,7 @@ import { action } from "@ember/object"; import { observes } from "@ember-decorators/object"; import discourseDebounce from "discourse/lib/debounce"; -import { INPUT_DELAY } from "discourse-common/config/environment"; +import { INPUT_DELAY } from "discourse/lib/environment"; import AdminEmailLogsController from "admin/controllers/admin-email-logs"; import IncomingEmail from "admin/models/incoming-email"; diff --git a/app/assets/javascripts/admin/addon/controllers/admin-email-sent.js b/app/assets/javascripts/admin/addon/controllers/admin-email-sent.js index d3156fbb7d5..5e8045913de 100644 --- a/app/assets/javascripts/admin/addon/controllers/admin-email-sent.js +++ b/app/assets/javascripts/admin/addon/controllers/admin-email-sent.js @@ -1,6 +1,6 @@ import { observes } from "@ember-decorators/object"; import discourseDebounce from "discourse/lib/debounce"; -import { INPUT_DELAY } from "discourse-common/config/environment"; +import { INPUT_DELAY } from "discourse/lib/environment"; import AdminEmailLogsController from "admin/controllers/admin-email-logs"; export default class AdminEmailSentController extends AdminEmailLogsController { diff --git a/app/assets/javascripts/admin/addon/controllers/admin-email-skipped.js b/app/assets/javascripts/admin/addon/controllers/admin-email-skipped.js index 186514eb0ca..0e37b0b3f23 100644 --- a/app/assets/javascripts/admin/addon/controllers/admin-email-skipped.js +++ b/app/assets/javascripts/admin/addon/controllers/admin-email-skipped.js @@ -1,6 +1,6 @@ import { observes } from "@ember-decorators/object"; import discourseDebounce from "discourse/lib/debounce"; -import { INPUT_DELAY } from "discourse-common/config/environment"; +import { INPUT_DELAY } from "discourse/lib/environment"; import AdminEmailLogsController from "admin/controllers/admin-email-logs"; export default class AdminEmailSkippedController extends AdminEmailLogsController { diff --git a/app/assets/javascripts/admin/addon/controllers/admin-logs-screened-ip-addresses.js b/app/assets/javascripts/admin/addon/controllers/admin-logs-screened-ip-addresses.js index 4b805a1b425..113051cdc62 100644 --- a/app/assets/javascripts/admin/addon/controllers/admin-logs-screened-ip-addresses.js +++ b/app/assets/javascripts/admin/addon/controllers/admin-logs-screened-ip-addresses.js @@ -3,9 +3,9 @@ import { action } from "@ember/object"; import { service } from "@ember/service"; import { observes } from "@ember-decorators/object"; import discourseDebounce from "discourse/lib/debounce"; +import { INPUT_DELAY } from "discourse/lib/environment"; import { exportEntity } from "discourse/lib/export-csv"; import { outputExportResult } from "discourse/lib/export-result"; -import { INPUT_DELAY } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; import ScreenedIpAddress from "admin/models/screened-ip-address"; diff --git a/app/assets/javascripts/admin/addon/controllers/admin-permalinks-index.js b/app/assets/javascripts/admin/addon/controllers/admin-permalinks-index.js index fc29a5f9ea5..90797c549cd 100644 --- a/app/assets/javascripts/admin/addon/controllers/admin-permalinks-index.js +++ b/app/assets/javascripts/admin/addon/controllers/admin-permalinks-index.js @@ -4,8 +4,8 @@ import { or } from "@ember/object/computed"; import { service } from "@ember/service"; import { observes } from "@ember-decorators/object"; import discourseDebounce from "discourse/lib/debounce"; +import { INPUT_DELAY } from "discourse/lib/environment"; import { clipboardCopy } from "discourse/lib/utilities"; -import { INPUT_DELAY } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; import Permalink from "admin/models/permalink"; diff --git a/app/assets/javascripts/admin/addon/controllers/admin-site-settings.js b/app/assets/javascripts/admin/addon/controllers/admin-site-settings.js index 7ecad6bb810..e1de5ee87fa 100644 --- a/app/assets/javascripts/admin/addon/controllers/admin-site-settings.js +++ b/app/assets/javascripts/admin/addon/controllers/admin-site-settings.js @@ -4,8 +4,8 @@ import { alias } from "@ember/object/computed"; import { service } from "@ember/service"; import { isEmpty } from "@ember/utils"; import { debounce } from "discourse/lib/decorators"; +import { INPUT_DELAY } from "discourse/lib/environment"; import SiteSettingFilter from "discourse/lib/site-setting-filter"; -import { INPUT_DELAY } from "discourse-common/config/environment"; export default class AdminSiteSettingsController extends Controller { @service router; diff --git a/app/assets/javascripts/admin/addon/controllers/admin-users-list-show.js b/app/assets/javascripts/admin/addon/controllers/admin-users-list-show.js index ac7e2114795..b73353d4311 100644 --- a/app/assets/javascripts/admin/addon/controllers/admin-users-list-show.js +++ b/app/assets/javascripts/admin/addon/controllers/admin-users-list-show.js @@ -6,7 +6,7 @@ import CanCheckEmailsHelper from "discourse/lib/can-check-emails-helper"; import { computedI18n, setting } from "discourse/lib/computed"; import discourseDebounce from "discourse/lib/debounce"; import discourseComputed, { bind } from "discourse/lib/decorators"; -import { INPUT_DELAY } from "discourse-common/config/environment"; +import { INPUT_DELAY } from "discourse/lib/environment"; import { i18n } from "discourse-i18n"; import BulkUserDeleteConfirmation from "admin/components/bulk-user-delete-confirmation"; import AdminUser from "admin/models/admin-user"; diff --git a/app/assets/javascripts/admin/addon/controllers/admin-watched-words.js b/app/assets/javascripts/admin/addon/controllers/admin-watched-words.js index b65b2da2801..b2a7e1113e3 100644 --- a/app/assets/javascripts/admin/addon/controllers/admin-watched-words.js +++ b/app/assets/javascripts/admin/addon/controllers/admin-watched-words.js @@ -3,7 +3,7 @@ import EmberObject, { action } from "@ember/object"; import { isEmpty } from "@ember/utils"; import { observes } from "@ember-decorators/object"; import discourseDebounce from "discourse/lib/debounce"; -import { INPUT_DELAY } from "discourse-common/config/environment"; +import { INPUT_DELAY } from "discourse/lib/environment"; export default class AdminWatchedWordsController extends Controller { filter = null; diff --git a/app/assets/javascripts/discourse/app/app.js b/app/assets/javascripts/discourse/app/app.js index 31e6f45f906..6d15e44d2cc 100644 --- a/app/assets/javascripts/discourse/app/app.js +++ b/app/assets/javascripts/discourse/app/app.js @@ -15,9 +15,9 @@ import Application from "@ember/application"; import { VERSION } from "@ember/version"; import require from "require"; import { normalizeEmberEventHandling } from "discourse/lib/ember-events"; +import { isTesting } from "discourse/lib/environment"; import { withPluginApi } from "discourse/lib/plugin-api"; import { buildResolver } from "discourse/resolver"; -import { isTesting } from "discourse-common/config/environment"; const _pluginCallbacks = []; let _unhandledThemeErrors = []; diff --git a/app/assets/javascripts/discourse/app/components/ace-editor.gjs b/app/assets/javascripts/discourse/app/components/ace-editor.gjs index 6dda39b27bf..8d2617c205c 100644 --- a/app/assets/javascripts/discourse/app/components/ace-editor.gjs +++ b/app/assets/javascripts/discourse/app/components/ace-editor.gjs @@ -7,8 +7,8 @@ import { buildWaiter } from "@ember/test-waiters"; import { modifier } from "ember-modifier"; import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner"; import { bind } from "discourse/lib/decorators"; +import { isTesting } from "discourse/lib/environment"; import loadAce from "discourse/lib/load-ace-editor"; -import { isTesting } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; const WAITER = buildWaiter("ace-editor"); diff --git a/app/assets/javascripts/discourse/app/components/choose-topic.js b/app/assets/javascripts/discourse/app/components/choose-topic.js index 7a0e3bfb9a9..73e986bf833 100644 --- a/app/assets/javascripts/discourse/app/components/choose-topic.js +++ b/app/assets/javascripts/discourse/app/components/choose-topic.js @@ -4,8 +4,8 @@ import { action } from "@ember/object"; import { isEmpty, isPresent } from "@ember/utils"; import { popupAjaxError } from "discourse/lib/ajax-error"; import { debounce } from "discourse/lib/decorators"; +import { INPUT_DELAY } from "discourse/lib/environment"; import { searchForTerm } from "discourse/lib/search"; -import { INPUT_DELAY } from "discourse-common/config/environment"; // args: // topicChangedCallback diff --git a/app/assets/javascripts/discourse/app/components/composer-messages.js b/app/assets/javascripts/discourse/app/components/composer-messages.js index 9963fbe01aa..223b94df9b7 100644 --- a/app/assets/javascripts/discourse/app/components/composer-messages.js +++ b/app/assets/javascripts/discourse/app/components/composer-messages.js @@ -6,8 +6,8 @@ import { service } from "@ember/service"; import { classNameBindings } from "@ember-decorators/component"; import { ajax } from "discourse/lib/ajax"; import { debounce } from "discourse/lib/decorators"; +import { INPUT_DELAY } from "discourse/lib/environment"; import LinkLookup from "discourse/lib/link-lookup"; -import { INPUT_DELAY } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; let _messagesCache = {}; diff --git a/app/assets/javascripts/discourse/app/components/composer-title.js b/app/assets/javascripts/discourse/app/components/composer-title.js index e3ffd13ff25..53de89fea31 100644 --- a/app/assets/javascripts/discourse/app/components/composer-title.js +++ b/app/assets/javascripts/discourse/app/components/composer-title.js @@ -9,8 +9,8 @@ import { lookupCache } from "pretty-text/oneboxer-cache"; import { ajax } from "discourse/lib/ajax"; import discourseDebounce from "discourse/lib/debounce"; import discourseComputed from "discourse/lib/decorators"; +import { isTesting } from "discourse/lib/environment"; import putCursorAtEnd from "discourse/lib/put-cursor-at-end"; -import { isTesting } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; @classNames("title-input") diff --git a/app/assets/javascripts/discourse/app/components/d-editor.js b/app/assets/javascripts/discourse/app/components/d-editor.js index 494738f570a..1a0732d39a8 100644 --- a/app/assets/javascripts/discourse/app/components/d-editor.js +++ b/app/assets/javascripts/discourse/app/components/d-editor.js @@ -18,6 +18,7 @@ import Toolbar from "discourse/lib/composer/toolbar"; import discourseDebounce from "discourse/lib/debounce"; import discourseComputed, { bind } from "discourse/lib/decorators"; import deprecated from "discourse/lib/deprecated"; +import { isTesting } from "discourse/lib/environment"; import { getRegister } from "discourse/lib/get-owner"; import { hashtagAutocompleteOptions } from "discourse/lib/hashtag-autocomplete"; import { linkSeenHashtagsInContext } from "discourse/lib/hashtag-decorator"; @@ -34,7 +35,6 @@ import { renderUserStatusHtml, } from "discourse/lib/user-status-on-autocomplete"; import virtualElementFromTextRange from "discourse/lib/virtual-element-from-text-range"; -import { isTesting } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; let _createCallbacks = []; diff --git a/app/assets/javascripts/discourse/app/components/emoji-picker/content.gjs b/app/assets/javascripts/discourse/app/components/emoji-picker/content.gjs index 45bb6911718..6ac7891f679 100644 --- a/app/assets/javascripts/discourse/app/components/emoji-picker/content.gjs +++ b/app/assets/javascripts/discourse/app/components/emoji-picker/content.gjs @@ -23,9 +23,9 @@ import { } from "discourse/lib/body-scroll-lock"; import discourseDebounce from "discourse/lib/debounce"; import { bind } from "discourse/lib/decorators"; +import { INPUT_DELAY } from "discourse/lib/environment"; import { makeArray } from "discourse/lib/helpers"; import { emojiUrlFor } from "discourse/lib/text"; -import { INPUT_DELAY } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; import DiversityMenu from "./diversity-menu"; diff --git a/app/assets/javascripts/discourse/app/components/glimmer-site-header.gjs b/app/assets/javascripts/discourse/app/components/glimmer-site-header.gjs index a4e5f01745c..72ba3d0b904 100644 --- a/app/assets/javascripts/discourse/app/components/glimmer-site-header.gjs +++ b/app/assets/javascripts/discourse/app/components/glimmer-site-header.gjs @@ -8,6 +8,7 @@ import { waitForPromise } from "@ember/test-waiters"; import ItsATrap from "@discourse/itsatrap"; import concatClass from "discourse/helpers/concat-class"; import { bind, debounce } from "discourse/lib/decorators"; +import { isTesting } from "discourse/lib/environment"; import discourseLater from "discourse/lib/later"; import scrollLock from "discourse/lib/scroll-lock"; import { @@ -16,7 +17,6 @@ import { } from "discourse/lib/swipe-events"; import { isDocumentRTL } from "discourse/lib/text-direction"; import swipe from "discourse/modifiers/swipe"; -import { isTesting } from "discourse-common/config/environment"; import Header from "./header"; let _menuPanelClassesToForceDropdown = []; diff --git a/app/assets/javascripts/discourse/app/components/header/hamburger-dropdown-wrapper.gjs b/app/assets/javascripts/discourse/app/components/header/hamburger-dropdown-wrapper.gjs index 46d5285d55d..908e46d431e 100644 --- a/app/assets/javascripts/discourse/app/components/header/hamburger-dropdown-wrapper.gjs +++ b/app/assets/javascripts/discourse/app/components/header/hamburger-dropdown-wrapper.gjs @@ -4,10 +4,10 @@ import { on } from "@ember/modifier"; import { action } from "@ember/object"; import { service } from "@ember/service"; import { waitForPromise } from "@ember/test-waiters"; +import { isTesting } from "discourse/lib/environment"; import discourseLater from "discourse/lib/later"; import { isDocumentRTL } from "discourse/lib/text-direction"; import { prefersReducedMotion } from "discourse/lib/utilities"; -import { isTesting } from "discourse-common/config/environment"; import closeOnClickOutside from "../../modifiers/close-on-click-outside"; import SidebarHamburgerDropdown from "../sidebar/hamburger-dropdown"; diff --git a/app/assets/javascripts/discourse/app/components/header/user-menu-wrapper.gjs b/app/assets/javascripts/discourse/app/components/header/user-menu-wrapper.gjs index a5ec97eef08..4f2670462c5 100644 --- a/app/assets/javascripts/discourse/app/components/header/user-menu-wrapper.gjs +++ b/app/assets/javascripts/discourse/app/components/header/user-menu-wrapper.gjs @@ -1,10 +1,10 @@ import Component from "@glimmer/component"; import { hash } from "@ember/helper"; import { action } from "@ember/object"; +import { isTesting } from "discourse/lib/environment"; import discourseLater from "discourse/lib/later"; import { isDocumentRTL } from "discourse/lib/text-direction"; import { prefersReducedMotion } from "discourse/lib/utilities"; -import { isTesting } from "discourse-common/config/environment"; import closeOnClickOutside from "../../modifiers/close-on-click-outside"; import UserMenu from "../user-menu/menu"; diff --git a/app/assets/javascripts/discourse/app/components/modal/avatar-selector.js b/app/assets/javascripts/discourse/app/components/modal/avatar-selector.js index 65460d5ec74..1346b8d8620 100644 --- a/app/assets/javascripts/discourse/app/components/modal/avatar-selector.js +++ b/app/assets/javascripts/discourse/app/components/modal/avatar-selector.js @@ -4,8 +4,8 @@ import { action } from "@ember/object"; import { service } from "@ember/service"; import { ajax } from "discourse/lib/ajax"; import { popupAjaxError } from "discourse/lib/ajax-error"; +import { isTesting } from "discourse/lib/environment"; import { allowsImages } from "discourse/lib/uploads"; -import { isTesting } from "discourse-common/config/environment"; export default class AvatarSelectorModal extends Component { @service currentUser; diff --git a/app/assets/javascripts/discourse/app/components/post-text-selection.gjs b/app/assets/javascripts/discourse/app/components/post-text-selection.gjs index c9e20501884..d9068393ff9 100644 --- a/app/assets/javascripts/discourse/app/components/post-text-selection.gjs +++ b/app/assets/javascripts/discourse/app/components/post-text-selection.gjs @@ -7,6 +7,7 @@ import { modifier } from "ember-modifier"; import PostTextSelectionToolbar from "discourse/components/post-text-selection-toolbar"; import discourseDebounce from "discourse/lib/debounce"; import { bind } from "discourse/lib/decorators"; +import { INPUT_DELAY } from "discourse/lib/environment"; import escapeRegExp from "discourse/lib/escape-regexp"; import isElementInViewport from "discourse/lib/is-element-in-viewport"; import toMarkdown from "discourse/lib/to-markdown"; @@ -17,7 +18,6 @@ import { selectedText, } from "discourse/lib/utilities"; import virtualElementFromTextRange from "discourse/lib/virtual-element-from-text-range"; -import { INPUT_DELAY } from "discourse-common/config/environment"; function getQuoteTitle(element) { const titleEl = element.querySelector(".title"); diff --git a/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/categories-modal.gjs b/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/categories-modal.gjs index 95de77fd0a2..f89f3be1ec1 100644 --- a/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/categories-modal.gjs +++ b/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/categories-modal.gjs @@ -15,8 +15,8 @@ import dirSpan from "discourse/helpers/dir-span"; import loadingSpinner from "discourse/helpers/loading-spinner"; import { popupAjaxError } from "discourse/lib/ajax-error"; import discourseDebounce from "discourse/lib/debounce"; +import { INPUT_DELAY } from "discourse/lib/environment"; import Category from "discourse/models/category"; -import { INPUT_DELAY } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; class ActionSerializer { diff --git a/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/tags-modal.gjs b/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/tags-modal.gjs index 9f6fba018ac..4b78e8cbfcd 100644 --- a/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/tags-modal.gjs +++ b/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/tags-modal.gjs @@ -11,7 +11,7 @@ import ConditionalLoadingSpinner from "discourse/components/conditional-loading- import loadingSpinner from "discourse/helpers/loading-spinner"; import { popupAjaxError } from "discourse/lib/ajax-error"; import discourseDebounce from "discourse/lib/debounce"; -import { INPUT_DELAY } from "discourse-common/config/environment"; +import { INPUT_DELAY } from "discourse/lib/environment"; import { i18n } from "discourse-i18n"; import EditNavigationMenuModal from "./modal"; diff --git a/app/assets/javascripts/discourse/app/components/software-update-prompt.gjs b/app/assets/javascripts/discourse/app/components/software-update-prompt.gjs index f5be6c1de1a..cc7e49f2e1c 100644 --- a/app/assets/javascripts/discourse/app/components/software-update-prompt.gjs +++ b/app/assets/javascripts/discourse/app/components/software-update-prompt.gjs @@ -6,8 +6,8 @@ import { service } from "@ember/service"; import DButton from "discourse/components/d-button"; import concatClass from "discourse/helpers/concat-class"; import { bind } from "discourse/lib/decorators"; +import { isTesting } from "discourse/lib/environment"; import discourseLater from "discourse/lib/later"; -import { isTesting } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; export default class SoftwareUpdatePrompt extends Component { diff --git a/app/assets/javascripts/discourse/app/components/topic-timer-info.js b/app/assets/javascripts/discourse/app/components/topic-timer-info.js index b9785baaefa..333eebff38b 100644 --- a/app/assets/javascripts/discourse/app/components/topic-timer-info.js +++ b/app/assets/javascripts/discourse/app/components/topic-timer-info.js @@ -5,10 +5,10 @@ import { classNames } from "@ember-decorators/component"; import { on } from "@ember-decorators/object"; import { DELETE_REPLIES_TYPE } from "discourse/components/modal/edit-topic-timer"; import discourseComputed from "discourse/lib/decorators"; +import { isTesting } from "discourse/lib/environment"; import { iconHTML } from "discourse/lib/icon-library"; import discourseLater from "discourse/lib/later"; import Category from "discourse/models/category"; -import { isTesting } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; @classNames("topic-timer-info") diff --git a/app/assets/javascripts/discourse/app/controllers/application.js b/app/assets/javascripts/discourse/app/controllers/application.js index fcdf0ae0b10..5c40df41f6a 100644 --- a/app/assets/javascripts/discourse/app/controllers/application.js +++ b/app/assets/javascripts/discourse/app/controllers/application.js @@ -5,7 +5,7 @@ import runAfterFramePaint from "discourse/lib/after-frame-paint"; import discourseDebounce from "discourse/lib/debounce"; import discourseComputed from "discourse/lib/decorators"; import deprecated from "discourse/lib/deprecated"; -import { isTesting } from "discourse-common/config/environment"; +import { isTesting } from "discourse/lib/environment"; const HIDE_SIDEBAR_KEY = "sidebar-hidden"; diff --git a/app/assets/javascripts/discourse/app/controllers/groups-index.js b/app/assets/javascripts/discourse/app/controllers/groups-index.js index 2684eeb8586..ca50a4a2425 100644 --- a/app/assets/javascripts/discourse/app/controllers/groups-index.js +++ b/app/assets/javascripts/discourse/app/controllers/groups-index.js @@ -3,7 +3,7 @@ import { action } from "@ember/object"; import { service } from "@ember/service"; import discourseDebounce from "discourse/lib/debounce"; import discourseComputed from "discourse/lib/decorators"; -import { INPUT_DELAY } from "discourse-common/config/environment"; +import { INPUT_DELAY } from "discourse/lib/environment"; import { i18n } from "discourse-i18n"; export default class GroupsIndexController extends Controller { diff --git a/app/assets/javascripts/discourse/app/controllers/topic.js b/app/assets/javascripts/discourse/app/controllers/topic.js index 55e4c1ef92b..57a219f8e06 100644 --- a/app/assets/javascripts/discourse/app/controllers/topic.js +++ b/app/assets/javascripts/discourse/app/controllers/topic.js @@ -22,6 +22,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error"; import { BookmarkFormData } from "discourse/lib/bookmark-form-data"; import { resetCachedTopicList } from "discourse/lib/cached-topic-list"; import discourseComputed, { bind } from "discourse/lib/decorators"; +import { isTesting } from "discourse/lib/environment"; import { wantsNewWindow } from "discourse/lib/intercept-click"; import discourseLater from "discourse/lib/later"; import { deepMerge } from "discourse/lib/object"; @@ -37,7 +38,6 @@ import Composer from "discourse/models/composer"; import Post from "discourse/models/post"; import Topic from "discourse/models/topic"; import TopicTimer from "discourse/models/topic-timer"; -import { isTesting } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; let customPostMessageCallbacks = {}; diff --git a/app/assets/javascripts/discourse/app/controllers/user-invited-show.js b/app/assets/javascripts/discourse/app/controllers/user-invited-show.js index 3d695cc9443..cfe227aa639 100644 --- a/app/assets/javascripts/discourse/app/controllers/user-invited-show.js +++ b/app/assets/javascripts/discourse/app/controllers/user-invited-show.js @@ -7,8 +7,8 @@ import CreateInvite from "discourse/components/modal/create-invite"; import CreateInviteBulk from "discourse/components/modal/create-invite-bulk"; import { popupAjaxError } from "discourse/lib/ajax-error"; import discourseComputed, { debounce } from "discourse/lib/decorators"; +import { INPUT_DELAY } from "discourse/lib/environment"; import Invite from "discourse/models/invite"; -import { INPUT_DELAY } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; export default class UserInvitedShowController extends Controller { diff --git a/app/assets/javascripts/discourse/app/discourse-common-loader-shims.js b/app/assets/javascripts/discourse/app/discourse-common-loader-shims.js index 74354a5894d..5c5c8bb0310 100644 --- a/app/assets/javascripts/discourse/app/discourse-common-loader-shims.js +++ b/app/assets/javascripts/discourse/app/discourse-common-loader-shims.js @@ -129,3 +129,6 @@ loaderShim("discourse-common/deprecation-workflow", () => importSync("discourse/deprecation-workflow") ); loaderShim("discourse-common/resolver", () => importSync("discourse/resolver")); +loaderShim("discourse-common/config/environment", () => + importSync("discourse/lib/environment") +); diff --git a/app/assets/javascripts/discourse/app/helpers/page-reloader.js b/app/assets/javascripts/discourse/app/helpers/page-reloader.js index e2b83824821..84e55697835 100644 --- a/app/assets/javascripts/discourse/app/helpers/page-reloader.js +++ b/app/assets/javascripts/discourse/app/helpers/page-reloader.js @@ -1,4 +1,4 @@ -import { isTesting } from "discourse-common/config/environment"; +import { isTesting } from "discourse/lib/environment"; export function reload() { if (!isTesting()) { diff --git a/app/assets/javascripts/discourse/app/helpers/route-action.js b/app/assets/javascripts/discourse/app/helpers/route-action.js index 1536594079e..cad61e38caa 100644 --- a/app/assets/javascripts/discourse/app/helpers/route-action.js +++ b/app/assets/javascripts/discourse/app/helpers/route-action.js @@ -5,7 +5,7 @@ import { assert, runInDebug } from "@ember/debug"; import { computed, get } from "@ember/object"; import { getOwner } from "@ember/owner"; import { join } from "@ember/runloop"; -import { isTesting } from "discourse-common/config/environment"; +import { isTesting } from "discourse/lib/environment"; function getCurrentRouteInfos(router) { let routerLib = router._routerMicrolib || router.router; diff --git a/app/assets/javascripts/discourse/app/initializers/dev-tools.js b/app/assets/javascripts/discourse/app/initializers/dev-tools.js index aa3f2b117a1..693a5b6ad3d 100644 --- a/app/assets/javascripts/discourse/app/initializers/dev-tools.js +++ b/app/assets/javascripts/discourse/app/initializers/dev-tools.js @@ -1,5 +1,5 @@ import { DEBUG } from "@glimmer/env"; -import { isDevelopment } from "discourse-common/config/environment"; +import { isDevelopment } from "discourse/lib/environment"; const KEY = "discourse__dev_tools"; diff --git a/app/assets/javascripts/discourse/app/initializers/discourse-bootstrap.js b/app/assets/javascripts/discourse/app/initializers/discourse-bootstrap.js index 9a77268db32..f50296523ee 100644 --- a/app/assets/javascripts/discourse/app/initializers/discourse-bootstrap.js +++ b/app/assets/javascripts/discourse/app/initializers/discourse-bootstrap.js @@ -1,18 +1,18 @@ import { DEBUG } from "@glimmer/env"; import { _backburner } from "@ember/runloop"; import RSVP from "rsvp"; +import { + isDevelopment, + isProduction, + isTesting, + setEnvironment, +} from "discourse/lib/environment"; import { setDefaultOwner } from "discourse/lib/get-owner"; import { setupS3CDN, setupURL } from "discourse/lib/get-url"; import { setIconList } from "discourse/lib/icon-library"; import PreloadStore from "discourse/lib/preload-store"; import { setURLContainer } from "discourse/lib/url"; import Session from "discourse/models/session"; -import { - isDevelopment, - isProduction, - isTesting, - setEnvironment, -} from "discourse-common/config/environment"; import I18n from "discourse-i18n"; export default { diff --git a/app/assets/javascripts/discourse/app/instance-initializers/component-templates.js b/app/assets/javascripts/discourse/app/instance-initializers/component-templates.js index f965614336e..34982dd40d3 100644 --- a/app/assets/javascripts/discourse/app/instance-initializers/component-templates.js +++ b/app/assets/javascripts/discourse/app/instance-initializers/component-templates.js @@ -2,7 +2,7 @@ import * as GlimmerManager from "@glimmer/manager"; import ClassicComponent from "@ember/component"; import deprecated from "discourse/lib/deprecated"; import DiscourseTemplateMap from "discourse/lib/discourse-template-map"; -import { isTesting } from "discourse-common/config/environment"; +import { isTesting } from "discourse/lib/environment"; let THROW_GJS_ERROR = isTesting(); diff --git a/app/assets/javascripts/discourse/app/instance-initializers/handle-cookies.js b/app/assets/javascripts/discourse/app/instance-initializers/handle-cookies.js index d62bc257931..a4d64900c3b 100644 --- a/app/assets/javascripts/discourse/app/instance-initializers/handle-cookies.js +++ b/app/assets/javascripts/discourse/app/instance-initializers/handle-cookies.js @@ -1,8 +1,8 @@ import { later } from "@ember/runloop"; import { extendColorSchemeCookies } from "discourse/lib/color-scheme-picker"; +import { isTesting } from "discourse/lib/environment"; import { extendThemeCookie } from "discourse/lib/theme-selector"; import { extendTextSizeCookie } from "discourse/models/user"; -import { isTesting } from "discourse-common/config/environment"; const DELAY = isTesting() ? 0 : 5000; diff --git a/app/assets/javascripts/discourse/app/instance-initializers/message-bus.js b/app/assets/javascripts/discourse/app/instance-initializers/message-bus.js index a2376c34eb5..eb9f15d6664 100644 --- a/app/assets/javascripts/discourse/app/instance-initializers/message-bus.js +++ b/app/assets/javascripts/discourse/app/instance-initializers/message-bus.js @@ -1,9 +1,9 @@ import $ from "jquery"; import { handleLogoff } from "discourse/lib/ajax"; +import { isProduction, isTesting } from "discourse/lib/environment"; // Initialize the message bus to receive messages. import getURL from "discourse/lib/get-url"; import userPresent, { onPresenceChange } from "discourse/lib/user-presence"; -import { isProduction, isTesting } from "discourse-common/config/environment"; const LONG_POLL_AFTER_UNSEEN_TIME = 1200000; // 20 minutes diff --git a/app/assets/javascripts/discourse/app/instance-initializers/subscribe-user-notifications.js b/app/assets/javascripts/discourse/app/instance-initializers/subscribe-user-notifications.js index 783a701cd9f..c6214168b5d 100644 --- a/app/assets/javascripts/discourse/app/instance-initializers/subscribe-user-notifications.js +++ b/app/assets/javascripts/discourse/app/instance-initializers/subscribe-user-notifications.js @@ -8,13 +8,13 @@ import { init as initDesktopNotifications, onNotification as onDesktopNotification, } from "discourse/lib/desktop-notifications"; +import { isTesting } from "discourse/lib/environment"; import { isPushNotificationsEnabled, register as registerPushNotifications, unsubscribe as unsubscribePushNotifications, } from "discourse/lib/push-notifications"; import Notification from "discourse/models/notification"; -import { isTesting } from "discourse-common/config/environment"; class SubscribeUserNotificationsInit { @service currentUser; diff --git a/app/assets/javascripts/discourse/app/lib/ajax.js b/app/assets/javascripts/discourse/app/lib/ajax.js index e7d0fa60c70..f734553b1a1 100644 --- a/app/assets/javascripts/discourse/app/lib/ajax.js +++ b/app/assets/javascripts/discourse/app/lib/ajax.js @@ -1,12 +1,12 @@ import { run } from "@ember/runloop"; import $ from "jquery"; import { Promise } from "rsvp"; +import { isTesting } from "discourse/lib/environment"; import getURL from "discourse/lib/get-url"; import userPresent from "discourse/lib/user-presence"; import Session from "discourse/models/session"; import Site from "discourse/models/site"; import User from "discourse/models/user"; -import { isTesting } from "discourse-common/config/environment"; let _trackView = false; let _topicId = null; diff --git a/app/assets/javascripts/discourse/app/lib/autocomplete.js b/app/assets/javascripts/discourse/app/lib/autocomplete.js index 5e7414c31ad..157057b9fe0 100644 --- a/app/assets/javascripts/discourse/app/lib/autocomplete.js +++ b/app/assets/javascripts/discourse/app/lib/autocomplete.js @@ -2,12 +2,12 @@ import { cancel } from "@ember/runloop"; import { createPopper } from "@popperjs/core"; import $ from "jquery"; import discourseDebounce from "discourse/lib/debounce"; +import { INPUT_DELAY } from "discourse/lib/environment"; import { iconHTML } from "discourse/lib/icon-library"; import discourseLater from "discourse/lib/later"; import { isDocumentRTL } from "discourse/lib/text-direction"; import { TextareaAutocompleteHandler } from "discourse/lib/textarea-text-manipulation"; import Site from "discourse/models/site"; -import { INPUT_DELAY } from "discourse-common/config/environment"; /** This is a jQuery plugin to support autocompleting values in our text fields. diff --git a/app/assets/javascripts/discourse/app/lib/category-tag-search.js b/app/assets/javascripts/discourse/app/lib/category-tag-search.js index ca298b98cbf..43a8ffabc37 100644 --- a/app/assets/javascripts/discourse/app/lib/category-tag-search.js +++ b/app/assets/javascripts/discourse/app/lib/category-tag-search.js @@ -4,10 +4,10 @@ import { ajax } from "discourse/lib/ajax"; import { CANCELLED_STATUS } from "discourse/lib/autocomplete"; import { SEPARATOR } from "discourse/lib/category-hashtags"; import discourseDebounce from "discourse/lib/debounce"; +import { isTesting } from "discourse/lib/environment"; import discourseLater from "discourse/lib/later"; import { TAG_HASHTAG_POSTFIX } from "discourse/lib/tag-hashtags"; import Category from "discourse/models/category"; -import { isTesting } from "discourse-common/config/environment"; let cache = {}; let cacheTime; diff --git a/app/assets/javascripts/discourse/app/lib/click-track.js b/app/assets/javascripts/discourse/app/lib/click-track.js index 4ffb4e8c0c1..eb53d776bfc 100644 --- a/app/assets/javascripts/discourse/app/lib/click-track.js +++ b/app/assets/javascripts/discourse/app/lib/click-track.js @@ -2,12 +2,12 @@ import jQuery from "jquery"; import { Promise } from "rsvp"; import { ajax } from "discourse/lib/ajax"; import deprecated from "discourse/lib/deprecated"; +import { isTesting } from "discourse/lib/environment"; import { getOwnerWithFallback } from "discourse/lib/get-owner"; import getURL, { samePrefix } from "discourse/lib/get-url"; import { wantsNewWindow } from "discourse/lib/intercept-click"; import DiscourseURL from "discourse/lib/url"; import User from "discourse/models/user"; -import { isTesting } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; export function isValidLink(link) { diff --git a/app/assets/javascripts/discourse/app/lib/debounce.js b/app/assets/javascripts/discourse/app/lib/debounce.js index 37171684b15..b987bbea467 100644 --- a/app/assets/javascripts/discourse/app/lib/debounce.js +++ b/app/assets/javascripts/discourse/app/lib/debounce.js @@ -1,5 +1,5 @@ import { debounce } from "@ember/runloop"; -import { isTesting } from "discourse-common/config/environment"; +import { isTesting } from "discourse/lib/environment"; /** Debounce a Javascript function. This means if it's called many times in a time limit it diff --git a/app/assets/javascripts/discourse-common/addon/config/environment.js b/app/assets/javascripts/discourse/app/lib/environment.js similarity index 100% rename from app/assets/javascripts/discourse-common/addon/config/environment.js rename to app/assets/javascripts/discourse/app/lib/environment.js diff --git a/app/assets/javascripts/discourse/app/lib/eyeline.js b/app/assets/javascripts/discourse/app/lib/eyeline.js index ffa55b95e8b..6f5c6d459b6 100644 --- a/app/assets/javascripts/discourse/app/lib/eyeline.js +++ b/app/assets/javascripts/discourse/app/lib/eyeline.js @@ -1,7 +1,7 @@ import EmberObject from "@ember/object"; import Evented from "@ember/object/evented"; import $ from "jquery"; -import { isTesting } from "discourse-common/config/environment"; +import { isTesting } from "discourse/lib/environment"; let _skipUpdate; let _rootElement; diff --git a/app/assets/javascripts/discourse/app/lib/hashtag-autocomplete.js b/app/assets/javascripts/discourse/app/lib/hashtag-autocomplete.js index 52e06f2e47e..6a8176d6682 100644 --- a/app/assets/javascripts/discourse/app/lib/hashtag-autocomplete.js +++ b/app/assets/javascripts/discourse/app/lib/hashtag-autocomplete.js @@ -3,12 +3,12 @@ import { htmlSafe } from "@ember/template"; import { ajax } from "discourse/lib/ajax"; import { CANCELLED_STATUS } from "discourse/lib/autocomplete"; import discourseDebounce from "discourse/lib/debounce"; +import { INPUT_DELAY, isTesting } from "discourse/lib/environment"; import { getHashtagTypeClasses as getHashtagTypeClassesNew } from "discourse/lib/hashtag-type-registry"; import discourseLater from "discourse/lib/later"; import { findRawTemplate } from "discourse/lib/raw-templates"; import { emojiUnescape } from "discourse/lib/text"; import { escapeExpression } from "discourse/lib/utilities"; -import { INPUT_DELAY, isTesting } from "discourse-common/config/environment"; /** * Sets up a textarea using the jQuery autocomplete plugin, specifically diff --git a/app/assets/javascripts/discourse/app/lib/highlight-syntax.js b/app/assets/javascripts/discourse/app/lib/highlight-syntax.js index 3e0b9b3d07d..55300c540a0 100644 --- a/app/assets/javascripts/discourse/app/lib/highlight-syntax.js +++ b/app/assets/javascripts/discourse/app/lib/highlight-syntax.js @@ -1,8 +1,8 @@ import { DEBUG } from "@glimmer/env"; import { waitForPromise } from "@ember/test-waiters"; +import { isTesting } from "discourse/lib/environment"; import { getURLWithCDN } from "discourse/lib/get-url"; import mergeHTMLPlugin from "discourse/lib/highlight-syntax-merge-html-plugin"; -import { isTesting } from "discourse-common/config/environment"; let _moreLanguages = []; let _plugins = []; diff --git a/app/assets/javascripts/discourse/app/lib/icon-library.js b/app/assets/javascripts/discourse/app/lib/icon-library.js index 6835dbc6db7..410b1be5042 100644 --- a/app/assets/javascripts/discourse/app/lib/icon-library.js +++ b/app/assets/javascripts/discourse/app/lib/icon-library.js @@ -1,8 +1,8 @@ import { h } from "virtual-dom"; import attributeHook from "discourse/lib/attribute-hook"; import deprecated from "discourse/lib/deprecated"; +import { isDevelopment } from "discourse/lib/environment"; import escape from "discourse/lib/escape"; -import { isDevelopment } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; export const SVG_NAMESPACE = "http://www.w3.org/2000/svg"; diff --git a/app/assets/javascripts/discourse/app/lib/key-value-store.js b/app/assets/javascripts/discourse/app/lib/key-value-store.js index e5915f6a1ad..e97dc3b96c1 100644 --- a/app/assets/javascripts/discourse/app/lib/key-value-store.js +++ b/app/assets/javascripts/discourse/app/lib/key-value-store.js @@ -1,4 +1,4 @@ -import { isTesting } from "discourse-common/config/environment"; +import { isTesting } from "discourse/lib/environment"; const TEST_KEY_PREFIX = "__test_"; diff --git a/app/assets/javascripts/discourse/app/lib/keyboard-shortcuts.js b/app/assets/javascripts/discourse/app/lib/keyboard-shortcuts.js index bd34d7962ee..a52d555e694 100644 --- a/app/assets/javascripts/discourse/app/lib/keyboard-shortcuts.js +++ b/app/assets/javascripts/discourse/app/lib/keyboard-shortcuts.js @@ -2,6 +2,7 @@ import { getOwner, setOwner } from "@ember/owner"; import { run, throttle } from "@ember/runloop"; import { ajax } from "discourse/lib/ajax"; import domUtils from "discourse/lib/dom-utils"; +import { INPUT_DELAY } from "discourse/lib/environment"; import discourseLater from "discourse/lib/later"; import { headerOffset } from "discourse/lib/offset-calculator"; import { @@ -11,7 +12,6 @@ import { import DiscourseURL from "discourse/lib/url"; import Composer from "discourse/models/composer"; import { capabilities } from "discourse/services/capabilities"; -import { INPUT_DELAY } from "discourse-common/config/environment"; let disabledBindings = []; export function disableDefaultKeyboardShortcuts(bindings) { diff --git a/app/assets/javascripts/discourse/app/lib/later.js b/app/assets/javascripts/discourse/app/lib/later.js index dee620c0b4e..b14c517ad74 100644 --- a/app/assets/javascripts/discourse/app/lib/later.js +++ b/app/assets/javascripts/discourse/app/lib/later.js @@ -1,5 +1,5 @@ import { later } from "@ember/runloop"; -import { isTesting } from "discourse-common/config/environment"; +import { isTesting } from "discourse/lib/environment"; export default function () { if (isTesting() && typeof [...arguments].at(-1) === "number") { diff --git a/app/assets/javascripts/discourse/app/lib/lightbox.js b/app/assets/javascripts/discourse/app/lib/lightbox.js index 809b8357e99..f4338d5c87c 100644 --- a/app/assets/javascripts/discourse/app/lib/lightbox.js +++ b/app/assets/javascripts/discourse/app/lib/lightbox.js @@ -1,6 +1,7 @@ import $ from "jquery"; import { spinnerHTML } from "discourse/helpers/loading-spinner"; import deprecated from "discourse/lib/deprecated"; +import { isTesting } from "discourse/lib/environment"; import { getOwnerWithFallback } from "discourse/lib/get-owner"; import { helperContext } from "discourse/lib/helpers"; import { renderIcon } from "discourse/lib/icon-library"; @@ -11,7 +12,6 @@ import { postRNWebviewMessage, } from "discourse/lib/utilities"; import User from "discourse/models/user"; -import { isTesting } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; export async function setupLightboxes({ container, selector }) { diff --git a/app/assets/javascripts/discourse/app/lib/lightbox/constants.js b/app/assets/javascripts/discourse/app/lib/lightbox/constants.js index a3e1f1688bf..4be2c4fe1e6 100644 --- a/app/assets/javascripts/discourse/app/lib/lightbox/constants.js +++ b/app/assets/javascripts/discourse/app/lib/lightbox/constants.js @@ -1,4 +1,4 @@ -import { isTesting } from "discourse-common/config/environment"; +import { isTesting } from "discourse/lib/environment"; export const ANIMATION_DURATION = isTesting() || window.matchMedia("(prefers-reduced-motion: reduce)").matches diff --git a/app/assets/javascripts/discourse/app/lib/logout.js b/app/assets/javascripts/discourse/app/lib/logout.js index e443d113811..43320b514ab 100644 --- a/app/assets/javascripts/discourse/app/lib/logout.js +++ b/app/assets/javascripts/discourse/app/lib/logout.js @@ -1,7 +1,7 @@ import { isEmpty } from "@ember/utils"; +import { isTesting } from "discourse/lib/environment"; import getURL from "discourse/lib/get-url"; import { helperContext } from "discourse/lib/helpers"; -import { isTesting } from "discourse-common/config/environment"; export default function logout({ redirect } = {}) { if (isTesting()) { diff --git a/app/assets/javascripts/discourse/app/lib/mobile.js b/app/assets/javascripts/discourse/app/lib/mobile.js index e7b3830f1e0..2501cb12174 100644 --- a/app/assets/javascripts/discourse/app/lib/mobile.js +++ b/app/assets/javascripts/discourse/app/lib/mobile.js @@ -1,5 +1,5 @@ import $ from "jquery"; -import { isTesting } from "discourse-common/config/environment"; +import { isTesting } from "discourse/lib/environment"; let mobileForced = false; diff --git a/app/assets/javascripts/discourse/app/lib/plugin-api.gjs b/app/assets/javascripts/discourse/app/lib/plugin-api.gjs index 471ec541da2..f8be4084c11 100644 --- a/app/assets/javascripts/discourse/app/lib/plugin-api.gjs +++ b/app/assets/javascripts/discourse/app/lib/plugin-api.gjs @@ -68,6 +68,7 @@ import { addPopupMenuOption } from "discourse/lib/composer/custom-popup-menu-opt import deprecated from "discourse/lib/deprecated"; import { registerDesktopNotificationHandler } from "discourse/lib/desktop-notifications"; import { downloadCalendar } from "discourse/lib/download-calendar"; +import { isTesting } from "discourse/lib/environment"; import { getOwnerWithFallback } from "discourse/lib/get-owner"; import { registerHashtagType } from "discourse/lib/hashtag-type-registry"; import { @@ -159,7 +160,6 @@ import { queryRegistry, reopenWidget, } from "discourse/widgets/widget"; -import { isTesting } from "discourse-common/config/environment"; import { addImageWrapperButton } from "discourse-markdown-it/features/image-controls"; import { CUSTOM_USER_SEARCH_OPTIONS } from "select-kit/components/user-chooser"; import { modifySelectKit } from "select-kit/mixins/plugin-api"; diff --git a/app/assets/javascripts/discourse/app/lib/swipe-events.js b/app/assets/javascripts/discourse/app/lib/swipe-events.js index 13f7bbe1b5f..3aab68b9d73 100644 --- a/app/assets/javascripts/discourse/app/lib/swipe-events.js +++ b/app/assets/javascripts/discourse/app/lib/swipe-events.js @@ -1,5 +1,5 @@ import { bind } from "discourse/lib/decorators"; -import { isTesting } from "discourse-common/config/environment"; +import { isTesting } from "discourse/lib/environment"; // common max animation time in ms for swipe events for swipe end // prefers reduced motion and tests return 0 diff --git a/app/assets/javascripts/discourse/app/lib/textarea-text-manipulation.js b/app/assets/javascripts/discourse/app/lib/textarea-text-manipulation.js index d7d06b70924..2472de72dd6 100644 --- a/app/assets/javascripts/discourse/app/lib/textarea-text-manipulation.js +++ b/app/assets/javascripts/discourse/app/lib/textarea-text-manipulation.js @@ -4,6 +4,7 @@ import { service } from "@ember/service"; import { isEmpty } from "@ember/utils"; import $ from "jquery"; import { bind } from "discourse/lib/decorators"; +import { isTesting } from "discourse/lib/environment"; import escapeRegExp from "discourse/lib/escape-regexp"; import putCursorAtEnd from "discourse/lib/put-cursor-at-end"; import { generateLinkifyFunction } from "discourse/lib/text"; @@ -16,7 +17,6 @@ import { inCodeBlock, setCaretPosition, } from "discourse/lib/utilities"; -import { isTesting } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; const INDENT_DIRECTION_LEFT = "left"; diff --git a/app/assets/javascripts/discourse/app/lib/transformer.js b/app/assets/javascripts/discourse/app/lib/transformer.js index c04790b8e9b..8324e2ec258 100644 --- a/app/assets/javascripts/discourse/app/lib/transformer.js +++ b/app/assets/javascripts/discourse/app/lib/transformer.js @@ -1,11 +1,11 @@ import { DEBUG } from "@glimmer/env"; import { capitalize } from "@ember/string"; +import { isTesting } from "discourse/lib/environment"; import { consolePrefix } from "discourse/lib/source-identifier"; import { BEHAVIOR_TRANSFORMERS, VALUE_TRANSFORMERS, } from "discourse/lib/transformer/registry"; -import { isTesting } from "discourse-common/config/environment"; const CORE_TRANSFORMER = "CORE"; const PLUGIN_TRANSFORMER = "PLUGIN"; diff --git a/app/assets/javascripts/discourse/app/lib/uppy-plugin-base.js b/app/assets/javascripts/discourse/app/lib/uppy-plugin-base.js index 4bff35104c1..f3b4257d5e0 100644 --- a/app/assets/javascripts/discourse/app/lib/uppy-plugin-base.js +++ b/app/assets/javascripts/discourse/app/lib/uppy-plugin-base.js @@ -1,7 +1,7 @@ import { warn } from "@ember/debug"; import { BasePlugin } from "@uppy/core"; import { Promise } from "rsvp"; -import { isTesting } from "discourse-common/config/environment"; +import { isTesting } from "discourse/lib/environment"; export class UppyPluginBase extends BasePlugin { constructor(uppy, opts) { diff --git a/app/assets/javascripts/discourse/app/lib/url.js b/app/assets/javascripts/discourse/app/lib/url.js index 7a43b74f506..be9e058e7bb 100644 --- a/app/assets/javascripts/discourse/app/lib/url.js +++ b/app/assets/javascripts/discourse/app/lib/url.js @@ -4,13 +4,13 @@ import { setOwner } from "@ember/owner"; import { next, schedule } from "@ember/runloop"; import { isEmpty } from "@ember/utils"; import $ from "jquery"; +import { isTesting } from "discourse/lib/environment"; import getURL, { withoutPrefix } from "discourse/lib/get-url"; import LockOn from "discourse/lib/lock-on"; import offsetCalculator from "discourse/lib/offset-calculator"; import { defaultHomepage } from "discourse/lib/utilities"; import Category from "discourse/models/category"; import Session from "discourse/models/session"; -import { isTesting } from "discourse-common/config/environment"; const rewrites = []; export const TOPIC_URL_REGEXP = /\/t\/([^\/]*[^\d\/][^\/]*)\/(\d+)\/?(\d+)?/; diff --git a/app/assets/javascripts/discourse/app/lib/user-presence.js b/app/assets/javascripts/discourse/app/lib/user-presence.js index 39f257f54d7..3ba9e7143d9 100644 --- a/app/assets/javascripts/discourse/app/lib/user-presence.js +++ b/app/assets/javascripts/discourse/app/lib/user-presence.js @@ -1,4 +1,4 @@ -import { isTesting } from "discourse-common/config/environment"; +import { isTesting } from "discourse/lib/environment"; const callbacks = []; diff --git a/app/assets/javascripts/discourse/app/lib/user-search.js b/app/assets/javascripts/discourse/app/lib/user-search.js index ac81886f71b..9e8b636d012 100644 --- a/app/assets/javascripts/discourse/app/lib/user-search.js +++ b/app/assets/javascripts/discourse/app/lib/user-search.js @@ -4,10 +4,10 @@ import { ajax } from "discourse/lib/ajax"; import { CANCELLED_STATUS } from "discourse/lib/autocomplete"; import { camelCaseToSnakeCase } from "discourse/lib/case-converter"; import discourseDebounce from "discourse/lib/debounce"; +import { isTesting } from "discourse/lib/environment"; import discourseLater from "discourse/lib/later"; import { userPath } from "discourse/lib/url"; import { emailValid } from "discourse/lib/utilities"; -import { isTesting } from "discourse-common/config/environment"; let cache = {}, cacheKey, diff --git a/app/assets/javascripts/discourse/app/lib/zoom-check.js b/app/assets/javascripts/discourse/app/lib/zoom-check.js index 094b9b52636..63bf2ff623c 100644 --- a/app/assets/javascripts/discourse/app/lib/zoom-check.js +++ b/app/assets/javascripts/discourse/app/lib/zoom-check.js @@ -1,4 +1,4 @@ -import { isTesting } from "discourse-common/config/environment"; +import { isTesting } from "discourse/lib/environment"; // return true when the browser viewport is zoomed export default function isZoomed() { diff --git a/app/assets/javascripts/discourse/app/mapping-router.js b/app/assets/javascripts/discourse/app/mapping-router.js index fcd1e39b480..86c1ab68bca 100644 --- a/app/assets/javascripts/discourse/app/mapping-router.js +++ b/app/assets/javascripts/discourse/app/mapping-router.js @@ -1,7 +1,7 @@ import EmbroiderRouter from "@embroider/router"; +import { isTesting } from "discourse/lib/environment"; import getURL from "discourse/lib/get-url"; import Site from "discourse/models/site"; -import { isTesting } from "discourse-common/config/environment"; import applyRouterHomepageOverrides from "./lib/homepage-router-overrides"; class BareRouter extends EmbroiderRouter { diff --git a/app/assets/javascripts/discourse/app/mixins/scroll-top.js b/app/assets/javascripts/discourse/app/mixins/scroll-top.js index 01f182b8d13..e8920c824f3 100644 --- a/app/assets/javascripts/discourse/app/mixins/scroll-top.js +++ b/app/assets/javascripts/discourse/app/mixins/scroll-top.js @@ -1,6 +1,6 @@ import { scheduleOnce } from "@ember/runloop"; +import { isTesting } from "discourse/lib/environment"; import DiscourseURL from "discourse/lib/url"; -import { isTesting } from "discourse-common/config/environment"; const context = { _scrollTop() { diff --git a/app/assets/javascripts/discourse/app/models/site.js b/app/assets/javascripts/discourse/app/models/site.js index 0cbe6da42d1..2144e34aad2 100644 --- a/app/assets/javascripts/discourse/app/models/site.js +++ b/app/assets/javascripts/discourse/app/models/site.js @@ -6,6 +6,7 @@ import { htmlSafe } from "@ember/template"; import { isEmpty } from "@ember/utils"; import discourseComputed from "discourse/lib/decorators"; import deprecated from "discourse/lib/deprecated"; +import { isRailsTesting, isTesting } from "discourse/lib/environment"; import { getOwnerWithFallback } from "discourse/lib/get-owner"; import PreloadStore from "discourse/lib/preload-store"; import { needsHbrTopicList } from "discourse/lib/raw-templates"; @@ -15,7 +16,6 @@ import Category from "discourse/models/category"; import PostActionType from "discourse/models/post-action-type"; import RestModel from "discourse/models/rest"; import TrustLevel from "discourse/models/trust-level"; -import { isRailsTesting, isTesting } from "discourse-common/config/environment"; @singleton export default class Site extends RestModel { diff --git a/app/assets/javascripts/discourse/app/models/user.js b/app/assets/javascripts/discourse/app/models/user.js index 065adffbc08..487ba070f57 100644 --- a/app/assets/javascripts/discourse/app/models/user.js +++ b/app/assets/javascripts/discourse/app/models/user.js @@ -16,6 +16,7 @@ import { url } from "discourse/lib/computed"; import cookie, { removeCookie } from "discourse/lib/cookie"; import discourseComputed from "discourse/lib/decorators"; import deprecated from "discourse/lib/deprecated"; +import { isTesting } from "discourse/lib/environment"; import { longDate } from "discourse/lib/formatter"; import { getOwnerWithFallback } from "discourse/lib/get-owner"; import getURL, { getURLWithCDN } from "discourse/lib/get-url"; @@ -38,7 +39,6 @@ import UserBadge from "discourse/models/user-badge"; import UserDraftsStream from "discourse/models/user-drafts-stream"; import UserPostsStream from "discourse/models/user-posts-stream"; import UserStream from "discourse/models/user-stream"; -import { isTesting } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; export const SECOND_FACTOR_METHODS = { diff --git a/app/assets/javascripts/discourse/app/routes/topic-from-params.js b/app/assets/javascripts/discourse/app/routes/topic-from-params.js index d2411b947ee..a2482fd9ba1 100644 --- a/app/assets/javascripts/discourse/app/routes/topic-from-params.js +++ b/app/assets/javascripts/discourse/app/routes/topic-from-params.js @@ -2,10 +2,10 @@ import { action } from "@ember/object"; import { schedule } from "@ember/runloop"; import { service } from "@ember/service"; import { isEmpty } from "@ember/utils"; +import { isTesting } from "discourse/lib/environment"; import DiscourseURL from "discourse/lib/url"; import Draft from "discourse/models/draft"; import DiscourseRoute from "discourse/routes/discourse"; -import { isTesting } from "discourse-common/config/environment"; // This route is used for retrieving a topic based on params export default class TopicFromParams extends DiscourseRoute { diff --git a/app/assets/javascripts/discourse/app/services/composer.js b/app/assets/javascripts/discourse/app/services/composer.js index 5d51eb3971b..12ccad94b77 100644 --- a/app/assets/javascripts/discourse/app/services/composer.js +++ b/app/assets/javascripts/discourse/app/services/composer.js @@ -19,6 +19,7 @@ import { customPopupMenuOptions } from "discourse/lib/composer/custom-popup-menu import discourseDebounce from "discourse/lib/debounce"; import discourseComputed from "discourse/lib/decorators"; import deprecated from "discourse/lib/deprecated"; +import { isTesting } from "discourse/lib/environment"; import prepareFormTemplateData, { getFormTemplateObject, } from "discourse/lib/form-template-validation"; @@ -45,7 +46,6 @@ import Composer, { SAVE_LABELS, } from "discourse/models/composer"; import Draft from "discourse/models/draft"; -import { isTesting } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; async function loadDraft(store, opts = {}) { diff --git a/app/assets/javascripts/discourse/app/services/history-store.js b/app/assets/javascripts/discourse/app/services/history-store.js index 7b054c075ed..a5edc2df86a 100644 --- a/app/assets/javascripts/discourse/app/services/history-store.js +++ b/app/assets/javascripts/discourse/app/services/history-store.js @@ -3,8 +3,8 @@ import { cached } from "@glimmer/tracking"; import Service, { service } from "@ember/service"; import { TrackedMap } from "@ember-compat/tracked-built-ins"; import { bind } from "discourse/lib/decorators"; +import { isTesting } from "discourse/lib/environment"; import { disableImplicitInjections } from "discourse/lib/implicit-injections"; -import { isTesting } from "discourse-common/config/environment"; const HISTORY_SIZE = 100; const HISTORIC_KEY = Symbol("historic"); diff --git a/app/assets/javascripts/discourse/app/services/presence.js b/app/assets/javascripts/discourse/app/services/presence.js index e439abe05d3..f60c15ba66d 100644 --- a/app/assets/javascripts/discourse/app/services/presence.js +++ b/app/assets/javascripts/discourse/app/services/presence.js @@ -6,6 +6,7 @@ import Service, { service } from "@ember/service"; import { Promise } from "rsvp"; import { ajax } from "discourse/lib/ajax"; import { bind } from "discourse/lib/decorators"; +import { isTesting } from "discourse/lib/environment"; import getURL from "discourse/lib/get-url"; import { disableImplicitInjections } from "discourse/lib/implicit-injections"; import discourseLater from "discourse/lib/later"; @@ -14,7 +15,6 @@ import userPresent, { removeOnPresenceChange, } from "discourse/lib/user-presence"; import User from "discourse/models/user"; -import { isTesting } from "discourse-common/config/environment"; const PRESENCE_INTERVAL_S = 30; const DEFAULT_PRESENCE_DEBOUNCE_MS = isTesting() ? 0 : 500; diff --git a/app/assets/javascripts/discourse/app/services/route-scroll-manager.js b/app/assets/javascripts/discourse/app/services/route-scroll-manager.js index a55bbfc4878..a615f600cd3 100644 --- a/app/assets/javascripts/discourse/app/services/route-scroll-manager.js +++ b/app/assets/javascripts/discourse/app/services/route-scroll-manager.js @@ -1,8 +1,8 @@ import { next, schedule } from "@ember/runloop"; import Service, { service } from "@ember/service"; import { bind } from "discourse/lib/decorators"; +import { isTesting } from "discourse/lib/environment"; import { disableImplicitInjections } from "discourse/lib/implicit-injections"; -import { isTesting } from "discourse-common/config/environment"; const STORE_KEY = Symbol("scroll-location"); diff --git a/app/assets/javascripts/discourse/app/services/screen-track.js b/app/assets/javascripts/discourse/app/services/screen-track.js index b0311bdab70..de2da9931e7 100644 --- a/app/assets/javascripts/discourse/app/services/screen-track.js +++ b/app/assets/javascripts/discourse/app/services/screen-track.js @@ -2,13 +2,13 @@ import { run } from "@ember/runloop"; import Service, { service } from "@ember/service"; import { ajax } from "discourse/lib/ajax"; import { bind } from "discourse/lib/decorators"; +import { isTesting } from "discourse/lib/environment"; import { disableImplicitInjections } from "discourse/lib/implicit-injections"; import { getHighestReadCache, resetHighestReadCache, setHighestReadCache, } from "discourse/lib/topic-list-tracker"; -import { isTesting } from "discourse-common/config/environment"; // We use this class to track how long posts in a topic are on the screen. const PAUSE_UNLESS_SCROLLED = 1000 * 60 * 3; diff --git a/app/assets/javascripts/discourse/app/services/user-tips.js b/app/assets/javascripts/discourse/app/services/user-tips.js index 8c0e1b9d9d3..f37db93bc76 100644 --- a/app/assets/javascripts/discourse/app/services/user-tips.js +++ b/app/assets/javascripts/discourse/app/services/user-tips.js @@ -1,8 +1,8 @@ import Service, { service } from "@ember/service"; import { TrackedSet } from "@ember-compat/tracked-built-ins"; import discourseDebounce from "discourse/lib/debounce"; +import { isTesting } from "discourse/lib/environment"; import { disableImplicitInjections } from "discourse/lib/implicit-injections"; -import { isTesting } from "discourse-common/config/environment"; @disableImplicitInjections export default class UserTips extends Service { diff --git a/app/assets/javascripts/discourse/app/widgets/glue.js b/app/assets/javascripts/discourse/app/widgets/glue.js index 5ef480969bd..a6881743cf1 100644 --- a/app/assets/javascripts/discourse/app/widgets/glue.js +++ b/app/assets/javascripts/discourse/app/widgets/glue.js @@ -1,8 +1,8 @@ import { cancel, scheduleOnce } from "@ember/runloop"; import { diff, patch } from "virtual-dom"; import DirtyKeys from "discourse/lib/dirty-keys"; +import { isTesting } from "discourse/lib/environment"; import { queryRegistry, traverseCustomWidgets } from "discourse/widgets/widget"; -import { isTesting } from "discourse-common/config/environment"; export default class WidgetGlue { constructor(name, register, attrs) { diff --git a/app/assets/javascripts/discourse/app/widgets/post.js b/app/assets/javascripts/discourse/app/widgets/post.js index 7c3911c6785..4385fed4fe7 100644 --- a/app/assets/javascripts/discourse/app/widgets/post.js +++ b/app/assets/javascripts/discourse/app/widgets/post.js @@ -7,6 +7,7 @@ import { dateNode } from "discourse/helpers/node"; import autoGroupFlairForUser from "discourse/lib/avatar-flair"; import { avatarUrl, translateSize } from "discourse/lib/avatar-utils"; import { registerDeprecationHandler } from "discourse/lib/deprecated"; +import { isTesting } from "discourse/lib/environment"; import { relativeAgeMediumSpan } from "discourse/lib/formatter"; import getURL, { getAbsoluteURL, getURLWithCDN } from "discourse/lib/get-url"; import { iconNode } from "discourse/lib/icon-library"; @@ -27,7 +28,6 @@ import { postTransformCallbacks } from "discourse/widgets/post-stream"; import RawHtml from "discourse/widgets/raw-html"; import RenderGlimmer from "discourse/widgets/render-glimmer"; import { applyDecorators, createWidget } from "discourse/widgets/widget"; -import { isTesting } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; function transformWithCallbacks(post, topicUrl, store) { diff --git a/app/assets/javascripts/discourse/app/widgets/widget.js b/app/assets/javascripts/discourse/app/widgets/widget.js index 71f018a631b..65e914208fc 100644 --- a/app/assets/javascripts/discourse/app/widgets/widget.js +++ b/app/assets/javascripts/discourse/app/widgets/widget.js @@ -3,6 +3,7 @@ import { getOwner, setOwner } from "@ember/owner"; import { camelize } from "@ember/string"; import { Promise } from "rsvp"; import { h } from "virtual-dom"; +import { isProduction } from "discourse/lib/environment"; import { deepMerge } from "discourse/lib/object"; import { consolePrefix } from "discourse/lib/source-identifier"; import DecoratorHelper from "discourse/widgets/decorator-helper"; @@ -25,7 +26,6 @@ import { WidgetTouchMoveHook, WidgetTouchStartHook, } from "discourse/widgets/hooks"; -import { isProduction } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; const _registry = {}; diff --git a/app/assets/javascripts/discourse/public/assets/scripts/discourse-test-listen-boot.js b/app/assets/javascripts/discourse/public/assets/scripts/discourse-test-listen-boot.js index 4a704502c61..2027f3163bc 100644 --- a/app/assets/javascripts/discourse/public/assets/scripts/discourse-test-listen-boot.js +++ b/app/assets/javascripts/discourse/public/assets/scripts/discourse-test-listen-boot.js @@ -1,2 +1,2 @@ -require("discourse-common/config/environment").setEnvironment("qunit-testing"); +require("discourse/lib/environment").setEnvironment("qunit-testing"); require("discourse/tests/test-boot-ember-cli"); diff --git a/app/assets/javascripts/float-kit/addon/components/d-float-portal.gjs b/app/assets/javascripts/float-kit/addon/components/d-float-portal.gjs index 92079c64458..289a196a90f 100644 --- a/app/assets/javascripts/float-kit/addon/components/d-float-portal.gjs +++ b/app/assets/javascripts/float-kit/addon/components/d-float-portal.gjs @@ -1,5 +1,5 @@ import Component from "@glimmer/component"; -import { isTesting } from "discourse-common/config/environment"; +import { isTesting } from "discourse/lib/environment"; export default class DFloatPortal extends Component { get inline() { diff --git a/app/assets/javascripts/float-kit/addon/components/d-menu.gjs b/app/assets/javascripts/float-kit/addon/components/d-menu.gjs index 3534ef336e3..d6e19e2c062 100644 --- a/app/assets/javascripts/float-kit/addon/components/d-menu.gjs +++ b/app/assets/javascripts/float-kit/addon/components/d-menu.gjs @@ -9,7 +9,7 @@ import { and } from "truth-helpers"; import DButton from "discourse/components/d-button"; import DModal from "discourse/components/d-modal"; import concatClass from "discourse/helpers/concat-class"; -import { isTesting } from "discourse-common/config/environment"; +import { isTesting } from "discourse/lib/environment"; import DFloatBody from "float-kit/components/d-float-body"; import { MENU } from "float-kit/lib/constants"; import DMenuInstance from "float-kit/lib/d-menu-instance"; diff --git a/app/assets/javascripts/float-kit/addon/lib/update-position.js b/app/assets/javascripts/float-kit/addon/lib/update-position.js index e62a398cdc8..4f5ca701614 100644 --- a/app/assets/javascripts/float-kit/addon/lib/update-position.js +++ b/app/assets/javascripts/float-kit/addon/lib/update-position.js @@ -7,9 +7,9 @@ import { shift, } from "@floating-ui/dom"; import domFromString from "discourse/lib/dom-from-string"; +import { isTesting } from "discourse/lib/environment"; import { iconHTML } from "discourse/lib/icon-library"; import { headerOffset } from "discourse/lib/offset-calculator"; -import { isTesting } from "discourse-common/config/environment"; import { FLOAT_UI_PLACEMENTS } from "float-kit/lib/constants"; const centerOffset = offset(({ rects }) => { diff --git a/app/assets/javascripts/select-kit/addon/components/icon-picker.js b/app/assets/javascripts/select-kit/addon/components/icon-picker.js index 97e008e249f..859e9629445 100644 --- a/app/assets/javascripts/select-kit/addon/components/icon-picker.js +++ b/app/assets/javascripts/select-kit/addon/components/icon-picker.js @@ -2,13 +2,13 @@ import { action, computed } from "@ember/object"; import { classNames } from "@ember-decorators/component"; import $ from "jquery"; import { ajax } from "discourse/lib/ajax"; +import { isDevelopment } from "discourse/lib/environment"; import { makeArray } from "discourse/lib/helpers"; import { convertIconClass, disableMissingIconWarning, enableMissingIconWarning, } from "discourse/lib/icon-library"; -import { isDevelopment } from "discourse-common/config/environment"; import FilterForMore from "select-kit/components/filter-for-more"; import MultiSelectComponent from "select-kit/components/multi-select"; import { diff --git a/app/assets/javascripts/select-kit/addon/components/select-kit.js b/app/assets/javascripts/select-kit/addon/components/select-kit.js index 16961bdbf82..20981bf52ca 100644 --- a/app/assets/javascripts/select-kit/addon/components/select-kit.js +++ b/app/assets/javascripts/select-kit/addon/components/select-kit.js @@ -14,8 +14,8 @@ import { Promise } from "rsvp"; import discourseDebounce from "discourse/lib/debounce"; import { bind as bindDecorator } from "discourse/lib/decorators"; import deprecated from "discourse/lib/deprecated"; +import { INPUT_DELAY } from "discourse/lib/environment"; import { makeArray } from "discourse/lib/helpers"; -import { INPUT_DELAY } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; import { applyContentPluginApiCallbacks, diff --git a/plugins/chat/assets/javascripts/discourse/components/browse-channels.gjs b/plugins/chat/assets/javascripts/discourse/components/browse-channels.gjs index af504b8d724..fc360e3f245 100644 --- a/plugins/chat/assets/javascripts/discourse/components/browse-channels.gjs +++ b/plugins/chat/assets/javascripts/discourse/components/browse-channels.gjs @@ -10,7 +10,7 @@ import { eq } from "truth-helpers"; import DButton from "discourse/components/d-button"; import FilterInput from "discourse/components/filter-input"; import discourseDebounce from "discourse/lib/debounce"; -import { INPUT_DELAY } from "discourse-common/config/environment"; +import { INPUT_DELAY } from "discourse/lib/environment"; import { i18n } from "discourse-i18n"; import List from "discourse/plugins/chat/discourse/components/chat/list"; import ChatModalNewMessage from "discourse/plugins/chat/discourse/components/chat/modal/new-message"; diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/list/index.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/list/index.gjs index 7fd2ceb32b3..45990091dce 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat/list/index.gjs +++ b/plugins/chat/assets/javascripts/discourse/components/chat/list/index.gjs @@ -4,8 +4,8 @@ import { action } from "@ember/object"; import { modifier } from "ember-modifier"; import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner"; import discourseDebounce from "discourse/lib/debounce"; +import { INPUT_DELAY } from "discourse/lib/environment"; import isElementInViewport from "discourse/lib/is-element-in-viewport"; -import { INPUT_DELAY } from "discourse-common/config/environment"; import EmptyState from "./empty-state"; import Item from "./item"; diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/members-selector.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/members-selector.gjs index 9158dfeb8a6..e2e2a4a67d6 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/members-selector.gjs +++ b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/members-selector.gjs @@ -4,7 +4,7 @@ import { action } from "@ember/object"; import { service } from "@ember/service"; import DButton from "discourse/components/d-button"; import discourseDebounce from "discourse/lib/debounce"; -import { INPUT_DELAY } from "discourse-common/config/environment"; +import { INPUT_DELAY } from "discourse/lib/environment"; import { i18n } from "discourse-i18n"; import ChatablesLoader from "./lib/chatables-loader"; import List from "./list"; diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/search.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/search.gjs index 26454b92b2a..dc92d14f68b 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/search.gjs +++ b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/search.gjs @@ -7,7 +7,7 @@ import { service } from "@ember/service"; import DButton from "discourse/components/d-button"; import { popupAjaxError } from "discourse/lib/ajax-error"; import discourseDebounce from "discourse/lib/debounce"; -import { INPUT_DELAY } from "discourse-common/config/environment"; +import { INPUT_DELAY } from "discourse/lib/environment"; import { i18n } from "discourse-i18n"; import { MODES } from "./constants"; import ChatablesLoader from "./lib/chatables-loader"; diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-info-members.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-info-members.gjs index c71be51f9b7..25e90324cb8 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-info-members.gjs +++ b/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-info-members.gjs @@ -8,10 +8,10 @@ import { service } from "@ember/service"; import { modifier } from "ember-modifier"; import FilterInput from "discourse/components/filter-input"; import discourseDebounce from "discourse/lib/debounce"; +import { INPUT_DELAY } from "discourse/lib/environment"; import isElementInViewport from "discourse/lib/is-element-in-viewport"; import DiscourseURL, { userPath } from "discourse/lib/url"; import autoFocus from "discourse/modifiers/auto-focus"; -import { INPUT_DELAY } from "discourse-common/config/environment"; import icon from "discourse-common/helpers/d-icon"; import { i18n } from "discourse-i18n"; import MessageCreator from "discourse/plugins/chat/discourse/components/chat/message-creator"; diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/selection-manager.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/selection-manager.gjs index e1bdffbe303..2d8bceb1c00 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat/selection-manager.gjs +++ b/plugins/chat/assets/javascripts/discourse/components/chat/selection-manager.gjs @@ -6,8 +6,8 @@ import { not, or } from "truth-helpers"; import DButton from "discourse/components/d-button"; import { popupAjaxError } from "discourse/lib/ajax-error"; import { bind } from "discourse/lib/decorators"; +import { isTesting } from "discourse/lib/environment"; import { clipboardCopyAsync } from "discourse/lib/utilities"; -import { isTesting } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; import DeleteMessagesConfirm from "discourse/plugins/chat/discourse/components/chat/modal/delete-messages-confirm"; import ChatModalMoveMessageToChannel from "discourse/plugins/chat/discourse/components/chat/modal/move-message-to-channel"; diff --git a/plugins/chat/assets/javascripts/discourse/controllers/preferences-chat.js b/plugins/chat/assets/javascripts/discourse/controllers/preferences-chat.js index 718b817b593..4da09e5ba15 100644 --- a/plugins/chat/assets/javascripts/discourse/controllers/preferences-chat.js +++ b/plugins/chat/assets/javascripts/discourse/controllers/preferences-chat.js @@ -3,7 +3,7 @@ import { action } from "@ember/object"; import { service } from "@ember/service"; import { popupAjaxError } from "discourse/lib/ajax-error"; import discourseComputed from "discourse/lib/decorators"; -import { isTesting } from "discourse-common/config/environment"; +import { isTesting } from "discourse/lib/environment"; import { i18n } from "discourse-i18n"; import { CHAT_SOUNDS } from "discourse/plugins/chat/discourse/services/chat-audio-manager"; diff --git a/plugins/chat/assets/javascripts/discourse/services/chat-audio-manager.js b/plugins/chat/assets/javascripts/discourse/services/chat-audio-manager.js index a37c8703507..0a85f5b1111 100644 --- a/plugins/chat/assets/javascripts/discourse/services/chat-audio-manager.js +++ b/plugins/chat/assets/javascripts/discourse/services/chat-audio-manager.js @@ -1,6 +1,6 @@ import Service from "@ember/service"; +import { isTesting } from "discourse/lib/environment"; import { getURLWithCDN } from "discourse/lib/get-url"; -import { isTesting } from "discourse-common/config/environment"; export const CHAT_SOUNDS = { bell: [{ src: "/plugins/chat/audio/bell.mp3", type: "audio/mpeg" }], diff --git a/plugins/chat/assets/javascripts/discourse/services/chat-notification-manager.js b/plugins/chat/assets/javascripts/discourse/services/chat-notification-manager.js index d4644525b7c..970242e42bf 100644 --- a/plugins/chat/assets/javascripts/discourse/services/chat-notification-manager.js +++ b/plugins/chat/assets/javascripts/discourse/services/chat-notification-manager.js @@ -4,7 +4,7 @@ import { alertChannel, onNotification as onDesktopNotification, } from "discourse/lib/desktop-notifications"; -import { isTesting } from "discourse-common/config/environment"; +import { isTesting } from "discourse/lib/environment"; export default class ChatNotificationManager extends Service { @service chat; diff --git a/plugins/discourse-local-dates/assets/javascripts/discourse/components/modal/local-dates-create.js b/plugins/discourse-local-dates/assets/javascripts/discourse/components/modal/local-dates-create.js index 50248e32227..c6e3aaad9ad 100644 --- a/plugins/discourse-local-dates/assets/javascripts/discourse/components/modal/local-dates-create.js +++ b/plugins/discourse-local-dates/assets/javascripts/discourse/components/modal/local-dates-create.js @@ -5,9 +5,9 @@ import { schedule } from "@ember/runloop"; import { observes } from "@ember-decorators/object"; import { propertyNotEqual } from "discourse/lib/computed"; import computed, { debounce } from "discourse/lib/decorators"; +import { INPUT_DELAY } from "discourse/lib/environment"; import { applyLocalDates } from "discourse/lib/local-dates"; import { cook } from "discourse/lib/text"; -import { INPUT_DELAY } from "discourse-common/config/environment"; import { i18n } from "discourse-i18n"; import generateDateMarkup from "discourse/plugins/discourse-local-dates/lib/local-date-markup-generator";