forked from ember-learn/ember-cli.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBlueprint.html
4931 lines (3832 loc) · 154 KB
/
Blueprint.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Blueprint - ember-cli</title>
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
<script src="https://cdnjs.cloudflare.com/ajax/libs/yui/3.18.0/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div class="yui3-g">
<div id="sidebar" class="yui3-u">
<div class="logo">
<a href="../index.html">
<img src="https://ember-cli.com/assets/images/ember-cli-logo-small-dark.png">
</a>
</div>
<div id="modules" class="sidebox">
<div class="hd">
<h2 class="no-toc">Modules</h2>
</div>
<div class="bd">
<ul>
<li><a href="../modules/ember-cli.html">ember-cli</a>
</li>
</ul>
</div>
</div>
<div id="classes" class="sidebox">
<div class="hd">
<h2 class="no-toc">Classes</h2>
</div>
<div class="bd">
<ul>
<li><a href="../classes/Addon.html">Addon</a></li>
<li><a href="../classes/AmdTransformAddon.html">AmdTransformAddon</a></li>
<li><a href="../classes/Blueprint.html">Blueprint</a></li>
<li><a href="../classes/Builder.html">Builder</a></li>
<li><a href="../classes/CLI.html">CLI</a></li>
<li><a href="../classes/Command.html">Command</a></li>
<li><a href="../classes/DefaultPackager.html">DefaultPackager</a></li>
<li><a href="../classes/EmberAddon.html">EmberAddon</a></li>
<li><a href="../classes/EmberApp.html">EmberApp</a></li>
<li><a href="../classes/HardwareInfo.html">HardwareInfo</a></li>
<li><a href="../classes/HistorySupportAddon.html">HistorySupportAddon</a></li>
<li><a href="../classes/Instrumentation.html">Instrumentation</a></li>
<li><a href="../classes/NodeModulesList.html">NodeModulesList</a></li>
<li><a href="../classes/NpmTask.html">NpmTask</a></li>
<li><a href="../classes/PackageInfo.html">PackageInfo</a></li>
<li><a href="../classes/PackageInfoCache.html">PackageInfoCache</a></li>
<li><a href="../classes/PerBundleAddonCache.html">PerBundleAddonCache</a></li>
<li><a href="../classes/Project.html">Project</a></li>
<li><a href="../classes/ServeFilesAddon.html">ServeFilesAddon</a></li>
<li><a href="../classes/TestsServerAddon.html">TestsServerAddon</a></li>
<li><a href="../classes/WatcherAddon.html">WatcherAddon</a></li>
<li><a href="../classes/WindowsSymlinkChecker.html">WindowsSymlinkChecker</a></li>
</ul>
</div>
</div>
<div id="sections" class="sidebox">
<div class="hd">
<h2 class="no-toc">Blueprint</h2>
</div>
<div class="bd">
<div><a href="#static-property-summary">Static Property Summary</a></div>
<div><a href="#static-method-summary">Static Method Summary</a></div>
<div><a href="#constructor-summary">Constructor Summary</a></div>
<div><a href="#property-summary">Property Summary</a></div>
<div><a href="#method-summary">Method Summary</a></div>
<div><a href="#static-public-properties">Static Public Properties</a></div>
<ul>
<li><a href="#props_defaultLookupPaths">defaultLookupPaths</a></li>
<li><a href="#props_ignoredFiles">ignoredFiles</a></li>
<li><a href="#props_ignoredUpdateFiles">ignoredUpdateFiles</a></li>
<li><a href="#props_renamedFiles">renamedFiles</a></li>
</ul>
<div><a href="#static-public-methods">Static Public Methods</a></div>
<ul>
<li><a href="#method_list">list</a></li>
<li><a href="#method_load">load</a></li>
<li><a href="#method_lookup">lookup</a></li>
</ul>
<div><a href="#public-constructors">Public Constructors</a></div>
<ul>
<li><a href="#method_Blueprint">Blueprint</a></li>
</ul>
<div><a href="#public-properties">Public Properties</a></div>
<ul>
<li><a href="#props_shouldTransformTypeScript">shouldTransformTypeScript</a></li>
</ul>
<div><a href="#private-properties">Private Properties</a></div>
<ul>
<li><a href="#props__actions">_actions</a></li>
</ul>
<div><a href="#public-methods">Public Methods</a></div>
<ul>
<li><a href="#method_addAddonsToProject">addAddonsToProject</a></li>
<li><a href="#method_addAddonToProject">addAddonToProject</a></li>
<li><a href="#method_addPackagesToProject">addPackagesToProject</a></li>
<li><a href="#method_addPackageToProject">addPackageToProject</a></li>
<li><a href="#method_afterInstall">afterInstall</a></li>
<li><a href="#method_afterUninstall">afterUninstall</a></li>
<li><a href="#method_beforeInstall">beforeInstall</a></li>
<li><a href="#method_beforeUninstall">beforeUninstall</a></li>
<li><a href="#method_buildFileInfo">buildFileInfo</a></li>
<li><a href="#method_fileMapTokens">fileMapTokens</a></li>
<li><a href="#method_files">files</a></li>
<li><a href="#method_filesPath">filesPath</a></li>
<li><a href="#method_generateFileMap">generateFileMap</a></li>
<li><a href="#method_insertIntoFile">insertIntoFile</a></li>
<li><a href="#method_install">install</a></li>
<li><a href="#method_isUpdate">isUpdate</a></li>
<li><a href="#method_locals">locals</a></li>
<li><a href="#method_lookupBlueprint">lookupBlueprint</a></li>
<li><a href="#method_mapFile">mapFile</a></li>
<li><a href="#method_normalizeEntityName">normalizeEntityName</a></li>
<li><a href="#method_processFiles">processFiles</a></li>
<li><a href="#method_processFilesForUninstall">processFilesForUninstall</a></li>
<li><a href="#method_removePackageFromProject">removePackageFromProject</a></li>
<li><a href="#method_removePackagesFromProject">removePackagesFromProject</a></li>
<li><a href="#method_srcPath">srcPath</a></li>
<li><a href="#method_taskFor">taskFor</a></li>
<li><a href="#method_uninstall">uninstall</a></li>
</ul>
<div><a href="#private-methods">Private Methods</a></div>
<ul>
<li><a href="#method__checkForNoMatch">_checkForNoMatch</a></li>
<li><a href="#method__checkForPod">_checkForPod</a></li>
<li><a href="#method__checkInRepoAddonExists">_checkInRepoAddonExists</a></li>
<li><a href="#method__commit">_commit</a></li>
<li><a href="#method__fileMapTokens">_fileMapTokens</a></li>
<li><a href="#method__generateFileMapVariables">_generateFileMapVariables</a></li>
<li><a href="#method__getFileInfos">_getFileInfos</a></li>
<li><a href="#method__getFilesForInstall">_getFilesForInstall</a></li>
<li><a href="#method__ignoreUpdateFiles">_ignoreUpdateFiles</a></li>
<li><a href="#method__locals">_locals</a></li>
<li><a href="#method__normalizeEntityName">_normalizeEntityName</a></li>
<li><a href="#method__process">_process</a></li>
<li><a href="#method__processOptions">_processOptions</a></li>
<li><a href="#method__writeFile">_writeFile</a></li>
<li><a href="#method__writeStatusToUI">_writeStatusToUI</a></li>
<li><a href="#method_convertToJS">convertToJS</a></li>
<li><a href="#method_dir">dir</a></li>
<li><a href="#method_gatherConfirmationMessages">gatherConfirmationMessages</a></li>
<li><a href="#method_generateLookupPaths">generateLookupPaths</a></li>
<li><a href="#method_getDetailedHelpPath">getDetailedHelpPath</a></li>
<li><a href="#method_hasPathToken">hasPathToken</a></li>
<li><a href="#method_isFilePath">isFilePath</a></li>
<li><a href="#method_isIgnored">isIgnored</a></li>
<li><a href="#method_isValidFile">isValidFile</a></li>
<li><a href="#method_markIdenticalToBeSkipped">markIdenticalToBeSkipped</a></li>
<li><a href="#method_markToBeRemoved">markToBeRemoved</a></li>
<li><a href="#method_prepareConfirm">prepareConfirm</a></li>
<li><a href="#method_shouldConvertToJS">shouldConvertToJS</a></li>
<li><a href="#method_supportsAddon">supportsAddon</a></li>
</ul>
</div>
</div>
<div class="version-info">
Version: 5.4.0-a905f346b9
</div>
</div>
<div id="main" class="yui3-u">
<div class="content"><div class="title">
<span class="source-link"><a href="../files/lib_models_blueprint.js.html#l29"><code>lib/models/blueprint.js:29</code></a></span>
<h1 class="class-name">Blueprint</h1>
</div>
<div class="class-extends">
<h4>Extends:</h4>
<div>CoreObject → Blueprint</div>
</div>
<div class="class-description"><p>A blueprint is a bundle of template files with optional install
logic.</p>
<p>Blueprints follow a simple structure. Let's take the built-in
<code>controller</code> blueprint as an example:</p>
<pre class="code prettyprint"><code>blueprints/controller
├── files
│ ├── app
│ │ └── __path__
│ │ └── __name__.js
└── index.js
blueprints/controller-test
├── files
│ └── tests
│ └── unit
│ └── controllers
│ └── __test__.js
└── index.js
</code></pre>
<h2>Files</h2>
<p><code>files</code> contains templates for the all the files to be
installed into the target directory.</p>
<p>The <code>__name__</code> token is subtituted with the dasherized
entity name at install time. For example, when the user
invokes <code>ember generate controller foo</code> then <code>__name__</code> becomes
<code>foo</code>. When the <code>--pod</code> flag is used, for example <code>ember generate controller foo --pod</code> then <code>__name__</code> becomes
<code>controller</code>.</p>
<p>The <code>__path__</code> token is substituted with the blueprint
name at install time. For example, when the user invokes
<code>ember generate controller foo</code> then <code>__path__</code> becomes
<code>controller</code>. When the <code>--pod</code> flag is used, for example
<code>ember generate controller foo --pod</code> then <code>__path__</code>
becomes <code>foo</code> (or <code><podModulePrefix>/foo</code> if the
podModulePrefix is defined). This token is primarily for
pod support, and is only necessary if the blueprint can be
used in pod structure. If the blueprint does not require pod
support, simply use the blueprint name instead of the
<code>__path__</code> token.</p>
<p>The <code>__test__</code> token is substituted with the dasherized
entity name and appended with <code>-test</code> at install time.
This token is primarily for pod support and only necessary
if the blueprint requires support for a pod structure. If
the blueprint does not require pod support, simply use the
<code>__name__</code> token instead.</p>
<h2>Template Variables (AKA Locals)</h2>
<p>Variables can be inserted into templates with
<code><%= someVariableName %></code>.</p>
<p>For example, the built-in <code>util</code> blueprint
<code>files/app/utils/__name__.js</code> looks like this:</p>
<pre class="code prettyprint"><code class="language-js">export default function <%= camelizedModuleName %>() {
return true;
}
</code></pre>
<p><code><%= camelizedModuleName %></code> is replaced with the real
value at install time.</p>
<p>The following template variables are provided by default:</p>
<ul>
<li><code>dasherizedPackageName</code></li>
<li><code>classifiedPackageName</code></li>
<li><code>dasherizedModuleName</code></li>
<li><code>classifiedModuleName</code></li>
<li><code>camelizedModuleName</code></li>
</ul>
<p><code>packageName</code> is the project name as found in the project's
<code>package.json</code>.</p>
<p><code>moduleName</code> is the name of the entity being generated.</p>
<p>The mechanism for providing custom template variables is
described below.</p>
<h2>Index.js</h2>
<p>Custom installation and uninstallation behavior can be added
by overriding the hooks documented below. <code>index.js</code> should
export a plain object, which will extend the prototype of the
<code>Blueprint</code> class. If needed, the original <code>Blueprint</code> prototype
can be accessed through the <code>_super</code> property.</p>
<pre class="code prettyprint"><code class="language-js">module.exports = {
locals(options) {
// Return custom template variables here.
return {};
},
normalizeEntityName(entityName) {
// Normalize and validate entity name here.
return entityName;
},
fileMapTokens(options) {
// Return custom tokens to be replaced in your files
return {
__token__(options){
// logic to determine value goes here
return 'value';
}
}
},
filesPath(options) {
return path.join(this.path, 'files');
},
beforeInstall(options) {},
afterInstall(options) {},
beforeUninstall(options) {},
afterUninstall(options) {}
};
</code></pre>
<h2>Blueprint Hooks</h2>
<h3>beforeInstall & beforeUninstall</h3>
<p>Called before any of the template files are processed and receives
the <code>options</code> and <code>locals</code> hashes as parameters. Typically used for
validating any additional command line options or for any asynchronous
setup that is needed. As an example, the <code>controller</code> blueprint validates
its <code>--type</code> option in this hook. If you need to run any asynchronous code,
wrap it in a promise and return that promise from these hooks. This will
ensure that your code is executed correctly.</p>
<h3>afterInstall & afterUninstall</h3>
<p>The <code>afterInstall</code> and <code>afterUninstall</code> hooks receives the same
arguments as <code>locals</code>. Use it to perform any custom work after the
files are processed. For example, the built-in <code>route</code> blueprint
uses these hooks to add and remove relevant route declarations in
<code>app/router.js</code>.</p>
<h3>Overriding Install</h3>
<p>If you don't want your blueprint to install the contents of
<code>files</code> you can override the <code>install</code> method. It receives the
same <code>options</code> object described above and must return a promise.
See the built-in <code>resource</code> blueprint for an example of this.</p>
</div>
<h2 id="static-method-summary">Static Method Summary</h2>
<table class="summary">
<thead>
<tr>
<th colspan="2">Static Public Methods</th>
</tr>
</thead>
<tbody>
<tr>
<td>
public
static
</td>
<td>
<div class="method-name ">
<a href="#method_list">list</a>([options]): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array" class="crosslink external" target="_blank">Array</a>
</div>
<div class="short-description">
</div>
</td>
</tr>
<tr>
<td>
public
static
</td>
<td>
<div class="method-name ">
<a href="#method_load">load</a>(blueprintPath, [blueprintOptions]): <a href="../classes/Blueprint.html" class="crosslink">Blueprint</a>
</div>
<div class="short-description">
<p>Loads a blueprint from given path.</p>
</div>
</td>
</tr>
<tr>
<td>
public
static
</td>
<td>
<div class="method-name ">
<a href="#method_lookup">lookup</a>(name, [options]): <a href="../classes/Blueprint.html" class="crosslink">Blueprint</a>
</div>
<div class="short-description">
</div>
</td>
</tr>
</tbody>
</table>
<h2 id="static-property-summary">Static Property Summary</h2>
<table class="summary">
<thead>
<tr>
<th colspan="2">Static Public Properties</th>
</tr>
</thead>
<tbody>
<tr>
<td>
public
static
</td>
<td>
<div class="property-name ">
<a href="#props_defaultLookupPaths">defaultLookupPaths</a>: Unknown
</div>
<div class="short-description">
</div>
</td>
</tr>
<tr>
<td>
public
static
</td>
<td>
<div class="property-name ">
<a href="#props_ignoredFiles">ignoredFiles</a>: Unknown
</div>
<div class="short-description">
</div>
</td>
</tr>
<tr>
<td>
public
static
</td>
<td>
<div class="property-name ">
<a href="#props_ignoredUpdateFiles">ignoredUpdateFiles</a>: Unknown
</div>
<div class="short-description">
</div>
</td>
</tr>
<tr>
<td>
public
static
</td>
<td>
<div class="property-name ">
<a href="#props_renamedFiles">renamedFiles</a>: Unknown
</div>
<div class="short-description">
<p>Files that are renamed when installed into the target directory. This allows including files in the blueprint that would have an effect on another process, such as a file named <code>.gitignore</code>.</p>
</div>
</td>
</tr>
</tbody>
</table>
<h2 id="constructor-summary">Constructor Summary</h2>
<table class="summary">
<thead>
<tr>
<th colspan="2">Public Constructors</th>
</tr>
</thead>
<tbody>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_Blueprint">Blueprint</a>([blueprintPath], [blueprintOptions])
</div>
<div class="short-description">
<p>A blueprint is a bundle of template files with optional install logic.</p>
</div>
</td>
</tr>
</tbody>
</table>
<h2 id="property-summary">Property Summary</h2>
<table class="summary">
<thead>
<tr>
<th colspan="2">Public Properties</th>
</tr>
</thead>
<tbody>
<tr>
<td>
public
</td>
<td>
<div class="property-name ">
<a href="#props_shouldTransformTypeScript">shouldTransformTypeScript</a>: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a>
</div>
<div class="short-description">
<p>Indicates whether or not a blueprint is a candidate for automatic transpilation from TS to JS. This property could be false in the case that the blueprint is written in JS and is not intended to work with TS at all, OR in the case that the blueprint is written in TS and the author does not intend to support transpilation to JS.</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="summary">
<thead>
<tr>
<th colspan="2">Private Properties</th>
</tr>
</thead>
<tbody>
<tr>
<td>
private
</td>
<td>
<div class="property-name ">
<a href="#props__actions">_actions</a>: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a>
</div>
<div class="short-description">
<p>Actions lookup</p>
</div>
</td>
</tr>
</tbody>
</table>
<h2 id="method-summary">Method Summary</h2>
<table class="summary">
<thead>
<tr>
<th colspan="2">Public Methods</th>
</tr>
</thead>
<tbody>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_addAddonsToProject">addAddonsToProject</a>(options): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="crosslink external" target="_blank">Promise</a>
</div>
<div class="short-description">
<p>Used to add multiple addons to the project's <code>package.json</code> and run their <code>defaultBlueprint</code> if they provide one.</p>
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_addAddonToProject">addAddonToProject</a>(options): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="crosslink external" target="_blank">Promise</a>
</div>
<div class="short-description">
<p>Used to add an addon to the project's <code>package.json</code> and run it's <code>defaultBlueprint</code> if it provides one.</p>
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_addPackagesToProject">addPackagesToProject</a>(packages): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="crosslink external" target="_blank">Promise</a>
</div>
<div class="short-description">
<p>Used to add multiple packages to the project's <code>package.json</code>.</p>
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_addPackageToProject">addPackageToProject</a>(packageName, target): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="crosslink external" target="_blank">Promise</a>
</div>
<div class="short-description">
<p>Used to add a package to the project's <code>package.json</code>.</p>
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_afterInstall">afterInstall</a>( ): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="crosslink external" target="_blank">Promise</a> | Null
</div>
<div class="short-description">
<p>Hook for running operations after install.</p>
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_afterUninstall">afterUninstall</a>( ): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="crosslink external" target="_blank">Promise</a> | Null
</div>
<div class="short-description">
<p>Hook for running operations after uninstall.</p>
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_beforeInstall">beforeInstall</a>( ): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="crosslink external" target="_blank">Promise</a> | Null
</div>
<div class="short-description">
<p>Hook for running operations before install.</p>
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_beforeUninstall">beforeUninstall</a>( ): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="crosslink external" target="_blank">Promise</a> | Null
</div>
<div class="short-description">
<p>Hook for running operations before uninstall.</p>
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_buildFileInfo">buildFileInfo</a>(destPath, templateVariables, file): FileInfo
</div>
<div class="short-description">
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_fileMapTokens">fileMapTokens</a>( ): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a> | Null
</div>
<div class="short-description">
<p>Hook to add additional or override existing fileMap tokens.</p>
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_files">files</a>(options): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array" class="crosslink external" target="_blank">Array</a>
</div>
<div class="short-description">
<p>Used to retrieve files for blueprint.</p>
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_filesPath">filesPath</a>(options): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a>
</div>
<div class="short-description">
<p>Hook to specify the path to the blueprint's files. By default this is <code>path.join(this.path, 'files)</code>.</p>
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_generateFileMap">generateFileMap</a>(fileMapVariables): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a>
</div>
<div class="short-description">
<p>Used to generate fileMap tokens for mapFile.</p>
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_insertIntoFile">insertIntoFile</a>(pathRelativeToProjectRoot, contentsToInsert, providedOptions): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="crosslink external" target="_blank">Promise</a>
</div>
<div class="short-description">
<p>Inserts the given content into a file. If the <code>contentsToInsert</code> string is already present in the current contents, the file will not be changed unless <code>force</code> option is passed.</p>
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_install">install</a>(options): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="crosslink external" target="_blank">Promise</a>
</div>
<div class="short-description">
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_isUpdate">isUpdate</a>( ): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a>
</div>
<div class="short-description">
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_locals">locals</a>(options): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="crosslink external" target="_blank">Promise</a> | Null
</div>
<div class="short-description">
<p>Hook for adding custom template variables.</p>
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_lookupBlueprint">lookupBlueprint</a>(dasherizedName): <a href="../classes/Blueprint.html" class="crosslink">Blueprint</a>
</div>
<div class="short-description">
<p>Used to retrieve a blueprint with the given name.</p>
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_mapFile">mapFile</a>(file, locals): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a>
</div>
<div class="short-description">
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_normalizeEntityName">normalizeEntityName</a>(entityName): Null
</div>
<div class="short-description">
<p>Hook for normalizing entity name</p>
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_processFiles">processFiles</a>(intoDir, templateVariables): Promise<FileInfo>
</div>
<div class="short-description">
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_processFilesForUninstall">processFilesForUninstall</a>(intoDir, templateVariables)
</div>
<div class="short-description">
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_removePackageFromProject">removePackageFromProject</a>(packageName): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="crosslink external" target="_blank">Promise</a>
</div>
<div class="short-description">
<p>Used to remove a package from the project's <code>package.json</code>.</p>
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_removePackagesFromProject">removePackagesFromProject</a>(packages): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="crosslink external" target="_blank">Promise</a>
</div>
<div class="short-description">
<p>Used to remove multiple packages from the project's <code>package.json</code>.</p>
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_srcPath">srcPath</a>(file): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a>
</div>
<div class="short-description">
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_taskFor">taskFor</a>(dasherizedName)
</div>
<div class="short-description">
<p>Used to retrieve a task with the given name. Passes the new task the standard information available (like <code>ui</code>, <code>project</code>, etc).</p>
</div>
</td>
</tr>
<tr>
<td>
public
</td>
<td>
<div class="method-name ">
<a href="#method_uninstall">uninstall</a>(options): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="crosslink external" target="_blank">Promise</a>
</div>
<div class="short-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="summary">
<thead>
<tr>
<th colspan="2">Private Methods</th>
</tr>
</thead>
<tbody>
<tr>
<td>
private
</td>
<td>
<div class="method-name ">
<a href="#method__checkForNoMatch">_checkForNoMatch</a>(fileInfos, rawArgs)
</div>
<div class="short-description">
</div>
</td>
</tr>
<tr>
<td>
private
</td>
<td>
<div class="method-name ">
<a href="#method__checkForPod">_checkForPod</a>( )