-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from barinbritva/rewrite-tasks
Rewrite tasks from bash to js.
- Loading branch information
Showing
28 changed files
with
436 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"extends": "standard-with-typescript", | ||
"parserOptions": { | ||
"project": "./tsconfig.json" | ||
"project": "./tsconfig.json", | ||
"createDefaultProgram": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
"author": { | ||
"name": "Barin Britva", | ||
"email": "[email protected]", | ||
"url": "https://barinbritva.ru" | ||
"url": "https://barinbritva.com" | ||
}, | ||
"license": "MIT", | ||
"main": "./dist/index.js", | ||
|
@@ -32,12 +32,13 @@ | |
"bin": { | ||
"init-typescript-app": "./dist/cli.js" | ||
}, | ||
"types": "./dist/__types__", | ||
"scripts": { | ||
"build": "./tasks/build.sh", | ||
"build:dev": "./tasks/build.sh -d", | ||
"build": "ts-node ./tasks/run-build.ts", | ||
"build:dev": "ts-node --project ./tsconfig-dev.json ./tasks/run-build.ts -d", | ||
"start": "node ./dist/index.js", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"release": "./tasks/release.sh" | ||
"release": "NODE_ENV=production ts-node ./tasks/release.ts" | ||
}, | ||
"devDependencies": { | ||
"@types/ejs": "^3.0.4", | ||
|
@@ -55,6 +56,7 @@ | |
"husky": "^4.2.5", | ||
"lint-staged": "^10.2.11", | ||
"prettier": "^2.0.5", | ||
"ts-node": "^9.1.1", | ||
"typescript": "^3.9.7" | ||
}, | ||
"dependencies": { | ||
|
@@ -68,7 +70,7 @@ | |
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "tsc --noEmit && lint-staged" | ||
"pre-commit": "lint-staged && tsc --noEmit" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"removeComments": false, | ||
"sourceMap": true, | ||
"watch": true, | ||
|
||
"noUnusedLocals": false, | ||
"allowUnreachableCode": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import fs from 'fs' | ||
import { run } from './process' | ||
import tsconfig from '../tsconfig.json' | ||
|
||
export async function build (mode: 'production' | 'development'): Promise<string> { | ||
const distPath = tsconfig.compilerOptions.outDir | ||
let buildCommand = 'tsc' | ||
|
||
if (mode === 'development') { | ||
buildCommand += ' --project ./tsconfig-dev.json' | ||
} | ||
|
||
console.info('Build mode: ' + mode + '.') | ||
|
||
if (fs.existsSync(distPath)) { | ||
console.info('Removing previous build...') | ||
fs.rmdirSync(distPath, { recursive: true }) | ||
} | ||
|
||
console.info('Running command: ' + buildCommand) | ||
return await run(buildCommand) | ||
} |
Oops, something went wrong.