Skip to content

Commit

Permalink
Merge pull request #3 from near/develop
Browse files Browse the repository at this point in the history
develop -> main
  • Loading branch information
charleslavon authored Apr 10, 2024
2 parents f85c704 + 3eb3309 commit dfa22c6
Show file tree
Hide file tree
Showing 739 changed files with 77,716 additions and 14,100 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NEXT_PUBLIC_EVENTS_API_URL=https://api.lu.ma/public/v1
NEXT_PUBLIC_EVENTS_API_KEY=
18 changes: 18 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": [
"plugin:@typescript-eslint/recommended",
"next/core-web-vitals", // extended set of recommended rules from Next.js
"prettier"
],
"plugins": ["simple-import-sort", "@typescript-eslint"],
"root": true,
"rules": {
"simple-import-sort/imports": "warn",
"@typescript-eslint/no-explicit-any": "off", // TODO: remove once refactor from JS is complete
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-unused-vars": [
"warn",
{ "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }
]
}
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# production
/build
public/
/public/build

# misc
.DS_Store
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.12.1
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"trailingComma": "all",
"singleAttributePerLine": false,
"printWidth": 120
}
Empty file removed app/removeme.md
Empty file.
179 changes: 103 additions & 76 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,142 +1,169 @@
const appGatewayHostname = 'https://dev.near.org'; // This will probably change to "apps.near.org"

/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
compiler: {
styledComponents: true,
},
redirects: async () => {
return [
// Please keep redirects in alphabetical order based on `source`:

{
source: '/signup',
destination:
'https://dev.near.org/signup',
source: '/applications',
destination: `${appGatewayHostname}/applications`,
permanent: true,
},
{
source: '/signin',
destination:
'https://dev.near.org/signin',
source: '/blog/getting-started-with-the-near-wallet',
destination: 'https://wallet.near.org',
permanent: true,
},
{
source: '/data-availability',
destination:
'https://dev.near.org/data-availability',
source: '/brand',
destination: 'https://pages.near.org/brand',
permanent: true,
},
{
source: '/open-web-applications',
destination:
'https://dev.near.org/open-web-applications',
source: '/components',
destination: `${appGatewayHostname}/components`,
permanent: true,
},
{
source: '/fast-auth-and-relayers',
destination:
'https://dev.near.org/fast-auth-and-relayers',
permanent: true,
source: '/consensus',
destination: 'https://nearconsensus2023.splashthat.com/',
permanent: false,
},
{
source: '/data-infrastructure',
destination:
'https://dev.near.org/data-infrastructure',
source: '/da',
destination: '/data-availability',
permanent: true,
},
{
source: '/ecosystem',
destination:
'https://dev.near.org/ecosystem',
permanent: true,
source: '/developer-governance',
destination: 'https://neardevgov.org/',
permanent: false,
},
{
source: '/sandbox',
destination:
'https://dev.near.org/sandbox',
source: '/docs',
destination: 'https://docs.near.org',
permanent: true,
},
{
source: '/onboarding',
destination:
'https://dev.near.org/onboarding',
permanent: true,
source: '/ethcc',
destination: 'https://www.eventbrite.com/e/near-ethcc-tickets-655229297467',
permanent: false,
},
{
source: '/:path/component/:slug',
destination:
'https://dev.near.org/:path/component/:slug',
source: '/ethdenver',
destination: 'https://pages.near.org/ethdenver2024',
permanent: true,
},
{
source: '/horizon',
destination:
'https://dev.near.org/nearhorizon.near/component/HomePage',
permanent: true,
source: '/files/:slug',
destination: 'https://discovery-domain.org/papers/:slug.pdf',
permanent: false,
},
{
source: '/brand',
destination:
'https://pages.near.org/brand',
source: '/gateways',
destination: `${appGatewayHostname}/gateways`,
permanent: true,
}
]
},
rewrites: async () => {
return [
},
{
source: '/',
destination: '/index.html',
source: '/horizon',
destination: `${appGatewayHostname}/nearhorizon.near/component/HomePage`,
permanent: true,
},
{
source: '/:path',
destination: '/:path/index.html',
source: '/nearcon23.near/widget/Index',
destination: 'https://nearcon.app',
permanent: true,
},
{
source: '/blog',
destination: '/blog/page/2/index.html',
source: '/onboarding',
destination: `${appGatewayHostname}/onboarding`,
permanent: true,
},
{
source: '/blog/:path*',
destination: '/blog/:path*/index.html',
source: '/papers/:slug',
destination: 'https://discovery-domain.org/papers/:slug.pdf',
permanent: false,
},
{
source: '/learn/:path*',
destination: '/learn/:path*/index.html',
source: '/people',
destination: `${appGatewayHostname}/people`,
permanent: true,
},
{
source: '/near-events/:path*',
destination: '/near-events/:path*/index.html',
source: '/pitch',
destination: 'https://nearpitchfestconsensus.splashthat.com/',
permanent: false,
},
{
source: '/case-studies/:path*',
destination: '/case-studies/:path*/index.html',
source: '/sandbox',
destination: `${appGatewayHostname}/sandbox`,
permanent: true,
},
{
source: '/use-cases/:path*',
destination: '/use-cases/:path*/index.html',
source: '/signin',
destination: `${appGatewayHostname}/applications?requestAuth=1`,
permanent: false,
},
{
source: '/coverages/:path*',
destination: '/coverages/:path*/index.html',
source: '/signup',
destination: `${appGatewayHostname}/applications?requestAuth=1&createAccount=1`,
permanent: false,
},
{
source: '/events/:path*',
destination: '/events/:path*/index.html',
source: '/stackoverflow',
destination: `${appGatewayHostname}/near/widget/NearOrg.HomePage?utm_source=stack&utm_medium=podcast&utm_campaign=stackoverflow_evergreen_bos_awareness`,
permanent: false,
},
{
source: '/ecosystem/:path*',
destination: '/ecosystem/:path*/index.html',
source: '/stakewars',
destination: 'https://github.com/near/stakewars-iv',
permanent: false,
},
{
source: '/developers/:path*',
destination: '/developers/:path*/index.html',
source: '/validators',
destination: 'https://pages.near.org/validators',
permanent: true,
},

// Handle dynamic widget/component path redirects:

{
source: '/papers/:path*',
destination: '/papers/:path*/index.html',
source: '/:path/component/:slug',
destination: `${appGatewayHostname}/:path/component/:slug`,
permanent: true,
},
{
source: '/press-releases/:path*',
destination: '/press-releases/:path*/index.html',
source: '/:path/widget/:slug',
destination: `${appGatewayHostname}/:path/widget/:slug`,
permanent: true,
},
]
];
},
}
rewrites: async () => [
{
source: '/api/analytics/:path*',
destination: 'https://near.dataplane.rudderstack.com/:path*',
},
{
source: '/blog/:path*',
destination: '/blog/:path*/index.html',
}
],
headers: async () => [
{
source: '/:path*',
headers: [{
key: 'Referrer-Policy',
value: 'strict-origin-when-cross-origin'
}]
}
]
};

module.exports = nextConfig
module.exports = nextConfig;
30 changes: 21 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,34 @@
"version": "0.1.0",
"scripts": {
"dev": "next dev",
"build": "pnpm run deploy-nearorg && next build",
"build": "next build",
"start": "next start",
"lint": "next lint",
"sync-submodules": "git submodule init && git submodule update",
"deploy-nearorg": "cp -r nearorg_marketing/public/ ./public"
"prettier": "prettier --check 'src/**/*.{js,jsx,ts,tsx,json}'",
"prettier:write": "prettier --write 'src/**/*.{js,jsx,ts,tsx,json}'",
"ts:check": "tsc --noEmit --incremental",
"precommit": "npm run lint && npm run prettier:write && npm run ts:check",
"sync-submodules": "git submodule init && git submodule update"
},
"dependencies": {
"react": "^18",
"react-dom": "^18",
"next": "14.0.3"
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-navigation-menu": "^1.1.4",
"next": "14.1.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"styled-components": "^6.1.8"
},
"devDependencies": {
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18"
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"eslint": "^8",
"eslint-config-next": "14.1.4",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"prettier": "^3.2.5",
"typescript": "^5"
},
"license": "ISC"
}
Loading

0 comments on commit dfa22c6

Please sign in to comment.