@embroider/compat 3.5.6-unstable.4aacaee → 3.5.7-unstable.203b5bc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embroider/compat",
3
- "version": "3.5.6-unstable.4aacaee",
3
+ "version": "3.5.7-unstable.203b5bc",
4
4
  "private": false,
5
5
  "description": "Backward compatibility layer for the Embroider build system.",
6
6
  "repository": {
@@ -60,7 +60,7 @@
60
60
  "typescript-memoize": "^1.0.1",
61
61
  "walk-sync": "^3.0.0",
62
62
  "yargs": "^17.0.1",
63
- "@embroider/macros": "1.16.6-unstable.4aacaee"
63
+ "@embroider/macros": "1.16.6-unstable.203b5bc"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@glimmer/syntax": "^0.84.3",
@@ -83,12 +83,12 @@
83
83
  "ember-engines": "^0.8.19",
84
84
  "scenario-tester": "^3.0.1",
85
85
  "typescript": "^5.4.5",
86
- "@embroider/core": "^3.4.15-unstable.4aacaee",
86
+ "@embroider/core": "^3.4.15-unstable.203b5bc",
87
87
  "@embroider/sample-transforms": "0.0.0",
88
88
  "@embroider/test-support": "0.36.0"
89
89
  },
90
90
  "peerDependencies": {
91
- "@embroider/core": "^3.4.15-unstable.4aacaee"
91
+ "@embroider/core": "^3.4.15-unstable.203b5bc"
92
92
  },
93
93
  "engines": {
94
94
  "node": "12.* || 14.* || >= 16"
@@ -482,6 +482,29 @@ class CompatAppBuilder {
482
482
  (0, fs_extra_1.outputJSONSync)((0, path_2.join)((0, core_1.locateEmbroiderWorkingDir)(this.compatApp.root), 'content-for.json'), contentForConfig, {
483
483
  spaces: 2,
484
484
  });
485
+ // In addition to outputting content-for.json, we also want to check if content-for 'config-module' has a custom content.
486
+ // If so, it means some classic addons used to provide this custom content, which is no longer supported.
487
+ // Developers can deactivate this check (and the subsequent warning) with useAddonConfigModule
488
+ if (this.compatApp.options.useAddonConfigModule) {
489
+ let modulePrefix = this.configTree.readConfig().modulePrefix;
490
+ // This is the default script provided by https://github.com/ember-cli/ember-cli/blob/master/lib/utilities/ember-app-utils.js#L84
491
+ // When storeConfigInMeta is true, this content is always present in the config-module key of content-for.json
492
+ const defaultConfigModule = `var prefix = '${modulePrefix}';\ntry {\n var metaName = prefix + '/config/environment';\n var rawConfig = document.querySelector('meta[name=\"' + metaName + '\"]').getAttribute('content');\n var config = JSON.parse(decodeURIComponent(rawConfig));\n\n var exports = { 'default': config };\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n return exports;\n}\ncatch(err) {\n throw new Error('Could not read config from meta tag with name \"' + metaName + '\".');\n}\n`.replace(/\s/g, '');
493
+ const configModule = contentForConfig['/index.html']['config-module'];
494
+ const diff = configModule.replace(/\s/g, '').replace(defaultConfigModule, '');
495
+ if (diff.length) {
496
+ throw new Error(`
497
+ Your app uses at least one classic addon that provides content-for 'config-module'. This is no longer supported.
498
+ With Embroider, you have full control over the config module, so classic addons no longer need to modify it under the hood.
499
+ The following code is included via content-for 'config-module':
500
+
501
+ ${configModule}
502
+
503
+ 1. If you want to keep the same behavior, add it to the app/environment.js.
504
+ 2. Once app/environment.js has the content you need, remove the present error by setting "useAddonConfigModule" to false in the build options.
505
+ `);
506
+ }
507
+ }
485
508
  }
486
509
  addEmberEnvConfig(emberEnvConfig) {
487
510
  (0, fs_extra_1.outputJSONSync)((0, path_2.join)((0, core_1.locateEmbroiderWorkingDir)(this.compatApp.root), 'ember-env.json'), emberEnvConfig, {
@@ -1 +1 @@
1
- {"version":3,"file":"compat-app-builder.js","sourceRoot":"","sources":["compat-app-builder.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,0CAUyB;AACzB,+BAA8C;AAI9C,yDAAwD;AACxD,6DAAqC;AACrC,iEAAyC;AACzC,iEAAyC;AACzC,oEAAkC;AAClC,uCAA2G;AAI3G,qFAAyE;AACzE,6DAAyD;AAEzD,2DAAsE;AACtE,2DAA6C;AAC7C,+BA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CAAC,CAAW,CAAC;YAC7C,CAAC;iBAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;gBACtC,oBAAoB,GAAG,MAAM,CAAC;YAChC,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CAAC,iEAAiE,MAAM,EAAE,CAAC,CAAC;YAC7F,CAAC;YAED,OAAO,CAAC,oBAAoB,CAAC,GAAG,IAAA,iCAAsB,EAAC,oBAAoB,CAAC,CAAC;QAC/E,CAAC;QAED,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC;YACvB,6BAAsB;YACtB;gBACE,OAAO;aACR;SACF,CAAC,CAAC;IACL,CAAC;AACH,CAAC","sourcesContent":["import type { Node as BroccoliNode } from 'broccoli-node-api';\nimport type { OutputPaths, AddonPackage, Engine, AppMeta, TemplateColocationPluginOptions } from '@embroider/core';\nimport {\n explicitRelative,\n extensionsPattern,\n warn,\n jsHandlebarsCompile,\n templateColocationPluginPath,\n cacheBustingPluginVersion,\n cacheBustingPluginPath,\n Resolver,\n locateEmbroiderWorkingDir,\n} from '@embroider/core';\nimport { resolve as resolvePath } from 'path';\nimport type Options from './options';\nimport type { CompatResolverOptions } from './resolver-transform';\nimport type { PackageRules } from './dependency-rules';\nimport { activePackageRules } from './dependency-rules';\nimport flatMap from 'lodash/flatMap';\nimport mergeWith from 'lodash/mergeWith';\nimport cloneDeep from 'lodash/cloneDeep';\nimport bind from 'bind-decorator';\nimport { outputJSONSync, readFileSync, readJSONSync, rmSync, writeFileSync, realpathSync } from 'fs-extra';\nimport type { Options as EtcOptions } from 'babel-plugin-ember-template-compilation';\nimport type { Options as ResolverTransformOptions } from './resolver-transform';\nimport type { Options as AdjustImportsOptions } from './babel-plugin-adjust-imports';\nimport { makePortable } from '@embroider/core/src/portable-babel-config';\nimport { AppFiles } from '@embroider/core/src/app-files';\nimport type { PortableHint } from '@embroider/core/src/portable';\nimport { maybeNodeModuleVersion } from '@embroider/core/src/portable';\nimport { Memoize } from 'typescript-memoize';\nimport { join, dirname } from 'path';\nimport resolve from 'resolve';\nimport type ContentForConfig from './content-for-config';\nimport type { V1Config } from './v1-config';\nimport type { Package, PackageInfo } from '@embroider/core';\nimport { readdirSync, pathExistsSync } from 'fs-extra';\nimport type { TransformOptions } from '@babel/core';\nimport { MacrosConfig } from '@embroider/macros/src/node';\nimport escapeRegExp from 'escape-string-regexp';\n\nimport type CompatApp from './compat-app';\nimport { SyncDir } from './sync-dir';\n\n// This exists during the actual broccoli build step. As opposed to CompatApp,\n// which also exists during pipeline-construction time.\n\nexport class CompatAppBuilder {\n constructor(\n private root: string,\n private origAppPackage: Package,\n private appPackageWithMovedDeps: Package,\n private options: Required<Options>,\n private compatApp: CompatApp,\n private configTree: V1Config,\n private contentForTree: ContentForConfig,\n private synthVendor: Package,\n private synthStyles: Package\n ) {}\n\n @Memoize()\n private fastbootJSSrcDir() {\n let target = join(this.compatApp.root, 'fastboot');\n if (pathExistsSync(target)) {\n return target;\n }\n }\n\n private activeAddonChildren(pkg: Package): AddonPackage[] {\n let result = (pkg.dependencies.filter(this.isActiveAddon) as AddonPackage[]).filter(\n // When looking for child addons, we want to ignore 'peerDependencies' of\n // a given package, to align with how ember-cli resolves addons. So here\n // we only include dependencies that are definitely active due to one of\n // the other sections.\n addon => pkg.categorizeDependency(addon.name) !== 'peerDependencies'\n );\n if (pkg === this.appPackageWithMovedDeps) {\n let extras = [this.synthVendor, this.synthStyles].filter(this.isActiveAddon) as AddonPackage[];\n result = [...result, ...extras];\n }\n return result.sort(this.orderAddons);\n }\n\n @Memoize()\n private get allActiveAddons(): AddonPackage[] {\n let result = this.appPackageWithMovedDeps.findDescendants(this.isActiveAddon) as AddonPackage[];\n let extras = [this.synthVendor, this.synthStyles].filter(this.isActiveAddon) as AddonPackage[];\n let extraDescendants = flatMap(extras, dep => dep.findDescendants(this.isActiveAddon)) as AddonPackage[];\n result = [...result, ...extras, ...extraDescendants];\n return result.sort(this.orderAddons);\n }\n\n @bind\n private isActiveAddon(pkg: Package): boolean {\n // stage1 already took care of converting everything that's actually active\n // into v2 addons. If it's not a v2 addon, we don't want it.\n //\n // We can encounter v1 addons here when there is inactive stuff floating\n // around in the node_modules that accidentally satisfy something like an\n // optional peer dep.\n return pkg.isV2Addon();\n }\n\n @bind\n private orderAddons(depA: Package, depB: Package): number {\n let depAIdx = 0;\n let depBIdx = 0;\n\n if (depA && depA.meta && depA.isV2Addon()) {\n depAIdx = depA.meta['order-index'] || 0;\n }\n if (depB && depB.meta && depB.isV2Addon()) {\n depBIdx = depB.meta['order-index'] || 0;\n }\n\n return depAIdx - depBIdx;\n }\n\n private resolvableExtensions(): string[] {\n // webpack's default is ['.wasm', '.mjs', '.js', '.json']. Keeping that\n // subset in that order is sensible, since many third-party libraries will\n // expect it to work that way.\n //\n // For TS, we defer to ember-cli-babel, and the setting for\n // \"enableTypescriptTransform\" can be set with and without\n // ember-cli-typescript\n return ['.wasm', '.mjs', '.js', '.json', '.ts', '.hbs', '.hbs.js', '.gjs', '.gts'];\n }\n\n private addEmberEntrypoints(htmlTreePath: string): string[] {\n let classicEntrypoints = ['index.html', 'tests/index.html'];\n if (!this.compatApp.shouldBuildTests) {\n classicEntrypoints.pop();\n }\n for (let entrypoint of classicEntrypoints) {\n let sourcePath = join(htmlTreePath, entrypoint);\n let rewrittenAppPath = join(this.root, entrypoint);\n writeFileSync(rewrittenAppPath, readFileSync(sourcePath));\n }\n return classicEntrypoints;\n }\n\n private modulePrefix(): string {\n return this.configTree.readConfig().modulePrefix;\n }\n\n private podModulePrefix(): string | undefined {\n return this.configTree.readConfig().podModulePrefix;\n }\n\n private rootURL(): string {\n return this.configTree.readConfig().rootURL;\n }\n\n @Memoize()\n private activeRules() {\n return activePackageRules(this.options.packageRules.concat(defaultAddonPackageRules()), [\n { name: this.origAppPackage.name, version: this.origAppPackage.version, root: this.root },\n ...this.allActiveAddons.filter(p => p.meta['auto-upgraded']),\n ]);\n }\n\n private resolverConfig(engines: AppFiles[]): CompatResolverOptions {\n let renamePackages = Object.assign({}, ...this.allActiveAddons.map(dep => dep.meta['renamed-packages']));\n let renameModules = Object.assign({}, ...this.allActiveAddons.map(dep => dep.meta['renamed-modules']));\n\n let options: CompatResolverOptions['options'] = {\n staticHelpers: this.options.staticHelpers,\n staticModifiers: this.options.staticModifiers,\n staticComponents: this.options.staticComponents,\n allowUnsafeDynamicComponents: this.options.allowUnsafeDynamicComponents,\n };\n\n let config: CompatResolverOptions = {\n // this part is the base ModuleResolverOptions as required by @embroider/core\n renameModules,\n renamePackages,\n resolvableExtensions: this.resolvableExtensions(),\n appRoot: this.origAppPackage.root,\n engines: engines.map((appFiles, index) => ({\n packageName: appFiles.engine.package.name,\n // first engine is the app, which has been relocated to this.root\n // we need to use the real path here because webpack requests always use the real path i.e. follow symlinks\n root: realpathSync(index === 0 ? this.root : appFiles.engine.package.root),\n fastbootFiles: appFiles.fastbootFiles,\n activeAddons: [...appFiles.engine.addons]\n .map(([addon, canResolveFromFile]) => ({\n name: addon.name,\n root: addon.root,\n canResolveFromFile,\n }))\n // the traditional order is the order in which addons will run, such\n // that the last one wins. Our resolver's order is the order to\n // search, so first one wins.\n .reverse(),\n isLazy: appFiles.engine.package.isLazyEngine(),\n })),\n amdCompatibility: this.options.amdCompatibility,\n\n // this is the additional stufff that @embroider/compat adds on top to do\n // global template resolving\n modulePrefix: this.modulePrefix(),\n splitAtRoutes: this.options.splitAtRoutes,\n podModulePrefix: this.podModulePrefix(),\n activePackageRules: this.activeRules(),\n options,\n autoRun: this.compatApp.autoRun,\n staticAppPaths: this.options.staticAppPaths,\n };\n\n return config;\n }\n\n @Memoize()\n private get resolvableExtensionsPattern(): RegExp {\n return extensionsPattern(this.resolvableExtensions());\n }\n\n @Memoize()\n private async babelConfig(resolverConfig: CompatResolverOptions) {\n let babel = cloneDeep(this.compatApp.babelConfig());\n\n if (!babel.plugins) {\n babel.plugins = [];\n }\n\n // Our stage3 code is always allowed to use dynamic import. We may emit it\n // ourself when splitting routes.\n babel.plugins.push(require.resolve('@babel/plugin-syntax-dynamic-import'));\n\n // https://github.com/webpack/webpack/issues/12154\n babel.plugins.push(require.resolve('./rename-require-plugin'));\n\n babel.plugins.push([\n require.resolve('babel-plugin-ember-template-compilation'),\n await this.etcOptions(resolverConfig),\n ]);\n\n // this is @embroider/macros configured for full stage3 resolution\n babel.plugins.push(...this.compatApp.macrosConfig.babelPluginConfig());\n\n let colocationOptions: TemplateColocationPluginOptions = {\n appRoot: this.origAppPackage.root,\n\n // This extra weirdness is a compromise in favor of build performance.\n //\n // 1. When auto-upgrading an addon from v1 to v2, we definitely want to\n // run any custom AST transforms in stage1.\n //\n // 2. In general case, AST transforms are allowed to manipulate Javascript\n // scope. This means that running transforms -- even when we're doing\n // source-to-source compilation that emits handlebars and not wire\n // format -- implies changing .hbs files into .js files.\n //\n // 3. So stage1 may need to rewrite .hbs to .hbs.js (to avoid colliding\n // with an existing co-located .js file).\n //\n // 4. But stage1 doesn't necessarily want to run babel over the\n // corresponding JS file. Most of the time, that's just an\n // unnecessarily expensive second parse. (We only run it in stage1 to\n // eliminate an addon's custom babel plugins, and many addons don't\n // have any.)\n //\n // 5. Therefore, the work of template-colocation gets defered until here,\n // and it may see co-located templates named `.hbs.js` instead of the\n // usual `.hbs.\n templateExtensions: ['.hbs', '.hbs.js'],\n\n // All of the above only applies to auto-upgraded packages that were\n // authored in v1. V2 packages don't get any of this complexity, they're\n // supposed to take care of colocating their own templates explicitly.\n packageGuard: true,\n };\n babel.plugins.push([templateColocationPluginPath, colocationOptions]);\n\n babel.plugins.push([\n require.resolve('./babel-plugin-adjust-imports'),\n (() => {\n let pluginConfig: AdjustImportsOptions = {\n appRoot: resolverConfig.appRoot,\n };\n return pluginConfig;\n })(),\n ]);\n\n // we can use globally shared babel runtime by default\n babel.plugins.push([\n require.resolve('@babel/plugin-transform-runtime'),\n { absoluteRuntime: __dirname, useESModules: true, regenerator: false },\n ]);\n\n const portable = makePortable(babel, { basedir: this.root }, this.portableHints);\n addCachablePlugin(portable.config);\n return portable;\n }\n\n // recurse to find all active addons that don't cross an engine boundary.\n // Inner engines themselves will be returned, but not those engines' children.\n // The output set's insertion order is the proper ember-cli compatible\n // ordering of the addons.\n private findActiveAddons(pkg: Package, engine: Engine, isChild = false): void {\n for (let child of this.activeAddonChildren(pkg)) {\n if (!child.isEngine()) {\n this.findActiveAddons(child, engine, true);\n }\n let canResolveFrom: string;\n if (pkg === this.appPackageWithMovedDeps) {\n // we want canResolveFrom to always be a rewritten package path, and our\n // app's package is not rewritten yet here.\n canResolveFrom = resolvePath(this.root, 'package.json');\n } else {\n // whereas our addons are already moved\n canResolveFrom = resolvePath(pkg.root, 'package.json');\n }\n engine.addons.set(child, canResolveFrom);\n }\n // ensure addons are applied in the correct order, if set (via @embroider/compat/v1-addon)\n if (!isChild) {\n engine.addons = new Map(\n [...engine.addons].sort(([a], [b]) => {\n return (a.meta['order-index'] || 0) - (b.meta['order-index'] || 0);\n })\n );\n }\n }\n\n private partitionEngines(): Engine[] {\n let queue: Engine[] = [\n {\n package: this.appPackageWithMovedDeps,\n addons: new Map(),\n isApp: true,\n modulePrefix: this.modulePrefix(),\n appRelativePath: '.',\n },\n ];\n let done: Engine[] = [];\n let seenEngines: Set<Package> = new Set();\n while (true) {\n let current = queue.shift();\n if (!current) {\n break;\n }\n this.findActiveAddons(current.package, current);\n for (let addon of current.addons.keys()) {\n if (addon.isEngine() && !seenEngines.has(addon)) {\n seenEngines.add(addon);\n queue.push({\n package: addon,\n addons: new Map(),\n isApp: !current,\n modulePrefix: addon.name,\n appRelativePath: explicitRelative(this.root, addon.root),\n });\n }\n }\n done.push(current);\n }\n return done;\n }\n\n @Memoize()\n private get activeFastboot() {\n return this.activeAddonChildren(this.appPackageWithMovedDeps).find(a => a.name === 'ember-cli-fastboot');\n }\n\n private emberVersion() {\n let pkg = this.activeAddonChildren(this.appPackageWithMovedDeps).find(a => a.name === 'ember-source');\n if (!pkg) {\n throw new Error('no ember version!');\n }\n return pkg.version;\n }\n\n @Memoize()\n private get fastbootConfig():\n | { packageJSON: PackageInfo; extraAppFiles: string[]; extraVendorFiles: string[] }\n | undefined {\n if (this.activeFastboot) {\n // this is relying on work done in stage1 by @embroider/compat/src/compat-adapters/ember-cli-fastboot.ts\n let packageJSON = readJSONSync(join(this.activeFastboot.root, '_fastboot_', 'package.json'));\n let { extraAppFiles, extraVendorFiles } = packageJSON['embroider-fastboot'];\n delete packageJSON['embroider-fastboot'];\n extraVendorFiles.push('assets/embroider_macros_fastboot_init.js');\n return { packageJSON, extraAppFiles, extraVendorFiles };\n }\n }\n\n private engines: { engine: Engine; appSync: SyncDir; fastbootSync: SyncDir | undefined }[] | undefined;\n\n private updateAppJS(appJSPath: string): AppFiles[] {\n if (!this.engines) {\n this.engines = this.partitionEngines().map(engine => {\n if (engine.isApp) {\n // this is the app. We have more to do for the app than for other\n // engines.\n let fastbootSync: SyncDir | undefined;\n if (this.activeFastboot) {\n let fastbootDir = this.fastbootJSSrcDir();\n if (fastbootDir) {\n fastbootSync = new SyncDir(fastbootDir, resolvePath(this.root, '_fastboot_'));\n }\n }\n return {\n engine,\n appSync: new SyncDir(appJSPath, this.root),\n fastbootSync,\n };\n } else {\n // this is not the app, so it's some other engine. Engines are already\n // built by stage1 like all other addons, so we only need to observe\n // their files, not doing any actual copying or building.\n return {\n engine,\n appSync: new SyncDir(engine.package.root, undefined),\n\n // AFAIK, we've never supported a fastboot overlay directory in an\n // engine. But if we do need that, it would go here.\n fastbootSync: undefined,\n };\n }\n });\n }\n\n for (let engine of this.engines) {\n engine.appSync.update();\n engine.fastbootSync?.update();\n }\n\n return this.engines.map(\n ({ engine, appSync, fastbootSync }) =>\n new AppFiles(\n engine,\n appSync.files,\n fastbootSync?.files ?? new Set(),\n this.resolvableExtensionsPattern,\n this.staticAppPathsPattern,\n this.podModulePrefix()\n )\n );\n }\n\n @Memoize()\n private get staticAppPathsPattern(): RegExp | undefined {\n if (this.options.staticAppPaths.length > 0) {\n return new RegExp(\n '^(?:' + this.options.staticAppPaths.map(staticAppPath => escapeRegExp(staticAppPath)).join('|') + ')(?:$|/)'\n );\n }\n }\n\n private firstBuild = true;\n\n async build(inputPaths: OutputPaths<TreeNames>) {\n // on the first build, we lock down the macros config. on subsequent builds,\n // this doesn't do anything anyway because it's idempotent.\n this.compatApp.macrosConfig.finalize();\n\n // on first build, clear the output directory completely\n if (this.firstBuild) {\n rmSync(this.root, { recursive: true, force: true });\n this.firstBuild = false;\n }\n\n let appFiles = this.updateAppJS(inputPaths.appJS);\n let assetPaths = this.addEmberEntrypoints(inputPaths.htmlTree);\n\n if (this.activeFastboot) {\n // when using fastboot, our own package.json needs to be in the output so fastboot can read it.\n assetPaths.push('package.json');\n }\n\n let meta: AppMeta = {\n type: 'app',\n version: 2,\n assets: assetPaths,\n babel: {\n filename: '_babel_config_.js',\n isParallelSafe: true, // TODO\n majorVersion: this.compatApp.babelMajorVersion(),\n fileFilter: '_babel_filter_.js',\n },\n 'root-url': this.rootURL(),\n };\n\n // all compat apps are auto-upgraded, there's no v2 app format here\n meta['auto-upgraded'] = true;\n\n let pkg = this.combinePackageJSON(meta);\n writeFileSync(join(this.root, 'package.json'), JSON.stringify(pkg, null, 2), 'utf8');\n\n let resolverConfig = this.resolverConfig(appFiles);\n let config = this.configTree.readConfig();\n let contentForConfig = this.contentForTree.readContents();\n\n this.addResolverConfig(resolverConfig);\n this.addContentForConfig(contentForConfig);\n this.addEmberEnvConfig(config.EmberENV);\n this.outputAppBootError(config.modulePrefix, config.APP, contentForConfig);\n let babelConfig = await this.babelConfig(resolverConfig);\n this.addBabelConfig(babelConfig);\n this.addMacrosConfig(this.compatApp.macrosConfig.babelPluginConfig()[0]);\n }\n\n private combinePackageJSON(meta: AppMeta): object {\n let pkgLayers: any[] = [this.origAppPackage.packageJSON];\n let fastbootConfig = this.fastbootConfig;\n if (fastbootConfig) {\n // fastboot-specific package.json output is allowed to add to our original package.json\n pkgLayers.push(fastbootConfig.packageJSON);\n }\n // but our own new v2 app metadata takes precedence over both\n pkgLayers.push({ 'ember-addon': meta });\n return combinePackageJSON(...pkgLayers);\n }\n\n private async etcOptions(resolverConfig: CompatResolverOptions): Promise<EtcOptions> {\n let transforms = this.compatApp.htmlbarsPlugins;\n\n let { plugins: macroPlugins, setConfig } = MacrosConfig.transforms();\n setConfig(this.compatApp.macrosConfig);\n for (let macroPlugin of macroPlugins) {\n transforms.push(macroPlugin as any);\n }\n\n if (\n this.options.staticComponents ||\n this.options.staticHelpers ||\n this.options.staticModifiers ||\n (globalThis as any).embroider_audit\n ) {\n let opts: ResolverTransformOptions = {\n appRoot: resolverConfig.appRoot,\n emberVersion: this.emberVersion(),\n };\n transforms.push([require.resolve('./resolver-transform'), opts]);\n }\n\n let resolver = new Resolver(resolverConfig);\n let resolution = await resolver.nodeResolve(\n 'ember-source/vendor/ember/ember-template-compiler',\n resolvePath(this.root, 'package.json')\n );\n if (resolution.type !== 'real') {\n throw new Error(`bug: unable to resolve ember-template-compiler from ${this.root}`);\n }\n\n return {\n transforms,\n compilerPath: resolution.filename,\n enableLegacyModules: ['ember-cli-htmlbars', 'ember-cli-htmlbars-inline-precompile', 'htmlbars-inline-precompile'],\n };\n }\n\n @Memoize()\n private get portableHints(): PortableHint[] {\n return this.options.pluginHints.map(hint => {\n let cursor = join(this.origAppPackage.root, 'package.json');\n for (let i = 0; i < hint.resolve.length; i++) {\n let target = hint.resolve[i];\n if (i < hint.resolve.length - 1) {\n target = join(target, 'package.json');\n }\n cursor = resolve.sync(target, { basedir: dirname(cursor) });\n }\n\n return {\n requireFile: cursor,\n useMethod: hint.useMethod,\n packageVersion: maybeNodeModuleVersion(cursor),\n };\n });\n }\n\n private addBabelConfig(pconfig: { config: TransformOptions; isParallelSafe: boolean }) {\n if (!pconfig.isParallelSafe) {\n warn('Your build is slower because some babel plugins are non-serializable');\n }\n writeFileSync(\n join(locateEmbroiderWorkingDir(this.compatApp.root), '_babel_config_.js'),\n `module.exports = ${JSON.stringify(pconfig.config, null, 2)}`,\n 'utf8'\n );\n writeFileSync(\n join(locateEmbroiderWorkingDir(this.compatApp.root), '_babel_filter_.js'),\n babelFilterTemplate({ skipBabel: this.options.skipBabel, appRoot: this.origAppPackage.root }),\n 'utf8'\n );\n }\n\n private addResolverConfig(config: CompatResolverOptions) {\n outputJSONSync(join(locateEmbroiderWorkingDir(this.compatApp.root), 'resolver.json'), config, { spaces: 2 });\n }\n\n private addContentForConfig(contentForConfig: any) {\n outputJSONSync(join(locateEmbroiderWorkingDir(this.compatApp.root), 'content-for.json'), contentForConfig, {\n spaces: 2,\n });\n }\n\n private addEmberEnvConfig(emberEnvConfig: any) {\n outputJSONSync(join(locateEmbroiderWorkingDir(this.compatApp.root), 'ember-env.json'), emberEnvConfig, {\n spaces: 2,\n });\n }\n\n private addMacrosConfig(macrosConfig: any) {\n outputJSONSync(join(locateEmbroiderWorkingDir(this.compatApp.root), 'macros-config.json'), macrosConfig, {\n spaces: 2,\n });\n }\n\n // Classic addons providing custom content-for \"app-boot\" is no longer supported.\n // The purpose of this error message is to help developers to move the classic addons code.\n // Developers can deactivate it with useAddonAppBoot build option.\n private outputAppBootError(modulePrefix: string, appConfig: any, contentForConfig: any) {\n if (!this.compatApp.options.useAddonAppBoot) {\n return;\n }\n\n // This is the default script provided by\n // https://github.com/ember-cli/ember-cli/blob/master/lib/utilities/ember-app-utils.js#L103\n const defaultAppBoot = `\n if (!runningTests) {\n require(\"${modulePrefix}/app\")[\"default\"].create(${JSON.stringify(appConfig || {})});\n }\n `.replace(/\\s/g, '');\n\n const appBoot = contentForConfig['/index.html']['app-boot'];\n const diff = appBoot.replace(/\\s/g, '').replace(defaultAppBoot, '');\n\n if (diff.length) {\n throw new Error(`\n Your app uses at least one classic addon that provides content-for 'app-boot'. This is no longer supported.\n With Embroider, you have full control over the app-boot script, so classic addons no longer need to modify it under the hood.\n The following code is used for your app boot:\n\n ${appBoot}\n\n 1. If you want to keep the same behavior, copy and paste it to the app-boot script included in app/index.html.\n 2. Once app/index.html has the content you need, remove the present error by setting \"useAddonAppBoot\" to false in the build options.\n `);\n }\n }\n}\n\nfunction defaultAddonPackageRules(): PackageRules[] {\n return readdirSync(join(__dirname, 'addon-dependency-rules'))\n .map(filename => {\n if (filename.endsWith('.js')) {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n return require(join(__dirname, 'addon-dependency-rules', filename)).default;\n }\n })\n .filter(Boolean)\n .reduce((a, b) => a.concat(b), []);\n}\n\nconst babelFilterTemplate = jsHandlebarsCompile(`\nconst { babelFilter } = require(${JSON.stringify(require.resolve('@embroider/core'))});\nmodule.exports = babelFilter({{json-stringify skipBabel}}, \"{{js-string-escape appRoot}}\");\n`) as (params: { skipBabel: Options['skipBabel']; appRoot: string }) => string;\n\nfunction combinePackageJSON(...layers: object[]) {\n function custom(objValue: any, srcValue: any, key: string, _object: any, _source: any, stack: { size: number }) {\n if (key === 'keywords' && stack.size === 0) {\n if (Array.isArray(objValue)) {\n return objValue.concat(srcValue);\n }\n }\n }\n return mergeWith({}, ...layers, custom);\n}\n\nfunction addCachablePlugin(babelConfig: TransformOptions) {\n if (Array.isArray(babelConfig.plugins) && babelConfig.plugins.length > 0) {\n const plugins = Object.create(null);\n plugins[cacheBustingPluginPath] = cacheBustingPluginVersion;\n\n for (const plugin of babelConfig.plugins) {\n let absolutePathToPlugin: string;\n if (Array.isArray(plugin) && typeof plugin[0] === 'string') {\n absolutePathToPlugin = plugin[0] as string;\n } else if (typeof plugin === 'string') {\n absolutePathToPlugin = plugin;\n } else {\n throw new Error(`[Embroider] a babel plugin without an absolute path was from: ${plugin}`);\n }\n\n plugins[absolutePathToPlugin] = maybeNodeModuleVersion(absolutePathToPlugin);\n }\n\n babelConfig.plugins.push([\n cacheBustingPluginPath,\n {\n plugins,\n },\n ]);\n }\n}\n\ninterface TreeNames {\n appJS: BroccoliNode;\n htmlTree: BroccoliNode;\n publicTree: BroccoliNode | undefined;\n configTree: BroccoliNode;\n}\n"]}
1
+ {"version":3,"file":"compat-app-builder.js","sourceRoot":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AC;YACvB,6BAAsB;YACtB;gBACE,OAAO;aACR;SACF,CAAC,CAAC;IACL,CAAC;AACH,CAAC","sourcesContent":["import type { Node as BroccoliNode } from 'broccoli-node-api';\nimport type { OutputPaths, AddonPackage, Engine, AppMeta, TemplateColocationPluginOptions } from '@embroider/core';\nimport {\n explicitRelative,\n extensionsPattern,\n warn,\n jsHandlebarsCompile,\n templateColocationPluginPath,\n cacheBustingPluginVersion,\n cacheBustingPluginPath,\n Resolver,\n locateEmbroiderWorkingDir,\n} from '@embroider/core';\nimport { resolve as resolvePath } from 'path';\nimport type Options from './options';\nimport type { CompatResolverOptions } from './resolver-transform';\nimport type { PackageRules } from './dependency-rules';\nimport { activePackageRules } from './dependency-rules';\nimport flatMap from 'lodash/flatMap';\nimport mergeWith from 'lodash/mergeWith';\nimport cloneDeep from 'lodash/cloneDeep';\nimport bind from 'bind-decorator';\nimport { outputJSONSync, readFileSync, readJSONSync, rmSync, writeFileSync, realpathSync } from 'fs-extra';\nimport type { Options as EtcOptions } from 'babel-plugin-ember-template-compilation';\nimport type { Options as ResolverTransformOptions } from './resolver-transform';\nimport type { Options as AdjustImportsOptions } from './babel-plugin-adjust-imports';\nimport { makePortable } from '@embroider/core/src/portable-babel-config';\nimport { AppFiles } from '@embroider/core/src/app-files';\nimport type { PortableHint } from '@embroider/core/src/portable';\nimport { maybeNodeModuleVersion } from '@embroider/core/src/portable';\nimport { Memoize } from 'typescript-memoize';\nimport { join, dirname } from 'path';\nimport resolve from 'resolve';\nimport type ContentForConfig from './content-for-config';\nimport type { V1Config } from './v1-config';\nimport type { Package, PackageInfo } from '@embroider/core';\nimport { readdirSync, pathExistsSync } from 'fs-extra';\nimport type { TransformOptions } from '@babel/core';\nimport { MacrosConfig } from '@embroider/macros/src/node';\nimport escapeRegExp from 'escape-string-regexp';\n\nimport type CompatApp from './compat-app';\nimport { SyncDir } from './sync-dir';\n\n// This exists during the actual broccoli build step. As opposed to CompatApp,\n// which also exists during pipeline-construction time.\n\nexport class CompatAppBuilder {\n constructor(\n private root: string,\n private origAppPackage: Package,\n private appPackageWithMovedDeps: Package,\n private options: Required<Options>,\n private compatApp: CompatApp,\n private configTree: V1Config,\n private contentForTree: ContentForConfig,\n private synthVendor: Package,\n private synthStyles: Package\n ) {}\n\n @Memoize()\n private fastbootJSSrcDir() {\n let target = join(this.compatApp.root, 'fastboot');\n if (pathExistsSync(target)) {\n return target;\n }\n }\n\n private activeAddonChildren(pkg: Package): AddonPackage[] {\n let result = (pkg.dependencies.filter(this.isActiveAddon) as AddonPackage[]).filter(\n // When looking for child addons, we want to ignore 'peerDependencies' of\n // a given package, to align with how ember-cli resolves addons. So here\n // we only include dependencies that are definitely active due to one of\n // the other sections.\n addon => pkg.categorizeDependency(addon.name) !== 'peerDependencies'\n );\n if (pkg === this.appPackageWithMovedDeps) {\n let extras = [this.synthVendor, this.synthStyles].filter(this.isActiveAddon) as AddonPackage[];\n result = [...result, ...extras];\n }\n return result.sort(this.orderAddons);\n }\n\n @Memoize()\n private get allActiveAddons(): AddonPackage[] {\n let result = this.appPackageWithMovedDeps.findDescendants(this.isActiveAddon) as AddonPackage[];\n let extras = [this.synthVendor, this.synthStyles].filter(this.isActiveAddon) as AddonPackage[];\n let extraDescendants = flatMap(extras, dep => dep.findDescendants(this.isActiveAddon)) as AddonPackage[];\n result = [...result, ...extras, ...extraDescendants];\n return result.sort(this.orderAddons);\n }\n\n @bind\n private isActiveAddon(pkg: Package): boolean {\n // stage1 already took care of converting everything that's actually active\n // into v2 addons. If it's not a v2 addon, we don't want it.\n //\n // We can encounter v1 addons here when there is inactive stuff floating\n // around in the node_modules that accidentally satisfy something like an\n // optional peer dep.\n return pkg.isV2Addon();\n }\n\n @bind\n private orderAddons(depA: Package, depB: Package): number {\n let depAIdx = 0;\n let depBIdx = 0;\n\n if (depA && depA.meta && depA.isV2Addon()) {\n depAIdx = depA.meta['order-index'] || 0;\n }\n if (depB && depB.meta && depB.isV2Addon()) {\n depBIdx = depB.meta['order-index'] || 0;\n }\n\n return depAIdx - depBIdx;\n }\n\n private resolvableExtensions(): string[] {\n // webpack's default is ['.wasm', '.mjs', '.js', '.json']. Keeping that\n // subset in that order is sensible, since many third-party libraries will\n // expect it to work that way.\n //\n // For TS, we defer to ember-cli-babel, and the setting for\n // \"enableTypescriptTransform\" can be set with and without\n // ember-cli-typescript\n return ['.wasm', '.mjs', '.js', '.json', '.ts', '.hbs', '.hbs.js', '.gjs', '.gts'];\n }\n\n private addEmberEntrypoints(htmlTreePath: string): string[] {\n let classicEntrypoints = ['index.html', 'tests/index.html'];\n if (!this.compatApp.shouldBuildTests) {\n classicEntrypoints.pop();\n }\n for (let entrypoint of classicEntrypoints) {\n let sourcePath = join(htmlTreePath, entrypoint);\n let rewrittenAppPath = join(this.root, entrypoint);\n writeFileSync(rewrittenAppPath, readFileSync(sourcePath));\n }\n return classicEntrypoints;\n }\n\n private modulePrefix(): string {\n return this.configTree.readConfig().modulePrefix;\n }\n\n private podModulePrefix(): string | undefined {\n return this.configTree.readConfig().podModulePrefix;\n }\n\n private rootURL(): string {\n return this.configTree.readConfig().rootURL;\n }\n\n @Memoize()\n private activeRules() {\n return activePackageRules(this.options.packageRules.concat(defaultAddonPackageRules()), [\n { name: this.origAppPackage.name, version: this.origAppPackage.version, root: this.root },\n ...this.allActiveAddons.filter(p => p.meta['auto-upgraded']),\n ]);\n }\n\n private resolverConfig(engines: AppFiles[]): CompatResolverOptions {\n let renamePackages = Object.assign({}, ...this.allActiveAddons.map(dep => dep.meta['renamed-packages']));\n let renameModules = Object.assign({}, ...this.allActiveAddons.map(dep => dep.meta['renamed-modules']));\n\n let options: CompatResolverOptions['options'] = {\n staticHelpers: this.options.staticHelpers,\n staticModifiers: this.options.staticModifiers,\n staticComponents: this.options.staticComponents,\n allowUnsafeDynamicComponents: this.options.allowUnsafeDynamicComponents,\n };\n\n let config: CompatResolverOptions = {\n // this part is the base ModuleResolverOptions as required by @embroider/core\n renameModules,\n renamePackages,\n resolvableExtensions: this.resolvableExtensions(),\n appRoot: this.origAppPackage.root,\n engines: engines.map((appFiles, index) => ({\n packageName: appFiles.engine.package.name,\n // first engine is the app, which has been relocated to this.root\n // we need to use the real path here because webpack requests always use the real path i.e. follow symlinks\n root: realpathSync(index === 0 ? this.root : appFiles.engine.package.root),\n fastbootFiles: appFiles.fastbootFiles,\n activeAddons: [...appFiles.engine.addons]\n .map(([addon, canResolveFromFile]) => ({\n name: addon.name,\n root: addon.root,\n canResolveFromFile,\n }))\n // the traditional order is the order in which addons will run, such\n // that the last one wins. Our resolver's order is the order to\n // search, so first one wins.\n .reverse(),\n isLazy: appFiles.engine.package.isLazyEngine(),\n })),\n amdCompatibility: this.options.amdCompatibility,\n\n // this is the additional stufff that @embroider/compat adds on top to do\n // global template resolving\n modulePrefix: this.modulePrefix(),\n splitAtRoutes: this.options.splitAtRoutes,\n podModulePrefix: this.podModulePrefix(),\n activePackageRules: this.activeRules(),\n options,\n autoRun: this.compatApp.autoRun,\n staticAppPaths: this.options.staticAppPaths,\n };\n\n return config;\n }\n\n @Memoize()\n private get resolvableExtensionsPattern(): RegExp {\n return extensionsPattern(this.resolvableExtensions());\n }\n\n @Memoize()\n private async babelConfig(resolverConfig: CompatResolverOptions) {\n let babel = cloneDeep(this.compatApp.babelConfig());\n\n if (!babel.plugins) {\n babel.plugins = [];\n }\n\n // Our stage3 code is always allowed to use dynamic import. We may emit it\n // ourself when splitting routes.\n babel.plugins.push(require.resolve('@babel/plugin-syntax-dynamic-import'));\n\n // https://github.com/webpack/webpack/issues/12154\n babel.plugins.push(require.resolve('./rename-require-plugin'));\n\n babel.plugins.push([\n require.resolve('babel-plugin-ember-template-compilation'),\n await this.etcOptions(resolverConfig),\n ]);\n\n // this is @embroider/macros configured for full stage3 resolution\n babel.plugins.push(...this.compatApp.macrosConfig.babelPluginConfig());\n\n let colocationOptions: TemplateColocationPluginOptions = {\n appRoot: this.origAppPackage.root,\n\n // This extra weirdness is a compromise in favor of build performance.\n //\n // 1. When auto-upgrading an addon from v1 to v2, we definitely want to\n // run any custom AST transforms in stage1.\n //\n // 2. In general case, AST transforms are allowed to manipulate Javascript\n // scope. This means that running transforms -- even when we're doing\n // source-to-source compilation that emits handlebars and not wire\n // format -- implies changing .hbs files into .js files.\n //\n // 3. So stage1 may need to rewrite .hbs to .hbs.js (to avoid colliding\n // with an existing co-located .js file).\n //\n // 4. But stage1 doesn't necessarily want to run babel over the\n // corresponding JS file. Most of the time, that's just an\n // unnecessarily expensive second parse. (We only run it in stage1 to\n // eliminate an addon's custom babel plugins, and many addons don't\n // have any.)\n //\n // 5. Therefore, the work of template-colocation gets defered until here,\n // and it may see co-located templates named `.hbs.js` instead of the\n // usual `.hbs.\n templateExtensions: ['.hbs', '.hbs.js'],\n\n // All of the above only applies to auto-upgraded packages that were\n // authored in v1. V2 packages don't get any of this complexity, they're\n // supposed to take care of colocating their own templates explicitly.\n packageGuard: true,\n };\n babel.plugins.push([templateColocationPluginPath, colocationOptions]);\n\n babel.plugins.push([\n require.resolve('./babel-plugin-adjust-imports'),\n (() => {\n let pluginConfig: AdjustImportsOptions = {\n appRoot: resolverConfig.appRoot,\n };\n return pluginConfig;\n })(),\n ]);\n\n // we can use globally shared babel runtime by default\n babel.plugins.push([\n require.resolve('@babel/plugin-transform-runtime'),\n { absoluteRuntime: __dirname, useESModules: true, regenerator: false },\n ]);\n\n const portable = makePortable(babel, { basedir: this.root }, this.portableHints);\n addCachablePlugin(portable.config);\n return portable;\n }\n\n // recurse to find all active addons that don't cross an engine boundary.\n // Inner engines themselves will be returned, but not those engines' children.\n // The output set's insertion order is the proper ember-cli compatible\n // ordering of the addons.\n private findActiveAddons(pkg: Package, engine: Engine, isChild = false): void {\n for (let child of this.activeAddonChildren(pkg)) {\n if (!child.isEngine()) {\n this.findActiveAddons(child, engine, true);\n }\n let canResolveFrom: string;\n if (pkg === this.appPackageWithMovedDeps) {\n // we want canResolveFrom to always be a rewritten package path, and our\n // app's package is not rewritten yet here.\n canResolveFrom = resolvePath(this.root, 'package.json');\n } else {\n // whereas our addons are already moved\n canResolveFrom = resolvePath(pkg.root, 'package.json');\n }\n engine.addons.set(child, canResolveFrom);\n }\n // ensure addons are applied in the correct order, if set (via @embroider/compat/v1-addon)\n if (!isChild) {\n engine.addons = new Map(\n [...engine.addons].sort(([a], [b]) => {\n return (a.meta['order-index'] || 0) - (b.meta['order-index'] || 0);\n })\n );\n }\n }\n\n private partitionEngines(): Engine[] {\n let queue: Engine[] = [\n {\n package: this.appPackageWithMovedDeps,\n addons: new Map(),\n isApp: true,\n modulePrefix: this.modulePrefix(),\n appRelativePath: '.',\n },\n ];\n let done: Engine[] = [];\n let seenEngines: Set<Package> = new Set();\n while (true) {\n let current = queue.shift();\n if (!current) {\n break;\n }\n this.findActiveAddons(current.package, current);\n for (let addon of current.addons.keys()) {\n if (addon.isEngine() && !seenEngines.has(addon)) {\n seenEngines.add(addon);\n queue.push({\n package: addon,\n addons: new Map(),\n isApp: !current,\n modulePrefix: addon.name,\n appRelativePath: explicitRelative(this.root, addon.root),\n });\n }\n }\n done.push(current);\n }\n return done;\n }\n\n @Memoize()\n private get activeFastboot() {\n return this.activeAddonChildren(this.appPackageWithMovedDeps).find(a => a.name === 'ember-cli-fastboot');\n }\n\n private emberVersion() {\n let pkg = this.activeAddonChildren(this.appPackageWithMovedDeps).find(a => a.name === 'ember-source');\n if (!pkg) {\n throw new Error('no ember version!');\n }\n return pkg.version;\n }\n\n @Memoize()\n private get fastbootConfig():\n | { packageJSON: PackageInfo; extraAppFiles: string[]; extraVendorFiles: string[] }\n | undefined {\n if (this.activeFastboot) {\n // this is relying on work done in stage1 by @embroider/compat/src/compat-adapters/ember-cli-fastboot.ts\n let packageJSON = readJSONSync(join(this.activeFastboot.root, '_fastboot_', 'package.json'));\n let { extraAppFiles, extraVendorFiles } = packageJSON['embroider-fastboot'];\n delete packageJSON['embroider-fastboot'];\n extraVendorFiles.push('assets/embroider_macros_fastboot_init.js');\n return { packageJSON, extraAppFiles, extraVendorFiles };\n }\n }\n\n private engines: { engine: Engine; appSync: SyncDir; fastbootSync: SyncDir | undefined }[] | undefined;\n\n private updateAppJS(appJSPath: string): AppFiles[] {\n if (!this.engines) {\n this.engines = this.partitionEngines().map(engine => {\n if (engine.isApp) {\n // this is the app. We have more to do for the app than for other\n // engines.\n let fastbootSync: SyncDir | undefined;\n if (this.activeFastboot) {\n let fastbootDir = this.fastbootJSSrcDir();\n if (fastbootDir) {\n fastbootSync = new SyncDir(fastbootDir, resolvePath(this.root, '_fastboot_'));\n }\n }\n return {\n engine,\n appSync: new SyncDir(appJSPath, this.root),\n fastbootSync,\n };\n } else {\n // this is not the app, so it's some other engine. Engines are already\n // built by stage1 like all other addons, so we only need to observe\n // their files, not doing any actual copying or building.\n return {\n engine,\n appSync: new SyncDir(engine.package.root, undefined),\n\n // AFAIK, we've never supported a fastboot overlay directory in an\n // engine. But if we do need that, it would go here.\n fastbootSync: undefined,\n };\n }\n });\n }\n\n for (let engine of this.engines) {\n engine.appSync.update();\n engine.fastbootSync?.update();\n }\n\n return this.engines.map(\n ({ engine, appSync, fastbootSync }) =>\n new AppFiles(\n engine,\n appSync.files,\n fastbootSync?.files ?? new Set(),\n this.resolvableExtensionsPattern,\n this.staticAppPathsPattern,\n this.podModulePrefix()\n )\n );\n }\n\n @Memoize()\n private get staticAppPathsPattern(): RegExp | undefined {\n if (this.options.staticAppPaths.length > 0) {\n return new RegExp(\n '^(?:' + this.options.staticAppPaths.map(staticAppPath => escapeRegExp(staticAppPath)).join('|') + ')(?:$|/)'\n );\n }\n }\n\n private firstBuild = true;\n\n async build(inputPaths: OutputPaths<TreeNames>) {\n // on the first build, we lock down the macros config. on subsequent builds,\n // this doesn't do anything anyway because it's idempotent.\n this.compatApp.macrosConfig.finalize();\n\n // on first build, clear the output directory completely\n if (this.firstBuild) {\n rmSync(this.root, { recursive: true, force: true });\n this.firstBuild = false;\n }\n\n let appFiles = this.updateAppJS(inputPaths.appJS);\n let assetPaths = this.addEmberEntrypoints(inputPaths.htmlTree);\n\n if (this.activeFastboot) {\n // when using fastboot, our own package.json needs to be in the output so fastboot can read it.\n assetPaths.push('package.json');\n }\n\n let meta: AppMeta = {\n type: 'app',\n version: 2,\n assets: assetPaths,\n babel: {\n filename: '_babel_config_.js',\n isParallelSafe: true, // TODO\n majorVersion: this.compatApp.babelMajorVersion(),\n fileFilter: '_babel_filter_.js',\n },\n 'root-url': this.rootURL(),\n };\n\n // all compat apps are auto-upgraded, there's no v2 app format here\n meta['auto-upgraded'] = true;\n\n let pkg = this.combinePackageJSON(meta);\n writeFileSync(join(this.root, 'package.json'), JSON.stringify(pkg, null, 2), 'utf8');\n\n let resolverConfig = this.resolverConfig(appFiles);\n let config = this.configTree.readConfig();\n let contentForConfig = this.contentForTree.readContents();\n\n this.addResolverConfig(resolverConfig);\n this.addContentForConfig(contentForConfig);\n this.addEmberEnvConfig(config.EmberENV);\n this.outputAppBootError(config.modulePrefix, config.APP, contentForConfig);\n let babelConfig = await this.babelConfig(resolverConfig);\n this.addBabelConfig(babelConfig);\n this.addMacrosConfig(this.compatApp.macrosConfig.babelPluginConfig()[0]);\n }\n\n private combinePackageJSON(meta: AppMeta): object {\n let pkgLayers: any[] = [this.origAppPackage.packageJSON];\n let fastbootConfig = this.fastbootConfig;\n if (fastbootConfig) {\n // fastboot-specific package.json output is allowed to add to our original package.json\n pkgLayers.push(fastbootConfig.packageJSON);\n }\n // but our own new v2 app metadata takes precedence over both\n pkgLayers.push({ 'ember-addon': meta });\n return combinePackageJSON(...pkgLayers);\n }\n\n private async etcOptions(resolverConfig: CompatResolverOptions): Promise<EtcOptions> {\n let transforms = this.compatApp.htmlbarsPlugins;\n\n let { plugins: macroPlugins, setConfig } = MacrosConfig.transforms();\n setConfig(this.compatApp.macrosConfig);\n for (let macroPlugin of macroPlugins) {\n transforms.push(macroPlugin as any);\n }\n\n if (\n this.options.staticComponents ||\n this.options.staticHelpers ||\n this.options.staticModifiers ||\n (globalThis as any).embroider_audit\n ) {\n let opts: ResolverTransformOptions = {\n appRoot: resolverConfig.appRoot,\n emberVersion: this.emberVersion(),\n };\n transforms.push([require.resolve('./resolver-transform'), opts]);\n }\n\n let resolver = new Resolver(resolverConfig);\n let resolution = await resolver.nodeResolve(\n 'ember-source/vendor/ember/ember-template-compiler',\n resolvePath(this.root, 'package.json')\n );\n if (resolution.type !== 'real') {\n throw new Error(`bug: unable to resolve ember-template-compiler from ${this.root}`);\n }\n\n return {\n transforms,\n compilerPath: resolution.filename,\n enableLegacyModules: ['ember-cli-htmlbars', 'ember-cli-htmlbars-inline-precompile', 'htmlbars-inline-precompile'],\n };\n }\n\n @Memoize()\n private get portableHints(): PortableHint[] {\n return this.options.pluginHints.map(hint => {\n let cursor = join(this.origAppPackage.root, 'package.json');\n for (let i = 0; i < hint.resolve.length; i++) {\n let target = hint.resolve[i];\n if (i < hint.resolve.length - 1) {\n target = join(target, 'package.json');\n }\n cursor = resolve.sync(target, { basedir: dirname(cursor) });\n }\n\n return {\n requireFile: cursor,\n useMethod: hint.useMethod,\n packageVersion: maybeNodeModuleVersion(cursor),\n };\n });\n }\n\n private addBabelConfig(pconfig: { config: TransformOptions; isParallelSafe: boolean }) {\n if (!pconfig.isParallelSafe) {\n warn('Your build is slower because some babel plugins are non-serializable');\n }\n writeFileSync(\n join(locateEmbroiderWorkingDir(this.compatApp.root), '_babel_config_.js'),\n `module.exports = ${JSON.stringify(pconfig.config, null, 2)}`,\n 'utf8'\n );\n writeFileSync(\n join(locateEmbroiderWorkingDir(this.compatApp.root), '_babel_filter_.js'),\n babelFilterTemplate({ skipBabel: this.options.skipBabel, appRoot: this.origAppPackage.root }),\n 'utf8'\n );\n }\n\n private addResolverConfig(config: CompatResolverOptions) {\n outputJSONSync(join(locateEmbroiderWorkingDir(this.compatApp.root), 'resolver.json'), config, { spaces: 2 });\n }\n\n private addContentForConfig(contentForConfig: any) {\n outputJSONSync(join(locateEmbroiderWorkingDir(this.compatApp.root), 'content-for.json'), contentForConfig, {\n spaces: 2,\n });\n\n // In addition to outputting content-for.json, we also want to check if content-for 'config-module' has a custom content.\n // If so, it means some classic addons used to provide this custom content, which is no longer supported.\n // Developers can deactivate this check (and the subsequent warning) with useAddonConfigModule\n if (this.compatApp.options.useAddonConfigModule) {\n let modulePrefix = this.configTree.readConfig().modulePrefix;\n\n // This is the default script provided by https://github.com/ember-cli/ember-cli/blob/master/lib/utilities/ember-app-utils.js#L84\n // When storeConfigInMeta is true, this content is always present in the config-module key of content-for.json\n const defaultConfigModule =\n `var prefix = '${modulePrefix}';\\ntry {\\n var metaName = prefix + '/config/environment';\\n var rawConfig = document.querySelector('meta[name=\\\"' + metaName + '\\\"]').getAttribute('content');\\n var config = JSON.parse(decodeURIComponent(rawConfig));\\n\\n var exports = { 'default': config };\\n\\n Object.defineProperty(exports, '__esModule', { value: true });\\n\\n return exports;\\n}\\ncatch(err) {\\n throw new Error('Could not read config from meta tag with name \\\"' + metaName + '\\\".');\\n}\\n`.replace(\n /\\s/g,\n ''\n );\n\n const configModule = contentForConfig['/index.html']['config-module'];\n const diff = configModule.replace(/\\s/g, '').replace(defaultConfigModule, '');\n\n if (diff.length) {\n throw new Error(`\n Your app uses at least one classic addon that provides content-for 'config-module'. This is no longer supported.\n With Embroider, you have full control over the config module, so classic addons no longer need to modify it under the hood.\n The following code is included via content-for 'config-module':\n\n ${configModule}\n \n 1. If you want to keep the same behavior, add it to the app/environment.js.\n 2. Once app/environment.js has the content you need, remove the present error by setting \"useAddonConfigModule\" to false in the build options.\n `);\n }\n }\n }\n\n private addEmberEnvConfig(emberEnvConfig: any) {\n outputJSONSync(join(locateEmbroiderWorkingDir(this.compatApp.root), 'ember-env.json'), emberEnvConfig, {\n spaces: 2,\n });\n }\n\n private addMacrosConfig(macrosConfig: any) {\n outputJSONSync(join(locateEmbroiderWorkingDir(this.compatApp.root), 'macros-config.json'), macrosConfig, {\n spaces: 2,\n });\n }\n\n // Classic addons providing custom content-for \"app-boot\" is no longer supported.\n // The purpose of this error message is to help developers to move the classic addons code.\n // Developers can deactivate it with useAddonAppBoot build option.\n private outputAppBootError(modulePrefix: string, appConfig: any, contentForConfig: any) {\n if (!this.compatApp.options.useAddonAppBoot) {\n return;\n }\n\n // This is the default script provided by\n // https://github.com/ember-cli/ember-cli/blob/master/lib/utilities/ember-app-utils.js#L103\n const defaultAppBoot = `\n if (!runningTests) {\n require(\"${modulePrefix}/app\")[\"default\"].create(${JSON.stringify(appConfig || {})});\n }\n `.replace(/\\s/g, '');\n\n const appBoot = contentForConfig['/index.html']['app-boot'];\n const diff = appBoot.replace(/\\s/g, '').replace(defaultAppBoot, '');\n\n if (diff.length) {\n throw new Error(`\n Your app uses at least one classic addon that provides content-for 'app-boot'. This is no longer supported.\n With Embroider, you have full control over the app-boot script, so classic addons no longer need to modify it under the hood.\n The following code is used for your app boot:\n\n ${appBoot}\n\n 1. If you want to keep the same behavior, copy and paste it to the app-boot script included in app/index.html.\n 2. Once app/index.html has the content you need, remove the present error by setting \"useAddonAppBoot\" to false in the build options.\n `);\n }\n }\n}\n\nfunction defaultAddonPackageRules(): PackageRules[] {\n return readdirSync(join(__dirname, 'addon-dependency-rules'))\n .map(filename => {\n if (filename.endsWith('.js')) {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n return require(join(__dirname, 'addon-dependency-rules', filename)).default;\n }\n })\n .filter(Boolean)\n .reduce((a, b) => a.concat(b), []);\n}\n\nconst babelFilterTemplate = jsHandlebarsCompile(`\nconst { babelFilter } = require(${JSON.stringify(require.resolve('@embroider/core'))});\nmodule.exports = babelFilter({{json-stringify skipBabel}}, \"{{js-string-escape appRoot}}\");\n`) as (params: { skipBabel: Options['skipBabel']; appRoot: string }) => string;\n\nfunction combinePackageJSON(...layers: object[]) {\n function custom(objValue: any, srcValue: any, key: string, _object: any, _source: any, stack: { size: number }) {\n if (key === 'keywords' && stack.size === 0) {\n if (Array.isArray(objValue)) {\n return objValue.concat(srcValue);\n }\n }\n }\n return mergeWith({}, ...layers, custom);\n}\n\nfunction addCachablePlugin(babelConfig: TransformOptions) {\n if (Array.isArray(babelConfig.plugins) && babelConfig.plugins.length > 0) {\n const plugins = Object.create(null);\n plugins[cacheBustingPluginPath] = cacheBustingPluginVersion;\n\n for (const plugin of babelConfig.plugins) {\n let absolutePathToPlugin: string;\n if (Array.isArray(plugin) && typeof plugin[0] === 'string') {\n absolutePathToPlugin = plugin[0] as string;\n } else if (typeof plugin === 'string') {\n absolutePathToPlugin = plugin;\n } else {\n throw new Error(`[Embroider] a babel plugin without an absolute path was from: ${plugin}`);\n }\n\n plugins[absolutePathToPlugin] = maybeNodeModuleVersion(absolutePathToPlugin);\n }\n\n babelConfig.plugins.push([\n cacheBustingPluginPath,\n {\n plugins,\n },\n ]);\n }\n}\n\ninterface TreeNames {\n appJS: BroccoliNode;\n htmlTree: BroccoliNode;\n publicTree: BroccoliNode | undefined;\n configTree: BroccoliNode;\n}\n"]}
@@ -21,6 +21,12 @@ class default_1 extends broccoli_plugin_1.default {
21
21
  (0, fs_extra_1.writeJSONSync)((0, path_1.join)(this.outputPath, 'package.json'), {
22
22
  name: this.originalPackage.name,
23
23
  version: this.originalPackage.version,
24
+ keywords: ['ember-addon'],
25
+ 'ember-addon': {
26
+ version: 2,
27
+ type: 'addon',
28
+ 'auto-upgraded': true,
29
+ },
24
30
  '//': 'This empty package was created by embroider. See https://github.com/embroider-build/embroider/blob/main/docs/empty-package-output.md',
25
31
  });
26
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"empty-package-tree.js","sourceRoot":"","sources":["empty-package-tree.ts"],"names":[],"mappings":";;;;;AACA,sEAAqC;AACrC,uCAAyC;AACzC,+BAA4B;AAE5B,eAAqB,SAAQ,yBAAM;IAGjC,YAAoB,eAAwB;QAC1C,KAAK,CAAC,EAAE,EAAE;YACR,UAAU,EAAE,oBAAoB;YAChC,gBAAgB,EAAE,IAAI;YACtB,UAAU,EAAE,KAAK;SAClB,CAAC,CAAC;QALe,oBAAe,GAAf,eAAe,CAAS;QAFpC,UAAK,GAAG,KAAK,CAAC;IAQtB,CAAC;IACD,KAAK;QACH,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,IAAA,wBAAa,EAAC,IAAA,WAAI,EAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,EAAE;gBACnD,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI;gBAC/B,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,OAAO;gBACrC,IAAI,EAAE,sIAAsI;aAC7I,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AAnBD,4BAmBC","sourcesContent":["import type { Package } from '@embroider/core';\nimport Plugin from 'broccoli-plugin';\nimport { writeJSONSync } from 'fs-extra';\nimport { join } from 'path';\n\nexport default class extends Plugin {\n private built = false;\n\n constructor(private originalPackage: Package) {\n super([], {\n annotation: 'empty-package-tree',\n persistentOutput: true,\n needsCache: false,\n });\n }\n build() {\n if (!this.built) {\n writeJSONSync(join(this.outputPath, 'package.json'), {\n name: this.originalPackage.name,\n version: this.originalPackage.version,\n '//': 'This empty package was created by embroider. See https://github.com/embroider-build/embroider/blob/main/docs/empty-package-output.md',\n });\n }\n }\n}\n"]}
1
+ {"version":3,"file":"empty-package-tree.js","sourceRoot":"","sources":["empty-package-tree.ts"],"names":[],"mappings":";;;;;AACA,sEAAqC;AACrC,uCAAyC;AACzC,+BAA4B;AAE5B,eAAqB,SAAQ,yBAAM;IAGjC,YAAoB,eAAwB;QAC1C,KAAK,CAAC,EAAE,EAAE;YACR,UAAU,EAAE,oBAAoB;YAChC,gBAAgB,EAAE,IAAI;YACtB,UAAU,EAAE,KAAK;SAClB,CAAC,CAAC;QALe,oBAAe,GAAf,eAAe,CAAS;QAFpC,UAAK,GAAG,KAAK,CAAC;IAQtB,CAAC;IACD,KAAK;QACH,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,IAAA,wBAAa,EAAC,IAAA,WAAI,EAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,EAAE;gBACnD,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI;gBAC/B,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,OAAO;gBACrC,QAAQ,EAAE,CAAC,aAAa,CAAC;gBACzB,aAAa,EAAE;oBACb,OAAO,EAAE,CAAC;oBACV,IAAI,EAAE,OAAO;oBACb,eAAe,EAAE,IAAI;iBACtB;gBACD,IAAI,EAAE,sIAAsI;aAC7I,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AAzBD,4BAyBC","sourcesContent":["import type { Package } from '@embroider/core';\nimport Plugin from 'broccoli-plugin';\nimport { writeJSONSync } from 'fs-extra';\nimport { join } from 'path';\n\nexport default class extends Plugin {\n private built = false;\n\n constructor(private originalPackage: Package) {\n super([], {\n annotation: 'empty-package-tree',\n persistentOutput: true,\n needsCache: false,\n });\n }\n build() {\n if (!this.built) {\n writeJSONSync(join(this.outputPath, 'package.json'), {\n name: this.originalPackage.name,\n version: this.originalPackage.version,\n keywords: ['ember-addon'],\n 'ember-addon': {\n version: 2,\n type: 'addon',\n 'auto-upgraded': true,\n },\n '//': 'This empty package was created by embroider. See https://github.com/embroider-build/embroider/blob/main/docs/empty-package-output.md',\n });\n }\n }\n}\n"]}
package/src/options.d.ts CHANGED
@@ -12,6 +12,7 @@ export default interface Options extends CoreOptions {
12
12
  allowUnsafeDynamicComponents?: boolean;
13
13
  availableContentForTypes?: string[];
14
14
  useAddonAppBoot?: boolean;
15
+ useAddonConfigModule?: boolean;
15
16
  }
16
17
  export declare function optionsWithDefaults(options?: Options): Required<Options>;
17
18
  export declare const recommendedOptions: {
package/src/options.js CHANGED
@@ -14,6 +14,7 @@ const defaults = Object.assign((0, core_1.optionsWithDefaults)(), {
14
14
  allowUnsafeDynamicComponents: false,
15
15
  availableContentForTypes: [],
16
16
  useAddonAppBoot: true,
17
+ useAddonConfigModule: true,
17
18
  });
18
19
  function optionsWithDefaults(options) {
19
20
  return Object.assign({}, defaults, options);
@@ -1 +1 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["options.ts"],"names":[],"mappings":";;;AA6HA,kDAEC;AA5HD,0CAA0E;AA6G1E,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAA,0BAAgB,GAAE,EAAE;IACjD,gBAAgB,EAAE,KAAK;IACvB,2BAA2B,EAAE,KAAK;IAClC,iBAAiB,EAAE,KAAK;IACxB,cAAc,EAAE,IAAI,GAAG,EAAE;IACzB,gBAAgB,EAAE,EAAE;IACpB,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE,EAAE;IAChB,4BAA4B,EAAE,KAAK;IACnC,wBAAwB,EAAE,EAAE;IAC5B,eAAe,EAAE,IAAI;CACtB,CAAC,CAAC;AAEH,SAAgB,mBAAmB,CAAC,OAAiB;IACnD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC;AAED,+EAA+E;AAC/E,6EAA6E;AAC7E,+EAA+E;AAC/E,cAAc;AACD,QAAA,kBAAkB,GAAgC,MAAM,CAAC,MAAM,CAAC;IAC3E,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC;QACvB,gBAAgB,EAAE,IAAI;QACtB,2BAA2B,EAAE,IAAI;QACjC,aAAa,EAAE,IAAI;QACnB,eAAe,EAAE,IAAI;QACrB,gBAAgB,EAAE,IAAI;QACtB,iBAAiB,EAAE,IAAI;QACvB,4BAA4B,EAAE,KAAK;KACpC,CAAC;CACH,CAAC,CAAC","sourcesContent":["import type { V1AddonConstructor } from './v1-addon';\nimport type { Node } from 'broccoli-node-api';\nimport type { Options as CoreOptions } from '@embroider/core';\nimport { optionsWithDefaults as coreWithDefaults } from '@embroider/core';\nimport type { PackageRules } from './dependency-rules';\n\n// These options control how hard we will try to achieve compatibility with v1\n// addons. The defaults are conservative and try to maximize compatibility, at\n// the cost of slower or bigger builds. As you eliminate sources of legacy\n// behavior you can benefit from the more aggressive modes.\nexport default interface Options extends CoreOptions {\n // Controls whether your addon's \"addon\" trees should be resolved statically\n // at build time.\n //\n // false (the default): implies maximum backward compatibility at the cost\n // of bigger builds. In this mode, we force every file into the Ember app,\n // which is the legacy behavior.\n //\n // true: produces smaller builds. The addon files must be imported from\n // somewhere we can statically see during the build. In this mode, your app\n // will only include files that are actually imported from somewhere.\n //\n // Commentary: most v1 addons already work well with this set to true, because\n // they tend to either offer Javascript that users are supposed to directly\n // `import` or components / helpers / services that get directly imported and\n // re-exported by code in App Javascript. The exceptions are addons that do\n // runtime shenanigans with `require` or scoped runtime resolutions.\n //\n // To workaround an addon that is preventing you from enabling this flag, you\n // can use addonDependencyRules.\n staticAddonTrees?: boolean;\n\n // Controls whether your addon's \"addonTestSupport\" trees should be resolved\n // statically at build time.\n //\n // false (the default): implies maximum backward compatibility at the cost\n // of bigger builds. All test support files will be forced into your Ember\n // app, which is the legacy behavior.\n //\n // true: produces smaller builds. Only files that are explicitly imported\n // will end up in your app.\n //\n // Commentary: this is analogous to staticAddonTrees and the same guidelines\n // apply.\n staticAddonTestSupportTrees?: boolean;\n\n // when true, we will load ember-source as ES modules. This means unused parts\n // of ember-source won't be included. But it also means that addons using old\n // APIs to try to `require()` things from Ember -- particularly from within\n // vendor.js -- cannot do that anymore.\n //\n // When false (the default) we load ember-source the traditional way, which is\n // that a big ol' script gets smooshed into vendor.js, and none of ember's\n // public module API actually exists as modules at build time.\n staticEmberSource?: boolean;\n\n // Allows you to override how specific addons will build. Like:\n //\n // import V1Addon from '@embroider/compat'; let compatAdapters = new Map();\n // compatAdapters.set('some-addon', class extends V1Addon {// do stuff here:\n // see examples in ./compat-adapters\n // });\n //\n // This should be understood as a temporary way to keep yourself from getting\n // stuck, not an alternative to actually fixing upstream. For the most part,\n // the real solution will be converting the addon in question to natively\n // publish as v2.\n //\n // We ship with some default compatAdapters to fix otherwise incompatible\n // behaviors in popular addons. You can override the default adapters by\n // setting your own value here (including null to completely disable it).\n compatAdapters?: Map<string, V1AddonConstructor | null>;\n\n // optional list of additional broccoli trees that should be incorporated into\n // the final build. This exists because the classic `app.toTree()` method\n // accepts an optional tree argument that has the same purpose.\n extraPublicTrees?: Node[];\n\n // Allows you to tell Embroider about otherwise dynamic dependencies within\n // your app and addons that it can't figure out on its own. These are combined\n // with the default rules that ship with Embroider. Your own rules take\n // precedence over the built-ins. Order matters, first matching rule will\n // apply to any given addon.\n //\n // See the addon-dependency-rules directory in the @embroider/compat package\n // for the built-in rules.\n //\n // These ONLY APPLY to v1-formatted addons. An addon that ships as native v2\n // is expected to do the right thing on its own.\n //\n // Follow to the definition of PackageRules for more info.\n packageRules?: PackageRules[];\n\n // This turns build errors into runtime errors. It is not a good idea to keep\n // it on in production. But it can be helpful when testing how much of your\n // app is able to work with staticComponents enabled.\n allowUnsafeDynamicComponents?: boolean;\n\n // Allows you to customize the list of content types addons use to provide HTML\n // to {{content-for}}. By default, the following content types are expected:\n // 'head', 'test-head', 'head-footer', 'test-head-footer', 'body', 'test-body',\n // 'body-footer', 'test-body-footer'. You need to use this config only to extend\n // this list.\n availableContentForTypes?: string[];\n\n // Allows you to cancel the warning that at least one classic addon provides\n // content-for 'app-boot'. This warning brings awareness for developers\n // switching to Embroider, but is no longer necessary once content-for\n // 'app-boot' code has been properly moved to the app-side.\n useAddonAppBoot?: boolean;\n}\n\nconst defaults = Object.assign(coreWithDefaults(), {\n staticAddonTrees: false,\n staticAddonTestSupportTrees: false,\n staticEmberSource: false,\n compatAdapters: new Map(),\n extraPublicTrees: [],\n workspaceDir: null,\n packageRules: [],\n allowUnsafeDynamicComponents: false,\n availableContentForTypes: [],\n useAddonAppBoot: true,\n});\n\nexport function optionsWithDefaults(options?: Options): Required<Options> {\n return Object.assign({}, defaults, options);\n}\n\n// These are recommended configurations for addons to test themselves under. By\n// keeping them here, it's easier to do ecosystem-wide compatibility testing.\n// See the `@embroider/test-setup` package which can help consume these to test\n// them in CI.\nexport const recommendedOptions: { [name: string]: Options } = Object.freeze({\n safe: Object.freeze({}),\n optimized: Object.freeze({\n staticAddonTrees: true,\n staticAddonTestSupportTrees: true,\n staticHelpers: true,\n staticModifiers: true,\n staticComponents: true,\n staticEmberSource: true,\n allowUnsafeDynamicComponents: false,\n }),\n});\n"]}
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["options.ts"],"names":[],"mappings":";;;AAmIA,kDAEC;AAlID,0CAA0E;AAkH1E,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAA,0BAAgB,GAAE,EAAE;IACjD,gBAAgB,EAAE,KAAK;IACvB,2BAA2B,EAAE,KAAK;IAClC,iBAAiB,EAAE,KAAK;IACxB,cAAc,EAAE,IAAI,GAAG,EAAE;IACzB,gBAAgB,EAAE,EAAE;IACpB,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE,EAAE;IAChB,4BAA4B,EAAE,KAAK;IACnC,wBAAwB,EAAE,EAAE;IAC5B,eAAe,EAAE,IAAI;IACrB,oBAAoB,EAAE,IAAI;CAC3B,CAAC,CAAC;AAEH,SAAgB,mBAAmB,CAAC,OAAiB;IACnD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC;AAED,+EAA+E;AAC/E,6EAA6E;AAC7E,+EAA+E;AAC/E,cAAc;AACD,QAAA,kBAAkB,GAAgC,MAAM,CAAC,MAAM,CAAC;IAC3E,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC;QACvB,gBAAgB,EAAE,IAAI;QACtB,2BAA2B,EAAE,IAAI;QACjC,aAAa,EAAE,IAAI;QACnB,eAAe,EAAE,IAAI;QACrB,gBAAgB,EAAE,IAAI;QACtB,iBAAiB,EAAE,IAAI;QACvB,4BAA4B,EAAE,KAAK;KACpC,CAAC;CACH,CAAC,CAAC","sourcesContent":["import type { V1AddonConstructor } from './v1-addon';\nimport type { Node } from 'broccoli-node-api';\nimport type { Options as CoreOptions } from '@embroider/core';\nimport { optionsWithDefaults as coreWithDefaults } from '@embroider/core';\nimport type { PackageRules } from './dependency-rules';\n\n// These options control how hard we will try to achieve compatibility with v1\n// addons. The defaults are conservative and try to maximize compatibility, at\n// the cost of slower or bigger builds. As you eliminate sources of legacy\n// behavior you can benefit from the more aggressive modes.\nexport default interface Options extends CoreOptions {\n // Controls whether your addon's \"addon\" trees should be resolved statically\n // at build time.\n //\n // false (the default): implies maximum backward compatibility at the cost\n // of bigger builds. In this mode, we force every file into the Ember app,\n // which is the legacy behavior.\n //\n // true: produces smaller builds. The addon files must be imported from\n // somewhere we can statically see during the build. In this mode, your app\n // will only include files that are actually imported from somewhere.\n //\n // Commentary: most v1 addons already work well with this set to true, because\n // they tend to either offer Javascript that users are supposed to directly\n // `import` or components / helpers / services that get directly imported and\n // re-exported by code in App Javascript. The exceptions are addons that do\n // runtime shenanigans with `require` or scoped runtime resolutions.\n //\n // To workaround an addon that is preventing you from enabling this flag, you\n // can use addonDependencyRules.\n staticAddonTrees?: boolean;\n\n // Controls whether your addon's \"addonTestSupport\" trees should be resolved\n // statically at build time.\n //\n // false (the default): implies maximum backward compatibility at the cost\n // of bigger builds. All test support files will be forced into your Ember\n // app, which is the legacy behavior.\n //\n // true: produces smaller builds. Only files that are explicitly imported\n // will end up in your app.\n //\n // Commentary: this is analogous to staticAddonTrees and the same guidelines\n // apply.\n staticAddonTestSupportTrees?: boolean;\n\n // when true, we will load ember-source as ES modules. This means unused parts\n // of ember-source won't be included. But it also means that addons using old\n // APIs to try to `require()` things from Ember -- particularly from within\n // vendor.js -- cannot do that anymore.\n //\n // When false (the default) we load ember-source the traditional way, which is\n // that a big ol' script gets smooshed into vendor.js, and none of ember's\n // public module API actually exists as modules at build time.\n staticEmberSource?: boolean;\n\n // Allows you to override how specific addons will build. Like:\n //\n // import V1Addon from '@embroider/compat'; let compatAdapters = new Map();\n // compatAdapters.set('some-addon', class extends V1Addon {// do stuff here:\n // see examples in ./compat-adapters\n // });\n //\n // This should be understood as a temporary way to keep yourself from getting\n // stuck, not an alternative to actually fixing upstream. For the most part,\n // the real solution will be converting the addon in question to natively\n // publish as v2.\n //\n // We ship with some default compatAdapters to fix otherwise incompatible\n // behaviors in popular addons. You can override the default adapters by\n // setting your own value here (including null to completely disable it).\n compatAdapters?: Map<string, V1AddonConstructor | null>;\n\n // optional list of additional broccoli trees that should be incorporated into\n // the final build. This exists because the classic `app.toTree()` method\n // accepts an optional tree argument that has the same purpose.\n extraPublicTrees?: Node[];\n\n // Allows you to tell Embroider about otherwise dynamic dependencies within\n // your app and addons that it can't figure out on its own. These are combined\n // with the default rules that ship with Embroider. Your own rules take\n // precedence over the built-ins. Order matters, first matching rule will\n // apply to any given addon.\n //\n // See the addon-dependency-rules directory in the @embroider/compat package\n // for the built-in rules.\n //\n // These ONLY APPLY to v1-formatted addons. An addon that ships as native v2\n // is expected to do the right thing on its own.\n //\n // Follow to the definition of PackageRules for more info.\n packageRules?: PackageRules[];\n\n // This turns build errors into runtime errors. It is not a good idea to keep\n // it on in production. But it can be helpful when testing how much of your\n // app is able to work with staticComponents enabled.\n allowUnsafeDynamicComponents?: boolean;\n\n // Allows you to customize the list of content types addons use to provide HTML\n // to {{content-for}}. By default, the following content types are expected:\n // 'head', 'test-head', 'head-footer', 'test-head-footer', 'body', 'test-body',\n // 'body-footer', 'test-body-footer'. You need to use this config only to extend\n // this list.\n availableContentForTypes?: string[];\n\n // Allows you to cancel the warning that at least one classic addon provides\n // content-for 'app-boot'. This warning brings awareness for developers\n // switching to Embroider, but is no longer necessary once content-for\n // 'app-boot' code has been properly moved to the app-side.\n useAddonAppBoot?: boolean;\n\n // content-for 'config-module'. This warning brings awareness for developers\n // switching to Embroider, but is no longer necessary once content-for\n // 'config-module' code has been properly moved to the app-side.\n useAddonConfigModule?: boolean;\n}\n\nconst defaults = Object.assign(coreWithDefaults(), {\n staticAddonTrees: false,\n staticAddonTestSupportTrees: false,\n staticEmberSource: false,\n compatAdapters: new Map(),\n extraPublicTrees: [],\n workspaceDir: null,\n packageRules: [],\n allowUnsafeDynamicComponents: false,\n availableContentForTypes: [],\n useAddonAppBoot: true,\n useAddonConfigModule: true,\n});\n\nexport function optionsWithDefaults(options?: Options): Required<Options> {\n return Object.assign({}, defaults, options);\n}\n\n// These are recommended configurations for addons to test themselves under. By\n// keeping them here, it's easier to do ecosystem-wide compatibility testing.\n// See the `@embroider/test-setup` package which can help consume these to test\n// them in CI.\nexport const recommendedOptions: { [name: string]: Options } = Object.freeze({\n safe: Object.freeze({}),\n optimized: Object.freeze({\n staticAddonTrees: true,\n staticAddonTestSupportTrees: true,\n staticHelpers: true,\n staticModifiers: true,\n staticComponents: true,\n staticEmberSource: true,\n allowUnsafeDynamicComponents: false,\n }),\n});\n"]}