Skip to content

Commit

Permalink
explicitly disabling all packages but the treemap, just to narrow bug…
Browse files Browse the repository at this point in the history
… scope.
  • Loading branch information
rusackas committed Mar 18, 2020
1 parent b1a759e commit da45f7b
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 8 deletions.
58 changes: 51 additions & 7 deletions superset-frontend/plugin-devmode.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,48 @@ const PLUGINS_REPO =
process.env.SUPERSET_UI_PLUGINS_PATH ||
path.resolve('../../superset-ui-plugins');

console.log('looking for plugins in ', PLUGINS_REPO);

const PACKAGES_ROOT = path.join(PLUGINS_REPO, 'packages');

// TODO refactor these troublesome packages so they can work with a symlink to their `src` directory
const unlinkablePackages = [
'@superset-ui/legacy-preset-chart-nvd3',
'@superset-ui/preset-chart-xy',
'@superset-ui/legacy-plugin-chart-calendar',
'@superset-ui/legacy-plugin-chart-chord',
'@superset-ui/legacy-plugin-chart-country-map',
'@superset-ui/legacy-plugin-chart-event-flow',
'@superset-ui/legacy-plugin-chart-force-directed',
'@superset-ui/legacy-plugin-chart-heatmap',
'@superset-ui/legacy-plugin-chart-histogram',
'@superset-ui/legacy-plugin-chart-horizon',
'@superset-ui/legacy-plugin-chart-iframe',
'@superset-ui/legacy-plugin-chart-map-box',
'@superset-ui/legacy-plugin-chart-markup',
'@superset-ui/legacy-plugin-chart-paired-t-test',
'@superset-ui/legacy-plugin-chart-parallel-coordinates',
'@superset-ui/legacy-plugin-chart-partition',
'@superset-ui/legacy-plugin-chart-pivot-table',
'@superset-ui/legacy-plugin-chart-rose',
'@superset-ui/legacy-plugin-chart-sankey',
'@superset-ui/legacy-plugin-chart-sankey-loop',
'@superset-ui/legacy-plugin-chart-sunburst',
'@superset-ui/legacy-plugin-chart-table',
// '@superset-ui/legacy-plugin-chart-treemap',
'@superset-ui/legacy-plugin-chart-word-cloud',
'@superset-ui/legacy-plugin-chart-world-map',
'@superset-ui/legacy-preset-chart-big-number',
'@superset-ui/plugin-chart-icicle-event',
'@superset-ui/plugin-chart-table',
'@superset-ui/plugin-chart-word-cloud',
'@superset-ui/plugins-demo',

]

function findPackages() {
if (!fs.existsSync(PACKAGES_ROOT)) {
console.warn('Package root not found!');
return [];
}
return fs
Expand All @@ -46,13 +84,18 @@ function linkPackages(packageDirs) {
// eslint-disable-next-line import/no-dynamic-require, global-require
const packageName = require(path.join(directoryPath, 'package.json')).name;
console.log(`[${i + 1}/${packageDirs.length}] ${packageName}`);
execSync('npm link --loglevel error', {
cwd: directoryPath,
stdio: 'inherit',
});
execSync(`npm link ${packageName} --loglevel error`, {
stdio: 'inherit',
});
if(unlinkablePackages.includes(packageName)){
console.log(`Not linking this package!`);
}
else{
execSync('npm link --loglevel error', {
cwd: directoryPath,
stdio: 'inherit',
});
execSync(`npm link ${packageName} --loglevel error`, {
stdio: 'inherit',
});
}
});
}

Expand All @@ -67,4 +110,5 @@ if (require.main === module) {
module.exports = {
findPackages,
PACKAGES_ROOT,
unlinkablePackages,
};
2 changes: 1 addition & 1 deletion superset-frontend/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if (isDevMode) {
// first get a set of every plugin package name
// eslint-disable-next-line import/no-dynamic-require, global-require
dir => require(path.join(PACKAGES_ROOT, dir.name, 'package.json')).name,
),
).filter((packageName) => !pluginDevmode.unlinkablePackages.includes(packageName))
);

// now check which packages in node_modules are symlinks
Expand Down

0 comments on commit da45f7b

Please sign in to comment.