Skip to content

Commit c2d7a83

Browse files
authored
Support gts/gjs in blueprint (#1013)
* Support gts/gts in blueprint * Update blueprint
1 parent ab22279 commit c2d7a83

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

  • ember-basic-dropdown/blueprints/ember-basic-dropdown

ember-basic-dropdown/blueprints/ember-basic-dropdown/index.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ module.exports = {
4949
if (!fs.existsSync(file)) {
5050
file = path.join('app', `app.ts`);
5151
}
52+
if (!fs.existsSync(file)) {
53+
file = path.join('app', `app.gts`);
54+
}
55+
if (!fs.existsSync(file)) {
56+
file = path.join('app', `app.gjs`);
57+
}
5258
if (fs.existsSync(file)) {
5359
this.ui.writeLine(`Added import statement to ${file}`);
5460
promises.push(
@@ -71,6 +77,24 @@ module.exports = {
7177
{},
7278
),
7379
);
80+
} else {
81+
applicationFile = path.join(templatePath, `application.gts`);
82+
if (!fs.existsSync(file)) {
83+
file = path.join(templatePath, `application.gjs`);
84+
}
85+
if (fs.existsSync(applicationFile)) {
86+
this.ui.writeLine(`Added wormhole statement to ${applicationFile}`);
87+
promises.push(
88+
this.insertIntoFile(applicationFile, `import BasicDropdownWormhole from 'ember-basic-dropdown/components/basic-dropdown-wormhole';${EOL}`, {
89+
before: `<template>`,
90+
}),
91+
);
92+
promises.push(
93+
this.insertIntoFile(applicationFile, `${EOL} <BasicDropdownWormhole />`, {
94+
after: `<template>`,
95+
}),
96+
);
97+
}
7498
}
7599

76100
return Promise.all(promises);

0 commit comments

Comments
 (0)