Asking for help from docker experts re custom extensions issue

Hi @Hyperbytes,

I see you are raising a good point here about the docker based projects and the installation of the custom Wappler extensions.

There is indeed an extra step involved in the packaging of your custom extension to solve this problem.

You have to include an additional copy files post install script within the extension itself that is run on install and copies the required files in the extensions project folder and from there they are distributed to the rest.

See as example the extension from @tbvgl wappler-advanced-logger - npm

and specifically in the project.json:

"scripts": {
        "postinstall": "node scripts/copyFiles.js"
    },

and the in the scripts folder in copyFiles.js:

const fs = require('fs-extra');
const path = require('path');

const srcDir = path.join(__dirname, '../server_connect');
const destDir = path.join(__dirname, '../../../extensions/server_connect');

const subDirs = fs.readdirSync(srcDir, { withFileTypes: true })
    .filter(dirent => dirent.isDirectory())
    .map(dirent => dirent.name);

for (const subDir of subDirs) {
    const srcSubDir = path.join(srcDir, subDir);
    const destSubDir = path.join(destDir, subDir);

    if (!fs.existsSync(destSubDir)) {
        fs.mkdirSync(destSubDir, { recursive: true });
    }

    fs.copySync(srcSubDir, destSubDir, { overwrite: true });
}

This generic copyFiles.js can be enhanced also the copy any app_connect files as well if the extension requires them.

So try adjusting your extensions with this and see how it works.

We should add this instructions then also the the instructions for packaging custom extensions.