antwarjs / antwar

A static site generator built with React and Webpack.
https://antwar.js.org/
MIT License
460 stars 35 forks source link

Unable to get local dev working with contributing steps #111

Closed andersosthus closed 7 years ago

andersosthus commented 7 years ago

Hi,

I'm trying out the steps listed in Contributing.md, but I'm unable to get it to work.

Node v6.5.0
Npm v3.10.3

After cloning the repo I ran npm run init. This completed fine. I then tried npm start. This doesn't work in the root folder, since package.json doesn't specify a start script.

I then navigate to ./site and run npm run start. Here I get the following error:

antwar({
^

TypeError: antwar is not a function
    at Object.<anonymous> (/mnt/d/Projects/antwar/site/bootstrap.js:8:1)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.runMain (module.js:590:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

So basically it looks like it doesn't search for imports properly in ../packages since, if I'm not mistaken, the require('antwar') statement in bootstrap.js should be using that one?

The same issue in smoketest as well.

Am I doing something wrong here or ?

bebraw commented 7 years ago

Yeah, there's no start at the root. Better update those docs a notch.

Which OS are you running? I have to patch NODE_PATH at those sites so that could be it. It's most likely failing to look up the package from the sibling directory. We may have to change the patching mechanism.

andersosthus commented 7 years ago

Hi,

I forgot to mention OS in my original post. I've done these tests in Bash on Windows. Basically it's Ubuntu 14.04 binaries. I've successfully ran other node projects in this environment before.

bebraw commented 7 years ago

Ok, I have a rough fix in mind. I'll try to patch that in later today. 👍

bebraw commented 7 years ago

Here we go. Try this:

  1. npm run build (now that I think of it, I think this was the missing step earlier, npm run init builds the project initially now)
  2. npm start (runs the smoketest)

npm run site should run the site (styling in progress).

There's also npm run watch. It should pick up changes made to the source, run tests, and generate code. It's not particularly fast, but it should work.

bebraw commented 7 years ago

I've revamped the project a lot. Please give it a go again and re-open if this is still relevant. Thanks. 👍