From cbc28e8e337acc740487bc9cf5c263b3eaba6493 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Wed, 20 Dec 2023 13:15:06 +0000 Subject: [PATCH] Enable Embroider/Webpack code spliting for Wizard (#24919) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (extracted from #23678) * Move Wizard back into main app, remove Wizard addon * Remove Wizard-related resolver or build hacks * 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 things 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. Embroider does not eagerly pull things from this folder into any bundle, unless something explicitly "asks" for them via `imports`. Conversely, things 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 already 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 guarantee 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. Co-authored-by: Godfrey Chan --- .../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/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 .../styling-preview/-homepage-preview.js | 0 .../fields/styling-preview/-preview-base.hbs | 0 .../fields/styling-preview/-preview-base.js | 0 .../fields/styling-preview/index.hbs | 0 .../fields/styling-preview/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 | 10 +-- app/assets/javascripts/discourse/package.json | 2 +- .../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-ember3.json | 3 +- app/assets/javascripts/package-ember5.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 | 69 -------------- app/assets/javascripts/yarn-ember3.lock | 18 ++++ app/assets/javascripts/yarn-ember5.lock | 18 ++++ jsconfig.json | 4 - spec/integrity/coding_style_spec.rb | 1 - 56 files changed, 53 insertions(+), 296 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/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/styling-preview/-homepage-preview.js (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/styling-preview/-preview-base.hbs (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/styling-preview/-preview-base.js (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/styling-preview/index.hbs (100%) rename app/assets/javascripts/{wizard/addon => discourse/app/static/wizard}/components/fields/styling-preview/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 (78%) 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/discourse-common/addon/lib/discourse-template-map.js b/app/assets/javascripts/discourse-common/addon/lib/discourse-template-map.js index 51ec2c6c3c3..2a254f54606 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 6fe66c42deb..f0368c42fa8 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 651e48be51f..9db4d96d80c 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 6844a751554..a64d1de642e 100644 --- a/app/assets/javascripts/discourse/app/mapping-router.js +++ b/app/assets/javascripts/discourse/app/mapping-router.js @@ -1,10 +1,10 @@ -import EmberRouter from "@ember/routing/router"; +import EmbroiderRouter from "@embroider/router"; import Site from "discourse/models/site"; import { isTesting } from "discourse-common/config/environment"; import getURL from "discourse-common/lib/get-url"; import applyRouterHomepageOverrides from "./lib/homepage-router-overrides"; -class BareRouter extends EmberRouter { +class BareRouter extends EmbroiderRouter { location = isTesting() ? "none" : "history"; setupRouter() { 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 96a9017994f..51b5c29f6b3 100644 --- a/app/assets/javascripts/discourse/app/routes/app-route-map.js +++ b/app/assets/javascripts/discourse/app/routes/app-route-map.js @@ -276,4 +276,8 @@ export default function () { this.route("invites", { resetNamespace: true }, 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 c78c766adb5..f32f0409a34 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/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/styling-preview/-homepage-preview.js b/app/assets/javascripts/discourse/app/static/wizard/components/fields/styling-preview/-homepage-preview.js similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/styling-preview/-homepage-preview.js rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/styling-preview/-homepage-preview.js diff --git a/app/assets/javascripts/wizard/addon/components/fields/styling-preview/-preview-base.hbs b/app/assets/javascripts/discourse/app/static/wizard/components/fields/styling-preview/-preview-base.hbs similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/styling-preview/-preview-base.hbs rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/styling-preview/-preview-base.hbs diff --git a/app/assets/javascripts/wizard/addon/components/fields/styling-preview/-preview-base.js b/app/assets/javascripts/discourse/app/static/wizard/components/fields/styling-preview/-preview-base.js similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/styling-preview/-preview-base.js rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/styling-preview/-preview-base.js diff --git a/app/assets/javascripts/wizard/addon/components/fields/styling-preview/index.hbs b/app/assets/javascripts/discourse/app/static/wizard/components/fields/styling-preview/index.hbs similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/styling-preview/index.hbs rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/styling-preview/index.hbs diff --git a/app/assets/javascripts/wizard/addon/components/fields/styling-preview/index.js b/app/assets/javascripts/discourse/app/static/wizard/components/fields/styling-preview/index.js similarity index 100% rename from app/assets/javascripts/wizard/addon/components/fields/styling-preview/index.js rename to app/assets/javascripts/discourse/app/static/wizard/components/fields/styling-preview/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 78% rename from app/assets/javascripts/wizard/addon/templates/wizard.gjs rename to app/assets/javascripts/discourse/app/templates/wizard.gjs index 1b35aa10bc2..80dc4d944f4 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(