-
Notifications
You must be signed in to change notification settings - Fork 12k
feat(@angular/cli): specify multiple default collections #8723
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,15 +72,14 @@ export default Task.extend({ | |
}); | ||
|
||
const cwd = this.project.root; | ||
const schematicName = CliConfig.fromGlobal().get('defaults.schematics.newApp'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to retrieve config value from multiple places. Now it's always responsibility of the caller. |
||
commandOptions.version = packageJson.version; | ||
|
||
const runOptions = { | ||
taskOptions: commandOptions, | ||
workingDir: cwd, | ||
emptyHost: true, | ||
collectionName: commandOptions.collectionName, | ||
schematicName | ||
schematicName: commandOptions.schematicName | ||
}; | ||
|
||
return schematicRunTask.run(runOptions) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
const Task = require('../ember-cli/lib/models/task'); | ||
const stringUtils = require('ember-cli-string-utils'); | ||
import { CliConfig } from '../models/config'; | ||
import { getCollection, getSchematic } from '../utilities/schematics'; | ||
|
||
export interface SchematicGetOptions { | ||
|
@@ -19,10 +18,7 @@ export interface SchematicAvailableOptions { | |
|
||
export default Task.extend({ | ||
run: function (options: SchematicGetOptions): Promise<SchematicAvailableOptions[]> { | ||
const collectionName = options.collectionName || | ||
CliConfig.getValue('defaults.schematics.collection'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to retrieve config value from multiple places. Now it's always responsibility of the caller. |
||
|
||
const collection = getCollection(collectionName); | ||
const collection = getCollection(options.collectionName); | ||
|
||
const schematic = getSchematic(collection, options.schematicName); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "@custom-other/application", | ||
"version": "0.1", | ||
"schematics": { | ||
"application": { | ||
"factory": "./index.js", | ||
"schema": "./schema.json", | ||
"description": "Create an very empty application" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const s = require('@angular-devkit/schematics'); | ||
|
||
exports.default = function(options) { | ||
return s.chain([s.mergeWith(s.apply( | ||
s.url('./files'), [s.template({}), s.move(options.name)]))]); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "very-empty-app", | ||
"schematics": "./collection.json" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"$schema": "http://json-schema.org/schema", | ||
"id": "VeryEmptyApp", | ||
"title": "Angular Bazel Workspace Options Schema", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List schematics per collection