Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 07c0032

Browse files
committedAug 26, 2019
draft
0 parents  commit 07c0032

15 files changed

+11542
-0
lines changed
 

‎.editorconfig

Lines changed: 13 additions & 0 deletions
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

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
# Only exists if Bazel was run
8+
/bazel-out
9+
10+
# dependencies
11+
/node_modules
12+
13+
# profiling files
14+
chrome-profiler-events.json
15+
speed-measure-plugin.json
16+
17+
# IDEs and editors
18+
/.idea
19+
.project
20+
.classpath
21+
.c9/
22+
*.launch
23+
.settings/
24+
*.sublime-workspace
25+
26+
# IDE - VSCode
27+
.vscode/*
28+
!.vscode/settings.json
29+
!.vscode/tasks.json
30+
!.vscode/launch.json
31+
!.vscode/extensions.json
32+
.history/*
33+
34+
# misc
35+
/.sass-cache
36+
/connect.lock
37+
/coverage
38+
/libpeerconnection.log
39+
npm-debug.log
40+
yarn-error.log
41+
testem.log
42+
/typings
43+
44+
# System Files
45+
.DS_Store
46+
Thumbs.db

‎README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Angular Render (experimental)
2+
====
3+
#### Rete.js plugin

‎angular.json

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"rete-angular-render-plugin": {
7+
"projectType": "application",
8+
"schematics": {
9+
"@schematics/angular:component": {
10+
"style": "sass"
11+
}
12+
},
13+
"root": "",
14+
"sourceRoot": "src",
15+
"prefix": "app",
16+
"architect": {
17+
"build": {
18+
"builder": "@angular-devkit/build-angular:browser",
19+
"options": {
20+
"outputPath": "dist/rete-angular-render-plugin",
21+
"index": "src/index.html",
22+
"main": "src/main.ts",
23+
"polyfills": "src/polyfills.ts",
24+
"tsConfig": "tsconfig.app.json",
25+
"aot": false,
26+
"assets": [
27+
"src/favicon.ico",
28+
"src/assets"
29+
],
30+
"styles": [
31+
"src/styles.sass"
32+
],
33+
"scripts": [],
34+
"preserveSymlinks": true
35+
},
36+
"configurations": {
37+
"production": {
38+
"fileReplacements": [
39+
{
40+
"replace": "src/environments/environment.ts",
41+
"with": "src/environments/environment.prod.ts"
42+
}
43+
],
44+
"optimization": true,
45+
"outputHashing": "all",
46+
"sourceMap": false,
47+
"extractCss": true,
48+
"namedChunks": false,
49+
"aot": true,
50+
"extractLicenses": true,
51+
"vendorChunk": false,
52+
"buildOptimizer": true,
53+
"budgets": [
54+
{
55+
"type": "initial",
56+
"maximumWarning": "2mb",
57+
"maximumError": "5mb"
58+
}
59+
]
60+
}
61+
}
62+
},
63+
"serve": {
64+
"builder": "@angular-devkit/build-angular:dev-server",
65+
"options": {
66+
"browserTarget": "rete-angular-render-plugin:build"
67+
},
68+
"configurations": {
69+
"production": {
70+
"browserTarget": "rete-angular-render-plugin:build:production"
71+
}
72+
}
73+
},
74+
"extract-i18n": {
75+
"builder": "@angular-devkit/build-angular:extract-i18n",
76+
"options": {
77+
"browserTarget": "rete-angular-render-plugin:build"
78+
}
79+
},
80+
"test": {
81+
"builder": "@angular-devkit/build-angular:karma",
82+
"options": {
83+
"main": "src/test.ts",
84+
"polyfills": "src/polyfills.ts",
85+
"tsConfig": "tsconfig.spec.json",
86+
"karmaConfig": "karma.conf.js",
87+
"assets": [
88+
"src/favicon.ico",
89+
"src/assets"
90+
],
91+
"styles": [
92+
"src/styles.sass"
93+
],
94+
"scripts": []
95+
}
96+
},
97+
"lint": {
98+
"builder": "@angular-devkit/build-angular:tslint",
99+
"options": {
100+
"tsConfig": [
101+
"tsconfig.app.json",
102+
"tsconfig.spec.json",
103+
"e2e/tsconfig.json"
104+
],
105+
"exclude": [
106+
"**/node_modules/**"
107+
]
108+
}
109+
},
110+
"e2e": {
111+
"builder": "@angular-devkit/build-angular:protractor",
112+
"options": {
113+
"protractorConfig": "e2e/protractor.conf.js",
114+
"devServerTarget": "rete-angular-render-plugin:serve"
115+
},
116+
"configurations": {
117+
"production": {
118+
"devServerTarget": "rete-angular-render-plugin:serve:production"
119+
}
120+
}
121+
}
122+
}
123+
},
124+
"render": {
125+
"projectType": "library",
126+
"root": "projects/render",
127+
"sourceRoot": "projects/render/src",
128+
"prefix": "lib",
129+
"architect": {
130+
"build": {
131+
"builder": "@angular-devkit/build-ng-packagr:build",
132+
"options": {
133+
"tsConfig": "projects/render/tsconfig.lib.json",
134+
"project": "projects/render/ng-package.json"
135+
}
136+
},
137+
"test": {
138+
"builder": "@angular-devkit/build-angular:karma",
139+
"options": {
140+
"main": "projects/render/src/test.ts",
141+
"tsConfig": "projects/render/tsconfig.spec.json",
142+
"karmaConfig": "projects/render/karma.conf.js"
143+
}
144+
},
145+
"lint": {
146+
"builder": "@angular-devkit/build-angular:tslint",
147+
"options": {
148+
"tsConfig": [
149+
"projects/render/tsconfig.lib.json",
150+
"projects/render/tsconfig.spec.json"
151+
],
152+
"exclude": [
153+
"**/node_modules/**"
154+
]
155+
}
156+
}
157+
}
158+
}},
159+
"defaultProject": "rete-angular-render-plugin"
160+
}

‎package-lock.json

Lines changed: 11044 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "rete-angular-render-plugin",
3+
"version": "0.1.0",
4+
"main": "dist/bundles/render.umd.js",
5+
"module": "dist/bundles/render.umd.js",
6+
"scripts": {
7+
"ng": "ng",
8+
"build": "ng build render",
9+
"build:dev": "ng build render --watch"
10+
},
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/retejs/angular-render-plugin.git"
14+
},
15+
"keywords": [
16+
"angular",
17+
"rete.js"
18+
],
19+
"author": "Vitaliy Stoliarov",
20+
"license": "MIT",
21+
"bugs": {
22+
"url": "https://github.com/retejs/angular-render-plugin/issues"
23+
},
24+
"homepage": "https://github.com/retejs/angular-render-plugin#readme",
25+
"dependencies": {
26+
"@angular/common": "7.0.0",
27+
"@angular/compiler": "7.0.0",
28+
"@angular/core": "7.0.0",
29+
"@angular/elements": "7.0.0",
30+
"@angular/platform-browser": "7.0.0",
31+
"@angular/platform-browser-dynamic": "7.0.0",
32+
"rete": "^1.4.1",
33+
"rxjs": "~6.4.0",
34+
"tslib": "^1.9.0",
35+
"zone.js": "~0.9.1"
36+
},
37+
"devDependencies": {
38+
"@angular-devkit/build-angular": "0.10.2",
39+
"@angular-devkit/build-ng-packagr": "0.10.2",
40+
"@angular/cli": "^7.0.2",
41+
"@angular/compiler-cli": "^7.0.0",
42+
"@angular/language-service": "~7.0.0",
43+
"@types/node": "~8.9.4",
44+
"ng-packagr": "^5.1.0",
45+
"ts-node": "~7.0.0",
46+
"tsickle": "^0.35.0",
47+
"tslint": "~5.15.0",
48+
"typescript": "3.1.1"
49+
}
50+
}

‎projects/render/ng-package.json

Lines changed: 7 additions & 0 deletions
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",
4+
"lib": {
5+
"entryFile": "src/index.ts"
6+
}
7+
}

‎projects/render/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "render",
3+
"version": "0.0.1",
4+
"peerDependencies": {
5+
"@angular/common": "^7.0.0",
6+
"@angular/core": "^7.0.0"
7+
}
8+
}

‎projects/render/src/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { NodeEditor } from 'rete';
2+
function install(editor: NodeEditor) {
3+
editor.on('rendernode', ({ el }) => {
4+
const element = document.createElement('rete-node');
5+
el.appendChild(element);
6+
});
7+
}
8+
9+
export default {
10+
name: 'angular-render',
11+
install
12+
}
13+
14+
export { ReteModule } from './module';

‎projects/render/src/module.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { NgModule, Injector } from '@angular/core';
2+
import { createCustomElement } from '@angular/elements';
3+
4+
import { NodeComponent } from './node.component';
5+
6+
@NgModule({
7+
declarations: [
8+
NodeComponent
9+
],
10+
exports: [
11+
NodeComponent
12+
],
13+
entryComponents: [
14+
NodeComponent
15+
]
16+
})
17+
export class ReteModule {
18+
constructor(injector: Injector) { // StaticInjectorError due to 'npm link'
19+
console.log(injector);
20+
const NodeElement = createCustomElement(NodeComponent, { injector });
21+
customElements.define('rete-node', NodeElement);
22+
}
23+
}

‎projects/render/src/node.component.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Component } from '@angular/core';
2+
3+
4+
@Component({
5+
template: 'test!!!'
6+
})
7+
export class NodeComponent {
8+
}

‎projects/render/tsconfig.lib.json

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

‎projects/render/tslint.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"extends": "../../tslint.json",
3+
"rules": {
4+
"directive-selector": [
5+
true,
6+
"attribute",
7+
"lib",
8+
"camelCase"
9+
],
10+
"component-selector": [
11+
true,
12+
"element",
13+
"lib",
14+
"kebab-case"
15+
]
16+
}
17+
}

‎tsconfig.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"compileOnSave": false,
3+
"compilerOptions": {
4+
"baseUrl": "./",
5+
"outDir": "./dist/out-tsc",
6+
"sourceMap": true,
7+
"declaration": false,
8+
"module": "esnext",
9+
"moduleResolution": "node",
10+
"emitDecoratorMetadata": true,
11+
"experimentalDecorators": true,
12+
"importHelpers": true,
13+
"target": "es2015",
14+
"typeRoots": [
15+
"node_modules/@types"
16+
],
17+
"lib": [
18+
"es2018",
19+
"dom"
20+
],
21+
"paths": {
22+
"render": [
23+
"dist/render"
24+
],
25+
"render/*": [
26+
"dist/render/*"
27+
]
28+
}
29+
}
30+
}

‎tslint.json

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
{
2+
"extends": "tslint:recommended",
3+
"rules": {
4+
"array-type": false,
5+
"arrow-parens": false,
6+
"deprecation": {
7+
"severity": "warn"
8+
},
9+
"component-class-suffix": true,
10+
"contextual-lifecycle": true,
11+
"directive-class-suffix": true,
12+
"directive-selector": [
13+
true,
14+
"attribute",
15+
"app",
16+
"camelCase"
17+
],
18+
"component-selector": [
19+
true,
20+
"element",
21+
"app",
22+
"kebab-case"
23+
],
24+
"import-blacklist": [
25+
true,
26+
"rxjs/Rx"
27+
],
28+
"interface-name": false,
29+
"max-classes-per-file": false,
30+
"max-line-length": [
31+
true,
32+
140
33+
],
34+
"member-access": false,
35+
"member-ordering": [
36+
true,
37+
{
38+
"order": [
39+
"static-field",
40+
"instance-field",
41+
"static-method",
42+
"instance-method"
43+
]
44+
}
45+
],
46+
"no-consecutive-blank-lines": false,
47+
"no-console": [
48+
true,
49+
"debug",
50+
"info",
51+
"time",
52+
"timeEnd",
53+
"trace"
54+
],
55+
"no-empty": false,
56+
"no-inferrable-types": [
57+
true,
58+
"ignore-params"
59+
],
60+
"no-non-null-assertion": true,
61+
"no-redundant-jsdoc": true,
62+
"no-switch-case-fall-through": true,
63+
"no-use-before-declare": true,
64+
"no-var-requires": false,
65+
"object-literal-key-quotes": [
66+
true,
67+
"as-needed"
68+
],
69+
"object-literal-sort-keys": false,
70+
"ordered-imports": false,
71+
"quotemark": [
72+
true,
73+
"single"
74+
],
75+
"trailing-comma": false,
76+
"no-conflicting-lifecycle": true,
77+
"no-host-metadata-property": true,
78+
"no-input-rename": true,
79+
"no-inputs-metadata-property": true,
80+
"no-output-native": true,
81+
"no-output-on-prefix": true,
82+
"no-output-rename": true,
83+
"no-outputs-metadata-property": true,
84+
"template-banana-in-box": true,
85+
"template-no-negated-async": true,
86+
"use-lifecycle-interface": true,
87+
"use-pipe-transform-interface": true
88+
},
89+
"rulesDirectory": [
90+
"codelyzer"
91+
]
92+
}

0 commit comments

Comments
 (0)
Please sign in to comment.