Skip to content

Commit 5293975

Browse files
committed
chore(package): code cleanup
1 parent 0071a85 commit 5293975

File tree

3 files changed

+6
-27
lines changed

3 files changed

+6
-27
lines changed

packages/plugin-tab/dist/js/plugin-node-tab.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var PluginTab = {
1+
const PluginTab = {
22
/**
33
* The function defined as the onready callback within the plugin configuration.
44
*/

packages/plugin-tab/index.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -75,39 +75,17 @@ function getPluginFrontendConfig() {
7575
* Instead, alter getPluginFrontendConfig() and registerEvents() methods
7676
*/
7777
function pluginInit(patternlab) {
78-
console.log('PLUGIN INIT!');
79-
8078
if (!patternlab) {
8179
console.error('patternlab object not provided to pluginInit');
8280
process.exit(1);
8381
}
8482

8583
//write the plugin json to public/patternlab-components
8684
const pluginConfig = getPluginFrontendConfig();
87-
88-
console.log(patternlab.config.plugins);
89-
9085
pluginConfig.tabsToAdd =
9186
patternlab.config.plugins[pluginName].options.tabsToAdd;
9287
writeConfigToOutput(patternlab, pluginConfig);
9388

94-
// const pluginConfigPathName = path.resolve(
95-
// patternlab.config.paths.public.root,
96-
// 'patternlab-components',
97-
// 'packages'
98-
// );
99-
// try {
100-
// fs.outputFileSync(
101-
// pluginConfigPathName + '/' + pluginName + '.json',
102-
// JSON.stringify(pluginConfig, null, 2)
103-
// );
104-
// } catch (ex) {
105-
// console.trace(
106-
// 'plugin-tab: Error occurred while writing pluginFile configuration'
107-
// );
108-
// console.log(ex);
109-
// }
110-
11189
//add the plugin config to the patternlab-object
11290
if (!patternlab.plugins) {
11391
patternlab.plugins = [];
@@ -161,7 +139,6 @@ function pluginInit(patternlab) {
161139
'/*SNIPPETS*/',
162140
snippetString
163141
);
164-
console.log(161, tabJSFileContents);
165142
_.each(patternlab.uikits, uikit => {
166143
fs.outputFileSync(
167144
path.join(process.cwd(), uikit.outputDir, writePath),

packages/plugin-tab/src/tab-loader.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const fs = require('fs-extra');
1414
function findTab(patternlab, pattern) {
1515
//read the filetypes from the configuration
1616
const fileTypes =
17-
patternlab.config.plugins['@pattern-lab-plugin-tab'].options.tabsToAdd;
17+
patternlab.config.plugins['pattern-lab-plugin-tab'].options.tabsToAdd;
1818

1919
//exit if either of these two parameters are missing
2020
if (!patternlab) {
@@ -46,10 +46,12 @@ function findTab(patternlab, pattern) {
4646
pattern.getPatternLink(patternlab, 'custom', '.' + fileType);
4747

4848
//look for a custom filetype for this template
49+
let tabFileName;
50+
let tabFileNameStats;
4951
try {
50-
var tabFileName = path.resolve(customFileTypePath);
52+
tabFileName = path.resolve(customFileTypePath);
5153
try {
52-
var tabFileNameStats = fs.statSync(tabFileName);
54+
tabFileNameStats = fs.statSync(tabFileName);
5355
} catch (err) {
5456
//not a file - move on quietly
5557
}

0 commit comments

Comments
 (0)