Skip to content

Commit

Permalink
Biome support!!
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothy Miller committed Nov 7, 2023
1 parent 74d7684 commit 58f1bd2
Show file tree
Hide file tree
Showing 43 changed files with 349 additions and 312 deletions.
3 changes: 0 additions & 3 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"recommendations": [
"albbus.t4-app-tools",
"esbenp.prettier-vscode",
"wix.vscode-import-cost",
"unifiedjs.vscode-mdx",
"RobbOwen.synthwave-vscode",
Expand All @@ -11,11 +10,9 @@
"DavidAnson.vscode-markdownlint",
"waderyan.gitblame",
"PeterSchmalfeldt.explorer-exclude",
"dbaeumer.vscode-eslint",
"wilsonsio.color-vision",
"tamasfe.even-better-toml",
"formulahendry.auto-rename-tag",
"dbaeumer.vscode-eslint",
"expo.vscode-expo-tools",
"Postman.postman-for-vscode"
]
Expand Down
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
"*.js": "${capture}.js.map, ${capture}.d.ts, ${capture}.d.ts.map",
"*.ts": "$(capture).test.ts, $(capture).test.tsx, $(capture).test.node.ts, $(capture).test.node.tsx, $(capture).test.native.ts, $(capture).test.native.tsx, $(capture).test.ios.ts, $(capture).test.ios.tsx, $(capture).test.web.ts, $(capture).test.web.tsx, $(capture).test.android.ts, $(capture).test.android.tsx, ${capture}.native.tsx, ${capture}.ios.tsx, ${capture}.android.tsx, ${capture}.web.tsx, ${capture}.native.ts, ${capture}.ios.ts, ${capture}.android.ts, ${capture}.web.ts, ${capture}.native.js, ${capture}.ios.js, ${capture}.android.js, ${capture}.web.js, ${capture}.native.jsx, ${capture}.ios.jsx, ${capture}.android.jsx, ${capture}.web.jsx",
"*.tsx": "$(capture).test.ts, $(capture).test.tsx, $(capture).test.node.ts, $(capture).test.node.tsx, $(capture).test.native.ts, $(capture).test.native.tsx, $(capture).test.ios.ts, $(capture).test.ios.tsx, $(capture).test.web.ts, $(capture).test.web.tsx, $(capture).test.android.ts, $(capture).test.android.tsx, ${capture}.native.tsx, ${capture}.ios.tsx, ${capture}.android.tsx, ${capture}.web.tsx, ${capture}.native.ts, ${capture}.ios.ts, ${capture}.android.ts, ${capture}.web.ts, ${capture}.native.js, ${capture}.ios.js, ${capture}.android.js, ${capture}.web.js, ${capture}.native.jsx, ${capture}.ios.jsx, ${capture}.android.jsx, ${capture}.web.jsx"
},
"editor.defaultFormatter": "biomejs.biome",
"[typescriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
}
// Turn this on if you want to debug the T4 App Tools Extension
// "terminal.integrated.defaultProfile.windows": null
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ The VSCode extension is optional but highly recommended. It provides a better de
- ✅ Uses tRPC & Tanstack Query for fetching & caching across all platforms.
- ✅ Authentication across all platforms.
- ✅ Powered by TypeScript for type safety and better developer experience.
- ✅ Comes with pre-configured ESLint and Prettier for code consistency.
- ✅ Comes with pre-configured Biome for lightning fast code consistency.
- ✅ Github Action publishing for Expo apps
- ✅ Database migration in CI/CD
- ✅ Tauri Support
Expand Down
26 changes: 13 additions & 13 deletions apps/expo/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ module.exports = function (api) {
alias: {
app: '../../packages/app',
'@t4/api': '../../packages/api',
'@t4/ui': '../../packages/ui'
'@t4/ui': '../../packages/ui',
},
extensions: ['.js', '.jsx', '.tsx', '.ios.js', '.android.js']
}
extensions: ['.js', '.jsx', '.tsx', '.ios.js', '.android.js'],
},
],
...(process.env.EAS_BUILD_PLATFORM === 'android'
? []
: [
[
'@tamagui/babel-plugin',
{
components: ['@t4/ui', 'tamagui'],
config: './tamagui.config.ts'
}
]
]),
'jotai/babel/plugin-react-refresh'
]
[
'@tamagui/babel-plugin',
{
components: ['@t4/ui', 'tamagui'],
config: './tamagui.config.ts',
},
],
]),
'jotai/babel/plugin-react-refresh',
],
}
}
6 changes: 3 additions & 3 deletions apps/expo/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const workspaceRoot = path.resolve(__dirname, '../..')
/** @type {import('expo/metro-config').MetroConfig} */
const config = getDefaultConfig(projectRoot, {
// [Web-only]: Enables CSS support in Metro.
isCSSEnabled: true
isCSSEnabled: true,
})

// // Add import aliases
Expand All @@ -17,7 +17,7 @@ const config = getDefaultConfig(projectRoot, {
// };

// Add the additional `cjs` extension to the resolver
config.resolver.sourceExts.push("cjs");
config.resolver.sourceExts.push('cjs')

// 1. Watch all files within the monorepo
config.watchFolders = [workspaceRoot]
Expand All @@ -27,7 +27,7 @@ config.resolver.nodeModulesPaths = [
path.resolve(workspaceRoot, 'node_modules'),
]
// 3. Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths`
config.resolver.disableHierarchicalLookup = true;
config.resolver.disableHierarchicalLookup = true

config.transformer = { ...config.transformer, unstable_allowRequireContext: true }
config.transformer.minifierPath = require.resolve('metro-minify-terser')
Expand Down
7 changes: 0 additions & 7 deletions apps/next/.eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion apps/next/cfImageLoader.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Docs: https://developers.cloudflare.com/images/url-format
export default function cloudflareLoader ({ src, width, quality }) {
export default function cloudflareLoader({ src, width, quality }) {
const params = [`width=${width}`, `quality=${quality || 75}`, 'format=auto']
// const params = [`width=${width}`, `quality=${quality || 75}`]
const isDev = process.env.NODE_ENV === 'development'
Expand Down
41 changes: 21 additions & 20 deletions apps/next/next.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
const { withTamagui } = require('@tamagui/next-plugin')
const { join } = require('path')
const million = require('million/compiler')
const pattycake = require('pattycake');
const withPWA = require("@ducanh2912/next-pwa").default({
dest: "public",
disable: process.env.NODE_ENV === "development",
const pattycake = require('pattycake')
const withPWA = require('@ducanh2912/next-pwa').default({
dest: 'public',
disable: process.env.NODE_ENV === 'development',
register: true,
sw: "service-worker.js",
sw: 'service-worker.js',
swcMinify: true,
});
})

const boolVals = {
true: true,
false: false
false: false,
}

const disableExtraction =
Expand All @@ -24,7 +24,8 @@ const disableBrowserLogs =
const enableMillionJS =
boolVals[process.env.ENABLE_MILLION_JS] ?? process.env.NODE_ENV === 'production'

const enablePattyCake = boolVals[process.env.ENABLE_PATTY_CAKE] ?? process.env.NODE_ENV === 'production'
const enablePattyCake =
boolVals[process.env.ENABLE_PATTY_CAKE] ?? process.env.NODE_ENV === 'production'

// Enabling causes FOUC on page refreshes
const optimizeCss = false
Expand All @@ -43,8 +44,8 @@ const plugins = [
if (path.includes(join('packages', 'app'))) {
return true
}
}
})
},
}),
]

module.exports = function () {
Expand All @@ -58,13 +59,13 @@ module.exports = function () {
// Using Solito image loader without Cloudflare's Paid Image Resizing
images: {},
typescript: {
ignoreBuildErrors: true
ignoreBuildErrors: true,
},
modularizeImports: {
'@tamagui/lucide-icons': {
transform: '@tamagui/lucide-icons/dist/esm/icons/{{kebabCase member}}',
skipDefaultConversion: true
}
skipDefaultConversion: true,
},
},
transpilePackages: [
'solito',
Expand All @@ -74,7 +75,7 @@ module.exports = function () {
'expo-modules-core',
'react-native-safe-area-context',
'react-native-reanimated',
'react-native-gesture-handler'
'react-native-gesture-handler',
],
experimental: {
/*
Expand All @@ -98,29 +99,29 @@ module.exports = function () {
],
},
compiler: {
removeConsole: disableBrowserLogs
removeConsole: disableBrowserLogs,
},
}

for (const plugin of plugins) {
config = {
...config,
...plugin(config)
...plugin(config),
}
}

const millionConfig = {
auto: true,
mute: true
mute: true,
}

if (enableMillionJS) {
config = million.next(config, millionConfig);
config = million.next(config, millionConfig)
}

if (enablePattyCake) {
config = pattycake.next(config);
config = pattycake.next(config)
}

return config;
return config
}
1 change: 0 additions & 1 deletion apps/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"devDependencies": {
"@tamagui/next-plugin": "1.75.9",
"@types/react": "^18.2.34",
"eslint-config-next": "^14.0.1",
"vercel": "^32.5.0"
}
}
18 changes: 11 additions & 7 deletions apps/next/pages/404.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,21 @@ export default function Page() {
<Head>
<title>Page not found</title>
</Head>
<YStack flex={1} justifyContent="center" alignItems="center" padding="$4" space="$4">
<SolitoImage src="/t4-logo.png" width={96} height={96} alt="T4 Logo" />
<YStack flex={1} justifyContent='center' alignItems='center' padding='$4' space='$4'>
<SolitoImage src='/t4-logo.png' width={96} height={96} alt='T4 Logo' />
<H1>Page not found</H1>
<Paragraph maxWidth={500}>
Your changes were saved, but we could not load the page you requested because it was not found on our server.
Please try connecting again. If the issue keeps happening, <Anchor href={"mailto:"+customerCareEmail} target="_blank" rel="noreferrer">
Your changes were saved, but we could not load the page you requested because it was not
found on our server. Please try connecting again. If the issue keeps happening,{' '}
<Anchor href={'mailto:' + customerCareEmail} target='_blank' rel='noreferrer'>
contact Customer Care
</Anchor>.
</Anchor>
.
</Paragraph>
<XStack padding="$4">
<Button icon={<RotateCw />} onPress={() => router.reload()}>Try Again</Button>
<XStack padding='$4'>
<Button icon={<RotateCw />} onPress={() => router.reload()}>
Try Again
</Button>
</XStack>
</YStack>
</>
Expand Down
20 changes: 12 additions & 8 deletions apps/next/pages/500.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,23 @@ export default function Page() {
<Head>
<title>Unable to connect to server</title>
</Head>
<YStack flex={1} justifyContent="center" alignItems="center" padding="$4" space="$4">
<SolitoImage src="/t4-logo.png" width={96} height={96} alt="T4 Logo" />
<YStack flex={1} justifyContent='center' alignItems='center' padding='$4' space='$4'>
<SolitoImage src='/t4-logo.png' width={96} height={96} alt='T4 Logo' />
<H1>Unable to connect to server</H1>
<Paragraph maxWidth={500}>
Your changes were saved, but we could not connect to the server due to a technical issue on our end.
Please try connecting again. If the issue keeps happening, <Anchor href={"mailto:"+customerCareEmail} target="_blank" rel="noreferrer">
Your changes were saved, but we could not connect to the server due to a technical issue
on our end. Please try connecting again. If the issue keeps happening,{' '}
<Anchor href={'mailto:' + customerCareEmail} target='_blank' rel='noreferrer'>
contact Customer Care
</Anchor>.
</Anchor>
.
</Paragraph>
<XStack padding="$4">
<Button icon={<RotateCw />} onPress={() => router.reload()}>Try Again</Button>
<XStack padding='$4'>
<Button icon={<RotateCw />} onPress={() => router.reload()}>
Try Again
</Button>
</XStack>
</YStack>
</>
)
}
}
Loading

1 comment on commit 58f1bd2

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔ EAS production build completed

Android QR IOS QR
Android QR IOS QR

Please sign in to comment.