DEV: Remove rfc176-shims

Ember has now migrated to the new module layout, so these shims are no longer required
This commit is contained in:
Peter Wagenet 2022-05-03 12:22:11 -07:00 committed by David Taylor
parent 13bc2f1f39
commit 0ac90abcfa
4 changed files with 1 additions and 70 deletions

View File

@ -1 +0,0 @@
engine-strict = true

View File

@ -1,61 +0,0 @@
"use strict";
// In core, babel-plugin-ember-modules-api-polyfill takes care of re-writing the new module
// syntax to the legacy Ember globals. For themes and plugins, we need to manually set up
// the modules.
//
// Eventually, Ember RFC176 will be implemented, and we can drop these shims.
const RFC176Data = require("ember-rfc176-data");
module.exports = {
name: require("./package").name,
isDevelopingAddon() {
return true;
},
contentFor: function (type) {
if (type !== "vendor-suffix") {
return;
}
const modules = {};
for (const entry of RFC176Data) {
// Entries look like:
// {
// global: 'Ember.expandProperties',
// module: '@ember/object/computed',
// export: 'expandProperties',
// deprecated: false
// },
if (entry.deprecated) {
continue;
}
let m = modules[entry.module];
if (!m) {
m = modules[entry.module] = [];
}
if (entry.module === "@ember/test") {
m.push({ ...entry, global: `(Ember.Test && ${entry.global})` });
} else {
m.push(entry);
}
}
let output = "";
for (const moduleName of Object.keys(modules)) {
const exports = modules[moduleName];
const rawExports = exports
.map((e) => `${e.export}:${e.global}`)
.join(",");
output += `define("${moduleName}", () => {return {${rawExports}}});\n`;
}
return output;
},
};

View File

@ -1,6 +0,0 @@
{
"name": "rfc176-shims",
"keywords": [
"ember-addon"
]
}

View File

@ -89,8 +89,7 @@
},
"ember-addon": {
"paths": [
"lib/bootstrap-json",
"lib/rfc176-shims"
"lib/bootstrap-json"
]
},
"devDependencies": {