Skip to content

Updated dependencies so the codemod would work with https://github.com/fossasia/open-event-frontend #230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
11 changes: 7 additions & 4 deletions __tests__/bin-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const path = require('path');
const fs = require('fs-extra');
const cp = require('child_process');
const tmp = require('tmp');
const chalk = require("chalk");


const originalCwd = process.cwd();

Expand Down Expand Up @@ -62,7 +64,7 @@ describe('bin acceptance', function() {

expect(exitCode).not.toEqual(0);

expect(stderr).toEqual(`It doesn't look like you're inside an Ember app. I couldn't find a package.json at ${tmpPackageJson}\n`);
expect(stderr).toContain(`It doesn't look like you're inside an Ember app. I couldn't find a package.json at ${tmpPackageJson}`);
});
});

Expand Down Expand Up @@ -116,7 +118,7 @@ describe('bin acceptance', function() {

expect(exitCode).toEqual(0);

expect(stdout).toMatch('Done! All uses of the Ember global have been updated.\n');
expect(stdout).toContain('Done! All uses of the Ember global have been updated.');

expect(fs.readFileSync(tmpFile, 'utf8')).toEqual(fs.readFileSync(outputFile, 'utf8'));
});
Expand Down Expand Up @@ -144,8 +146,8 @@ describe('bin acceptance', function() {

expect(exitCode).toEqual(0);

expect(stdout).toMatch('Done! Some files could not be upgraded automatically. See MODULE_REPORT.md.\n');

expect(stdout).toMatch(chalk.yellow("\nDone! Some files could not be upgraded automatically. See " + chalk.blue("MODULE_REPORT.md") + "."));
let expectedOutput = fs.readFileSync(path.join(__dirname, 'expected', 'MODULE_REPORT.md'), 'utf8')
.replace(/\//, path.sep)
.replace(/\r?\n/g, require('os').EOL);
Expand Down Expand Up @@ -180,7 +182,8 @@ describe('bin acceptance', function() {

expect(exitCode).toEqual(0);

expect(stdout).toMatch('Done! All uses of the Ember global have been updated.\n');
expect(stdout).toContain('Done! All uses of the Ember global have been updated.');


expect(fs.readFileSync(tmpFile, 'utf8')).toEqual(fs.readFileSync(outputFile, 'utf8'));
});
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
},
"dependencies": {
"chalk": "^2.4.2",
"ember-rfc176-data": "^0.3.16",
"ember-rfc176-data": "^0.3.18",
"execa": "~1.0.0",
"glob": "^7.1.6",
"jscodeshift": "^0.3.29"
"jscodeshift": "^17.0.0"
},
"devDependencies": {
"fs-extra": "^8.1.0",
"jest": "^24.9.0",
"tmp": "^0.1.0"
"fs-extra": "^11.2.0",
"jest": "^29.7.0",
"tmp": "^0.2.3"
},
"engines": {
"node": "6.* || >= 8.*"
Expand Down
2 changes: 1 addition & 1 deletion transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function transform(file, api/*, options*/) {

const lineTerminator = source.indexOf('\r\n') > -1 ? '\r\n' : '\n';

let j = api.jscodeshift;
let j = api.jscodeshift.withParser('ts');

let root = j(source);

Expand Down
Loading