Skip to content

Commit

Permalink
Added new dummy files
Browse files Browse the repository at this point in the history
  • Loading branch information
clehnert-psl committed Nov 14, 2017
1 parent 23955da commit 0b4065e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
8 changes: 6 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ Global and per blueprint config options are available. Here they are shown with
{
"rootDirectory": "app",
"podsDirectory": "pods", // Assumed as a sub directory of root
"blueprintsDirectory": "blueprints"
"blueprintsDirectory": "blueprints",
"useTemplateDirectory": true // Should the components be generated in directory matching the template name?
}
```

Expand All @@ -232,4 +233,7 @@ Global and per blueprint config options are available. Here they are shown with
{
"forcePods": false
}
```
```

### Naming
The `__TEMPLATE_TOKEN__` used for any file or directory within `/blueprints` will nbe replaced with the component name supplied via the command. This is useful if you have some files that should be generated that do not ytake the components name, e.g., `index.js`.
5 changes: 3 additions & 2 deletions dist/generate/tasks/copy-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ function copyFiles(blueprints, __destinationDirectory__, __templateDirectory__,
var nextArgs = [blueprints, __destinationDirectory__, __templateDirectory__, __templateName__, callback, index + 1];

// If a blueprint exists for the current index
var fileName = _path2['default'].basename(blueprint).replace('__TEMPLATE_TOKEN__', __templateName__);
var __templateToken__ = __templateName__ ? __templateName__ : __templateDirectory__;
var fileName = _path2['default'].basename(blueprint).replace('__TEMPLATE_TOKEN__', __templateToken__);
var target = _path2['default'].join(__destinationDirectory__, fileName);

// Build template variable middleware
var handleTemplateVariables = buildTemplateVariablesMiddleware(new _smartStream2['default'].SmartStream('ReplaceTemplateVariables'), __templateName__);
var handleTemplateVariables = buildTemplateVariablesMiddleware(new _smartStream2['default'].SmartStream('ReplaceTemplateVariables'), __templateToken__);

// Prepare arguments for writeFromBlueprint
var writeArgs = [blueprint, target, handleTemplateVariables, function () {
Expand Down
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions src/generate/tasks/copy-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ export default function copyFiles(blueprints, __destinationDirectory__, __templa
];

// If a blueprint exists for the current index
const fileName = path.basename(blueprint).replace('__TEMPLATE_TOKEN__', __templateName__);
const __templateToken__ = __templateName__ ? __templateName__ : __templateDirectory__;
const fileName = path.basename(blueprint).replace('__TEMPLATE_TOKEN__', __templateToken__);
const target = path.join(__destinationDirectory__, fileName);

// Build template variable middleware
const handleTemplateVariables = buildTemplateVariablesMiddleware(
new ss.SmartStream('ReplaceTemplateVariables'),
__templateName__
__templateToken__
);

// Prepare arguments for writeFromBlueprint
Expand Down

0 comments on commit 0b4065e

Please sign in to comment.