-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add template for tsconfig.json + getMetadata.ts + manifest.json #145
base: main
Are you sure you want to change the base?
Conversation
Hey port can you share the repo(extension) where you have the |
Could you please take a look at this table? We added it recently. Looks like you can use a raw object instead of a stringified and maybe simplify some logic |
Hey thanks for the comments, and I somehow did not receive a notif about Shiv's comment. So here is the repo: Maybe we should remove include, exclude and paths and keep the other two? lol this was difficult, lmk if i did anything wrong here |
Update it please, params of extension are different from this pr
Thinking without checking, but I think this should work
where |
Thanks! Could you please check again to see if i got it right? @rin-st I have also updated the example args file |
Thanks @portdeveloper ! Added some comments. Also, you can test resulting template for example with this defaults
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm! But don't merge it for now, let's wait also Shiv or Carlos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Umm @portdeveloper I think you forgot to update https://github.com/portdeveloper/test-tsconfig-ext/blob/main/extension/packages/nextjs/tsconfig.json.args.mjs ?
I am just trying to understand what extra tsConfig things we need and maybe we can set them as default in main SE-2 (for eg last time we switched "moduleResolution": "Bundler"
by default in SE-2 for better working with all extensions)
Also I think you are working on pwa extension right, so maybe can you add all the required .template.mjs
in this PR itself?
@technophile-04 And there doesn't seem to be anything an extension-builder can add besides more plugins and more compiler options? I have updated https://github.com/portdeveloper/test-tsconfig-ext/blob/main/extension/packages/nextjs/tsconfig.json.args.mjs too |
yeah true lol there not other options to add, also for pwa do you need any other more template file like |
We also need these:
Should I get the manifest.json and getMetadata in this PR as well? |
Yes could you do that please? Regarding this :
I think we need to update main SE-2 repo with Thanks @portdeveloper!! |
Sorry for the continued confusion on this. I think that won't be necessary! Because I am using the Let me quickly update that as well. |
Ohh I see! I think last time I tried using PS: I am replying to my own comment because Port replied to og comment by editing it 🤣 |
I am never gonna work under the sun again :(((((( i was like why does it say technophile there this should be a bug lmaooo |
Hey just added a commit for the manifest.json file, and hopefully I am not editing anyone's message hehe. args.mjs i used to test things: Had to make iconPath optional as that is not needed in the pwa template. |
Honestly, I don't understand how to templatize getMetadata.ts and how to use stringify. I am so confused lol |
templates/base/packages/nextjs/utils/scaffold-eth/getMetadata.ts.template.mjs
Outdated
Show resolved
Hide resolved
@@ -45,6 +48,15 @@ export const getMetadata = ({ | |||
}, | |||
icons: { | |||
icon: [{ url: "/favicon.png", sizes: "32x32", type: "image/png" }], | |||
${extraIcons[0] ? Object.entries(extraIcons[0]).map(([key, value]) => `${key}: ${JSON.stringify(value)}`).join(',\n ') : ''} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you tried ...${stringify(extraIcons[0]}
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not work since there is no object there, the "..." just gets transferred to the created file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this its fine with current logic, there doesn't seem any good way with stringify
:(, so let's use this for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also maybe let's also just this (alternate) solution below this row in the
create-eth/contributors/TEMPLATING.md
Line 177 in 0816599
# Things worth mentioning |
And mention about this discussion their
templates/base/packages/nextjs/utils/scaffold-eth/getMetadata.ts.template.mjs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @portdeveloper!! Can you create the PR for pwa on create-eth-extensions
so that we could test this branch as well as that PR and then we merge this PR?
Saying this because we try to follow this process when adding .template.mjs
like we have corresponding PR for extension.
Now when I do :
yarn cli -e portdeveloper/test-everything test-port
And in the generated instance if I do yarn next:check-types
I get some ts-errors.
Maybe a good way will be create a PWA extensions to create-eth-extensions
and test this PR too and also add more necessary template.mjs
files required in this PR
Description
Added a template for
tsconfig.json
file to the project templates.Changes
tsconfig.json
template file, removed tsconfig.jsonTesting
Here is a repo with all the changed file args
https://github.com/portdeveloper/test-everything
To-Do