Skip to content

Commit

Permalink
chore(rollup): cleanup magicExports remains (#3688)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey authored Jul 10, 2022
1 parent 540af5a commit 7a4e17f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
13 changes: 1 addition & 12 deletions packages/remix-architect/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
const { getAdapterConfig } = require("../../rollup.utils");

// Re-export everything from this package that is available in `remix`
/** @type {import('../../rollup.utils').MagicExports} */
const magicExports = {
"@remix-run/architect": {
values: ["createArcTableSessionStorage"],
},
"@remix-run/node": {
types: ["UploadHandler", "UploadHandlerPart"],
},
};

/** @returns {import("rollup").RollupOptions[]} */
module.exports = function rollup() {
return [getAdapterConfig("architect", magicExports)];
return [getAdapterConfig("architect")];
};
10 changes: 4 additions & 6 deletions rollup.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,10 @@ function copyToPlaygrounds() {

/**
* @param {RemixAdapter} adapterName
* @param {MagicExports} [magicExports] TODO: Remove in v2
* @returns {import("rollup").RollupOptions}
*/
function getAdapterConfig(adapterName, magicExports) {
/** @type {RemixPackage} */
function getAdapterConfig(adapterName) {
/** @type {`@remix-run/${RemixAdapter}`} */
let packageName = `@remix-run/${adapterName}`;
let sourceDir = `packages/remix-${adapterName}`;
let outputDir = getOutputDir(packageName);
Expand Down Expand Up @@ -176,10 +175,10 @@ function getAdapterConfig(adapterName, magicExports) {
* @returns {import("rollup").Plugin}
*/
function magicExportsPlugin({ packageName, version }) {
let magicExports = getMagicExports(packageName);
return {
name: `${packageName}:generate-magic-exports`,
generateBundle() {
let magicExports = getMagicExports(packageName);
if (!magicExports) {
return;
}
Expand Down Expand Up @@ -235,7 +234,7 @@ function magicExportsPlugin({ packageName, version }) {

/**
* TODO: Remove in v2
* @param {RemixPackage} packageName
* @param {ScopedRemixPackage} packageName
* @returns {MagicExports | null}
*/
function getMagicExports(packageName) {
Expand Down Expand Up @@ -413,7 +412,6 @@ module.exports = {
createBanner,
getAdapterConfig,
getCliConfig,
getMagicExports,
getOutputDir,
isBareModuleId,
magicExportsPlugin,
Expand Down

0 comments on commit 7a4e17f

Please sign in to comment.