diff --git a/.gitignore b/.gitignore index b0bd0e6a..4e0e7d60 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +/tmp/ + # compiled output /dist/ /declarations/ diff --git a/app/app.js b/app/app.js index 4b5cb0be..df9c979f 100644 --- a/app/app.js +++ b/app/app.js @@ -4,6 +4,8 @@ import loadInitializers from 'ember-load-initializers'; import config from 'ember-help-wanted/config/environment'; import { importSync, isDevelopingApp, macroCondition } from '@embroider/macros'; +import compatModules from '@embroider/virtual/compat-modules'; + if (macroCondition(isDevelopingApp())) { importSync('./deprecation-workflow'); } @@ -11,7 +13,7 @@ if (macroCondition(isDevelopingApp())) { export default class App extends Application { modulePrefix = config.modulePrefix; podModulePrefix = config.podModulePrefix; - Resolver = Resolver; + Resolver = Resolver.withModules(compatModules); } -loadInitializers(App, config.modulePrefix); +loadInitializers(App, config.modulePrefix, compatModules); diff --git a/app/config/environment.js b/app/config/environment.js new file mode 100644 index 00000000..db601f53 --- /dev/null +++ b/app/config/environment.js @@ -0,0 +1,3 @@ +import loadConfigFromMeta from '@embroider/config-meta-loader'; + +export default loadConfigFromMeta('ember-help-wanted'); diff --git a/babel.config.cjs b/babel.config.cjs new file mode 100644 index 00000000..f9cd4c96 --- /dev/null +++ b/babel.config.cjs @@ -0,0 +1,43 @@ +const { + babelCompatSupport, + templateCompatSupport, +} = require('@embroider/compat/babel'); +const scopedCSS = require('ember-scoped-css/build'); + +module.exports = { + plugins: [ + [ + 'babel-plugin-ember-template-compilation', + { + compilerPath: 'ember-source/dist/ember-template-compiler.js', + enableLegacyModules: [ + 'ember-cli-htmlbars', + 'ember-cli-htmlbars-inline-precompile', + 'htmlbars-inline-precompile', + ], + transforms: [...templateCompatSupport(), scopedCSS.templatePlugin({})], + }, + ], + [ + 'module:decorator-transforms', + { + runtime: { + import: require.resolve('decorator-transforms/runtime-esm'), + }, + }, + ], + [ + '@babel/plugin-transform-runtime', + { + absoluteRuntime: __dirname, + useESModules: true, + regenerator: false, + }, + ], + ...babelCompatSupport(), + ], + + generatorOpts: { + compact: false, + }, +}; diff --git a/ember-cli-build.js b/ember-cli-build.js index 1e0c89de..da6a271b 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -1,8 +1,11 @@ 'use strict'; - const EmberApp = require('ember-cli/lib/broccoli/ember-app'); -module.exports = function (defaults) { +const { compatBuild } = require('@embroider/compat'); + +module.exports = async function (defaults) { + const { buildOnce } = await import('@embroider/vite'); + const app = new EmberApp(defaults, { emberData: { deprecations: { @@ -13,11 +16,7 @@ module.exports = function (defaults) { DEPRECATE_STORE_EXTENDS_EMBER_OBJECT: false, }, }, - 'ember-scoped-css': { - layerName: false, - additionalRoots: ['templates/'], - }, }); - return app.toTree(); + return compatBuild(app, buildOnce); }; diff --git a/eslint.config.mjs b/eslint.config.mjs index 3c10bdbf..6a62001c 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -28,7 +28,8 @@ const esmParserOptions = { requireConfigFile: false, babelOptions: { plugins: [ - ['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }], + ['@babel/plugin-proposal-decorators', { legacy: true }], + ['@babel/plugin-proposal-class-properties', { loose: true }], ], }, }; diff --git a/app/index.html b/index.html similarity index 51% rename from app/index.html rename to index.html index 6bfb5169..0173ed56 100644 --- a/app/index.html +++ b/index.html @@ -8,17 +8,22 @@ {{content-for "head"}} - - + + {{content-for "head-footer"}}
{{content-for "body"}} - - + + {{content-for "body-footer"}} -