Skip to content

Commit

Permalink
Merge pull request #105 from DXHeroes/renovate/pin-dependencies
Browse files Browse the repository at this point in the history
fix(deps): pin dependencies
  • Loading branch information
prokopsimek authored Oct 29, 2019
2 parents 0d80eec + bad93a0 commit e89155c
Show file tree
Hide file tree
Showing 6 changed files with 181 additions and 167 deletions.
106 changes: 53 additions & 53 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,61 +25,61 @@
"access": "public"
},
"dependencies": {
"@oclif/command": "^1",
"@oclif/config": "^1",
"@oclif/plugin-help": "^2",
"@octokit/rest": "^16.34.0",
"@types/eslint": "^6.1.3",
"@types/js-yaml": "^3.12.1",
"axios": "^0.19.0",
"bitbucket": "^1.15.1",
"colors": "^1.4.0",
"cross-env": "^6.0.3",
"debug": "^4.1.1",
"eslint": "^6.5.1",
"eslint-plugin-eslint-plugin": "^2.1.0",
"git-url-parse": "^11.1.2",
"glob": "^7.1.5",
"inversify": "^5.0.1",
"js-yaml": "^3.13.1",
"lodash": "^4.17.15",
"memfs": "^2.15.5",
"node-filter-async": "^1.1.3",
"npm-check-updates": "^3.1.25",
"oclif": "^1.14.1",
"reflect-metadata": "^0.1.13",
"semver": "^6.3.0",
"simple-git": "^1.126.0",
"toposort": "^2.0.2",
"ts-node": "^8",
"tslib": "^1",
"typescript": "^3.6",
"update-notifier": "^3.0.1"
"@oclif/command": "1.5.15",
"@oclif/config": "1.13.0",
"@oclif/plugin-help": "2.2.0",
"@octokit/rest": "16.34.0",
"@types/eslint": "6.1.3",
"@types/js-yaml": "3.12.1",
"axios": "0.19.0",
"bitbucket": "1.15.1",
"colors": "1.4.0",
"cross-env": "6.0.3",
"debug": "4.1.1",
"eslint": "6.5.1",
"eslint-plugin-eslint-plugin": "2.1.0",
"git-url-parse": "11.1.2",
"glob": "7.1.5",
"inversify": "5.0.1",
"js-yaml": "3.13.1",
"lodash": "4.17.15",
"memfs": "2.15.5",
"node-filter-async": "1.1.3",
"npm-check-updates": "3.1.25",
"oclif": "1.14.1",
"reflect-metadata": "0.1.13",
"semver": "6.3.0",
"simple-git": "1.126.0",
"toposort": "2.0.2",
"ts-node": "8.3.0",
"tslib": "1.10.0",
"typescript": "3.6.4",
"update-notifier": "3.0.1"
},
"devDependencies": {
"@semantic-release/changelog": "^3.0.4",
"@semantic-release/git": "^7.0.16",
"@types/debug": "^4.1.5",
"@types/git-url-parse": "^9.0.0",
"@types/glob": "^7.1.1",
"@types/jest": "^24.0.19",
"@types/lodash": "^4.14.144",
"@types/node": "^12",
"@types/rimraf": "^2.0.2",
"@types/semver": "^6.0.2",
"@types/toposort": "^2.0.3",
"@types/update-notifier": "^2.5.0",
"@typescript-eslint/eslint-plugin": "^2.5.0",
"@typescript-eslint/parser": "^2.5.0",
"codecov": "^3.6.1",
"eslint-config-prettier": "^6.4.0",
"eslint-plugin-prettier": "^3.1.1",
"jest": "^24.9.0",
"nock": "^11.6.0",
"prettier": "^1.18.2",
"rimraf": "^3.0.0",
"semantic-release": "^15.13.27",
"ts-jest": "^24.1.0"
"@semantic-release/changelog": "3.0.4",
"@semantic-release/git": "7.0.16",
"@types/debug": "4.1.5",
"@types/git-url-parse": "9.0.0",
"@types/glob": "7.1.1",
"@types/jest": "24.0.19",
"@types/lodash": "4.14.144",
"@types/node": "12.6.6",
"@types/rimraf": "2.0.2",
"@types/semver": "6.0.2",
"@types/toposort": "2.0.3",
"@types/update-notifier": "2.5.0",
"@typescript-eslint/eslint-plugin": "2.5.0",
"@typescript-eslint/parser": "2.5.0",
"codecov": "3.6.1",
"eslint-config-prettier": "6.4.0",
"eslint-plugin-prettier": "3.1.1",
"jest": "24.9.0",
"nock": "11.6.0",
"prettier": "1.18.2",
"rimraf": "3.0.0",
"semantic-release": "15.13.27",
"ts-jest": "24.1.0"
},
"engineStrict": true,
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion src/reporters/CLIReporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class CLIReporter implements IReporter {

for (const cwp of componentsWithPractices) {
if (cwp.component.repositoryPath) {
repoName = GitServiceUtils.getUrlToRepo(cwp.component.repositoryPath, cwp.component.path.replace(componentsSharedSubpath, ''));
repoName = ReporterUtils.getPathOrRepoUrl(cwp.component.repositoryPath, cwp.component.path.replace(componentsSharedSubpath, ''));
} else {
repoName = cwp.component.path;
}
Expand Down
12 changes: 12 additions & 0 deletions src/reporters/ReporterUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,20 @@ import _ from 'lodash';
import { ProjectComponent, PracticeEvaluationResult, PracticeImpact, PracticeMetadata } from '../model';
import { DXScoreResult, DXScoreOverallResult } from './model';
import { assertNever } from '../lib/assertNever';
import { GitServiceUtils } from '../services/git/GitServiceUtils';
import gitUrlParse from 'git-url-parse';

export class ReporterUtils {
static getPathOrRepoUrl = (url: string, path?: string | undefined, branch = 'master') => {
const parsedUrl = gitUrlParse(url);

if (parsedUrl.protocol === 'file') {
return url;
}

return GitServiceUtils.getUrlToRepo(url, path, branch);
};

static getComponentsWithPractices(practicesAndComponents: PracticeWithContextForReporter[]) {
const result: {
component: ProjectComponent;
Expand Down
7 changes: 4 additions & 3 deletions src/services/git/GitServiceUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ export class GitServiceUtils {
static getUrlToRepo = (url: string, path?: string | undefined, branch = 'master') => {
const parsedUrl = gitUrlParse(url);

let completeUrl = parsedUrl.toString('https');
let completeUrl = `${parsedUrl.protocol}://${parsedUrl.source}/${parsedUrl.owner}/${parsedUrl.name}`;
const sourceUrl = <GitService | null>parsedUrl.source;

if (path) {
completeUrl += GitServiceUtils.getPath(<GitService>parsedUrl.source, path, branch || parsedUrl.ref);
if (path && sourceUrl) {
completeUrl += GitServiceUtils.getPath(sourceUrl, path, branch || parsedUrl.ref);
}

return completeUrl;
Expand Down
5 changes: 3 additions & 2 deletions test/factories/PracticeWithContextFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ import {
} from '../../src/model';
import { DeepPartial } from '../../src/lib/deepPartial';
import _ from 'lodash';
import path from 'path';

export const practiceWithContextFactory = (
practiceWithContext: DeepPartial<PracticeWithContextForReporter> = {},
): PracticeWithContextForReporter => {
return _.merge(
{
component: {
repositoryPath: './',
path: './',
repositoryPath: path.resolve('./'),
path: path.resolve('./'),
language: ProgrammingLanguage.JavaScript,
framework: ProjectComponentFramework.UNKNOWN,
type: ProjectComponentType.UNKNOWN,
Expand Down
Loading

0 comments on commit e89155c

Please sign in to comment.