Closed BWsix closed 2 years ago
Since Nuxtjs and Nextjs provide their own create-app feature, how do you think using them inside create-liff-app and replacing the result with our templates?
I did some changes (https://github.com/line/create-liff-app/pull/15/commits/c406a40b82db1ffac6a30553329bc0f6d239ce8f) and create-liff-app will now generate nextjs & nuxtjs projects using their create-app
feature. Does this look ok to you?
Changes:
create-app
. Then, create-liff-app will use its template to overwrite the generated files./templates/nextjs
& /templates/nuxtjs
since they are the same as the create-app
generated ones.nuxtjs projects generated by the current version(1.0.4) of create-liff-app do not work as expected, as it always throws this error: Error: liffId is necessary for liff.init(). I do not know how to fix that.
Also, as I mentioned in the original PR, nuxtjs app does not work as expected. Therefore, I am unsure if the above change will break anything. Please remember to double-check the changes!
let us set up CI to automatically test and lint before merging
Please help me out on this one, as I do not know how😅
Thank you and your team for the time and effort you spent reviewing this PR👍
Maybe we should fix the test since the local test fails. yarn test
Merging this! 🎉
Fixes https://github.com/line/create-liff-app/issues/11
This PR changes how
create-liff-app
install dependencies, ensuring that all dependencies used in generated projects are up-to-date. I'm not sure if this is fixing the issue or making it even worse, any feedback would be great🙏Changes:
.eslinerc.js
'linebreak-style': ['error', 'unix']
since all the linebreaks are inCRLF
dependencies
anddevDependencies
fields in everypackage.json
in/templates
(except for nuxtjs templates)@line/create-liff-app
upgradation scriptcreate-liff-app.ts
templates
object in the end of the file to store all the dependencies used by different frameworksenvPrefix
andenvFileNameVariants
intotemplates
objectinstall
function now installs dependencies fromtemplates
object in runtimeProblems that need to be discussed:
create-liff-app
do not work as expected, as it always throws this error:Error: liffId is necessary for liff.init()
. I do not know how to fix that.no
on the questioninstall now
,create-liff-app
will first runnpm install --package-lock-only
to install the latest version of the packages without actually saving them to the node_modules, then usefs.rmSync
to delete the generatedpackage-lock.json
. I do not think this is a good way of handling the problem and maybe it needs to be replaced? Below are two possible fixes that I came up with. What do you think?install now
option and install the dependencies by default listcreate-next-app
does. This is lesserror-prone.dependencies
anddevDependencies
fields in everypackage.json
in/templates
. Use them to generate outdated dependencies as it does in the current version(1.0.4) ofcreate-liff-app
, then remind the user to upgrade the dependencies in theshowDoneComments
function.Notes:
Nuxtjs
create-nuxt-app
are hardcoded intopackage.json
, so this refactor followed the conversion and only@line/liff
is installed in the runtime