question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running ui-jar in an NX setup

See original GitHub issue

@nording I like your approach running this tool within a test environment. I tried to run it within an NX setup which has a slightly different structure than pure Angular CLI projects.

β”œβ”€β”€ README.md
β”œβ”€β”€ angular.json
β”œβ”€β”€ apps
β”‚Β Β  β”œβ”€β”€ app1
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ browserslist
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ src
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ tsconfig.app.json
β”‚Β Β  β”‚Β Β  └── tslint.json
β”‚Β Β  └── ui-jar
β”‚Β Β      β”œβ”€β”€ browserslist
β”‚       β”œβ”€β”€ src
β”‚Β Β      β”‚Β Β  β”œβ”€β”€ app
β”‚Β Β      β”‚Β Β  β”‚Β Β  β”œβ”€β”€ app.component.html
β”‚Β Β      β”‚Β Β  β”‚Β Β  β”œβ”€β”€ app.component.scss
β”‚Β Β      β”‚Β Β  β”‚Β Β  β”œβ”€β”€ app.component.ts
β”‚Β Β      β”‚Β Β  β”‚Β Β  └── app.module.ts
β”‚Β Β      β”‚Β Β  β”œβ”€β”€ assets
β”‚Β Β      β”‚Β Β  β”œβ”€β”€ environments
β”‚Β Β      β”‚Β Β  β”‚Β Β  β”œβ”€β”€ environment.prod.ts
β”‚Β Β      β”‚Β Β  β”‚Β Β  └── environment.ts
β”‚Β Β      β”‚Β Β  β”œβ”€β”€ favicon.ico
β”‚Β Β      β”‚Β Β  β”œβ”€β”€ index.html
β”‚Β Β      β”‚Β Β  β”œβ”€β”€ main.ts
β”‚Β Β      β”‚Β Β  β”œβ”€β”€ polyfills.ts
β”‚Β Β      β”‚Β Β  β”œβ”€β”€ styles.scss
β”‚Β Β      β”‚Β Β  └── test.ts
β”‚Β Β      β”œβ”€β”€ tsconfig.app.json
β”‚Β Β      └── tslint.json
β”œβ”€β”€ jest-global-mocks.ts
β”œβ”€β”€ jest.config.js
β”œβ”€β”€ libs
β”‚Β Β  β”œβ”€β”€ lib1
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ src
β”‚Β Β  β”‚Β Β  └── tsconfig.lib.json
β”‚Β Β  └── lib2
β”‚Β Β      β”œβ”€β”€ src
β”‚Β Β      β”‚Β Β  β”œβ”€β”€ xyz
β”‚Β Β      β”‚Β Β  β”‚Β Β  β”œβ”€β”€ xyz.component.spec.ts
β”‚Β Β      β”‚Β Β  β”‚Β Β  β”œβ”€β”€ xyz.component.ts
β”‚Β Β      β”‚Β Β  └── ute.module.ts
β”‚Β Β      └── tsconfig.lib.json
β”œβ”€β”€ nx.json
β”œβ”€β”€ package-lock.json
β”œβ”€β”€ package.json
β”œβ”€β”€ setup-jest.ts
β”œβ”€β”€ tools
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ tsconfig.spec.json
└── tslint.json

As a testing framework I’m using jest. To me it’s not exactly clear, wherefore the exclude/include setup is and how it can match the expectations within my setup.

Open β€œprojects/ui-jar/tsonfig.app.json” and add following:

"exclude": [
    ...
    "../../src/**/*.spec.ts"
]
"include": [
    "**/*.ts",
    "../../src/**/*.ts"
]

Appreciate your work and feedback.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
alyalincommented, Sep 23, 2018

I use nx and generated the docs app with this tsconfig.app.json:

{
  "extends": "../../tsconfig.json",
  "compilerOptions": {
    "outDir": "../../dist/out-tsc/apps/docs",
    "module": "es2015",
    "types": []
  },
  "exclude": [
    "src/test.ts",
    "**/*.spec.ts",
    "../../libs/**/*.spec.ts"
  ],
  "include": [
    "**/*.ts",
    "../../libs/**/*.ts"
  ]
}

NPM scripts:

"ui-jar": "node node_modules/ui-jar/dist/bin/cli.js --directory ./libs/ --includes \\.ts$",
"docs:watch": "npm run ui-jar -- --watch",
"docs:serve": "npm run ui-jar && ng serve docs"

Works as expected.

0reactions
paeskucommented, Sep 23, 2018

@picomis thank you pointing me in the right direction.
First I referenced my app’s path for ui-jar instead the ./libs/ path. Second I missed the comment in my component to group it within the sidebar:

/**
 * @group Layout
 * @component LabelValue
 * @description Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 */

Thanks all for help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Start NX without graphical UI for NX remote
Is it possible to start NX without graphical interface? Since this NX session will be controlled by remote executable, the UI is not...
Read more >
Field 'browser' doesn't contain a valid alias configuration #8036
The build fails when trying to perform a build involving a requirejs dependency which also requires other files.
Read more >
Finding files and syntax notes - Engineering.com
Compiling and linking tools providing by NX use <NX install directory>\UGOPEN\ as the base directory for all include files.
Read more >
Chapter 3. The Seam life cycle - Seam in Action
Once running, the servlet container also notifies Seam when HTTP sessions ... Ade ncz htikn le dxr Skmz life cycle sc nz oltnuivoe...
Read more >
Installing Cisco License Manager
If you want to install using a command line script, see Running the Command Line Installation ... Client packageβ€”clm-ui.jar and clm-sdk.jar.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found