Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/addon/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"ember-source": ">=3.10.0-beta.1"
},
"nodeVersionRange": ">=8",
"commands" : ["ember-angle-brackets-codemod@2 angle-brackets ./app/templates"]
"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-angle-brackets-codemod@3 ${url} app/`, { stdio: \"inherit\" }); } finally { if (!ps.exitCode) { ps.kill(); await new Promise(resolve => { ps.once(\"exit\", resolve); }); } }"
},
"fpe-on-codemod": {
"versionRanges": {
Expand Down
2 changes: 1 addition & 1 deletion packages/app/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"ember-source": ">=3.10.0-beta.1"
},
"nodeVersionRange": ">=8",
"commands" : ["ember-angle-brackets-codemod@2 angle-brackets ./app/templates"]
"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-angle-brackets-codemod@3 ${url} app/`, { stdio: \"inherit\" }); } finally { if (!ps.exitCode) { ps.kill(); await new Promise(resolve => { ps.once(\"exit\", resolve); }); } }"
},
"fpe-on-codemod": {
"versionRanges": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

{{outlet}}

<Ui::Button @text="Click me" />
<FooBar />
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{yield}}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

{{outlet}}

{{ui/button text="Click me"}}
{{foo-bar}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{yield}}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

{{outlet}}

<Ui::Button @text="Click me" />
<FooBar />
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{yield}}
10 changes: 10 additions & 0 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const {
assertNoUnstaged,
assertCodemodRan
} = require('./helpers/assertions');
const run = require('ember-cli-update/src/run');

let manifest;
let fixturesPath;
Expand Down Expand Up @@ -121,6 +122,10 @@ describe('runs codemods', function() {
} = await merge({
async beforeMerge() {
await _merge('local', tmpPath);

if (manifest[codemod].script) {
await run('npm install', { cwd: tmpPath });
}
}
});

Expand Down Expand Up @@ -148,9 +153,14 @@ describe('runs codemods', function() {
assertNoUnstaged(status);
assertCodemodRan(status);

await fs.remove(path.join(tmpPath, 'package-lock.json'));

// file is indeterminent between OS's, so ignore
await fs.remove(path.join(tmpPath, 'MODULE_REPORT.md'));

// remove dist and node_modules before fixture compare
await run('git clean -fdX', { cwd: tmpPath });

let nodeVersion = 'latest-node';
if (process.env.NODE_LTS) {
nodeVersion = 'min-node';
Expand Down