File tree Expand file tree Collapse file tree
tests/integration/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <template >
2+ {{ yield }}
3+ </template >
Original file line number Diff line number Diff line change 1+ import { module , test } from ' qunit' ;
2+ import { render } from ' @ember/test-helpers' ;
3+ import { setupRenderingTest } from ' ember-qunit' ;
4+
5+ import <%= componentName %> from ' ../../../src/components/<%= name %>' ;
6+
7+ module (' Integration | Component | <%= name %>' , function (hooks ) {
8+ setupRenderingTest (hooks);
9+
10+ test (' it renders' , async function (assert ) {
11+ await render (<template ><%= selfCloseComponent(componentName) %></template >);
12+
13+ assert .dom ().hasText (' ' );
14+
15+ // Template block usage:
16+ await render (<template >
17+ <%= openComponent(componentName) %>
18+ template block text
19+ <%= closeComponent(componentName) %>
20+ </template >);
21+
22+ assert .dom ().hasText (' template block text' );
23+ });
24+ });
Original file line number Diff line number Diff line change 1+ const stringUtil = require ( 'ember-cli-string-utils' ) ;
2+
3+ function invocationFor ( options ) {
4+ let parts = options . entity . name . split ( '/' ) ;
5+ return parts . map ( ( p ) => stringUtil . classify ( p ) ) . join ( '::' ) ;
6+ }
7+
8+
9+ module . exports = {
10+ locals : function ( options ) {
11+ let templateInvocation = invocationFor ( options ) ;
12+ let componentName = templateInvocation ;
13+ let openComponent = ( descriptor ) => `<${ descriptor } >` ;
14+ let closeComponent = ( descriptor ) => `</${ descriptor } >` ;
15+ let selfCloseComponent = ( descriptor ) => `<${ descriptor } />` ;
16+
17+ return {
18+ name : options . project . name ( ) ,
19+ componentName,
20+ openComponent,
21+ closeComponent,
22+ selfCloseComponent,
23+ } ;
24+ }
25+ }
Original file line number Diff line number Diff line change 3939 "@babel/eslint-parser" : " ^7.25.1<% if (typescript) { %>" ,
4040 "@babel/plugin-transform-typescript" : " ^7.25.2<% } %>" ,
4141 "@babel/runtime" : " ^7.25.6" ,
42+ "@ember/addon-blueprint" : " github:ember-cli/ember-addon-blueprint#blueprints" ,
4243 "@ember/app-tsconfig" : " ^1.0.0" ,
4344 "@ember/library-tsconfig" : " ^1.0.0" ,
4445 "@ember/test-helpers" : " ^5.2.1" ,
6869 "eslint-plugin-import" : " ^2.31.0" ,
6970 "eslint-plugin-n" : " ^17.15.1" ,
7071 "globals" : " ^16.1.0" ,
72+ "layer-gen" : " ^0.2.0" ,
7173 "prettier" : " ^3.4.2" ,
7274 "prettier-plugin-ember-template-tag" : " ^2.0.4" ,
7375 "publint" : " ^0.3.16" ,
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ const replacers = {
1717} ;
1818
1919module . exports = {
20+ name : "face" ,
2021 description,
2122
2223 fileMapTokens ( options ) {
Original file line number Diff line number Diff line change 33 "version" : " 0.17.1" ,
44 "description" : " Blueprint for scaffolding ember v2 addons" ,
55 "keywords" : [
6- " ember-blueprint"
6+ " ember-blueprint" ,
7+ " ember-addon"
78 ],
89 "repository" : {
910 "type" : " git" ,
1718 "new:addon" : " rm -rf my-addon; pnpm dlx ember-cli@latest addon my-addon --blueprint ."
1819 },
1920 "dependencies" : {
21+ "ember-cli-string-utils" : " ^1.1.0" ,
2022 "sort-package-json" : " ^3.4.0"
2123 },
2224 "devDependencies" : {
2325 "prettier" : " ^3.5.3" ,
2426 "prettier-plugin-ember-template-tag" : " 2.1.0" ,
2527 "release-plan" : " ^0.17.4"
2628 },
27- "packageManager" : " pnpm@10.6.5"
29+ "packageManager" : " pnpm@10.6.5" ,
30+ "blueprints" : {
31+ "component" : " ./blueprints/component"
32+ }
2833}
You can’t perform that action at this time.
0 commit comments