Skip to content

Commit

Permalink
just copy calc dist shares to workflow for now (#553)
Browse files Browse the repository at this point in the history
* just copy calc dist shares to workflow for now

* update supabase, drop pierre

* more esm + tsconfig

* small tweak

* ok building now

* upgrade some more

* next logs activity now

* fix app tests

* fix specs after the /

* clean up app tests

* fix case sensitive tiltfiles
  • Loading branch information
0xBigBoss authored Jul 7, 2024
1 parent 7053289 commit e33e6cb
Show file tree
Hide file tree
Showing 83 changed files with 4,974 additions and 3,445 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# may be redundant but last thing we want is large dockerfiles. from here on out, it mostly mirrors the .gitignore
**/Tiltfile
**/**.tiltfile
**/**.Tiltfile
**/**.Tiltfile
**/*.tsbuildinfo
**/dist
Expand Down
10 changes: 0 additions & 10 deletions .pierre/ci/tests.ts

This file was deleted.

4 changes: 0 additions & 4 deletions .tiltignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ packages/playwright/playwright-report
**/*.tsbuildinfo
**/node_modules
**/.turbo
# may be redundant but last thing we want is large dockerfiles. from here on out, it mostly mirrors the .gitignore
**/Tiltfile
**/**.tiltfile
**/**.Tiltfile
**/*.tsbuildinfo
**/dist
**/node_modules
Expand Down
14 changes: 7 additions & 7 deletions Tiltfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load("ext://color", "color")
load("ext://dotenv", "dotenv")
load("./tilt/common.tiltfile", "CFG", "CI", "DEBUG")
load("./tilt/utils.tiltfile", "require_env", "require_tools")
load("./tilt/common.Tiltfile", "CFG", "CI", "DEBUG")
load("./tilt/utils.Tiltfile", "require_env", "require_tools")

print(color.green("███████╗███████╗███╗ ██╗██████╗ ██╗████████╗"))

Expand Down Expand Up @@ -79,14 +79,14 @@ Add the following to your /etc/hosts file:
print(color.red("NEXT_PUBLIC_SUPABASE_URL is not pointing to host.docker.internal. Please update your environment to point to a local supabase instance."))
fail(color.red("NEXT_PUBLIC_SUPABASE_URL is not pointing to host.docker.internal"))

include("tilt/infra.tiltfile")
include("tilt/infra.Tiltfile")

include("tilt/deps.tiltfile")
include("tilt/deps.Tiltfile")

include("./tilt/apps.tiltfile")
include("./tilt/apps.Tiltfile")

include("./tilt/tests.tiltfile")
include("./tilt/tests.Tiltfile")

if config.tilt_subcommand == "down":
include("./tilt/cleanup.tiltfile")
include("./tilt/cleanup.Tiltfile")

2 changes: 1 addition & 1 deletion apps/distributor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@my/supabase": "workspace:*",
"@my/wagmi": "workspace:*",
"@openzeppelin/merkle-tree": "1.0.5",
"@supabase/supabase-js": "2.41.1",
"@supabase/supabase-js": "2.44.2",
"@wagmi/core": "^2.10.5",
"app": "workspace:*",
"express": "^4.18.2",
Expand Down
12 changes: 6 additions & 6 deletions apps/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,23 @@
"expo-web-browser": "~12.8.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-native": "0.73.6",
"react-native": "0.74.1",
"react-native-dotenv": "^3.4.9",
"react-native-gesture-handler": "~2.14.1",
"react-native-ios-modal": "^0.1.8",
"react-native-reanimated": "~3.6.2",
"react-native-reanimated": "~3.10.1",
"react-native-safe-area-context": "4.8.2",
"react-native-screens": "~3.29.0",
"react-native-svg": "14.1.0",
"react-native-svg": "15.2.0",
"react-native-url-polyfill": "^1.3.0",
"react-native-web": "~0.19.10"
},
"devDependencies": {
"@babel/core": "^7.20.2",
"@babel/core": "^7.24.0",
"@expo/metro-config": "~0.17.1",
"@tamagui/babel-plugin": "^1.91.4",
"@tamagui/babel-plugin": "^1.101.7",
"babel-plugin-transform-inline-environment-variables": "^0.4.4",
"babel-preset-expo": "^10.0.1",
"babel-preset-expo": "~11.0.0",
"cross-env": "^7.0.3",
"metro-minify-terser": "^0.74.1",
"react-native-clean-project": "^4.0.3",
Expand Down
6 changes: 6 additions & 0 deletions apps/next/babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": ["next/babel"],
"generatorOpts": {
"importAttributesKeyword": "with"
}
}
27 changes: 24 additions & 3 deletions apps/next/next.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/** @type {import('next').NextConfig} */
import tamaguiPlugin from '@tamagui/next-plugin'
import { join } from 'node:path'
import withPlaiceholder from '@plaiceholder/next'
import { createRequire } from 'node:module'
const require = createRequire(import.meta.url)
const withBundleAnalyzer = require('@next/bundle-analyzer')
const { withTamagui } = require('@tamagui/next-plugin')

const boolVals = {
true: true,
Expand All @@ -12,13 +15,17 @@ const disableExtraction =
boolVals[process.env.DISABLE_EXTRACTION] ?? process.env.NODE_ENV === 'development'

const plugins = [
withBundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
openAnalyzer: process.env.ANALYZE === 'true',
}),
withPlaiceholder,
tamaguiPlugin.withTamagui({
withTamagui({
themeBuilder: {
input: '../../packages/ui/src/themes/theme.ts',
output: '../../packages/ui/src/themes/theme-generated.ts',
},
config: './tamagui.config.ts',
config: '../../packages/ui/src/tamagui.config.ts',
components: ['tamagui', '@my/ui'],
importsWhitelist: ['constants.js', 'colors.js'],
outputCSS: process.env.NODE_ENV === 'production' ? './public/tamagui.css' : null,
Expand All @@ -31,6 +38,20 @@ const plugins = [
},
excludeReactNativeWebExports: ['Switch', 'ProgressBar', 'Picker', 'CheckBox', 'Touchable'],
}),
(nextConfig) => {
return {
webpack: (webpackConfig, options) => {
webpackConfig.resolve.alias = {
...webpackConfig.resolve.alias,
'react-native-svg': '@tamagui/react-native-svg',
}
if (typeof nextConfig.webpack === 'function') {
return nextConfig.webpack(webpackConfig, options)
}
return webpackConfig
},
}
},
]

export default () => {
Expand Down
17 changes: 8 additions & 9 deletions apps/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
"@my/api": "workspace:*",
"@my/supabase": "workspace:*",
"@my/ui": "workspace:*",
"@my/wagmi": "workspace:*",
"@plaiceholder/next": "^3.0.0",
"@supabase/auth-helpers-react": "^0.4.2",
"@supabase/ssr": "^0.0.9",
"@supabase/supabase-js": "2.41.1",
"@tamagui/next-theme": "^1.93.2",
"@supabase/auth-helpers-react": "0.5.0",
"@supabase/supabase-js": "2.44.2",
"@tamagui/next-theme": "^1.101.7",
"@tanstack/react-query": "^5.18.1",
"@tanstack/react-query-devtools": "^5.18.1",
"@trpc/client": "11.0.0-next-beta.264",
Expand All @@ -30,23 +30,22 @@
"@trpc/server": "11.0.0-next-beta.264",
"app": "workspace:*",
"expo-sharing": "~11.5.0",
"next": "13.4.19",
"next": "^14.2.4",
"plaiceholder": "^3.0.0",
"raf": "^3.4.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-native": "0.73.6",
"react-native-reanimated": "~3.6.2",
"react-native": "0.74.1",
"react-native-reanimated": "~3.10.1",
"react-native-web": "~0.19.10",
"react-native-web-lite": "^1.74.8",
"sharp": "0.32.6",
"vercel": "^33.5.2",
"zod": "^3.22.4"
},
"devDependencies": {
"@next/bundle-analyzer": "^13.4.19",
"@next/eslint-plugin-next": "^14.0.4",
"@tamagui/next-plugin": "^1.93.2",
"@tamagui/next-plugin": "^1.101.7",
"@types/node": "^20.11.0",
"dotenv-cli": "^7.3.0",
"eslint-config-next": "^14.0.4"
Expand Down
3 changes: 0 additions & 3 deletions apps/next/pages/[tag].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { CheckoutTagSchema } from 'app/features/account/sendtag/checkout/Checkou
import { assert } from 'app/utils/assert'
import { supabaseAdmin } from 'app/utils/supabase/admin'
import { TopNav } from 'app/components/TopNav'
import { logRequest } from 'utils/logRequest'

export const Page: NextPageWithLayout<{ sendid: string }> = ({ sendid }) => {
return (
Expand Down Expand Up @@ -43,8 +42,6 @@ export const getServerSideProps = (async (ctx: GetServerSidePropsContext) => {
assert(!!tag, 'tag is required')
assert(typeof tag === 'string', 'Identifier tag must be a string')

logRequest(ctx)

const supabase = createPagesServerClient<Database>(ctx)
const {
data: { session },
Expand Down
4 changes: 2 additions & 2 deletions apps/next/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import NextDocument, {
import { Children } from 'react'
import { AppRegistry } from 'react-native'

import Tamagui from '../tamagui.config'
import { config } from '@my/ui'

export default class Document extends NextDocument {
static async getInitialProps(ctx: DocumentContext): Promise<DocumentInitialProps> {
Expand All @@ -29,7 +29,7 @@ export default class Document extends NextDocument {
key="tamagui-css"
// biome-ignore lint/security/noDangerouslySetInnerHtml: tamagui is a trusted source
dangerouslySetInnerHTML={{
__html: Tamagui.getCSS({
__html: config.getCSS({
exclude: process.env.NODE_ENV === 'development' ? null : 'design-system',
}),
}}
Expand Down
3 changes: 0 additions & 3 deletions apps/next/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { useUser } from 'app/utils/useUser'
import debug from 'debug'
import type { GetServerSidePropsContext, InferGetServerSidePropsType } from 'next'
import Head from 'next/head'
import { logRequest } from 'utils/logRequest'
import { userOnboarded } from 'utils/userOnboarded'
import type { NextPageWithLayout } from './_app'
import { AuthCarouselContext } from 'app/features/auth/AuthCarouselContext'
Expand Down Expand Up @@ -62,8 +61,6 @@ export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
data: { session },
} = await supabase.auth.getSession()

logRequest(ctx)

if (!session) {
log('no session')
const paths = [
Expand Down
4 changes: 0 additions & 4 deletions apps/next/pages/profile/[sendid].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import type { Database } from '@my/supabase/database.types'
import { userOnboarded } from 'utils/userOnboarded'
import { supabaseAdmin } from 'app/utils/supabase/admin'
import { TopNav } from 'app/components/TopNav'
import { logRequest } from 'utils/logRequest'

export const Page: NextPageWithLayout = () => {
return (
Expand All @@ -32,9 +31,6 @@ export const getServerSideProps = (async (ctx: GetServerSidePropsContext) => {
}
}

// log user activity
logRequest(ctx)

const supabase = createPagesServerClient<Database>(ctx)
const {
data: { session },
Expand Down
1,430 changes: 685 additions & 745 deletions apps/next/public/tamagui.css

Large diffs are not rendered by default.

12 changes: 0 additions & 12 deletions apps/next/tamagui.config.ts

This file was deleted.

16 changes: 13 additions & 3 deletions apps/next/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"lib": ["dom", "dom.iterable", "esnext"],
"baseUrl": ".",
"paths": {
"react-native": ["react-native-web"]
"react-native": ["react-native-web"],
"@my/wagmi": ["../../packages/wagmi/src"],
"@my/wagmi/*": ["../../packages/wagmi/src/*"]
},
"allowJs": true,
"skipLibCheck": true,
Expand All @@ -27,8 +29,16 @@
"name": "@nderscore/tamagui-typescript-plugin",
"pathToApp": "."
}
]
],
"types": ["node"]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
"next.config.js",
"./types.d.ts"
],
"exclude": ["node_modules"]
}
7 changes: 7 additions & 0 deletions apps/next/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { config } from '@my/ui'

export type Conf = typeof config

declare module '@my/ui' {
interface TamaguiCustomConfig extends Conf {}
}
8 changes: 2 additions & 6 deletions apps/next/utils/userProtected.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import type { ParsedUrlQuery } from 'node:querystring'
import type { Database } from '@my/supabase/database.types'
import { createPagesServerClient } from '@supabase/auth-helpers-nextjs'
import type { GetServerSideProps, PreviewData } from 'next'

import debug from 'debug'
import type { GetServerSideProps, PreviewData } from 'next'
import type { ParsedUrlQuery } from 'node:querystring'
import { userOnboarded } from './userOnboarded'
import { logRequest } from './logRequest'

const log = debug('api:utils:userProtected')

Expand All @@ -28,8 +26,6 @@ export function userProtectedGetSSP<
data: { session },
} = await supabase.auth.getSession()

logRequest(ctx)

if (!session) {
log('no session')
return {
Expand Down
38 changes: 24 additions & 14 deletions apps/workers/src/client.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { Connection, Client } from '@temporalio/client'
import { WorkflowA, WorkflowB } from '@my/workflows/all-workflows'
import {
// WorkflowA, WorkflowB,

export async function runWorkflow(): Promise<string> {
DistributionWorkflow,
} from '@my/workflows/all-workflows'

export async function runWorkflow(): Promise<void> {
const connection = await Connection.connect() // Connect to localhost with default ConnectionOptions.
// In production, pass options to the Connection constructor to configure TLS and other settings.
// This is optional but we leave this here to remind you there is a gRPC connection being established.
Expand All @@ -11,19 +15,25 @@ export async function runWorkflow(): Promise<string> {
// In production you will likely specify `namespace` here; it is 'default' if omitted
})

// Invoke the `WorkflowA` Workflow, only resolved when the workflow completes
const result = await client.workflow.execute(WorkflowA, {
taskQueue: 'monorepo',
workflowId: `workflow-a-${Date.now()}`, // TODO: remember to replace this with a meaningful business ID
args: ['Temporal'], // type inference works! args: [name: string]
})
// Starts the `WorkflowB` Workflow, don't wait for it to complete
await client.workflow.start(WorkflowB, {
taskQueue: 'monorepo',
workflowId: `workflow-b-${Date.now()}`, // TODO: remember to replace this with a meaningful business ID
// Invoke the `DistributionWorkflow` Workflow, only resolved when the workflow completes
await client.workflow.execute(DistributionWorkflow, {
taskQueue: 'dev',
workflowId: `distribution-workflow-${Date.now()}`, // TODO: remember to replace this with a meaningful business ID
args: [11], // type inference works! args: [name: string]
})
console.log(result) // // [api-server] A: Hello, Temporal!, B: Hello, Temporal!
return result
// // Invoke the `WorkflowA` Workflow, only resolved when the workflow completes
// const result = await client.workflow.execute(WorkflowA, {
// taskQueue: 'monorepo',
// workflowId: `workflow-a-${Date.now()}`, // TODO: remember to replace this with a meaningful business ID
// args: ['Temporal'], // type inference works! args: [name: string]
// })
// // Starts the `WorkflowB` Workflow, don't wait for it to complete
// await client.workflow.start(WorkflowB, {
// taskQueue: 'monorepo',
// workflowId: `workflow-b-${Date.now()}`, // TODO: remember to replace this with a meaningful business ID
// })
// console.log(result) // // [api-server] A: Hello, Temporal!, B: Hello, Temporal!
// return result
}

runWorkflow().catch((err) => {
Expand Down
Loading

0 comments on commit e33e6cb

Please sign in to comment.