Skip to content

Commit

Permalink
Luigi Container Component Travis Setup Release (#2957)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndricimrr authored Feb 9, 2023
1 parent fe3a2a3 commit 64ff0f2
Show file tree
Hide file tree
Showing 33 changed files with 3,853 additions and 0 deletions.
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

0 comments on commit 64ff0f2

Please sign in to comment.