Skip to content

Commit

Permalink
feat: add ember-no-implicit-this-codemod
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelly Selden committed Jan 15, 2020
1 parent b8c19cf commit 964185a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/addon/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,12 @@
},
"nodeVersionRange": ">=8",
"commands": ["github:ember-codemods/ember-data-codemod globals-to-ember-data-imports app/**/*.js"]
},
"ember-no-implicit-this-codemod": {
"versionRanges": {
"ember-source": ">=3.12"
},
"nodeVersionRange": ">=8",
"script": "let ps = execa.command(\"ember s\", { stderr: \"inherit\", preferLocal: true }); ps.stdout.pipe(process.stdout); try { let url = await new Promise((resolve, reject) => { ps.stdout.on(\"data\", data => { let str = data.toString(); let matches = str.match(/^Build successful \\(\\d+ms\\) – Serving on (.*)$/m); if (matches) { resolve(matches[1]); } }); ps.once(\"error\", reject); ps.once(\"exit\", reject); }); await execa.command(`npx ember-no-implicit-this-codemod ${url} app/`, { stdio: \"inherit\" }); } finally { if (!ps.exitCode) { ps.kill(); await new Promise(resolve => { ps.once(\"exit\", resolve); }); } }"
}
}
7 changes: 7 additions & 0 deletions packages/app/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,12 @@
},
"nodeVersionRange": ">=8",
"commands": ["github:ember-codemods/ember-data-codemod globals-to-ember-data-imports app/**/*.js"]
},
"ember-no-implicit-this-codemod": {
"versionRanges": {
"ember-source": ">=3.12"
},
"nodeVersionRange": ">=8",
"script": "let ps = execa.command(\"ember s\", { stderr: \"inherit\", preferLocal: true }); ps.stdout.pipe(process.stdout); try { let url = await new Promise((resolve, reject) => { ps.stdout.on(\"data\", data => { let str = data.toString(); let matches = str.match(/^Build successful \\(\\d+ms\\) – Serving on (.*)$/m); if (matches) { resolve(matches[1]); } }); ps.once(\"error\", reject); ps.once(\"exit\", reject); }); await execa.command(`npx ember-no-implicit-this-codemod ${url} app/`, { stdio: \"inherit\" }); } finally { if (!ps.exitCode) { ps.kill(); await new Promise(resolve => { ps.once(\"exit\", resolve); }); } }"
}
}

0 comments on commit 964185a

Please sign in to comment.