Skip to content

Comments

feat(ut): Add test#45

Open
ivanchenhz wants to merge 1 commit intomomentum-design:mainfrom
ivanchenhz:font-icon
Open

feat(ut): Add test#45
ivanchenhz wants to merge 1 commit intomomentum-design:mainfrom
ivanchenhz:font-icon

Conversation

@ivanchenhz
Copy link
Contributor

For issue: #35

  • Need run in javascript
  • Add test

Not cover yet

  • Update config format
  • Use momentum-constructor-common to read momentum file path as default

config = require(path.resolve(configFile));
if (!config) {
config = require(path.resolve(configFile));
}
Copy link
Member

Choose a reason for hiding this comment

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

Can we only read config from _config? Use Object.assign?

Copy link
Contributor Author

@ivanchenhz ivanchenhz Aug 29, 2022

Choose a reason for hiding this comment

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

We still want to support the config file way,
So the user doesn't have to write js, if they prefer cli

}
await fs.writeFile(configFile, `module.exports = ${JSON.stringify(config, null, 2)}`, 'utf-8');

return _dry ? config : await fs.writeFile(configFile, `module.exports = ${JSON.stringify(config, null, 2)}`, 'utf-8');
Copy link
Member

Choose a reason for hiding this comment

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

Do we need print config if we use dry mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The init would return the config in dry run,
How to use the return stuff would up to the user,

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