create-expo 5.0.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/build/{205.index.js → 589.index.js} +442 -128
  2. package/build/601.index.js +20 -11
  3. package/build/{525.index.js → 870.index.js} +423 -334
  4. package/build/Examples.d.ts +38 -0
  5. package/build/Template.d.ts +98 -0
  6. package/build/__mocks__/fs.d.ts +1 -0
  7. package/build/__mocks__/ora.d.ts +1 -0
  8. package/build/__tests__/Examples.test.d.ts +1 -0
  9. package/build/__tests__/Template.test.d.ts +1 -0
  10. package/build/__tests__/configureWorkspaces.test.d.ts +1 -0
  11. package/build/__tests__/createAsync.test.d.ts +1 -0
  12. package/build/__tests__/createExpoConfig.test.d.ts +1 -0
  13. package/build/__tests__/createFileTransformer.test.d.ts +1 -0
  14. package/build/__tests__/generateAgentFiles.test.d.ts +1 -0
  15. package/build/__tests__/promptSdkVersion.test.d.ts +1 -0
  16. package/build/__tests__/resolvePackageManager.test.d.ts +1 -0
  17. package/build/__tests__/sanitizeTemplate.test.d.ts +1 -0
  18. package/build/__tests__/telemetry.test.d.ts +1 -0
  19. package/build/agent-files/AGENTS.md +41 -0
  20. package/build/agent-files/CLAUDE.md +1 -0
  21. package/build/cli.d.ts +1 -0
  22. package/build/configureWorkspaces.d.ts +9 -0
  23. package/build/createAsync.d.ts +11 -0
  24. package/build/createExpoConfig.d.ts +38 -0
  25. package/build/createFileTransform.d.ts +5 -0
  26. package/build/error.d.ts +9 -0
  27. package/build/generateAgentFiles.d.ts +1 -0
  28. package/build/index.d.ts +1 -0
  29. package/build/index.js +38 -10
  30. package/build/legacyTemplates.d.ts +7 -0
  31. package/build/log.d.ts +12 -0
  32. package/build/paths.d.ts +2 -0
  33. package/build/promptSdkVersion.d.ts +23 -0
  34. package/build/resolvePackageManager.d.ts +12 -0
  35. package/build/resolveProjectRoot.d.ts +3 -0
  36. package/build/sessionStorage.d.ts +8 -0
  37. package/build/telemetry.d.ts +29 -0
  38. package/build/utils/__tests__/args.test.d.ts +1 -0
  39. package/build/utils/__tests__/array.test.d.ts +1 -0
  40. package/build/utils/__tests__/log.test.d.ts +1 -0
  41. package/build/utils/__tests__/npm.test.d.ts +1 -0
  42. package/build/utils/__tests__/obj.test.d.ts +1 -0
  43. package/build/utils/args.d.ts +33 -0
  44. package/build/utils/array.d.ts +1 -0
  45. package/build/utils/dir.d.ts +1 -0
  46. package/build/utils/env.d.ts +14 -0
  47. package/build/utils/fetch.d.ts +2 -0
  48. package/build/utils/git.d.ts +1 -0
  49. package/build/utils/github.d.ts +2 -0
  50. package/build/utils/log.d.ts +6 -0
  51. package/build/utils/npm.d.ts +52 -0
  52. package/build/utils/obj.d.ts +1 -0
  53. package/build/utils/tar.d.ts +10 -0
  54. package/build/utils/update-check.d.ts +2 -0
  55. package/package.json +33 -21
  56. package/template/agent-files/AGENTS.md +41 -0
  57. package/template/agent-files/CLAUDE.md +1 -0
  58. package/build/517.index.js +0 -1380
@@ -0,0 +1,7 @@
1
+ export declare const LEGACY_TEMPLATES: {
2
+ title: string;
3
+ value: string;
4
+ description: string;
5
+ }[];
6
+ export declare const ALIASES: string[];
7
+ export declare function promptTemplateAsync(): Promise<any>;
package/build/log.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ export declare function error(...message: string[]): void;
2
+ /** Print an error and provide additional info (the stack trace) in debug mode. */
3
+ export declare function exception(e: Error): void;
4
+ export declare function log(...message: string[]): void;
5
+ /** Log a message and exit the current process. If the `code` is non-zero then `console.error` will be used instead of `console.log`. */
6
+ export declare function exit(message: string | Error, code?: number): never;
7
+ export declare const Log: {
8
+ error: typeof error;
9
+ exception: typeof exception;
10
+ log: typeof log;
11
+ exit: typeof exit;
12
+ };
@@ -0,0 +1,2 @@
1
+ export declare function dotExpoHomeDirectory(): string;
2
+ export declare const getStateJsonPath: () => string;
@@ -0,0 +1,23 @@
1
+ type SdkVersionsSummary = {
2
+ /** Highest released SDK major version (highest entry with a releaseNoteUrl). */
3
+ latest: number;
4
+ /** Major SDK version currently shipping in the App Store / Play Store version of Expo Go. */
5
+ expoGoCompatible: number | null;
6
+ /** All released SDK major versions, sorted descending. */
7
+ available: number[];
8
+ };
9
+ export declare function fetchSdkVersionsAsync(): Promise<SdkVersionsSummary | null>;
10
+ /**
11
+ * If the resolved template is an Expo-published template without an explicit
12
+ * SDK tag, prompt the user to pick which Expo SDK to use and return the
13
+ * template name with the chosen SDK tag appended.
14
+ *
15
+ * Returns the template unchanged if the user is non-interactive, the template
16
+ * already targets a specific version, or we can't reach the versions endpoint.
17
+ */
18
+ export declare function applySdkVersionToTemplateAsync(template: string, { yes, showAlternatives, projectName, }: {
19
+ yes: boolean;
20
+ showAlternatives?: boolean;
21
+ projectName?: string;
22
+ }): Promise<string>;
23
+ export {};
@@ -0,0 +1,12 @@
1
+ export type PackageManagerName = 'npm' | 'pnpm' | 'yarn' | 'bun' | 'nub';
2
+ /** Determine which package manager to use for installing dependencies based on how the process was started. */
3
+ export declare function resolvePackageManager(): PackageManagerName;
4
+ export declare function isPackageManagerAvailable(manager: PackageManagerName): boolean;
5
+ export declare function formatRunCommand(packageManager: PackageManagerName, cmd: string): string;
6
+ export declare function formatSelfCommand(): "pnpx create-expo" | "bunx create-expo" | "nubx create-expo" | "npx create-expo";
7
+ export declare function installDependenciesAsync(projectRoot: string, packageManager: PackageManagerName, flags?: {
8
+ silent: boolean;
9
+ }): Promise<void>;
10
+ export declare function configurePackageManager(projectRoot: string, packageManager: PackageManagerName, flags?: {
11
+ silent: boolean;
12
+ }): Promise<void>;
@@ -0,0 +1,3 @@
1
+ export declare function assertValidName(folderName: string): void;
2
+ export declare function assertFolderEmpty(projectRoot: string, folderName: string): void;
3
+ export declare function resolveProjectRootAsync(input: string): Promise<string>;
@@ -0,0 +1,8 @@
1
+ type SessionData = {
2
+ sessionSecret: string;
3
+ userId: string;
4
+ username: string;
5
+ currentConnection: 'Username-Password-Authentication';
6
+ };
7
+ export declare function getSession(): SessionData | null;
8
+ export {};
@@ -0,0 +1,29 @@
1
+ type AnalyticsMessage = {
2
+ context?: {
3
+ [key: string]: unknown;
4
+ };
5
+ integrations?: {
6
+ [destination: string]: boolean;
7
+ };
8
+ properties?: {
9
+ [key: string]: unknown;
10
+ };
11
+ timestamp?: Date;
12
+ [key: string]: unknown;
13
+ };
14
+ export declare function _resetGlobals(): void;
15
+ export declare function initializeAnalyticsIdentityAsync(): Promise<void>;
16
+ export declare function identify(): void;
17
+ export declare function track(message: AnalyticsMessage & {
18
+ event: string;
19
+ }): void;
20
+ export declare function flushAsync(): Promise<void>;
21
+ export declare enum AnalyticsEventTypes {
22
+ CREATE_EXPO_APP = "create expo app"
23
+ }
24
+ export declare enum AnalyticsEventPhases {
25
+ ATTEMPT = "attempt",
26
+ SUCCESS = "success",
27
+ FAIL = "fail"
28
+ }
29
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,33 @@
1
+ import type { Spec } from 'arg';
2
+ import arg from 'arg';
3
+ /**
4
+ * Parse args and assert unknown options.
5
+ *
6
+ * @param schema the `args` schema for parsing the command line arguments.
7
+ * @param argv extra strings
8
+ * @returns processed args object.
9
+ */
10
+ export declare function assertWithOptionsArgs(schema: arg.Spec, options: arg.Options): arg.Result<arg.Spec>;
11
+ export declare function printHelp(info: string, usage: string, options: string, extra?: string): never;
12
+ /**
13
+ * Enables the resolution of arguments that can either be a string or a boolean.
14
+ *
15
+ * @param args arguments that were passed to the command.
16
+ * @param rawMap raw map of arguments that are passed to the command.
17
+ * @param extraArgs extra arguments and aliases that should be resolved as string or boolean.
18
+ * @returns parsed arguments and project root.
19
+ */
20
+ export declare function resolveStringOrBooleanArgsAsync(args: string[], rawMap: arg.Spec, extraArgs: arg.Spec): Promise<{
21
+ args: Record<string, string | true | undefined>;
22
+ projectRoot: string;
23
+ }>;
24
+ export declare function _resolveStringOrBooleanArgs(multiTypeArgs: Spec, args: string[]): {
25
+ args: Record<string, string | true | undefined>;
26
+ projectRoot: string;
27
+ };
28
+ /** Convert all aliases to fully qualified flag names. */
29
+ export declare function collapseAliases(arg: Spec, args: string[]): string[];
30
+ /** Assert that the spec has unknown arguments. */
31
+ export declare function assertUnknownArgs(arg: Spec, args: string[]): void;
32
+ /** Asserts that a duplicate flag has been used, this naively throws without knowing if an alias or flag were used as the duplicate. */
33
+ export declare function assertDuplicateArgs(args: string[], argNameAliasTuple: [string, string][]): void;
@@ -0,0 +1 @@
1
+ export declare function replaceValue<T>(values: T[], original: T, replacement: T): T[];
@@ -0,0 +1 @@
1
+ export declare function getConflictsForDirectory(projectRoot: string): string[];
@@ -0,0 +1,14 @@
1
+ declare class Env {
2
+ /** Enable debug logging */
3
+ get EXPO_DEBUG(): boolean;
4
+ /** Enable the beta version of Expo (TODO: Should this just be in the beta version of expo releases?) */
5
+ get EXPO_BETA(): boolean;
6
+ /** Is running in non-interactive CI mode */
7
+ get CI(): boolean;
8
+ /** Disable all API caches. Does not disable bundler caches. */
9
+ get EXPO_NO_CACHE(): boolean;
10
+ /** Disable telemetry (analytics) */
11
+ get EXPO_NO_TELEMETRY(): boolean;
12
+ }
13
+ export declare const env: Env;
14
+ export {};
@@ -0,0 +1,2 @@
1
+ /** Export a fetch method that ensures fetch is available */
2
+ export declare const fetch: typeof globalThis.fetch;
@@ -0,0 +1 @@
1
+ export declare function initGitRepoAsync(root: string): Promise<boolean>;
@@ -0,0 +1,2 @@
1
+ import { type ExtractProps } from './npm';
2
+ export declare function downloadAndExtractGitHubRepositoryAsync(repoUrl: URL, output: string, props: ExtractProps): Promise<string>;
@@ -0,0 +1,6 @@
1
+ import type { Ora } from 'ora';
2
+ export declare function withSectionLog<T>(action: (spinner: Ora) => Promise<T>, message: {
3
+ pending: string;
4
+ success: string;
5
+ error: (errror: Error) => string;
6
+ }): Promise<T>;
@@ -0,0 +1,52 @@
1
+ export interface ExtractProps {
2
+ expName: string;
3
+ filter?(path: string): boolean | undefined | null;
4
+ strip?: number;
5
+ disableCache?: boolean;
6
+ }
7
+ /** Applies the `@beta` npm tag when `EXPO_BETA` is enabled. */
8
+ export declare function applyBetaTag(npmPackageName: string): string;
9
+ /** Split a package name from its tag. */
10
+ export declare function splitNpmNameAndTag(npmPackageName: string): [string, string | undefined];
11
+ /**
12
+ * Applies known shortcuts to an NPM package name and tag.
13
+ * - If the name is `blank`, `blank-typescript`, `tabs`, or `bare-minimum`, apply the prefix `expo-template-`.
14
+ * - If a tag is a numeric value like `45`, and the name is a known template, then convert the tag to `sdk-X`.
15
+ *
16
+ * @example `blank@45` => `expo-template-blank@sdk-45`
17
+ */
18
+ export declare function getResolvedTemplateName(npmPackageName: string): string;
19
+ export declare function applyKnownNpmPackageNameRules(name: string): string | null;
20
+ /**
21
+ * Extracts a tarball stream to a directory.
22
+ */
23
+ export declare function extractNpmTarballAsync(stream: ReadableStream, output: string, props: ExtractProps): Promise<string>;
24
+ export declare function extractLocalNpmTarballAsync(tarFilePath: string, output: string, props: ExtractProps): Promise<string>;
25
+ /** Normalize the npm pack JSON formats used before and after npm 12 */
26
+ export declare function normalizeNpmPackResult(result: unknown): unknown[] | null;
27
+ export type NpmPackageInfo = {
28
+ /** "expo-template-blank@45.0.0" */
29
+ id: string;
30
+ /** "expo-template-blank" */
31
+ name: string;
32
+ /** "45.0.0" */
33
+ version: string;
34
+ /** 73765 */
35
+ size: number;
36
+ /** 90909 */
37
+ unpackedSize: number;
38
+ /** "2366988b44e4ee16eb2b0e902ee6c12a127b2c2e" */
39
+ shasum: string;
40
+ /** "sha512-oc7MjAt3sp8mi3Gf3LkKUNUkbiK7lJ7BecHMqe06n8vrStT4h2cHJKxf5dtAfgmXkBHHsQE/g7RUWrh1KbBjAw==" */
41
+ integrity: string;
42
+ /** "expo-template-blank-45.0.0.tgz" */
43
+ filename: string;
44
+ files: {
45
+ path: string;
46
+ size: number;
47
+ mode: number;
48
+ }[];
49
+ entryCount: number;
50
+ bundled: unknown[];
51
+ };
52
+ export declare function downloadAndExtractNpmModuleAsync(npmName: string, output: string, props: ExtractProps): Promise<string>;
@@ -0,0 +1 @@
1
+ export declare function deepMerge(target: any, source: any): any;
@@ -0,0 +1,10 @@
1
+ import { TarTypeFlag } from 'multitars';
2
+ export interface ExtractOptions {
3
+ strip?: number;
4
+ filter?(name: string, type: TarTypeFlag): boolean | null | undefined;
5
+ rename?(name: string, type: TarTypeFlag): string | null | undefined;
6
+ checksumAlgorithm?: string;
7
+ }
8
+ export declare function extractStream(input: ReadableStream, targetOutput: string, options?: ExtractOptions): Promise<string>;
9
+ /** Extract a tar using built-in tools if available and falling back on Node.js. */
10
+ export declare function extractAsync(input: string, output: string, options?: ExtractOptions): Promise<void>;
@@ -0,0 +1,2 @@
1
+ export declare const PACKAGE_NAME = "create-expo";
2
+ export default function shouldUpdate(): Promise<void>;
package/package.json CHANGED
@@ -1,31 +1,37 @@
1
1
  {
2
2
  "name": "create-expo",
3
- "version": "5.0.0",
4
- "bin": "./bin/create-expo.js",
5
- "main": "build",
3
+ "version": "5.1.0",
6
4
  "description": "Create universal Expo apps",
7
- "license": "BSD-3-Clause",
8
5
  "keywords": [
9
6
  "expo",
10
- "react-native",
11
- "react"
7
+ "react",
8
+ "react-native"
12
9
  ],
13
10
  "homepage": "https://docs.expo.dev",
11
+ "license": "BSD-3-Clause",
12
+ "author": "Evan Bacon <bacon@expo.io> (https://github.com/evanbacon)",
14
13
  "repository": {
15
14
  "type": "git",
16
15
  "url": "https://github.com/expo/expo.git",
17
16
  "directory": "packages/create-expo"
18
17
  },
19
- "author": "Evan Bacon <bacon@expo.io> (https://github.com/evanbacon)",
18
+ "bin": {
19
+ "create-expo": "./bin/create-expo.js"
20
+ },
20
21
  "files": [
21
22
  "bin",
22
23
  "build",
23
24
  "template"
24
25
  ],
25
- "engines": {
26
- "node": ">=18.13.0"
26
+ "main": "build/index.js",
27
+ "exports": {
28
+ ".": "./build/index.js",
29
+ "./package.json": "./package.json"
27
30
  },
28
31
  "devDependencies": {
32
+ "@expo/config": "58.0.0",
33
+ "@expo/json-file": "11.1.0",
34
+ "@expo/package-manager": "1.14.0",
29
35
  "@expo/spawn-async": "^1.8.0",
30
36
  "@octokit/types": "^13.5.0",
31
37
  "@types/debug": "^4.1.7",
@@ -37,28 +43,34 @@
37
43
  "arg": "^5.0.2",
38
44
  "chalk": "^4.0.0",
39
45
  "debug": "^4.3.4",
46
+ "expo-module-scripts": "56.0.3",
40
47
  "getenv": "^2.0.0",
41
48
  "glob": "^13.0.0",
49
+ "memfs": "^3.2.0",
50
+ "multitars": "^1.0.2",
42
51
  "nock": "^14.0.10",
43
52
  "ora": "3.4.0",
44
53
  "picomatch": "^2.3.2",
45
54
  "prompts": "^2.4.2",
46
- "multitars": "^1.0.0",
47
- "update-check": "^1.5.4",
48
- "@expo/config": "57.0.0",
49
- "@expo/json-file": "11.0.0",
50
- "expo-module-scripts": "56.0.3",
51
- "@expo/package-manager": "1.13.0"
55
+ "resolve-workspace-root": "^2.0.0",
56
+ "update-check": "^1.5.4"
57
+ },
58
+ "engines": {
59
+ "node": "^22.13.0 || ^24.3.0 || ^26.0.0 || >=27.0.0"
52
60
  },
53
- "gitHead": "e3eb896c5fdcd89e0cded98ff4e35c9db12cc9c0",
61
+ "gitHead": "c543a7181fc32e14f42d89550087b80ac5c490f2",
54
62
  "scripts": {
63
+ "prebuild": "expo-module clean",
55
64
  "build": "ncc build ./src/index.ts -o build/",
65
+ "prebuild:prod": "expo-module clean",
56
66
  "build:prod": "ncc build ./src/index.ts -o build/ --minify --no-cache --no-source-map-register",
57
67
  "clean": "expo-module clean",
58
- "lint": "expo-module lint",
59
- "typecheck": "expo-module typecheck",
60
- "test": "expo-module test",
61
- "test:e2e": "expo-module test --config e2e/jest.config.js --runInBand",
62
- "watch": "pnpm run build --watch"
68
+ "lint": "oxlint --config oxlint.config.mjs .",
69
+ "format": "expo-module format",
70
+ "depscheck": "expo-module depscheck",
71
+ "typecheck": "tsc -p tsconfig.json",
72
+ "test": "jest",
73
+ "test:e2e": "jest --config e2e/jest.config.js --runInBand",
74
+ "sync-agent-templates": "node scripts/sync-agent-templates.js"
63
75
  }
64
76
  }
@@ -0,0 +1,41 @@
1
+ This is an Expo/React Native mobile application. Prioritize mobile-first patterns, performance, and cross-platform compatibility.
2
+
3
+ ## Expo has changed — do not trust your training data
4
+
5
+ Expo ships breaking changes every SDK release. APIs you remember are likely renamed, moved, or removed. Before writing any code that touches an Expo, EAS, or React Native API:
6
+
7
+ 1. Read the major version of the `expo` package in `package.json`.
8
+ 2. Fetch the matching versioned docs: `https://docs.expo.dev/versions/v<major>.0.0/`
9
+ 3. For anything else, fetch https://docs.expo.dev/llms.txt — an index of all Expo docs with corrections to common LLM misconceptions. Follow its links to the specific page you need; never answer from memory.
10
+
11
+ ## Commands
12
+
13
+ Use `bunx` instead of `npx` if the project uses bun (`bun.lock` present).
14
+
15
+ ```bash
16
+ npx expo install <package> # ALWAYS use instead of npm/yarn/pnpm/bun add — resolves SDK-compatible versions
17
+ npx expo start # start the dev server
18
+ npx expo lint # lint
19
+ npx tsc --noEmit # typecheck
20
+ npx expo-doctor # diagnose dependency and config issues
21
+ npx expo install --fix # fix incompatible package versions
22
+ ```
23
+
24
+ Run lint and typecheck before declaring any task done.
25
+
26
+ ## Navigation & Routing
27
+
28
+ - Use **Expo Router** for all navigation. Routes live in `src/app/` — every file there is a screen, `_layout.tsx` files define navigators. Keep non-route code (components, hooks, utils) outside `src/app/`.
29
+ - Import `Link`, `router`, and `useLocalSearchParams` from `expo-router`.
30
+ - Docs: https://docs.expo.dev/router/introduction.md
31
+
32
+ ## Building with EAS
33
+
34
+ Use EAS to build, sign, and submit the app in the cloud (`eas build`, `eas submit`) and to ship over-the-air updates (`eas update`) — no local Xcode or Android Studio required. Run EAS CLI as `bunx eas-cli <command>` in Bun projects, or `npx eas-cli@latest <command>` otherwise; substitute that for bare `eas` in docs examples.
35
+ Docs: https://docs.expo.dev/eas/index.md
36
+
37
+ ## Rules
38
+
39
+ - If `ios/` and `android/` directories do not exist, they are generated (Continuous Native Generation). Never create or edit them by hand — configure native behavior in `app.json` and config plugins.
40
+ - Expo Go only includes its bundled native modules. After adding a library with native code, the app needs a development build: `npx expo run:ios|android` locally, or `eas build --profile development`.
41
+ - Prefer recommended Expo modules over third-party libraries, and check your available skills before adding dependencies. Docs: https://docs.expo.dev/versions/latest/index.md
@@ -0,0 +1 @@
1
+ @AGENTS.md