Skip to content

Commit

Permalink
Added build script
Browse files Browse the repository at this point in the history
  • Loading branch information
timocov committed Jun 10, 2019
1 parent 43bef29 commit e3087ed
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ src/**/*.js
src/**/*.js.map

dist/
lib/

node_modules/

Expand Down
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"files.exclude": {
"dist/**": true,
"lib/**": true
}
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The followings are the example usage of the custom transformer.

```js
// webpack.config.js
const minifyPrivatesTransformer = require('ts-transformer-minify-privates/transformer').default;
const minifyPrivatesTransformer = require('ts-transformer-minify-privates').default;

module.exports = {
// ...
Expand Down Expand Up @@ -45,7 +45,7 @@ module.exports = {
```js
// rollup.config.js
import typescript from 'rollup-plugin-typescript2';
import minifyPrivatesTransformer from 'ts-transformer-minify-privates/transformer';
import minifyPrivatesTransformer from 'ts-transformer-minify-privates';

export default {
// ...
Expand All @@ -68,7 +68,7 @@ See [ttypescript's README](https://github.com/cevek/ttypescript/blob/master/READ
"compilerOptions": {
// ...
"plugins": [
{ "transform": "ts-transformer-minify-privates/transformer" }
{ "transform": "ts-transformer-minify-privates" }
]
},
// ...
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
"name": "ts-transformer-minify-privates",
"version": "0.0.1",
"description": "A TypeScript custom transformer which minify names of private class members",
"main": "transformer.js",
"main": "dist/transformer.js",
"repository": {
"type": "git",
"url": "git+https://github.com/timocov/ts-transformer-minify-privates.git"
},
"files": [
"dist/"
],
"keywords": [
"typescript",
"transformer",
Expand All @@ -28,6 +31,7 @@
"@types/mocha": "~5.2.7",
"@types/node": "~12.0.4",
"chai": "~4.2.0",
"clean-publish": "~1.1.2",
"mocha": "~6.1.4",
"ts-node": "~8.2.0",
"tslint": "~5.17.0",
Expand Down
16 changes: 16 additions & 0 deletions prepare-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e

echo ">> Cleaning up..."
rm -rf lib/ dist/
mkdir -p dist/

echo ">> Building a package..."
npm run tsc
cp -r lib/src/* dist/

echo ">> Cleaning up a package.json file..."
./node_modules/.bin/clear-package-json package.json --fields private -o package.json

echo "Package is ready to publish"
1 change: 1 addition & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"outDir": "./lib",
"rootDir": "./",
"strict": true,
"target": "es5",
Expand Down

0 comments on commit e3087ed

Please sign in to comment.