trainings-juanmaguitar / schibsted-sui-tools-training-dec2018

https://gitpitch.com/trainings-juanmaguitar/schibsted-sui-tools-training/pitchme#/
2 stars 1 forks source link

cannot import properly domain into sui-bundler-demo with "sui-bundler dev" #32

Open juanmaguitar opened 5 years ago

juanmaguitar commented 5 years ago

When doing npm run build in the project staff/juanma-garrido/domain-demo it generates the lib folder w/ the ES5 version of the code

By running npm run build it will execute the following code that will use the lib version of the code

const Domain = require('./lib')
const domain = new Domain()
domain
  .get('list_students_use_case')
  .execute()
  .then(console.log) // eslint-disable-line

This works fine

But when I try to use this lib version of the code from staff/juanma-garrido/domain-demo I get this error when sui-bundler dev...

Failed to compile.

/Volumes/RINGO/PROJECTS/2018/SCHIBSTED/training-sui/schibsted-sui-tools-training/staff/juanma-garrido/domain-demo/lib/config/base.js
Module Error (from ../node_modules/thread-loader/dist/cjs.js):

/Volumes/RINGO/PROJECTS/2018/SCHIBSTED/training-sui/schibsted-sui-tools-training/staff/juanma-garrido/domain-demo/lib/config/base.js
  1:13  error  Delete `;`                                  prettier/prettier
  3:32  error  Replace `"__esModule"` with `'__esModule'`  prettier/prettier
  5:3   error  Delete `;`                                  prettier/prettier
  8:2   error  Delete `;`                                  prettier/prettier
  9:33  error  Replace `;` with `⏎`                        prettier/prettier

✖ 5 problems (5 errors, 0 warnings)
  5 errors, 0 warnings potentially fixable with the `--fix` option.

It seems that sui-bundler is evaluating w/ the linter the generated code of the lib folder Any idea of how to solve this?

Notes:

nucliweb commented 5 years ago

I think that is because you're running the server into folder staff/juanma-garrido/domain-demo and the relative path can't go to any resource upper than this folder.