@embroider/core 2.1.1 → 2.1.2-unstable.3a232cc

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.
Files changed (73) hide show
  1. package/package.json +3 -4
  2. package/src/app-differ.d.ts +1 -1
  3. package/src/app-differ.js +21 -22
  4. package/src/app-differ.js.map +1 -1
  5. package/src/app-files.d.ts +1 -2
  6. package/src/app-files.js +0 -7
  7. package/src/app-files.js.map +1 -1
  8. package/src/app.d.ts +9 -7
  9. package/src/app.js +32 -46
  10. package/src/app.js.map +1 -1
  11. package/src/describe-exports.d.ts +0 -1
  12. package/src/describe-exports.js +8 -9
  13. package/src/describe-exports.js.map +1 -1
  14. package/src/index.d.ts +3 -0
  15. package/src/index.js +5 -1
  16. package/src/index.js.map +1 -1
  17. package/src/module-resolver.d.ts +66 -25
  18. package/src/module-resolver.js +698 -131
  19. package/src/module-resolver.js.map +1 -1
  20. package/src/options.d.ts +0 -1
  21. package/src/options.js.map +1 -1
  22. package/src/virtual-content.d.ts +9 -0
  23. package/src/virtual-content.js +131 -0
  24. package/src/virtual-content.js.map +1 -0
  25. package/src/wait-for-trees.js.map +1 -1
  26. package/src/babel-plugin-adjust-imports.d.ts +0 -31
  27. package/src/babel-plugin-adjust-imports.js +0 -224
  28. package/src/babel-plugin-adjust-imports.js.map +0 -1
  29. package/src/babel-plugin-inline-hbs-deps-node.d.ts +0 -14
  30. package/src/babel-plugin-inline-hbs-deps-node.js +0 -27
  31. package/src/babel-plugin-inline-hbs-deps-node.js.map +0 -1
  32. package/src/babel-plugin-inline-hbs-deps.d.ts +0 -10
  33. package/src/babel-plugin-inline-hbs-deps.js +0 -134
  34. package/src/babel-plugin-inline-hbs-deps.js.map +0 -1
  35. package/src/babel-plugin-inline-hbs-node.d.ts +0 -7
  36. package/src/babel-plugin-inline-hbs-node.js +0 -15
  37. package/src/babel-plugin-inline-hbs-node.js.map +0 -1
  38. package/src/babel-plugin-inline-hbs.d.ts +0 -24
  39. package/src/babel-plugin-inline-hbs.js +0 -142
  40. package/src/babel-plugin-inline-hbs.js.map +0 -1
  41. package/src/babel-plugin-stage1-inline-hbs-node.d.ts +0 -12
  42. package/src/babel-plugin-stage1-inline-hbs-node.js +0 -9
  43. package/src/babel-plugin-stage1-inline-hbs-node.js.map +0 -1
  44. package/src/babel-plugin-stage1-inline-hbs.d.ts +0 -9
  45. package/src/babel-plugin-stage1-inline-hbs.js +0 -96
  46. package/src/babel-plugin-stage1-inline-hbs.js.map +0 -1
  47. package/src/browser-index.d.ts +0 -1
  48. package/src/browser-index.js +0 -6
  49. package/src/browser-index.js.map +0 -1
  50. package/src/ember-template-compiler-types.d.ts +0 -41
  51. package/src/ember-template-compiler-types.js +0 -3
  52. package/src/ember-template-compiler-types.js.map +0 -1
  53. package/src/load-ember-template-compiler.d.ts +0 -6
  54. package/src/load-ember-template-compiler.js +0 -57
  55. package/src/load-ember-template-compiler.js.map +0 -1
  56. package/src/mini-modules-polyfill.d.ts +0 -12
  57. package/src/mini-modules-polyfill.js +0 -80
  58. package/src/mini-modules-polyfill.js.map +0 -1
  59. package/src/patch-template-compiler.d.ts +0 -1
  60. package/src/patch-template-compiler.js +0 -176
  61. package/src/patch-template-compiler.js.map +0 -1
  62. package/src/resolver-plugin.d.ts +0 -3
  63. package/src/resolver-plugin.js +0 -53
  64. package/src/resolver-plugin.js.map +0 -1
  65. package/src/resolver.d.ts +0 -14
  66. package/src/resolver.js +0 -3
  67. package/src/resolver.js.map +0 -1
  68. package/src/template-compiler-common.d.ts +0 -70
  69. package/src/template-compiler-common.js +0 -176
  70. package/src/template-compiler-common.js.map +0 -1
  71. package/src/template-compiler-node.d.ts +0 -17
  72. package/src/template-compiler-node.js +0 -32
  73. package/src/template-compiler-node.js.map +0 -1
@@ -1,142 +0,0 @@
1
- "use strict";
2
- /*
3
- This plugin is used only for Ember < 3.27. For newer Ember's we have a
4
- different implementation that shares the standard
5
- babel-plugin-ember-template-compilation and supports passing Javascript
6
- lexically scoped names into templates.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const path_1 = require("path");
10
- const core_1 = require("@babel/core");
11
- const babel_import_util_1 = require("babel-import-util");
12
- const shared_internals_1 = require("@embroider/shared-internals");
13
- function make(getCompiler) {
14
- function inlineHBSTransform(babel) {
15
- let t = babel.types;
16
- return {
17
- visitor: {
18
- Program: {
19
- enter(path, state) {
20
- state.dependencies = new Map();
21
- state.adder = new babel_import_util_1.ImportUtil(t, path);
22
- },
23
- exit(path, state) {
24
- for (let { module, exportedName } of shared_internals_1.templateCompilationModules) {
25
- state.adder.removeImport(module, exportedName);
26
- }
27
- let counter = 0;
28
- for (let dep of state.dependencies.values()) {
29
- path.node.body.unshift(amdDefine(dep.runtimeName, counter, t));
30
- path.node.body.unshift(t.importDeclaration([t.importDefaultSpecifier(t.identifier(`a${counter++}`))], t.stringLiteral(dep.path)));
31
- }
32
- },
33
- },
34
- TaggedTemplateExpression(path, state) {
35
- for (let { module, exportedName } of shared_internals_1.templateCompilationModules) {
36
- if (path.get('tag').referencesImport(module, exportedName)) {
37
- handleTagged(path, state, t);
38
- }
39
- }
40
- },
41
- CallExpression(path, state) {
42
- for (let { module, exportedName } of shared_internals_1.templateCompilationModules) {
43
- if (path.get('callee').referencesImport(module, exportedName)) {
44
- handleCalled(path, state, t);
45
- }
46
- }
47
- },
48
- },
49
- };
50
- }
51
- inlineHBSTransform._parallelBabel = {
52
- requireFile: __filename,
53
- };
54
- inlineHBSTransform.baseDir = function () {
55
- return (0, path_1.join)(__dirname, '..');
56
- };
57
- function handleTagged(path, state, t) {
58
- if (path.node.quasi.expressions.length) {
59
- throw path.buildCodeFrameError('placeholders inside a tagged template string are not supported');
60
- }
61
- let template = path.node.quasi.quasis.map(quasi => quasi.value.cooked).join('');
62
- let { compiled, dependencies } = compiler(state).precompile(template, { filename: state.file.opts.filename });
63
- for (let dep of dependencies) {
64
- state.dependencies.set(dep.runtimeName, dep);
65
- }
66
- path.replaceWith(t.callExpression(state.adder.import(path, '@ember/template-factory', 'createTemplateFactory'), [
67
- jsonLiteral(compiled, t),
68
- ]));
69
- }
70
- function handleCalled(path, state, t) {
71
- let { template, insertRuntimeErrors } = getCallArguments(path);
72
- let compilerInstance = compiler(state);
73
- let result;
74
- try {
75
- result = compilerInstance.precompile(template, { filename: state.file.opts.filename, insertRuntimeErrors });
76
- }
77
- catch (err) {
78
- if (insertRuntimeErrors) {
79
- path.replaceWith(t.callExpression(t.functionExpression(null, [], t.blockStatement([
80
- t.throwStatement(t.newExpression(t.identifier('Error'), [t.stringLiteral(err.message)])),
81
- ])), []));
82
- return;
83
- }
84
- throw err;
85
- }
86
- let { compiled, dependencies } = result;
87
- for (let dep of dependencies) {
88
- state.dependencies.set(dep.runtimeName, dep);
89
- }
90
- path.replaceWith(t.callExpression(state.adder.import(path, '@ember/template-factory', 'createTemplateFactory'), [
91
- jsonLiteral(compiled, t),
92
- ]));
93
- }
94
- function jsonLiteral(value, t) {
95
- if (typeof value === 'undefined') {
96
- return t.identifier('undefined');
97
- }
98
- let ast = (0, core_1.parse)(`a(${value})`, {});
99
- let statement = ast.program.body[0];
100
- let expression = statement.expression;
101
- return expression.arguments[0];
102
- }
103
- function compiler(state) {
104
- if (!state.templateCompiler) {
105
- state.templateCompiler = getCompiler(state.opts);
106
- }
107
- return state.templateCompiler;
108
- }
109
- function amdDefine(runtimeName, importCounter, t) {
110
- return t.expressionStatement(t.callExpression(t.memberExpression(t.identifier('window'), t.identifier('define')), [
111
- t.stringLiteral(runtimeName),
112
- t.functionExpression(null, [], t.blockStatement([t.returnStatement(t.identifier(`a${importCounter}`))])),
113
- ]));
114
- }
115
- function getTemplateString(template, path) {
116
- if ((template === null || template === void 0 ? void 0 : template.type) === 'StringLiteral') {
117
- return template.value;
118
- }
119
- // treat inert TemplateLiteral (without subexpressions) like a StringLiteral
120
- if ((template === null || template === void 0 ? void 0 : template.type) === 'TemplateLiteral' && !template.expressions.length) {
121
- return template.quasis[0].value.cooked;
122
- }
123
- throw path.buildCodeFrameError('hbs accepts only a string literal argument');
124
- }
125
- function getCallArguments(path) {
126
- let [template, options] = path.node.arguments;
127
- let insertRuntimeErrors = (options === null || options === void 0 ? void 0 : options.type) === 'ObjectExpression' &&
128
- options.properties.some(prop => prop.type === 'ObjectProperty' &&
129
- prop.computed === false &&
130
- prop.key.type === 'Identifier' &&
131
- prop.key.name === 'insertRuntimeErrors' &&
132
- prop.value.type === 'BooleanLiteral' &&
133
- prop.value.value);
134
- return {
135
- template: getTemplateString(template, path),
136
- insertRuntimeErrors,
137
- };
138
- }
139
- return inlineHBSTransform;
140
- }
141
- exports.default = make;
142
- //# sourceMappingURL=babel-plugin-inline-hbs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"babel-plugin-inline-hbs.js","sourceRoot":"","sources":["babel-plugin-inline-hbs.ts"],"names":[],"mappings":";AAAA;;;;;EAKE;;AAKF,+BAA4B;AAE5B,sCAAoC;AAEpC,yDAA+C;AAC/C,kEAAyE;AAiBzE,SAAwB,IAAI,CAAI,WAA0C;IACxE,SAAS,kBAAkB,CAAC,KAAmB;QAC7C,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;QACpB,OAAO;YACL,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,KAAK,CAAC,IAAyB,EAAE,KAAe;wBAC9C,KAAK,CAAC,YAAY,GAAG,IAAI,GAAG,EAAE,CAAC;wBAC/B,KAAK,CAAC,KAAK,GAAG,IAAI,8BAAU,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;oBACxC,CAAC;oBACD,IAAI,CAAC,IAAyB,EAAE,KAAe;wBAC7C,KAAK,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,6CAA0B,EAAE;4BAC/D,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;yBAChD;wBACD,IAAI,OAAO,GAAG,CAAC,CAAC;wBAChB,KAAK,IAAI,GAAG,IAAI,KAAK,C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xC;QACD,MAAM,IAAI,CAAC,mBAAmB,CAAC,4CAA4C,CAAC,CAAC;IAC/E,CAAC;IAED,SAAS,gBAAgB,CAAC,IAAgC;QACxD,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;QAE9C,IAAI,mBAAmB,GACrB,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,MAAK,kBAAkB;YACpC,OAAO,CAAC,UAAU,CAAC,IAAI,CACrB,IAAI,CAAC,EAAE,CACL,IAAI,CAAC,IAAI,KAAK,gBAAgB;gBAC9B,IAAI,CAAC,QAAQ,KAAK,KAAK;gBACvB,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,YAAY;gBAC9B,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,qBAAqB;gBACvC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,gBAAgB;gBACpC,IAAI,CAAC,KAAK,CAAC,KAAK,CACnB,CAAC;QAEJ,OAAO;YACL,QAAQ,EAAE,iBAAiB,CAAC,QAAQ,EAAE,IAAI,CAAC;YAC3C,mBAAmB;SACpB,CAAC;IACJ,CAAC;IAED,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AApKD,uBAoKC","sourcesContent":["/*\n This plugin is used only for Ember < 3.27. For newer Ember's we have a\n different implementation that shares the standard\n babel-plugin-ember-template-compilation and supports passing Javascript\n lexically scoped names into templates.\n*/\n\nimport type { types as t } from '@babel/core';\nimport type * as Babel from '@babel/core';\nimport type { NodePath } from '@babel/traverse';\nimport { join } from 'path';\nimport type { TemplateCompiler } from './template-compiler-common';\nimport { parse } from '@babel/core';\nimport { ResolvedDep } from './resolver';\nimport { ImportUtil } from 'babel-import-util';\nimport { templateCompilationModules } from '@embroider/shared-internals';\n\ntype BabelTypes = typeof t;\n\ninterface State<O> {\n opts: O;\n file: {\n code: string;\n opts: {\n filename: string;\n };\n };\n dependencies: Map<string, ResolvedDep>;\n templateCompiler: TemplateCompiler | undefined;\n adder: ImportUtil;\n}\n\nexport default function make<O>(getCompiler: (opts: O) => TemplateCompiler) {\n function inlineHBSTransform(babel: typeof Babel): Babel.PluginObj<State<O>> {\n let t = babel.types;\n return {\n visitor: {\n Program: {\n enter(path: NodePath<t.Program>, state: State<O>) {\n state.dependencies = new Map();\n state.adder = new ImportUtil(t, path);\n },\n exit(path: NodePath<t.Program>, state: State<O>) {\n for (let { module, exportedName } of templateCompilationModules) {\n state.adder.removeImport(module, exportedName);\n }\n let counter = 0;\n for (let dep of state.dependencies.values()) {\n path.node.body.unshift(amdDefine(dep.runtimeName, counter, t));\n path.node.body.unshift(\n t.importDeclaration(\n [t.importDefaultSpecifier(t.identifier(`a${counter++}`))],\n t.stringLiteral(dep.path)\n )\n );\n }\n },\n },\n TaggedTemplateExpression(path: NodePath<t.TaggedTemplateExpression>, state: State<O>) {\n for (let { module, exportedName } of templateCompilationModules) {\n if (path.get('tag').referencesImport(module, exportedName)) {\n handleTagged(path, state, t);\n }\n }\n },\n CallExpression(path: NodePath<t.CallExpression>, state: State<O>) {\n for (let { module, exportedName } of templateCompilationModules) {\n if (path.get('callee').referencesImport(module, exportedName)) {\n handleCalled(path, state, t);\n }\n }\n },\n },\n };\n }\n\n inlineHBSTransform._parallelBabel = {\n requireFile: __filename,\n };\n\n inlineHBSTransform.baseDir = function () {\n return join(__dirname, '..');\n };\n\n function handleTagged(path: NodePath<t.TaggedTemplateExpression>, state: State<O>, t: BabelTypes) {\n if (path.node.quasi.expressions.length) {\n throw path.buildCodeFrameError('placeholders inside a tagged template string are not supported');\n }\n let template = path.node.quasi.quasis.map(quasi => quasi.value.cooked).join('');\n let { compiled, dependencies } = compiler(state).precompile(template, { filename: state.file.opts.filename });\n for (let dep of dependencies) {\n state.dependencies.set(dep.runtimeName, dep);\n }\n\n path.replaceWith(\n t.callExpression(state.adder.import(path, '@ember/template-factory', 'createTemplateFactory'), [\n jsonLiteral(compiled, t),\n ])\n );\n }\n\n function handleCalled(path: NodePath<t.CallExpression>, state: State<O>, t: BabelTypes) {\n let { template, insertRuntimeErrors } = getCallArguments(path);\n let compilerInstance = compiler(state);\n\n let result: ReturnType<TemplateCompiler['precompile']>;\n try {\n result = compilerInstance.precompile(template, { filename: state.file.opts.filename, insertRuntimeErrors });\n } catch (err) {\n if (insertRuntimeErrors) {\n path.replaceWith(\n t.callExpression(\n t.functionExpression(\n null,\n [],\n t.blockStatement([\n t.throwStatement(t.newExpression(t.identifier('Error'), [t.stringLiteral(err.message)])),\n ])\n ),\n []\n )\n );\n return;\n }\n throw err;\n }\n let { compiled, dependencies } = result;\n for (let dep of dependencies) {\n state.dependencies.set(dep.runtimeName, dep);\n }\n path.replaceWith(\n t.callExpression(state.adder.import(path, '@ember/template-factory', 'createTemplateFactory'), [\n jsonLiteral(compiled, t),\n ])\n );\n }\n\n function jsonLiteral(value: unknown | undefined, t: BabelTypes) {\n if (typeof value === 'undefined') {\n return t.identifier('undefined');\n }\n let ast = parse(`a(${value})`, {}) as t.File;\n let statement = ast.program.body[0] as t.ExpressionStatement;\n let expression = statement.expression as t.CallExpression;\n return expression.arguments[0];\n }\n\n function compiler(state: State<O>) {\n if (!state.templateCompiler) {\n state.templateCompiler = getCompiler(state.opts);\n }\n return state.templateCompiler;\n }\n\n function amdDefine(runtimeName: string, importCounter: number, t: BabelTypes) {\n return t.expressionStatement(\n t.callExpression(t.memberExpression(t.identifier('window'), t.identifier('define')), [\n t.stringLiteral(runtimeName),\n t.functionExpression(null, [], t.blockStatement([t.returnStatement(t.identifier(`a${importCounter}`))])),\n ])\n );\n }\n\n function getTemplateString(template: any, path: NodePath<t.CallExpression>): string {\n if (template?.type === 'StringLiteral') {\n return template.value;\n }\n // treat inert TemplateLiteral (without subexpressions) like a StringLiteral\n if (template?.type === 'TemplateLiteral' && !template.expressions.length) {\n return template.quasis[0].value.cooked;\n }\n throw path.buildCodeFrameError('hbs accepts only a string literal argument');\n }\n\n function getCallArguments(path: NodePath<t.CallExpression>): { template: string; insertRuntimeErrors: boolean } {\n let [template, options] = path.node.arguments;\n\n let insertRuntimeErrors =\n options?.type === 'ObjectExpression' &&\n options.properties.some(\n prop =>\n prop.type === 'ObjectProperty' &&\n prop.computed === false &&\n prop.key.type === 'Identifier' &&\n prop.key.name === 'insertRuntimeErrors' &&\n prop.value.type === 'BooleanLiteral' &&\n prop.value.value\n );\n\n return {\n template: getTemplateString(template, path),\n insertRuntimeErrors,\n };\n }\n\n return inlineHBSTransform;\n}\n"]}
@@ -1,12 +0,0 @@
1
- import { NodeTemplateCompilerParams } from './template-compiler-node';
2
- export interface Params {
3
- templateCompiler: NodeTemplateCompilerParams;
4
- }
5
- declare const _default: {
6
- (babel: typeof import("@babel/core")): unknown;
7
- _parallelBabel: {
8
- requireFile: string;
9
- };
10
- baseDir(): string;
11
- };
12
- export default _default;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const template_compiler_node_1 = require("./template-compiler-node");
7
- const babel_plugin_stage1_inline_hbs_1 = __importDefault(require("./babel-plugin-stage1-inline-hbs"));
8
- exports.default = (0, babel_plugin_stage1_inline_hbs_1.default)((opts) => new template_compiler_node_1.NodeTemplateCompiler(opts.templateCompiler));
9
- //# sourceMappingURL=babel-plugin-stage1-inline-hbs-node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"babel-plugin-stage1-inline-hbs-node.js","sourceRoot":"","sources":["babel-plugin-stage1-inline-hbs-node.ts"],"names":[],"mappings":";;;;;AAAA,qEAA4F;AAC5F,sGAAoD;AAMpD,kBAAe,IAAA,wCAAI,EAAC,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,6CAAoB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC","sourcesContent":["import { NodeTemplateCompiler, NodeTemplateCompilerParams } from './template-compiler-node';\nimport make from './babel-plugin-stage1-inline-hbs';\n\nexport interface Params {\n templateCompiler: NodeTemplateCompilerParams;\n}\n\nexport default make((opts: Params) => new NodeTemplateCompiler(opts.templateCompiler));\n"]}
@@ -1,9 +0,0 @@
1
- import type { TemplateCompiler } from './template-compiler-common';
2
- import type * as Babel from '@babel/core';
3
- export default function make<Opts>(getCompiler: (opts: Opts) => TemplateCompiler): {
4
- (babel: typeof Babel): unknown;
5
- _parallelBabel: {
6
- requireFile: string;
7
- };
8
- baseDir(): string;
9
- };
@@ -1,96 +0,0 @@
1
- "use strict";
2
- /*
3
- This babel plugins is responsible for running custom AST transform in inline
4
- templates. It doesn't compile to wire format, because it runs at stage1.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const path_1 = require("path");
8
- const shared_internals_1 = require("@embroider/shared-internals");
9
- function make(getCompiler) {
10
- function stage1InlineHBSTransform(babel) {
11
- let t = babel.types;
12
- return {
13
- visitor: {
14
- TaggedTemplateExpression(path, state) {
15
- for (let { module, exportedName } of shared_internals_1.templateCompilationModules) {
16
- if (path.get('tag').referencesImport(module, exportedName)) {
17
- handleTagged(path, state, t);
18
- }
19
- }
20
- },
21
- CallExpression(path, state) {
22
- for (let { module, exportedName } of shared_internals_1.templateCompilationModules) {
23
- if (path.get('callee').referencesImport(module, exportedName)) {
24
- handleCalled(path, state, t);
25
- }
26
- }
27
- },
28
- },
29
- };
30
- }
31
- stage1InlineHBSTransform._parallelBabel = {
32
- requireFile: __filename,
33
- };
34
- stage1InlineHBSTransform.baseDir = function () {
35
- return (0, path_1.join)(__dirname, '..');
36
- };
37
- function handleTagged(path, state, t) {
38
- if (path.node.quasi.expressions.length) {
39
- throw path.buildCodeFrameError('placeholders inside a tagged template string are not supported');
40
- }
41
- let template = path.node.quasi.quasis.map(quasi => quasi.value.cooked).join('');
42
- let compiled = compiler(state).applyTransforms(state.file.opts.filename, template);
43
- path.get('quasi').replaceWith(t.templateLiteral([t.templateElement({ raw: compiled, cooked: compiled })], []));
44
- }
45
- function handleCalled(path, state, t) {
46
- let { template, insertRuntimeErrors } = getCallArguments(path);
47
- let compilerInstance = compiler(state);
48
- let compiled;
49
- try {
50
- compiled = compilerInstance.applyTransforms(state.file.opts.filename, template);
51
- }
52
- catch (err) {
53
- if (insertRuntimeErrors) {
54
- // in stage 1 we just leave the bad template in place (we were only
55
- // trying to run transforms and re-emit hbs), so that it will be handled
56
- // at stage3 instead.
57
- return;
58
- }
59
- throw err;
60
- }
61
- path.get('arguments')[0].replaceWith(t.stringLiteral(compiled));
62
- }
63
- function compiler(state) {
64
- if (!state.templateCompiler) {
65
- state.templateCompiler = getCompiler(state.opts);
66
- }
67
- return state.templateCompiler;
68
- }
69
- function getCallArguments(path) {
70
- let [template, options] = path.node.arguments;
71
- let insertRuntimeErrors = (options === null || options === void 0 ? void 0 : options.type) === 'ObjectExpression' &&
72
- options.properties.some(prop => prop.type === 'ObjectProperty' &&
73
- prop.computed === false &&
74
- prop.key.type === 'Identifier' &&
75
- prop.key.name === 'insertRuntimeErrors' &&
76
- prop.value.type === 'BooleanLiteral' &&
77
- prop.value.value);
78
- return {
79
- template: getTemplateString(template, path),
80
- insertRuntimeErrors,
81
- };
82
- }
83
- return stage1InlineHBSTransform;
84
- }
85
- exports.default = make;
86
- function getTemplateString(template, path) {
87
- if ((template === null || template === void 0 ? void 0 : template.type) === 'StringLiteral') {
88
- return template.value;
89
- }
90
- // treat inert TemplateLiteral (without subexpressions) like a StringLiteral
91
- if ((template === null || template === void 0 ? void 0 : template.type) === 'TemplateLiteral' && !template.expressions.length) {
92
- return template.quasis[0].value.cooked;
93
- }
94
- throw path.buildCodeFrameError('hbs accepts only a string literal argument');
95
- }
96
- //# sourceMappingURL=babel-plugin-stage1-inline-hbs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"babel-plugin-stage1-inline-hbs.js","sourceRoot":"","sources":["babel-plugin-stage1-inline-hbs.ts"],"names":[],"mappings":";AAAA;;;EAGE;;AAEF,+BAA4B;AAK5B,kEAAyE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AC,CAAC;AAC/E,CAAC","sourcesContent":["/*\n This babel plugins is responsible for running custom AST transform in inline\n templates. It doesn't compile to wire format, because it runs at stage1.\n*/\n\nimport { join } from 'path';\nimport type { TemplateCompiler } from './template-compiler-common';\nimport type { NodePath } from '@babel/traverse';\nimport type * as Babel from '@babel/core';\nimport type { types as t } from '@babel/core';\nimport { templateCompilationModules } from '@embroider/shared-internals';\n\nexport default function make<Opts>(getCompiler: (opts: Opts) => TemplateCompiler) {\n interface State {\n opts: Opts;\n file: {\n code: string;\n opts: {\n filename: string;\n };\n };\n templateCompiler: TemplateCompiler | undefined;\n }\n\n function stage1InlineHBSTransform(babel: typeof Babel): unknown {\n let t = babel.types;\n return {\n visitor: {\n TaggedTemplateExpression(path: NodePath<t.TaggedTemplateExpression>, state: State) {\n for (let { module, exportedName } of templateCompilationModules) {\n if (path.get('tag').referencesImport(module, exportedName)) {\n handleTagged(path, state, t);\n }\n }\n },\n CallExpression(path: NodePath<t.CallExpression>, state: State) {\n for (let { module, exportedName } of templateCompilationModules) {\n if (path.get('callee').referencesImport(module, exportedName)) {\n handleCalled(path, state, t);\n }\n }\n },\n },\n };\n }\n\n stage1InlineHBSTransform._parallelBabel = {\n requireFile: __filename,\n };\n\n stage1InlineHBSTransform.baseDir = function () {\n return join(__dirname, '..');\n };\n\n function handleTagged(path: NodePath<t.TaggedTemplateExpression>, state: State, t: typeof Babel.types) {\n if (path.node.quasi.expressions.length) {\n throw path.buildCodeFrameError('placeholders inside a tagged template string are not supported');\n }\n let template = path.node.quasi.quasis.map(quasi => quasi.value.cooked).join('');\n let compiled = compiler(state).applyTransforms(state.file.opts.filename, template);\n path.get('quasi').replaceWith(t.templateLiteral([t.templateElement({ raw: compiled, cooked: compiled })], []));\n }\n\n function handleCalled(path: NodePath<t.CallExpression>, state: State, t: typeof Babel.types) {\n let { template, insertRuntimeErrors } = getCallArguments(path);\n let compilerInstance = compiler(state);\n\n let compiled: string;\n try {\n compiled = compilerInstance.applyTransforms(state.file.opts.filename, template);\n } catch (err) {\n if (insertRuntimeErrors) {\n // in stage 1 we just leave the bad template in place (we were only\n // trying to run transforms and re-emit hbs), so that it will be handled\n // at stage3 instead.\n return;\n }\n throw err;\n }\n (path.get('arguments')[0] as NodePath).replaceWith(t.stringLiteral(compiled));\n }\n\n function compiler(state: State) {\n if (!state.templateCompiler) {\n state.templateCompiler = getCompiler(state.opts);\n }\n return state.templateCompiler;\n }\n\n function getCallArguments(path: NodePath<t.CallExpression>): { template: string; insertRuntimeErrors: boolean } {\n let [template, options] = path.node.arguments;\n\n let insertRuntimeErrors =\n options?.type === 'ObjectExpression' &&\n options.properties.some(\n prop =>\n prop.type === 'ObjectProperty' &&\n prop.computed === false &&\n prop.key.type === 'Identifier' &&\n prop.key.name === 'insertRuntimeErrors' &&\n prop.value.type === 'BooleanLiteral' &&\n prop.value.value\n );\n\n return {\n template: getTemplateString(template, path),\n insertRuntimeErrors,\n };\n }\n\n return stage1InlineHBSTransform;\n}\n\nfunction getTemplateString(template: any, path: NodePath<t.CallExpression>): string {\n if (template?.type === 'StringLiteral') {\n return template.value;\n }\n // treat inert TemplateLiteral (without subexpressions) like a StringLiteral\n if (template?.type === 'TemplateLiteral' && !template.expressions.length) {\n return template.quasis[0].value.cooked;\n }\n throw path.buildCodeFrameError('hbs accepts only a string literal argument');\n}\n"]}
@@ -1 +0,0 @@
1
- export { TemplateCompiler, TemplateCompilerParams } from './template-compiler-common';
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TemplateCompiler = void 0;
4
- var template_compiler_common_1 = require("./template-compiler-common");
5
- Object.defineProperty(exports, "TemplateCompiler", { enumerable: true, get: function () { return template_compiler_common_1.TemplateCompiler; } });
6
- //# sourceMappingURL=browser-index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"browser-index.js","sourceRoot":"","sources":["browser-index.ts"],"names":[],"mappings":";;;AAAA,uEAAsF;AAA7E,4HAAA,gBAAgB,OAAA","sourcesContent":["export { TemplateCompiler, TemplateCompilerParams } from './template-compiler-common';\n"]}
@@ -1,41 +0,0 @@
1
- export interface Plugins {
2
- ast?: unknown[];
3
- }
4
- export interface AST {
5
- _deliberatelyOpaque: 'AST';
6
- }
7
- export interface PreprocessOptions {
8
- contents: string;
9
- moduleName: string;
10
- plugins?: Plugins;
11
- filename?: string;
12
- parseOptions?: {
13
- srcName?: string;
14
- ignoreStandalone?: boolean;
15
- };
16
- mode?: 'codemod' | 'precompile';
17
- strictMode?: boolean;
18
- locals?: string[];
19
- }
20
- export interface PrinterOptions {
21
- entityEncoding?: 'transformed' | 'raw';
22
- }
23
- export interface GlimmerSyntax {
24
- preprocess(html: string, options?: PreprocessOptions): AST;
25
- print(ast: AST, options?: PrinterOptions): string;
26
- defaultOptions(options: PreprocessOptions): PreprocessOptions;
27
- precompile(templateContents: string, options: {
28
- contents: string;
29
- moduleName: string;
30
- filename: string;
31
- plugins?: any;
32
- parseOptions?: {
33
- srcName?: string;
34
- };
35
- }): string;
36
- _Ember: {
37
- FEATURES: any;
38
- ENV: any;
39
- };
40
- cacheKey: string;
41
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ember-template-compiler-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ember-template-compiler-types.js","sourceRoot":"","sources":["ember-template-compiler-types.ts"],"names":[],"mappings":"","sourcesContent":["export interface Plugins {\n ast?: unknown[];\n}\n\nexport interface AST {\n _deliberatelyOpaque: 'AST';\n}\n\nexport interface PreprocessOptions {\n contents: string;\n moduleName: string;\n plugins?: Plugins;\n filename?: string;\n\n parseOptions?: {\n srcName?: string;\n ignoreStandalone?: boolean;\n };\n\n // added in Ember 3.17 (@glimmer/syntax@0.40.2)\n mode?: 'codemod' | 'precompile';\n\n // added in Ember 3.25\n strictMode?: boolean;\n locals?: string[];\n}\n\nexport interface PrinterOptions {\n entityEncoding?: 'transformed' | 'raw';\n}\n\n// This just reflects the API we're extracting from ember-template-compiler.js,\n// plus a cache key that lets us know when the underlying source has remained\n// stable.\nexport interface GlimmerSyntax {\n preprocess(html: string, options?: PreprocessOptions): AST;\n print(ast: AST, options?: PrinterOptions): string;\n defaultOptions(options: PreprocessOptions): PreprocessOptions;\n precompile(\n templateContents: string,\n options: {\n contents: string;\n moduleName: string;\n filename: string;\n plugins?: any;\n parseOptions?: {\n srcName?: string;\n };\n }\n ): string;\n _Ember: { FEATURES: any; ENV: any };\n cacheKey: string;\n}\n"]}
@@ -1,6 +0,0 @@
1
- declare type EmbersExports = {
2
- cacheKey: string;
3
- theExports: any;
4
- };
5
- export declare function getEmberExports(templateCompilerPath: string): EmbersExports;
6
- export {};
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getEmberExports = void 0;
4
- const fs_1 = require("fs");
5
- const vm_1 = require("vm");
6
- const crypto_1 = require("crypto");
7
- const patch_template_compiler_1 = require("./patch-template-compiler");
8
- const CACHE = new Map();
9
- function getEmberExports(templateCompilerPath) {
10
- let entry = CACHE.get(templateCompilerPath);
11
- if (entry) {
12
- let currentStat = (0, fs_1.statSync)(templateCompilerPath);
13
- // Let's ensure the template is still what we cached
14
- if (currentStat.mode === entry.stat.mode &&
15
- currentStat.size === entry.stat.size &&
16
- currentStat.mtime.getTime() === entry.stat.mtime.getTime()) {
17
- return entry.value;
18
- }
19
- }
20
- let stat = (0, fs_1.statSync)(templateCompilerPath);
21
- let source = (0, patch_template_compiler_1.patch)((0, fs_1.readFileSync)(templateCompilerPath, 'utf8'), templateCompilerPath);
22
- let theExports = undefined;
23
- // cacheKey, theExports
24
- let cacheKey = (0, crypto_1.createHash)('md5').update(source).digest('hex');
25
- entry = Object.freeze({
26
- value: {
27
- cacheKey,
28
- get theExports() {
29
- if (theExports) {
30
- return theExports;
31
- }
32
- // matches (essentially) what ember-cli-htmlbars does in https://git.io/Jtbpj
33
- let sandbox = {
34
- module: { require, exports: {} },
35
- require,
36
- };
37
- if (typeof globalThis === 'undefined') {
38
- // for Node 10 usage with Ember 3.27+ we have to define the `global` global
39
- // in order for ember-template-compiler.js to evaluate properly
40
- // due to this code https://git.io/Jtb7
41
- sandbox.global = sandbox;
42
- }
43
- // using vm.createContext / vm.Script to ensure we evaluate in a fresh sandbox context
44
- // so that any global mutation done within ember-template-compiler.js does not leak out
45
- let context = (0, vm_1.createContext)(sandbox);
46
- let script = new vm_1.Script(source, { filename: templateCompilerPath });
47
- script.runInContext(context);
48
- return (theExports = context.module.exports);
49
- },
50
- },
51
- stat, // This is stored, so we can reload the templateCompiler if it changes mid-build.
52
- });
53
- CACHE.set(templateCompilerPath, entry);
54
- return entry.value;
55
- }
56
- exports.getEmberExports = getEmberExports;
57
- //# sourceMappingURL=load-ember-template-compiler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"load-ember-template-compiler.js","sourceRoot":"","sources":["load-ember-template-compiler.ts"],"names":[],"mappings":";;;AAAA,2BAAgD;AAChD,2BAA2C;AAC3C,mCAAoC;AACpC,uEAAkD;AAYlD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAsC,CAAC;AAE5D,SAAgB,eAAe,CAAC,oBAA4B;IAC1D,IAAI,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAE5C,IAAI,KAAK,EAAE;QACT,IAAI,WAAW,GAAG,IAAA,aAAQ,EAAC,oBAAoB,CAAC,CAAC;QAEjD,oDAAoD;QACpD,IACE,WAAW,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI;YACpC,WAAW,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI;YACpC,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,EAC1D;YACA,OAAO,KAAK,CAAC,KAAK,CAAC;SACpB;KACF;IAED,IAAI,IAAI,GAAG,IAA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AAC;AA1DD,0CA0DC","sourcesContent":["import fs, { readFileSync, statSync } from 'fs';\nimport { createContext, Script } from 'vm';\nimport { createHash } from 'crypto';\nimport { patch } from './patch-template-compiler';\n\ntype TemplateCompilerCacheEntry = {\n value: EmbersExports;\n stat: fs.Stats;\n};\n\ntype EmbersExports = {\n cacheKey: string;\n theExports: any;\n};\n\nconst CACHE = new Map<string, TemplateCompilerCacheEntry>();\n\nexport function getEmberExports(templateCompilerPath: string): EmbersExports {\n let entry = CACHE.get(templateCompilerPath);\n\n if (entry) {\n let currentStat = statSync(templateCompilerPath);\n\n // Let's ensure the template is still what we cached\n if (\n currentStat.mode === entry.stat.mode &&\n currentStat.size === entry.stat.size &&\n currentStat.mtime.getTime() === entry.stat.mtime.getTime()\n ) {\n return entry.value;\n }\n }\n\n let stat = statSync(templateCompilerPath);\n\n let source = patch(readFileSync(templateCompilerPath, 'utf8'), templateCompilerPath);\n let theExports: any = undefined;\n\n // cacheKey, theExports\n let cacheKey = createHash('md5').update(source).digest('hex');\n\n entry = Object.freeze({\n value: {\n cacheKey,\n get theExports() {\n if (theExports) {\n return theExports;\n }\n\n // matches (essentially) what ember-cli-htmlbars does in https://git.io/Jtbpj\n let sandbox = {\n module: { require, exports: {} },\n require,\n };\n\n if (typeof globalThis === 'undefined') {\n // for Node 10 usage with Ember 3.27+ we have to define the `global` global\n // in order for ember-template-compiler.js to evaluate properly\n // due to this code https://git.io/Jtb7\n (sandbox as any).global = sandbox;\n }\n // using vm.createContext / vm.Script to ensure we evaluate in a fresh sandbox context\n // so that any global mutation done within ember-template-compiler.js does not leak out\n let context = createContext(sandbox);\n let script = new Script(source, { filename: templateCompilerPath });\n\n script.runInContext(context);\n return (theExports = context.module.exports);\n },\n },\n stat, // This is stored, so we can reload the templateCompiler if it changes mid-build.\n });\n\n CACHE.set(templateCompilerPath, entry);\n return entry.value;\n}\n"]}
@@ -1,12 +0,0 @@
1
- import type { types as t } from '@babel/core';
2
- import type { NodePath } from '@babel/traverse';
3
- declare type BabelTypes = typeof t;
4
- export default function miniModulesPolyfill(babel: unknown): {
5
- visitor: {
6
- Program: {
7
- exit(path: NodePath<t.Program>): void;
8
- };
9
- };
10
- };
11
- export declare function handleImportDeclaration(t: BabelTypes, path: NodePath<t.ImportDeclaration>): undefined;
12
- export {};
@@ -1,80 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handleImportDeclaration = void 0;
4
- // this is intentionally not the whole babel-plugin-ember-modules-api-polyfill.
5
- // That runs very early, so any usage of polyfilled imports that gets emitted by
6
- // our other babel plugins can't take advantage of it.
7
- //
8
- // If I was going to try to do this properly, I would change
9
- // babel-plugin-ember-modules-api-polyfill to run very late in the game, like
10
- // this code does, so that other plugins could always not worry about it. But
11
- // seeing as modules-api-polyfill is already on the way out, it's simpler to
12
- // just handle the small piece of its functionality that matter to us:
13
- //
14
- // - all our usage (emitted by our babel plugins) is static imports, not dynamic
15
- // ones, so it's OK to just walk the top level, saving us the cost of a full
16
- // traverse
17
- // - we only emit a handful of specific imports that are easy to just list here
18
- //
19
- //
20
- let replacements = {
21
- '@ember/component/template-only': {
22
- default(t) {
23
- return t.memberExpression(t.identifier('Ember'), t.identifier('_templateOnlyComponent'));
24
- },
25
- },
26
- '@ember/template-factory': {
27
- createTemplateFactory(t) {
28
- return t.memberExpression(t.memberExpression(t.identifier('Ember'), t.identifier('HTMLBars')), t.identifier('template'));
29
- },
30
- },
31
- '@ember/component': {
32
- default(t) {
33
- return t.memberExpression(t.identifier('Ember'), t.identifier('Component'));
34
- },
35
- setComponentTemplate(t) {
36
- return t.memberExpression(t.identifier('Ember'), t.identifier('_setComponentTemplate'));
37
- },
38
- },
39
- };
40
- function miniModulesPolyfill(babel) {
41
- let t = babel.types;
42
- return {
43
- visitor: {
44
- Program: {
45
- exit(path) {
46
- for (let child of path.get('body')) {
47
- if (child.isImportDeclaration()) {
48
- let replacement = handleImportDeclaration(t, child);
49
- if (replacement) {
50
- path.replaceWith(replacement);
51
- }
52
- }
53
- }
54
- },
55
- },
56
- },
57
- };
58
- }
59
- exports.default = miniModulesPolyfill;
60
- function handleImportDeclaration(t, path) {
61
- let match = replacements[path.node.source.value];
62
- if (match) {
63
- let specifiers = path.get('specifiers');
64
- let replacers = specifiers.map(specifier => ({ replacer: match[specifier.node.local.name], specifier }));
65
- if (replacers.every(r => Boolean(r.replacer))) {
66
- path.replaceWith(t.variableDeclaration('const', replacers.map(r => t.variableDeclarator(r.specifier.node.local, r.replacer(t)))));
67
- }
68
- else {
69
- for (let { specifier, replacer } of replacers) {
70
- if (replacer) {
71
- path.insertAfter(t.variableDeclaration('const', [t.variableDeclarator(specifier.node.local, replacer(t))]));
72
- specifier.remove();
73
- }
74
- }
75
- }
76
- }
77
- return undefined;
78
- }
79
- exports.handleImportDeclaration = handleImportDeclaration;
80
- //# sourceMappingURL=mini-modules-polyfill.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mini-modules-polyfill.js","sourceRoot":"","sources":["mini-modules-polyfill.ts"],"names":[],"mappings":";;;AAKA,+EAA+E;AAC/E,gFAAgF;AAChF,sDAAsD;AACtD,EAAE;AACF,4DAA4D;AAC5D,6EAA6E;AAC7E,6EAA6E;AAC7E,4EAA4E;AAC5E,sEAAsE;AACtE,EAAE;AACF,gFAAgF;AAChF,8EAA8E;AAC9E,aAAa;AACb,+EAA+E;AAC/E,EAAE;AACF,EAAE;AACF,IAAI,YAAY,GAAqG;IACnH,gCAAgC,EAAE;QAChC,OAAO,CAAC,CAAa;YACnB,OAAO,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,wBAAwB,CAAC,CAAC,CAAC;QAC3F,CAAC;KACF;IACD,yBAAyB,EAAE;QACzB,qBAAqB,CAAC,CAAC;YACrB,OAAO,CAAC,CAAC,gBAAgB,CACvB,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,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,SAAS,GAAG,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;QACzG,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE;YAC7C,IAAI,CAAC,WAAW,CACd,CAAC,CAAC,mBAAmB,CACnB,OAAO,EACP,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,QAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CACjF,CACF,CAAC;SACH;aAAM;YACL,KAAK,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,SAAS,EAAE;gBAC7C,IAAI,QAAQ,EAAE;oBACZ,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC5G,SAAS,CAAC,MAAM,EAAE,CAAC;iBACpB;aACF;SACF;KACF;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAtBD,0DAsBC","sourcesContent":["import type { types as t } from '@babel/core';\nimport type { NodePath } from '@babel/traverse';\n\ntype BabelTypes = typeof t;\n\n// this is intentionally not the whole babel-plugin-ember-modules-api-polyfill.\n// That runs very early, so any usage of polyfilled imports that gets emitted by\n// our other babel plugins can't take advantage of it.\n//\n// If I was going to try to do this properly, I would change\n// babel-plugin-ember-modules-api-polyfill to run very late in the game, like\n// this code does, so that other plugins could always not worry about it. But\n// seeing as modules-api-polyfill is already on the way out, it's simpler to\n// just handle the small piece of its functionality that matter to us:\n//\n// - all our usage (emitted by our babel plugins) is static imports, not dynamic\n// ones, so it's OK to just walk the top level, saving us the cost of a full\n// traverse\n// - we only emit a handful of specific imports that are easy to just list here\n//\n//\nlet replacements: { [moduleSpecifier: string]: { [name: string]: ((t: BabelTypes) => t.Expression) | undefined } } = {\n '@ember/component/template-only': {\n default(t: BabelTypes) {\n return t.memberExpression(t.identifier('Ember'), t.identifier('_templateOnlyComponent'));\n },\n },\n '@ember/template-factory': {\n createTemplateFactory(t) {\n return t.memberExpression(\n t.memberExpression(t.identifier('Ember'), t.identifier('HTMLBars')),\n t.identifier('template')\n );\n },\n },\n '@ember/component': {\n default(t: BabelTypes) {\n return t.memberExpression(t.identifier('Ember'), t.identifier('Component'));\n },\n setComponentTemplate(t: BabelTypes) {\n return t.memberExpression(t.identifier('Ember'), t.identifier('_setComponentTemplate'));\n },\n },\n};\n\nexport default function miniModulesPolyfill(babel: unknown) {\n let t = (babel as any).types as BabelTypes;\n return {\n visitor: {\n Program: {\n exit(path: NodePath<t.Program>) {\n for (let child of path.get('body')) {\n if (child.isImportDeclaration()) {\n let replacement = handleImportDeclaration(t, child);\n if (replacement) {\n path.replaceWith(replacement);\n }\n }\n }\n },\n },\n },\n };\n}\n\nexport function handleImportDeclaration(t: BabelTypes, path: NodePath<t.ImportDeclaration>) {\n let match = replacements[path.node.source.value];\n if (match) {\n let specifiers = path.get('specifiers');\n let replacers = specifiers.map(specifier => ({ replacer: match[specifier.node.local.name], specifier }));\n if (replacers.every(r => Boolean(r.replacer))) {\n path.replaceWith(\n t.variableDeclaration(\n 'const',\n replacers.map(r => t.variableDeclarator(r.specifier.node.local, r.replacer!(t)))\n )\n );\n } else {\n for (let { specifier, replacer } of replacers) {\n if (replacer) {\n path.insertAfter(t.variableDeclaration('const', [t.variableDeclarator(specifier.node.local, replacer(t))]));\n specifier.remove();\n }\n }\n }\n }\n return undefined;\n}\n"]}
@@ -1 +0,0 @@
1
- export declare function patch(source: string, templateCompilerPath: string): string;