Browse Source

chore: add source-code-requirements folder to ng-packs project

pull/3073/head
mehmet-erim 7 years ago
parent
commit
50f7cbde57
  1. 20
      npm/ng-packs/source-code-requirements/README.md
  2. 32
      npm/ng-packs/source-code-requirements/karma.conf.js
  3. 23
      npm/ng-packs/source-code-requirements/tsconfig.lib.json
  4. 6
      npm/ng-packs/source-code-requirements/tsconfig.lib.prod.json
  5. 17
      npm/ng-packs/source-code-requirements/tsconfig.spec.json
  6. 17
      npm/ng-packs/source-code-requirements/tslint.json

20
npm/ng-packs/source-code-requirements/README.md

@ -0,0 +1,20 @@
## Code scaffolding
Run `ng generate component component-name --project {{package-name}}` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project {{package-name}}`.
> Note: Don't forget to add `--project {{package-name}}` or else it will be added to the default project in your `angular.json` file.
## Build
Run `ng build {{package-name}}` to build the project. The build artifacts will be stored in the `dist/` directory.
## Publishing
After building your library with `ng build {{package-name}}`, go to the dist folder `cd dist/{{package-name}}` and run `npm publish`.
## Running unit tests
Run `ng test {{package-name}}` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

32
npm/ng-packs/source-code-requirements/karma.conf.js

@ -0,0 +1,32 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma'),
],
client: {
clearContext: false, // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../../coverage/{{package-name}}'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true,
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true,
});
};

23
npm/ng-packs/source-code-requirements/tsconfig.lib.json

@ -0,0 +1,23 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"inlineSources": true,
"types": [],
"lib": [
"dom",
"es2018"
]
},
"angularCompilerOptions": {
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"enableResourceInlining": true
},
"exclude": [
"src/test.ts",
"**/*.spec.ts"
]
}

6
npm/ng-packs/source-code-requirements/tsconfig.lib.prod.json

@ -0,0 +1,6 @@
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}

17
npm/ng-packs/source-code-requirements/tsconfig.spec.json

@ -0,0 +1,17 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/spec",
"types": [
"jasmine",
"node"
]
},
"files": [
"src/test.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}

17
npm/ng-packs/source-code-requirements/tslint.json

@ -0,0 +1,17 @@
{
"extends": "../../tslint.json",
"rules": {
"directive-selector": [
true,
"attribute",
"lib",
"camelCase"
],
"component-selector": [
true,
"element",
"lib",
"kebab-case"
]
}
}
Loading…
Cancel
Save