Skip to content
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

Prepare for 0.14.0 #187

Merged
merged 1 commit into from
Mar 21, 2017
Merged
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: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

// Add your own contribution below

### 0.14.0

* TypeScript Dangerfiles are now support in Danger - orta

We use TypeScript in Danger, and a lot of my work in Artsy now uses TypeScript (see: [JS2017 at Artsy](http://artsy.github.io/blog/2017/02/05/Front-end-JavaScript-at-Artsy-2017/#TypeScrip1t)), so I wanted to
Expand Down
20 changes: 17 additions & 3 deletions dangerfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,16 @@ if (currentDTS !== savedDTS) {
fail(`${message}<br/><i>${idea}</i>`)
}

const checkForRelease = (packageDiff) => {
if (packageDiff.version) {
markdown(":tada:")
}
}

// Initial stab at starting a new dependency information rule
// Just starting simple by showing `yarn why {dep}` for now

schedule(async () => {
const packageDiff = await danger.git.JSONDiffForFile("package.json")
const checkForNewDependencies = (packageDiff) => {
if (packageDiff.dependencies) {
if (packageDiff.dependencies.added.length) {
const newDependencies = packageDiff.dependencies.added as string[]
Expand All @@ -67,8 +72,10 @@ ${messages.join("\n\n - ")}
})
}
}
}

// Ensure a lockfile change if deps/devDeps changes
// Ensure a lockfile change if deps/devDeps changes
const checkForLockfileDiff = (packageDiff) => {
if (packageDiff.dependencies || packageDiff.devDependencies) {
const lockfileChanged = includes(danger.git.modified_files, "yarn.lock")
if (!lockfileChanged) {
Expand All @@ -77,6 +84,13 @@ ${messages.join("\n\n - ")}
warn(`${message}<br/><i>${idea}</i>`)
}
}
}

schedule(async () => {
const packageDiff = await danger.git.JSONDiffForFile("package.json")
checkForRelease(packageDiff)
checkForNewDependencies(packageDiff)
checkForLockfileDiff(packageDiff)
})

// Always ensure we name all CI providers in the README
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "danger",
"version": "0.13.0",
"version": "0.14.0",
"description": "Unit tests for Team Culture",
"main": "distribution/danger.js",
"typings": "distribution/danger.d.ts",
Expand Down