Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can find module js ? #55

Open
hotrungnhan opened this issue Apr 20, 2022 · 10 comments
Open

Can find module js ? #55

hotrungnhan opened this issue Apr 20, 2022 · 10 comments
Assignees
Labels
bug Something isn't working Developer Tools Team

Comments

@hotrungnhan
Copy link
Contributor

hotrungnhan commented Apr 20, 2022

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

image

Acceptance Criteria

Context

<what are you currently working on that this is blocking?>

@hotrungnhan hotrungnhan added the bug Something isn't working label Apr 20, 2022
@MaxStalker
Copy link
Contributor

Could be CommonJS problem... 🤔
Can you try import instead?

@hotrungnhan
Copy link
Contributor Author

hotrungnhan commented Apr 20, 2022

@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

@MaxStalker
Copy link
Contributor

@hotrungnhan thanks for the notes :)
Will take a look now.

@MaxStalker
Copy link
Contributor

@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.

@hotrungnhan
Copy link
Contributor Author

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 ?

@hotrungnhan
Copy link
Contributor Author

hotrungnhan commented Apr 27, 2022

@MaxStalker is't this sample ok ? i check on version 0.15.0 do not work as well.
image

@MaxStalker
Copy link
Contributor

@hotrungnhan working on it, sorry it took a bit more time than I anticipated 😅

@hotrungnhan
Copy link
Contributor Author

@hotrungnhan working on it, sorry it took a bit more time than I anticipated 😅

=)) respect ><

@MaxStalker
Copy link
Contributor

Can you give a try to version 0.1.16-alpha.4?

@hotrungnhan
Copy link
Contributor Author

@MaxStalker it print out the file list , but the output folder isn't generated
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Developer Tools Team
Projects
None yet
Development

No branches or pull requests

2 participants