-
Notifications
You must be signed in to change notification settings - Fork 3
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
fix(deps): update remark #153
Conversation
@ProchaLu Apparently
Looks like Victor Ofoegbu already did this upgrade in upstream, so you probably can pull in those changes (also he migrated to App Router): |
@ProchaLu probably an easier and effective way of doing this would be doing this: |
0265112
to
3a46dcc
Compare
1310bdc
to
d95c89c
Compare
d95c89c
to
4d10f5c
Compare
@ProchaLu some new warnings and errors in the build now:
|
4d10f5c
to
2ed19d9
Compare
✅ Deploy Preview for dancing-dragon-b13f72 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. ⚠ Warning: custom changes will be lost. |
package.json
Outdated
@@ -16,16 +16,16 @@ | |||
"framer-motion": "^10.16.14", | |||
"gray-matter": "^4.0.3", | |||
"highlight.js": "^11.9.0", | |||
"next": "^14.0.3", | |||
"next": "^14.1.1-canary.66", |
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.
Creating an optimized production build ...
⨯ Failed to find font override values for font `Young Serif`
Fixed in the Next.js 14.1.1-canary.66
'use client' | ||
'use client'; | ||
|
||
import { useRouter } from 'next/navigation' | ||
import React from 'react' | ||
import { ChevronLeft } from 'react-feather' | ||
import { useRouter } from 'next/navigation'; | ||
import React from 'react'; | ||
import { ChevronLeft } from 'react-feather'; | ||
|
||
export default function BackButton() { | ||
const router = useRouter() | ||
return ( | ||
<button className="group flex items-center gap-1 text-accent-3 hover:text-accent-1 active:scale-95" onClick={() => router.push('/works')}> | ||
<ChevronLeft className="transition-transform group-hover:-translate-x-2" /> | ||
<div>All Projects</div> | ||
</button> | ||
) | ||
const router = useRouter(); | ||
return ( | ||
<button | ||
className="group flex items-center gap-1 text-accent-3 hover:text-accent-1 active:scale-95" | ||
onClick={() => router.push('/works')} | ||
> | ||
<ChevronLeft className="transition-transform group-hover:-translate-x-2" /> | ||
<div>All Projects</div> | ||
</button> | ||
); | ||
} |
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.
Prettier changes
app/[contentType]/page.tsx
Outdated
if (!contentType) { | ||
return notFound(); | ||
} |
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.
catch if contentType = undefined
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.
return
not necessary, for all instances of notFound()
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.
Deleted all return
before notFound()
9b10517
/** @type {import('prettier').Options} */ | ||
/** @type {import('prettier').Config} */ |
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.
Updated ESLint
utils/content.ts
Outdated
export type ContentDataTypes = { | ||
id: string; | ||
contentHtml: string; | ||
problem?: string; | ||
techStack?: string[]; | ||
} & Pick< | ||
IContent, | ||
| 'title' | ||
| 'draft' | ||
| 'date' | ||
| 'previewImage' | ||
| 'description' | ||
| 'tags' | ||
| 'category' | ||
>; | ||
|
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.
Add TS type for the getContentData
function, replacing the any
types
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.
- naming can probably be improved
- make sure that you choose the correct plural form (this is currently plural, but it's an object)
- can you derive
id
,contentHtml
,problem
ortechStack
from any other existing types? - why are
problem
andtechStack
optional? should there be a comment describing why for each?
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.
utils/content.ts
Outdated
export const getContentData = async ( | ||
id: string, | ||
contentType: IContentType, | ||
): Promise<ContentDataTypes> => { |
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.
Add TS type to replace any
import { author, site } from '../../../config/index.json'; | ||
import info from '../../../config/index.json' assert { type: 'json' }; |
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.
Named imports throw this Webpack error, and to solve this issue, we have to switch to default imports
./app/page.tsx
Should not import the named export 'site'.'siteTitle' (imported as 'site') from default-exporting module (only default export is available soon)
If a module import has an attribute with key type and value json, the host is required to either fail the import, or treat it as a JSON module. Specifically this means that the content of the module is parsed as JSON and the resulting JSON object is the default export of the module (which has no named exports).
export const contentTypesMap: Map<IContentType, any> = new Map([ | ||
export const contentTypesMap: Map< | ||
IContentType, | ||
{ | ||
title: string; | ||
description: string; | ||
path: string; | ||
} | ||
> = new Map([ |
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.
Remove type any
and use the correct types
{content.previewImage && ( | ||
{!!content.previewImage && ( |
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.
Non-null Assertion to tell TypeScript that the value is not null
or undefined
.
Potentially falsey string in logical AND expression. Please use boolean.eslint[jsx-expressions/strict-logical-expressions](https://github.com/hluisson/eslint-plugin-jsx-expressions/blob/v1.3.2/lib/rules/strict-logical-expressions.md)
package.json
Outdated
"build": "next build && sed -i 's/\"type\": \"module\"/\"type\": \"commonjs\"/' package.json", | ||
"build": "if [ $(uname) = 'Darwin' ]; then next build && sed -i '' 's/\"type\": \"module\"/\"type\": \"commonjs\"/' package.json; else next build && sed -i 's/\"type\": \"module\"/\"type\": \"commonjs\"/' package.json; fi", |
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.
On MacOS, the build
script fails with this error message
sed: 1: "package.json": extra characters at the end of p command
To avoid this error, we have to add a no extension flag to the MacOS command ('')
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.
Reverted in this commit, because it is not important for MacOS
d783dd7
export interface IContentData { | ||
id: string; | ||
contentHtml: string; | ||
date: Date; | ||
title: string; | ||
previewImage?: string; | ||
description?: string; | ||
tags?: string[]; | ||
category?: string; | ||
problem?: string; | ||
techStack?: string[]; | ||
} |
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 got an ESLint error because statically typed links uses static analysis to determine link types. Importing directly from dynamic pages can lead to potential errors.
Avoid imports from other pages in Next.js - this can cause errors with Next.js Statically Typed Links https://nextjs.org/docs/app/building-your-application/configuring/typescript#statically-typed-links
Instead, move anything you want to import to a non-page fileeslint[no-restricted-syntax](https://eslint.org/docs/latest/rules/no-restricted-syntax)
export interface IContentData { | ||
id: string; | ||
contentHtml: string; | ||
date: Date; | ||
title: string; | ||
previewImage?: string; | ||
description?: string; | ||
tags?: string[]; | ||
category?: string; | ||
problem?: string; | ||
techStack?: string[]; | ||
} |
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.
moved to content.ts
file because of ESLint errors. See the comment
This PR contains the following updates:
^3.0.1
->^4.0.0
^15.0.2
->^16.0.0
^10.0.2
->^11.0.0
Release Notes
remarkjs/remark-gfm (remark-gfm)
v4.0.0
Compare Source
Change
b8cc334
Update@types/mdast
,unified
, utilitiesmigrate: update too
9eb0f54
Change to useexports
migrate: don’t use private APIs
5715c93
Change to require Node.js 16migrate: update too
Full Changelog: remarkjs/remark-gfm@3.0.1...4.0.0
remarkjs/remark-html (remark-html)
v16.0.1
Compare Source
e507e9d
Fix to add misclassified dependencyFull Changelog: remarkjs/remark-html@16.0.0...16.0.1
v16.0.0
Compare Source
Change
c726e74
Change to require Node.js 16migrate: update too
80482a5
Change to useexports
migrate: don’t use private APIs
1946cf3
Update@types/mdast
, utilities, etcmigrate: update too
hast-util-sanitize@5
: everything’s safe, GH is safe, but make sure to check if you’re super worriedhast-util-to-html@9
:options.entities
->options.characterReferences
mdast-util-to-hast@13
: handlers are different, if you pass those, see the changelogFull Changelog: remarkjs/remark-html@15.0.2...16.0.0
remarkjs/remark (remark-parse)
v11.0.0
Compare Source
(see
15.0.0
)Configuration
📅 Schedule: Branch creation - "on Thursday on the first day instance of January, March, May, July, September, November after 4pm" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR has been generated by Mend Renovate. View repository job log here.