Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,12 @@
"plugin": "@nx/expo/plugin",
"options": {
"startTargetName": "start",
"serveTargetName": "serve",
"runIosTargetName": "run-ios",
"runAndroidTargetName": "run-android",
"exportTargetName": "export",
"prebuildTargetName": "prebuild",
"installTargetName": "install",
"buildTargetName": "build",
"submitTargetName": "submit"
"runIosTargetName": "rn:ios",
"runAndroidTargetName": "rn:android",
"prebuildTargetName": "rn:prebuild",
"installTargetName": "rn:install",
"buildTargetName": "rn:build",
"submitTargetName": "rn:submit"
}
}
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"expo": "^54.0.25",
"expo-asset": "^12.0.10",
"expo-audio": "^1.0.15",
"expo-bip39": "workspace:*",
"@xstack/expo-bip39": "workspace:*",
"expo-clipboard": "^8.0.7",
Comment on lines 116 to 120

Choose a reason for hiding this comment

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

P1 Badge Keep pnpm-lock in sync with renamed expo-bip39 package

The dependency was renamed to @xstack/expo-bip39, but pnpm-lock.yaml still pins the old unscoped expo-bip39 entry (e.g., lines 369–371). With pnpm install --frozen-lockfile the installer now fails because the new specifier has no matching lock entry, blocking installs until the lockfile is regenerated for the scoped name.

Useful? React with 👍 / 👎.

"expo-constants": "^18.0.10",
"expo-crypto": "^15.0.7",
Expand Down
1 change: 1 addition & 0 deletions packages/event-log/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
},
"typecheck": {
"executor": "nx:run-commands",
"dependsOn": ["^build"],
"options": {
Comment on lines 24 to 27

Choose a reason for hiding this comment

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

P1 Badge Avoid requiring missing build targets for event-log typecheck

Adding dependsOn: ["^build"] makes nx typecheck pkgs-event-log invoke the build target on every dependency before running the checker. pkgs-event-log imports packages like @xstack/fx/worker/runner, and packages/fx/project.json (and most other workspace libs) define no build target, so the command now errors with “Target build not found for project pkgs-fx” rather than running type checks. Unless every dependency gains a build target, this dependency chain breaks the typecheck target.

Useful? React with 👍 / 👎.

"command": "tsgo -p packages/event-log/tsconfig.check.json"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/event-log/src/Bip39Native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as Types from '@xstack/event-log/Types'
import type * as Context from 'effect/Context'
import * as Effect from 'effect/Effect'
import * as Layer from 'effect/Layer'
import ExpoBip39 from 'expo-bip39'
import ExpoBip39 from '@xstack/expo-bip39'

export const Bip39Live = Layer.effect(
Bip39,
Expand Down
8 changes: 2 additions & 6 deletions packages/expo-bip39/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
{
"name": "expo-bip39",
"name": "@xstack/expo-bip39",
"type": "module",
"version": "0.0.0",
"sideEffects": false,
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"./dist"
],
"scripts": {
"typecheck": "tsgo -p tsconfig.check.json",
"build": "rm -rf dist && tsc --build tsconfig.build.json"
}
]
}
40 changes: 40 additions & 0 deletions packages/expo-bip39/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "pkgs-expo-bip39",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/expo-bip39/src",
"projectType": "library",
"targets": {
"test": {
"executor": "nx:run-commands",
"outputs": [
"{workspaceRoot}/node_modules/.vitest/packages/expo-bip39",
"{workspaceRoot}/coverage/packages/expo-bip39"
],
"options": {
"command": "pnpm xdev test --project pkgs-expo-bip39"
}
},
"build": {
"executor": "nx:run-commands",
"outputs": ["{projectRoot}/dist"],
"options": {
"command": "tsc --build tsconfig.build.json",
"cwd": "packages/expo-bip39"
}
},
"madge": {
"executor": "nx:run-commands",
"options": {
"command": "madge --ts-config ./tsconfig.lib.json --circular --no-color --no-spinner --extensions ts,tsx ./src",
"cwd": "packages/expo-bip39"
}
},
"typecheck": {
"executor": "nx:run-commands",
"options": {
"command": "tsgo -p packages/expo-bip39/tsconfig.check.json"
}
}
},
"tags": []
}
4 changes: 0 additions & 4 deletions packages/purchase/src/payment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ import * as Layer from 'effect/Layer'

export * from '@xstack/purchase/payment/type'

export { Paddle } from '@xstack/purchase/payment/paddle'

export { Stripe } from '@xstack/purchase/payment/stripe'

export class Payment extends Context.Tag('@purchase:payment')<
Payment,
{
Expand Down
3 changes: 3 additions & 0 deletions packages/purchase/src/provider.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { Paddle } from '@xstack/purchase/payment/paddle'

export { Stripe } from '@xstack/purchase/payment/stripe'
31 changes: 12 additions & 19 deletions scripts/generate-tsconfig/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,7 @@ export function buildProjectBaseTsconfig({
return config
}

export function generatePackageLibraryConfigs({
item,
overrides,
}: {
item: ProjectItemDeclaration
overrides: Record<string, any>
}) {
export function generatePackageLibraryConfigs({ item }: { item: ProjectItemDeclaration }) {
const extendsPath = getExtendsPath(item)

const mainConfig = {
Expand All @@ -330,6 +324,8 @@ export function generatePackageLibraryConfigs({
files: [],
}

const overrides = item.options?.projectOverrides ?? {}

const main = mergeConfigs(mainConfig, overrides.main || {})
const lib = mergeConfigs(DefaultTsLibConfig, overrides.lib || {})
const test = mergeConfigs(DefaultTsTestConfig, overrides.test || {})
Expand All @@ -347,13 +343,7 @@ export function generatePackageLibraryConfigs({
}
}

export function generateAppLibraryConfigs({
item,
overrides,
}: {
item: ProjectItemDeclaration
overrides: Record<string, any>
}) {
export function generateAppLibraryConfigs({ item }: { item: ProjectItemDeclaration }) {
const extendsPath = getExtendsPath(item)

const mainConfig = {
Expand All @@ -362,6 +352,9 @@ export function generateAppLibraryConfigs({
include: [],
files: [],
}

const overrides = item.options?.projectOverrides ?? {}

const main = mergeConfigs(mainConfig, overrides.main || {})
const app = mergeConfigs(DefaultTsAppConfig, overrides.app || {})
const test = mergeConfigs(DefaultTsTestConfig, overrides.test || {})
Expand All @@ -371,11 +364,9 @@ export function generateAppLibraryConfigs({

export function generateAppConfigs({
item,
overrides,
allItems,
}: {
item: ProjectItemDeclaration
overrides: Record<string, any>
allItems: ProjectItemDeclaration[]
}) {
const extendsPath = getExtendsPath(item)
Expand All @@ -386,6 +377,9 @@ export function generateAppConfigs({
include: [],
files: [],
}

const overrides = item.options?.projectOverrides ?? {}

const main = mergeConfigs(mainConfig, overrides.main || {})
const app = mergeConfigs(DefaultTsAppConfig, overrides.app || {})
const test = mergeConfigs(DefaultTsTestConfig, overrides.test || {})
Expand Down Expand Up @@ -418,17 +412,16 @@ export function getProjectTsconfig(baseConfig: any, projects: ProjectDefinition[
const obj = { base }

if (target.options?.isPackage) {
const configs = generatePackageLibraryConfigs({ item: target.item, overrides: {} })
const configs = generatePackageLibraryConfigs({ item: target.item })
Object.assign(obj, configs)
} else {
if (target.kind === 'library') {
const configs = generateAppLibraryConfigs({ item: target.item, overrides: {} })
const configs = generateAppLibraryConfigs({ item: target.item })
Object.assign(obj, configs)
} else {
const configs = generateAppConfigs({
item: target.item,
allItems: target.definition.items,
overrides: target.definition.projectOverrides ?? {},
})
Object.assign(obj, configs)
}
Expand Down
15 changes: 3 additions & 12 deletions scripts/generate-tsconfig/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,16 @@ async function writeLibraryConfigs({
projectRoot,
item,
dryRun,
overrides,
}: {
projectRoot: string
item: ProjectItemDeclaration
dryRun: boolean
overrides: Record<string, any>
}) {
const itemPath = path.join(projectRoot, item.name)
const isPackage = item.options?.isPackage ?? false

if (isPackage) {
const configs = generatePackageLibraryConfigs({ item, overrides })
const configs = generatePackageLibraryConfigs({ item })

await generateTsConfigFile({
filePath: path.join(itemPath, 'tsconfig.json'),
Expand Down Expand Up @@ -82,7 +80,7 @@ async function writeLibraryConfigs({
return
}

const configs = generateAppLibraryConfigs({ item, overrides })
const configs = generateAppLibraryConfigs({ item })

await generateTsConfigFile({
filePath: path.join(itemPath, 'tsconfig.json'),
Expand All @@ -107,17 +105,15 @@ async function writeApplicationConfigs({
projectRoot,
item,
dryRun,
overrides,
allItems,
}: {
projectRoot: string
item: ProjectItemDeclaration
dryRun: boolean
overrides: Record<string, any>
allItems: ProjectItemDeclaration[]
}) {
const itemPath = path.join(projectRoot, item.name)
const configs = generateAppConfigs({ item, allItems, overrides })
const configs = generateAppConfigs({ item, allItems })

await generateTsConfigFile({
filePath: path.join(itemPath, 'tsconfig.json'),
Expand Down Expand Up @@ -175,29 +171,24 @@ async function main() {
})

for (const definition of PROJECT_DEFINITIONS) {
const projectOverrides = definition.projectOverrides ?? {}

// 生成项目级别的 base config
console.log(`\n🏗️ Generating configs for project: ${definition.projectName}`)
console.log('='.repeat(80))

const projectRoot = path.join(workspaceRoot, definition.projectName)

for (const item of definition.items) {
const overrides = projectOverrides[item.name] ?? {}
if (item.kind === 'library') {
await writeLibraryConfigs({
projectRoot,
item,
dryRun,
overrides,
})
} else {
await writeApplicationConfigs({
projectRoot,
item,
dryRun,
overrides,
allItems: definition.items,
})
}
Expand Down
16 changes: 12 additions & 4 deletions scripts/generate-tsconfig/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,21 @@ export interface ProjectItemOptions {
checkIncludes?: string[] | undefined
checkExcludes?: string[] | undefined
isPackage?: boolean | undefined
projectOverrides?:
| {
main?: any
app?: any
lib?: any
test?: any
check?: any
}
| undefined
}

export interface ProjectItemDeclaration {
name: string
kind: ProjectItemKind
options?: ProjectItemOptions | undefined
options?: ProjectItemOptions | undefined | undefined
}

export interface ProjectAliasOptions {
Expand All @@ -36,7 +45,6 @@ export interface ProjectBaseTarget {
export interface ProjectDefinition {
projectName: string
items: ProjectItemDeclaration[]
projectOverrides?: Record<string, any>
baseTargets?: ProjectBaseTarget[] | undefined
}

Expand All @@ -50,13 +58,13 @@ export const LEVEL1_BASE_PATH = '../tsconfig.base.json'
export const LEVEL2_BASE_PATH = '../../tsconfig.base.json'
export const LEVEL3_BASE_PATH = '../../../tsconfig.base.json'

export const tsLib = (name: string, options?: ProjectItemOptions): ProjectItemDeclaration => ({
export const tsLib = (name: string, options?: ProjectItemOptions | undefined): ProjectItemDeclaration => ({
kind: 'library',
name,
options,
})

export const tsApp = (name: string, options?: ProjectItemOptions): ProjectItemDeclaration => ({
export const tsApp = (name: string, options?: ProjectItemOptions | undefined): ProjectItemDeclaration => ({
kind: 'application',
name,
options,
Expand Down
Loading