-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Migrate Netlify CMS to Decap CMS #79
base: main
Are you sure you want to change the base?
Migrate Netlify CMS to Decap CMS #79
Conversation
Hi @biru-codeastromer please refer to this doc https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue on how to use keywords to properly link an issue. I have fixed it up for you previously. But you may want to do so properly moving forwards. |
Also you may want to run the build locally to make sure there are no issues before pushing code to the repo. I am current seeing the following in the logs at https://github.com/jenkins-infra/stories/pull/79/checks?check_run_id=34477938558: [2024-12-16T14:49:32.936Z] + npm run lint
[2024-12-16T14:49:33.238Z]
[2024-12-16T14:49:33.238Z] > [email protected] lint
[2024-12-16T14:49:33.238Z] > eslint .
[2024-12-16T14:49:33.238Z]
[2024-12-16T14:49:34.942Z] Browserslist: caniuse-lite is outdated. Please run:
[2024-12-16T14:49:34.942Z] npx browserslist@latest --update-db
[2024-12-16T14:49:34.943Z] Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
[2024-12-16T14:49:35.444Z]
[2024-12-16T14:49:35.445Z] /home/jenkins/agent/workspace/Websites_stories_PR-79/gatsby-config.js
[2024-12-16T14:49:35.445Z] 25:11 error Trailing spaces not allowed no-trailing-spaces
[2024-12-16T14:49:35.445Z]
[2024-12-16T14:49:35.445Z] /home/jenkins/agent/workspace/Websites_stories_PR-79/src/cms/cms.js
[2024-12-16T14:49:35.445Z] 1:17 error Unable to resolve path to module 'decap-cms-app' import/no-unresolved
[2024-12-16T14:49:35.445Z] 3:20 error Missing file extension for "../layout" import/extensions
[2024-12-16T14:49:35.445Z] 3:20 error Unable to resolve path to module '../layout' import/no-unresolved
[2024-12-16T14:49:35.445Z] 13:28 error There should be no space after '{' object-curly-spacing
[2024-12-16T14:49:35.445Z] 13:56 error There should be no space before '}' object-curly-spacing
[2024-12-16T14:49:35.445Z] 23:35 error Unexpected function expression prefer-arrow-callback
[2024-12-16T14:49:35.446Z] 28:10 error Missing semicolon semi
[2024-12-16T14:49:35.446Z] 35:5 error Unexpected console statement no-console
[2024-12-16T14:49:35.446Z]
[2024-12-16T14:49:35.446Z] ✖ 9 problems (9 errors, 0 warnings)
[2024-12-16T14:49:35.446Z] 5 errors and 0 warnings potentially fixable with the `--fix` option.
[2024-12-16T14:49:35.446Z] |
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.
Please update the file name src/cms/cms.js
to src/cms/index.js
, and update all references to this path accordingly.
Hi @krisstern Sir, Thank you for pointing that out! I appreciate you fixing the issue previously. I’ll make sure to follow the guidelines provided in the doc moving forward and use the appropriate keywords to link issues and pull requests properly. I’ll refer to the resource to ensure I’m following the best practices. Thanks for your help! |
Done Sir |
Hi @krisstern, I’ve completed fixing the previous errors, but I am still encountering issues with the layout and Decap CMS integration. It seems like the layout module is not being found in the src folder, which is causing problems with the build. Additionally, the decap-cms-app module also isn’t resolving properly. Interestingly, the same issue I saw in the template provided by the zbynek Sir comment on #1 , where the problem also occurred in the build of that repo. To resolve the npm install decap-cms-app issue, I used the yarn method as an alternative to npm. While this did successfully solve the dependency conflict, I’ve encountered a new issue after deploying the changes. Specifically, the images are no longer showing up on the deployed site. It seems like the change may have affected how the assets are being referenced or loaded. I’m currently looking into this issue. After resolving all the other errors, these 3 remaining issues persist in the logs: |
Please note we also have this issue #78 for modernizing dependecies, maybe you can use the same PR to resolve both issues. |
Okay Sir ,I will take a look at the details there and work on resolving both issues in a single PR. |
Hi Sir @krisstern ,I have encountered an issue while trying to resolve the CI checks for the project. The problem seems to occur depending on the file name and the configuration of the
It appears that whichever suggestion I follow leads to one of these errors, and I am unable to find a solution that resolves both issues at the same time.So deep driving and checking possible ways to tackle this error. |
For upgrading from React 17 to 18 there are additional steps like they outline here https://react.dev/blog/2022/03/08/react-18-upgrade-guide. So @biru-codeastromer you may want to do some more background research instead of going by trial-and-error. |
@biru-codeastromer Could you please remove the |
Also, could you please try running |
I also see the following in the stack trace currently: Error: Cannot create as TypeComposer the following value:
GraphQLScalarType({ name: "Date", description: "A date string, such as 2007-12-03, compliant with the ISO 8601
standard for representation of dates and times using the Gregorian calendar.", specifiedByURL: undefined, seria
lize: [function String], parseValue: [function String], parseLiteral: [function parseLiteral], extensions: { },
astNode: undefined, extensionASTNodes: [] }). |
Could you also check if we will need to upgrade from |
Is there a reason why I am seeing "react": "^18.0.0",
"react-dom": "^18.0.0", in the |
Thank you for the suggestion Sir! I have attempted upgrading to the latest version of React. However, I encountered compatibility issues with some other dependencies in the project, which forced me to downgrade React back to version 18.0.0. |
I’ve run npm audit fix multiple times during this process, but it hasn’t resolved all vulnerabilities. I will review the remaining audit issues manually and see if further updates or alternate solutions are required. |
Hi Sir @krisstern ,regarding the GraphQL error, I have made several attempts to resolve the issue, but the same error persists. I am currently investigating the root cause more deeply, including examining plugin compatibility and schema handling. Additionally, I’ll check the feasibility of replacing gatsby-plugin-netlify with gatsby-plugin-decap-cms to improve compatibility and align with updated project requirements. Thank you for your guidance! |
Yes, do try to delete the npm install --legacy-peer-deps Keep us posted how it goes. |
Remember to push your code changes here |
I encountered a permission issue during the build process in our CI pipeline. The error message indicated that there was a permission denied error when trying to create a directory in the /opt/build path. Here are the details of the error:
|
It looks like the build step (which is the only one you have control of) has been successful, and the problem looks like a deployment issue as discussed for example in https://community.cloudflare.com/t/gatsby-pages-deployment-error/558278/5. Let me follow this up with the Jenkins Infra team shortly. |
I have opened an issue with the Infra team helpdesk at jenkins-infra/helpdesk#4461. But please do not comment on that issue. In case of anything you would like to voice out let me know and I will liaise with the Infra team via that ticket. |
Thank you Sir for clarifying that the build step completed successfully and for identifying the deployment issue. I appreciate the reference to the related Cloudflare community discussion and your initiative to follow up with the Jenkins Infra team. |
Also thank you Sir for opening the issue with the Infra team and for sharing the helpdesk ticket reference. I understand your request not to comment directly on the issue, and I will ensure to communicate any additional input or concerns through you. Let me know if there’s anything further I can provide to assist with the resolution. |
Hi Sir, To resolve the permission issue during the build process, I propose using a custom cache directory. This involves setting environment variables and updating the build command to specify a directory with appropriate permissions: 1.Set Environment Variables Please let me know if you agree with this approach/thought or if there are any additional considerations. |
Hi @biru-codeastromer The Infra team will come up with a solution shortly. Unless they ask for our opinion, we do not need to provide any feedback at this stage. |
Thank You Sir for the clarification . |
Also, this is not a trivial change. Once we update the configuration it will affect the entire repo moving forwards, so it is better to let the Infra team step in and do some magic for us. However, since we are officially in the winter break, so the change may not come as soon as it normally does. |
Okay Sir, thank you for the details. Okay Sir I will wait since this PR is also has a connection with PR #77 and both these PR's solves three issues at together,so looking forward for the changes by the infra team whenever possible Sure, till then I will continue solving other issues and make other contributions. |
Hi @biru-codeastromer could you please take some time to resolve the conclicts in this PR? |
Sure Sir @krisstern will be doing It ! |
Hi Sir @krisstern I have resolved the merge conflicts in the PR. |
I solved it , but due to regular changes in main it keeps getting conflicts , |
Also I will follow your method what you told me in an issue regarding merging main |
Fixes #1, fixes #78
Description
This pull request refactors the current project setup by migrating from Netlify CMS to Decap CMS. The migration enhances CMS functionality and aligns with Decap CMS's rebranding and new features. Additionally, this PR modernizes the code by updating dependencies, addressing issue #78, and improving the overall project setup.
Changes made:
1.Replaced the netlify-cms-app dependency with decap-cms in the package.json.
2.Switched from gatsby-plugin-netlify-cms to gatsby-plugin-decap-cms in gatsby-config.js.
3.Updated config.yml to ensure compatibility with Decap CMS's backend and media folder settings.
4.Modernized the project by updating outdated dependencies to improve compatibility and security.