Skip to content
This repository was archived by the owner on Dec 10, 2019. It is now read-only.

Commit b40f668

Browse files
committed
WIP configuration writing to public
1 parent 05fdab5 commit b40f668

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

index.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
"use strict";
2-
console.log('index!');
2+
3+
var fs = require('fs-extra'),
4+
path = require('path');
5+
36
function plugin_init(patternlab) {
4-
console.log('plugin_init!');
7+
8+
//write the plugin json to public/patternlab-components
9+
var pluginConfig = {
10+
"name":"pattern-lab\/plugin-node-tab",
11+
"templates":[],
12+
"stylesheets":[],
13+
"javascripts":["\/js\/plugin-tab.js"],
14+
"onready":"PluginTab.init()",
15+
"callback":""
16+
}
17+
18+
var pluginConfigPathName = path.resolve(patternlab.config.paths.public.root, 'patternlab-components', 'packages');
19+
fs.outputFileSync(pluginConfigPathName + '/plugin-tab.json', JSON.stringify(pluginConfig, null, 2));
520
}
621

722
module.exports = plugin_init;

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"version": "0.0.1",
44
"description": "",
55
"main": "index.js",
6-
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1"
6+
"dependencies": {
7+
"fs-extra": "^0.30.0"
88
},
99
"repository": {
1010
"type": "git",

0 commit comments

Comments
 (0)