Skip to content

Commit 3c13054

Browse files
committed
ts-packager setup
1 parent 9101e28 commit 3c13054

8 files changed

+101
-38
lines changed

package-lock.json

+78-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "ts-error-handler",
33
"version": "0.0.0",
44
"ts-project-version": "1.2.4",
5+
"private": "true",
56
"scripts": {
67
"start": "npm run dev",
78
"dev": "npm run lint && ts-node src/index.ts",
@@ -35,6 +36,7 @@
3536
"jasmine": "^3.99.0",
3637
"nyc": "^15.1.0",
3738
"ts-node": "^10.4.0",
39+
"ts-packager": "^1.0.1",
3840
"typedoc": "^0.21.9",
3941
"typescript": "^4.5.4"
4042
}

publish.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
npm test
3+
npm run build:prod
4+
node_modules/.bin/ts-packager
5+
cd dist/src/
6+
npm publish

test/environment.spec.ts

-11
This file was deleted.

test/logger.spec.ts

-18
This file was deleted.

test/main.spec.ts

-7
This file was deleted.

ts-package-config.ts

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Config, BundleMap, bundlePackageJson } from 'ts-packager';
2+
3+
export const config: Config = {
4+
buildDir: 'dist/src/' // Where to put the build files
5+
};
6+
7+
export const files: BundleMap = {
8+
'CHANGELOG.md': true, // Copy the changelog to the build
9+
// TODO: 'LICENSE.md': true, // Copy the license to the build
10+
'README.md': true, // Copy the readme to the build
11+
// Copy the package.json to the build, removing scripts & dependencies
12+
'package.json': bundlePackageJson
13+
};

tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"include": [
2121
"./example/",
2222
"./src/",
23-
"./test/"
23+
"./test/",
24+
"./ts-package-config.ts"
2425
]
2526
}

0 commit comments

Comments
 (0)