Skip to content

Commit

Permalink
chore(build): build config
Browse files Browse the repository at this point in the history
  • Loading branch information
langpavel committed Nov 20, 2018
1 parent 42a5c8d commit 8b1fdf5
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 42 deletions.
33 changes: 18 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@the-gear/pg-query-builder",
"version": "0.0.0-development",
"version": "0.0.1",
"description": "",
"keywords": [
"pg",
Expand All @@ -23,20 +23,8 @@
"engines": {
"node": ">=8.0.0"
},
"scripts": {
"lint": "tslint --project tsconfig.json -t codeFrame 'src/**/*.ts' 'test/**/*.ts'",
"prebuild": "rimraf dist",
"build": "tsc --module commonjs && rollup -c rollup.config.ts && typedoc --out docs --target es6 --theme minimal --mode file src",
"start": "rollup -c rollup.config.ts -w",
"test": "jest",
"test:watch": "jest --watch",
"test:prod": "npm run lint && npm run test -- --coverage --no-cache",
"deploy-docs": "ts-node tools/gh-pages-publish",
"report-coverage": "cat ./coverage/lcov.info | coveralls",
"commit": "git-cz",
"semantic-release": "semantic-release",
"semantic-release-prepare": "ts-node tools/semantic-release-prepare",
"travis-deploy-once": "travis-deploy-once"
"publishConfig": {
"access": "public"
},
"lint-staged": {
"{src,test}/**/*.ts": [
Expand Down Expand Up @@ -123,5 +111,20 @@
"pre-commit": "lint-staged",
"pre-push": "npm run test:prod && npm run build"
}
},
"scripts": {
"lint": "tslint --project tsconfig.json -t codeFrame 'src/**/*.ts' 'test/**/*.ts'",
"prebuild": "rimraf dist",
"build": "tsc --module commonjs && rollup -c rollup.config.ts && typedoc --out docs --target es6 --theme minimal --mode file src",
"start": "rollup -c rollup.config.ts -w",
"test": "jest",
"test:watch": "jest --watch",
"test:prod": "npm run lint && npm run test -- --coverage --no-cache",
"deploy-docs": "ts-node tools/gh-pages-publish",
"report-coverage": "cat ./coverage/lcov.info | coveralls",
"commit": "git-cz",
"semantic-release": "semantic-release",
"semantic-release-prepare": "ts-node tools/semantic-release-prepare",
"travis-deploy-once": "travis-deploy-once"
}
}
69 changes: 42 additions & 27 deletions tools/semantic-release-prepare.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,54 @@
const path = require('path')
const { fork } = require('child_process')
const colors = require('colors')
const path = require('path');
const { fork } = require('child_process');
const colors = require('colors');

const { readFileSync, writeFileSync } = require('fs')
const pkg = JSON.parse(readFileSync(path.resolve(__dirname, '..', 'package.json')))
const { readFileSync, writeFileSync } = require('fs');
const pkg = JSON.parse(
readFileSync(path.resolve(__dirname, '..', 'package.json')),
);

pkg.scripts.prepush = 'npm run test:prod && npm run build'
pkg.scripts.commitmsg = 'commitlint -E GIT_PARAMS'
pkg.scripts.prepush = 'npm run test:prod && npm run build';
pkg.scripts.commitmsg = 'commitlint -E GIT_PARAMS';

writeFileSync(path.resolve(__dirname, '..', 'package.json'), JSON.stringify(pkg, null, 2))
writeFileSync(
path.resolve(__dirname, '..', 'package.json'),
JSON.stringify(pkg, null, 2),
);

// Call husky to set up the hooks
fork(path.resolve(__dirname, '..', 'node_modules', 'husky', 'bin', 'install'))
fork(path.resolve(__dirname, '..', 'node_modules', 'husky', 'bin', 'install'));

console.log()
console.log(colors.green('Done!!'))
console.log()
console.log();
console.log(colors.green('Done!!'));
console.log();

if (pkg.repository.url.trim()) {
console.log(colors.cyan('Now run:'))
console.log(colors.cyan(' npm install -g semantic-release-cli'))
console.log(colors.cyan(' semantic-release-cli setup'))
console.log()
console.log(colors.cyan('Important! Answer NO to "Generate travis.yml" question'))
console.log()
console.log(colors.cyan('Now run:'));
console.log(colors.cyan(' npm install -g semantic-release-cli'));
console.log(colors.cyan(' semantic-release-cli setup'));
console.log();
console.log(
colors.gray('Note: Make sure "repository.url" in your package.json is correct before')
)
colors.cyan('Important! Answer NO to "Generate travis.yml" question'),
);
console.log();
console.log(
colors.gray(
'Note: Make sure "repository.url" in your package.json is correct before',
),
);
} else {
console.log(colors.red('First you need to set the "repository.url" property in package.json'))
console.log(colors.cyan('Then run:'))
console.log(colors.cyan(' npm install -g semantic-release-cli'))
console.log(colors.cyan(' semantic-release-cli setup'))
console.log()
console.log(colors.cyan('Important! Answer NO to "Generate travis.yml" question'))
console.log(
colors.red(
'First you need to set the "repository.url" property in package.json',
),
);
console.log(colors.cyan('Then run:'));
console.log(colors.cyan(' npm install -g semantic-release-cli'));
console.log(colors.cyan(' semantic-release-cli setup'));
console.log();
console.log(
colors.cyan('Important! Answer NO to "Generate travis.yml" question'),
);
}

console.log()
console.log();

0 comments on commit 8b1fdf5

Please sign in to comment.