Skip to content

Commit

Permalink
refactor(multilib): Added MultiLib & MultiApp support (#1221)
Browse files Browse the repository at this point in the history
Please provide a brief summary of this pull request.

This PR is first atempt to provide more suitable structure for the repository so it supports multiple libraries as well as multiple application. Even all this is possible with existing CLI but its painfull process as after each run you would need to always modify angular.json to achive something like this.

The main feature that was added is https://github.com/nrwl/nx, which enchances existing CLI schematics to provide real enterprise support for multi repo.

To add additional app:
ng g app <name> <options>
To Generate library
ng g lib <name> <options>

App docs was completly refactored to use use relative scope package name to '@fundamental-ngx/core' instead of hardcoding path to library
When creating new library you can have either shared library or publishable. (more in the nx website)
This enforces running lint for the CI adn now we are using true angular cli tslint.json
Refactored many files under apps/docs to refer to new scope package '@fundamental-ngx/core' (We had many hardcoded links)
make some changes in the in the imports where we work with moment js. (We should not import whole moment JS library only features that we use
Current structure

/apps/* - have docs app
/libs/*. => place is existing libray adn created scoped package '@fundamental-ngx/core'

Updated build scripts adn paths This will be finetuned in this PR to see if CI can run properly

the Library package.json should not include any dependencies or devDependencies - only peer. Also the CI build shoudl npm install from the main/root package.json

How it knows to lookup the right classes when you import it like this '@fundamental-ngx/core' ?

in the root tsconfig.json you will seePATHS that setups the aliases so application can easily resolve this.
To build

ng build docs
ng build core

To lint
ng lint docs
ng lint core
  • Loading branch information
fkolar committed Sep 6, 2019
1 parent eeb5df0 commit 70e9e5d
Show file tree
Hide file tree
Showing 1,276 changed files with 16,333 additions and 15,498 deletions.
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
package.json
package-lock.json
package-lock.json
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
language: node_js
sudo: required
node_js: 10.15.0
cache: npm
dist: trusty
addons:
chrome: stable

git:
depth: false
script:
- npm run build
- npm run build-all
jobs:
include:
- stage: Lint and Test
script: npm run test && npm run test:coveralls && npm run build-pack-library
script: npm run lint && npm run test && npm run test:coveralls && npm run build-pack-library
- stage: Pre-release
if: branch = master
before_deploy:
Expand Down
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"nrwl.angular-console",
"angular.ng-template",
"ms-vscode.vscode-typescript-tslint-plugin",
"esbenp.prettier-vscode"
]
}
Loading

0 comments on commit 70e9e5d

Please sign in to comment.