FormidableLabs / formidable-react-component-boilerplate

MIT License
22 stars 2 forks source link

`lib/` is not present in some implemented Victory components. #41

Closed boygirl closed 9 years ago

boygirl commented 9 years ago

When including a component built from this boilerplate in another component built from this boilerplate the following isn't working

import {VictoryThing} from "victory-thing";

boygirl commented 9 years ago

var VictoryThing = require("victory-thing").VictoryThing; does work.

ryan-roemer commented 9 years ago

Can you please give an actual reproduction in code of the issue?

boygirl commented 9 years ago

if you clone down victory-donut you and npm install it will not find victory-animation, we were working around this by changing "main": "lib/index.js" to "main": "dist/victory-animation.js" in the package.json of victory-animation, which is not going to work out in the long run.

ryan-roemer commented 9 years ago

@boygirl -- Thanks. I'll try to reproduce that exact thing.

ryan-roemer commented 9 years ago

One problem is in the .npmignore, which when installed is:

### SublimeText ###
*.sublime-workspace

### OSX ###
.DS_Store
.AppleDouble
.LSOverride
Icon

# Thumbnails
._*

# Files that might appear on external disk
.Spotlight-V100
.Trashes

### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# App specific

coverage
node_modules
bower_components
.tmp
lib
npm-debug.log

lib is npmignore'd, which means we're not publishing it. Let me confirm upstream in this project.

ryan-roemer commented 9 years ago

lib is in the boilerplate. For example, this works:

diff --git a/src/components/victory-donut.jsx b/src/components/victory-donut.jsx
index 5a036a4..0328f53 100644
--- a/src/components/victory-donut.jsx
+++ b/src/components/victory-donut.jsx
@@ -2,7 +2,9 @@ import d3 from "d3";
 import _ from "lodash";
 import React from "react";
 import Radium from "radium";
-import {VictoryAnimation} from "victory-animation";
+import {BoilerplateComponent} from "formidable-react-component-boilerplate";
+
+const VictoryAnimation = BoilerplateComponent;

 @Radium
 class VictoryDonut extends React.Component {

@boygirl -- How did you last publish victory-animation?

boygirl commented 9 years ago

Ah, some of us generated components before the new publish stuff hit the boilerplate repos. I'll check on that and get back to you.

boygirl commented 9 years ago

fixed! we needed an .npmignore that did not ignore lib. Packages were falling back to the .gitignore on publish which does ignore lib.