Can find module js ?
hotrungnhan opened this issue ยท 10 comments
Instructions
Please fill out the template below to the best of your ability and include a label indicating which tool/service you were working with when you encountered the problem.
Node 16.14.2
Problem
<what is the problem you've encountered?>
I use processFolder api with setEnv to build js script with import constract to be binding with address map, but when i import flow-cadut/generator it cant find this module ?
Steps to Reproduce
Acceptance Criteria
Context
<what are you currently working on that this is blocking?>
Could be CommonJS problem... ๐ค
Can you try import
instead?
@MaxStalker blame here it was on this line, the publish package was built to ./package/dist/somefile.js not ./dist/package/somefile.js example for the generator which is :
./generator/dist/generator.module.js
another thing is that prebuild template wasn't in the generator so it keep throwing out Handlerbars.templates.sometemplate is undefine , I dont known why . can u give it a try ?
blame here
@hotrungnhan thanks for the notes :)
Will take a look now.
@hotrungnhan templates are pre-built here:
https://github.com/onflow/flow-cadut/blob/main/generator/src/templates/index.js
Checking now if they are included in the bundle.
const path = require("path")
const { processFolder } = require("flow-cadut/generator");
(async () => {
const input = path.resolve("./scripts");
const output = path.resolve("./dist");
await processFolder(input, output);
console.log("โ
Done!");
})();
this is my sample can u try ?
@MaxStalker is't this sample ok ? i check on version 0.15.0 do not work as well.
@hotrungnhan working on it, sorry it took a bit more time than I anticipated ๐
@hotrungnhan working on it, sorry it took a bit more time than I anticipated ๐
=)) respect ><
Can you give a try to version 0.1.16-alpha.4
?
@MaxStalker it print out the file list , but the output folder isn't generated