Skip to content

Commit

Permalink
feat: update core deps
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Oct 21, 2021
1 parent 54fbdf3 commit 19e8693
Show file tree
Hide file tree
Showing 7 changed files with 853 additions and 831 deletions.
73 changes: 23 additions & 50 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,54 +12,27 @@
"version": "detect"
}
},
"overrides": [
{
"files": ["**/*.js", "**/*.jsx"],
"parser": "babel-eslint",
"extends": [
"standard",
"standard-react",
"plugin:prettier/recommended",
"prettier/standard",
"prettier/react"
],
"env": { "node": true },
"rules": {
"space-before-function-paren": 0,
"react/prop-types": 0,
"react/jsx-handler-names": 0,
"react/jsx-fragments": 0,
"react/no-unused-prop-types": 0,
"import/export": 0,
"standard/no-callback-literal": 0
}
},
{
"files": ["**/*.ts", "**/*.tsx"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"plugin:@typescript-eslint/recommended",
"standard",
"standard-react",
"plugin:prettier/recommended",
"prettier/standard",
"prettier/react"
],
"env": { "browser": true, "node": true },
"rules": {
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"no-use-before-define": 0,
"@typescript-eslint/no-use-before-define": 0,
"space-before-function-paren": 0,
"react/prop-types": 0,
"react/jsx-handler-names": 0,
"react/jsx-fragments": 0,
"react/no-unused-prop-types": 0,
"import/export": 0,
"standard/no-callback-literal": 0
}
}
]
"ignorePatterns": ["**/*.js", "**/*.jsx"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"plugin:@typescript-eslint/recommended",
"standard",
"standard-react",
"plugin:prettier/recommended"
],
"env": { "browser": true, "node": true },
"rules": {
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"no-use-before-define": 0,
"@typescript-eslint/no-use-before-define": 0,
"space-before-function-paren": 0,
"react/prop-types": 0,
"react/jsx-handler-names": 0,
"react/jsx-fragments": 0,
"react/no-unused-prop-types": 0,
"import/export": 0,
"standard/no-callback-literal": 0
}
}
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"useTabs": false,
"tabWidth": 2,
"bracketSpacing": true,
"jsxBracketSameLine": false,
"bracketSameLine": false,
"arrowParens": "always",
"trailingComma": "none"
}
47 changes: 22 additions & 25 deletions lib/map-page-url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,32 @@ import { getCanonicalPageId } from './get-canonical-page-id'
// (they're nice for debugging and speed up local dev)
const uuid = !!includeNotionIdInUrls

export const mapPageUrl = (
site: Site,
recordMap: ExtendedRecordMap,
searchParams: URLSearchParams
) => (pageId = '') => {
if (uuidToId(pageId) === site.rootNotionPageId) {
return createUrl('/', searchParams)
} else {
return createUrl(
`/${getCanonicalPageId(pageId, recordMap, { uuid })}`,
searchParams
)
export const mapPageUrl =
(site: Site, recordMap: ExtendedRecordMap, searchParams: URLSearchParams) =>
(pageId = '') => {
if (uuidToId(pageId) === site.rootNotionPageId) {
return createUrl('/', searchParams)
} else {
return createUrl(
`/${getCanonicalPageId(pageId, recordMap, { uuid })}`,
searchParams
)
}
}
}

export const getCanonicalPageUrl = (
site: Site,
recordMap: ExtendedRecordMap
) => (pageId = '') => {
const pageUuid = parsePageId(pageId, { uuid: true })
export const getCanonicalPageUrl =
(site: Site, recordMap: ExtendedRecordMap) =>
(pageId = '') => {
const pageUuid = parsePageId(pageId, { uuid: true })

if (uuidToId(pageId) === site.rootNotionPageId) {
return `https://${site.domain}`
} else {
return `https://${site.domain}/${getCanonicalPageId(pageUuid, recordMap, {
uuid
})}`
if (uuidToId(pageId) === site.rootNotionPageId) {
return `https://${site.domain}`
} else {
return `https://${site.domain}/${getCanonicalPageId(pageUuid, recordMap, {
uuid
})}`
}
}
}

function createUrl(path: string, searchParams: URLSearchParams) {
return [path, searchParams.toString()].filter(Boolean).join('?')
Expand Down
4 changes: 4 additions & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
3 changes: 0 additions & 3 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
module.exports = withBundleAnalyzer({
images: {
domains: ['pbs.twimg.com']
},
future: {
webpack5: true
}
})
39 changes: 19 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,44 +33,43 @@
"got": "^11.8.2",
"isomorphic-unfetch": "^3.1.0",
"lqip-modern": "^1.2.0",
"next": "^10.2.0",
"next": "^11.1.2",
"node-fetch": "^2.6.1",
"notion-client": "^4.9.10",
"notion-types": "^4.8.2",
"notion-utils": "^4.8.6",
"notion-client": "^4.10.0",
"notion-types": "^4.10.0",
"notion-utils": "^4.10.0",
"p-map": "^4.0.0",
"p-memoize": "^4.0.0",
"react": "^17.0.2",
"react-body-classname": "^1.3.1",
"react-dom": "^17.0.2",
"react-icons": "^4.2.0",
"react-notion-x": "^4.9.9",
"react-notion-x": "^4.10.0",
"react-static-tweets": "^0.5.3",
"react-use": "^17.2.4",
"static-tweets": "^0.5.3",
"use-dark-mode": "^2.3.1"
},
"devDependencies": {
"@next/bundle-analyzer": "^10.2.0",
"@next/bundle-analyzer": "^11.1.2",
"@types/classnames": "^2.3.1",
"@types/node": "^15.0.1",
"@types/node-fetch": "^2.5.10",
"@types/react": "^17.0.4",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"babel-eslint": "^10.0.3",
"@types/node": "^16.11.2",
"@types/node-fetch": "^3.0.3",
"@types/react": "^17.0.31",
"@typescript-eslint/eslint-plugin": "^5.1.0",
"@typescript-eslint/parser": "^5.1.0",
"cross-env": "^7.0.2",
"eslint": "^7.25.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-config-standard": "^16.0.2",
"eslint-config-standard": "^16.0.3",
"eslint-config-standard-react": "^11.0.1",
"eslint-plugin-import": "^2.21.2",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-react": "^7.23.2",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-promise": "^5.1.1",
"eslint-plugin-react": "^7.26.1",
"npm-run-all": "^4.1.5",
"prettier": "^2.0.5",
"typescript": "^4.2.4"
"prettier": "^2.4.1",
"typescript": "^4.4.4"
}
}
Loading

0 comments on commit 19e8693

Please sign in to comment.