@embroider/compat 4.1.1 → 4.1.3
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/dist/src/babel.js
CHANGED
|
@@ -54,6 +54,8 @@ function babelMacros() {
|
|
|
54
54
|
}
|
|
55
55
|
function oldDebugMacros() {
|
|
56
56
|
let debugMacros = require.resolve('babel-plugin-debug-macros');
|
|
57
|
+
// Translate debug flag/calls to macroCondition(isDevelopingApp()) for consistency with @ember packages from ember-source
|
|
58
|
+
const isDebug = '@embroider/macros';
|
|
57
59
|
return [
|
|
58
60
|
[
|
|
59
61
|
debugMacros,
|
|
@@ -62,13 +64,13 @@ function oldDebugMacros() {
|
|
|
62
64
|
{
|
|
63
65
|
source: '@glimmer/env',
|
|
64
66
|
flags: {
|
|
65
|
-
DEBUG:
|
|
66
|
-
CI:
|
|
67
|
+
DEBUG: isDebug,
|
|
68
|
+
CI: !!process.env.CI,
|
|
67
69
|
},
|
|
68
70
|
},
|
|
69
71
|
],
|
|
70
72
|
debugTools: {
|
|
71
|
-
isDebug
|
|
73
|
+
isDebug,
|
|
72
74
|
source: '@ember/debug',
|
|
73
75
|
assertPredicateIndex: 1,
|
|
74
76
|
},
|
|
@@ -85,7 +87,7 @@ function oldDebugMacros() {
|
|
|
85
87
|
module: '@ember/application/deprecations',
|
|
86
88
|
},
|
|
87
89
|
debugTools: {
|
|
88
|
-
isDebug
|
|
90
|
+
isDebug,
|
|
89
91
|
source: '@ember/application/deprecations',
|
|
90
92
|
assertPredicateIndex: 1,
|
|
91
93
|
},
|
|
@@ -128,7 +130,7 @@ function templateColocation() {
|
|
|
128
130
|
return [core_1.templateColocationPluginPath, colocationOptions];
|
|
129
131
|
}
|
|
130
132
|
function babelCompatSupport() {
|
|
131
|
-
return [...
|
|
133
|
+
return [...oldDebugMacros(), ...babelMacros(), templateColocation(), ...pluginsFromV1Addons()];
|
|
132
134
|
}
|
|
133
135
|
function templateCompatSupport() {
|
|
134
136
|
return [...transformsFromV1Addons(), ...templateMacros(), looseModeSupport()];
|
package/dist/src/babel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babel.js","sourceRoot":"","sources":["../../src/babel.ts"],"names":[],"mappings":";;AAuCA,kDAGC;AAED,wDAGC;AAED,4CAOC;AAED,wCAGC;AAED,kCAGC;AAED,
|
|
1
|
+
{"version":3,"file":"babel.js","sourceRoot":"","sources":["../../src/babel.ts"],"names":[],"mappings":";;AAuCA,kDAGC;AAED,wDAGC;AAED,4CAOC;AAED,wCAGC;AAED,kCAGC;AAED,wCA6CC;AAED,gDAkCC;AAED,gDAEC;AAED,sDAEC;AA5JD,2BAAgC;AAChC,0CAKyB;AACzB,+BAA4B;AAG5B,mDAAsD;AAStD,SAAS,gBAAgB;IACvB,IAAI,UAAU,GAAG,IAAA,WAAI,EAAC,IAAA,gCAAyB,EAAC,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,mBAAmB,CAAC,CAAC;IACrF,IAAI,IAAA,eAAU,EAAC,UAAU,CAAC,EAAE,CAAC;QAC3B,iEAAiE;QACjE,OAAO,OAAO,CAAC,UAAU,CAAC,CAAC;IAC7B,CAAC;IAED,IAAI,MAAM,GAAG,IAAA,mBAAW,GAAE,CAAC;IAE3B,OAAO;QACL,OAAO,EAAE,EAAE;QACX,kBAAkB,EAAE,EAAE;QACtB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,cAAc,EAAE,MAAM,CAAC,cAAqB;KAC7C,CAAC;AACJ,CAAC;AAED,MAAM,cAAc,GAAG,IAAI,qBAAc,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;AAEzD,SAAgB,mBAAmB;IACjC,IAAI,MAAM,GAAG,gBAAgB,EAAE,CAAC;IAChC,OAAO,MAAM,CAAC,OAAO,CAAC;AACxB,CAAC;AAED,SAAgB,sBAAsB;IACpC,IAAI,MAAM,GAAG,gBAAgB,EAAE,CAAC;IAChC,OAAO,MAAM,CAAC,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aACF;YACD,2CAA2C;SAC5C;KACF,CAAC;AACJ,CAAC;AAED,SAAgB,kBAAkB;IAChC,IAAI,iBAAiB,GAAoC;QACvD,OAAO,EAAE,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO;QAEhD,sEAAsE;QACtE,EAAE;QACF,uEAAuE;QACvE,8CAA8C;QAC9C,EAAE;QACF,0EAA0E;QAC1E,wEAAwE;QACxE,qEAAqE;QACrE,2DAA2D;QAC3D,EAAE;QACF,uEAAuE;QACvE,4CAA4C;QAC5C,EAAE;QACF,+DAA+D;QAC/D,6DAA6D;QAC7D,wEAAwE;QACxE,sEAAsE;QACtE,gBAAgB;QAChB,EAAE;QACF,yEAAyE;QACzE,wEAAwE;QACxE,kBAAkB;QAClB,kBAAkB,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC;QAEvC,oEAAoE;QACpE,wEAAwE;QACxE,sEAAsE;QACtE,YAAY,EAAE,IAAI;KACnB,CAAC;IACF,OAAO,CAAC,mCAA4B,EAAE,iBAAiB,CAAC,CAAC;AAC3D,CAAC;AAED,SAAgB,kBAAkB;IAChC,OAAO,CAAC,GAAG,cAAc,EAAE,EAAE,GAAG,WAAW,EAAE,EAAE,kBAAkB,EAAE,EAAE,GAAG,mBAAmB,EAAE,CAAC,CAAC;AACjG,CAAC;AAED,SAAgB,qBAAqB;IACnC,OAAO,CAAC,GAAG,sBAAsB,EAAE,EAAE,GAAG,cAAc,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAChF,CAAC","sourcesContent":["import type { PluginItem } from '@babel/core';\nimport { existsSync } from 'fs';\nimport {\n locateEmbroiderWorkingDir,\n ResolverLoader,\n templateColocationPluginPath,\n type TemplateColocationPluginOptions,\n} from '@embroider/core';\nimport { join } from 'path';\nimport type { Transform } from 'babel-plugin-ember-template-compilation';\nimport type { Options as ResolverTransformOptions } from './resolver-transform';\nimport { buildMacros } from '@embroider/macros/babel';\n\nexport interface CompatBabelState {\n plugins: PluginItem[];\n templateTransforms: Transform[];\n babelMacros: PluginItem[];\n templateMacros: Transform[];\n}\n\nfunction loadCompatConfig(): CompatBabelState {\n let compatFile = join(locateEmbroiderWorkingDir(process.cwd()), '_babel_compat_.js');\n if (existsSync(compatFile)) {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n return require(compatFile);\n }\n\n let macros = buildMacros();\n\n return {\n plugins: [],\n templateTransforms: [],\n babelMacros: macros.babelMacros,\n templateMacros: macros.templateMacros as any,\n };\n}\n\nconst resolverLoader = new ResolverLoader(process.cwd());\n\nexport function pluginsFromV1Addons() {\n let config = loadCompatConfig();\n return config.plugins;\n}\n\nexport function transformsFromV1Addons() {\n let config = loadCompatConfig();\n return config.templateTransforms;\n}\n\nexport function looseModeSupport(): Transform {\n const { resolver } = resolverLoader;\n let opts: ResolverTransformOptions = {\n appRoot: resolver.options.appRoot,\n emberVersion: resolver.options.emberVersion,\n };\n return [require.resolve('./resolver-transform'), opts];\n}\n\nexport function templateMacros() {\n let config = loadCompatConfig();\n return config.templateMacros;\n}\n\nexport function babelMacros() {\n let config = loadCompatConfig();\n return config.babelMacros;\n}\n\nexport function oldDebugMacros(): PluginItem[] {\n let debugMacros = require.resolve('babel-plugin-debug-macros');\n\n // Translate debug flag/calls to macroCondition(isDevelopingApp()) for consistency with @ember packages from ember-source\n const isDebug = '@embroider/macros';\n\n return [\n [\n debugMacros,\n {\n flags: [\n {\n source: '@glimmer/env',\n flags: {\n DEBUG: isDebug,\n CI: !!process.env.CI,\n },\n },\n ],\n debugTools: {\n isDebug,\n source: '@ember/debug',\n assertPredicateIndex: 1,\n },\n externalizeHelpers: {\n module: '@ember/debug',\n },\n },\n '@ember/debug stripping',\n ],\n [\n debugMacros,\n {\n externalizeHelpers: {\n module: '@ember/application/deprecations',\n },\n debugTools: {\n isDebug,\n source: '@ember/application/deprecations',\n assertPredicateIndex: 1,\n },\n },\n '@ember/application/deprecations stripping',\n ],\n ];\n}\n\nexport function templateColocation(): PluginItem {\n let colocationOptions: TemplateColocationPluginOptions = {\n appRoot: resolverLoader.resolver.options.appRoot,\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 return [templateColocationPluginPath, colocationOptions];\n}\n\nexport function babelCompatSupport(): PluginItem[] {\n return [...oldDebugMacros(), ...babelMacros(), templateColocation(), ...pluginsFromV1Addons()];\n}\n\nexport function templateCompatSupport(): Transform[] {\n return [...transformsFromV1Addons(), ...templateMacros(), looseModeSupport()];\n}\n"]}
|
|
@@ -311,6 +311,7 @@ function fixDeprecate(babel) {
|
|
|
311
311
|
VariableDeclarator(path) {
|
|
312
312
|
if (path.node.id.type === 'Identifier' && path.node.id.name === 'deprecate') {
|
|
313
313
|
path.node.id.name = 'currentDeprecate';
|
|
314
|
+
path.node.init = null; // leave undefined for newDeprecate's (currentDeprecate ?? _deprecated) expression
|
|
314
315
|
}
|
|
315
316
|
},
|
|
316
317
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ember-source.js","sourceRoot":"","sources":["../../../src/compat-adapters/ember-source.ts"],"names":[],"mappings":";;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J,CAAC;AAED,SAAS,YAAY,CAAC,KAAmB;IACvC,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;IACpB,OAAO;QACL,OAAO,EAAE;YACP,OAAO,CAAC,IAAmC;gBACzC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CACpB,CAAC,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CACvG,CAAC;YACJ,CAAC;YACD,iBAAiB,EAAE;gBACjB,KAAK,CAAC,IAA6C,EAAE,KAAiC;oBACpF,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK,eAAe,EAAE,CAAC;wBAC/C,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC;oBAC7B,CAAC;gBACH,CAAC;gBACD,IAAI,CAAC,KAA8C,EAAE,KAAiC;oBACpF,KAAK,CAAC,aAAa,GAAG,KAAK,CAAC;gBAC9B,CAAC;aACF;YACD,eAAe,CAAC,IAA2C,EAAE,KAAiC;gBAC5F,IAAI,IAAI,GAAG,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;gBAC9F,IAAI,KAAK,CAAC,aAAa,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;oBAC1C,IAAI,CAAC,MAAM,EAAE,CAAC;gBAChB,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import V1Addon from '../v1-addon';\nimport buildFunnel from 'broccoli-funnel';\nimport mergeTrees from 'broccoli-merge-trees';\nimport AddToTree from '../add-to-tree';\nimport { outputFileSync, readFileSync, readdirSync, unlinkSync } from 'fs-extra';\nimport { join, resolve } from 'path';\nimport { Memoize } from 'typescript-memoize';\nimport { satisfies } from 'semver';\nimport { transform } from '@babel/core';\nimport type * as Babel from '@babel/core';\nimport type { NodePath } from '@babel/traverse';\nimport Plugin from 'broccoli-plugin';\nimport type { Node } from 'broccoli-node-api';\nimport { existsSync } from 'fs';\n\nexport default class extends V1Addon {\n get v2Tree() {\n return mergeTrees([super.v2Tree, buildFunnel(this.rootTree, { include: ['dist/ember-template-compiler.js'] })]);\n }\n\n // versions of ember-source prior to\n // https://github.com/emberjs/ember.js/pull/20675 ship dist/packages and\n // dist/dependencies separately and the imports between them are package-name\n // imports. Since many of the dependencies are also true package.json\n // dependencies (in order to get typescript types), and our module-resolver\n // prioritizes true dependencies, it's necessary to detect and remove the\n // package.json dependencies.\n //\n // After the above linked change, ember-source ships only dist/packages and\n // the inter-package imports are all relative. Some of the things in\n // dist/packages are still the rolled-in dependencies, but now that the\n // imports are all relative we need no special handling for them (beyond the\n // normal v2 addon renamed-modules support.\n @Memoize()\n private get includedDependencies() {\n let result: string[] = [];\n let depsDir = resolve(this.root, 'dist', 'dependencies');\n if (!existsSync(depsDir)) {\n return result;\n }\n for (let name of readdirSync(depsDir)) {\n if (name[0] === '@') {\n for (let innerName of readdirSync(resolve(this.root, 'dist', 'dependencies', name))) {\n if (innerName.endsWith('.js')) {\n result.push(name + '/' + innerName.slice(0, -3));\n }\n }\n } else {\n if (name.endsWith('.js')) {\n result.push(name.slice(0, -3));\n }\n }\n }\n return result;\n }\n\n get newPackageJSON() {\n let json = super.newPackageJSON;\n\n for (let name of this.includedDependencies) {\n // weirdly, many of the inlined dependency are still listed as real\n // dependencies too. If we don't delete them here, they will take\n // precedence over the inlined ones, because the embroider module-resolver\n // tries to prioritize real deps.\n delete json.dependencies?.[name];\n }\n\n return json;\n }\n\n customizes(treeName: string) {\n // we are adding custom implementations of these\n return treeName === 'treeForAddon' || treeName === 'treeForVendor' || super.customizes(treeName);\n }\n\n invokeOriginalTreeFor(name: string) {\n if (name === 'addon') {\n return this.customAddonTree();\n }\n if (name === 'vendor') {\n return this.customVendorTree();\n }\n }\n\n // Our addon tree is all of the \"packages\" we share. @embroider/compat already\n // supports that pattern of emitting modules into other package's namespaces.\n private customAddonTree() {\n let packages = buildFunnel(this.rootTree, {\n srcDir: 'dist/packages',\n });\n\n let trees: Node[] = [\n packages,\n buildFunnel(this.rootTree, {\n srcDir: 'dist/dependencies',\n allowEmpty: true,\n }),\n ];\n\n if (satisfies(this.packageJSON.version, '>= 4.0.0-alpha.0 <4.10.0-alpha.0', { includePrerelease: true })) {\n // import { loc } from '@ember/string' was removed in 4.0. but the\n // top-level `ember` package tries to import it until 4.10. A\n // spec-compliant ES modules implementation will treat this as a parse\n // error.\n trees.push(new ReplaceRequire([new FixStringLoc([packages])]));\n } else if (satisfies(this.packageJSON.version, '<5.7.0')) {\n trees.push(new ReplaceRequire([packages]));\n }\n\n if (satisfies(this.packageJSON.version, '<5.12.0')) {\n trees.push(new FixDeprecateFunction([packages]));\n }\n\n if (satisfies(this.packageJSON.version, '<5.11.1')) {\n trees.push(new FixCycleImports([packages]));\n }\n\n return mergeTrees(trees, { overwrite: true });\n }\n\n // We're zeroing out these files in vendor rather than deleting them, because\n // we can't easily intercept the `app.import` that presumably exists for them,\n // so rather than error they will just be empty.\n //\n // The reason we're zeroing these out is that we're going to consume all our\n // modules directly out of treeForAddon instead, as real modules that webpack\n // can see.\n private customVendorTree() {\n return new AddToTree(this.addonInstance._treeFor('vendor'), outputPath => {\n unlinkSync(join(outputPath, 'ember', 'ember.js'));\n outputFileSync(join(outputPath, 'ember', 'ember.js'), '');\n unlinkSync(join(outputPath, 'ember', 'ember-testing.js'));\n outputFileSync(join(outputPath, 'ember', 'ember-testing.js'), '');\n });\n }\n\n get packageMeta() {\n let meta = super.packageMeta;\n\n if (!meta['implicit-modules']) {\n meta['implicit-modules'] = [];\n }\n meta['implicit-modules'].push('./ember/index.js');\n // before 5.6, Ember uses the AMD loader to decide if it's test-only parts\n // are present, so we must ensure they're registered. After that it's\n // enough to evaluate ember-testing, which @embroider/core is hard-coded\n // to do in the backward-compatible tests bundle.\n if (!satisfies(this.packageJSON.version, '>= 5.6.0-alpha.0', { includePrerelease: true })) {\n if (!meta['implicit-test-modules']) {\n meta['implicit-test-modules'] = [];\n }\n meta['implicit-test-modules'].push('./ember-testing/index.js');\n }\n\n return meta;\n }\n}\n\nclass FixStringLoc extends Plugin {\n build() {\n let inSource = readFileSync(resolve(this.inputPaths[0], 'ember', 'index.js'), 'utf8');\n let outSource = transform(inSource, {\n plugins: [fixStringLoc],\n configFile: false,\n })!.code!;\n outputFileSync(resolve(this.outputPath, 'ember', 'index.js'), outSource, 'utf8');\n }\n}\n\nclass ReplaceRequire extends Plugin {\n build() {\n updateFileWithTransform(this, 'ember/index.js', function (babel: typeof Babel) {\n const { types: t } = babel;\n\n function createLoader() {\n return t.objectExpression([\n t.objectMethod(\n 'get',\n t.identifier('require'),\n [],\n t.blockStatement([\n t.returnStatement(t.memberExpression(t.identifier('globalThis'), t.identifier('require'))),\n ])\n ),\n t.objectMethod(\n 'get',\n t.identifier('define'),\n [],\n t.blockStatement([\n t.returnStatement(t.memberExpression(t.identifier('globalThis'), t.identifier('define'))),\n ])\n ),\n t.objectMethod(\n 'get',\n t.identifier('registry'),\n [],\n\n t.blockStatement([\n t.returnStatement(\n t.logicalExpression(\n '??',\n t.optionalMemberExpression(\n t.memberExpression(t.identifier('globalThis'), t.identifier('requirejs')),\n t.identifier('entries'),\n false,\n true\n ),\n t.optionalMemberExpression(\n t.memberExpression(t.identifier('globalThis'), t.identifier('require')),\n t.identifier('entries'),\n false,\n true\n )\n )\n ),\n ])\n ),\n ]);\n }\n\n return {\n visitor: {\n CallExpression(path: NodePath<Babel.types.CallExpression>) {\n if (\n path.node.callee.type === 'Identifier' &&\n (path.node.callee.name === 'has' || path.node.callee.name === 'require') &&\n path.node.arguments[0].type === 'StringLiteral' &&\n path.node.arguments[0].value === 'ember-testing'\n ) {\n path.replaceWith(t.identifier('EmberTestingImpl'));\n }\n },\n ImportDeclaration(path: NodePath<Babel.types.ImportDeclaration>) {\n if (path.node.source.value === 'require') {\n path.replaceWith(\n t.importDeclaration(\n [t.importSpecifier(t.identifier('EmberTestingImpl'), t.identifier('_impl'))],\n t.stringLiteral('@ember/test')\n )\n );\n }\n },\n VariableDeclaration(path: NodePath<Babel.types.VariableDeclaration>) {\n if (\n path.node.declarations[0].id.type === 'Identifier' &&\n path.node.declarations[0].id.name === 'PartialEmber' &&\n path.node.declarations[0].init!.type === 'ObjectExpression'\n ) {\n const declaration = path.node.declarations[0];\n const loader = (declaration.init! as Babel.types.ObjectExpression).properties.find(\n p => (p.type === 'ObjectProperty' && p.key.type === 'Identifier' && p.key.name) === '__loader'\n );\n (loader as Babel.types.ObjectProperty).value = createLoader();\n }\n },\n AssignmentExpression(path: NodePath<Babel.types.AssignmentExpression>) {\n if (\n path.node.left.type === 'MemberExpression' &&\n path.node.left.object.type === 'Identifier' &&\n path.node.left.object.name === 'Ember' &&\n path.node.left.property.type === 'Identifier' &&\n path.node.left.property.name === '__loader'\n ) {\n path.node.right = createLoader();\n }\n },\n },\n };\n });\n\n replaceFile(\n this,\n '@ember/test/adapter.js',\n `import { Adapter } from 'ember-testing';\n export default Adapter;`\n );\n\n replaceFile(\n this,\n '@ember/test/index.js',\n `export let registerAsyncHelper;\nexport let registerHelper;\nexport let registerWaiter;\nexport let unregisterHelper;\nexport let unregisterWaiter;\nexport let _impl;\n\nlet testingNotAvailableMessage = () => {\n throw new Error('Attempted to use test utilities, but \\`ember-testing\\` was not included');\n};\n\nregisterAsyncHelper = testingNotAvailableMessage;\nregisterHelper = testingNotAvailableMessage;\nregisterWaiter = testingNotAvailableMessage;\nunregisterHelper = testingNotAvailableMessage;\nunregisterWaiter = testingNotAvailableMessage;\n\nexport function registerTestImplementaiton(impl) {\n let { Test } = impl;\n registerAsyncHelper = Test.registerAsyncHelper;\n registerHelper = Test.registerHelper;\n registerWaiter = Test.registerWaiter;\n unregisterHelper = Test.unregisterHelper;\n unregisterWaiter = Test.unregisterWaiter;\n _impl = impl;\n}`\n );\n\n replaceFile(\n this,\n 'ember-testing/index.js',\n `export * from './lib/public-api';\nimport * as EmberTesting from './lib/public-api';\nimport { registerTestImplementaiton } from '@ember/test';\n\n\nregisterTestImplementaiton(EmberTesting);`\n );\n\n replaceFile(\n this,\n 'ember-testing/lib/public-api.js',\n `\nexport { default as Test } from './test';\nexport { default as Adapter } from './adapters/adapter';\nexport { default as setupForTesting } from './setup_for_testing';\nexport { default as QUnitAdapter } from './adapters/qunit';\n\nimport './ext/application';\nimport './ext/rsvp'; // setup RSVP + run loop integration\nimport './helpers'; // adds helpers to helpers object in Test\nimport './initializers'; // to setup initializer`\n );\n }\n}\n\nclass FixDeprecateFunction extends Plugin {\n build() {\n let inSource = readFileSync(resolve(this.inputPaths[0], '@ember', 'debug', 'index.js'), 'utf8');\n let outSource = transform(inSource, {\n plugins: [fixDeprecate],\n configFile: false,\n })!.code!;\n outputFileSync(resolve(this.outputPath, '@ember', 'debug', 'index.js'), outSource, 'utf8');\n }\n}\n\nfunction fixDeprecate(babel: typeof Babel) {\n const { types: t } = babel;\n\n return {\n name: 'ast-transform', // not required\n visitor: {\n Program(path: NodePath<Babel.types.Program>) {\n path.node.body.unshift(\n t.functionDeclaration(\n t.identifier('newDeprecate'),\n [t.restElement(t.identifier('rest'))],\n t.blockStatement([\n t.returnStatement(\n t.callExpression(\n t.logicalExpression('??', t.identifier('currentDeprecate'), t.identifier('_deprecate')),\n [t.spreadElement(t.identifier('rest'))]\n )\n ),\n ])\n )\n );\n },\n AssignmentExpression(path: NodePath<Babel.types.AssignmentExpression>) {\n if (path.node.left.type === 'Identifier' && path.node.left.name === 'deprecate') {\n path.node.left.name = 'currentDeprecate';\n }\n },\n\n ReturnStatement(path: NodePath<Babel.types.ReturnStatement>) {\n if (path.node.argument?.type === 'Identifier' && path.node.argument.name === 'deprecate') {\n path.node.argument.name = 'newDeprecate';\n }\n },\n\n CallExpression(path: NodePath<Babel.types.CallExpression>) {\n if (path.node.callee.type === 'Identifier' && path.node.callee.name === 'deprecate') {\n path.node.callee.name = 'newDeprecate';\n }\n if (\n path.node.callee.type === 'Identifier' &&\n path.node.callee.name === 'setDebugFunction' &&\n path.node.arguments[0].type === 'StringLiteral' &&\n path.node.arguments[0].value === 'deprecate'\n ) {\n path.remove();\n }\n },\n ExportSpecifier(path: NodePath<Babel.types.ExportSpecifier>) {\n if (path.node.local.name === 'deprecate') {\n path.node.local = t.identifier('newDeprecate');\n }\n },\n VariableDeclarator(path: NodePath<Babel.types.VariableDeclarator>) {\n if (path.node.id.type === 'Identifier' && path.node.id.name === 'deprecate') {\n path.node.id.name = 'currentDeprecate';\n }\n },\n },\n };\n}\n\nfunction updateFileWithTransform(\n context: Plugin,\n file: string,\n transformFunction: Babel.PluginItem | Babel.PluginItem[]\n) {\n // only update the file if it exists - this helps the codemods to work across many different versions\n if (!existsSync(resolve(context.inputPaths[0], file))) {\n return;\n }\n let inSource = readFileSync(resolve(context.inputPaths[0], file), 'utf8');\n\n let plugins = Array.isArray(transformFunction) ? transformFunction : [transformFunction];\n let outSource = transform(inSource, {\n plugins,\n configFile: false,\n })!.code!;\n outputFileSync(resolve(context.outputPath, file), outSource, 'utf8');\n}\n\nfunction replaceFile(context: Plugin, file: string, content: string) {\n outputFileSync(resolve(context.outputPath, file), content, 'utf8');\n}\n\nclass FixCycleImports extends Plugin {\n build() {\n for (let file of ['@ember/object/observable.js', '@ember/utils/lib/is_empty.js']) {\n updateFileWithTransform(this, file, moveObjectSpecifiersToMetal);\n }\n\n updateFileWithTransform(this, '@ember/array/index.js', [\n moveObjectSpecifiersToMetal,\n function (babel: typeof Babel) {\n const { types: t } = babel;\n return {\n visitor: {\n ExportNamedDeclaration(path: NodePath<Babel.types.ExportNamedDeclaration>) {\n if (path.node.source?.value === './lib/make-array') {\n path.node.source = t.stringLiteral('./make');\n }\n },\n },\n };\n },\n ]);\n\n updateFileWithTransform(this, '@ember/runloop/index.js', function (babel: typeof Babel) {\n const { types: t } = babel;\n\n return {\n visitor: {\n CallExpression(path: NodePath<Babel.types.CallExpression>) {\n if (path.node.callee.type === 'Identifier' && path.node.callee.name === 'flushAsyncObservers') {\n path.node.arguments = [t.identifier('schedule')];\n }\n },\n },\n };\n });\n\n updateFileWithTransform(this, '@ember/object/core.js', function (babel: typeof Babel) {\n const { types: t } = babel;\n\n return {\n visitor: {\n ImportDeclaration(path: NodePath<Babel.types.ImportDeclaration>) {\n if (path.node.source.value === '@ember/array') {\n path.node.source = t.stringLiteral('@ember/array/make');\n path.node.specifiers = [t.importDefaultSpecifier(t.identifier('makeArray'))];\n }\n\n if (path.node.source.value === '@ember/-internals/runtime') {\n path.replaceWith(\n t.importDeclaration(\n [t.importSpecifier(t.identifier('ActionHandler'), t.identifier('default'))],\n t.stringLiteral('@ember/-internals/runtime/lib/mixins/action_handler')\n )\n );\n }\n },\n },\n };\n });\n\n outputFileSync(\n resolve(this.outputPath, '@ember/array/make.js'),\n `export { default } from './lib/make-array';`,\n 'utf8'\n );\n\n updateFileWithTransform(this, '@ember/-internals/metal/index.js', function (babel: typeof Babel) {\n const { types: t } = babel;\n\n return {\n visitor: {\n FunctionDeclaration(path: NodePath<Babel.types.FunctionDeclaration>) {\n if (path.node.id?.name === 'flushAsyncObservers') {\n path.node.params = [t.identifier('_schedule')];\n }\n },\n IfStatement(path: NodePath<Babel.types.IfStatement>) {\n if (path.node.test.type === 'Identifier' && path.node.test.name === 'shouldSchedule') {\n path.node.test.name = '_schedule';\n }\n },\n CallExpression(path: NodePath<Babel.types.CallExpression>) {\n if (path.node.callee.type === 'Identifier' && path.node.callee.name === 'schedule') {\n path.node.callee.name = '_schedule';\n }\n },\n ImportDeclaration(path: NodePath<Babel.types.ImportDeclaration>) {\n if (path.node.source.value === '@ember/runloop') {\n path.remove();\n }\n },\n },\n };\n });\n }\n}\n\nfunction moveObjectSpecifiersToMetal() {\n let done = false;\n\n return {\n visitor: {\n ImportDeclaration(path: NodePath<Babel.types.ImportDeclaration>) {\n if (path.node.source.value === '@ember/-internals/metal') {\n if (done) {\n return;\n }\n\n /**\n * I need to use getAllPRevSiblings and getAllNextSiblings here because I need the siblings\n * to be paths and path.container only holds nodes (for some strange reason).\n */\n const objectimport = [...path.getAllPrevSiblings(), ...path.getAllNextSiblings()].find(\n p => p.node.type === 'ImportDeclaration' && p.node.source.value === '@ember/object'\n ) as NodePath<Babel.types.ImportDeclaration>;\n\n path.node.specifiers.push(...objectimport!.node.specifiers);\n objectimport.remove();\n\n done = true;\n }\n },\n },\n };\n}\n\nfunction fixStringLoc(babel: typeof Babel) {\n let t = babel.types;\n return {\n visitor: {\n Program(path: NodePath<Babel.types.Program>) {\n path.node.body.unshift(\n t.variableDeclaration('const', [t.variableDeclarator(t.identifier('loc'), t.identifier('undefined'))])\n );\n },\n ImportDeclaration: {\n enter(path: NodePath<Babel.types.ImportDeclaration>, state: { inEmberString: boolean }) {\n if (path.node.source.value === '@ember/string') {\n state.inEmberString = true;\n }\n },\n exit(_path: NodePath<Babel.types.ImportDeclaration>, state: { inEmberString: boolean }) {\n state.inEmberString = false;\n },\n },\n ImportSpecifier(path: NodePath<Babel.types.ImportSpecifier>, state: { inEmberString: boolean }) {\n let name = 'value' in path.node.imported ? path.node.imported.value : path.node.imported.name;\n if (state.inEmberString && name === 'loc') {\n path.remove();\n }\n },\n },\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ember-source.js","sourceRoot":"","sources":["../../../src/compat-adapters/ember-source.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,2DAAkC;AAClC,sEAA0C;AAC1C,gFAA8C;AAC9C,iEAAuC;AACvC,uCAAiF;AACjF,+BAAqC;AACrC,2DAA6C;AAC7C,mCAAmC;AACnC,sCAAwC;AAGxC,sEAAqC;AAErC,2BAAgC;AAEhC,eAAqB,SAAQ,kBAAO;IAClC,IAAI,MAAM;QACR,OAAO,IAAA,8BAAU,EA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,CAAC,OAAO,CACpB,CAAC,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CACvG,CAAC;YACJ,CAAC;YACD,iBAAiB,EAAE;gBACjB,KAAK,CAAC,IAA6C,EAAE,KAAiC;oBACpF,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK,eAAe,EAAE,CAAC;wBAC/C,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC;oBAC7B,CAAC;gBACH,CAAC;gBACD,IAAI,CAAC,KAA8C,EAAE,KAAiC;oBACpF,KAAK,CAAC,aAAa,GAAG,KAAK,CAAC;gBAC9B,CAAC;aACF;YACD,eAAe,CAAC,IAA2C,EAAE,KAAiC;gBAC5F,IAAI,IAAI,GAAG,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;gBAC9F,IAAI,KAAK,CAAC,aAAa,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;oBAC1C,IAAI,CAAC,MAAM,EAAE,CAAC;gBAChB,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import V1Addon from '../v1-addon';\nimport buildFunnel from 'broccoli-funnel';\nimport mergeTrees from 'broccoli-merge-trees';\nimport AddToTree from '../add-to-tree';\nimport { outputFileSync, readFileSync, readdirSync, unlinkSync } from 'fs-extra';\nimport { join, resolve } from 'path';\nimport { Memoize } from 'typescript-memoize';\nimport { satisfies } from 'semver';\nimport { transform } from '@babel/core';\nimport type * as Babel from '@babel/core';\nimport type { NodePath } from '@babel/traverse';\nimport Plugin from 'broccoli-plugin';\nimport type { Node } from 'broccoli-node-api';\nimport { existsSync } from 'fs';\n\nexport default class extends V1Addon {\n get v2Tree() {\n return mergeTrees([super.v2Tree, buildFunnel(this.rootTree, { include: ['dist/ember-template-compiler.js'] })]);\n }\n\n // versions of ember-source prior to\n // https://github.com/emberjs/ember.js/pull/20675 ship dist/packages and\n // dist/dependencies separately and the imports between them are package-name\n // imports. Since many of the dependencies are also true package.json\n // dependencies (in order to get typescript types), and our module-resolver\n // prioritizes true dependencies, it's necessary to detect and remove the\n // package.json dependencies.\n //\n // After the above linked change, ember-source ships only dist/packages and\n // the inter-package imports are all relative. Some of the things in\n // dist/packages are still the rolled-in dependencies, but now that the\n // imports are all relative we need no special handling for them (beyond the\n // normal v2 addon renamed-modules support.\n @Memoize()\n private get includedDependencies() {\n let result: string[] = [];\n let depsDir = resolve(this.root, 'dist', 'dependencies');\n if (!existsSync(depsDir)) {\n return result;\n }\n for (let name of readdirSync(depsDir)) {\n if (name[0] === '@') {\n for (let innerName of readdirSync(resolve(this.root, 'dist', 'dependencies', name))) {\n if (innerName.endsWith('.js')) {\n result.push(name + '/' + innerName.slice(0, -3));\n }\n }\n } else {\n if (name.endsWith('.js')) {\n result.push(name.slice(0, -3));\n }\n }\n }\n return result;\n }\n\n get newPackageJSON() {\n let json = super.newPackageJSON;\n\n for (let name of this.includedDependencies) {\n // weirdly, many of the inlined dependency are still listed as real\n // dependencies too. If we don't delete them here, they will take\n // precedence over the inlined ones, because the embroider module-resolver\n // tries to prioritize real deps.\n delete json.dependencies?.[name];\n }\n\n return json;\n }\n\n customizes(treeName: string) {\n // we are adding custom implementations of these\n return treeName === 'treeForAddon' || treeName === 'treeForVendor' || super.customizes(treeName);\n }\n\n invokeOriginalTreeFor(name: string) {\n if (name === 'addon') {\n return this.customAddonTree();\n }\n if (name === 'vendor') {\n return this.customVendorTree();\n }\n }\n\n // Our addon tree is all of the \"packages\" we share. @embroider/compat already\n // supports that pattern of emitting modules into other package's namespaces.\n private customAddonTree() {\n let packages = buildFunnel(this.rootTree, {\n srcDir: 'dist/packages',\n });\n\n let trees: Node[] = [\n packages,\n buildFunnel(this.rootTree, {\n srcDir: 'dist/dependencies',\n allowEmpty: true,\n }),\n ];\n\n if (satisfies(this.packageJSON.version, '>= 4.0.0-alpha.0 <4.10.0-alpha.0', { includePrerelease: true })) {\n // import { loc } from '@ember/string' was removed in 4.0. but the\n // top-level `ember` package tries to import it until 4.10. A\n // spec-compliant ES modules implementation will treat this as a parse\n // error.\n trees.push(new ReplaceRequire([new FixStringLoc([packages])]));\n } else if (satisfies(this.packageJSON.version, '<5.7.0')) {\n trees.push(new ReplaceRequire([packages]));\n }\n\n if (satisfies(this.packageJSON.version, '<5.12.0')) {\n trees.push(new FixDeprecateFunction([packages]));\n }\n\n if (satisfies(this.packageJSON.version, '<5.11.1')) {\n trees.push(new FixCycleImports([packages]));\n }\n\n return mergeTrees(trees, { overwrite: true });\n }\n\n // We're zeroing out these files in vendor rather than deleting them, because\n // we can't easily intercept the `app.import` that presumably exists for them,\n // so rather than error they will just be empty.\n //\n // The reason we're zeroing these out is that we're going to consume all our\n // modules directly out of treeForAddon instead, as real modules that webpack\n // can see.\n private customVendorTree() {\n return new AddToTree(this.addonInstance._treeFor('vendor'), outputPath => {\n unlinkSync(join(outputPath, 'ember', 'ember.js'));\n outputFileSync(join(outputPath, 'ember', 'ember.js'), '');\n unlinkSync(join(outputPath, 'ember', 'ember-testing.js'));\n outputFileSync(join(outputPath, 'ember', 'ember-testing.js'), '');\n });\n }\n\n get packageMeta() {\n let meta = super.packageMeta;\n\n if (!meta['implicit-modules']) {\n meta['implicit-modules'] = [];\n }\n meta['implicit-modules'].push('./ember/index.js');\n // before 5.6, Ember uses the AMD loader to decide if it's test-only parts\n // are present, so we must ensure they're registered. After that it's\n // enough to evaluate ember-testing, which @embroider/core is hard-coded\n // to do in the backward-compatible tests bundle.\n if (!satisfies(this.packageJSON.version, '>= 5.6.0-alpha.0', { includePrerelease: true })) {\n if (!meta['implicit-test-modules']) {\n meta['implicit-test-modules'] = [];\n }\n meta['implicit-test-modules'].push('./ember-testing/index.js');\n }\n\n return meta;\n }\n}\n\nclass FixStringLoc extends Plugin {\n build() {\n let inSource = readFileSync(resolve(this.inputPaths[0], 'ember', 'index.js'), 'utf8');\n let outSource = transform(inSource, {\n plugins: [fixStringLoc],\n configFile: false,\n })!.code!;\n outputFileSync(resolve(this.outputPath, 'ember', 'index.js'), outSource, 'utf8');\n }\n}\n\nclass ReplaceRequire extends Plugin {\n build() {\n updateFileWithTransform(this, 'ember/index.js', function (babel: typeof Babel) {\n const { types: t } = babel;\n\n function createLoader() {\n return t.objectExpression([\n t.objectMethod(\n 'get',\n t.identifier('require'),\n [],\n t.blockStatement([\n t.returnStatement(t.memberExpression(t.identifier('globalThis'), t.identifier('require'))),\n ])\n ),\n t.objectMethod(\n 'get',\n t.identifier('define'),\n [],\n t.blockStatement([\n t.returnStatement(t.memberExpression(t.identifier('globalThis'), t.identifier('define'))),\n ])\n ),\n t.objectMethod(\n 'get',\n t.identifier('registry'),\n [],\n\n t.blockStatement([\n t.returnStatement(\n t.logicalExpression(\n '??',\n t.optionalMemberExpression(\n t.memberExpression(t.identifier('globalThis'), t.identifier('requirejs')),\n t.identifier('entries'),\n false,\n true\n ),\n t.optionalMemberExpression(\n t.memberExpression(t.identifier('globalThis'), t.identifier('require')),\n t.identifier('entries'),\n false,\n true\n )\n )\n ),\n ])\n ),\n ]);\n }\n\n return {\n visitor: {\n CallExpression(path: NodePath<Babel.types.CallExpression>) {\n if (\n path.node.callee.type === 'Identifier' &&\n (path.node.callee.name === 'has' || path.node.callee.name === 'require') &&\n path.node.arguments[0].type === 'StringLiteral' &&\n path.node.arguments[0].value === 'ember-testing'\n ) {\n path.replaceWith(t.identifier('EmberTestingImpl'));\n }\n },\n ImportDeclaration(path: NodePath<Babel.types.ImportDeclaration>) {\n if (path.node.source.value === 'require') {\n path.replaceWith(\n t.importDeclaration(\n [t.importSpecifier(t.identifier('EmberTestingImpl'), t.identifier('_impl'))],\n t.stringLiteral('@ember/test')\n )\n );\n }\n },\n VariableDeclaration(path: NodePath<Babel.types.VariableDeclaration>) {\n if (\n path.node.declarations[0].id.type === 'Identifier' &&\n path.node.declarations[0].id.name === 'PartialEmber' &&\n path.node.declarations[0].init!.type === 'ObjectExpression'\n ) {\n const declaration = path.node.declarations[0];\n const loader = (declaration.init! as Babel.types.ObjectExpression).properties.find(\n p => (p.type === 'ObjectProperty' && p.key.type === 'Identifier' && p.key.name) === '__loader'\n );\n (loader as Babel.types.ObjectProperty).value = createLoader();\n }\n },\n AssignmentExpression(path: NodePath<Babel.types.AssignmentExpression>) {\n if (\n path.node.left.type === 'MemberExpression' &&\n path.node.left.object.type === 'Identifier' &&\n path.node.left.object.name === 'Ember' &&\n path.node.left.property.type === 'Identifier' &&\n path.node.left.property.name === '__loader'\n ) {\n path.node.right = createLoader();\n }\n },\n },\n };\n });\n\n replaceFile(\n this,\n '@ember/test/adapter.js',\n `import { Adapter } from 'ember-testing';\n export default Adapter;`\n );\n\n replaceFile(\n this,\n '@ember/test/index.js',\n `export let registerAsyncHelper;\nexport let registerHelper;\nexport let registerWaiter;\nexport let unregisterHelper;\nexport let unregisterWaiter;\nexport let _impl;\n\nlet testingNotAvailableMessage = () => {\n throw new Error('Attempted to use test utilities, but \\`ember-testing\\` was not included');\n};\n\nregisterAsyncHelper = testingNotAvailableMessage;\nregisterHelper = testingNotAvailableMessage;\nregisterWaiter = testingNotAvailableMessage;\nunregisterHelper = testingNotAvailableMessage;\nunregisterWaiter = testingNotAvailableMessage;\n\nexport function registerTestImplementaiton(impl) {\n let { Test } = impl;\n registerAsyncHelper = Test.registerAsyncHelper;\n registerHelper = Test.registerHelper;\n registerWaiter = Test.registerWaiter;\n unregisterHelper = Test.unregisterHelper;\n unregisterWaiter = Test.unregisterWaiter;\n _impl = impl;\n}`\n );\n\n replaceFile(\n this,\n 'ember-testing/index.js',\n `export * from './lib/public-api';\nimport * as EmberTesting from './lib/public-api';\nimport { registerTestImplementaiton } from '@ember/test';\n\n\nregisterTestImplementaiton(EmberTesting);`\n );\n\n replaceFile(\n this,\n 'ember-testing/lib/public-api.js',\n `\nexport { default as Test } from './test';\nexport { default as Adapter } from './adapters/adapter';\nexport { default as setupForTesting } from './setup_for_testing';\nexport { default as QUnitAdapter } from './adapters/qunit';\n\nimport './ext/application';\nimport './ext/rsvp'; // setup RSVP + run loop integration\nimport './helpers'; // adds helpers to helpers object in Test\nimport './initializers'; // to setup initializer`\n );\n }\n}\n\nclass FixDeprecateFunction extends Plugin {\n build() {\n let inSource = readFileSync(resolve(this.inputPaths[0], '@ember', 'debug', 'index.js'), 'utf8');\n let outSource = transform(inSource, {\n plugins: [fixDeprecate],\n configFile: false,\n })!.code!;\n outputFileSync(resolve(this.outputPath, '@ember', 'debug', 'index.js'), outSource, 'utf8');\n }\n}\n\nfunction fixDeprecate(babel: typeof Babel) {\n const { types: t } = babel;\n\n return {\n name: 'ast-transform', // not required\n visitor: {\n Program(path: NodePath<Babel.types.Program>) {\n path.node.body.unshift(\n t.functionDeclaration(\n t.identifier('newDeprecate'),\n [t.restElement(t.identifier('rest'))],\n t.blockStatement([\n t.returnStatement(\n t.callExpression(\n t.logicalExpression('??', t.identifier('currentDeprecate'), t.identifier('_deprecate')),\n [t.spreadElement(t.identifier('rest'))]\n )\n ),\n ])\n )\n );\n },\n AssignmentExpression(path: NodePath<Babel.types.AssignmentExpression>) {\n if (path.node.left.type === 'Identifier' && path.node.left.name === 'deprecate') {\n path.node.left.name = 'currentDeprecate';\n }\n },\n\n ReturnStatement(path: NodePath<Babel.types.ReturnStatement>) {\n if (path.node.argument?.type === 'Identifier' && path.node.argument.name === 'deprecate') {\n path.node.argument.name = 'newDeprecate';\n }\n },\n\n CallExpression(path: NodePath<Babel.types.CallExpression>) {\n if (path.node.callee.type === 'Identifier' && path.node.callee.name === 'deprecate') {\n path.node.callee.name = 'newDeprecate';\n }\n if (\n path.node.callee.type === 'Identifier' &&\n path.node.callee.name === 'setDebugFunction' &&\n path.node.arguments[0].type === 'StringLiteral' &&\n path.node.arguments[0].value === 'deprecate'\n ) {\n path.remove();\n }\n },\n ExportSpecifier(path: NodePath<Babel.types.ExportSpecifier>) {\n if (path.node.local.name === 'deprecate') {\n path.node.local = t.identifier('newDeprecate');\n }\n },\n VariableDeclarator(path: NodePath<Babel.types.VariableDeclarator>) {\n if (path.node.id.type === 'Identifier' && path.node.id.name === 'deprecate') {\n path.node.id.name = 'currentDeprecate';\n path.node.init = null; // leave undefined for newDeprecate's (currentDeprecate ?? _deprecated) expression\n }\n },\n },\n };\n}\n\nfunction updateFileWithTransform(\n context: Plugin,\n file: string,\n transformFunction: Babel.PluginItem | Babel.PluginItem[]\n) {\n // only update the file if it exists - this helps the codemods to work across many different versions\n if (!existsSync(resolve(context.inputPaths[0], file))) {\n return;\n }\n let inSource = readFileSync(resolve(context.inputPaths[0], file), 'utf8');\n\n let plugins = Array.isArray(transformFunction) ? transformFunction : [transformFunction];\n let outSource = transform(inSource, {\n plugins,\n configFile: false,\n })!.code!;\n outputFileSync(resolve(context.outputPath, file), outSource, 'utf8');\n}\n\nfunction replaceFile(context: Plugin, file: string, content: string) {\n outputFileSync(resolve(context.outputPath, file), content, 'utf8');\n}\n\nclass FixCycleImports extends Plugin {\n build() {\n for (let file of ['@ember/object/observable.js', '@ember/utils/lib/is_empty.js']) {\n updateFileWithTransform(this, file, moveObjectSpecifiersToMetal);\n }\n\n updateFileWithTransform(this, '@ember/array/index.js', [\n moveObjectSpecifiersToMetal,\n function (babel: typeof Babel) {\n const { types: t } = babel;\n return {\n visitor: {\n ExportNamedDeclaration(path: NodePath<Babel.types.ExportNamedDeclaration>) {\n if (path.node.source?.value === './lib/make-array') {\n path.node.source = t.stringLiteral('./make');\n }\n },\n },\n };\n },\n ]);\n\n updateFileWithTransform(this, '@ember/runloop/index.js', function (babel: typeof Babel) {\n const { types: t } = babel;\n\n return {\n visitor: {\n CallExpression(path: NodePath<Babel.types.CallExpression>) {\n if (path.node.callee.type === 'Identifier' && path.node.callee.name === 'flushAsyncObservers') {\n path.node.arguments = [t.identifier('schedule')];\n }\n },\n },\n };\n });\n\n updateFileWithTransform(this, '@ember/object/core.js', function (babel: typeof Babel) {\n const { types: t } = babel;\n\n return {\n visitor: {\n ImportDeclaration(path: NodePath<Babel.types.ImportDeclaration>) {\n if (path.node.source.value === '@ember/array') {\n path.node.source = t.stringLiteral('@ember/array/make');\n path.node.specifiers = [t.importDefaultSpecifier(t.identifier('makeArray'))];\n }\n\n if (path.node.source.value === '@ember/-internals/runtime') {\n path.replaceWith(\n t.importDeclaration(\n [t.importSpecifier(t.identifier('ActionHandler'), t.identifier('default'))],\n t.stringLiteral('@ember/-internals/runtime/lib/mixins/action_handler')\n )\n );\n }\n },\n },\n };\n });\n\n outputFileSync(\n resolve(this.outputPath, '@ember/array/make.js'),\n `export { default } from './lib/make-array';`,\n 'utf8'\n );\n\n updateFileWithTransform(this, '@ember/-internals/metal/index.js', function (babel: typeof Babel) {\n const { types: t } = babel;\n\n return {\n visitor: {\n FunctionDeclaration(path: NodePath<Babel.types.FunctionDeclaration>) {\n if (path.node.id?.name === 'flushAsyncObservers') {\n path.node.params = [t.identifier('_schedule')];\n }\n },\n IfStatement(path: NodePath<Babel.types.IfStatement>) {\n if (path.node.test.type === 'Identifier' && path.node.test.name === 'shouldSchedule') {\n path.node.test.name = '_schedule';\n }\n },\n CallExpression(path: NodePath<Babel.types.CallExpression>) {\n if (path.node.callee.type === 'Identifier' && path.node.callee.name === 'schedule') {\n path.node.callee.name = '_schedule';\n }\n },\n ImportDeclaration(path: NodePath<Babel.types.ImportDeclaration>) {\n if (path.node.source.value === '@ember/runloop') {\n path.remove();\n }\n },\n },\n };\n });\n }\n}\n\nfunction moveObjectSpecifiersToMetal() {\n let done = false;\n\n return {\n visitor: {\n ImportDeclaration(path: NodePath<Babel.types.ImportDeclaration>) {\n if (path.node.source.value === '@ember/-internals/metal') {\n if (done) {\n return;\n }\n\n /**\n * I need to use getAllPRevSiblings and getAllNextSiblings here because I need the siblings\n * to be paths and path.container only holds nodes (for some strange reason).\n */\n const objectimport = [...path.getAllPrevSiblings(), ...path.getAllNextSiblings()].find(\n p => p.node.type === 'ImportDeclaration' && p.node.source.value === '@ember/object'\n ) as NodePath<Babel.types.ImportDeclaration>;\n\n path.node.specifiers.push(...objectimport!.node.specifiers);\n objectimport.remove();\n\n done = true;\n }\n },\n },\n };\n}\n\nfunction fixStringLoc(babel: typeof Babel) {\n let t = babel.types;\n return {\n visitor: {\n Program(path: NodePath<Babel.types.Program>) {\n path.node.body.unshift(\n t.variableDeclaration('const', [t.variableDeclarator(t.identifier('loc'), t.identifier('undefined'))])\n );\n },\n ImportDeclaration: {\n enter(path: NodePath<Babel.types.ImportDeclaration>, state: { inEmberString: boolean }) {\n if (path.node.source.value === '@ember/string') {\n state.inEmberString = true;\n }\n },\n exit(_path: NodePath<Babel.types.ImportDeclaration>, state: { inEmberString: boolean }) {\n state.inEmberString = false;\n },\n },\n ImportSpecifier(path: NodePath<Babel.types.ImportSpecifier>, state: { inEmberString: boolean }) {\n let name = 'value' in path.node.imported ? path.node.imported.value : path.node.imported.name;\n if (state.inEmberString && name === 'loc') {\n path.remove();\n }\n },\n },\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embroider/compat",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Backward compatibility layer for the Embroider build system.",
|
|
6
6
|
"repository": {
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"@babel/plugin-syntax-typescript": "^7.25.4",
|
|
29
29
|
"@babel/plugin-transform-runtime": "^7.14.5",
|
|
30
30
|
"@babel/preset-env": "^7.14.5",
|
|
31
|
-
"@babel/runtime": "^7.
|
|
31
|
+
"@babel/runtime": "^7.28.3",
|
|
32
32
|
"@babel/traverse": "^7.14.5",
|
|
33
33
|
"@types/babel__code-frame": "^7.0.2",
|
|
34
34
|
"assert-never": "^1.1.0",
|
|
35
35
|
"babel-import-util": "^3.0.1",
|
|
36
|
-
"babel-plugin-debug-macros": "^
|
|
37
|
-
"babel-plugin-ember-template-compilation-2": "npm:babel-plugin-ember-template-compilation@^2.4.0",
|
|
36
|
+
"babel-plugin-debug-macros": "^2.0.0",
|
|
38
37
|
"babel-plugin-ember-template-compilation": "^3.0.0",
|
|
38
|
+
"babel-plugin-ember-template-compilation-2": "npm:babel-plugin-ember-template-compilation@^2.4.0",
|
|
39
39
|
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
|
40
40
|
"babylon": "^6.18.0",
|
|
41
41
|
"bind-decorator": "^1.0.11",
|
|
@@ -53,12 +53,12 @@
|
|
|
53
53
|
"fast-sourcemap-concat": "^2.1.1",
|
|
54
54
|
"fs-extra": "^9.1.0",
|
|
55
55
|
"fs-tree-diff": "^2.0.1",
|
|
56
|
-
"jsdom": "^
|
|
56
|
+
"jsdom": "^26.1.0",
|
|
57
57
|
"lodash": "^4.17.21",
|
|
58
58
|
"pkg-up": "^3.1.0",
|
|
59
59
|
"resolve": "^1.20.0",
|
|
60
|
-
"resolve.exports": "^2.0.2",
|
|
61
60
|
"resolve-package-path": "^4.0.1",
|
|
61
|
+
"resolve.exports": "^2.0.2",
|
|
62
62
|
"semver": "^7.3.5",
|
|
63
63
|
"symlink-or-copy": "^1.3.1",
|
|
64
64
|
"tree-sync": "^2.1.0",
|
|
@@ -87,12 +87,12 @@
|
|
|
87
87
|
"ember-engines": "^0.8.19",
|
|
88
88
|
"scenario-tester": "^4.0.0",
|
|
89
89
|
"typescript": "^5.4.5",
|
|
90
|
-
"@embroider/core": "^4.1.2",
|
|
91
90
|
"@embroider/sample-transforms": "0.0.0",
|
|
91
|
+
"@embroider/core": "^4.1.3",
|
|
92
92
|
"@embroider/test-support": "0.36.0"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
|
-
"@embroider/core": "^4.1.
|
|
95
|
+
"@embroider/core": "^4.1.3"
|
|
96
96
|
},
|
|
97
97
|
"engines": {
|
|
98
98
|
"node": "12.* || 14.* || >= 16"
|