Skip to content

Commit f49669d

Browse files
committed
Initial commit
0 parents  commit f49669d

15 files changed

+8203
-0
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

.gitignore

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
/reports
8+
9+
# dependencies
10+
/node_modules
11+
12+
# profiling files
13+
chrome-profiler-events.json
14+
speed-measure-plugin.json
15+
16+
# IDEs and editors
17+
/.idea
18+
.project
19+
.classpath
20+
.c9/
21+
*.launch
22+
.settings/
23+
*.sublime-workspace
24+
25+
# IDE - VSCode
26+
.vscode/*
27+
!.vscode/settings.json
28+
!.vscode/tasks.json
29+
!.vscode/launch.json
30+
!.vscode/extensions.json
31+
.history/*
32+
33+
# misc
34+
/.sass-cache
35+
/connect.lock
36+
/coverage
37+
/libpeerconnection.log
38+
npm-debug.log
39+
yarn-error.log
40+
testem.log
41+
/typings
42+
43+
# System Files
44+
.DS_Store
45+
Thumbs.db

angular.json

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "",
5+
"projects": {
6+
"ngx-context": {
7+
"root": "",
8+
"sourceRoot": "src",
9+
"projectType": "library",
10+
"prefix": "context",
11+
"architect": {
12+
"build": {
13+
"builder": "@angular-devkit/build-ng-packagr:build",
14+
"options": {
15+
"tsConfig": "src/tsconfig.lib.json",
16+
"project": "src/ng-package.json"
17+
}
18+
},
19+
"test": {
20+
"builder": "@angular-devkit/build-angular:karma",
21+
"options": {
22+
"main": "src/test.ts",
23+
"tsConfig": "src/tsconfig.spec.json",
24+
"karmaConfig": "src/karma.conf.js"
25+
}
26+
},
27+
"lint": {
28+
"builder": "@angular-devkit/build-angular:tslint",
29+
"options": {
30+
"tsConfig": ["src/tsconfig.lib.json", "src/tsconfig.spec.json"],
31+
"exclude": ["**/node_modules/**"]
32+
}
33+
}
34+
}
35+
}
36+
},
37+
"defaultProject": "ngx-context"
38+
}

package.json

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"name": "ngx-context",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"ng": "ng",
6+
"start": "ng serve",
7+
"build": "ng build",
8+
"test": "ng test",
9+
"lint": "ng lint",
10+
"e2e": "ng e2e"
11+
},
12+
"private": true,
13+
"dependencies": {
14+
"@angular/animations": "~7.2.0",
15+
"@angular/common": "~7.2.0",
16+
"@angular/compiler": "~7.2.0",
17+
"@angular/core": "~7.2.0",
18+
"@angular/forms": "~7.2.0",
19+
"@angular/platform-browser": "~7.2.0",
20+
"@angular/platform-browser-dynamic": "~7.2.0",
21+
"@angular/router": "~7.2.0",
22+
"core-js": "^2.5.4",
23+
"rxjs": "~6.3.3",
24+
"tslib": "^1.9.0",
25+
"zone.js": "~0.8.26"
26+
},
27+
"devDependencies": {
28+
"@angular-devkit/build-angular": "~0.13.0",
29+
"@angular-devkit/build-ng-packagr": "~0.13.0",
30+
"@angular/cli": "~7.3.1",
31+
"@angular/compiler-cli": "~7.2.0",
32+
"@angular/language-service": "~7.2.0",
33+
"@types/jasmine": "~2.8.8",
34+
"@types/jasminewd2": "~2.0.3",
35+
"@types/node": "~8.9.4",
36+
"codecov": "^3.2.0",
37+
"codelyzer": "~4.5.0",
38+
"jasmine-core": "~2.99.1",
39+
"jasmine-spec-reporter": "~4.2.1",
40+
"karma": "~3.1.1",
41+
"karma-chrome-launcher": "~2.2.0",
42+
"karma-coverage-istanbul-reporter": "~2.0.1",
43+
"karma-jasmine": "~1.1.2",
44+
"karma-jasmine-html-reporter": "^0.2.2",
45+
"ng-packagr": "^4.2.0",
46+
"protractor": "~5.4.0",
47+
"ts-node": "~7.0.0",
48+
"tsickle": ">=0.34.0",
49+
"tslib": "^1.9.0",
50+
"tslint": "~5.11.0",
51+
"typescript": "~3.2.2"
52+
}
53+
}

src/karma.conf.js

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/1.0/config/configuration-file.html
3+
4+
module.exports = function(config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
8+
plugins: [
9+
require('karma-jasmine'),
10+
require('karma-chrome-launcher'),
11+
require('karma-jasmine-html-reporter'),
12+
require('karma-coverage-istanbul-reporter'),
13+
require('@angular-devkit/build-angular/plugins/karma'),
14+
],
15+
client: {
16+
clearContext: false, // leave Jasmine Spec Runner output visible in browser
17+
},
18+
coverageIstanbulReporter: {
19+
dir: require('path').join(__dirname, '../reports/coverage'),
20+
reports: ['html', 'lcovonly'],
21+
fixWebpackSourcePaths: true,
22+
},
23+
reporters: ['progress', 'kjhtml'],
24+
port: 9876,
25+
colors: true,
26+
logLevel: config.LOG_INFO,
27+
autoWatch: true,
28+
browsers: ['ChromeHeadless'],
29+
customLaunchers: {
30+
ChromeHeadless: {
31+
base: 'Chrome',
32+
flags: ['--headless', '--disable-gpu', '--remote-debugging-port=9222'],
33+
},
34+
},
35+
singleRun: false,
36+
});
37+
};

src/ng-package.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "../node_modules/ng-packagr/ng-package.schema.json",
3+
"dest": "../dist/ngx-context",
4+
"lib": {
5+
"entryFile": "public_api.ts"
6+
}
7+
}

src/package.json

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "ngx-context",
3+
"version": "0.0.0",
4+
"repository": {
5+
"type": "git",
6+
"url": "git+https://github.com/ng-turkey/ngx-context.git"
7+
},
8+
"license": "MIT",
9+
"homepage": "https://github.com/ng-turkey/ngx-context#readme",
10+
"bugs": {
11+
"url": "https://github.com/ng-turkey/ngx-context/issues"
12+
},
13+
"description": "Angular Context: Pass properties down the component tree effortlessly.",
14+
"keywords": [
15+
"angular",
16+
"ngx",
17+
"context",
18+
"prop-drilling",
19+
"data-binding",
20+
"property binding",
21+
"utility",
22+
"provider",
23+
"consumer",
24+
"router-outlet"
25+
],
26+
"peerDependencies": {
27+
"@angular/core": ">=2.0.0 <8.0.0",
28+
"rxjs": ">=6.0.0 || ^5.6.0-forward-compat.4"
29+
}
30+
}

src/public_api.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// Public exports will be here

src/test.ts

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
2+
3+
import 'core-js/es7/reflect';
4+
import 'zone.js/dist/zone';
5+
import 'zone.js/dist/zone-testing';
6+
import { getTestBed } from '@angular/core/testing';
7+
import {
8+
BrowserDynamicTestingModule,
9+
platformBrowserDynamicTesting
10+
} from '@angular/platform-browser-dynamic/testing';
11+
12+
declare const require: any;
13+
14+
// First, initialize the Angular testing environment.
15+
getTestBed().initTestEnvironment(
16+
BrowserDynamicTestingModule,
17+
platformBrowserDynamicTesting()
18+
);
19+
// Then we find all the tests.
20+
const context = require.context('./', true, /\.spec\.ts$/);
21+
// And load the modules.
22+
context.keys().map(context);

src/tsconfig.lib.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../out-tsc/lib",
5+
"target": "es2015",
6+
"module": "es2015",
7+
"moduleResolution": "node",
8+
"declaration": true,
9+
"sourceMap": true,
10+
"inlineSources": true,
11+
"emitDecoratorMetadata": true,
12+
"experimentalDecorators": true,
13+
"importHelpers": true,
14+
"types": [],
15+
"lib": [
16+
"dom",
17+
"es2018"
18+
]
19+
},
20+
"angularCompilerOptions": {
21+
"annotateForClosureCompiler": true,
22+
"skipTemplateCodegen": true,
23+
"strictMetadataEmit": true,
24+
"fullTemplateTypeCheck": true,
25+
"strictInjectionParameters": true,
26+
"enableResourceInlining": true
27+
},
28+
"exclude": [
29+
"src/test.ts",
30+
"**/*.spec.ts"
31+
]
32+
}

src/tsconfig.spec.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../out-tsc/spec",
5+
"types": [
6+
"jasmine",
7+
"node"
8+
]
9+
},
10+
"files": [
11+
"test.ts"
12+
],
13+
"include": [
14+
"**/*.spec.ts",
15+
"**/*.d.ts"
16+
]
17+
}

src/tslint.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "../tslint.json",
3+
"rules": {
4+
"directive-selector": [true, "attribute", "context", "camelCase"],
5+
"component-selector": [true, "element", "context", "kebab-case"]
6+
}
7+
}

tsconfig.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"compileOnSave": false,
3+
"compilerOptions": {
4+
"baseUrl": "./",
5+
"outDir": "./dist/out-tsc",
6+
"sourceMap": true,
7+
"declaration": false,
8+
"module": "es2015",
9+
"moduleResolution": "node",
10+
"emitDecoratorMetadata": true,
11+
"experimentalDecorators": true,
12+
"importHelpers": true,
13+
"target": "es5",
14+
"typeRoots": ["node_modules/@types"],
15+
"lib": ["es2018", "dom"],
16+
"paths": {
17+
"ngx-context": ["dist/ngx-context"],
18+
"ngx-context/*": ["dist/ngx-context/*"]
19+
}
20+
}
21+
}

tslint.json

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"extends": "tslint:recommended",
3+
"rulesDirectory": ["codelyzer"],
4+
"rules": {
5+
"array-type": false,
6+
"arrow-parens": false,
7+
"curly": [true, "as-needed"],
8+
"deprecation": {
9+
"severity": "warn"
10+
},
11+
"import-blacklist": [true, "rxjs/Rx"],
12+
"interface-name": false,
13+
"max-classes-per-file": false,
14+
"max-line-length": [true, 140],
15+
"member-access": false,
16+
"member-ordering": [
17+
true,
18+
{
19+
"order": ["static-field", "instance-field", "static-method", "instance-method"]
20+
}
21+
],
22+
"no-consecutive-blank-lines": false,
23+
"no-console": [true, "debug", "info", "time", "timeEnd", "trace"],
24+
"no-empty": false,
25+
"no-inferrable-types": [true, "ignore-params"],
26+
"no-non-null-assertion": true,
27+
"no-redundant-jsdoc": true,
28+
"no-string-literal": false,
29+
"no-switch-case-fall-through": true,
30+
"no-use-before-declare": true,
31+
"no-var-requires": false,
32+
"object-literal-key-quotes": [true, "as-needed"],
33+
"object-literal-sort-keys": false,
34+
"only-arrow-functions": false,
35+
"ordered-imports": false,
36+
"quotemark": [true, "single"],
37+
"trailing-comma": false,
38+
"no-output-on-prefix": true,
39+
"use-input-property-decorator": true,
40+
"use-output-property-decorator": true,
41+
"use-host-property-decorator": true,
42+
"no-input-rename": true,
43+
"no-output-rename": true,
44+
"use-life-cycle-interface": true,
45+
"use-pipe-transform-interface": true,
46+
"component-class-suffix": true,
47+
"directive-class-suffix": true,
48+
"variable-name": [
49+
true,
50+
"ban-keywords",
51+
"check-format",
52+
"allow-leading-underscore",
53+
"require-const-for-all-caps"
54+
]
55+
}
56+
}

0 commit comments

Comments
 (0)