hjalmers / angular-generic-table

A generic table for Angular 2+. Generic table uses standard markup for tables ie. table, tr and td elements etc. and has support for expanding rows, global search, filters, sorting, pagination, export to CSV, column clicks, custom column rendering, custom export values.
https://hjalmers.github.io/angular-generic-table/
MIT License
105 stars 55 forks source link

Build error #211

Closed hjalmers closed 6 years ago

hjalmers commented 6 years ago

image

hjalmers commented 6 years ago

New build error when building through Travis CI image

hjalmers commented 6 years ago

Hi @mklein994, you wouldn't have any experience building scoped packages through travis would you? I fixed the first build error but got another one for the second package which depends on the core package which is built without errors. Not sure if the config for Travis is wrong but running the build script locally works...

mklein994 commented 6 years ago

@hjalmers, no unfortunately I don't. That's partially the reason why I wanted continuous integration; if it works in CI, I could get a sense of how to build the project from scratch 😉. Have you tried cloning the repo to a new directory and running npm install then npm run build:new from there?

mklein994 commented 6 years ago

I just tried doing that, and it failed with the same message, even when running it explicitly:

$ npx ng-packagr -p @angular-generic-table/column-settings/ng-package.json
Name Version
Operating System Ubuntu 16.04.4 LTS (Windows 10; Windows Subsystem for Linux)
Node v9.11.1 (nvm)
npm 5.6.0
mklein994 commented 6 years ago

Just a hunch; try comparing the directories between the one that works and a fresh clone after installing and building. Are any of the files different? (package-lock.json, perhaps?)

hjalmers commented 6 years ago

@mklein994 I know the reason, which I should have thought about, ng-packagr uses a different approach and in order for it to be able to build the scoped package we need to use npm link.

If you run the following command in the project root:

cd @angular-generic-table/core && npm link && cd ../../ && npm link @angular-generic-table/core

It should work. There might be some other way to let ng-packagr know where to look for the core package when building column-settings but npm link makes local development of scoped packages a lot easier too. I've added a script for this which I'll merge back to the master branch once I'm done preparing and updating the examples for angular 5+.

mklein994 commented 6 years ago

@hjalmers what editor do you use?

hjalmers commented 6 years ago

@mklein994 webstorm by jetbrains:)

mklein994 commented 6 years ago

Putting this here for future reference:

How to setup VSCode and WSL to work together:

TL;DR: run npm install in WSL for the main project and sub projects, then do the linking (npm link and npm link @angular-generic-table/*) in Windows.

These steps allow you to run npx ng serve from WSL, while working on @angular-generic-table/core or @angular-generic-table/column-settings from Visual Studio Code without it warning about missing modules.

Works as of 2018-04-18: