Skip to content
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

feat(config): 🔧 update better tooling with release it & other changes #132

Merged
merged 4 commits into from
Feb 25, 2023

Conversation

navin-moorthy
Copy link
Collaborator

@navin-moorthy navin-moorthy commented Feb 25, 2023

// package.json
{"release": "node release-it/getCommitsSinceLastRelease.js && release-it"}
  • update renovate cron to run once a week on saturday
// .github/renovate.json
{"schedule": ["after 12am and before 5am on saturday"]}
  • remove renovate lockfile maintenance update
// .github/renovate.json
"lockFileMaintenance": {
  "enabled": false
},
  • add .prettiercache to the root folder itself & gitignore it
// package.json
{"lint:prettier": "prettier --check --cache --cache-location=.prettiercache \"./**/*.{html,css,js,cjs,jsx,ts,cts,tsx,md,json}\""}
  • add prettier import order with react, next & other libraries following it
// .prettierrc.cjs
importOrder: [
  // Packages.
  // Things that start with a letter (or digit or underscore), or `@` followed by a letter.
  "^react$",
  "^react-dom$",
  "^next$",
  "^next/+",
  "^@?\\w",
  "",
  // Absolute imports and other imports such as Vue-style `@/foo`.
  // Anything that does not start with a dot.
  "^../",
  "",
  "^./",
  "",

  // Relative imports.
  // Anything that starts with two dots.

  // Style imports.
  "^.+\\.s?css$",
],
// next.config.js
images: {
  formats: ["image/avif", "image/webp"],
  deviceSizes: [384, 640, 768, 1024, 1280, 1440, 2560],
  imageSizes: [128, 256],
},
  • update tailwind.config.cjs for better legibility & update the html tag
// tailwind.config.cjs
plugin(function ({ addUtilities }) {
  addUtilities({
    ".inter-display": {
      "font-variation-settings": `"opsz" 32`,
    },
  });
  addUtilities({
    ".optimizeLegibility": {
      "text-rendering": "optimizeLegibility",
    },
  });
}),
// pages/_document.tsx
<Html className="min-h-full antialiased inter-display optimizeLegibility" lang="en" />
  • add customized InterVar with Adjusted Arial Fallback of a local font & preload our customized font.
// tailwind.config.cjs
fontFamily: {
  sans: [
    "InterVar",
    "Adjusted Arial Fallback",
    ...defaultTheme.fontFamily.sans,
  ],
},
// pages/_document.tsx
<Head>
  {/* Fonts Preload */}
  <link
    rel="preload"
    href="/fonts/Inter.var-english.woff2"
    as="font"
    type="font/woff2"
    crossOrigin="anonymous"
  />
</Head>;
  • add also notes on how to add the font splitting & fallback in the styles/global.css file gist lint
  • add hover media query to disable hover interaction on mobile
// tailwind.config.cjs
future: {
  relativeContentPathsByDefault: true,
  hoverOnlyWhenSupported: true,
},

@navin-moorthy navin-moorthy self-assigned this Feb 25, 2023
@vercel
Copy link

vercel bot commented Feb 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
next-react-app ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 25, 2023 at 1:01PM (UTC)

@navin-moorthy navin-moorthy changed the title Dev feat(config): 🔧 update better tooling with release it & other changes Feb 25, 2023
@kodiakhq kodiakhq bot merged commit 98efcb4 into main Feb 25, 2023
@kodiakhq kodiakhq bot deleted the dev branch February 25, 2023 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant