aragon / your-first-aragon-app

(Aragon 1) Template to help you build your first Aragon application
MIT License
21 stars 16 forks source link

Initialize arapp.json when creating from scratch #15

Open marsrobertson opened 4 years ago

marsrobertson commented 4 years ago

This is empty: https://github.com/aragon/your-first-aragon-app/blob/master/arapp.json

npm start complains about empty JSON

npm start

> placeholder-app-name@0.0.1 start /Users/ms/Stuff/aragon-tutorial
> buidler start

main     | Starting Aragon app development...
An unexpected error occurred:

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at readArapp (/Users/ms/Stuff/aragon-tutorial/node_modules/@aragon/buidler-aragon/src/utils/arappUtils.ts:15:15)
    at Object.getAppEnsName (/Users/ms/Stuff/aragon-tutorial/node_modules/@aragon/buidler-aragon/src/utils/arappUtils.ts:23:17)
    at SimpleTaskDefinition.config_1.task.addFlag.addFlag.setAction [as action] (/Users/ms/Stuff/aragon-tutorial/node_modules/@aragon/buidler-aragon/src/tasks/start-task.ts:34:30)
    at Environment._runTaskDefinition (/Users/ms/Stuff/aragon-tutorial/node_modules/@nomiclabs/buidler/src/internal/core/runtime-environment.ts:190:35)
    at Environment.run (/Users/ms/Stuff/aragon-tutorial/node_modules/@nomiclabs/buidler/src/internal/core/runtime-environment.ts:115:17)
    at main (/Users/ms/Stuff/aragon-tutorial/node_modules/@nomiclabs/buidler/src/internal/cli/cli.ts:151:15)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! placeholder-app-name@0.0.1 start: `buidler start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the placeholder-app-name@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ms/.npm/_logs/2020-04-01T13_44_00_046Z-debug.log
/**
 * Reads and parses an arapp.json file.
 * @return AragonAppJson
 */
export function readArapp(): AragonAppJson {
  return JSON.parse(fs.readFileSync(arappPath, 'utf-8'))
}
marsrobertson commented 4 years ago

Totally not sure what to put in arapp.json

Agent example: https://github.com/aragon/aragon-apps/blob/master/apps/agent/arapp.json

Posted on Spectrum: https://spectrum.chat/aragon/app-development/help-with-getting-started~e0e26bdb-cbe0-41d2-a57a-55db8e73a6e2

macor161 commented 4 years ago

Hi @marsrobertson, yes this is quite a common question. As explained here, the boilerplate code intentionally has empty files like CounterApp.sol and arapp.json.

However, it does lead to some confusion for many users to begin with a project which has a broken npm start command. Perhaps it would be more intuitive to start with all the basic files that the developer can then complete throughout the tutorial.