Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring #16

Merged
merged 2 commits into from
Apr 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 18 additions & 32 deletions .angular-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,39 @@
"apps": [
{
"name": "lib",
"root": "lib",
"root": "src/lib",
"outDir": "dist",
"assets": [
"assets"
],
"index": "test/index.html",
"main": "test/main.ts",
"polyfills": "test/polyfills.ts",
"test": "test/test.ts",
"assets": [],
"index": "../demo-app/index.html",
"main": "../demo-app/main.ts",
"polyfills": "../demo-app/polyfills.ts",
"test": "../test/test.ts",
"tsconfig": "tsconfig.lib.json",
"testTsconfig": "tsconfig.spec.json",
"testTsconfig": "../tsconfig.spec.json",
"prefix": "igo",
"mobile": true,
"styles": [],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
"scripts": []
},
{
"name": "demo",
"root": "demo-app",
"root": "src/demo-app",
"outDir": "dist",
"assets": [
"assets",
"locale"
"assets"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "igo",
"tsconfig": "tsconfig.demo.json",
"prefix": "demo",
"mobile": true,
"styles": [
"../node_modules/openlayers/dist/ol.css",
"../../node_modules/openlayers/dist/ol.css",
"css/styles.styl"
],
"scripts": [
"../node_modules/openlayers/dist/ol.js"
"../../node_modules/openlayers/dist/ol.js"
],
"environmentSource": "environments/environment.ts",
"environments": {
Expand All @@ -67,19 +57,15 @@
},
"lint": [
{
"project": "lib/tsconfig.lib.json",
"exclude": "**/node_modules/**/*"
},
{
"project": "lib/tsconfig.spec.json",
"project": "src/lib/tsconfig.lib.json",
"exclude": "**/node_modules/**/*"
},
{
"project": "demo-app/tsconfig.app.json",
"project": "src/tsconfig.spec.json",
"exclude": "**/node_modules/**/*"
},
{
"project": "demo-app/tsconfig.spec.json",
"project": "src/demo-app/tsconfig.demo.json",
"exclude": "**/node_modules/**/*"
},
{
Expand All @@ -89,7 +75,7 @@
],
"test": {
"karma": {
"config": "./karma.lib.conf.js"
"config": "./karma.conf.js"
}
},
"defaults": {
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

# compiled output
/dist
/lib/dist
/lib/bundle
/bundle
/tmp
/out-tsc
*.metadata.json
Expand Down
26 changes: 26 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/node_modules/
/guides/
/e2e/

# src
/src/demo-app/
/src/test/

.npmignore
.gitignore
CONTRIBUTING.md
*.tgz


# Ignore configurations
*.conf.*
tsconfig*.json
tslint.json
gulpfile.js
.*

# ignore the .ts files
*.ts

# include the .d.ts files
!*.d.ts
Empty file removed demo-app/assets/.gitkeep
Empty file.
2 changes: 0 additions & 2 deletions demo-app/assets/locale/en.json

This file was deleted.

3 changes: 0 additions & 3 deletions demo-app/assets/locale/fr.json

This file was deleted.

3 changes: 0 additions & 3 deletions demo-app/assets/locale/template.json

This file was deleted.

20 changes: 0 additions & 20 deletions demo-app/tsconfig.spec.json

This file was deleted.

12 changes: 6 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ var stylus = require('gulp-stylus');


gulp.task('copyHtml', () => {
gulp.src('./lib/src/**/*.html')
.pipe(gulp.dest('./lib/dist'));
gulp.src('./src/lib/**/*.html')
.pipe(gulp.dest('./dist'));
});

gulp.task('copyTs', () => {
gulp.src(['./lib/src/**/*.ts', '!./lib/src/**/*.spec.ts'])
gulp.src(['./src/lib/**/*.ts', '!./src/lib/**/*.spec.ts'])
.pipe(replace(/styleUrls: \[(\'\.\/|\')(.*?)\.styl\'\]/g, 'styleUrls: [\'$2.css\']'))
.pipe(gulp.dest('./lib/dist'));
.pipe(gulp.dest('./dist'));
});

gulp.task('copyStylus', () => {
gulp.src('./lib/src/**/*.styl')
gulp.src('./src/lib/**/*.styl')
.pipe(stylus())
.pipe(gulp.dest('./lib/dist'));
.pipe(gulp.dest('./dist'));
});

gulp.task('default', ['copyHtml', 'copyTs', 'copyStylus']);
6 changes: 3 additions & 3 deletions karma.demo.conf.js → karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ module.exports = function (config) {
files: [
'./node_modules/openlayers/dist/ol.js',
{
pattern: './assets/locale/*.json',
pattern: './src/assets/locale/*.json',
watched: false,
included: false,
nocache: false,
served: true
},
{ pattern: './demo-app/test.ts', watched: false }
{ pattern: './src/test/test.ts', watched: false }
],
preprocessors: {
'./demo-app/test.ts': ['@angular/cli']
'./src/test/test.ts': ['@angular/cli']
},
mime: {
'text/x-typescript': ['ts','tsx']
Expand Down
64 changes: 0 additions & 64 deletions karma.lib.conf.js

This file was deleted.

14 changes: 0 additions & 14 deletions lib/.npmignore

This file was deleted.

1 change: 0 additions & 1 deletion lib/README.md

This file was deleted.

41 changes: 0 additions & 41 deletions lib/assets/locale/en.json

This file was deleted.

41 changes: 0 additions & 41 deletions lib/assets/locale/fr.json

This file was deleted.

3 changes: 0 additions & 3 deletions lib/environments/environment.prod.ts

This file was deleted.

8 changes: 0 additions & 8 deletions lib/environments/environment.ts

This file was deleted.

Loading