-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from czeckd/packaging
Packaging for npm
- Loading branch information
Showing
17 changed files
with
318 additions
and
159 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,4 +1,4 @@ | ||
node_modules | ||
app/**/*.js | ||
*.js.map | ||
runt | ||
dist | ||
**~ |
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
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 |
---|---|---|
@@ -1,46 +1,61 @@ | ||
(function (global) { | ||
(function(global) { | ||
|
||
var ngVer = '@4.0.0'; | ||
|
||
var paths = { | ||
'npm:' : 'https://unpkg.com/' | ||
} | ||
|
||
var map = { | ||
'app' : 'app', | ||
'rxjs' : 'npm:[email protected]', | ||
'typescript' : 'npm:[email protected]/lib/typescript.js' | ||
}; | ||
|
||
var pkgs = [ | ||
'common', 'compiler', 'core', 'forms', 'http', 'platform-browser', 'platform-browser-dynamic' | ||
]; | ||
|
||
pkgs.forEach(function(name) { | ||
var key = '@angular/' + name; | ||
var value = 'npm:@angular/' + name + ngVer + '/bundles/' + name + '.umd.js'; | ||
map[key] = value; | ||
}); | ||
|
||
System.config({ | ||
|
||
transpiler: 'typescript', | ||
typescriptOptions: { | ||
"emitDecoratorMetadata": true | ||
}, | ||
|
||
paths: paths, | ||
map: map, | ||
|
||
packages: { | ||
app: { | ||
main: './main.ts', | ||
defaultExtension: 'ts' | ||
}, | ||
rxjs: { | ||
defaultExtension: 'js' | ||
} | ||
} | ||
}); | ||
})(this); | ||
var paths = { | ||
'npm:' : 'https://unpkg.com/' | ||
} | ||
|
||
// map tells the System loader where to look for things | ||
var map = { | ||
'app': 'app', | ||
'rxjs': 'npm:[email protected]', | ||
'@angular': 'npm:@angular', | ||
'typescript' : 'npm:[email protected]/lib/typescript.js', | ||
'angular-svg-icon': 'lib' | ||
}; | ||
|
||
// packages tells the System loader how to load when no filename and/or no extension | ||
var packages = { | ||
'app': { main: 'main.ts', defaultExtension: 'ts' }, | ||
'rxjs': { defaultExtension: 'js' }, | ||
'angular-svg-icon': { main: 'index.ts', defaultExtension: 'ts' } | ||
}; | ||
|
||
var ngPackageNames = [ | ||
'common', | ||
'compiler', | ||
'core', | ||
'forms', | ||
'http', | ||
'platform-browser', | ||
'platform-browser-dynamic' | ||
]; | ||
|
||
ngPackageNames.forEach(function(pkgName) { | ||
map['@angular/'+pkgName] = 'npm:@angular/' + pkgName + ngVer; | ||
}); | ||
|
||
// Add package entries for angular packages | ||
ngPackageNames.forEach(function(pkgName) { | ||
packages['@angular/'+pkgName] = { main: '/bundles/' + pkgName + '.umd.js', defaultExtension: 'js' }; | ||
}); | ||
|
||
var config = { | ||
transpiler: 'typescript', | ||
typescriptOptions: { | ||
emitDecoratorMetadata: true | ||
}, | ||
paths: paths, | ||
map: map, | ||
packages: packages | ||
} | ||
|
||
// filterSystemConfig - index.html's chance to modify config before it is registered. | ||
if (global.filterSystemConfig) { | ||
global.filterSystemConfig(config); | ||
} | ||
|
||
System.config(config); | ||
|
||
})(this); |
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,18 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { HttpModule } from '@angular/http'; | ||
|
||
|
||
import { SvgIconComponent, SVG_ICON_REGISTRY_PROVIDER } from './svg-icon.component'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
HttpModule | ||
], | ||
declarations: [ SvgIconComponent ], | ||
providers: [ SVG_ICON_REGISTRY_PROVIDER ], | ||
exports: [ SvgIconComponent ] | ||
}) | ||
|
||
export class AngularSvgIconModule {} |
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,4 @@ | ||
export * from './angular-svg-icon.module'; | ||
export * from './svg-icon-registry.service'; | ||
export * from './svg-icon.component'; | ||
|
File renamed without changes.
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 |
---|---|---|
@@ -1,40 +1,56 @@ | ||
{ | ||
"name": "angular-svg-icon", | ||
"description": "Angular 2+ component for inlining SVGs allowing them to be easily styled with CSS.", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/czeckd/angular-svg-icon.git" | ||
}, | ||
"author": "David Czeck", | ||
"license": "MIT", | ||
"typings": "index.d.ts", | ||
"keywords": [ | ||
"angular", | ||
"angular2", | ||
"angular4", | ||
"svg", | ||
"icon" | ||
], | ||
"scripts": { | ||
"start": "tsc && concurrently \"tsc -w\" \"lite-server\" ", | ||
"start": "rimraf runt && npm run dist && tsc && concurrently \"tsc -w\" \"lite-server\" ", | ||
"tsc": "tsc", | ||
"tsc:w": "tsc -w", | ||
"clean": "rimraf runt dist", | ||
"dist": "tools/mkdist", | ||
"lite": "lite-server", | ||
"lint": "tslint -c tslint.json ./app/**/*.ts -t verbose || true" | ||
}, | ||
"dependencies": { | ||
"@angular/common": "~4.0.0", | ||
"@angular/compiler": "~4.0.0", | ||
"@angular/core": "~4.0.0", | ||
"@angular/forms": "~4.0.0", | ||
"@angular/http": "~4.0.0", | ||
"@angular/platform-browser": "~4.0.0", | ||
"@angular/platform-browser-dynamic": "~4.0.0", | ||
"core-js": "^2.4.1", | ||
"systemjs": "0.19.47", | ||
"rxjs": "^5.2.0", | ||
"zone.js": "^0.8.4" | ||
"peerDependencies": { | ||
"@angular/core": "^2.4.0 || ^4.0.0", | ||
"@angular/http": "^2.4.0 || ^4.0.0", | ||
"rxjs": "^5.2.0" | ||
}, | ||
"devDependencies": { | ||
"@angular/common": "^4.0.0", | ||
"@angular/compiler": "^4.0.0", | ||
"@angular/compiler-cli": "^4.0.0", | ||
"@angular/core": "^4.0.0", | ||
"@angular/forms": "^4.0.0", | ||
"@angular/http": "^4.0.0", | ||
"@angular/platform-browser": "^4.0.0", | ||
"@angular/platform-browser-dynamic": "^4.0.0", | ||
"@types/core-js": "^0.9.39", | ||
"@types/node": "^6.0.60", | ||
"concurrently": "^2.2.0", | ||
"core-js": "^2.4.1", | ||
"lite-server": "^2.2.2", | ||
"rimraf": "^2.6.1", | ||
"rollup": "^0.41.6", | ||
"rxjs": "^5.2.0", | ||
"systemjs": "0.19.47", | ||
"ts-node": "^3.0.2", | ||
"tslint": "~4.5.0", | ||
"typescript": "~2.2.0" | ||
"typescript": "~2.2.0", | ||
"zone.js": "^0.8.4" | ||
} | ||
} |
Oops, something went wrong.