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

[pull] master from SAP:master #1056

Open
wants to merge 6 commits into
base: master
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ cache:
- $TRAVIS_BUILD_DIR/cypress-binary-cache
- $TRAVIS_BUILD_DIR/client-frameworks-support/client-support-angular
- $TRAVIS_BUILD_DIR/client-frameworks-support/testing-utilities/dist
- $TRAVIS_BUILD_DIR/container/public
- $HOME/.cache/Cypress
- $HOME/.cache/whitesource
notifications:
Expand Down Expand Up @@ -99,6 +100,9 @@ jobs:
- head $TRAVIS_BUILD_DIR/client/public/package.json
- ls -lah $TRAVIS_BUILD_DIR/test/e2e-test-application/node_modules/@luigi-project
- ls -lah $TRAVIS_BUILD_DIR/test/e2e-test-application/node_modules/@luigi-project/client/
# Check container files and package json version are correct
- ls -lah $TRAVIS_BUILD_DIR/container/public
- cat $TRAVIS_BUILD_DIR/container/public/package.json
- echo "check if luigi-client.d.ts exists" && cat $TRAVIS_BUILD_DIR/test/e2e-test-application/node_modules/@luigi-project/client/luigi-client.d.ts | grep -C 3 "withoutSync" || travis_terminate 1
- lerna run build --ignore docs || travis_terminate 1
- npm test --prefix core || travis_terminate 1
Expand Down Expand Up @@ -201,6 +205,15 @@ jobs:
before_cache:
- rm -rf ~/.npm/_logs
- rm -rf ~/.npm/_cacache
- name: 'Publish Luigi Container to NPM'
# run only when custom commit message given to Travis
if: repo = SAP/luigi AND (type = api AND commit_message = publish-luigi-container)
script:
- ls ./container/public
- bash ./scripts/npmPublish.sh luigi-container-release
before_cache:
- rm -rf ~/.npm/_logs
- rm -rf ~/.npm/_cacache


# ----- SETUP EXAMPLES TESTS -----
Expand Down
8 changes: 8 additions & 0 deletions container/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/node_modules/
/public/bundle.js
/public/bundle.js.map
/public/bundle.d.ts
/public/bundle.d.ts.map
/test-app/bundle.js
/test-app/bundle.js.map
.DS_Store
52 changes: 52 additions & 0 deletions container/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

# Luigi Container

## Overview
Luigi Container is a [web component](https://developer.mozilla.org/en-US/docs/Web/Web_Components) that can be included in an arbitrary application, in order to render a Luigi micro frontend (iframe or web component based) without the need of being a Luigi Core application.

## Usage
1. Install the container package: `@luigi-project/container`

```
npm install @luigi-project/container
```

2. Import it into your project:


```
import '@luigi-project/container';
```

3. You can now use the Luigi container as follows anywhere in your application:

```
<luigi-container
viewURL="https://www.example-microfronted.com"
webcomponent="false"
label="my label"
context='{"label": "Calendar"}'>
</luigi-container>
```

4. In a similar way you can use the Luigi compound container as follows:

```
<luigi-compound-container
context='{"label": "Dashboard"}'
compoundConfig = { your config here }
</luigi-compound-container>
```


## Development

Build the bundle and start an example app:

```bash
npm install
npm run build
npm start
```

Check `./test-app/index.html` for how it is used.
Loading