Skip to content

Commit

Permalink
Add configuration for automated TravisCI npm publishes
Browse files Browse the repository at this point in the history
  • Loading branch information
chasebrewsky committed Dec 27, 2018
1 parent 51ddb82 commit 936c36f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 10 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,12 @@ cache: npm

# Use a custom testing script for the travis build.
script: npm run test:travis

# Deploy to NPM when a new tag is present on the master branch.
deploy:
provider: npm
email: $NPM_EMAIL
api_key: $NPM_TOKEN
on:
tags: true
branch: master
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The architecture behind some of these libraries is quite brilliant, but many of
* Decorators are currently only a stage 2 proposal at the time of writing this and haven't been implemented in the main language. This means that current implementations may be subject to change if they decide to rewrite the current draft.
* Most current IOC frameworks written in Typescript tend to make use of the [Reflect API](https://github.com/rbuckton/reflect-metadata) to autoinject values based on their type definitions. This can fragment the codebase between the Typescript and Javascript implementations if not carefully architected. It also creates the potential for the library to break when sweeping changes are made in an ECMA major version upgrade since the [metadata proposal](https://rbuckton.github.io/reflect-metadata/) hasn't even been considered for ECMA adoption yet. Typescript documentation even warns developers that reflect metadata is still an experimental feature and subject to change in the future.

This uncertainty in the future of decorators and metadata can sometimes make using them a hard sell to developer teams attempting to make a long term application. They typically don't have the luxury of waiting until they become stable to begin making application.
This uncertainty in the future of decorators and metadata can sometimes make using them a hard sell to developer teams attempting to make a long term application. They typically don't have the luxury of waiting until they become stable before beginning a project.

The goal of this library was to implement a modern IOC solution for node without having to rely or build around the functionality of decorators.

Expand All @@ -23,7 +23,7 @@ The goal of this library was to implement a modern IOC solution for node without
In order to work around decorators, this library drew inspiration the IOC system present in the original AngularJS framework. The IOC component of this framework worked quite well for building medium sized projects with swappable services. There were a few downsides to it's implementation though:

* Once a project got to a certain size, maintaining and refactoring the string identifiers for services became a nightmare. When there was a naming conflict and names had to be changed around, it wasn't simply a matter of allowing an IDE to find and refactor the name of a function or method; it was a trial and error effort to make sure that all tests passed and no bugs were introduced after the change.
* There wasn't much granular control over injecting one off depdendencies for a particular service in a module. Either you replaced that service for every service in the module or you were out of luck.
* There wasn't much granular control over injecting one off dependendencies for a particular service in a module. Either you replaced that service for every service in the module or you were out of luck.

DIFuse aims to use the same general idea of the AngularJS IOC implementation while improving upon it's shortcomings.

Expand Down
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
{
"name": "difuse",
"version": "0.1.0",
"version": "0.0.0",
"description": "IOC framework for node projects",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"build": "tsc",
"lint": "tslint -p tsconfig.json",
"test": "jest",
"test:coverage": "jest --coverage",
"test:travis": "jest --coverage --coverageReporters=text-lcov | coveralls"
"test:travis": "jest --coverage --coverageReporters=text-lcov | coveralls",
"prepare": "npm run build"
},
"engines": {
"node" : ">=8.0.0"
},
"repository": {
"type": "git",
Expand All @@ -27,6 +32,9 @@
"bugs": {
"url": "https://github.com/chasebrewsky/DIFuse/issues"
},
"files": [
"/lib"
],
"homepage": "https://github.com/chasebrewsky/DIFuse#readme",
"devDependencies": {
"@types/jest": "23.3.10",
Expand Down
12 changes: 7 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
"module": "commonjs",
"lib": ["es2017"],
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"outDir": "./lib",
"removeComments": true,

"strict": true,
"noImplicitAny": true,
"strictNullChecks": true
}
},
"include": [
"src/**/*"
],
"exclude": [
"src/**/*.test.ts"
]
}
2 changes: 1 addition & 1 deletion tslint.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"defaultSeverity": "error",
"extends": [
"tslint-config-airbnb"
"tslint-config-airbnb"
],
"jsRules": {},
"rules": {},
Expand Down

0 comments on commit 936c36f

Please sign in to comment.