Skip to content

Commit

Permalink
Merge pull request #5 from barinbritva/rewrite-tasks
Browse files Browse the repository at this point in the history
Rewrite tasks from bash to js.
  • Loading branch information
barinbritva authored Mar 4, 2021
2 parents 893e757 + 564127c commit 77857fc
Show file tree
Hide file tree
Showing 28 changed files with 436 additions and 163 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
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
}
}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Windows support (by rewriting tasks from bash to js).

## [1.0.9] - 2020-09-02
### Added
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ interface Window {

## 🗺 Roadmap
### In version `1.x`
* **Windows support.** Current version works on Linux and MacOS.
* **Tests.** Test frameworks, code coverage.
* **Code standards.** Setting up `eslint`, auto code formatting.
* **Pull-request bots.** Checking code coverage, dependencies vulnerabilities, etc
Expand Down
19 changes: 0 additions & 19 deletions azure-pipelines.yml

This file was deleted.

66 changes: 66 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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": {
Expand All @@ -68,7 +70,7 @@
},
"husky": {
"hooks": {
"pre-commit": "tsc --noEmit && lint-staged"
"pre-commit": "lint-staged && tsc --noEmit"
}
}
}
25 changes: 23 additions & 2 deletions scaffold/_tsconfig/tsconfig-advanced.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
{
"extends": "./tsconfig-base.json",
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
"downlevelIteration": true,
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"module": "CommonJS",
"moduleResolution": "Node",
"target": "ES2015",
"outDir": "./dist",
"declaration": true,
"declarationDir": "./dist/__types__",
"resolveJsonModule": true,

"removeComments": true,
"sourceMap": false,
"watch": false,

"allowUnreachableCode": false,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
Expand All @@ -13,5 +31,8 @@
"strictNullChecks": true,
"strictPropertyInitialization": true,
"suppressImplicitAnyIndexErrors": true
}
},
"include": [
"./src"
]
}
11 changes: 9 additions & 2 deletions scaffold/_tsconfig/tsconfig-base.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@
"esModuleInterop": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"module": "UMD",
"module": "CommonJS",
"moduleResolution": "Node",
"target": "ES2015",
"removeComments": true
"outDir": "./dist",
"declaration": true,
"declarationDir": "./dist/__types__",
"resolveJsonModule": true,

"removeComments": true,
"sourceMap": false,
"watch": false
},
"include": [
"./src"
Expand Down
11 changes: 11 additions & 0 deletions scaffold/_tsconfig/tsconfig-dev.json
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
}
}
9 changes: 6 additions & 3 deletions scaffold/package.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@
"files": [
"/dist"
],
"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"
},<% if (author) { %>
"author": {
"name": "<%= author %>"
},<% } %><% if (license) { %>
"license": "<%= license.id %>",<% } %>
"devDependencies": {
"@types/node": "^14.14.31",
"ts-node": "^9.1.1",
"typescript": "^3.9.7"
}
}
20 changes: 0 additions & 20 deletions scaffold/tasks/build.sh

This file was deleted.

22 changes: 22 additions & 0 deletions scaffold/tasks/build.ts
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)
}
Loading

0 comments on commit 77857fc

Please sign in to comment.