-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(tools): added build TS scripts
- Loading branch information
1 parent
254db54
commit d36ec17
Showing
10 changed files
with
336 additions
and
4 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,3 +1,4 @@ | ||
dist | ||
|
||
### Node ### | ||
# Logs | ||
|
Empty file.
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
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,10 @@ | ||
import { createBuilder } from './utils'; | ||
import * as tasks from './tasks'; | ||
|
||
export const build = createBuilder([ | ||
['Removing "./dist/@ptsecurity/tslint-config" folder', tasks.removeDistFolder], | ||
['Lint source code', tasks.lint], | ||
['Compiling TypeScript', tasks.compileTS], | ||
['Copy meta files', tasks.copyMetaFiles], | ||
['Testing custom rules', tasks.testRules] | ||
]); |
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 @@ | ||
import { build } from './builder'; | ||
|
||
build({ | ||
packages: [{ name: 'tslint-config' }] | ||
}).catch(err => { | ||
console.log(err.stdout); | ||
process.exit(1); | ||
}).then(() => { | ||
console.info('Build Complete'); | ||
process.exit(0); | ||
}); |
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,39 @@ | ||
import * as util from './utils'; | ||
import { helperRoot } from './utils'; | ||
|
||
const dist = helperRoot('dist'); | ||
|
||
const root = helperRoot(''); | ||
const packageSrc = helperRoot('src'); | ||
const packageDist = `${dist}/@ptsecurity/tslint-config`; | ||
|
||
console.log(packageSrc); | ||
|
||
export function removeDistFolder() { | ||
return util.exec('rimraf', [packageDist]); | ||
} | ||
|
||
export async function lint() { | ||
await util.exec('tslint', [`${packageSrc}/src/**/*.ts --project ${root}/tsconfig.json`]); | ||
} | ||
|
||
export async function compileTS() { | ||
await util.exec('tsc', []); | ||
} | ||
|
||
export async function copyMetaFiles() { | ||
const files = [ | ||
{from: `${root}/package.json`, to: `${packageDist}/package.json`}, | ||
{from: `${root}/package-lock.json`, to: `${packageDist}/package-lock.json`}, | ||
{from: `${root}/CHANGELOG.md`, to: `${packageDist}/CHANGELOG.md`}, | ||
{from: `${root}/README.md`, to: `${packageDist}/README.md`} | ||
]; | ||
|
||
await util.mapAsync(files, async file => { | ||
await util.copy(file.from, file.to); | ||
}); | ||
} | ||
|
||
export async function testRules() { | ||
await util.exec('tslint', [`-r ${packageDist}/rules --test ${root}/test/rules/**/*`]); | ||
} |
Oops, something went wrong.