Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
Merge commit '336862fc4043688db61df7c5465093d0e75c6b77' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
atomicsulfate committed Jul 28, 2020
2 parents 328eb76 + 336862f commit c2e7ce1
Show file tree
Hide file tree
Showing 210 changed files with 8,317 additions and 1,903 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**/*.d.ts
**/*.json
@here/generator-harp.gl/**/*.ts
dist/**
**/*.js
81 changes: 81 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"plugins": ["@typescript-eslint", "prettier"],
"extends": ["standard-with-typescript", "prettier/@typescript-eslint"],
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"prettier/prettier": "error",

"@typescript-eslint/no-for-in-array": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/default-param-last": "off",
"@typescript-eslint/prefer-reduce-type-parameter": "off",
"@typescript-eslint/prefer-ts-expect-error": "off",
"@typescript-eslint/no-misused-promises": "off",
"@typescript-eslint/no-array-constructor": "off",
"@typescript-eslint/no-dynamic-delete": "off",
"@typescript-eslint/no-useless-constructor": "off",
"@typescript-eslint/require-array-sort-compare": "off",
"@typescript-eslint/no-base-to-string": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-extraneous-class": "off",
"@typescript-eslint/consistent-type-assertions": "off",
"@typescript-eslint/no-invalid-void-type": "off",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/restrict-plus-operands": "off",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/return-await": "off",
"@typescript-eslint/prefer-includes": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/prefer-optional-chain": "off",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/promise-function-async": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/no-unnecessary-type-assertion": "off",
"@typescript-eslint/method-signature-style": "off",
"@typescript-eslint/lines-between-class-members": "off",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/explicit-function-return-type": "off",

"accessor-pairs": "off",
"generator-star-spacing": "off",
"handle-callback-err": "off",
"import/export": "off",
"import/first": "off",
"import/no-webpack-loader-syntax": "off",
"new-cap": "off",
"no-async-promise-executor": "off",
"no-case-declarations": "off",
"no-extra-boolean-cast": "off",
"no-inner-declarations": "off",
"no-irregular-whitespace": "off",
"no-multi-spaces": "off",
"no-multi-str": "off",
"no-new": "off",
"no-path-concat": "off",
"no-proto": "off",
"no-prototype-builtins": "off",
"no-redeclare": "off",
"no-self-assign": "off",
"no-tabs": "off",
"no-unneeded-ternary": "off",
"no-useless-call": "off",
"no-useless-computed-key": "off",
"no-useless-escape": "off",
"no-useless-return": "off",
"operator-linebreak": "off",
"prefer-const": "off",
"prefer-promise-reject-errors": "off",
"promise/param-names": "off",
"quote-props": "off",
"space-in-parens": "off",
"spaced-comment": "off",
"standard/no-callback-literal": "off",
"valid-typeof": "off",
"wrap-iife": "off"
}
}
31 changes: 17 additions & 14 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,19 @@ jobs:
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.node_version }}--yarn-${{ hashFiles('**/yarn.lock') }}
key: yarn-${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
yarn-${{ runner.os }}-${{ matrix.node_version }}-
yarn-${{ runner.os }}-
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}
- name: Install dependencies
run: yarn
run: yarn --frozen-lockfile
- name: Disable hard-source-webpack-plugin
run: echo "::set-env name=HARP_NO_HARD_SOURCE_CACHE::true"
- name: Pretest
run: yarn run pre-test
shell: bash
Expand Down Expand Up @@ -80,22 +83,22 @@ jobs:
yarn test-browser --headless-chrome --timeout ${{ env.browserTestTimeout }}
shell: bash
if: matrix.os == 'windows-latest'
- name: Tests on Firefox (Windows)
run: |
export PATH=`pwd`:$PATH
cp node_modules/geckodriver/geckodriver.exe .
yarn test-browser --headless-firefox --timeout ${{ env.browserTestTimeout }}
if: matrix.os == 'windows-latest'
shell: bash
- name: Tests on Chrome (Linux)
run: |
set -ex
yarn
yarn --frozen-lockfile
google-chrome --version
whereis google-chrome
yarn test-browser --headless-chrome --timeout ${{ env.browserTestTimeout }}
shell: bash
if: matrix.os == 'ubuntu-latest'
- name: Tests on Firefox (Windows)
run: |
export PATH=`pwd`:$PATH
cp node_modules/geckodriver/geckodriver.exe .
yarn test-browser --headless-firefox --timeout ${{ env.browserTestTimeout }}
if: matrix.os == 'windows-latest'
shell: bash
- name: Tests on Firefox (Linux)
run: |
set -ex
Expand All @@ -104,11 +107,11 @@ jobs:
yarn test-browser --headless-firefox --timeout ${{ env.browserTestTimeout }}
shell: bash
if: matrix.os == 'ubuntu-latest'
- name: Build examples
run: yarn run build-examples
shell: bash
- name: Build bundle
run: yarn run build-bundle
shell: bash
- name: Build examples
run: yarn run build-examples
shell: bash
- name: Generate doc
run: yarn run typedoc
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules/
dist/
doc/
coverage/
test-npm-packages-app/
.vscode/
.DS_Store
Expand Down
12 changes: 2 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ branches:

env:
- DETECT_CHROMEDRIVER_VERSION=true
- HARP_NO_HARD_SOURCE_CACHE=true

before_install:
- yarn global add codecov
Expand Down Expand Up @@ -44,22 +45,13 @@ jobs:
script: ./scripts/publish-packages.sh
skip_cleanup: true
on:
branch: release
- provider: pages
skip_cleanup: true
committer-from-gh: true
keep-history: false
local-dir: dist/gh_deploy
github-token: $GITHUB_TOKEN
on:
branch: release
tags: true
- provider: s3
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
bucket: "harp.gl"
skip_cleanup: true
local_dir: dist/s3_deploy
upload-dir: docs
region: us-east-1
acl: public_read
cache_control: no-cache
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/

import { MapControls } from "@here/harp-map-controls";
import { CopyrightElementHandler, MapView } from "@here/harp-mapview";
import { APIFormat, AuthenticationMethod, OmvDataSource } from "@here/harp-omv-datasource";
import { MapView } from "@here/harp-mapview";
import { OmvDataSource } from "@here/harp-omv-datasource";

const defaultTheme = "resources/berlin_tilezen_base.json";

Expand All @@ -23,25 +23,8 @@ export class View {
theme: this.theme,
decoderUrl: "decoder.bundle.js"
});
CopyrightElementHandler.install("copyrightNotice")
.attach(mapView)
.setDefaults([
{
id: "here.com",
label: "HERE",
link: "https://legal.here.com/terms",
year: 2019
}
]);
const omvDataSource = new OmvDataSource({
baseUrl: "https://vector.hereapi.com/v2/vectortiles/base/mc",
apiFormat: APIFormat.XYZOMV,
styleSetName: "tilezen",
authenticationCode: "<%= apikey %>",
authenticationMethod: {
method: AuthenticationMethod.QueryString,
name: "apikey"
}
authenticationCode: "<%= apikey %>"
});
mapView.addDataSource(omvDataSource);
MapControls.create(mapView);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import { Theme } from "@here/harp-datasource-protocol";
import { MapControls } from "@here/harp-map-controls";
import { CopyrightElementHandler, MapView } from "@here/harp-mapview";
import { APIFormat, AuthenticationMethod, OmvDataSource } from "@here/harp-omv-datasource";
import { MapView } from "@here/harp-mapview";
import { OmvDataSource } from "@here/harp-omv-datasource";

const defaultTheme = "resources/berlin_tilezen_base.json";

Expand Down Expand Up @@ -35,26 +35,8 @@ export class View {
decoderUrl: "decoder.bundle.js"
});

CopyrightElementHandler.install("copyrightNotice")
.attach(mapView)
.setDefaults([
{
id: "here.com",
label: "HERE",
link: "https://legal.here.com/terms",
year: 2019
}
]);

const omvDataSource = new OmvDataSource({
baseUrl: "https://vector.hereapi.com/v2/vectortiles/base/mc",
apiFormat: APIFormat.XYZOMV,
styleSetName: "tilezen",
authenticationCode: "<%= apikey %>",
authenticationMethod: {
method: AuthenticationMethod.QueryString,
name: "apikey"
}
authenticationCode: "<%= apikey %>"
});
mapView.addDataSource(omvDataSource);

Expand Down
14 changes: 13 additions & 1 deletion @here/harp-datasource-protocol/lib/DecodedTile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ export interface DecodedTile {
* @see [[CopyrightInfo]]
*/
copyrightHolderIds?: string[];

/**
* List of {@link @here/harp-geoutils#TileKey}s stored as mortonCodes representing
* {@link @here/harp-mapview#Tile}s that have geometry covering this `Tile`.
*/
dependencies?: number[];
}

/**
Expand Down Expand Up @@ -164,6 +170,12 @@ export interface Geometry {
*/
featureStarts?: number[];

/**
* Optional sorted list of feature start indices for the outline geometry.
* Equivalent to {@link featureStarts} but pointing into the edgeIndex attribute.
*/
edgeFeatureStarts?: number[];

/**
* Optional array of objects. It can be used to pass user data from the geometry to the mesh.
*/
Expand Down Expand Up @@ -372,7 +384,7 @@ export function getFeatureName(
}
if (languages !== undefined) {
for (const lang of languages) {
name = env.lookup(`${basePropName}:${lang}`) || env.lookup(`${basePropName}_${lang}`);
name = env.lookup(`${basePropName}:${lang}`) ?? env.lookup(`${basePropName}_${lang}`);
if (typeof name === "string" && name.length > 0) {
return name;
}
Expand Down
4 changes: 2 additions & 2 deletions @here/harp-datasource-protocol/lib/Expr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ export abstract class Expr {
? {
definitions,
lockedNames: new Set(),
cache: definitionExprCache || new Map<string, Expr>()
cache: definitionExprCache ?? new Map<string, Expr>()
}
: undefined;

Expand Down Expand Up @@ -577,7 +577,7 @@ export class CallExpr extends Expr {

/** @override */
protected exprIsDynamic() {
const descriptor = this.descriptor || ExprEvaluator.getOperator(this.op);
const descriptor = this.descriptor ?? ExprEvaluator.getOperator(this.op);

if (descriptor && descriptor.isDynamicOperator && descriptor.isDynamicOperator(this)) {
return true;
Expand Down
4 changes: 2 additions & 2 deletions @here/harp-datasource-protocol/lib/ExprParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class Lexer {
* Parsed text.
*/
text(): string {
return this.m_text || "";
return this.m_text ?? "";
}

/**
Expand All @@ -223,7 +223,7 @@ class Lexer {
}

private yyinp(): void {
this.m_char = this.code.codePointAt(this.m_index++) || 0;
this.m_char = this.code.codePointAt(this.m_index++) ?? 0;
}

private yylex(): Token {
Expand Down
Loading

0 comments on commit c2e7ce1

Please sign in to comment.