Reverting changes from old branch

This commit is contained in:
Belen Curcio
2017-07-10 17:06:40 -03:00
parent 2c7f5ca089
commit 636f357186
10 changed files with 3 additions and 179 deletions
+1 -50
View File
@@ -8,14 +8,13 @@
// https://yarnpkg.com/
const program = require('./commander');
const inquirer = require('inquirer');
// Make things colorful!
require('colors');
const emoji = require('node-emoji');
const dir = process.cwd();
const fs = require('fs-extra');
const fs = require('fs');
const path = require('path');
const spawn = require('cross-spawn');
const semver = require('semver');
@@ -273,58 +272,10 @@ async function reconcilePluginDeps({skipLocal, skipRemote, dryRun, upgradeRemote
console.log(`✨ Done in ${totalTime}s.`);
}
async function createSeedPlugin() {
const pluginsDir = path.join(dir, 'plugins');
function pluginNameExists(pluginName) {
const pluginNames = fs.readdirSync(pluginsDir);
return !!pluginNames
.filter((pn) => pn === pluginName).length;
}
let answers = await inquirer.prompt([
{
type: 'input',
name: 'pluginName',
message: 'Plugin Name: i.e talk-plugin-permalink',
validate: (input) => {
if (pluginNameExists(input)) {
return 'Please, choose another name. That name already exists';
}
if (input && input.length > 0) {
return true;
}
return 'Plugin Name is required.';
}
}
]);
// Creating plugin seed
const seedTemplatePlugin = path.join(dir, 'scripts/templates/plugin');
const newPluginPath = path.join(pluginsDir, answers.pluginName);
try {
fs.copySync(seedTemplatePlugin, newPluginPath);
console.log('Success!');
} catch (err) {
console.error(err);
}
}
//==============================================================================
// Setting up the program command line arguments.
//==============================================================================
program
.command('create')
.description('creates a seed plugin')
.action(createSeedPlugin);
program
.command('list')
.description('')
@@ -1,25 +0,0 @@
import React from 'react';
import {CoralLogo} from 'plugin-api/beta/client/components/ui';
import styles from './style.css';
class MyPluginComponent extends React.Component {
render() {
return (
<div className={styles.myPluginContainer}>
<CoralLogo className={styles.logo}/>
<div className={styles.description}>
<h3><%= pluginName %> Plugin created by Talk CLI</h3>
<small>
To read more about plugins check{' '}
<a href="https://coralproject.github.io/talk/plugins-client.html">
our docs and guides!
</a>
</small>
</div>
</div>
);
}
}
export default MyPluginComponent;
@@ -1,27 +0,0 @@
.myPluginContainer {
padding: 10px;
background: #f0f0f0;
border: 1px solid #d6d6d6;
margin: 10px 0;
text-align: center;
border-radius: 3px;
}
.logo {
position: block;
animation: spin 2s infinite ease;
animation-delay: 1s;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.description {
color: #444444;
}
+2 -3
View File
@@ -15,9 +15,9 @@ function getSlotComponents(slot) {
// Filter out components that have been disabled in `plugin_config`
return flatten(plugins
// Filter out components that have been disabled in `plugin_config`
.filter((o) => o.module.slots && (!pluginConfig || !pluginConfig[o.plugin] || !pluginConfig[o.plugin].disable_components))
.filter((o) => !pluginConfig || !pluginConfig[o.plugin] || !pluginConfig[o.plugin].disable_components)
.filter((o) => o.module.slots[slot])
.map((o) => o.module.slots[slot]));
@@ -78,7 +78,6 @@ export function getSlotsFragments(slots) {
}
const components = uniq(flattenDeep(slots.map((slot) => {
return plugins
.filter((o) => o.module.slots)
.filter((o) => o.module.slots[slot])
.map((o) => o.module.slots[slot]);
})));
-1
View File
@@ -79,7 +79,6 @@
"express-session": "^1.15.1",
"file-loader": "^0.11.2",
"form-data": "^2.1.2",
"fs-extra": "^3.0.1",
"gql-merge": "^0.0.4",
"graphql": "^0.9.1",
"graphql-errors": "^2.1.0",
-14
View File
@@ -1,14 +0,0 @@
{
"presets": [
"es2015"
],
"plugins": [
"add-module-exports",
"transform-class-properties",
"transform-decorators-legacy",
"transform-object-assign",
"transform-object-rest-spread",
"transform-async-to-generator",
"transform-react-jsx"
]
}
@@ -1,23 +0,0 @@
{
"env": {
"browser": true,
"es6": true,
"mocha": true
},
"parserOptions": {
"sourceType": "module",
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
}
},
"parser": "babel-eslint",
"plugins": [
"react"
],
"rules": {
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"no-console": ["warn", { "allow": ["warn", "error"] }]
}
}
-20
View File
@@ -1,20 +0,0 @@
/**
This is a client index example file and it should look like this:
```
import LoveButton from './components/LoveButton';
export default {
slots: {
commentReactions: [LoveButton]
},
reducer,
translations
};
```
To read more info on how to build client plugins. Please, go to: https://coralproject.github.io/talk/plugins-client.html
*/
export default {};
@@ -1,15 +0,0 @@
#
# This file is for translations and they should look like this:
#
#
# ```
# en:
# coral-plugin-respect:
# respect: Respect
# respected: Respected
# es:
# coral-plugin-respect:
# respect: Respetar
# respected: Respetado
# ```
#
-1
View File
@@ -1 +0,0 @@
module.exports = {};