Skip to content

Commit

Permalink
WIP remove imagery modules + add custom-webpack + add imagery submodu…
Browse files Browse the repository at this point in the history
…les … (#3269)

* remove imagery modules + add custom-webpack + add imagery submodules +update packages-list.json

* moved submodule to ansyn-imagery-submodules

* update submodule to a new commit

* linting + rename @ansyn/ol to @ansyn/imagery-ol + remove imageries packages from build-libs.sh script + update cesium

* clear code

* change tsconfig libs paths to imagery-submodules

* change submodule reference

* change submodule commit ref

* adding script for building submodules libs and add it to travis

* fix

* building libs

* resolve comments

* resolve comments

* resolve comments

* reslove comments

* remove test submodules script

* --max_old_space_size=20000

* build libs with enableIvy false

* fix travis build

* fix docker file

* try fix build script

* try check build docker

* try fix docker

* try fix build

* try remove --prod

* return --prod

* working tests

* try add extra console outputs to build prod

* try add memory to build --prod

* try fix travis 10m limit

* return to previus angular json state

* try add travis improvements

* remove source map from prod

* resolve comment - add cesium and webpack issue reference

Co-authored-by: suzanz <[email protected]>
Co-authored-by: asafMasa <[email protected]>
  • Loading branch information
3 people authored Jun 21, 2020
1 parent 1c2d023 commit a585503
Show file tree
Hide file tree
Showing 230 changed files with 6,385 additions and 18,383 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src/app/@ansyn/imagery-submodules"]
path = src/app/@ansyn/imagery-submodules
url = https://github.com/AnSyn/imagery.git
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
os: linux
#from https://github.com/zcash/zcash/issues/341
sudo: required
dist: trusty

os: linux
addons:
chrome: stable

Expand All @@ -24,8 +27,11 @@ before_script:
#- apt-get install graphicsmagick # for e2e screenshots

script:
- npm run lint:submodules
- npm run lint
# - npm run test:single-run:submodules
- npm run test:single-run
- npm run build:submodules:libs
- npm run build:libs
- sh -x scripts/build.sh ansyn $TRAVIS_COMMIT $TRAVIS_TAG

Expand Down
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ FROM node as builder
WORKDIR /ng-app
COPY . .

RUN echo "Stage 1: Build"

RUN npm set progress=false \
&& npm config set depth 0 \
&& npm cache clean --force

RUN echo "RUN npm run install:submodules"
RUN npm run install:submodules

RUN echo "RUN npm install && npm run build:prod"
RUN npm install && npm run build:prod

RUN echo "Stage 2: Setup"
# Stage 2: Setup
FROM nginx:1.13-alpine

Expand Down
72 changes: 39 additions & 33 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular-builders/custom-webpack:browser",
"options": {
"customWebpackConfig": {
"path": "./custom-webpack.config.js"
},
"aot": true,
"outputPath": "dist",
"index": "src/index.html",
Expand Down Expand Up @@ -64,7 +67,7 @@
],
"optimization": true,
"outputHashing": "all",
"sourceMap": true,
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
Expand All @@ -81,7 +84,7 @@
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"builder": "@angular-builders/custom-webpack:dev-server",
"options": {
"browserTarget": "ansyn:build"
},
Expand All @@ -101,8 +104,11 @@
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"builder": "@angular-builders/custom-webpack:karma",
"options": {
"customWebpackConfig": {
"path": "./custom-webpack.config.js"
},
"main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts",
Expand Down Expand Up @@ -472,86 +478,86 @@
}
}
},
"@ansyn/ol": {
"root": "src/app/@ansyn/ol",
"sourceRoot": "projects/ansyn/ol/src",
"@ansyn/imagery-ol": {
"root": "src/app/@ansyn/imagery-submodules/imagery-ol",
"sourceRoot": "src/app/@ansyn/imagery-submodules/imagery-ol/src",
"projectType": "library",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "src/app/@ansyn/ol/tsconfig.lib.json",
"project": "src/app/@ansyn/ol/ng-package.json"
"tsConfig": "src/app/@ansyn/imagery-submodules/imagery-ol/tsconfig.lib.json",
"project": "src/app/@ansyn/imagery-submodules/imagery-ol/ng-package.json"
},
"configurations": {
"production": {
"project": "src/app/@ansyn/ol/ng-package.json"
, "tsConfig": "src/app/@ansyn/ol/tsconfig.lib.prod.json"
}
"project": "src/app/@ansyn/imagery-submodules/imagery-ol/ng-package.json",
"tsConfig": "src/app/@ansyn/imagery-submodules/imagery-ol/tsconfig.lib.prod.json"
}
}
}
}
},
"@ansyn/imagery-cesium": {
"root": "src/app/@ansyn/imagery-cesium",
"sourceRoot": "projects/ansyn/imagery-cesium/src",
"root": "src/app/@ansyn/imagery-submodules/imagery-cesium",
"sourceRoot": "src/app/@ansyn/imagery-submodules/imagery-cesium/src",
"projectType": "library",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "src/app/@ansyn/imagery-cesium/tsconfig.lib.json",
"project": "src/app/@ansyn/imagery-cesium/ng-package.json"
"tsConfig": "src/app/@ansyn/imagery-submodules/imagery-cesium/tsconfig.lib.json",
"project": "src/app/@ansyn/imagery-submodules/imagery-cesium/ng-package.json"
},
"configurations": {
"production": {
"project": "src/app/@ansyn/imagery-cesium/ng-package.json"
, "tsConfig": "src/app/@ansyn/imagery-cesium/tsconfig.lib.prod.json"
}
"project": "src/app/@ansyn/imagery-submodules/imagery-cesium/ng-package.json",
"tsConfig": "src/app/@ansyn/imagery-submodules/imagery-cesium/tsconfig.lib.prod.json"
}
}
}
}
},
"@ansyn/imagery-video": {
"root": "src/app/@ansyn/imagery-video",
"sourceRoot": "projects/ansyn/imagery-video/src",
"root": "src/app/@ansyn/imagery-submodules/imagery-video",
"sourceRoot": "src/app/@ansyn/imagery-submodules/imagery-video/src",
"projectType": "library",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "src/app/@ansyn/imagery-video/tsconfig.lib.json",
"project": "src/app/@ansyn/imagery-video/ng-package.json"
"tsConfig": "src/app/@ansyn/imagery-submodules/imagery-video/tsconfig.lib.json",
"project": "src/app/@ansyn/imagery-submodules/imagery-video/ng-package.json"
},
"configurations": {
"production": {
"project": "src/app/@ansyn/imagery-video/ng-package.json"
, "tsConfig": "src/app/@ansyn/imagery-video/tsconfig.lib.prod.json"
}
"project": "src/app/@ansyn/imagery-submodules/imagery-video/ng-package.json",
"tsConfig": "src/app/@ansyn/imagery-submodules/imagery-video/tsconfig.lib.prod.json"
}
}
}
}
},
"@ansyn/imagery": {
"root": "src/app/@ansyn/imagery",
"sourceRoot": "src/app/@ansyn/imagery",
"root": "src/app/@ansyn/imagery-submodules/imagery",
"sourceRoot": "src/app/@ansyn/imagery-submodules/imagery/src",
"projectType": "library",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "src/app/@ansyn/imagery/tsconfig.lib.json",
"project": "src/app/@ansyn/imagery/ng-package.json"
"tsConfig": "src/app/@ansyn/imagery-submodules/imagery/tsconfig.lib.json",
"project": "src/app/@ansyn/imagery-submodules/imagery/ng-package.json"
},
"configurations": {
"production": {
"project": "src/app/@ansyn/imagery/ng-package.json"
, "tsConfig": "src/app/@ansyn/imagery/tsconfig.lib.prod.json"
}
"project": "src/app/@ansyn/imagery-submodules/imagery/ng-package.json",
"tsConfig": "src/app/@ansyn/imagery-submodules/imagery/tsconfig.lib.prod.json"
}
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions custom-webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* This file was added in order to overcome a bug with Cesium and webpack (CesiumGS/cesium#8673) - it enables custom webpack config. */
// TODO - file should be removed in Cesium future versions.
module.exports = {
node: {
// Resolve node module use of fs
fs: "empty",
Buffer: false,
http: "empty",
https: "empty",
zlib: "empty"
}
};
Loading

0 comments on commit a585503

Please sign in to comment.