Skip to content

Commit

Permalink
feat: generate renovate.json
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfbecker committed May 1, 2019
1 parent 1f6a16e commit e8134e3
Show file tree
Hide file tree
Showing 4 changed files with 26,637 additions and 16 deletions.
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@
"scripts": {
"tslint": "tslint -p tsconfig.json -c tslint.json 'src/**/*.ts'",
"build": "tsc -p .",
"package-schema": "download http://json.schemastore.org/package | json2ts | prettier --parser typescript > src/package.ts",
"travis-schema": "download http://json.schemastore.org/travis | json2ts | prettier --parser typescript > src/travis.ts",
"tsconfig-schema": "download http://json.schemastore.org/tsconfig | json2ts | prettier --parser typescript > src/tsconfig.ts",
"tslint-schema": "download http://json.schemastore.org/tslint | json2ts | prettier --parser typescript > src/tslint.ts",
"package-schema": "download http://json.schemastore.org/package | json2ts | prettier --parser typescript > src/package-schema.ts",
"travis-schema": "download http://json.schemastore.org/travis | json2ts | prettier --parser typescript > src/travis-schema.ts",
"tsconfig-schema": "download http://json.schemastore.org/tsconfig | json2ts | prettier --parser typescript > src/tsconfig-schema.ts",
"tslint-schema": "download http://json.schemastore.org/tslint | json2ts | prettier --parser typescript > src/tslint-schema.ts",
"renovate-schema": "download http://json.schemastore.org/renovate | json2ts | prettier --parser typescript > src/renovate-schema.ts",
"prettier": "prettier '**/{*.{js?(on),ts?(x),scss},.*.js?(on)}' --write --list-different",
"prettier-check": "npm run prettier -- --write=false",
"semantic-release": "semantic-release"
Expand Down Expand Up @@ -65,6 +66,7 @@
"@types/js-yaml": "3.12.1",
"@types/mz": "0.0.32",
"@types/node": "11.13.8",
"download-cli": "^1.1.1",
"husky": "^2.1.0",
"json-schema-to-typescript": "^5.5.0",
"prettier": "^1.17.0",
Expand Down
8 changes: 8 additions & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { CodeCovRepo, createCodeCovClient, getCodeCovBadge } from './codecov'
import { createGitHubClient } from './github'
import { JsonSchemaForNpmPackageJsonFiles } from './package-schema'
import * as prompt from './prompt'
import { JsonSchemaForRenovateConfigFilesHttpsRenovatebotCom } from './renovate-schema'
import { createTravisClient, initTravis } from './travis'
import { JsonSchemaForTheTypeScriptCompilersConfigurationFile } from './tsconfig-schema'
import { JsonSchemaForTheTsLintConfigurationFiles } from './tslint-schema'
Expand Down Expand Up @@ -230,6 +231,13 @@ async function main(): Promise<void> {
['dist/', 'node_modules/', ...(hasTests ? ['coverage/', '.nyc_output/'] : []), ''].join('\n')
)

console.log('📄 Adding renovate.json')
const renovateJson: JsonSchemaForRenovateConfigFilesHttpsRenovatebotCom = {
extends: ['github>sourcegraph/renovate-config'],
semanticCommits: true,
}
await writeFile('renovate.json', JSON.stringify(renovateJson, null, 2))

let packageJson: JsonSchemaForNpmPackageJsonFiles
try {
packageJson = JSON.parse(await readFile('package.json', 'utf-8'))
Expand Down
Loading

0 comments on commit e8134e3

Please sign in to comment.