Skip to content

Commit 1e1e1ba

Browse files
Merge branch 'refactor/angular-cli'
# Conflicts: # .gitignore # LICENSE # README.md # package.json # tsconfig.json # tslint.json # yarn.lock
2 parents 8142aa0 + 9a475cf commit 1e1e1ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+7254
-2647
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
[*.ts]
12+
quote_type = single
13+
14+
[*.md]
15+
max_line_length = off
16+
trim_trailing_whitespace = false

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
on: [push]
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
matrix:
8+
node-version: [12.x]
9+
steps:
10+
- uses: actions/checkout@v1
11+
12+
- name: Use Node.js ${{ matrix.node-version }}
13+
uses: actions/setup-node@v1
14+
with:
15+
node-version: ${{ matrix.node-version }}
16+
17+
- name: install libgbm1
18+
run: sudo apt-get install -y libgbm1
19+
20+
- name: Get yarn cache
21+
id: yarn-cache
22+
run: echo "::set-output name=dir::$(yarn cache dir)"
23+
24+
- uses: actions/cache@v1
25+
id: cache
26+
with:
27+
path: ${{ steps.yarn-cache.outputs.dir }}
28+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
29+
restore-keys: |
30+
${{ runner.os }}-yarn-
31+
32+
- name: Intall deps
33+
run: |
34+
yarn install
35+
36+
- name: Lint
37+
run: yarn lint
38+
39+
- name: Test
40+
run: yarn test --watch=false
41+
42+
- name: Build
43+
run: yarn build:prod
44+

.gitignore

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,46 @@
11
# See http://help.github.com/ignore-files/ for more about ignoring files.
22

33
# compiled output
4-
/demo
4+
/dist
55
/tmp
6+
/out-tsc
7+
# Only exists if Bazel was run
8+
/bazel-out
69

710
# dependencies
811
/node_modules
9-
/examples/basic/node_modules
10-
/bower_components
12+
13+
# profiling files
14+
chrome-profiler-events*.json
15+
speed-measure-plugin*.json
1116

1217
# IDEs and editors
1318
/.idea
14-
/.vscode
1519
.project
1620
.classpath
21+
.c9/
1722
*.launch
1823
.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/*
1933

2034
# misc
2135
/.sass-cache
2236
/connect.lock
23-
/coverage/
37+
/coverage
2438
/libpeerconnection.log
2539
npm-debug.log
40+
yarn-error.log
2641
testem.log
2742
/typings
2843

29-
# e2e
30-
/e2e/*.js
31-
/e2e/*.map
32-
33-
#System Files
44+
# System Files
3445
.DS_Store
3546
Thumbs.db
36-
37-
index.js
38-
index.js.map
39-
src/*.js
40-
src/*.js.map
41-
aot
42-
bundles
43-
/dist

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2019 tevim GmbH
3+
Copyright (c) since 2020 Marcus Kirsch & Bengt Weiße GbR - codaline
44

55
Permission is hereby granted, free of charge, to any person
66
obtaining a copy of this software and associated documentation

README.md

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
angular-stl-model-viewer
22
==
33

4-
[![CircleCI][circleci-svg]][circleci]
5-
64
This is an angular component to render stl-models with THREE.js.
75

86
Installation
97
==
108
- `yarn add angular-stl-model-viewer`
119
- `npm install angular-stl-model-viewer`
12-
- or download the zip file from [release page][releases]
1310

1411
Usage
1512
==
1613
- import `StlModelViewerModule` to your app module
17-
- use stl-model-viewer component in your html `<stl-model-viewer stlModel="example.stl"></stl-model-viewer>`
14+
- use stl-model-viewer component in your html `<stl-model-viewer [stlModels]="['example.stl']"></stl-model-viewer>`
1815

1916

2017
Example
@@ -27,16 +24,16 @@ Configuration
2724
## Input Properties
2825
| Attr | Type | Default | Details |
2926
| ------------ | ---------------------- | -------------------------------------------------------------------------------- |--------------------------------------------------- |
30-
| stlModel | string | - | Path to stl-model |
31-
| hasControls | boolean | true | If true, the user can interact with the stl-model |
27+
| stlModels | string[] | - | List of stl model paths |
28+
| hasControls | boolean | true | If true, the user can interact with the stl-models |
3229
| camera | THREE.Camera | THREE.PerspectiveCamera( 35, WindowInnerWidth / WindowInnerHeight, 1, 15 ) | The projection mode used for rendering the scene |
3330
| cameraTarget | THREE.Vector3 | THREE.Vector3( 0, 0, 0 ) | The orientation point for the camera |
3431
| light | THREE.Light | THREE.PointLight( 0xffffff ) | Illuminates the scene |
3532
| material | THREE.MeshMaterialType | THREE.MeshPhongMaterial({ color: 0xc4c4c4, shininess: 100, specular: 0x111111 }) | Casts more precisely the possible materials assignable to a [ [Mesh]] object |
3633
| scene | THREE.Scene | THREE.Scene() | Scenes allow you to set up what and where is to be rendered by three.js. This is where you place objects, lights and cameras |
3734
| renderer | THREE.WebGLRenderer | THREE.WebGLRenderer({ antialias: true }) | Displays your beautifully crafted scenes using WebGL |
3835
| controls | THREE.OrbitControls | THREE.OrbitControls | Allow the camera to orbit around a target |
39-
| meshOptions | MeshOptions | {} | - |
36+
| meshOptions | MeshOptions[] | [] | customize mesh options per stl-model |
4037

4138
## Output Events
4239
| Attr | Details |
@@ -60,14 +57,5 @@ Contributing
6057
===
6158
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using `yarn lint` and `yarn test`.
6259

63-
License
64-
===
65-
66-
angular-stl-model-viewer is Copyright © 2018 [tevim GmbH][tevim]. It is free software, and may be redistributed under the terms specified in the [LICENSE][license] file.
6760

68-
[circleci]: https://circleci.com/gh/tevim/angular-stl-model-viewer
69-
[circleci-svg]: https://circleci.com/gh/tevim/angular-stl-model-viewer.svg?style=svg
70-
[license]: https://github.com/tevim/angular-stl-model-viewer/blob/master/LICENSE
71-
[releases]: https://github.com/tevim/angular-stl-model-viewer/releases
72-
[tevim]: https://www.tevim.com
73-
[live-demo]: https://tevim.github.io/angular-stl-model-viewer/examples/basic/dist/my-app/
61+
[live-demo]: https://codaline-io.github.io/angular-stl-model-viewer/examples/basic/dist/my-app/

angular.json

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

0 commit comments

Comments
 (0)