Skip to content

SSR support #202

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

Open
wants to merge 18 commits into
base: next
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 1 addition & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ root = true
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = 0
max_line_length = off
trim_trailing_whitespace = false
48 changes: 30 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
# Node
node_modules/*
npm-debug.log
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc

# dependencies
node_modules

# JetBrains
.idea
# IDEs and editors
/.idea
.project
.settings
.idea/*
*.iml
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio Code
.vscode/
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# Windows
Thumbs.db
Desktop.ini
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# Mac
# System Files
.DS_Store
**/.DS_Store

# Angular
/aot
Thumbs.db
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"printWidth": 120,
"singleQuote": true,
"trailingComma": "es5",
"parser": "typescript"
}
103 changes: 57 additions & 46 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,72 @@
language: node_js
sudo: false
node_js:
- '6'

env:
- NPM_CONFIG_LOGLEVEL='warn'
- 'lts/*'
install:
- yarn
cache:
yarn: true
directories:
- node_modules
- projects/ngx-openlayers/node_modules
- dist

jobs:
include:
- stage: build library
before_script:
- rm -rf lib
- stage: check
name: next lib linting
script:
- npm pack
- mkdir -p lib
- cp *.tgz lib/
cache:
directories:
- lib
- stage: build demo
before_install:
- cd example
install:
- npm i
- yarn lint

- stage: build
name: next lib and demo
script:
- npm un -S ngx-openlayers
- cp -r ../lib .
- npm i -S lib/*.tgz
- npm run build
cache:
directories:
- lib
- stage: deploy library release
script: ignore
- yarn build --prod --base-href "/ngx-openlayers/" --progress false

- stage: release
name: next lib version on github releases
if: tag =~ /^\d+.\d+.\d+-next.\d+$/
script: 'true' # skips tests
before_deploy:
- cd dist/ngx-openlayers
- cp ../../projects/ngx-openlayers/CHANGELOG.md CHANGELOG.md
- npm pack
deploy:
- provider: releases
api_key: $GITHUB_OAUTH_TOKEN
file_glob: true
file: lib/*
skip_cleanup: true
on:
tags: true
- stage: deploy demo pages
script: ignore
- provider: releases
prerelease: true
api_key: $GITHUB_OAUTH_TOKEN
file_glob: true
file: '*.tgz'
skip_cleanup: true
on:
tags: true

- stage: release
name: next demo on github pages
if: tag =~ /^\d+.\d+.\d+-next.\d+$/
script: 'true' # skips tests
before_deploy:
- cd dist/demo-ngx-openlayers
deploy:
- provider: pages
local_dir: dist
skip_cleanup: true
github_token: $GITHUB_OAUTH_TOKEN
on:
tags: true
- stage: publish library release
- provider: pages
local_dir: dist/demo-ngx-openlayers
skip_cleanup: true
github_token: $GITHUB_OAUTH_TOKEN
on:
tags: true

- stage: deploy
name: next lib version on npm
if: tag =~ /^\d+.\d+.\d+-next.\d+$/
script: 'true' # skips tests
before_deploy:
- cp projects/ngx-openlayers/CHANGELOG.md dist/ngx-openlayers/CHANGELOG.md
- cd dist/ngx-openlayers
deploy:
provider: npm
- provider: npm
email: $NPM_EMAIL
api_key: $NPM_TOKEN
tag: next
skip_cleanup: true
on:
tags: true
skip_cleanup: true

3 changes: 3 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# ngx-openlayers [![Build Status](https://travis-ci.org/quentin-ol/ngx-openlayers.svg?branch=master)](https://travis-ci.org/quentin-ol/ngx-openlayers)[![Join the chat at https://gitter.im/ngx-openlayers](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ngx-openlayers?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

## Demo
https://quentin-ol.github.io/ngx-openlayers/

## Installation

To install this library, run:
Expand Down
191 changes: 191 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"demo-ngx-openlayers": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {
"@schematics/angular:component": {
"inlineTemplate": true,
"inlineStyle": true,
"spec": false
},
"@schematics/angular:class": {
"spec": false
},
"@schematics/angular:directive": {
"spec": false
},
"@schematics/angular:guard": {
"spec": false
},
"@schematics/angular:module": {
"spec": false
},
"@schematics/angular:pipe": {
"spec": false
},
"@schematics/angular:service": {
"spec": false
}
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/demo-ngx-openlayers",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css",
"projects/ngx-openlayers/node_modules/openlayers/dist/ol.css"
],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "demo-ngx-openlayers:build"
},
"configurations": {
"production": {
"browserTarget": "demo-ngx-openlayers:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "demo-ngx-openlayers:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"src/styles.css"
],
"scripts": [],
"assets": [
"src/favicon.ico",
"src/assets"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
],
"tslintConfig": "tslint-prettier.json",
"typeCheck": true
}
}
}
},
"demo-ngx-openlayers-e2e": {
"root": "e2e/",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "demo-ngx-openlayers:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"ngx-openlayers": {
"root": "projects/ngx-openlayers",
"sourceRoot": "projects/ngx-openlayers/src",
"projectType": "library",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "projects/ngx-openlayers/tsconfig.lib.json",
"project": "projects/ngx-openlayers/ng-package.json"
},
"configurations": {
"production": {
"project": "projects/ngx-openlayers/ng-package.prod.json"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/ngx-openlayers/src/test.ts",
"tsConfig": "projects/ngx-openlayers/tsconfig.spec.json",
"karmaConfig": "projects/ngx-openlayers/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/ngx-openlayers/tsconfig.lib.json",
"projects/ngx-openlayers/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
],
"tslintConfig": "tslint-prettier.json",
"typeCheck": true
}
}
}
}
},
"defaultProject": "demo-ngx-openlayers"
}
Loading