More yeoman changes - #63
Conversation
There was a problem hiding this comment.
I'd like to modify the workspace entities, rename ComponentDefinition to Component and move the content of config.json to a new entity ComponentConfig.
That way we won't have to create a dummy ComponentDefinition when there is not config.json in the component, as is the case with the root component of api-server.
There was a problem hiding this comment.
Is the only issue that we are generating an empty config.json?
There was a problem hiding this comment.
We are not generating any config.json file.
I also don't like that config.json is embedded in ComponentDefinition, since config.json does not contain anything related to component definition. Instead, it contains arbitrary component configuration used by the component itself.
There was a problem hiding this comment.
The tests were complaining about a possible leak when 11 listeners were registered.
There was a problem hiding this comment.
Check the error code to ensure it is a parser error. Otherwise the error might be confusing (eg. too many fds open, permissions, ENOENT, etc).
There was a problem hiding this comment.
The isn't a good error code for JSON parsing errors AFAICT.
Perhaps it is enough to change the message to 'Cannot load ' + configFile.path + ...?
There was a problem hiding this comment.
Added a check err.name === 'SyntaxError'.
|
@ritch LTGY now? |
|
LGTM |
Fix ComponentDefinition.saveToFs to remove extra properties before writing json files (config, models, datasources).
Fix `Workspace.createFromTemplate` to set the root package name to the value supplied by the user, instead of hard-coded `.`.
The `models.json` should contain only models of the current component.
The root project does not have an app to load config.json. The configuration of REST API endpoint belongs to `server` component, because that's the component registering all different sub-apps.
The `api-server` root component should not include the following files, since there is no `app` to read them during boot: - config.json - datasources.json - models.json
- Include `loopback-boot 2.x` in the root `package.json` - Include express 4.x middleware packages in the root `package.json` - Drop `email` datasource. It is no longer needed, since loopback-boot does not call `loopback.autoAttach`. - Rename model names in `rest/models.json` to reference the built-in loopback models. Make internal models like `AccessToken` not public. - Refactor the `server` template to use the boot-based registration of middleware (see loopback-example-full-stack).
A basic implementation that checks whether all components can be loaded and whether there is at least one component present.
|
Rebased on top of current 3.0. |
namein the rootpackage.jsoncomponentNameproperties as required./to @ritch please review
Close #34