-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Initial commit, adding everything needed to start the developm…
…ent.
- Loading branch information
Supamiu
committed
Jun 29, 2017
0 parents
commit a2fbb35
Showing
23 changed files
with
821 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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,8 @@ | ||
.idea/ | ||
.DS_Store | ||
node_modules/ | ||
coverage/ | ||
npm-debug.log | ||
dist/ | ||
*.js.map | ||
*.js |
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 @@ | ||
save-prefix=^ |
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,21 @@ | ||
language: node_js | ||
|
||
node_js: | ||
- '8' | ||
|
||
script: npm test | ||
|
||
notifications: | ||
email: false | ||
|
||
cache: | ||
directories: | ||
- node_modules | ||
|
||
after_success: | ||
- npm run codecov | ||
|
||
addons: | ||
chrome: stable | ||
|
||
dist: trusty |
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,13 @@ | ||
{ | ||
"generator-angular-library": { | ||
"githubUsername": "Supamiu", | ||
"githubRepoName": "ng-serializer", | ||
"npmModuleName": "ng-serializer", | ||
"moduleGlobal": "ngSerializer", | ||
"ngModuleName": "NgSerializerModule", | ||
"selectorPrefix": "null", | ||
"projectTitle": "ng serializer", | ||
"projectDescription": "", | ||
"authorName": "Supamiu" | ||
} | ||
} |
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,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2017 Supamiu | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,90 @@ | ||
# ng serializer | ||
[](https://travis-ci.org/Supamiu/ng-serializer) | ||
[](https://codecov.io/gh/Supamiu/ng-serializer) | ||
[](http://badge.fury.io/js/ng-serializer) | ||
[](https://david-dm.org/Supamiu/ng-serializer?type=dev) | ||
[](https://github.com/Supamiu/ng-serializer/issues) | ||
[](https://github.com/Supamiu/ng-serializer/stargazers) | ||
[](https://raw.githubusercontent.com/Supamiu/ng-serializer/master/LICENSE) | ||
|
||
## Demo | ||
https://Supamiu.github.io/ng-serializer/ | ||
|
||
## Table of contents | ||
|
||
- [About](#about) | ||
- [Installation](#installation) | ||
- [Documentation](#documentation) | ||
- [Development](#development) | ||
- [License](#license) | ||
|
||
## About | ||
|
||
|
||
|
||
## Installation | ||
|
||
Install through npm: | ||
``` | ||
npm install --save ng-serializer | ||
``` | ||
|
||
Then include in your apps module: | ||
|
||
```typescript | ||
import { Component, NgModule } from '@angular/core'; | ||
import { NgSerializerModule } from 'ng-serializer'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
NgSerializerModule.forRoot() | ||
] | ||
}) | ||
export class MyModule {} | ||
``` | ||
|
||
Finally use in one of your apps components: | ||
```typescript | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
template: '<hello-world></hello-world>' | ||
}) | ||
export class MyComponent {} | ||
``` | ||
|
||
You may also find it useful to view the [demo source](https://github.com/Supamiu/ng-serializer/blob/master/demo/demo.component.ts). | ||
|
||
### Usage without a module bundler | ||
``` | ||
<script src="node_modules/ng-serializer/bundles/ng-serializer.umd.js"></script> | ||
<script> | ||
// everything is exported ngSerializer namespace | ||
</script> | ||
``` | ||
|
||
## Documentation | ||
All documentation is auto-generated from the source via [compodoc](https://compodoc.github.io/compodoc/) and can be viewed here: | ||
https://Supamiu.github.io/ng-serializer/docs/ | ||
|
||
## Development | ||
|
||
### Prepare your environment | ||
* Install [Node.js](http://nodejs.org/) and NPM | ||
* Install local dev dependencies: `npm install` while current directory is this repo | ||
|
||
### Development server | ||
Run `npm start` to start a development server on port 8000 with auto reload + tests. | ||
|
||
### Testing | ||
Run `npm test` to run tests once or `npm run test:watch` to continually run tests. | ||
|
||
### Release | ||
* Bump the version in package.json (once the module hits 1.0 this will become automatic) | ||
```bash | ||
npm run release | ||
``` | ||
|
||
## License | ||
|
||
MIT |
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,8 @@ | ||
/** | ||
* @license | ||
* Copyright Supamiu All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an GPL license that can be | ||
* found in the LICENSE file at https://github.com/supamiu/ng-serializer/blob/master/LICENSE | ||
*/ | ||
export * from './src/index'; |
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,86 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var webpack = require("webpack"); | ||
var path = require("path"); | ||
var ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin"); | ||
exports.default = function (config) { | ||
config.set({ | ||
// base path that will be used to resolve all patterns (eg. files, exclude) | ||
basePath: './', | ||
// frameworks to use | ||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter | ||
frameworks: ['mocha'], | ||
// list of files / patterns to load in the browser | ||
files: [ | ||
'test/entry.ts' | ||
], | ||
// preprocess matching files before serving them to the browser | ||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor | ||
preprocessors: { | ||
'test/entry.ts': ['webpack', 'sourcemap'] | ||
}, | ||
webpack: { | ||
resolve: { | ||
extensions: ['.ts', '.js'] | ||
}, | ||
module: { | ||
rules: [{ | ||
test: /\.ts$/, | ||
loader: 'tslint-loader', | ||
exclude: /node_modules/, | ||
enforce: 'pre', | ||
options: { | ||
emitErrors: config.singleRun, | ||
failOnHint: config.singleRun | ||
} | ||
}, { | ||
test: /\.ts$/, | ||
loader: 'ts-loader', | ||
exclude: /node_modules/, | ||
options: { | ||
transpileOnly: !config.singleRun | ||
} | ||
}, { | ||
test: /src\/.+\.ts$/, | ||
exclude: /(node_modules|\.spec\.ts$)/, | ||
loader: 'istanbul-instrumenter-loader', | ||
enforce: 'post' | ||
}] | ||
}, | ||
plugins: [ | ||
new webpack.SourceMapDevToolPlugin({ | ||
filename: null, | ||
test: /\.(ts|js)($|\?)/i | ||
}), | ||
new webpack.ContextReplacementPlugin(/angular(\\|\/)core(\\|\/)@angular/, path.join(__dirname, 'src')) | ||
].concat((config.singleRun ? [ | ||
new webpack.NoEmitOnErrorsPlugin() | ||
] : [ | ||
new ForkTsCheckerWebpackPlugin({ | ||
watch: ['./src', './test'] | ||
}) | ||
])) | ||
}, | ||
mochaReporter: { | ||
showDiff: true, | ||
output: 'autowatch' | ||
}, | ||
coverageIstanbulReporter: { | ||
reports: ['text-summary', 'html', 'lcovonly'], | ||
fixWebpackSourcePaths: true | ||
}, | ||
mime: { | ||
'text/x-typescript': ['ts'] | ||
}, | ||
// test results reporter to use | ||
// possible values: 'dots', 'progress' | ||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
reporters: ['mocha', 'coverage-istanbul'], | ||
// level of logging | ||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
logLevel: config.LOG_INFO, | ||
// start these browsers | ||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
browsers: ['ChromeHeadless'] | ||
}); | ||
}; |
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,103 @@ | ||
import * as webpack from 'webpack'; | ||
import * as path from 'path'; | ||
import * as ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'; | ||
|
||
export default config => { | ||
|
||
config.set({ | ||
|
||
// base path that will be used to resolve all patterns (eg. files, exclude) | ||
basePath: './', | ||
|
||
// frameworks to use | ||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter | ||
frameworks: ['mocha'], | ||
|
||
// list of files / patterns to load in the browser | ||
files: [ | ||
'test/entry.ts' | ||
], | ||
|
||
// preprocess matching files before serving them to the browser | ||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor | ||
preprocessors: { | ||
'test/entry.ts': ['webpack', 'sourcemap'] | ||
}, | ||
|
||
webpack: { | ||
resolve: { | ||
extensions: ['.ts', '.js'] | ||
}, | ||
module: { | ||
rules: [{ | ||
test: /\.ts$/, | ||
loader: 'tslint-loader', | ||
exclude: /node_modules/, | ||
enforce: 'pre', | ||
options: { | ||
emitErrors: config.singleRun, | ||
failOnHint: config.singleRun | ||
} | ||
}, { | ||
test: /\.ts$/, | ||
loader: 'ts-loader', | ||
exclude: /node_modules/, | ||
options: { | ||
transpileOnly: !config.singleRun | ||
} | ||
}, { | ||
test: /src\/.+\.ts$/, | ||
exclude: /(node_modules|\.spec\.ts$)/, | ||
loader: 'istanbul-instrumenter-loader', | ||
enforce: 'post' | ||
}] | ||
}, | ||
plugins: [ | ||
new webpack.SourceMapDevToolPlugin({ | ||
filename: null, | ||
test: /\.(ts|js)($|\?)/i | ||
}), | ||
new webpack.ContextReplacementPlugin( | ||
/angular(\\|\/)core(\\|\/)@angular/, | ||
path.join(__dirname, 'src') | ||
), | ||
...(config.singleRun ? [ | ||
new webpack.NoEmitOnErrorsPlugin() | ||
] : [ | ||
new ForkTsCheckerWebpackPlugin({ | ||
watch: ['./src', './test'] | ||
}) | ||
]) | ||
] | ||
}, | ||
|
||
mochaReporter: { | ||
showDiff: true, | ||
output: 'autowatch' | ||
}, | ||
|
||
coverageIstanbulReporter: { | ||
reports: ['text-summary', 'html', 'lcovonly'], | ||
fixWebpackSourcePaths: true | ||
}, | ||
|
||
mime: { | ||
'text/x-typescript': ['ts'] | ||
}, | ||
|
||
// test results reporter to use | ||
// possible values: 'dots', 'progress' | ||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
reporters: ['mocha', 'coverage-istanbul'], | ||
|
||
// level of logging | ||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
logLevel: config.LOG_INFO, | ||
|
||
// start these browsers | ||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
browsers: ['ChromeHeadless'] | ||
|
||
}); | ||
|
||
}; |
Oops, something went wrong.