DEV: move deprecation silencer to a shared package (#22668)

This babel plugin is intended to supress the deprecation warnings
from building plugins, however, discourse-plugins does not actually
consume this plugin at all. Currently this happens to work due to
how the babel worker processes are shared and the timing/ordering
of the build, but it will stop working with the embroider build.

This commit extracts the plugin the a shared package so that it
can be properly consumed by discourse-plugins as well as core.
This commit is contained in:
Godfrey Chan 2023-07-18 11:07:20 -07:00 committed by GitHub
parent 5fbce985a8
commit 3c69570b75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 25 additions and 2 deletions

View File

@ -0,0 +1,14 @@
{
"name": "deprecation-silencer",
"version": "1.0.0",
"private": true,
"description": "Silence deprecation in the build",
"author": "Discourse",
"license": "GPL-2.0-only",
"keywords": [],
"engines": {
"node": "16.* || >= 18",
"npm": "please-use-yarn",
"yarn": ">= 1.21.1"
}
}

View File

@ -90,6 +90,12 @@ function parsePluginName(pluginRbPath) {
module.exports = {
name: require("./package").name,
options: {
babel: {
plugins: [require.resolve("deprecation-silencer")],
},
},
pluginInfos() {
const root = path.resolve("../../../../plugins");
const pluginDirectories = fs

View File

@ -8,6 +8,7 @@
"ember-addon"
],
"dependencies": {
"deprecation-silencer": "1.0.0",
"discourse-widget-hbs": "1.0.0",
"ember-auto-import": "^2.6.3",
"ember-cli-babel": "^7.26.11",

View File

@ -9,7 +9,7 @@ const { parsePluginClientSettings } = require("./lib/site-settings-plugin");
const discourseScss = require("./lib/discourse-scss");
const generateScriptsTree = require("./lib/scripts");
const funnel = require("broccoli-funnel");
const DeprecationSilencer = require("./lib/deprecation-silencer");
const DeprecationSilencer = require("deprecation-silencer");
const generateWorkboxTree = require("./lib/workbox-tree-builder");
module.exports = function (defaults) {
@ -94,7 +94,7 @@ module.exports = function (defaults) {
},
babel: {
plugins: [require.resolve("./lib/deprecation-silencer")],
plugins: [require.resolve("deprecation-silencer")],
},
// We need to build tests in prod for theme tests

View File

@ -52,6 +52,7 @@
"bootstrap-json": "1.0.0",
"broccoli-asset-rev": "^3.0.0",
"deepmerge": "^4.3.1",
"deprecation-silencer": "1.0.0",
"dialog-holder": "1.0.0",
"discourse-common": "1.0.0",
"discourse-plugins": "1.0.0",

View File

@ -6,6 +6,7 @@
"workspaces": [
"admin",
"bootstrap-json",
"deprecation-silencer",
"dialog-holder",
"discourse",
"discourse-common",