From 0f55e6313ff88652fc9f8bdf2d92748252228c8b Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Tue, 26 Sep 2023 17:47:31 -0700 Subject: [PATCH] Enable Embroider/Webpack code spliting for Wizard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Move Wizard back into main app, remove Wizard addon * Remove Wizard-related resolver or build hacks * Add a `app/static` folder in the app, add it to `staticAppPaths` * Install and enable `@embroider/router` * Add "wizard" to `splitAtRoutes` In a fully optimized Embroider app, route-based code splitting more or less Just Work™ – install `@embroider/router`, subclass from it, configure which routes you want to split and that's about it. However, our app is not "fully optimized", by which I mean we are not able to turn on all the `static*` flags. In Embroider, "static" means "statically analyzable". Specifically it means that all inter-dependencies between modules (files) are explicitly expressed as `import`s, as opposed to `{{i18n ...}}` magically means "look for the default export in app/helpers/i18n.js" or something even more dynamic with the resolver. Without turning on those flags, Embroider behaves conservatively, slurps up all `app` files eagerly into the primary bundle/chunks. So, while you _could_ turn on route-based code splitting, there won't be much to split. The commits leading up to this involves a bunch of refactors and cleanups that 1) works perfectly fine in the classic build, 2) are good and useful in their own right, but also 3) re-arranged thigns such that most dependencies are now explicit. With those in place, I was able to move all the wizard code into the "app/static" folder. Embrodier does not eagerly pull things from this folder into any bundle, unless something explicitly "asks" for them via `imports`. Conversely, thigns from this folder are not registered with the resolver and are not added to the `loader.js` registry. In conjunction with route-based code splitting, we now have the ability to split out islands of on-demand functionalities from the main app bundle. When you split a route in Embroider, it automatically creates a bundle/entrypoint with the relevant routes/templates/controllers matching that route prefix. Anything they import will be added to the bundle as well, assuming they are not alreay in the main app bundle, which is where the "app/static" folder comes into play. The "app/static" folder name is not special. It is configured in ember-cli-build.js. Alternatively, we could have left everything in their normal locations, and add more fine-grained paths to the `staticAppPaths` array. I just thought it would be easy to manage and scale, and less error-prone to do it this way. Note that putting things in `app/static` does not guarentee that it would not be part of the main app bundle. For example, if we were to add an `import ... from "app/static/wizard/...";` in a main bundle file (say, `app.js`), then that chunk of the module graph would be pulled in. (Consider using `await import(...)`?) Overtime, we can build better tooling (e.g. lint rules and babel macros to make things less repetitive) as we expand the use of this pattern, but this is a start. --- .../javascripts/bootstrap-json/index.js | 6 +- .../discourse-common/addon/lib/deprecated.js | 2 +- .../addon/lib/discourse-template-map.js | 2 +- .../discourse-common/addon/lib/loader-shim.js | 2 +- .../discourse-common/addon/resolver.js | 31 ------- .../discourse/app/mapping-router.js | 4 +- .../discourse/app/routes/app-route-map.js | 4 + .../addon => discourse/app}/routes/wizard.js | 2 +- .../app/routes/wizard/index.js} | 0 .../app/routes/wizard/step.js} | 0 .../wizard}/components/discourse-logo.gjs | 0 .../wizard}/components/fields/checkbox.hbs | 0 .../wizard}/components/fields/checkbox.js | 0 .../wizard}/components/fields/checkboxes.hbs | 0 .../wizard}/components/fields/checkboxes.js | 0 .../wizard}/components/fields/component.gjs | 0 .../fields/components/-homepage-preview.js | 0 .../fields/components/-preview-base.hbs | 0 .../fields/components/-preview-base.js | 0 .../components/fields/components/index.js | 0 .../fields/components/styling-preview.hbs | 0 .../fields/components/styling-preview.js | 0 .../wizard}/components/fields/dropdown.hbs | 0 .../wizard}/components/fields/dropdown.js | 0 .../fields/image-previews/generic.hbs | 0 .../fields/image-previews/generic.js | 0 .../components/fields/image-previews/index.js | 0 .../fields/image-previews/logo-small.js | 0 .../components/fields/image-previews/logo.js | 0 .../wizard}/components/fields/image.hbs | 0 .../static/wizard}/components/fields/image.js | 0 .../static/wizard}/components/fields/index.js | 0 .../static/wizard}/components/fields/text.hbs | 0 .../static/wizard}/components/fields/text.js | 0 .../wizard}/components/wizard-canvas.gjs | 0 .../wizard}/components/wizard-field.gjs | 0 .../static/wizard}/components/wizard-step.gjs | 0 .../app/static/wizard}/lib/preview.js | 0 .../app/static/wizard}/models/wizard.js | 0 .../app}/templates/wizard.gjs | 2 +- .../app/templates/wizard}/step.gjs | 4 +- .../javascripts/discourse/ember-cli-build.js | 9 +- app/assets/javascripts/discourse/package.json | 2 +- .../tests/acceptance/sidebar-user-test.js | 1 + .../discourse/tests/acceptance/wizard-test.js | 1 + .../tests/helpers}/wizard-pretender.js | 0 .../javascripts/discourse/tests/index.html | 1 - .../tests/unit/ember/resolver-test.js | 90 ------------------- .../tests/unit/models/wizard-field-test.js | 2 +- app/assets/javascripts/package.json | 3 +- app/assets/javascripts/wizard/.npmrc | 1 - .../wizard/addon/routes/wizard-route-map.js | 5 -- app/assets/javascripts/wizard/app/.gitkeep | 0 .../wizard/config/ember-cli-update.json | 20 ----- .../javascripts/wizard/ember-cli-build.js | 20 ----- app/assets/javascripts/wizard/index.js | 31 ------- app/assets/javascripts/wizard/package.json | 70 --------------- app/assets/javascripts/yarn.lock | 12 ++- config/initializers/assets.rb | 1 - jsconfig.json | 4 - lib/ember_cli.rb | 1 - spec/integrity/coding_style_spec.rb | 1 - 62 files changed, 31 insertions(+), 303 deletions(-) rename app/assets/javascripts/{wizard/addon => discourse/app}/routes/wizard.js (91%) rename app/assets/javascripts/{wizard/addon/routes/wizard-index.js => discourse/app/routes/wizard/index.js} (100%) rename app/assets/javascripts/{wizard/addon/routes/wizard-step.js => discourse/app/routes/wizard/step.js} (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/discourse-logo.gjs (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/checkbox.hbs (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/checkbox.js (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/checkboxes.hbs (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/checkboxes.js (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/component.gjs (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/components/-homepage-preview.js (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/components/-preview-base.hbs (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/components/-preview-base.js (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/components/index.js (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/components/styling-preview.hbs (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/components/styling-preview.js (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/dropdown.hbs (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/dropdown.js (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/image-previews/generic.hbs (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/image-previews/generic.js (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/image-previews/index.js (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/image-previews/logo-small.js (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/image-previews/logo.js (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/image.hbs (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/image.js (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/index.js (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/text.hbs (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/text.js (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/wizard-canvas.gjs (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/wizard-field.gjs (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/wizard-step.gjs (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/lib/preview.js (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/models/wizard.js (100%) rename app/assets/javascripts/{wizard/addon => discourse/app}/templates/wizard.gjs (80%) rename app/assets/javascripts/{wizard/addon/templates => discourse/app/templates/wizard}/step.gjs (89%) rename app/assets/javascripts/{wizard/addon/test-helpers => discourse/tests/helpers}/wizard-pretender.js (100%) delete mode 100644 app/assets/javascripts/wizard/.npmrc delete mode 100644 app/assets/javascripts/wizard/addon/routes/wizard-route-map.js delete mode 100644 app/assets/javascripts/wizard/app/.gitkeep delete mode 100644 app/assets/javascripts/wizard/config/ember-cli-update.json delete mode 100644 app/assets/javascripts/wizard/ember-cli-build.js delete mode 100644 app/assets/javascripts/wizard/index.js delete mode 100644 app/assets/javascripts/wizard/package.json diff --git a/app/assets/javascripts/bootstrap-json/index.js b/app/assets/javascripts/bootstrap-json/index.js index a069821aee7a8..2f992a2cb7634 100644 --- a/app/assets/javascripts/bootstrap-json/index.js +++ b/app/assets/javascripts/bootstrap-json/index.js @@ -68,15 +68,11 @@ function head(buffer, bootstrap, headers, baseURL) { if (bootstrap.preloaded.currentUser) { const user = JSON.parse(bootstrap.preloaded.currentUser); - let { admin, staff } = user; + let { staff } = user; if (staff) { buffer.push(``); } - - if (admin) { - buffer.push(``); - } } bootstrap.plugin_js.forEach((src) => diff --git a/app/assets/javascripts/discourse-common/addon/lib/deprecated.js b/app/assets/javascripts/discourse-common/addon/lib/deprecated.js index 0dc0fea964015..c5076edc99ecc 100644 --- a/app/assets/javascripts/discourse-common/addon/lib/deprecated.js +++ b/app/assets/javascripts/discourse-common/addon/lib/deprecated.js @@ -38,7 +38,7 @@ export default function deprecated(msg, options = {}) { let consolePrefix = ""; if (window.Discourse) { - // This module doesn't exist in pretty-text/wizard/etc. + // This module doesn't exist in pretty-text etc. consolePrefix = require("discourse/lib/source-identifier").consolePrefix() || ""; } diff --git a/app/assets/javascripts/discourse-common/addon/lib/discourse-template-map.js b/app/assets/javascripts/discourse-common/addon/lib/discourse-template-map.js index 51ec2c6c3c34c..2a254f54606a4 100644 --- a/app/assets/javascripts/discourse-common/addon/lib/discourse-template-map.js +++ b/app/assets/javascripts/discourse-common/addon/lib/discourse-template-map.js @@ -8,7 +8,7 @@ function appendToCache(cache, key, value) { cache.set(key, cachedValue); } -const NAMESPACES = ["discourse/", "wizard/", "admin/"]; +const NAMESPACES = ["discourse/", "admin/"]; function isInRecognisedNamespace(moduleName) { for (const ns of NAMESPACES) { diff --git a/app/assets/javascripts/discourse-common/addon/lib/loader-shim.js b/app/assets/javascripts/discourse-common/addon/lib/loader-shim.js index 6fe66c42debea..f0368c42fa82e 100644 --- a/app/assets/javascripts/discourse-common/addon/lib/loader-shim.js +++ b/app/assets/javascripts/discourse-common/addon/lib/loader-shim.js @@ -16,7 +16,7 @@ let { define: __define__, require: __require__ } = globalThis; // it appears to be unused in the static analysis. // // For Discourse, the AMD/loader.js mechanism is an important glue. It is what -// allows Discourse core/admin/wizard/plugins to all be separate .js bundlers +// allows Discourse core/admin/plugins to all be separate .js bundlers // and be "glued back together" as full module graph in the browser. // // For instance, a plugin module can `import Post from "discourse/models/post"; diff --git a/app/assets/javascripts/discourse-common/addon/resolver.js b/app/assets/javascripts/discourse-common/addon/resolver.js index 651e48be51f65..9db4d96d80cf7 100644 --- a/app/assets/javascripts/discourse-common/addon/resolver.js +++ b/app/assets/javascripts/discourse-common/addon/resolver.js @@ -135,7 +135,6 @@ function lookupModuleBySuffix(suffix) { "discourse-common/", "select-kit/", "admin/", - "wizard/", "truth-helpers/", ]; Object.keys(requirejs.entries).forEach((name) => { @@ -215,18 +214,12 @@ export function buildResolver(baseName) { const dashed = dasherize(split[1].replace(/[\.\/]/g, "-")); const adminBase = `admin/${type}s/`; - const wizardBase = `wizard/${type}s/`; if ( lookupModuleBySuffix(`${type}s/${dashed}`) || requirejs.entries[adminBase + dashed] || requirejs.entries[adminBase + dashed.replace(/^admin[-]/, "")] || requirejs.entries[ adminBase + dashed.replace(/^admin[-]/, "").replace(/-/g, "_") - ] || - requirejs.entries[wizardBase + dashed] || - requirejs.entries[wizardBase + dashed.replace(/^wizard[-]/, "")] || - requirejs.entries[ - wizardBase + dashed.replace(/^wizard[-]/, "").replace(/-/g, "_") ] ) { corrected = type + ":" + dashed; @@ -282,7 +275,6 @@ export function buildResolver(baseName) { this.findMobileTemplate(parsedName) || this.findTemplate(parsedName) || this.findAdminTemplate(parsedName) || - this.findWizardTemplate(parsedName) || this.findLoadingTemplate(parsedName) || this.findConnectorTemplate(parsedName) || this.discourseTemplateModule("not_found") @@ -386,28 +378,5 @@ export function buildResolver(baseName) { return resolved; } - - findWizardTemplate(parsedName) { - if (parsedName.fullNameWithoutType === "wizard") { - return this.discourseTemplateModule("wizard/templates/wizard"); - } - - let namespaced; - - if (parsedName.fullNameWithoutType.startsWith("components/")) { - // Look up components as-is - namespaced = parsedName.fullNameWithoutType; - } else if (/^wizard[_\.-]/.test(parsedName.fullNameWithoutType)) { - // This may only get hit for the loading routes and may be removable. - namespaced = parsedName.fullNameWithoutType.slice(7); - } - - if (namespaced) { - let wizardParsedName = this.parseName( - `template:wizard/templates/${namespaced}` - ); - return this.findTemplate(wizardParsedName); - } - } }; } diff --git a/app/assets/javascripts/discourse/app/mapping-router.js b/app/assets/javascripts/discourse/app/mapping-router.js index 6c051f26af2a8..757dbc200bfc6 100644 --- a/app/assets/javascripts/discourse/app/mapping-router.js +++ b/app/assets/javascripts/discourse/app/mapping-router.js @@ -1,11 +1,11 @@ -import EmberRouter from "@ember/routing/router"; +import EmbroiderRouter from "@embroider/router"; import { rewritePath } from "discourse/lib/url"; import { defaultHomepage } from "discourse/lib/utilities"; import Site from "discourse/models/site"; import { isTesting } from "discourse-common/config/environment"; import getURL from "discourse-common/lib/get-url"; -const BareRouter = EmberRouter.extend({ +const BareRouter = EmbroiderRouter.extend({ location: isTesting() ? "none" : "discourse-location", handleURL(url) { diff --git a/app/assets/javascripts/discourse/app/routes/app-route-map.js b/app/assets/javascripts/discourse/app/routes/app-route-map.js index 5c64d985c7fba..0eae83097a76a 100644 --- a/app/assets/javascripts/discourse/app/routes/app-route-map.js +++ b/app/assets/javascripts/discourse/app/routes/app-route-map.js @@ -278,4 +278,8 @@ export default function () { this.route("show", { path: "/:token" }); } ); + + this.route("wizard", function () { + this.route("step", { path: "/steps/:step_id" }); + }); } diff --git a/app/assets/javascripts/wizard/addon/routes/wizard.js b/app/assets/javascripts/discourse/app/routes/wizard.js similarity index 91% rename from app/assets/javascripts/wizard/addon/routes/wizard.js rename to app/assets/javascripts/discourse/app/routes/wizard.js index c78c766adb5e4..f32f0409a346d 100644 --- a/app/assets/javascripts/wizard/addon/routes/wizard.js +++ b/app/assets/javascripts/discourse/app/routes/wizard.js @@ -1,6 +1,6 @@ import Route from "@ember/routing/route"; import DisableSidebar from "discourse/mixins/disable-sidebar"; -import Wizard from "wizard/models/wizard"; +import Wizard from "discourse/static/wizard/models/wizard"; export default class WizardRoute extends Route.extend(DisableSidebar) { model() { diff --git a/app/assets/javascripts/wizard/addon/routes/wizard-index.js b/app/assets/javascripts/discourse/app/routes/wizard/index.js similarity index 100% rename from app/assets/javascripts/wizard/addon/routes/wizard-index.js rename to app/assets/javascripts/discourse/app/routes/wizard/index.js diff --git a/app/assets/javascripts/wizard/addon/routes/wizard-step.js b/app/assets/javascripts/discourse/app/routes/wizard/step.js similarity index 100% rename from app/assets/javascripts/wizard/addon/routes/wizard-step.js rename to app/assets/javascripts/discourse/app/routes/wizard/step.js diff --git a/app/assets/javascripts/wizard/addon/components/discourse-logo.gjs b/app/assets/javascripts/discourse/app/static/wizard/components/discourse-logo.gjs similarity index 100% rename from app/assets/javascripts/wizard/addon/components/discourse-logo.gjs rename to app/assets/javascripts/discourse/app/static/wizard/components/discourse-logo.gjs diff --git a/app/assets/javascripts/wizard/addon/components/fields/checkbox.hbs b/app/assets/javascripts/discourse/app/static/wizard/components/fields/checkbox.hbs similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/checkbox.hbs rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/checkbox.hbs diff --git a/app/assets/javascripts/wizard/addon/components/fields/checkbox.js b/app/assets/javascripts/discourse/app/static/wizard/components/fields/checkbox.js similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/checkbox.js rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/checkbox.js diff --git a/app/assets/javascripts/wizard/addon/components/fields/checkboxes.hbs b/app/assets/javascripts/discourse/app/static/wizard/components/fields/checkboxes.hbs similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/checkboxes.hbs rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/checkboxes.hbs diff --git a/app/assets/javascripts/wizard/addon/components/fields/checkboxes.js b/app/assets/javascripts/discourse/app/static/wizard/components/fields/checkboxes.js similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/checkboxes.js rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/checkboxes.js diff --git a/app/assets/javascripts/wizard/addon/components/fields/component.gjs b/app/assets/javascripts/discourse/app/static/wizard/components/fields/component.gjs similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/component.gjs rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/component.gjs diff --git a/app/assets/javascripts/wizard/addon/components/fields/components/-homepage-preview.js b/app/assets/javascripts/discourse/app/static/wizard/components/fields/components/-homepage-preview.js similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/components/-homepage-preview.js rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/components/-homepage-preview.js diff --git a/app/assets/javascripts/wizard/addon/components/fields/components/-preview-base.hbs b/app/assets/javascripts/discourse/app/static/wizard/components/fields/components/-preview-base.hbs similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/components/-preview-base.hbs rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/components/-preview-base.hbs diff --git a/app/assets/javascripts/wizard/addon/components/fields/components/-preview-base.js b/app/assets/javascripts/discourse/app/static/wizard/components/fields/components/-preview-base.js similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/components/-preview-base.js rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/components/-preview-base.js diff --git a/app/assets/javascripts/wizard/addon/components/fields/components/index.js b/app/assets/javascripts/discourse/app/static/wizard/components/fields/components/index.js similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/components/index.js rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/components/index.js diff --git a/app/assets/javascripts/wizard/addon/components/fields/components/styling-preview.hbs b/app/assets/javascripts/discourse/app/static/wizard/components/fields/components/styling-preview.hbs similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/components/styling-preview.hbs rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/components/styling-preview.hbs diff --git a/app/assets/javascripts/wizard/addon/components/fields/components/styling-preview.js b/app/assets/javascripts/discourse/app/static/wizard/components/fields/components/styling-preview.js similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/components/styling-preview.js rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/components/styling-preview.js diff --git a/app/assets/javascripts/wizard/addon/components/fields/dropdown.hbs b/app/assets/javascripts/discourse/app/static/wizard/components/fields/dropdown.hbs similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/dropdown.hbs rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/dropdown.hbs diff --git a/app/assets/javascripts/wizard/addon/components/fields/dropdown.js b/app/assets/javascripts/discourse/app/static/wizard/components/fields/dropdown.js similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/dropdown.js rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/dropdown.js diff --git a/app/assets/javascripts/wizard/addon/components/fields/image-previews/generic.hbs b/app/assets/javascripts/discourse/app/static/wizard/components/fields/image-previews/generic.hbs similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/image-previews/generic.hbs rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/image-previews/generic.hbs diff --git a/app/assets/javascripts/wizard/addon/components/fields/image-previews/generic.js b/app/assets/javascripts/discourse/app/static/wizard/components/fields/image-previews/generic.js similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/image-previews/generic.js rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/image-previews/generic.js diff --git a/app/assets/javascripts/wizard/addon/components/fields/image-previews/index.js b/app/assets/javascripts/discourse/app/static/wizard/components/fields/image-previews/index.js similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/image-previews/index.js rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/image-previews/index.js diff --git a/app/assets/javascripts/wizard/addon/components/fields/image-previews/logo-small.js b/app/assets/javascripts/discourse/app/static/wizard/components/fields/image-previews/logo-small.js similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/image-previews/logo-small.js rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/image-previews/logo-small.js diff --git a/app/assets/javascripts/wizard/addon/components/fields/image-previews/logo.js b/app/assets/javascripts/discourse/app/static/wizard/components/fields/image-previews/logo.js similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/image-previews/logo.js rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/image-previews/logo.js diff --git a/app/assets/javascripts/wizard/addon/components/fields/image.hbs b/app/assets/javascripts/discourse/app/static/wizard/components/fields/image.hbs similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/image.hbs rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/image.hbs diff --git a/app/assets/javascripts/wizard/addon/components/fields/image.js b/app/assets/javascripts/discourse/app/static/wizard/components/fields/image.js similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/image.js rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/image.js diff --git a/app/assets/javascripts/wizard/addon/components/fields/index.js b/app/assets/javascripts/discourse/app/static/wizard/components/fields/index.js similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/index.js rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/index.js diff --git a/app/assets/javascripts/wizard/addon/components/fields/text.hbs b/app/assets/javascripts/discourse/app/static/wizard/components/fields/text.hbs similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/text.hbs rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/text.hbs diff --git a/app/assets/javascripts/wizard/addon/components/fields/text.js b/app/assets/javascripts/discourse/app/static/wizard/components/fields/text.js similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/text.js rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/text.js diff --git a/app/assets/javascripts/wizard/addon/components/wizard-canvas.gjs b/app/assets/javascripts/discourse/app/static/wizard/components/wizard-canvas.gjs similarity index 100% rename from app/assets/javascripts/wizard/addon/components/wizard-canvas.gjs rename to app/assets/javascripts/discourse/app/static/wizard/components/wizard-canvas.gjs diff --git a/app/assets/javascripts/wizard/addon/components/wizard-field.gjs b/app/assets/javascripts/discourse/app/static/wizard/components/wizard-field.gjs similarity index 100% rename from app/assets/javascripts/wizard/addon/components/wizard-field.gjs rename to app/assets/javascripts/discourse/app/static/wizard/components/wizard-field.gjs diff --git a/app/assets/javascripts/wizard/addon/components/wizard-step.gjs b/app/assets/javascripts/discourse/app/static/wizard/components/wizard-step.gjs similarity index 100% rename from app/assets/javascripts/wizard/addon/components/wizard-step.gjs rename to app/assets/javascripts/discourse/app/static/wizard/components/wizard-step.gjs diff --git a/app/assets/javascripts/wizard/addon/lib/preview.js b/app/assets/javascripts/discourse/app/static/wizard/lib/preview.js similarity index 100% rename from app/assets/javascripts/wizard/addon/lib/preview.js rename to app/assets/javascripts/discourse/app/static/wizard/lib/preview.js diff --git a/app/assets/javascripts/wizard/addon/models/wizard.js b/app/assets/javascripts/discourse/app/static/wizard/models/wizard.js similarity index 100% rename from app/assets/javascripts/wizard/addon/models/wizard.js rename to app/assets/javascripts/discourse/app/static/wizard/models/wizard.js diff --git a/app/assets/javascripts/wizard/addon/templates/wizard.gjs b/app/assets/javascripts/discourse/app/templates/wizard.gjs similarity index 80% rename from app/assets/javascripts/wizard/addon/templates/wizard.gjs rename to app/assets/javascripts/discourse/app/templates/wizard.gjs index 003a510345e84..ed726b64b2cf0 100644 --- a/app/assets/javascripts/wizard/addon/templates/wizard.gjs +++ b/app/assets/javascripts/discourse/app/templates/wizard.gjs @@ -1,6 +1,6 @@ import RouteTemplate from "ember-route-template"; import hideApplicationFooter from "discourse/helpers/hide-application-footer"; -import DiscourseLogo from "../components/discourse-logo"; +import DiscourseLogo from "discourse/static/wizard/components/discourse-logo"; export default RouteTemplate(