create-expo 5.0.2 → 5.1.1
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.
- package/build/{205.index.js → 589.index.js} +392 -91
- package/build/601.index.js +20 -11
- package/build/{223.index.js → 870.index.js} +2 -10
- package/build/Examples.d.ts +38 -0
- package/build/Template.d.ts +98 -0
- package/build/__mocks__/fs.d.ts +1 -0
- package/build/__mocks__/ora.d.ts +1 -0
- package/build/__tests__/Examples.test.d.ts +1 -0
- package/build/__tests__/Template.test.d.ts +1 -0
- package/build/__tests__/configureWorkspaces.test.d.ts +1 -0
- package/build/__tests__/createAsync.test.d.ts +1 -0
- package/build/__tests__/createExpoConfig.test.d.ts +1 -0
- package/build/__tests__/createFileTransformer.test.d.ts +1 -0
- package/build/__tests__/generateAgentFiles.test.d.ts +1 -0
- package/build/__tests__/promptSdkVersion.test.d.ts +1 -0
- package/build/__tests__/resolvePackageManager.test.d.ts +1 -0
- package/build/__tests__/sanitizeTemplate.test.d.ts +1 -0
- package/build/__tests__/telemetry.test.d.ts +1 -0
- package/build/cli.d.ts +1 -0
- package/build/configureWorkspaces.d.ts +9 -0
- package/build/createAsync.d.ts +11 -0
- package/build/createExpoConfig.d.ts +38 -0
- package/build/createFileTransform.d.ts +5 -0
- package/build/error.d.ts +9 -0
- package/build/generateAgentFiles.d.ts +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +38 -10
- package/build/legacyTemplates.d.ts +7 -0
- package/build/log.d.ts +12 -0
- package/build/paths.d.ts +2 -0
- package/build/promptSdkVersion.d.ts +23 -0
- package/build/resolvePackageManager.d.ts +12 -0
- package/build/resolveProjectRoot.d.ts +3 -0
- package/build/sessionStorage.d.ts +8 -0
- package/build/telemetry.d.ts +29 -0
- package/build/utils/__tests__/args.test.d.ts +1 -0
- package/build/utils/__tests__/array.test.d.ts +1 -0
- package/build/utils/__tests__/log.test.d.ts +1 -0
- package/build/utils/__tests__/npm.test.d.ts +1 -0
- package/build/utils/__tests__/obj.test.d.ts +1 -0
- package/build/utils/args.d.ts +33 -0
- package/build/utils/array.d.ts +1 -0
- package/build/utils/dir.d.ts +1 -0
- package/build/utils/env.d.ts +14 -0
- package/build/utils/fetch.d.ts +2 -0
- package/build/utils/git.d.ts +1 -0
- package/build/utils/github.d.ts +2 -0
- package/build/utils/log.d.ts +6 -0
- package/build/utils/npm.d.ts +52 -0
- package/build/utils/obj.d.ts +1 -0
- package/build/utils/tar.d.ts +10 -0
- package/build/utils/update-check.d.ts +2 -0
- package/package.json +31 -21
- package/build/517.index.js +0 -1380
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
|
+
};
|
package/build/paths.d.ts
ADDED
|
@@ -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,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 @@
|
|
|
1
|
+
export declare function initGitRepoAsync(root: string): Promise<boolean>;
|
|
@@ -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>;
|
package/package.json
CHANGED
|
@@ -1,31 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-expo",
|
|
3
|
-
"version": "5.
|
|
4
|
-
"bin": "./bin/create-expo.js",
|
|
5
|
-
"main": "build",
|
|
3
|
+
"version": "5.1.1",
|
|
6
4
|
"description": "Create universal Expo apps",
|
|
7
|
-
"license": "BSD-3-Clause",
|
|
8
5
|
"keywords": [
|
|
9
6
|
"expo",
|
|
10
|
-
"react
|
|
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
|
-
"
|
|
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
|
-
"
|
|
26
|
-
|
|
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,6 +43,7 @@
|
|
|
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",
|
|
42
49
|
"memfs": "^3.2.0",
|
|
@@ -45,22 +52,25 @@
|
|
|
45
52
|
"ora": "3.4.0",
|
|
46
53
|
"picomatch": "^2.3.2",
|
|
47
54
|
"prompts": "^2.4.2",
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
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"
|
|
53
60
|
},
|
|
54
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "40afe3afa42f1dcca3dcba7ffbb3641859bdf2f0",
|
|
55
62
|
"scripts": {
|
|
63
|
+
"prebuild": "expo-module clean",
|
|
56
64
|
"build": "ncc build ./src/index.ts -o build/",
|
|
65
|
+
"prebuild:prod": "expo-module clean",
|
|
57
66
|
"build:prod": "ncc build ./src/index.ts -o build/ --minify --no-cache --no-source-map-register",
|
|
58
67
|
"clean": "expo-module clean",
|
|
59
|
-
"lint": "
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
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"
|
|
65
75
|
}
|
|
66
76
|
}
|