Files
AFFiNE-Mirror/packages/frontend/apps/ios/codegen.ts
Lakr 75a6c79b2c fix(ios): crash at swift runtime error (#13635)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Fetch copilot model options per prompt (default, optional, pro) with
generated GraphQL query and schema types.

* **Chores**
* Upgraded iOS deps: Apollo iOS 1.23.0, EventSource 0.1.5, Swift
Collections 1.2.1.
* Switched Intelligents to static linking and updated project
integration.
* Parameterized and standardized GraphQL codegen tooling; setup
automation now syncs versions and safely backs up/restores custom
scalars.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-09-23 05:56:08 +00:00

35 lines
998 B
TypeScript

import { execSync } from 'node:child_process';
import { ProjectRoot } from '@affine-tools/utils/path';
import { Package } from '@affine-tools/utils/workspace';
const iosPackage = new Package('@affine/ios');
const PackageRoot = iosPackage.path;
console.log('[*] PackageRoot', PackageRoot);
const version = process.argv[2] || '1.23.0'; // Default to 1.23.0 if no version provided
console.log('[*] graphql...');
execSync(`${PackageRoot}/apollo-codegen-chore.sh "${version}"`, {
stdio: 'inherit',
});
console.log('[*] rust...');
execSync(
'cargo build -p affine_mobile_native --features use-as-lib --lib --release --target aarch64-apple-ios',
{
stdio: 'inherit',
}
);
execSync(
`cargo run -p affine_mobile_native --features use-as-lib --bin uniffi-bindgen generate \
--library ${ProjectRoot}/target/aarch64-apple-ios/release/libaffine_mobile_native.a \
--language swift --out-dir ${PackageRoot}/App/App/uniffi`,
{ stdio: 'inherit' }
);
console.log('[+] codegen complete');