2

I'm trying to share my code from my front (hyperapp) to my admin (hyperapp to) to make "preview" button.

The setup of these projects was made by an other dev, so i had to learn hyperapp workflow on the job, i'm not expert. From what i know he was inspired by Facebook React conf.

All my usefull code is in src/ folder, and there is many dependencies so i have to export all (api, constants, utils, etc..).

Here is my bit configuration (that work, it export code correctly):

    "bit": {
        "env": {
            "compiler": "bit.envs/compilers/react@1.0.2"
        },
        "packageManager": "yarn",
        "packageManagerArgs": [
            "--production",
            "--no-optional"
        ],
        "packageManagerProcessOptions": {
            "shell": true
        },
        "resolveModules": {
            "modulesDirectories": [
                "src"
            ]
        },
        "dist": {
            "entry": "src",
            "target": "dist"
        }
    }

So, the code is "correctly" exported to bit.dev, but, when i import it from my admin with

"@bit/adrienbelair.betterise-web.modules": "^0.3.0",

i get the following error after running yarn:

yarn install
ls: Command failed.
Exit code: 1
Command: node .bit.postinstall.js
...
Error: ENOTDIR: not a directory, mkdir 'node_modules/utils/HOA'

Yes, if i look into node_module, utils is a file, and not a directory All these are auto-generated, i dont understand what am i doing wrong?

Second thing, probably from this above error, when i try to import a component (even if there is an error, vendor are downloaded and at their place), i get:

import { Advice } from '@bit/adrienbelair.betterise-web.modules/dist/modules';
./node_modules/@bit/adrienbelair.betterise-web.api/controlleur.js
Module not found: Can't resolve 'api' in '/Users/prinzivalle/Web/betterise/admin-front/node_modules/@bit/adrienbelair.betterise-web.api'

From this line (if i look into node_module, where the error is thrown):

import { User, Cardline } from 'api';

I know, its a very specific case, mine, but i dont find any forum or explicit tutorial. Only some little component export with not a lot of dependencies. I made my code with a little knowledge of Hyperapp/React and without thinking about sharing it one day..

Thank for reading.

Georgio
  • 87
  • 18
  • When i fixe one "ENOTDIR: not a directory, mkdir [path/to/module]" error by changing project three, there is an other one. Is there a particular project three to respect? Folder/Component names? – Georgio Aug 29 '19 at 14:01
  • Hi, It is very likely that the React compiler is a misfit for hyperapp components. You might want to try and import the code into your app instead of installing it. – Tally Barak Nov 14 '19 at 12:07
  • My main goal was to not duplicate project, finally, i use an iframe to acheive that. I want to make a preview button, not really sharing components and reuse each of it, but display a whole page. – Georgio Nov 15 '19 at 13:06

0 Answers0