turbo tasks

This commit is contained in:
EthanShoeDev
2025-09-19 19:44:20 -04:00
parent b053cb9945
commit dd0bb7636d
16 changed files with 223 additions and 185 deletions

View File

@@ -5,22 +5,21 @@
"main": "expo-router/entry",
"type": "module",
"scripts": {
"start": "expo start",
"android": "expo run:android --port 8082",
"ios": "expo run:ios --port 8081",
"android:release": "expo run:android --variant release",
"fmt": "cross-env SORT_IMPORTS=true prettier --write .",
"fmt:check": "cross-env SORT_IMPORTS=true prettier --check .",
"lint": "eslint --fix --max-warnings 0 --report-unused-disable-directives .",
"lint:check": "eslint --max-warnings 0 --report-unused-disable-directives .",
"typecheck": "tsc",
"dev:android": "expo run:android --port 8082",
"dev:ios": "expo run:ios --port 8081",
"dev:android:release": "expo run:android --port 8082 --variant release",
"dev:ios:release": "expo run:ios --port 8081 --variant release",
"build:signed:aab": "tsx scripts/signed-build.ts",
"build:signed:apk": "tsx scripts/signed-build.ts --format apk",
"web": "expo start --web",
"prebuild": "expo prebuild",
"prebuild:clean": "expo prebuild --clean",
"expo:dep:check": "expo install --fix",
"expo:doctor": "pnpm dlx expo-doctor@latest",
"fmt": "cross-env SORT_IMPORTS=true prettier --write .",
"fmt:check": "cross-env SORT_IMPORTS=true prettier --check .",
"typecheck": "tsc",
"lint:fix": "eslint --fix --max-warnings 0 --report-unused-disable-directives .",
"eslint:check": "eslint --max-warnings 0 --report-unused-disable-directives .",
"test:e2e": "maestro test test/e2e/",
"adb:logs": "while ! adb logcat --pid=$(adb shell pidof -s dev.fressh.app); do sleep 1; done"
},

View File

@@ -1,16 +0,0 @@
{
"extends": ["//"],
"tasks": {
"android": {
"dependsOn": ["^build"]
},
"ios": {
"dependsOn": ["^build"]
},
"lint": {
"dependsOn": ["lint:fix", "typecheck", "//#lint:root", "expo:doctor"]
},
"expo:doctor": {},
"lint:check": {}
}
}

32
apps/mobile/turbo.jsonc Normal file
View File

@@ -0,0 +1,32 @@
{
"extends": ["//"],
"tasks": {
// Default overrides
"lint": {
"dependsOn": ["fmt", "^build"],
"with": ["typecheck", "//#lint:root", "expo:doctor"],
},
"lint:check": {
"dependsOn": ["^build"],
"with": ["fmt:check", "typecheck", "//#lint:check:root", "expo:doctor"],
},
"test": {
"dependsOn": ["^build"],
"with": ["test:e2e"],
},
"dev:android": {
"dependsOn": ["^build", "^build:android"],
"cache": false,
"persistent": true,
},
"dev:ios": {
"dependsOn": ["^build", "^build:ios"],
"cache": false,
"persistent": true,
},
// Special tasks
"expo:doctor": {},
"test:e2e": {},
},
}

View File

@@ -4,15 +4,14 @@
"private": true,
"type": "module",
"scripts": {
"dev": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro",
"fmt": "cross-env SORT_IMPORTS=true prettier --write .",
"fmt:check": "cross-env SORT_IMPORTS=true prettier --check .",
"lint": "eslint --fix --max-warnings 0 --report-unused-disable-directives .",
"lint:check": "eslint --max-warnings 0 --report-unused-disable-directives .",
"typecheck": "tsc",
"lint:fix": "eslint --fix --max-warnings 0 --report-unused-disable-directives .",
"eslint:check": "eslint --max-warnings 0 --report-unused-disable-directives ."
"build": "astro build",
"dev": "astro dev",
"preview": "astro preview"
},
"dependencies": {
"@astrojs/vercel": "^8.2.7",

View File

@@ -1,7 +0,0 @@
{
"extends": ["//"],
"tasks": {
"lint": {},
"lint:check": {}
}
}

4
apps/web/turbo.jsonc Normal file
View File

@@ -0,0 +1,4 @@
{
"extends": ["//"],
"tasks": {},
}

View File

@@ -2,32 +2,31 @@
"name": "fressh",
"private": true,
"version": "workspace:*",
"packageManager": "pnpm@10.16.1",
"packageManager": "pnpm@10.17.0",
"type": "module",
"engines": {
"node": ">=22"
},
"scripts": {
"test": "turbo test",
"lint:all": "turbo lint",
"lint:check:all": "turbo lint:check",
"lint:root": "pnpm run fmt:root && syncpack list-mismatches || (syncpack fix-mismatches && pnpm i)",
"lint:check:root": "syncpack list-mismatches",
"fmt:root": "prettier --cache --write .",
"fmt:check:root": "prettier --check .",
"update:all": "syncpack update",
"update:all:alt": "pnpm dlx npm-check-updates --interactive --format group -ws --root",
"syncpack:fix": "syncpack list-mismatches || (syncpack fix-mismatches && pnpm i)",
"syncpack:check": "syncpack list-mismatches",
"jscpd:check": "cross-env NODE_OPTIONS=--max-old-space-size=8192 jscpd --config .jscpd.json",
"knip:check": "knip",
"knip:fix:danger": "knip --fix",
"jscpd:check": "cross-env NODE_OPTIONS=--max-old-space-size=8192 jscpd --config .jscpd.json"
"update:all": "syncpack update",
"update:all:alt": "pnpm dlx npm-check-updates --interactive --format group -ws --root"
},
"devDependencies": {
"knip": "^5.63.1",
"cross-env": "^10.0.0",
"@epic-web/config": "^1.21.3",
"prettier": "^3.6.2",
"cross-env": "^10.0.0",
"globby": "^14.1.0",
"jscpd": "^4.0.5",
"knip": "^5.63.1",
"prettier": "^3.6.2",
"syncpack": "^13.0.4",
"tsx": "^4.20.5",
"turbo": "^2.5.6",
"typescript": "~5.9.2"
}

View File

@@ -32,17 +32,18 @@
"!**/.*"
],
"scripts": {
"build": "if [ \"$(uname)\" = \"Darwin\" ]; then npm run build:ios; else npm run build:android; fi",
"build:ios": "ubrn build ios --and-generate --release && bob build",
"build:android": "ubrn build android --and-generate --release && bob build",
"ubrn:web": "ubrn build web",
"ubrn:clean": "rm -rfv cpp/ android/CMakeLists.txt android/src/main/java android/*.cpp ios/ src/Native* src/index.*ts* src/generated/",
"test": "jest",
"fmt": "cross-env SORT_IMPORTS=true prettier --write .",
"fmt:check": "cross-env SORT_IMPORTS=true prettier --check .",
"lint": "eslint --fix --max-warnings 0 --report-unused-disable-directives .",
"lint:check": "eslint --max-warnings 0 --report-unused-disable-directives .",
"typecheck": "tsc",
"lint": "eslint \"**/*.{js,ts,tsx}\"",
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
"release": "release-it --only-version",
"lint:rust": "cd rust/uniffi-russh && just lint"
"build:ios": "ubrn build ios --and-generate --release",
"build:android": "ubrn build android --and-generate --release",
"build:bob": "bob build",
"build": "if [ \"$(uname)\" = \"Darwin\" ]; then turbo build:ios; else turbo build:android; fi",
"lint:rust": "cd rust/uniffi-russh && just lint",
"test": "jest",
"release": "release-it --only-version"
},
"keywords": [
"react-native",
@@ -67,7 +68,6 @@
"@release-it/conventional-changelog": "^10.0.1",
"@types/jest": "^30.0.0",
"@types/react": "~19.1.12",
"del-cli": "^6.0.0",
"eslint": "^9.35.0",
"jest": "^30.1.3",
"prettier": "^3.6.2",
@@ -78,6 +78,9 @@
"turbo": "^2.5.6",
"typescript": "~5.9.2"
},
"dependencies": {
"uniffi-bindgen-react-native": "github:EthanShoeDev/uniffi-bindgen-react-native#build-ts"
},
"peerDependencies": {
"react": "19.1.0",
"react-native": "0.81.4"
@@ -126,8 +129,5 @@
"languages": "kotlin-objc",
"type": "turbo-module",
"version": "0.54.3"
},
"dependencies": {
"uniffi-bindgen-react-native": "github:EthanShoeDev/uniffi-bindgen-react-native#build-ts"
}
}

View File

@@ -1,17 +0,0 @@
{
"$schema": "https://turbo.build/schema.json",
"tasks": {
"build": {
"outputs": ["lib/**", "android/**", "ios/**", "cpp/**", "src/**"],
"dependsOn": ["lint:rust"]
},
"typecheck": {
"dependsOn": ["build"]
},
"lint": {
"with": ["typecheck", "lint:rust"]
},
"lint:rust": {}
},
"extends": ["//"]
}

View File

@@ -0,0 +1,27 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"tasks": {
// Default overrides
"lint": {
"dependsOn": ["fmt", "^build"],
"with": ["typecheck", "//#lint:root", "lint:rust"],
},
"lint:check": {
"dependsOn": ["^build"],
"with": ["fmt:check", "typecheck", "//#lint:check:root", "lint:rust"],
},
"build:android": {
"outputs": ["dist/**"],
"dependsOn": ["^build", "build:bob"],
},
"build:ios": {
"outputs": ["dist/**"],
"dependsOn": ["^build", "build:bob"],
},
// Special tasks
"lint:rust": {},
"build:bob": {},
},
}

View File

@@ -7,14 +7,14 @@
".": "./dist/index.js"
},
"scripts": {
"dev": "vite --config vite.config.internal.ts",
"fmt": "cross-env SORT_IMPORTS=true prettier --write .",
"fmt:check": "cross-env SORT_IMPORTS=true prettier --check .",
"lint": "eslint --fix --max-warnings 0 --report-unused-disable-directives .",
"lint:check": "eslint --max-warnings 0 --report-unused-disable-directives .",
"typecheck": "tsc --noEmit",
"build:main": "tsc -b && vite build",
"build:internal": "tsc -b && vite build --config vite.config.internal.ts",
"fmt:check": "cross-env SORT_IMPORTS=true prettier --check .",
"fmt": "cross-env SORT_IMPORTS=true prettier --write .",
"eslint:check": "eslint . --report-unused-disable-directives --max-warnings 0",
"lint:fix": "eslint --fix --report-unused-disable-directives --max-warnings 0 .",
"typecheck": "tsc --noEmit",
"dev": "vite --config vite.config.internal.ts",
"preview": "vite preview"
},
"dependencies": {

View File

@@ -1,19 +1,20 @@
{
"extends": ["//"],
"tasks": {
// Default overrides
"build": {
"dependsOn": ["build:internal", "build:main"]
"dependsOn": ["build:internal", "build:main"],
},
// Special tasks
"build:main": {
"inputs": ["src/**"],
"dependsOn": ["build:internal"],
"outputs": ["dist/**"]
"outputs": ["dist/**"],
},
"build:internal": {
"inputs": ["src-internal/**"],
"outputs": ["dist-internal/**"]
"outputs": ["dist-internal/**"],
},
"lint": {},
"lint:check": {}
}
},
}

50
pnpm-lock.yaml generated
View File

@@ -19,6 +19,9 @@ importers:
cross-env:
specifier: ^10.0.0
version: 10.0.0
globby:
specifier: ^14.1.0
version: 14.1.0
jscpd:
specifier: ^4.0.5
version: 4.0.5
@@ -31,6 +34,9 @@ importers:
syncpack:
specifier: ^13.0.4
version: 13.0.4(typescript@5.9.2)
tsx:
specifier: ^4.20.5
version: 4.20.5
turbo:
specifier: ^2.5.6
version: 2.5.6
@@ -327,9 +333,6 @@ importers:
'@types/react':
specifier: ~19.1.12
version: 19.1.12
del-cli:
specifier: ^6.0.0
version: 6.0.0
eslint:
specifier: ^9.35.0
version: 9.35.0(jiti@2.5.1)
@@ -4556,19 +4559,10 @@ packages:
resolution: {integrity: sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==}
engines: {node: '>= 14'}
del-cli@6.0.0:
resolution: {integrity: sha512-9nitGV2W6KLFyya4qYt4+9AKQFL+c0Ehj5K7V7IwlxTc6RMCfQUGY9E9pLG6e8TQjtwXpuiWIGGZb3mfVxyZkw==}
engines: {node: '>=18'}
hasBin: true
del@6.1.1:
resolution: {integrity: sha512-ua8BhapfP0JUJKC/zV9yHHDW/rDoDxP4Zhn3AkA6/xT6gY7jYXJiaeyBZznYVujhZZET+UgcbZiQ7sN3WqcImg==}
engines: {node: '>=10'}
del@8.0.0:
resolution: {integrity: sha512-R6ep6JJ+eOBZsBr9esiNN1gxFbZE4Q2cULkUSFumGYecAiS6qodDvcPx/sFuWHMNul7DWmrtoEOpYSm7o6tbSA==}
engines: {node: '>=18'}
depd@2.0.0:
resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==}
engines: {node: '>= 0.8'}
@@ -6036,18 +6030,10 @@ packages:
resolution: {integrity: sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==}
engines: {node: '>=6'}
is-path-cwd@3.0.0:
resolution: {integrity: sha512-kyiNFFLU0Ampr6SDZitD/DwUo4Zs1nSdnygUBqsu3LooL00Qvb5j+UnvApUn/TTj1J3OuE6BTdQ5rudKmU2ZaA==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
is-path-inside@3.0.3:
resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==}
engines: {node: '>=8'}
is-path-inside@4.0.0:
resolution: {integrity: sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==}
engines: {node: '>=12'}
is-plain-obj@4.1.0:
resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==}
engines: {node: '>=12'}
@@ -7251,10 +7237,6 @@ packages:
resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==}
engines: {node: '>=10'}
p-map@7.0.3:
resolution: {integrity: sha512-VkndIv2fIB99swvQoA65bm+fsmt6UNdGeIB0oxBs+WhAhdh08QA04JXpI7rbB9r08/nkbysKoya9rtDERYOYMA==}
engines: {node: '>=18'}
p-queue@8.1.1:
resolution: {integrity: sha512-aNZ+VfjobsWryoiPnEApGGmf5WmNsCo9xu8dfaYamG5qaLP7ClhLN6NgsFe6SwJ2UbLEBK5dv9x8Mn5+RVhMWQ==}
engines: {node: '>=18'}
@@ -14499,11 +14481,6 @@ snapshots:
escodegen: 2.1.0
esprima: 4.0.1
del-cli@6.0.0:
dependencies:
del: 8.0.0
meow: 13.2.0
del@6.1.1:
dependencies:
globby: 11.1.0
@@ -14515,15 +14492,6 @@ snapshots:
rimraf: 3.0.2
slash: 3.0.0
del@8.0.0:
dependencies:
globby: 14.1.0
is-glob: 4.0.3
is-path-cwd: 3.0.0
is-path-inside: 4.0.0
p-map: 7.0.3
slash: 5.1.0
depd@2.0.0: {}
dequal@2.0.3: {}
@@ -16331,12 +16299,8 @@ snapshots:
is-path-cwd@2.2.0: {}
is-path-cwd@3.0.0: {}
is-path-inside@3.0.3: {}
is-path-inside@4.0.0: {}
is-plain-obj@4.1.0: {}
is-promise@2.2.2: {}
@@ -18082,8 +18046,6 @@ snapshots:
dependencies:
aggregate-error: 3.1.0
p-map@7.0.3: {}
p-queue@8.1.1:
dependencies:
eventemitter3: 5.0.1

View File

@@ -0,0 +1,38 @@
/**
* This scripts finds and collects aall turbo.jsonc files in the repo.
* It iterates over those and grabs the "scripts" section of each package.json
*
* It aggregates the results and prints them out in a human readable format.
*/
import * as fsp from 'fs/promises';
import { globby } from 'globby';
import path from 'path';
console.log('Turbo tasks report');
console.log('--------------------------------');
async function main() {
const turboJsonFiles = await globby('**/turbo.jsonc');
const reportParts: string[] = [];
for (const turboJsonFile of turboJsonFiles) {
reportParts.push(`Turbo config: ${turboJsonFile}`);
reportParts.push('--------------------------------');
const turboConfigContents = await fsp.readFile(turboJsonFile, 'utf-8');
reportParts.push(turboConfigContents);
const relativePackageJson = path.join(turboJsonFile, '..', 'package.json');
reportParts.push(`Package json scripts: ${relativePackageJson}`);
reportParts.push('--------------------------------');
const packageJson = await fsp.readFile(relativePackageJson, 'utf-8');
const packageJsonObject = JSON.parse(packageJson);
const scripts = packageJsonObject.scripts;
reportParts.push(JSON.stringify(scripts, null, 2));
reportParts.push('--------------------------------');
}
const report = reportParts.join('\n');
console.log(report);
}
void main();

View File

@@ -1,47 +0,0 @@
{
"$schema": "https://turbo.build/schema.json",
"ui": "tui",
"globalPassThroughEnv": ["NODE_OPTIONS"],
"globalEnv": ["CI"],
"tasks": {
"fmt": {},
"fmt:check": {},
"eslint:check": {
"dependsOn": ["^build"]
},
"lint:fix": {
"dependsOn": ["^build", "fmt"]
},
"typecheck": {
"dependsOn": ["^build"]
},
"build": {
"outputs": ["dist/**"],
"dependsOn": ["^build"]
},
"lint:check": {
"with": ["fmt:check"],
"dependsOn": ["eslint:check", "typecheck", "//#lint:check:root"]
},
"lint": {
"dependsOn": ["lint:fix", "typecheck", "//#lint:root"]
},
"test": {
"dependsOn": ["^build"]
},
"dev": {
"cache": false,
"persistent": true,
"dependsOn": ["^build"]
},
"//#lint:check": {
"dependsOn": ["//#lint:check:root", "//#jscpd:check"]
},
"//#lint": {
"dependsOn": ["//#lint:root", "//#jscpd:check"]
},
"//#lint:root": {},
"//#lint:check:root": {},
"//#jscpd:check": {}
}
}

64
turbo.jsonc Normal file
View File

@@ -0,0 +1,64 @@
{
"$schema": "https://turbo.build/schema.json",
"ui": "tui",
"tasks": {
// Defaults
"fmt": { "with": ["//#fmt:root"] },
"fmt:check": { "with": ["//#fmt:check:root"] },
"lint": {
"dependsOn": ["fmt", "^build"],
"with": ["typecheck", "//#lint:root"],
},
"lint:check": {
"dependsOn": ["^build"],
"with": ["fmt:check", "typecheck", "//#lint:check:root"],
},
"typecheck": {
"dependsOn": ["^build"],
},
"build": {
"dependsOn": ["^build"],
},
"build:ios": {
"dependsOn": ["^build"],
},
"build:android": {
"dependsOn": ["^build"],
},
"test": {
"dependsOn": ["^build"],
},
"dev": {
"cache": false,
"persistent": true,
"dependsOn": ["^build"],
},
"clean": { "cache": false, "dependsOn": ["^clean"] },
// Root tasks overrides
"//#fmt:root": {},
"//#fmt:check:root": {},
"//#lint:root": {
"dependsOn": ["fmt:root"],
"with": [
"syncpack:fix",
"jscpd:check",
// "knip:fix:danger",
],
},
"//#lint:check:root": {
"with": [
"fmt:check:root",
"syncpack:check",
"jscpd:check",
//"knip:check",
],
},
// Special root tasks
"//#jscpd:check": {},
"//#syncpack:fix": {},
"//#syncpack:check": {},
"//#knip:check": {},
"//#knip:fix:danger": {},
},
}