Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aragon init prepare template for environments #371

Merged
merged 5 commits into from
Feb 21, 2019

Conversation

0xGabi
Copy link
Contributor

@0xGabi 0xGabi commented Feb 19, 2019

No description provided.

t.is(appName, project.environments.default.appName)
t.is(`${appName}`, project.environments.default.appName)
t.is(`${appName}.open.aragonpm.eth`, project.environments.staging.appName)
t.is(`${appName}.open.aragonpm.eth`, project.environments.production.appName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like appName for staging and prod will be aragon-app.aragonpm.eth.open.aragonpm.eth

defaultEnv.appName = appName
Object.assign(arapp.environments.default, defaultEnv)

stagingEnv.appName = stagingEnv.appName.replace(/^app/, appName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid stagingEnv.appName = 'aragon-app.aragonpm.eth.open.aragonpm.eth'

we could have:

- stagingEnv.appName = stagingEnv.appName.replace(/^app/, appName)
+ stagingEnv.appName = stagingEnv.appName.replace(/^app/, basename)

this will work for the CLI, but break the test, because in the test we are passing a path: ./.tmp/aragon-app, and not the basename.

I think what we can do instead is some parsing in prepareTemplate (get the basename from appName) and rename the param to path:

function prepareTemplate(path, appName) {
   const basename = name.split('.')[0]
   //...
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right. This is better

@0xGabi 0xGabi merged commit 85ca980 into aragon:master Feb 21, 2019
@0xGabi 0xGabi deleted the aragon-init-pepare-template branch February 21, 2019 16:17
@@ -11,7 +11,7 @@
"build": "npm run extract-roles && babel -d dist src --copy-files",
"prepare": "npm run build",
"test": "ava",
"lint": "eslint src test && documentation lint src test",
"lint": "eslint src test/commands && documentation lint src test/commands",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed this, but it seems unnecessary to run documentation lint on the tests 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll include this change in #359

const licensePath = path.resolve(basename, 'LICENSE')

const packageJsonPath = path.resolve(basename, 'package.json')
const packageJsonPath = path.resolve(dir, 'package.json')
const packageJson = await fs.readJson(packageJsonPath)
delete packageJson.license
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, should we move this to also be in create-aragon-app (really really want to start pushing that!)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! I already made the same changes in create-aragon-app. Seems its never the perfect time to merge the monorepo PR to finally have create-aragon-app in aragonCLI 😅Maybe after the beta release?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the next release (5.4) would be a great time!

@kernelwhisperer kernelwhisperer added this to the aragonCLI v5.4 milestone Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants