Skip to content

Commit

Permalink
chore(package): update packages & configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
DxCx committed Aug 17, 2017
1 parent 8c23a8b commit 38d0420
Show file tree
Hide file tree
Showing 11 changed files with 4,183 additions and 236 deletions.
1 change: 0 additions & 1 deletion .babelrc

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
*
!yarn.lock
!src/
!src/**/*
!*.js
!*.json
!*.md
!.babelrc
!.gitignore
!.travis.yml
!LICENSE
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ What does it include:
2. packaging for npm modules (webpack + tslint + awesome-typescript-loader + dts-bundle)
3. testings for npm modules (jest)
4. code coverage (jest) when running tests
5. Typescript => ES6 => ES5 (babel)
5. Typescript => ES5
6. Two versions embed in the package, one for node, one for browser (browserify)

Notes
Expand Down Expand Up @@ -40,7 +40,6 @@ Files explained:
1a. src/Example.ts - Just an example exported library, used to should import in tests.
1b. src/Example.spec.ts - tests for the example class
1c. src/index.ts - index, which functionality is exported from the library
1d. src/main.ts - just wrapper for index
3. package.json - file is used to describe the library
4. tsconfig.json - configuration file for the library compilation
6. tslint.json - configuration file for the linter (both test and library)
Expand Down
14 changes: 14 additions & 0 deletions __tests__/Example.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';

import 'jest';
import { Example } from '../src';

describe('Example', () => {
it('Should be pass sanity', () => {
expect(typeof Example).toBe('function');
});

it('Should be able to create new instance', () => {
expect(typeof new Example()).toBe('object');
});
});
55 changes: 27 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@
"name": "ts-library-starter",
"version": "0.1.0",
"description": "Example git project that is used for typescript libraries as a starter pack",
"main": "dist/main.js",
"typings": "dist/main.d.ts",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"jam": {
"main": "./dist/main.browser.js"
"main": "./dist/index.browser.js"
},
"browser": {
"dist/main.js": "./dist/main.browser.js"
"dist/index.js": "./dist/index.browser.js"
},
"scripts": {
"prebuild": "npm install",
"build": "webpack || echo not ok",
"test": "jest",
"test:watch": "npm test -- --watch",
"coverage": "npm test -- --coverage --no-cache",
"coverage:watch": "npm run coverage -- --watch",
"prerelease": "npm run build && npm test",
"prepare": "npm run build && npm test",
"release": "standard-version && npm pack"
},
"repository": {
Expand All @@ -35,10 +34,9 @@
"package",
"tslint",
"jest",
"babel",
"tsloader",
"boilerplate",
"awesome-typescript-loader"
"ts-loader"
],
"author": "Hagai Cohen",
"license": "MIT",
Expand All @@ -47,30 +45,31 @@
},
"homepage": "https://github.com/DxCx/ts-library-starter#readme",
"devDependencies": {
"@types/jest": "^0.9.31",
"@types/node": "^6.0.38",
"awesome-typescript-loader": "^2.2.1",
"babel-core": "^6.14.0",
"babel-loader": "^6.2.5",
"babel-polyfill": "^6.13.0",
"babel-preset-es2015": "^6.14.0",
"browserify": "^13.1.0",
"delete-empty": "^0.1.3",
"dts-bundle": "^0.5.0",
"jest": "^15.1.1",
"standard-version": "^2.4.0",
"tslint": "^3.15.1",
"tslint-loader": "^2.1.5",
"typescript": "2.0.0",
"typescript-babel-jest": "^0.1.2",
"webpack": "2.1.0-beta.22",
"webpack-node-externals": "^1.4.3"
"@types/jest": "^20.0.7",
"@types/node": "^8.0.24",
"browserify": "^14.4.0",
"delete-empty": "^1.0.1",
"dts-bundle": "^0.7.3",
"jest": "^20.0.4",
"standard-version": "^4.2.0",
"ts-jest": "^20.0.10",
"ts-loader": "^2.3.3",
"tslint": "^5.6.0",
"tslint-loader": "^3.5.3",
"typescript": "2.4.2",
"webpack": "3.5.5",
"webpack-node-externals": "^1.6.0"
},
"dependencies": {},
"jest": {
"scriptPreprocessor": "node_modules/typescript-babel-jest",
"transform": {
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"mapCoverage": true,
"collectCoverageFrom": ["src/**/*.ts"],
"coveragePathIgnorePatterns": ["\/__tests__\/", "\/node_modules\/"],
"testEnvironment": "node",
"testRegex": ".*\\.spec\\.ts$",
"testRegex": "__tests__/.*\\.spec\\.ts$",
"moduleFileExtensions": [
"ts",
"js",
Expand Down
17 changes: 0 additions & 17 deletions src/Example.spec.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/main.ts

This file was deleted.

50 changes: 24 additions & 26 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"lib": ["es6", "dom"],
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"sourceMap": false,
"declaration": true,
"outDir": "dist",
"removeComments": false,
"typeRoots": [
"node_modules/@types"
],
"types": [
"@types/node"
]
},
"files": [
"src/main.ts"
],
"exclude": [
"node_modules"
]
"compilerOptions": {
"experimentalDecorators": true,
"lib": ["es6"],
"module": "commonjs",
"target": "es5",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"sourceMap": false,
"declaration": true,
"outDir": "dist",
"removeComments": false,
"typeRoots": [
"node_modules/@types"
],
"types": [
"@types/node"
]
},
"files": [
"src/index.ts"
],
"exclude": [
"node_modules"
]
}
5 changes: 1 addition & 4 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"extends": "tslint:recommended",
"rules": {
"use-strict": true
}
"extends": "tslint:recommended"
}
Loading

0 comments on commit 38d0420

Please sign in to comment.