@expo/cli 0.18.25 → 0.18.27

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/bin/cli CHANGED
@@ -120,7 +120,7 @@ const args = (0, _arg().default)({
120
120
  });
121
121
  if (args["--version"]) {
122
122
  // Version is added in the build script.
123
- console.log("0.18.25");
123
+ console.log("0.18.27");
124
124
  process.exit(0);
125
125
  }
126
126
  if (args["--non-interactive"]) {
@@ -36,45 +36,6 @@ function _interopRequireDefault(obj) {
36
36
  default: obj
37
37
  };
38
38
  }
39
- function _getRequireWildcardCache(nodeInterop) {
40
- if (typeof WeakMap !== "function") return null;
41
- var cacheBabelInterop = new WeakMap();
42
- var cacheNodeInterop = new WeakMap();
43
- return (_getRequireWildcardCache = function(nodeInterop) {
44
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
45
- })(nodeInterop);
46
- }
47
- function _interopRequireWildcard(obj, nodeInterop) {
48
- if (!nodeInterop && obj && obj.__esModule) {
49
- return obj;
50
- }
51
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
52
- return {
53
- default: obj
54
- };
55
- }
56
- var cache = _getRequireWildcardCache(nodeInterop);
57
- if (cache && cache.has(obj)) {
58
- return cache.get(obj);
59
- }
60
- var newObj = {};
61
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
62
- for(var key in obj){
63
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
64
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
65
- if (desc && (desc.get || desc.set)) {
66
- Object.defineProperty(newObj, key, desc);
67
- } else {
68
- newObj[key] = obj[key];
69
- }
70
- }
71
- }
72
- newObj.default = obj;
73
- if (cache) {
74
- cache.set(obj, newObj);
75
- }
76
- return newObj;
77
- }
78
39
  async function queryAndGenerateAsync(projectRoot, { files , props , extras }) {
79
40
  const valid = files.filter((file)=>!!_templates.TEMPLATES.find((template)=>template.destination(props) === file));
80
41
  if (valid.length !== files.length) {
@@ -106,9 +67,10 @@ async function generateAsync(projectRoot, { answer , props , extras }) {
106
67
  // Copy files
107
68
  await Promise.all(answer.map(async (file)=>{
108
69
  const template = _templates.TEMPLATES[file];
109
- if (template.id === "tsconfig.json") {
110
- const { typescript } = await Promise.resolve().then(()=>/*#__PURE__*/ _interopRequireWildcard(require("./typescript.js")));
111
- return typescript(projectRoot);
70
+ if (template.configureAsync) {
71
+ if (await template.configureAsync(projectRoot)) {
72
+ return;
73
+ }
112
74
  }
113
75
  const projectFilePath = _path().default.resolve(projectRoot, template.destination(props));
114
76
  // copy the file from template
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/customize/generate.ts"],"sourcesContent":["import path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { DestinationResolutionProps, selectTemplatesAsync, TEMPLATES } from './templates';\nimport { installAsync } from '../install/installAsync';\nimport { Log } from '../log';\nimport { copyAsync } from '../utils/dir';\nimport { CommandError } from '../utils/errors';\n\nexport async function queryAndGenerateAsync(\n projectRoot: string,\n {\n files,\n props,\n extras,\n }: {\n files: string[];\n props: DestinationResolutionProps;\n /** Any extra props to pass to the install command. */\n extras: any[];\n }\n) {\n const valid = files.filter(\n (file) => !!TEMPLATES.find((template) => template.destination(props) === file)\n );\n\n if (valid.length !== files.length) {\n const diff = files.filter(\n (file) => !TEMPLATES.find((template) => template.destination(props) === file)\n );\n throw new CommandError(\n `Invalid files: ${diff.join(', ')}. Allowed: ${TEMPLATES.map((template) =>\n template.destination(props)\n ).join(', ')}`\n );\n }\n\n if (!valid.length) {\n return;\n }\n Log.log(`Generating: ${valid.join(', ')}`);\n return generateAsync(projectRoot, {\n answer: files.map((file) =>\n TEMPLATES.findIndex((template) => template.destination(props) === file)\n ),\n props,\n extras,\n });\n}\n\n/** Select templates to generate then generate and install. */\nexport async function selectAndGenerateAsync(\n projectRoot: string,\n {\n props,\n extras,\n }: {\n props: DestinationResolutionProps;\n /** Any extra props to pass to the install command. */\n extras: any[];\n }\n) {\n const answer = await selectTemplatesAsync(projectRoot, props);\n\n if (!answer?.length) {\n Log.exit('\\n\\u203A Exiting with no change...', 0);\n }\n\n await generateAsync(projectRoot, {\n answer,\n props,\n extras,\n });\n}\n\nasync function generateAsync(\n projectRoot: string,\n {\n answer,\n props,\n extras,\n }: {\n answer: number[];\n props: DestinationResolutionProps;\n /** Any extra props to pass to the install command. */\n extras: any[];\n }\n) {\n // Copy files\n await Promise.all(\n answer.map(async (file) => {\n const template = TEMPLATES[file];\n\n if (template.id === 'tsconfig.json') {\n const { typescript } = await import('./typescript.js');\n return typescript(projectRoot);\n }\n\n const projectFilePath = path.resolve(projectRoot, template.destination(props));\n // copy the file from template\n return copyAsync(template.file(projectRoot), projectFilePath, {\n overwrite: true,\n recursive: true,\n });\n })\n );\n\n // Install dependencies\n const packages = answer\n .map((file) => TEMPLATES[file].dependencies)\n .flat()\n .filter((pkg) => !resolveFrom.silent(projectRoot, pkg));\n if (packages.length) {\n Log.debug('Installing ' + packages.join(', '));\n await installAsync(packages, {}, ['--dev', ...extras]);\n }\n}\n"],"names":["queryAndGenerateAsync","selectAndGenerateAsync","projectRoot","files","props","extras","valid","filter","file","TEMPLATES","find","template","destination","length","diff","CommandError","join","map","Log","log","generateAsync","answer","findIndex","selectTemplatesAsync","exit","Promise","all","id","typescript","projectFilePath","path","resolve","copyAsync","overwrite","recursive","packages","dependencies","flat","pkg","resolveFrom","silent","debug","installAsync"],"mappings":"AAAA;;;;;;;;;;;IASsBA,qBAAqB,MAArBA,qBAAqB;IA0CrBC,sBAAsB,MAAtBA,sBAAsB;;;8DAnD3B,MAAM;;;;;;;8DACC,cAAc;;;;;;2BAEsC,aAAa;8BAC5D,yBAAyB;qBAClC,QAAQ;qBACF,cAAc;wBACX,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEvC,eAAeD,qBAAqB,CACzCE,WAAmB,EACnB,EACEC,KAAK,CAAA,EACL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;IACL,CAAC,CAAC,CACH,CAAC;IAEF,uBAAuB;IACvB,MAAMC,QAAQ,GAAGd,MAAM,CACpBJ,GAAG,CAAC,CAACT,IAAI,GAAKC,UAAS,UAAA,CAACD,IAAI,CAAC,CAAC4B,YAAY,CAAC,CAC3CC,IAAI,EAAE,CACN9B,MAAM,CAAC,CAAC+B,GAAG,GAAK,CAACC,YAAW,EAAA,QAAA,CAACC,MAAM,CAACtC,WAAW,EAAEoC,GAAG,CAAC,CAAC,AAAC;IAC1D,IAAIH,QAAQ,CAACtB,MAAM,EAAE;QACnBK,IAAG,IAAA,CAACuB,KAAK,CAAC,aAAa,GAAGN,QAAQ,CAACnB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/C,MAAM0B,IAAAA,aAAY,aAAA,EAACP,QAAQ,EAAE,EAAE,EAAE;YAAC,OAAO;eAAK9B,MAAM;SAAC,CAAC,CAAC;IACzD,CAAC;AACH,CAAC"}
1
+ {"version":3,"sources":["../../../src/customize/generate.ts"],"sourcesContent":["import path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { DestinationResolutionProps, selectTemplatesAsync, TEMPLATES } from './templates';\nimport { installAsync } from '../install/installAsync';\nimport { Log } from '../log';\nimport { copyAsync } from '../utils/dir';\nimport { CommandError } from '../utils/errors';\n\nexport async function queryAndGenerateAsync(\n projectRoot: string,\n {\n files,\n props,\n extras,\n }: {\n files: string[];\n props: DestinationResolutionProps;\n /** Any extra props to pass to the install command. */\n extras: any[];\n }\n) {\n const valid = files.filter(\n (file) => !!TEMPLATES.find((template) => template.destination(props) === file)\n );\n\n if (valid.length !== files.length) {\n const diff = files.filter(\n (file) => !TEMPLATES.find((template) => template.destination(props) === file)\n );\n throw new CommandError(\n `Invalid files: ${diff.join(', ')}. Allowed: ${TEMPLATES.map((template) =>\n template.destination(props)\n ).join(', ')}`\n );\n }\n\n if (!valid.length) {\n return;\n }\n Log.log(`Generating: ${valid.join(', ')}`);\n return generateAsync(projectRoot, {\n answer: files.map((file) =>\n TEMPLATES.findIndex((template) => template.destination(props) === file)\n ),\n props,\n extras,\n });\n}\n\n/** Select templates to generate then generate and install. */\nexport async function selectAndGenerateAsync(\n projectRoot: string,\n {\n props,\n extras,\n }: {\n props: DestinationResolutionProps;\n /** Any extra props to pass to the install command. */\n extras: any[];\n }\n) {\n const answer = await selectTemplatesAsync(projectRoot, props);\n\n if (!answer?.length) {\n Log.exit('\\n\\u203A Exiting with no change...', 0);\n }\n\n await generateAsync(projectRoot, {\n answer,\n props,\n extras,\n });\n}\n\nasync function generateAsync(\n projectRoot: string,\n {\n answer,\n props,\n extras,\n }: {\n answer: number[];\n props: DestinationResolutionProps;\n /** Any extra props to pass to the install command. */\n extras: any[];\n }\n) {\n // Copy files\n await Promise.all(\n answer.map(async (file) => {\n const template = TEMPLATES[file];\n\n if (template.configureAsync) {\n if (await template.configureAsync(projectRoot)) {\n return;\n }\n }\n\n const projectFilePath = path.resolve(projectRoot, template.destination(props));\n // copy the file from template\n return copyAsync(template.file(projectRoot), projectFilePath, {\n overwrite: true,\n recursive: true,\n });\n })\n );\n\n // Install dependencies\n const packages = answer\n .map((file) => TEMPLATES[file].dependencies)\n .flat()\n .filter((pkg) => !resolveFrom.silent(projectRoot, pkg));\n if (packages.length) {\n Log.debug('Installing ' + packages.join(', '));\n await installAsync(packages, {}, ['--dev', ...extras]);\n }\n}\n"],"names":["queryAndGenerateAsync","selectAndGenerateAsync","projectRoot","files","props","extras","valid","filter","file","TEMPLATES","find","template","destination","length","diff","CommandError","join","map","Log","log","generateAsync","answer","findIndex","selectTemplatesAsync","exit","Promise","all","configureAsync","projectFilePath","path","resolve","copyAsync","overwrite","recursive","packages","dependencies","flat","pkg","resolveFrom","silent","debug","installAsync"],"mappings":"AAAA;;;;;;;;;;;IASsBA,qBAAqB,MAArBA,qBAAqB;IA0CrBC,sBAAsB,MAAtBA,sBAAsB;;;8DAnD3B,MAAM;;;;;;;8DACC,cAAc;;;;;;2BAEsC,aAAa;8BAC5D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AC5DI,SAAS,EAAE,IAAI;YACfC,SAAS,EAAE,IAAI;SAChB,CAAC,CAAC;IACL,CAAC,CAAC,CACH,CAAC;IAEF,uBAAuB;IACvB,MAAMC,QAAQ,GAAGb,MAAM,CACpBJ,GAAG,CAAC,CAACT,IAAI,GAAKC,UAAS,UAAA,CAACD,IAAI,CAAC,CAAC2B,YAAY,CAAC,CAC3CC,IAAI,EAAE,CACN7B,MAAM,CAAC,CAAC8B,GAAG,GAAK,CAACC,YAAW,EAAA,QAAA,CAACC,MAAM,CAACrC,WAAW,EAAEmC,GAAG,CAAC,CAAC,AAAC;IAC1D,IAAIH,QAAQ,CAACrB,MAAM,EAAE;QACnBK,IAAG,IAAA,CAACsB,KAAK,CAAC,aAAa,GAAGN,QAAQ,CAAClB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/C,MAAMyB,IAAAA,aAAY,aAAA,EAACP,QAAQ,EAAE,EAAE,EAAE;YAAC,OAAO;eAAK7B,MAAM;SAAC,CAAC,CAAC;IACzD,CAAC;AACH,CAAC"}
@@ -79,14 +79,6 @@ const TEMPLATES = [
79
79
  "babel-preset-expo",
80
80
  ]
81
81
  },
82
- {
83
- id: "webpack.config.js",
84
- file: (projectRoot)=>importFromExpoWebpackConfig(projectRoot, "template", "webpack.config.js"),
85
- destination: ()=>"webpack.config.js",
86
- dependencies: [
87
- "@expo/webpack-config"
88
- ]
89
- },
90
82
  {
91
83
  id: "metro.config.js",
92
84
  dependencies: [
@@ -95,6 +87,32 @@ const TEMPLATES = [
95
87
  destination: ()=>"metro.config.js",
96
88
  file: (projectRoot)=>importFromVendor(projectRoot, "metro.config.js")
97
89
  },
90
+ {
91
+ // `tsconfig.json` is special-cased and doesn't follow the template.
92
+ id: "tsconfig.json",
93
+ dependencies: [],
94
+ destination: ()=>"tsconfig.json",
95
+ file: ()=>"",
96
+ configureAsync: async (projectRoot)=>{
97
+ const { typescript } = require("./typescript");
98
+ await typescript(projectRoot);
99
+ return true;
100
+ }
101
+ },
102
+ {
103
+ id: ".eslintrc.js",
104
+ dependencies: [],
105
+ destination: ()=>".eslintrc.js",
106
+ file: (projectRoot)=>importFromVendor(projectRoot, ".eslintrc.js"),
107
+ configureAsync: async (projectRoot)=>{
108
+ const { ESLintProjectPrerequisite } = require("../lint/ESlintPrerequisite");
109
+ const prerequisite = new ESLintProjectPrerequisite(projectRoot);
110
+ if (!await prerequisite.assertAsync()) {
111
+ await prerequisite.bootstrapAsync();
112
+ }
113
+ return false;
114
+ }
115
+ },
98
116
  {
99
117
  id: "serve.json",
100
118
  file: (projectRoot)=>importFromExpoWebpackConfig(projectRoot, "web-default", "serve.json"),
@@ -110,11 +128,12 @@ const TEMPLATES = [
110
128
  dependencies: []
111
129
  },
112
130
  {
113
- // `tsconfig.json` is special cased and don't not follow the template
114
- id: "tsconfig.json",
115
- dependencies: [],
116
- destination: ()=>"tsconfig.json",
117
- file: ()=>""
131
+ id: "webpack.config.js",
132
+ file: (projectRoot)=>importFromExpoWebpackConfig(projectRoot, "template", "webpack.config.js"),
133
+ destination: ()=>"webpack.config.js",
134
+ dependencies: [
135
+ "@expo/webpack-config"
136
+ ]
118
137
  },
119
138
  ];
120
139
  /** Generate the prompt choices. */ function createChoices(projectRoot, props) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/customize/templates.ts"],"sourcesContent":["import chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport prompt, { ExpoChoice } from '../utils/prompts';\n\nconst debug = require('debug')('expo:customize:templates');\n\nexport type DestinationResolutionProps = {\n /** Web 'public' folder path (defaults to `/web`). This technically can be changed but shouldn't be. */\n webStaticPath: string;\n};\n\nfunction importFromExpoWebpackConfig(projectRoot: string, folder: string, moduleId: string) {\n try {\n const filePath = resolveFrom(projectRoot, `@expo/webpack-config/${folder}/${moduleId}`);\n debug(`Using @expo/webpack-config template for \"${moduleId}\": ${filePath}`);\n return filePath;\n } catch {\n debug(`@expo/webpack-config template for \"${moduleId}\" not found, falling back on @expo/cli`);\n }\n return importFromVendor(projectRoot, moduleId);\n}\n\nfunction importFromVendor(projectRoot: string, moduleId: string) {\n try {\n const filePath = resolveFrom(projectRoot, '@expo/cli/static/template/' + moduleId);\n debug(`Using @expo/cli template for \"${moduleId}\": ${filePath}`);\n return filePath;\n } catch {\n // For dev mode, testing and other cases where @expo/cli is not installed\n const filePath = require.resolve(`@expo/cli/static/template/${moduleId}`);\n debug(\n `Local @expo/cli template for \"${moduleId}\" not found, falling back on template relative to @expo/cli: ${filePath}`\n );\n\n return filePath;\n }\n}\n\nexport const TEMPLATES: {\n /** Unique ID for easily indexing. */\n id: string;\n /** Template file path to copy into the project. */\n file: (projectRoot: string) => string;\n /** Output location for the file in the user project. */\n destination: (props: DestinationResolutionProps) => string;\n /** List of dependencies to install in the project. These are used inside of the template file. */\n dependencies: string[];\n}[] = [\n {\n id: 'babel.config.js',\n file: (projectRoot) => importFromVendor(projectRoot, 'babel.config.js'),\n destination: () => 'babel.config.js',\n dependencies: [\n // Even though this is installed in `expo`, we should add it for now.\n 'babel-preset-expo',\n ],\n },\n {\n id: 'webpack.config.js',\n file: (projectRoot) =>\n importFromExpoWebpackConfig(projectRoot, 'template', 'webpack.config.js'),\n destination: () => 'webpack.config.js',\n dependencies: ['@expo/webpack-config'],\n },\n {\n id: 'metro.config.js',\n dependencies: ['@expo/metro-config'],\n destination: () => 'metro.config.js',\n file: (projectRoot) => importFromVendor(projectRoot, 'metro.config.js'),\n },\n {\n id: 'serve.json',\n file: (projectRoot) => importFromExpoWebpackConfig(projectRoot, 'web-default', 'serve.json'),\n // web/serve.json\n destination: ({ webStaticPath }) => webStaticPath + '/serve.json',\n dependencies: [],\n },\n {\n id: 'index.html',\n file: (projectRoot) => importFromExpoWebpackConfig(projectRoot, 'web-default', 'index.html'),\n // web/index.html\n destination: ({ webStaticPath }) => webStaticPath + '/index.html',\n dependencies: [],\n },\n {\n // `tsconfig.json` is special cased and don't not follow the template\n id: 'tsconfig.json',\n dependencies: [],\n destination: () => 'tsconfig.json',\n file: () => '',\n },\n];\n\n/** Generate the prompt choices. */\nfunction createChoices(\n projectRoot: string,\n props: DestinationResolutionProps\n): ExpoChoice<number>[] {\n return TEMPLATES.map((template, index) => {\n const destination = template.destination(props);\n const localProjectFile = path.resolve(projectRoot, destination);\n const exists = fs.existsSync(localProjectFile);\n\n return {\n title: destination,\n value: index,\n description: exists ? chalk.red('This will overwrite the existing file') : undefined,\n };\n });\n}\n\n/** Prompt to select templates to add. */\nexport async function selectTemplatesAsync(projectRoot: string, props: DestinationResolutionProps) {\n const options = createChoices(projectRoot, props);\n\n const { answer } = await prompt({\n type: 'multiselect',\n name: 'answer',\n message: 'Which files would you like to generate?',\n hint: '- Space to select. Return to submit',\n warn: 'File already exists.',\n limit: options.length,\n instructions: '',\n choices: options,\n });\n return answer;\n}\n"],"names":["TEMPLATES","selectTemplatesAsync","debug","require","importFromExpoWebpackConfig","projectRoot","folder","moduleId","filePath","resolveFrom","importFromVendor","resolve","id","file","destination","dependencies","webStaticPath","createChoices","props","map","template","index","localProjectFile","path","exists","fs","existsSync","title","value","description","chalk","red","undefined","options","answer","prompt","type","name","message","hint","warn","limit","length","instructions","choices"],"mappings":"AAAA;;;;;;;;;;;IAyCaA,SAAS,MAATA,SAAS;IA0EAC,oBAAoB,MAApBA,oBAAoB;;;8DAnHxB,OAAO;;;;;;;8DACV,IAAI;;;;;;;8DACF,MAAM;;;;;;;8DACC,cAAc;;;;;;8DAEH,kBAAkB;;;;;;AAErD,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,0BAA0B,CAAC,AAAC;AAO3D,SAASC,2BAA2B,CAACC,WAAmB,EAAEC,MAAc,EAAEC,QAAgB,EAAE;IAC1F,IAAI;QACF,MAAMC,QAAQ,GAAGC,IAAAA,YAAW,EAAA,QAAA,EAACJ,WAAW,EAAE,CAAC,qBAAqB,EAAEC,MAAM,CAAC,CAAC,EAAEC,QAAQ,CAAC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;QAChE,MAAMU,MAAM,GAAGC,GAAE,EAAA,QAAA,CAACC,UAAU,CAACJ,gBAAgB,CAAC,AAAC;QAE/C,OAAO;YACLK,KAAK,EAAEb,WAAW;YAClBc,KAAK,EAAEP,KAAK;YACZQ,WAAW,EAAEL,MAAM,GAAGM,MAAK,EAAA,QAAA,CAACC,GAAG,CAAC,uCAAuC,CAAC,GAAGC,SAAS;SACrF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAGM,eAAe/B,oBAAoB,CAACI,WAAmB,EAAEa,KAAiC,EAAE;IACjG,MAAMe,OAAO,GAAGhB,aAAa,CAACZ,WAAW,EAAEa,KAAK,CAAC,AAAC;IAElD,MAAM,EAAEgB,MAAM,CAAA,EAAE,GAAG,MAAMC,IAAAA,QAAM,QAAA,EAAC;QAC9BC,IAAI,EAAE,aAAa;QACnBC,IAAI,EAAE,QAAQ;QACdC,OAAO,EAAE,yCAAyC;QAClDC,IAAI,EAAE,qCAAqC;QAC3CC,IAAI,EAAE,sBAAsB;QAC5BC,KAAK,EAAER,OAAO,CAACS,MAAM;QACrBC,YAAY,EAAE,EAAE;QAChBC,OAAO,EAAEX,OAAO;KACjB,CAAC,AAAC;IACH,OAAOC,MAAM,CAAC;AAChB,CAAC"}
1
+ {"version":3,"sources":["../../../src/customize/templates.ts"],"sourcesContent":["import chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport prompt, { ExpoChoice } from '../utils/prompts';\n\nconst debug = require('debug')('expo:customize:templates');\n\nexport type DestinationResolutionProps = {\n /** Web 'public' folder path (defaults to `/web`). This technically can be changed but shouldn't be. */\n webStaticPath: string;\n};\n\nfunction importFromExpoWebpackConfig(projectRoot: string, folder: string, moduleId: string) {\n try {\n const filePath = resolveFrom(projectRoot, `@expo/webpack-config/${folder}/${moduleId}`);\n debug(`Using @expo/webpack-config template for \"${moduleId}\": ${filePath}`);\n return filePath;\n } catch {\n debug(`@expo/webpack-config template for \"${moduleId}\" not found, falling back on @expo/cli`);\n }\n return importFromVendor(projectRoot, moduleId);\n}\n\nfunction importFromVendor(projectRoot: string, moduleId: string) {\n try {\n const filePath = resolveFrom(projectRoot, '@expo/cli/static/template/' + moduleId);\n debug(`Using @expo/cli template for \"${moduleId}\": ${filePath}`);\n return filePath;\n } catch {\n // For dev mode, testing and other cases where @expo/cli is not installed\n const filePath = require.resolve(`@expo/cli/static/template/${moduleId}`);\n debug(\n `Local @expo/cli template for \"${moduleId}\" not found, falling back on template relative to @expo/cli: ${filePath}`\n );\n\n return filePath;\n }\n}\n\nexport const TEMPLATES: {\n /** Unique ID for easily indexing. */\n id: string;\n /** Template file path to copy into the project. */\n file: (projectRoot: string) => string;\n /** Output location for the file in the user project. */\n destination: (props: DestinationResolutionProps) => string;\n /** List of dependencies to install in the project. These are used inside of the template file. */\n dependencies: string[];\n\n /** Custom step for configuring the file. Return true to exit early. */\n configureAsync?: (projectRoot: string) => Promise<boolean>;\n}[] = [\n {\n id: 'babel.config.js',\n file: (projectRoot) => importFromVendor(projectRoot, 'babel.config.js'),\n destination: () => 'babel.config.js',\n dependencies: [\n // Even though this is installed in `expo`, we should add it for now.\n 'babel-preset-expo',\n ],\n },\n {\n id: 'metro.config.js',\n dependencies: ['@expo/metro-config'],\n destination: () => 'metro.config.js',\n file: (projectRoot) => importFromVendor(projectRoot, 'metro.config.js'),\n },\n {\n // `tsconfig.json` is special-cased and doesn't follow the template.\n id: 'tsconfig.json',\n dependencies: [],\n destination: () => 'tsconfig.json',\n file: () => '',\n configureAsync: async (projectRoot) => {\n const { typescript } = require('./typescript') as typeof import('./typescript');\n await typescript(projectRoot);\n return true;\n },\n },\n {\n id: '.eslintrc.js',\n dependencies: [],\n destination: () => '.eslintrc.js',\n file: (projectRoot) => importFromVendor(projectRoot, '.eslintrc.js'),\n configureAsync: async (projectRoot) => {\n const { ESLintProjectPrerequisite } =\n require('../lint/ESlintPrerequisite') as typeof import('../lint/ESlintPrerequisite.js');\n const prerequisite = new ESLintProjectPrerequisite(projectRoot);\n if (!(await prerequisite.assertAsync())) {\n await prerequisite.bootstrapAsync();\n }\n return false;\n },\n },\n {\n id: 'serve.json',\n file: (projectRoot) => importFromExpoWebpackConfig(projectRoot, 'web-default', 'serve.json'),\n // web/serve.json\n destination: ({ webStaticPath }) => webStaticPath + '/serve.json',\n dependencies: [],\n },\n {\n id: 'index.html',\n file: (projectRoot) => importFromExpoWebpackConfig(projectRoot, 'web-default', 'index.html'),\n // web/index.html\n destination: ({ webStaticPath }) => webStaticPath + '/index.html',\n dependencies: [],\n },\n {\n id: 'webpack.config.js',\n file: (projectRoot) =>\n importFromExpoWebpackConfig(projectRoot, 'template', 'webpack.config.js'),\n destination: () => 'webpack.config.js',\n dependencies: ['@expo/webpack-config'],\n },\n];\n\n/** Generate the prompt choices. */\nfunction createChoices(\n projectRoot: string,\n props: DestinationResolutionProps\n): ExpoChoice<number>[] {\n return TEMPLATES.map((template, index) => {\n const destination = template.destination(props);\n const localProjectFile = path.resolve(projectRoot, destination);\n const exists = fs.existsSync(localProjectFile);\n\n return {\n title: destination,\n value: index,\n description: exists ? chalk.red('This will overwrite the existing file') : undefined,\n };\n });\n}\n\n/** Prompt to select templates to add. */\nexport async function selectTemplatesAsync(projectRoot: string, props: DestinationResolutionProps) {\n const options = createChoices(projectRoot, props);\n\n const { answer } = await prompt({\n type: 'multiselect',\n name: 'answer',\n message: 'Which files would you like to generate?',\n hint: '- Space to select. Return to submit',\n warn: 'File already exists.',\n limit: options.length,\n instructions: '',\n choices: options,\n });\n return answer;\n}\n"],"names":["TEMPLATES","selectTemplatesAsync","debug","require","importFromExpoWebpackConfig","projectRoot","folder","moduleId","filePath","resolveFrom","importFromVendor","resolve","id","file","destination","dependencies","configureAsync","typescript","ESLintProjectPrerequisite","prerequisite","assertAsync","bootstrapAsync","webStaticPath","createChoices","props","map","template","index","localProjectFile","path","exists","fs","existsSync","title","value","description","chalk","red","undefined","options","answer","prompt","type","name","message","hint","warn","lim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AAGC,GAAE,EAAA,QAAA,CAACC,UAAU,CAACJ,gBAAgB,CAAC,AAAC;QAE/C,OAAO;YACLK,KAAK,EAAEnB,WAAW;YAClBoB,KAAK,EAAEP,KAAK;YACZQ,WAAW,EAAEL,MAAM,GAAGM,MAAK,EAAA,QAAA,CAACC,GAAG,CAAC,uCAAuC,CAAC,GAAGC,SAAS;SACrF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAGM,eAAerC,oBAAoB,CAACI,WAAmB,EAAEmB,KAAiC,EAAE;IACjG,MAAMe,OAAO,GAAGhB,aAAa,CAAClB,WAAW,EAAEmB,KAAK,CAAC,AAAC;IAElD,MAAM,EAAEgB,MAAM,CAAA,EAAE,GAAG,MAAMC,IAAAA,QAAM,QAAA,EAAC;QAC9BC,IAAI,EAAE,aAAa;QACnBC,IAAI,EAAE,QAAQ;QACdC,OAAO,EAAE,yCAAyC;QAClDC,IAAI,EAAE,qCAAqC;QAC3CC,IAAI,EAAE,sBAAsB;QAC5BC,KAAK,EAAER,OAAO,CAACS,MAAM;QACrBC,YAAY,EAAE,EAAE;QAChBC,OAAO,EAAEX,OAAO;KACjB,CAAC,AAAC;IACH,OAAOC,MAAM,CAAC;AAChB,CAAC"}
@@ -81,6 +81,10 @@ const expoExportEmbed = async (argv)=>{
81
81
  "--asset-catalog-dest": String,
82
82
  "--unstable-transform-profile": String,
83
83
  "--config": String,
84
+ // Hack: This is added because react-native-xcode.sh script always includes this value.
85
+ // If supplied, we'll do nothing with the value, but at least the process won't crash.
86
+ // Note that we also don't show this value in the `--help` prompt since we don't want people to use it.
87
+ "--config-cmd": String,
84
88
  // This is here for compatibility with the `npx react-native bundle` command.
85
89
  // devs should use `DEBUG=expo:*` instead.
86
90
  "--verbose": Boolean,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/export/embed/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport arg from 'arg';\nimport chalk from 'chalk';\nimport path from 'path';\n\nimport { Command } from '../../../bin/cli';\nimport { assertWithOptionsArgs, printHelp } from '../../utils/args';\n\nexport const expoExportEmbed: Command = async (argv) => {\n const rawArgsMap: arg.Spec = {\n // Types\n '--entry-file': String,\n '--platform': String,\n '--transformer': String,\n '--bundle-output': String,\n '--bundle-encoding': String,\n '--max-workers': Number,\n '--sourcemap-output': String,\n '--sourcemap-sources-root': String,\n '--assets-dest': String,\n '--asset-catalog-dest': String,\n '--unstable-transform-profile': String,\n '--config': String,\n\n // This is here for compatibility with the `npx react-native bundle` command.\n // devs should use `DEBUG=expo:*` instead.\n '--verbose': Boolean,\n '--help': Boolean,\n // Aliases\n '-h': '--help',\n '-v': '--verbose',\n };\n const args = assertWithOptionsArgs(rawArgsMap, {\n argv,\n permissive: true,\n });\n\n if (args['--help']) {\n printHelp(\n `(Internal) Export the JavaScript bundle during a native build script for embedding in a native binary`,\n chalk`npx expo export:embed {dim <dir>}`,\n [\n chalk`<dir> Directory of the Expo project. {dim Default: Current working directory}`,\n `--entry-file <path> Path to the root JS file, either absolute or relative to JS root`,\n `--platform <string> Either \"ios\" or \"android\" (default: \"ios\")`,\n `--transformer <string> Specify a custom transformer to be used`,\n `--dev [boolean] If false, warnings are disabled and the bundle is minified (default: true)`,\n `--minify [boolean] Allows overriding whether bundle is minified. This defaults to false if dev is true, and true if dev is false. Disabling minification can be useful for speeding up production builds for testing purposes.`,\n `--bundle-output <string> File name where to store the resulting bundle, ex. /tmp/groups.bundle`,\n `--bundle-encoding <string> Encoding the bundle should be written in (https://nodejs.org/api/buffer.html#buffer_buffer). (default: \"utf8\")`,\n `--max-workers <number> Specifies the maximum number of workers the worker-pool will spawn for transforming files. This defaults to the number of the cores available on your machine.`,\n `--sourcemap-output <string> File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map`,\n `--sourcemap-sources-root <string> Path to make sourcemap's sources entries relative to, ex. /root/dir`,\n `--sourcemap-use-absolute-path Report SourceMapURL using its full path`,\n `--assets-dest <string> Directory name where to store assets referenced in the bundle`,\n `--asset-catalog-dest <string> Directory to create an iOS Asset Catalog for images`,\n `--unstable-transform-profile <string> Experimental, transform JS for a specific JS engine. Currently supported: hermes, hermes-canary, default`,\n `--reset-cache Removes cached files`,\n `-v, --verbose Enables debug logging`,\n\n `--config <string> Path to the CLI configuration file`,\n // This is seemingly unused.\n `--read-global-cache Try to fetch transformed JS code from the global cache, if configured.`,\n\n `-h, --help Usage info`,\n ].join('\\n')\n );\n }\n\n const [\n { exportEmbedAsync },\n { resolveOptions },\n { logCmdError },\n { resolveCustomBooleanArgsAsync },\n ] = await Promise.all([\n import('./exportEmbedAsync.js'),\n import('./resolveOptions.js'),\n import('../../utils/errors.js'),\n import('../../utils/resolveArgs.js'),\n ]);\n\n return (async () => {\n const parsed = await resolveCustomBooleanArgsAsync(argv ?? [], rawArgsMap, {\n '--dev': Boolean,\n '--minify': Boolean,\n '--sourcemap-use-absolute-path': Boolean,\n '--reset-cache': Boolean,\n '--read-global-cache': Boolean,\n });\n return exportEmbedAsync(path.resolve(parsed.projectRoot), resolveOptions(args, parsed));\n })().catch(logCmdError);\n};\n"],"names":["expoExportEmbed","argv","rawArgsMap","String","Number","Boolean","args","assertWithOptionsArgs","permissive","printHelp","chalk","join","exportEmbedAsync","resolveOptions","logCmdError","resolveCustomBooleanArgsAsync","Promise","all","parsed","path","resolve","projectRoot","catch"],"mappings":"AAAA;;;;;+BAQaA,iBAAe;;aAAfA,eAAe;;;8DANV,OAAO;;;;;;;8DACR,MAAM;;;;;;sBAG0B,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE5D,MAAMA,eAAe,GAAY,OAAOC,IAAI,GAAK;IACtD,MAAMC,UAAU,GAAa;QAC3B,QAAQ;QACR,cAAc,EAAEC,MAAM;QACtB,YAAY,EAAEA,MAAM;QACpB,eAAe,EAAEA,MAAM;QACvB,iBAAiB,EAAEA,MAAM;QACzB,mBAAmB,EAAEA,MAAM;QAC3B,eAAe,EAAEC,MAAM;QACvB,o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,CAAC;IAED,MAAM,CACJ,EAAEC,gBAAgB,CAAA,EAAE,EACpB,EAAEC,cAAc,CAAA,EAAE,EAClB,EAAEC,WAAW,CAAA,EAAE,EACf,EAAEC,6BAA6B,CAAA,EAAE,GAClC,GAAG,MAAMC,OAAO,CAACC,GAAG,CAAC;QACpB,iEAAA,OAAM,CAAC,uBAAuB,GAAC;QAC/B,iEAAA,OAAM,CAAC,qBAAqB,GAAC;QAC7B,iEAAA,OAAM,CAAC,uBAAuB,GAAC;QAC/B,iEAAA,OAAM,CAAC,4BAA4B,GAAC;KACrC,CAAC,AAAC;IAEH,OAAO,CAAC,UAAY;QAClB,MAAMC,MAAM,GAAG,MAAMH,6BAA6B,CAACd,IAAI,WAAJA,IAAI,GAAI,EAAE,EAAEC,UAAU,EAAE;YACzE,OAAO,EAAEG,OAAO;YAChB,UAAU,EAAEA,OAAO;YACnB,+BAA+B,EAAEA,OAAO;YACxC,eAAe,EAAEA,OAAO;YACxB,qBAAqB,EAAEA,OAAO;SAC/B,CAAC,AAAC;QACH,OAAOO,gBAAgB,CAACO,KAAI,EAAA,QAAA,CAACC,OAAO,CAACF,MAAM,CAACG,WAAW,CAAC,EAAER,cAAc,CAACP,IAAI,EAAEY,MAAM,CAAC,CAAC,CAAC;IAC1F,CAAC,CAAC,EAAE,CAACI,KAAK,CAACR,WAAW,CAAC,CAAC;AAC1B,CAAC,AAAC"}
1
+ {"version":3,"sources":["../../../../src/export/embed/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport arg from 'arg';\nimport chalk from 'chalk';\nimport path from 'path';\n\nimport { Command } from '../../../bin/cli';\nimport { assertWithOptionsArgs, printHelp } from '../../utils/args';\n\nexport const expoExportEmbed: Command = async (argv) => {\n const rawArgsMap: arg.Spec = {\n // Types\n '--entry-file': String,\n '--platform': String,\n '--transformer': String,\n '--bundle-output': String,\n '--bundle-encoding': String,\n '--max-workers': Number,\n '--sourcemap-output': String,\n '--sourcemap-sources-root': String,\n '--assets-dest': String,\n '--asset-catalog-dest': String,\n '--unstable-transform-profile': String,\n '--config': String,\n\n // Hack: This is added because react-native-xcode.sh script always includes this value.\n // If supplied, we'll do nothing with the value, but at least the process won't crash.\n // Note that we also don't show this value in the `--help` prompt since we don't want people to use it.\n '--config-cmd': String,\n\n // This is here for compatibility with the `npx react-native bundle` command.\n // devs should use `DEBUG=expo:*` instead.\n '--verbose': Boolean,\n '--help': Boolean,\n // Aliases\n '-h': '--help',\n '-v': '--verbose',\n };\n const args = assertWithOptionsArgs(rawArgsMap, {\n argv,\n permissive: true,\n });\n\n if (args['--help']) {\n printHelp(\n `(Internal) Export the JavaScript bundle during a native build script for embedding in a native binary`,\n chalk`npx expo export:embed {dim <dir>}`,\n [\n chalk`<dir> Directory of the Expo project. {dim Default: Current working directory}`,\n `--entry-file <path> Path to the root JS file, either absolute or relative to JS root`,\n `--platform <string> Either \"ios\" or \"android\" (default: \"ios\")`,\n `--transformer <string> Specify a custom transformer to be used`,\n `--dev [boolean] If false, warnings are disabled and the bundle is minified (default: true)`,\n `--minify [boolean] Allows overriding whether bundle is minified. This defaults to false if dev is true, and true if dev is false. Disabling minification can be useful for speeding up production builds for testing purposes.`,\n `--bundle-output <string> File name where to store the resulting bundle, ex. /tmp/groups.bundle`,\n `--bundle-encoding <string> Encoding the bundle should be written in (https://nodejs.org/api/buffer.html#buffer_buffer). (default: \"utf8\")`,\n `--max-workers <number> Specifies the maximum number of workers the worker-pool will spawn for transforming files. This defaults to the number of the cores available on your machine.`,\n `--sourcemap-output <string> File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map`,\n `--sourcemap-sources-root <string> Path to make sourcemap's sources entries relative to, ex. /root/dir`,\n `--sourcemap-use-absolute-path Report SourceMapURL using its full path`,\n `--assets-dest <string> Directory name where to store assets referenced in the bundle`,\n `--asset-catalog-dest <string> Directory to create an iOS Asset Catalog for images`,\n `--unstable-transform-profile <string> Experimental, transform JS for a specific JS engine. Currently supported: hermes, hermes-canary, default`,\n `--reset-cache Removes cached files`,\n `-v, --verbose Enables debug logging`,\n\n `--config <string> Path to the CLI configuration file`,\n // This is seemingly unused.\n `--read-global-cache Try to fetch transformed JS code from the global cache, if configured.`,\n\n `-h, --help Usage info`,\n ].join('\\n')\n );\n }\n\n const [\n { exportEmbedAsync },\n { resolveOptions },\n { logCmdError },\n { resolveCustomBooleanArgsAsync },\n ] = await Promise.all([\n import('./exportEmbedAsync.js'),\n import('./resolveOptions.js'),\n import('../../utils/errors.js'),\n import('../../utils/resolveArgs.js'),\n ]);\n\n return (async () => {\n const parsed = await resolveCustomBooleanArgsAsync(argv ?? [], rawArgsMap, {\n '--dev': Boolean,\n '--minify': Boolean,\n '--sourcemap-use-absolute-path': Boolean,\n '--reset-cache': Boolean,\n '--read-global-cache': Boolean,\n });\n return exportEmbedAsync(path.resolve(parsed.projectRoot), resolveOptions(args, parsed));\n })().catch(logCmdError);\n};\n"],"names":["expoExportEmbed","argv","rawArgsMap","String","Number","Boolean","args","assertWithOptionsArgs","permissive","printHelp","chalk","join","exportEmbedAsync","resolveOptions","logCmdError","resolveCustomBooleanArgsAsync","Promise","all","parsed","path","resolve","projectRoot","catch"],"mappings":"AAAA;;;;;+BAQaA,iBAAe;;aAAfA,eAAe;;;8DANV,OAAO;;;;;;;8DACR,MAAM;;;;;;sBAG0B,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE5D,MAAMA,eAAe,GAAY,OAAOC,IAAI,GAAK;IACtD,MAAMC,UAAU,GAAa;QAC3B,QAAQ;QACR,cAAc,EAAEC,MAAM;QACtB,YAAY,EAAEA,MAAM;QACpB,eAAe,EAAEA,MAAM;QACvB,iBAAiB,EAAEA,MAAM;QACzB,mBAAmB,EAAEA,MAAM;QAC3B,eAAe,EAAEC,MAAM;QACvB,oBAAoB,EAAED,MAAM;QAC5B,0BAA0B,EAAEA,MAAM;QAClC,eAAe,EAAEA,MAAM;QACvB,sBAAsB,EAAEA,MAAM;QAC9B,8BAA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AA,EAAE,EACpB,EAAEC,cAAc,CAAA,EAAE,EAClB,EAAEC,WAAW,CAAA,EAAE,EACf,EAAEC,6BAA6B,CAAA,EAAE,GAClC,GAAG,MAAMC,OAAO,CAACC,GAAG,CAAC;QACpB,iEAAA,OAAM,CAAC,uBAAuB,GAAC;QAC/B,iEAAA,OAAM,CAAC,qBAAqB,GAAC;QAC7B,iEAAA,OAAM,CAAC,uBAAuB,GAAC;QAC/B,iEAAA,OAAM,CAAC,4BAA4B,GAAC;KACrC,CAAC,AAAC;IAEH,OAAO,CAAC,UAAY;QAClB,MAAMC,MAAM,GAAG,MAAMH,6BAA6B,CAACd,IAAI,WAAJA,IAAI,GAAI,EAAE,EAAEC,UAAU,EAAE;YACzE,OAAO,EAAEG,OAAO;YAChB,UAAU,EAAEA,OAAO;YACnB,+BAA+B,EAAEA,OAAO;YACxC,eAAe,EAAEA,OAAO;YACxB,qBAAqB,EAAEA,OAAO;SAC/B,CAAC,AAAC;QACH,OAAOO,gBAAgB,CAACO,KAAI,EAAA,QAAA,CAACC,OAAO,CAACF,MAAM,CAACG,WAAW,CAAC,EAAER,cAAc,CAACP,IAAI,EAAEY,MAAM,CAAC,CAAC,CAAC;IAC1F,CAAC,CAAC,EAAE,CAACI,KAAK,CAACR,WAAW,CAAC,CAAC;AAC1B,CAAC,AAAC"}
@@ -31,6 +31,7 @@ const _log = require("../log");
31
31
  const _prerequisite = require("../start/doctor/Prerequisite");
32
32
  const _ensureDependenciesAsync = require("../start/doctor/dependencies/ensureDependenciesAsync");
33
33
  const _findUp = require("../utils/findUp");
34
+ const _interactive = require("../utils/interactive");
34
35
  const _prompts = require("../utils/prompts");
35
36
  function _interopRequireDefault(obj) {
36
37
  return obj && obj.__esModule ? obj : {
@@ -38,11 +39,6 @@ function _interopRequireDefault(obj) {
38
39
  };
39
40
  }
40
41
  const debug = require("debug")("expo:lint");
41
- const ESLINT_TEMPLATE_BASE = `// https://docs.expo.dev/guides/using-eslint/
42
- module.exports = {
43
- extends: 'expo',
44
- };
45
- `;
46
42
  class ESLintProjectPrerequisite extends _prerequisite.ProjectPrerequisite {
47
43
  async assertImplementation() {
48
44
  const hasEslintConfig = await eslintIsConfigured(this.projectRoot);
@@ -53,11 +49,15 @@ class ESLintProjectPrerequisite extends _prerequisite.ProjectPrerequisite {
53
49
  debug("Setting up ESLint");
54
50
  const hasEslintConfig = await eslintIsConfigured(this.projectRoot);
55
51
  if (!hasEslintConfig) {
56
- const shouldSetupLint = await (0, _prompts.confirmAsync)({
57
- message: "No ESLint config found. Install and configure ESLint in this project?"
58
- });
59
- if (!shouldSetupLint) {
60
- throw new _prerequisite.PrerequisiteCommandError("ESLint is not configured for this project.");
52
+ if (!(0, _interactive.isInteractive)()) {
53
+ _log.Log.warn(`No ESLint config found. Configuring automatically.`);
54
+ } else {
55
+ const shouldSetupLint = await (0, _prompts.confirmAsync)({
56
+ message: "No ESLint config found. Install and configure ESLint in this project?"
57
+ });
58
+ if (!shouldSetupLint) {
59
+ throw new _prerequisite.PrerequisiteCommandError("ESLint is not configured for this project.");
60
+ }
61
61
  }
62
62
  // TODO(cedric): if we want to add prettier, also configure proper prettier rules
63
63
  // const shouldIncludePrettier = await confirmAsync({
@@ -84,7 +84,7 @@ class ESLintProjectPrerequisite extends _prerequisite.ProjectPrerequisite {
84
84
  // if (shouldIncludePrettier) {
85
85
  // await fs.writeFile(path.join(this.projectRoot, '.prettierrc'), '{}', 'utf8');
86
86
  // }
87
- await _promises().default.writeFile(_path().default.join(this.projectRoot, ".eslintrc.js"), ESLINT_TEMPLATE_BASE, "utf8");
87
+ await _promises().default.writeFile(_path().default.join(this.projectRoot, ".eslintrc.js"), await _promises().default.readFile(require.resolve(`@expo/cli/static/template/.eslintrc.js`), "utf8"), "utf8");
88
88
  }
89
89
  const hasLintScript = await lintScriptIsConfigured(this.projectRoot);
90
90
  if (!hasLintScript) {
@@ -118,7 +118,6 @@ class ESLintProjectPrerequisite extends _prerequisite.ProjectPrerequisite {
118
118
  dev: true
119
119
  },
120
120
  {
121
- version: "^7.0.0",
122
121
  pkg: "eslint-config-expo",
123
122
  file: "eslint-config-expo/package.json",
124
123
  dev: true
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lint/ESlintPrerequisite.ts"],"sourcesContent":["import JsonFile, { JSONObject } from '@expo/json-file';\nimport fs from 'fs/promises';\nimport path from 'path';\n\nimport { Log } from '../log';\nimport { PrerequisiteCommandError, ProjectPrerequisite } from '../start/doctor/Prerequisite';\nimport { ensureDependenciesAsync } from '../start/doctor/dependencies/ensureDependenciesAsync';\nimport { findFileInParents } from '../utils/findUp';\nimport { confirmAsync } from '../utils/prompts';\n\nconst debug = require('debug')('expo:lint') as typeof console.log;\n\nconst ESLINT_TEMPLATE_BASE = `// https://docs.expo.dev/guides/using-eslint/\nmodule.exports = {\n extends: 'expo',\n};\n`;\n\n// TODO(cedric): if we want to add prettier, also configure proper prettier rules\n// const ESLINT_TEMPLATE_PRETTIER = `// https://docs.expo.dev/guides/using-eslint/\n// module.exports = {\n// extends: ['expo', 'prettier'],\n// plugins: ['prettier'],\n// rules: {\n// 'prettier/prettier': ['warn'],\n// },\n// };\n// `;\n\n/** Ensure the project has the required ESlint config. */\nexport class ESLintProjectPrerequisite extends ProjectPrerequisite<boolean> {\n async assertImplementation(): Promise<boolean> {\n const hasEslintConfig = await eslintIsConfigured(this.projectRoot);\n const hasLintScript = await lintScriptIsConfigured(this.projectRoot);\n\n return hasEslintConfig && hasLintScript;\n }\n\n async bootstrapAsync(): Promise<boolean> {\n debug('Setting up ESLint');\n\n const hasEslintConfig = await eslintIsConfigured(this.projectRoot);\n if (!hasEslintConfig) {\n const shouldSetupLint = await confirmAsync({\n message: 'No ESLint config found. Install and configure ESLint in this project?',\n });\n\n if (!shouldSetupLint) {\n throw new PrerequisiteCommandError('ESLint is not configured for this project.');\n }\n\n // TODO(cedric): if we want to add prettier, also configure proper prettier rules\n // const shouldIncludePrettier = await confirmAsync({\n // message: 'Include Prettier?',\n // });\n\n // if (shouldIncludePrettier) {\n // packages.push({ file: 'prettier/package.json', pkg: 'prettier', dev: true });\n // packages.push({\n // file: 'eslint-config-prettier/package.json',\n // pkg: 'eslint-config-prettier',\n // dev: true,\n // });\n // packages.push({\n // file: 'eslint-plugin-prettier/package.json',\n // pkg: 'eslint-plugin-prettier',\n // dev: true,\n // });\n // }\n\n await this._ensureDependenciesInstalledAsync({ skipPrompt: true, isProjectMutable: true });\n\n // TODO(cedric): if we want to add prettier, also configure proper prettier rules\n // if (shouldIncludePrettier) {\n // await fs.writeFile(path.join(this.projectRoot, '.prettierrc'), '{}', 'utf8');\n // }\n\n await fs.writeFile(path.join(this.projectRoot, '.eslintrc.js'), ESLINT_TEMPLATE_BASE, 'utf8');\n }\n\n const hasLintScript = await lintScriptIsConfigured(this.projectRoot);\n if (!hasLintScript) {\n const scripts = JsonFile.read(path.join(this.projectRoot, 'package.json')).scripts;\n await JsonFile.setAsync(\n path.join(this.projectRoot, 'package.json'),\n 'scripts',\n typeof scripts === 'object' ? { ...scripts, lint: 'eslint .' } : { lint: 'eslint .' },\n { json5: false }\n );\n }\n\n Log.log();\n Log.log('ESlint has been configured 🎉');\n Log.log();\n\n return true;\n }\n\n async _ensureDependenciesInstalledAsync({\n skipPrompt,\n isProjectMutable,\n }: {\n skipPrompt?: boolean;\n isProjectMutable?: boolean;\n }): Promise<boolean> {\n try {\n return await ensureDependenciesAsync(this.projectRoot, {\n skipPrompt,\n isProjectMutable,\n installMessage: 'ESLint is required to lint your project.',\n warningMessage: 'ESLint not installed, unable to set up linting for your project.',\n requiredPackages: [\n { version: '^8.57.0', pkg: 'eslint', file: 'eslint/package.json', dev: true },\n {\n version: '^7.0.0',\n pkg: 'eslint-config-expo',\n file: 'eslint-config-expo/package.json',\n dev: true,\n },\n ],\n });\n } catch (error) {\n this.resetAssertion();\n throw error;\n }\n }\n}\n\nasync function eslintIsConfigured(projectRoot: string) {\n debug('Ensuring ESlint is configured in', projectRoot);\n\n // TODO(cedric): drop `package.json` check once we swap to flat config\n const packageFile = await JsonFile.readAsync(path.join(projectRoot, 'package.json'));\n if (\n typeof packageFile.eslintConfig === 'object' &&\n Object.keys(packageFile.eslintConfig as JSONObject).length > 0\n ) {\n debug('Found ESlint config in package.json');\n return true;\n }\n\n const eslintConfigFiles = [\n // TODO(cedric): drop these files once we swap to flat config\n // See: https://eslint.org/docs/latest/use/configure/configuration-files-deprecated\n '.eslintrc.js',\n '.eslintrc.cjs',\n '.eslintrc.yaml',\n '.eslintrc.yml',\n '.eslintrc.json',\n // TODO(cedric): use these files once we swap to flat config\n // See: https://eslint.org/docs/latest/use/configure/configuration-files\n // 'eslint.config.js',\n // 'eslint.config.mjs',\n // 'eslint.config.cjs',\n ];\n for (const configFile of eslintConfigFiles) {\n const configPath = findFileInParents(projectRoot, configFile);\n const configIsEmpty = configPath ? await eslintConfigIsEmpty(configPath) : null;\n\n if (configPath && !configIsEmpty) {\n debug('Found ESlint config file:', configPath);\n return true;\n } else if (configPath && configIsEmpty) {\n debug('Skipping empty ESlint config file:', configPath);\n }\n }\n\n return false;\n}\n\n/** Determine if the eslint config file is empty. */\nasync function eslintConfigIsEmpty(filePath: string) {\n const content = await fs.readFile(filePath, 'utf8').then(\n (text) => text.trim().replaceAll(/\\s|\\r\\n|\\n|\\r/g, ''),\n () => null\n );\n\n return (\n !content ||\n content === '{}' || // .eslintrc.json\n content === '---' || // .eslintrc.yaml / .eslintrc.yml\n content.startsWith('module.exports={}') || // .eslintrc.js / .eslintrc.cjs / eslint.config.js / eslint.config.cjs\n content.startsWith('exportdefault{}') || // .eslint.config.mjs\n content.startsWith('exportdefault[]') // .eslint.config.mjs\n );\n}\n\nasync function lintScriptIsConfigured(projectRoot: string) {\n const packageFile = await JsonFile.readAsync(path.join(projectRoot, 'package.json'));\n return typeof (packageFile.scripts as JSONObject | undefined)?.lint === 'string';\n}\n"],"names":["ESLintProjectPrerequisite","debug","require","ESLINT_TEMPLATE_BASE","ProjectPrerequisite","assertImplementation","hasEslintConfig","eslintIsConfigured","projectRoot","hasLintScript","lintScriptIsConfigured","bootstrapAsync","shouldSetupLint","confirmAsync","message","PrerequisiteCommandError","_ensureDependenciesInstalledAsync","skipPrompt","isProjectMutable","fs","writeFile","path","join","scripts","JsonFile","read","setAsync","lint","json5","Log","log","ensureDependenciesAsync","installMessage","warningMessage","requiredPackages","version","pkg","file","dev","error","resetAssertion","packageFile","readAsync","eslintConfig","Object","keys","length","eslintConfigFiles","configFile","configPath","findFileInParents","configIsEmpty","eslintConfigIsEmpty","filePath","content","readFile","then","text","trim","replaceAll","startsWith"],"mappings":"AAAA;;;;+BA8BaA,2BAAyB;;aAAzBA,yBAAyB;;;8DA9BD,iBAAiB;;;;;;;8DACvC,aAAa;;;;;;;8DACX,MAAM;;;;;;qBAEH,QAAQ;8BACkC,8BAA8B;yCACpD,sDAAsD;wBAC5D,iBAAiB;yBACtB,kBAAkB;;;;;;AAE/C,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,AAAsB,AAAC;AAElE,MAAMC,oBAAoB,GAAG,CAAC;;;;AAI9B,CAAC,AAAC;AAcK,MAAMH,yBAAyB,SAASI,aAAmB,oBAAA;UAC1DC,oBAAoB,GAAqB;QAC7C,MAAMC,eAAe,GAAG,MAAMC,kBAAkB,CAAC,IAAI,CAACC,WAAW,CAAC,AAAC;QACnE,MAAMC,aAAa,GAAG,MAAMC,sBAAsB,CAAC,IAAI,CAACF,WAAW,CAAC,AAAC;QAErE,OAAOF,eAAe,IAAIG,aAAa,CAAC;IAC1C;UAEME,cAAc,GAAqB;QACvCV,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAE3B,MAAMK,eAAe,GAAG,MAAMC,kBAAkB,CAAC,IAAI,CAACC,WAAW,CAAC,AAAC;QACnE,IAAI,CAACF,eAAe,EAAE;YACpB,MAAMM,eAAe,GAAG,MAAMC,IAAAA,QAAY,aAAA,EAAC;gBACzCC,OAAO,EAAE,uEAAuE;aACjF,CAAC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iB,CAAC,CAAC,qBAAqB;IAAtB,CACrC;AACJ,CAAC;AAED,eAAelD,sBAAsB,CAACF,WAAmB,EAAE;QAE3C,GAA+C;IAD7D,MAAMiC,WAAW,GAAG,MAAMjB,SAAQ,EAAA,QAAA,CAACkB,SAAS,CAACrB,KAAI,EAAA,QAAA,CAACC,IAAI,CAACd,WAAW,EAAE,cAAc,CAAC,CAAC,AAAC;IACrF,OAAO,OAAO,CAAA,CAAA,GAA+C,GAA9CiC,WAAW,CAAClB,OAAO,SAAiC,GAArD,KAAA,CAAqD,GAArD,GAA+C,CAAEI,IAAI,CAAA,KAAK,QAAQ,CAAC;AACnF,CAAC"}
1
+ {"version":3,"sources":["../../../src/lint/ESlintPrerequisite.ts"],"sourcesContent":["import JsonFile, { JSONObject } from '@expo/json-file';\nimport fs from 'fs/promises';\nimport path from 'path';\n\nimport { Log } from '../log';\nimport { PrerequisiteCommandError, ProjectPrerequisite } from '../start/doctor/Prerequisite';\nimport { ensureDependenciesAsync } from '../start/doctor/dependencies/ensureDependenciesAsync';\nimport { findFileInParents } from '../utils/findUp';\nimport { isInteractive } from '../utils/interactive';\nimport { confirmAsync } from '../utils/prompts';\n\nconst debug = require('debug')('expo:lint') as typeof console.log;\n\n// TODO(cedric): if we want to add prettier, also configure proper prettier rules\n// const ESLINT_TEMPLATE_PRETTIER = `// https://docs.expo.dev/guides/using-eslint/\n// module.exports = {\n// extends: ['expo', 'prettier'],\n// plugins: ['prettier'],\n// rules: {\n// 'prettier/prettier': ['warn'],\n// },\n// };\n// `;\n\n/** Ensure the project has the required ESlint config. */\nexport class ESLintProjectPrerequisite extends ProjectPrerequisite<boolean> {\n async assertImplementation(): Promise<boolean> {\n const hasEslintConfig = await eslintIsConfigured(this.projectRoot);\n const hasLintScript = await lintScriptIsConfigured(this.projectRoot);\n\n return hasEslintConfig && hasLintScript;\n }\n\n async bootstrapAsync(): Promise<boolean> {\n debug('Setting up ESLint');\n\n const hasEslintConfig = await eslintIsConfigured(this.projectRoot);\n if (!hasEslintConfig) {\n if (!isInteractive()) {\n Log.warn(`No ESLint config found. Configuring automatically.`);\n } else {\n const shouldSetupLint = await confirmAsync({\n message: 'No ESLint config found. Install and configure ESLint in this project?',\n });\n if (!shouldSetupLint) {\n throw new PrerequisiteCommandError('ESLint is not configured for this project.');\n }\n }\n\n // TODO(cedric): if we want to add prettier, also configure proper prettier rules\n // const shouldIncludePrettier = await confirmAsync({\n // message: 'Include Prettier?',\n // });\n\n // if (shouldIncludePrettier) {\n // packages.push({ file: 'prettier/package.json', pkg: 'prettier', dev: true });\n // packages.push({\n // file: 'eslint-config-prettier/package.json',\n // pkg: 'eslint-config-prettier',\n // dev: true,\n // });\n // packages.push({\n // file: 'eslint-plugin-prettier/package.json',\n // pkg: 'eslint-plugin-prettier',\n // dev: true,\n // });\n // }\n\n await this._ensureDependenciesInstalledAsync({ skipPrompt: true, isProjectMutable: true });\n\n // TODO(cedric): if we want to add prettier, also configure proper prettier rules\n // if (shouldIncludePrettier) {\n // await fs.writeFile(path.join(this.projectRoot, '.prettierrc'), '{}', 'utf8');\n // }\n\n await fs.writeFile(\n path.join(this.projectRoot, '.eslintrc.js'),\n await fs.readFile(require.resolve(`@expo/cli/static/template/.eslintrc.js`), 'utf8'),\n 'utf8'\n );\n }\n\n const hasLintScript = await lintScriptIsConfigured(this.projectRoot);\n if (!hasLintScript) {\n const scripts = JsonFile.read(path.join(this.projectRoot, 'package.json')).scripts;\n await JsonFile.setAsync(\n path.join(this.projectRoot, 'package.json'),\n 'scripts',\n typeof scripts === 'object' ? { ...scripts, lint: 'eslint .' } : { lint: 'eslint .' },\n { json5: false }\n );\n }\n\n Log.log();\n Log.log('ESlint has been configured 🎉');\n Log.log();\n\n return true;\n }\n\n async _ensureDependenciesInstalledAsync({\n skipPrompt,\n isProjectMutable,\n }: {\n skipPrompt?: boolean;\n isProjectMutable?: boolean;\n }): Promise<boolean> {\n try {\n return await ensureDependenciesAsync(this.projectRoot, {\n skipPrompt,\n isProjectMutable,\n installMessage: 'ESLint is required to lint your project.',\n warningMessage: 'ESLint not installed, unable to set up linting for your project.',\n requiredPackages: [\n { version: '^8.57.0', pkg: 'eslint', file: 'eslint/package.json', dev: true },\n {\n pkg: 'eslint-config-expo',\n file: 'eslint-config-expo/package.json',\n dev: true,\n },\n ],\n });\n } catch (error) {\n this.resetAssertion();\n throw error;\n }\n }\n}\n\nasync function eslintIsConfigured(projectRoot: string) {\n debug('Ensuring ESlint is configured in', projectRoot);\n\n // TODO(cedric): drop `package.json` check once we swap to flat config\n const packageFile = await JsonFile.readAsync(path.join(projectRoot, 'package.json'));\n if (\n typeof packageFile.eslintConfig === 'object' &&\n Object.keys(packageFile.eslintConfig as JSONObject).length > 0\n ) {\n debug('Found ESlint config in package.json');\n return true;\n }\n\n const eslintConfigFiles = [\n // TODO(cedric): drop these files once we swap to flat config\n // See: https://eslint.org/docs/latest/use/configure/configuration-files-deprecated\n '.eslintrc.js',\n '.eslintrc.cjs',\n '.eslintrc.yaml',\n '.eslintrc.yml',\n '.eslintrc.json',\n // TODO(cedric): use these files once we swap to flat config\n // See: https://eslint.org/docs/latest/use/configure/configuration-files\n // 'eslint.config.js',\n // 'eslint.config.mjs',\n // 'eslint.config.cjs',\n ];\n for (const configFile of eslintConfigFiles) {\n const configPath = findFileInParents(projectRoot, configFile);\n const configIsEmpty = configPath ? await eslintConfigIsEmpty(configPath) : null;\n\n if (configPath && !configIsEmpty) {\n debug('Found ESlint config file:', configPath);\n return true;\n } else if (configPath && configIsEmpty) {\n debug('Skipping empty ESlint config file:', configPath);\n }\n }\n\n return false;\n}\n\n/** Determine if the eslint config file is empty. */\nasync function eslintConfigIsEmpty(filePath: string) {\n const content = await fs.readFile(filePath, 'utf8').then(\n (text) => text.trim().replaceAll(/\\s|\\r\\n|\\n|\\r/g, ''),\n () => null\n );\n\n return (\n !content ||\n content === '{}' || // .eslintrc.json\n content === '---' || // .eslintrc.yaml / .eslintrc.yml\n content.startsWith('module.exports={}') || // .eslintrc.js / .eslintrc.cjs / eslint.config.js / eslint.config.cjs\n content.startsWith('exportdefault{}') || // .eslint.config.mjs\n content.startsWith('exportdefault[]') // .eslint.config.mjs\n );\n}\n\nasync function lintScriptIsConfigured(projectRoot: string) {\n const packageFile = await JsonFile.readAsync(path.join(projectRoot, 'package.json'));\n return typeof (packageFile.scripts as JSONObject | undefined)?.lint === 'string';\n}\n"],"names":["ESLintProjectPrerequisite","debug","require","ProjectPrerequisite","assertImplementation","hasEslintConfig","eslintIsConfigured","projectRoot","hasLintScript","lintScriptIsConfigured","bootstrapAsync","isInteractive","Log","warn","shouldSetupLint","confirmAsync","message","PrerequisiteCommandError","_ensureDependenciesInstalledAsync","skipPrompt","isProjectMutable","fs","writeFile","path","join","readFile","resolve","scripts","JsonFile","read","setAsync","lint","json5","log","ensureDependenciesAsync","installMessage","warningMessage","requiredPackages","version","pkg","file","dev","error","resetAssertion","packageFile","readAsync","eslintConfig","Object","keys","length","eslintConfigFiles","configFile","configPath","findFileInParents","configIsEmpty","eslintConfigIsEmpty","filePath","content","then","text","trim","replaceAll","startsWith"],"mappings":"AAAA;;;;+BAyBaA,2BAAyB;;aAAzBA,yBAAyB;;;8DAzBD,iBAAiB;;;;;;;8DACvC,aAAa;;;;;;;8DACX,MAAM;;;;;;qBAEH,QAAQ;8BACkC,8BAA8B;yCACpD,sDAAsD;wBAC5D,iBAAiB;6BACrB,sBAAsB;yBACvB,kBAAkB;;;;;;AAE/C,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,AAAsB,AAAC;AAc3D,MAAMF,yBAAyB,SAASG,aAAmB,oBAAA;UAC1DC,oBAAoB,GAAqB;QAC7C,MAAMC,eAAe,GAAG,MAAMC,kBAAkB,CAAC,IAAI,CAACC,WAAW,CAAC,AAAC;QACnE,MAAMC,aAAa,GAAG,MAAMC,sBAAsB,CAAC,IAAI,CAACF,WAAW,CAAC,AAAC;QAErE,OAAOF,eAAe,IAAIG,aAAa,CAA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IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,kDAAkD,GAClD,eAAeG,mBAAmB,CAACC,QAAgB,EAAE;IACnD,MAAMC,OAAO,GAAG,MAAMpC,SAAE,EAAA,QAAA,CAACI,QAAQ,CAAC+B,QAAQ,EAAE,MAAM,CAAC,CAACE,IAAI,CACtD,CAACC,IAAI,GAAKA,IAAI,CAACC,IAAI,EAAE,CAACC,UAAU,mBAAmB,EAAE,CAAC,EACtD,IAAM,IAAI,CACX,AAAC;IAEF,OACE,CAACJ,OAAO,IACRA,OAAO,KAAK,IAAI,IAChBA,OAAO,KAAK,KAAK,IACjBA,OAAO,CAACK,UAAU,CAAC,mBAAmB,CAAC,IACvCL,OAAO,CAACK,UAAU,CAAC,iBAAiB,CAAC,IACrCL,OAAO,CAACK,UAAU,CAAC,iBAAiB,CAAC,CAAC,qBAAqB;IAAtB,CACrC;AACJ,CAAC;AAED,eAAerD,sBAAsB,CAACF,WAAmB,EAAE;QAE3C,GAA+C;IAD7D,MAAMqC,WAAW,GAAG,MAAMhB,SAAQ,EAAA,QAAA,CAACiB,SAAS,CAACtB,KAAI,EAAA,QAAA,CAACC,IAAI,CAACjB,WAAW,EAAE,cAAc,CAAC,CAAC,AAAC;IACrF,OAAO,OAAO,CAAA,CAAA,GAA+C,GAA9CqC,WAAW,CAACjB,OAAO,SAAiC,GAArD,KAAA,CAAqD,GAArD,GAA+C,CAAEI,IAAI,CAAA,KAAK,QAAQ,CAAC;AACnF,CAAC"}
@@ -69,6 +69,7 @@ function _interopRequireWildcard(obj, nodeInterop) {
69
69
  }
70
70
  return newObj;
71
71
  }
72
+ const debug = require("debug")("expo:run:ios");
72
73
  async function runIosAsync(projectRoot, options) {
73
74
  var ref;
74
75
  (0, _nodeEnv.setNodeEnv)(options.configuration === "Release" ? "production" : "development");
@@ -88,6 +89,7 @@ async function runIosAsync(projectRoot, options) {
88
89
  // Find the path to the built app binary, this will be used to install the binary
89
90
  // on a device.
90
91
  const binaryPath = await (0, _profile.profile)(_xcodeBuild.getAppBinaryPath)(buildOutput);
92
+ debug("Binary path:", binaryPath);
91
93
  // Ensure the port hasn't become busy during the build.
92
94
  if (props.shouldStartBundler && !await (0, _port.ensurePortAvailabilityAsync)(projectRoot, props)) {
93
95
  props.shouldStartBundler = false;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/run/ios/runIosAsync.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport * as XcodeBuild from './XcodeBuild';\nimport { Options } from './XcodeBuild.types';\nimport { launchAppAsync } from './launchApp';\nimport { resolveOptionsAsync } from './options/resolveOptions';\nimport * as Log from '../../log';\nimport { maybePromptToSyncPodsAsync } from '../../utils/cocoapods';\nimport { setNodeEnv } from '../../utils/nodeEnv';\nimport { ensurePortAvailabilityAsync } from '../../utils/port';\nimport { profile } from '../../utils/profile';\nimport { getSchemesForIosAsync } from '../../utils/scheme';\nimport { ensureNativeProjectAsync } from '../ensureNativeProject';\nimport { logProjectLogsLocation } from '../hints';\nimport { startBundlerAsync } from '../startBundler';\n\nexport async function runIosAsync(projectRoot: string, options: Options) {\n setNodeEnv(options.configuration === 'Release' ? 'production' : 'development');\n require('@expo/env').load(projectRoot);\n\n assertPlatform();\n\n const install = !!options.install;\n\n if ((await ensureNativeProjectAsync(projectRoot, { platform: 'ios', install })) && install) {\n await maybePromptToSyncPodsAsync(projectRoot);\n }\n\n // Resolve the CLI arguments into useable options.\n const props = await resolveOptionsAsync(projectRoot, options);\n\n // Spawn the `xcodebuild` process to create the app binary.\n const buildOutput = await XcodeBuild.buildAsync(props);\n\n // Find the path to the built app binary, this will be used to install the binary\n // on a device.\n const binaryPath = await profile(XcodeBuild.getAppBinaryPath)(buildOutput);\n\n // Ensure the port hasn't become busy during the build.\n if (props.shouldStartBundler && !(await ensurePortAvailabilityAsync(projectRoot, props))) {\n props.shouldStartBundler = false;\n }\n\n // Start the dev server which creates all of the required info for\n // launching the app on a simulator.\n const manager = await startBundlerAsync(projectRoot, {\n port: props.port,\n headless: !props.shouldStartBundler,\n // If a scheme is specified then use that instead of the package name.\n scheme: (await getSchemesForIosAsync(projectRoot))?.[0],\n });\n\n // Install and launch the app binary on a device.\n await launchAppAsync(binaryPath, manager, {\n isSimulator: props.isSimulator,\n device: props.device,\n shouldStartBundler: props.shouldStartBundler,\n });\n\n // Log the location of the JS logs for the device.\n if (props.shouldStartBundler) {\n logProjectLogsLocation();\n } else {\n await manager.stopAsync();\n }\n}\n\nfunction assertPlatform() {\n if (process.platform !== 'darwin') {\n Log.exit(\n chalk`iOS apps can only be built on macOS devices. Use {cyan eas build -p ios} to build in the cloud.`\n );\n }\n}\n"],"names":["runIosAsync","projectRoot","options","setNodeEnv","configuration","require","load","assertPlatform","install","ensureNativeProjectAsync","platform","maybePromptToSyncPodsAsync","props","resolveOptionsAsync","buildOutput","XcodeBuild","buildAsync","binaryPath","profile","getAppBinaryPath","shouldStartBundler","ensurePortAvailabilityAsync","manager","startBundlerAsync","port","headless","scheme","getSchemesForIosAsync","launchAppAsync","isSimulator","device","logProjectLogsLocation","stopAsync","process","Log","exit","chalk"],"mappings":"AAAA;;;;+BAgBsBA,aAAW;;aAAXA,WAAW;;;8DAhBf,OAAO;;;;;;kEAEG,cAAc;2BAEX,aAAa;gCACR,0BAA0B;2DACzC,WAAW;2BACW,uBAAuB;yBACvC,qBAAqB;sBACJ,kBAAkB;yBACtC,qBAAqB;wBACP,oBAAoB;qCACjB,wBAAwB;uBAC1B,UAAU;8BACf,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE5C,eAAeA,WAAW,CAACC,WAAmB,EAAEC,OAAgB,EAAE;QAiC7D,GAA0C;IAhCpDC,IAAAA,QAAU,WAAA,EAACD,OAAO,CAACE,aAAa,KAAK,SAAS,GAAG,YAAY,GAAG,aAAa,CAAC,CAAC;IAC/EC,OAAO,CAAC,WAAW,CAAC,CAACC,IAAI,CAACL,WAAW,CAAC,CAAC;IAEvCM,cAA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AAA,EAACX,UAAU,EAAEK,OAAO,EAAE;QACxCO,WAAW,EAAEjB,KAAK,CAACiB,WAAW;QAC9BC,MAAM,EAAElB,KAAK,CAACkB,MAAM;QACpBV,kBAAkB,EAAER,KAAK,CAACQ,kBAAkB;KAC7C,CAAC,CAAC;IAEH,kDAAkD;IAClD,IAAIR,KAAK,CAACQ,kBAAkB,EAAE;QAC5BW,IAAAA,MAAsB,uBAAA,GAAE,CAAC;IAC3B,OAAO;QACL,MAAMT,OAAO,CAACU,SAAS,EAAE,CAAC;IAC5B,CAAC;AACH,CAAC;AAED,SAASzB,cAAc,GAAG;IACxB,IAAI0B,OAAO,CAACvB,QAAQ,KAAK,QAAQ,EAAE;QACjCwB,IAAG,CAACC,IAAI,CACNC,IAAAA,MAAK,EAAA,QAAA,CAAA,CAAC,+FAA+F,CAAC,CACvG,CAAC;IACJ,CAAC;AACH,CAAC"}
1
+ {"version":3,"sources":["../../../../src/run/ios/runIosAsync.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport * as XcodeBuild from './XcodeBuild';\nimport { Options } from './XcodeBuild.types';\nimport { launchAppAsync } from './launchApp';\nimport { resolveOptionsAsync } from './options/resolveOptions';\nimport * as Log from '../../log';\nimport { maybePromptToSyncPodsAsync } from '../../utils/cocoapods';\nimport { setNodeEnv } from '../../utils/nodeEnv';\nimport { ensurePortAvailabilityAsync } from '../../utils/port';\nimport { profile } from '../../utils/profile';\nimport { getSchemesForIosAsync } from '../../utils/scheme';\nimport { ensureNativeProjectAsync } from '../ensureNativeProject';\nimport { logProjectLogsLocation } from '../hints';\nimport { startBundlerAsync } from '../startBundler';\n\nconst debug = require('debug')('expo:run:ios');\n\nexport async function runIosAsync(projectRoot: string, options: Options) {\n setNodeEnv(options.configuration === 'Release' ? 'production' : 'development');\n require('@expo/env').load(projectRoot);\n\n assertPlatform();\n\n const install = !!options.install;\n\n if ((await ensureNativeProjectAsync(projectRoot, { platform: 'ios', install })) && install) {\n await maybePromptToSyncPodsAsync(projectRoot);\n }\n\n // Resolve the CLI arguments into useable options.\n const props = await resolveOptionsAsync(projectRoot, options);\n\n // Spawn the `xcodebuild` process to create the app binary.\n const buildOutput = await XcodeBuild.buildAsync(props);\n\n // Find the path to the built app binary, this will be used to install the binary\n // on a device.\n const binaryPath = await profile(XcodeBuild.getAppBinaryPath)(buildOutput);\n\n debug('Binary path:', binaryPath);\n\n // Ensure the port hasn't become busy during the build.\n if (props.shouldStartBundler && !(await ensurePortAvailabilityAsync(projectRoot, props))) {\n props.shouldStartBundler = false;\n }\n\n // Start the dev server which creates all of the required info for\n // launching the app on a simulator.\n const manager = await startBundlerAsync(projectRoot, {\n port: props.port,\n headless: !props.shouldStartBundler,\n // If a scheme is specified then use that instead of the package name.\n scheme: (await getSchemesForIosAsync(projectRoot))?.[0],\n });\n\n // Install and launch the app binary on a device.\n await launchAppAsync(binaryPath, manager, {\n isSimulator: props.isSimulator,\n device: props.device,\n shouldStartBundler: props.shouldStartBundler,\n });\n\n // Log the location of the JS logs for the device.\n if (props.shouldStartBundler) {\n logProjectLogsLocation();\n } else {\n await manager.stopAsync();\n }\n}\n\nfunction assertPlatform() {\n if (process.platform !== 'darwin') {\n Log.exit(\n chalk`iOS apps can only be built on macOS devices. Use {cyan eas build -p ios} to build in the cloud.`\n );\n }\n}\n"],"names":["runIosAsync","debug","require","projectRoot","options","setNodeEnv","configuration","load","assertPlatform","install","ensureNativeProjectAsync","platform","maybePromptToSyncPodsAsync","props","resolveOptionsAsync","buildOutput","XcodeBuild","buildAsync","binaryPath","profile","getAppBinaryPath","shouldStartBundler","ensurePortAvailabilityAsync","manager","startBundlerAsync","port","headless","scheme","getSchemesForIosAsync","launchAppAsync","isSimulator","device","logProjectLogsLocation","stopAsync","process","Log","exit","chalk"],"mappings":"AAAA;;;;+BAkBsBA,aAAW;;aAAXA,WAAW;;;8DAlBf,OAAO;;;;;;kEAEG,cAAc;2BAEX,aAAa;gCACR,0BAA0B;2DACzC,WAAW;2BACW,uBAAuB;yB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A,KAA2B,4BAAA,EAACnB,WAAW,EAAEU,KAAK,CAAC,AAAC,EAAE;QACxFA,KAAK,CAACQ,kBAAkB,GAAG,KAAK,CAAC;IACnC,CAAC;IAED,kEAAkE;IAClE,oCAAoC;IACpC,MAAME,OAAO,GAAG,MAAMC,IAAAA,aAAiB,kBAAA,EAACrB,WAAW,EAAE;QACnDsB,IAAI,EAAEZ,KAAK,CAACY,IAAI;QAChBC,QAAQ,EAAE,CAACb,KAAK,CAACQ,kBAAkB;QACnC,sEAAsE;QACtEM,MAAM,EAAE,CAAA,GAA0C,GAAzC,MAAMC,IAAAA,OAAqB,sBAAA,EAACzB,WAAW,CAAC,SAAM,GAA/C,KAAA,CAA+C,GAA/C,GAA0C,AAAE,CAAC,CAAC,CAAC;KACxD,CAAC,AAAC;IAEH,iDAAiD;IACjD,MAAM0B,IAAAA,UAAc,eAAA,EAACX,UAAU,EAAEK,OAAO,EAAE;QACxCO,WAAW,EAAEjB,KAAK,CAACiB,WAAW;QAC9BC,MAAM,EAAElB,KAAK,CAACkB,MAAM;QACpBV,kBAAkB,EAAER,KAAK,CAACQ,kBAAkB;KAC7C,CAAC,CAAC;IAEH,kDAAkD;IAClD,IAAIR,KAAK,CAACQ,kBAAkB,EAAE;QAC5BW,IAAAA,MAAsB,uBAAA,GAAE,CAAC;IAC3B,OAAO;QACL,MAAMT,OAAO,CAACU,SAAS,EAAE,CAAC;IAC5B,CAAC;AACH,CAAC;AAED,SAASzB,cAAc,GAAG;IACxB,IAAI0B,OAAO,CAACvB,QAAQ,KAAK,QAAQ,EAAE;QACjCwB,IAAG,CAACC,IAAI,CACNC,IAAAA,MAAK,EAAA,QAAA,CAAA,CAAC,+FAA+F,CAAC,CACvG,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -27,6 +27,13 @@ function _chalk() {
27
27
  };
28
28
  return data;
29
29
  }
30
+ function _npmPackageArg() {
31
+ const data = /*#__PURE__*/ _interopRequireDefault(require("npm-package-arg"));
32
+ _npmPackageArg = function() {
33
+ return data;
34
+ };
35
+ return data;
36
+ }
30
37
  function _semver() {
31
38
  const data = /*#__PURE__*/ _interopRequireDefault(require("semver"));
32
39
  _semver = function() {
@@ -34,6 +41,13 @@ function _semver() {
34
41
  };
35
42
  return data;
36
43
  }
44
+ function _subset() {
45
+ const data = /*#__PURE__*/ _interopRequireDefault(require("semver/ranges/subset"));
46
+ _subset = function() {
47
+ return data;
48
+ };
49
+ return data;
50
+ }
37
51
  const _getVersionedPackages = require("./getVersionedPackages");
38
52
  const _resolvePackages = require("./resolvePackages");
39
53
  const _log = /*#__PURE__*/ _interopRequireWildcard(require("../../../log"));
@@ -134,9 +148,40 @@ async function getVersionedDependenciesAsync(projectRoot, exp, pkg, packagesToCh
134
148
  debug(`Incorrect dependencies: %O`, incorrectDeps);
135
149
  if (pkg == null ? void 0 : (ref = pkg.expo) == null ? void 0 : (ref1 = ref.install) == null ? void 0 : ref1.exclude) {
136
150
  const packagesToExclude = pkg.expo.install.exclude;
137
- const incorrectAndExcludedDeps = incorrectDeps.filter((dep)=>packagesToExclude.includes(dep.packageName));
138
- debug(`Incorrect dependency warnings filtered out by expo.install.exclude: %O`, incorrectAndExcludedDeps.map((dep)=>dep.packageName));
139
- incorrectDeps = incorrectDeps.filter((dep)=>!packagesToExclude.includes(dep.packageName));
151
+ // Parse the exclude list to ensure we can factor in any specified version ranges
152
+ const parsedPackagesToExclude = packagesToExclude.reduce((acc, packageName)=>{
153
+ const npaResult = (0, _npmPackageArg().default)(packageName);
154
+ if (typeof npaResult.name === "string") {
155
+ acc[npaResult.name] = npaResult;
156
+ } else {
157
+ acc[packageName] = npaResult;
158
+ }
159
+ return acc;
160
+ }, {});
161
+ const incorrectAndExcludedDeps = incorrectDeps.filter((dep)=>{
162
+ if (parsedPackagesToExclude[dep.packageName]) {
163
+ const { name , raw , rawSpec , type } = parsedPackagesToExclude[dep.packageName];
164
+ const suggestedRange = combinedKnownPackages[name];
165
+ // If only the package name itself is specified, then we keep it in the exclude list
166
+ if (name === raw) {
167
+ return true;
168
+ } else if (type === "version") {
169
+ return suggestedRange === rawSpec;
170
+ } else if (type === "range") {
171
+ // Fall through exclusions if the suggested range is invalid
172
+ if (!_semver().default.validRange(suggestedRange)) {
173
+ debug(`Invalid semver range in combined known packages for package ${name} in expo.install.exclude: %O`, suggestedRange);
174
+ return false;
175
+ }
176
+ return (0, _subset().default)(suggestedRange, rawSpec);
177
+ } else {
178
+ debug(`Unsupported npm package argument type for package ${name} in expo.install.exclude: %O`, type);
179
+ }
180
+ }
181
+ return false;
182
+ }).map((dep)=>dep.packageName);
183
+ debug(`Incorrect dependency warnings filtered out by expo.install.exclude: %O`, incorrectAndExcludedDeps);
184
+ incorrectDeps = incorrectDeps.filter((dep)=>!incorrectAndExcludedDeps.includes(dep.packageName));
140
185
  }
141
186
  return incorrectDeps;
142
187
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/start/doctor/dependencies/validateDependenciesVersions.ts"],"sourcesContent":["import { ExpoConfig, PackageJSONConfig } from '@expo/config';\nimport assert from 'assert';\nimport chalk from 'chalk';\nimport semver from 'semver';\n\nimport { BundledNativeModules } from './bundledNativeModules';\nimport { getCombinedKnownVersionsAsync } from './getVersionedPackages';\nimport { resolveAllPackageVersionsAsync } from './resolvePackages';\nimport * as Log from '../../../log';\nimport { env } from '../../../utils/env';\n\nconst debug = require('debug')('expo:doctor:dependencies:validate') as typeof console.log;\n\ntype IncorrectDependency = {\n packageName: string;\n packageType: 'dependencies' | 'devDependencies';\n expectedVersionOrRange: string;\n actualVersion: string;\n};\n\ntype DependenciesToCheck = { known: string[]; unknown: string[] };\n\n/**\n * Print a list of incorrect dependency versions.\n * This only checks dependencies when not running in offline mode.\n *\n * @param projectRoot Expo project root.\n * @param exp Expo project config.\n * @param pkg Project's `package.json`.\n * @param packagesToCheck A list of packages to check, if undefined or empty, all will be checked.\n * @returns `true` if there are no incorrect dependencies.\n */\nexport async function validateDependenciesVersionsAsync(\n projectRoot: string,\n exp: Pick<ExpoConfig, 'sdkVersion'>,\n pkg: PackageJSONConfig,\n packagesToCheck?: string[]\n): Promise<boolean | null> {\n if (env.EXPO_OFFLINE) {\n Log.warn('Skipping dependency validation in offline mode');\n return null;\n }\n\n const incorrectDeps = await getVersionedDependenciesAsync(projectRoot, exp, pkg, packagesToCheck);\n return logIncorrectDependencies(incorrectDeps);\n}\n\nfunction logInvalidDependency({\n packageName,\n expectedVersionOrRange,\n actualVersion,\n}: IncorrectDependency) {\n Log.warn(\n chalk` {bold ${packageName}}{cyan @}{red ${actualVersion}} - expected version: {green ${expectedVersionOrRange}}`\n );\n}\n\nexport function logIncorrectDependencies(incorrectDeps: IncorrectDependency[]) {\n if (!incorrectDeps.length) {\n return true;\n }\n\n Log.warn(\n chalk`The following packages should be updated for best compatibility with the installed {bold expo} version:`\n );\n incorrectDeps.forEach((dep) => logInvalidDependency(dep));\n\n Log.warn(\n 'Your project may not work correctly until you install the expected versions of the packages.'\n );\n\n return false;\n}\n\n/**\n * Return a list of versioned dependencies for the project SDK version.\n *\n * @param projectRoot Expo project root.\n * @param exp Expo project config.\n * @param pkg Project's `package.json`.\n * @param packagesToCheck A list of packages to check, if undefined or empty, all will be checked.\n * @returns A list of incorrect dependencies.\n */\nexport async function getVersionedDependenciesAsync(\n projectRoot: string,\n exp: Pick<ExpoConfig, 'sdkVersion'>,\n pkg: PackageJSONConfig,\n packagesToCheck?: string[]\n): Promise<IncorrectDependency[]> {\n // This should never happen under normal circumstances since\n // the CLI is versioned in the `expo` package.\n assert(exp.sdkVersion, 'SDK Version is missing');\n\n // Get from both endpoints and combine the known package versions.\n const combinedKnownPackages = await getCombinedKnownVersionsAsync({\n projectRoot,\n sdkVersion: exp.sdkVersion,\n });\n // debug(`Known dependencies: %O`, combinedKnownPackages);\n\n const resolvedDependencies = packagesToCheck?.length\n ? // Diff the provided packages to ensure we only check against installed packages.\n getFilteredObject(packagesToCheck, { ...pkg.dependencies, ...pkg.devDependencies })\n : // If no packages are provided, check against the `package.json` `dependencies` + `devDependencies` object.\n { ...pkg.dependencies, ...pkg.devDependencies };\n debug(`Checking dependencies for ${exp.sdkVersion}: %O`, resolvedDependencies);\n\n // intersection of packages from package.json and bundled native modules\n const { known: resolvedPackagesToCheck, unknown } = getPackagesToCheck(\n combinedKnownPackages,\n resolvedDependencies\n );\n debug(`Comparing known versions: %O`, resolvedPackagesToCheck);\n debug(`Skipping packages that cannot be versioned automatically: %O`, unknown);\n // read package versions from the file system (node_modules)\n const packageVersions = await resolveAllPackageVersionsAsync(\n projectRoot,\n resolvedPackagesToCheck\n );\n debug(`Package versions: %O`, packageVersions);\n // find incorrect dependencies by comparing the actual package versions with the bundled native module version ranges\n let incorrectDeps = findIncorrectDependencies(pkg, packageVersions, combinedKnownPackages);\n debug(`Incorrect dependencies: %O`, incorrectDeps);\n\n if (pkg?.expo?.install?.exclude) {\n const packagesToExclude = pkg.expo.install.exclude;\n const incorrectAndExcludedDeps = incorrectDeps.filter((dep) =>\n packagesToExclude.includes(dep.packageName)\n );\n debug(\n `Incorrect dependency warnings filtered out by expo.install.exclude: %O`,\n incorrectAndExcludedDeps.map((dep) => dep.packageName)\n );\n incorrectDeps = incorrectDeps.filter((dep) => !packagesToExclude.includes(dep.packageName));\n }\n\n return incorrectDeps;\n}\n\nfunction getFilteredObject(keys: string[], object: Record<string, string>) {\n return keys.reduce<Record<string, string>>((acc, key) => {\n acc[key] = object[key];\n return acc;\n }, {});\n}\n\nfunction getPackagesToCheck(\n bundledNativeModules: BundledNativeModules,\n dependencies?: Record<string, string> | null\n): DependenciesToCheck {\n const dependencyNames = Object.keys(dependencies ?? {});\n const known: string[] = [];\n const unknown: string[] = [];\n for (const dependencyName of dependencyNames) {\n if (dependencyName in bundledNativeModules) {\n known.push(dependencyName);\n } else {\n unknown.push(dependencyName);\n }\n }\n return { known, unknown };\n}\n\nfunction findIncorrectDependencies(\n pkg: PackageJSONConfig,\n packageVersions: Record<string, string>,\n bundledNativeModules: BundledNativeModules\n): IncorrectDependency[] {\n const packages = Object.keys(packageVersions);\n const incorrectDeps: IncorrectDependency[] = [];\n for (const packageName of packages) {\n const expectedVersionOrRange = bundledNativeModules[packageName];\n const actualVersion = packageVersions[packageName];\n if (isDependencyVersionIncorrect(packageName, actualVersion, expectedVersionOrRange)) {\n incorrectDeps.push({\n packageName,\n packageType: findDependencyType(pkg, packageName),\n expectedVersionOrRange,\n actualVersion,\n });\n }\n }\n return incorrectDeps;\n}\n\nfunction isDependencyVersionIncorrect(\n packageName: string,\n actualVersion: string,\n expectedVersionOrRange?: string\n) {\n if (!expectedVersionOrRange) {\n return false;\n }\n\n // we never want to go backwards with the expo patch version\n if (packageName === 'expo') {\n return semver.ltr(actualVersion, expectedVersionOrRange);\n }\n\n // all other packages: version range is based on Expo SDK version, so we always want to match range\n return !semver.intersects(expectedVersionOrRange, actualVersion);\n}\n\nfunction findDependencyType(\n pkg: PackageJSONConfig,\n packageName: string\n): IncorrectDependency['packageType'] {\n if (pkg.devDependencies && packageName in pkg.devDependencies) {\n return 'devDependencies';\n }\n\n return 'dependencies';\n}\n"],"names":["validateDependenciesVersionsAsync","logIncorrectDependencies","getVersionedDependenciesAsync","debug","require","projectRoot","exp","pkg","packagesToCheck","env","EXPO_OFFLINE","Log","warn","incorrectDeps","logInvalidDependency","packageName","expectedVersionOrRange","actualVersion","chalk","length","forEach","dep","assert","sdkVersion","combinedKnownPackages","getCombinedKnownVersionsAsync","resolvedDependencies","getFilteredObject","dependencies","devDependencies","known","resolvedPackagesToCheck","unknown","getPackagesToCheck","packageVersions","resolveAllPackageVersionsAsync","findIncorrectDependencies","expo","install","exclude","packagesToExclude","incorrectAndExcludedDeps","filter","includes","map","keys","object","reduce","acc","key","bundledNativeModules","dependencyNames","Object","dependencyName","push","packages","isDependencyVersionIncorrect","packageType","findDependencyType","semver","ltr","intersects"],"mappings":"AAAA;;;;;;;;;;;IAgCsBA,iCAAiC,MAAjCA,iCAAiC;IAyBvCC,wBAAwB,MAAxBA,wBAAwB;I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ACH,CAAC;IACD,OAAOJ,aAAa,CAAC;AACvB,CAAC;AAED,SAAS2C,4BAA4B,CACnCzC,WAAmB,EACnBE,aAAqB,EACrBD,sBAA+B,EAC/B;IACA,IAAI,CAACA,sBAAsB,EAAE;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,4DAA4D;IAC5D,IAAID,WAAW,KAAK,MAAM,EAAE;QAC1B,OAAO4C,OAAM,EAAA,QAAA,CAACC,GAAG,CAAC3C,aAAa,EAAED,sBAAsB,CAAC,CAAC;IAC3D,CAAC;IAED,mGAAmG;IACnG,OAAO,CAAC2C,OAAM,EAAA,QAAA,CAACE,UAAU,CAAC7C,sBAAsB,EAAEC,aAAa,CAAC,CAAC;AACnE,CAAC;AAED,SAASyC,kBAAkB,CACzBnD,GAAsB,EACtBQ,WAAmB,EACiB;IACpC,IAAIR,GAAG,CAACsB,eAAe,IAAId,WAAW,IAAIR,GAAG,CAACsB,eAAe,EAAE;QAC7D,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC"}
1
+ {"version":3,"sources":["../../../../../src/start/doctor/dependencies/validateDependenciesVersions.ts"],"sourcesContent":["import { ExpoConfig, PackageJSONConfig } from '@expo/config';\nimport assert from 'assert';\nimport chalk from 'chalk';\nimport npmPackageArg from 'npm-package-arg';\nimport semver from 'semver';\nimport semverRangeSubset from 'semver/ranges/subset';\n\nimport { BundledNativeModules } from './bundledNativeModules';\nimport { getCombinedKnownVersionsAsync } from './getVersionedPackages';\nimport { resolveAllPackageVersionsAsync } from './resolvePackages';\nimport * as Log from '../../../log';\nimport { env } from '../../../utils/env';\n\nconst debug = require('debug')('expo:doctor:dependencies:validate') as typeof console.log;\n\ntype IncorrectDependency = {\n packageName: string;\n packageType: 'dependencies' | 'devDependencies';\n expectedVersionOrRange: string;\n actualVersion: string;\n};\n\ntype DependenciesToCheck = { known: string[]; unknown: string[] };\n\n/**\n * Print a list of incorrect dependency versions.\n * This only checks dependencies when not running in offline mode.\n *\n * @param projectRoot Expo project root.\n * @param exp Expo project config.\n * @param pkg Project's `package.json`.\n * @param packagesToCheck A list of packages to check, if undefined or empty, all will be checked.\n * @returns `true` if there are no incorrect dependencies.\n */\nexport async function validateDependenciesVersionsAsync(\n projectRoot: string,\n exp: Pick<ExpoConfig, 'sdkVersion'>,\n pkg: PackageJSONConfig,\n packagesToCheck?: string[]\n): Promise<boolean | null> {\n if (env.EXPO_OFFLINE) {\n Log.warn('Skipping dependency validation in offline mode');\n return null;\n }\n\n const incorrectDeps = await getVersionedDependenciesAsync(projectRoot, exp, pkg, packagesToCheck);\n return logIncorrectDependencies(incorrectDeps);\n}\n\nfunction logInvalidDependency({\n packageName,\n expectedVersionOrRange,\n actualVersion,\n}: IncorrectDependency) {\n Log.warn(\n chalk` {bold ${packageName}}{cyan @}{red ${actualVersion}} - expected version: {green ${expectedVersionOrRange}}`\n );\n}\n\nexport function logIncorrectDependencies(incorrectDeps: IncorrectDependency[]) {\n if (!incorrectDeps.length) {\n return true;\n }\n\n Log.warn(\n chalk`The following packages should be updated for best compatibility with the installed {bold expo} version:`\n );\n incorrectDeps.forEach((dep) => logInvalidDependency(dep));\n\n Log.warn(\n 'Your project may not work correctly until you install the expected versions of the packages.'\n );\n\n return false;\n}\n\n/**\n * Return a list of versioned dependencies for the project SDK version.\n *\n * @param projectRoot Expo project root.\n * @param exp Expo project config.\n * @param pkg Project's `package.json`.\n * @param packagesToCheck A list of packages to check, if undefined or empty, all will be checked.\n * @returns A list of incorrect dependencies.\n */\nexport async function getVersionedDependenciesAsync(\n projectRoot: string,\n exp: Pick<ExpoConfig, 'sdkVersion'>,\n pkg: PackageJSONConfig,\n packagesToCheck?: string[]\n): Promise<IncorrectDependency[]> {\n // This should never happen under normal circumstances since\n // the CLI is versioned in the `expo` package.\n assert(exp.sdkVersion, 'SDK Version is missing');\n\n // Get from both endpoints and combine the known package versions.\n const combinedKnownPackages = await getCombinedKnownVersionsAsync({\n projectRoot,\n sdkVersion: exp.sdkVersion,\n });\n // debug(`Known dependencies: %O`, combinedKnownPackages);\n\n const resolvedDependencies = packagesToCheck?.length\n ? // Diff the provided packages to ensure we only check against installed packages.\n getFilteredObject(packagesToCheck, { ...pkg.dependencies, ...pkg.devDependencies })\n : // If no packages are provided, check against the `package.json` `dependencies` + `devDependencies` object.\n { ...pkg.dependencies, ...pkg.devDependencies };\n debug(`Checking dependencies for ${exp.sdkVersion}: %O`, resolvedDependencies);\n\n // intersection of packages from package.json and bundled native modules\n const { known: resolvedPackagesToCheck, unknown } = getPackagesToCheck(\n combinedKnownPackages,\n resolvedDependencies\n );\n debug(`Comparing known versions: %O`, resolvedPackagesToCheck);\n debug(`Skipping packages that cannot be versioned automatically: %O`, unknown);\n // read package versions from the file system (node_modules)\n const packageVersions = await resolveAllPackageVersionsAsync(\n projectRoot,\n resolvedPackagesToCheck\n );\n debug(`Package versions: %O`, packageVersions);\n // find incorrect dependencies by comparing the actual package versions with the bundled native module version ranges\n let incorrectDeps = findIncorrectDependencies(pkg, packageVersions, combinedKnownPackages);\n debug(`Incorrect dependencies: %O`, incorrectDeps);\n\n if (pkg?.expo?.install?.exclude) {\n const packagesToExclude = pkg.expo.install.exclude;\n\n // Parse the exclude list to ensure we can factor in any specified version ranges\n const parsedPackagesToExclude = packagesToExclude.reduce(\n (acc: Record<string, npmPackageArg.Result>, packageName: string) => {\n const npaResult = npmPackageArg(packageName);\n if (typeof npaResult.name === 'string') {\n acc[npaResult.name] = npaResult;\n } else {\n acc[packageName] = npaResult;\n }\n return acc;\n },\n {}\n );\n\n const incorrectAndExcludedDeps = incorrectDeps\n .filter((dep) => {\n if (parsedPackagesToExclude[dep.packageName]) {\n const { name, raw, rawSpec, type } = parsedPackagesToExclude[dep.packageName];\n const suggestedRange = combinedKnownPackages[name];\n\n // If only the package name itself is specified, then we keep it in the exclude list\n if (name === raw) {\n return true;\n } else if (type === 'version') {\n return suggestedRange === rawSpec;\n } else if (type === 'range') {\n // Fall through exclusions if the suggested range is invalid\n if (!semver.validRange(suggestedRange)) {\n debug(\n `Invalid semver range in combined known packages for package ${name} in expo.install.exclude: %O`,\n suggestedRange\n );\n return false;\n }\n\n return semverRangeSubset(suggestedRange, rawSpec);\n } else {\n debug(\n `Unsupported npm package argument type for package ${name} in expo.install.exclude: %O`,\n type\n );\n }\n }\n\n return false;\n })\n .map((dep) => dep.packageName);\n\n debug(\n `Incorrect dependency warnings filtered out by expo.install.exclude: %O`,\n incorrectAndExcludedDeps\n );\n incorrectDeps = incorrectDeps.filter(\n (dep) => !incorrectAndExcludedDeps.includes(dep.packageName)\n );\n }\n\n return incorrectDeps;\n}\n\nfunction getFilteredObject(keys: string[], object: Record<string, string>) {\n return keys.reduce<Record<string, string>>((acc, key) => {\n acc[key] = object[key];\n return acc;\n }, {});\n}\n\nfunction getPackagesToCheck(\n bundledNativeModules: BundledNativeModules,\n dependencies?: Record<string, string> | null\n): DependenciesToCheck {\n const dependencyNames = Object.keys(dependencies ?? {});\n const known: string[] = [];\n const unknown: string[] = [];\n for (const dependencyName of dependencyNames) {\n if (dependencyName in bundledNativeModules) {\n known.push(dependencyName);\n } else {\n unknown.push(dependencyName);\n }\n }\n return { known, unknown };\n}\n\nfunction findIncorrectDependencies(\n pkg: PackageJSONConfig,\n packageVersions: Record<string, string>,\n bundledNativeModules: BundledNativeModules\n): IncorrectDependency[] {\n const packages = Object.keys(packageVersions);\n const incorrectDeps: IncorrectDependency[] = [];\n for (const packageName of packages) {\n const expectedVersionOrRange = bundledNativeModules[packageName];\n const actualVersion = packageVersions[packageName];\n if (isDependencyVersionIncorrect(packageName, actualVersion, expectedVersionOrRange)) {\n incorrectDeps.push({\n packageName,\n packageType: findDependencyType(pkg, packageName),\n expectedVersionOrRange,\n actualVersion,\n });\n }\n }\n return incorrectDeps;\n}\n\nfunction isDependencyVersionIncorrect(\n packageName: string,\n actualVersion: string,\n expectedVersionOrRange?: string\n) {\n if (!expectedVersionOrRange) {\n return false;\n }\n\n // we never want to go backwards with the expo patch version\n if (packageName === 'expo') {\n return semver.ltr(actualVersion, expectedVersionOrRange);\n }\n\n // all other packages: version range is based on Expo SDK version, so we always want to match range\n return !semver.intersects(expectedVersionOrRange, actualVersion);\n}\n\nfunction findDependencyType(\n pkg: PackageJSONConfig,\n packageName: string\n): IncorrectDependency['packageType'] {\n if (pkg.devDependencies && packageName in pkg.devDependencies) {\n return 'devDependencies';\n }\n\n return 'dependencies';\n}\n"],"names":["validateDependenciesVersionsAsync","logIncorrectDependencies","getVersionedDependenciesAsync","debug","require","projectRoot","exp","pkg","packagesToCheck","env","EXPO_OFFLINE","Log","warn","incorrectDeps","logInvalidDependency","packageName","expectedVersionOrRange","actualVersion","chalk","length","forEach","dep","assert","sdkVersion","combinedKnownPackages","getCombinedKnownVersionsAsync","resolvedDependencies","getFilteredObject","dependencies","devDependencies","known","resolvedPackagesToCheck","unknown","getPackagesToCheck","packageVersions","resolveAllPackageVersionsAsync","findIncorrectDependencies","expo","install","exclude","packagesToExclude","parsedPackagesToExclude","reduce","acc","npaResult","npmPackageArg","name","incorrectAndExcludedDeps","filter","raw","rawSpec","type","suggestedRange","semver","validRange","semverRangeSubset","map","includes","keys","object","key","bundledNativeModules","dependencyNames","Object","dependencyName","push","packages","isDependencyVersionIncorrect","packageType","findDependencyType","ltr","intersects"],"mappings":"AAAA;;;;;;;;;;;IAkCsBA,iCAAiC,MAAjCA,iCAAiC;IAyBvCC,wBAAwB,MAAxBA,wBAAwB;IA0BlBC,6BAA6B,MAA7BA,6BAA6B;;;8DApFhC,QAAQ;;;;;;;8DACT,OAAO;;;;;;;8DACC,iBAAiB;;;;;;;8DACxB,QAAQ;;;;;;;8DACG,sBAAsB;;;;;;sCAGN,wBAAwB;iCACvB,mBAAmB;2DAC7C,cAAc;qBACf,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAExC,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,mCAAmC,CAA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AO,KAAK,CAAC;IACf,CAAC;IAED,4DAA4D;IAC5D,IAAID,WAAW,KAAK,MAAM,EAAE;QAC1B,OAAOsC,OAAM,EAAA,QAAA,CAACiB,GAAG,CAACrD,aAAa,EAAED,sBAAsB,CAAC,CAAC;IAC3D,CAAC;IAED,mGAAmG;IACnG,OAAO,CAACqC,OAAM,EAAA,QAAA,CAACkB,UAAU,CAACvD,sBAAsB,EAAEC,aAAa,CAAC,CAAC;AACnE,CAAC;AAED,SAASoD,kBAAkB,CACzB9D,GAAsB,EACtBQ,WAAmB,EACiB;IACpC,IAAIR,GAAG,CAACsB,eAAe,IAAId,WAAW,IAAIR,GAAG,CAACsB,eAAe,EAAE;QAC7D,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC"}
@@ -136,8 +136,9 @@ class BundlerDevServer {
136
136
  return {
137
137
  // Create a mock server
138
138
  server: {
139
- close: ()=>{
139
+ close: (callback)=>{
140
140
  this.instance = null;
141
+ callback == null ? void 0 : callback();
141
142
  },
142
143
  addListener () {}
143
144
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/start/server/BundlerDevServer.ts"],"sourcesContent":["import assert from 'assert';\nimport resolveFrom from 'resolve-from';\n\nimport { AsyncNgrok } from './AsyncNgrok';\nimport DevToolsPluginManager from './DevToolsPluginManager';\nimport { DevelopmentSession } from './DevelopmentSession';\nimport { CreateURLOptions, UrlCreator } from './UrlCreator';\nimport { PlatformBundlers } from './platformBundlers';\nimport * as Log from '../../log';\nimport { FileNotifier } from '../../utils/FileNotifier';\nimport { resolveWithTimeout } from '../../utils/delay';\nimport { env } from '../../utils/env';\nimport { CommandError } from '../../utils/errors';\nimport { openBrowserAsync } from '../../utils/open';\nimport {\n BaseOpenInCustomProps,\n BaseResolveDeviceProps,\n PlatformManager,\n} from '../platforms/PlatformManager';\n\nconst debug = require('debug')('expo:start:server:devServer') as typeof console.log;\n\nexport type MessageSocket = {\n broadcast: (method: string, params?: Record<string, any> | undefined) => void;\n};\n\nexport type ServerLike = {\n close(callback?: (err?: Error) => void): void;\n addListener?(event: string, listener: (...args: any[]) => void): unknown;\n};\n\nexport type DevServerInstance = {\n /** Bundler dev server instance. */\n server: ServerLike;\n /** Dev server URL location properties. */\n location: {\n url: string;\n port: number;\n protocol: 'http' | 'https';\n host?: string;\n };\n /** Additional middleware that's attached to the `server`. */\n middleware: any;\n /** Message socket for communicating with the runtime. */\n messageSocket: MessageSocket;\n};\n\nexport interface BundlerStartOptions {\n /** Should the dev server use `https` protocol. */\n https?: boolean;\n /** Should start the dev servers in development mode (minify). */\n mode?: 'development' | 'production';\n /** Is dev client enabled. */\n devClient?: boolean;\n /** Should run dev servers with clean caches. */\n resetDevServer?: boolean;\n /** Code signing private key path (defaults to same directory as certificate) */\n privateKeyPath?: string;\n\n /** Max amount of workers (threads) to use with Metro bundler, defaults to undefined for max workers. */\n maxWorkers?: number;\n /** Port to start the dev server on. */\n port?: number;\n\n /** Should start a headless dev server e.g. mock representation to approximate info from a server running in a different process. */\n headless?: boolean;\n /** Should instruct the bundler to create minified bundles. */\n minify?: boolean;\n\n /** Will the bundler be used for exporting. NOTE: This is an odd option to pass to the dev server. */\n isExporting?: boolean;\n\n // Webpack options\n /** Should modify and create PWA icons. */\n isImageEditingEnabled?: boolean;\n\n location: CreateURLOptions;\n}\n\nconst PLATFORM_MANAGERS = {\n simulator: () =>\n require('../platforms/ios/ApplePlatformManager')\n .ApplePlatformManager as typeof import('../platforms/ios/ApplePlatformManager').ApplePlatformManager,\n emulator: () =>\n require('../platforms/android/AndroidPlatformManager')\n .AndroidPlatformManager as typeof import('../platforms/android/AndroidPlatformManager').AndroidPlatformManager,\n};\n\nexport abstract class BundlerDevServer {\n /** Name of the bundler. */\n abstract get name(): string;\n\n /** Ngrok instance for managing tunnel connections. */\n protected ngrok: AsyncNgrok | null = null;\n /** Interfaces with the Expo 'Development Session' API. */\n protected devSession: DevelopmentSession | null = null;\n /** Http server and related info. */\n protected instance: DevServerInstance | null = null;\n /** Native platform interfaces for opening projects. */\n private platformManagers: Record<string, PlatformManager<any>> = {};\n /** Manages the creation of dev server URLs. */\n protected urlCreator?: UrlCreator | null = null;\n\n private notifier: FileNotifier | null = null;\n protected readonly devToolsPluginManager: DevToolsPluginManager;\n public isDevClient: boolean;\n\n constructor(\n /** Project root folder. */\n public projectRoot: string,\n /** A mapping of bundlers to platforms. */\n public platformBundlers: PlatformBundlers,\n /** Advanced options */\n options?: {\n /**\n * The instance of DevToolsPluginManager\n * @default new DevToolsPluginManager(projectRoot)\n */\n devToolsPluginManager?: DevToolsPluginManager;\n // TODO: Replace with custom scheme maybe...\n isDevClient?: boolean;\n }\n ) {\n this.devToolsPluginManager =\n options?.devToolsPluginManager ?? new DevToolsPluginManager(projectRoot);\n this.isDevClient = options?.isDevClient ?? false;\n }\n\n protected setInstance(instance: DevServerInstance) {\n this.instance = instance;\n }\n\n /** Get the manifest middleware function. */\n protected async getManifestMiddlewareAsync(\n options: Pick<BundlerStartOptions, 'minify' | 'mode' | 'privateKeyPath'> = {}\n ) {\n const Middleware = require('./middleware/ExpoGoManifestHandlerMiddleware')\n .ExpoGoManifestHandlerMiddleware as typeof import('./middleware/ExpoGoManifestHandlerMiddleware').ExpoGoManifestHandlerMiddleware;\n\n const urlCreator = this.getUrlCreator();\n const middleware = new Middleware(this.projectRoot, {\n constructUrl: urlCreator.constructUrl.bind(urlCreator),\n mode: options.mode,\n minify: options.minify,\n isNativeWebpack: this.name === 'webpack' && this.isTargetingNative(),\n privateKeyPath: options.privateKeyPath,\n });\n return middleware;\n }\n\n /** Start the dev server using settings defined in the start command. */\n public async startAsync(options: BundlerStartOptions): Promise<DevServerInstance> {\n await this.stopAsync();\n\n let instance: DevServerInstance;\n if (options.headless) {\n instance = await this.startHeadlessAsync(options);\n } else {\n instance = await this.startImplementationAsync(options);\n }\n\n this.setInstance(instance);\n await this.postStartAsync(options);\n return instance;\n }\n\n protected abstract startImplementationAsync(\n options: BundlerStartOptions\n ): Promise<DevServerInstance>;\n\n public async waitForTypeScriptAsync(): Promise<boolean> {\n return false;\n }\n\n public abstract startTypeScriptServices(): Promise<void>;\n\n public async watchEnvironmentVariables(): Promise<void> {\n // noop -- We've only implemented this functionality in Metro.\n }\n\n /**\n * Creates a mock server representation that can be used to estimate URLs for a server started in another process.\n * This is used for the run commands where you can reuse the server from a previous run.\n */\n private async startHeadlessAsync(options: BundlerStartOptions): Promise<DevServerInstance> {\n if (!options.port)\n throw new CommandError('HEADLESS_SERVER', 'headless dev server requires a port option');\n this.urlCreator = this.getUrlCreator(options);\n\n return {\n // Create a mock server\n server: {\n close: () => {\n this.instance = null;\n },\n addListener() {},\n },\n location: {\n // The port is the main thing we want to send back.\n port: options.port,\n // localhost isn't always correct.\n host: 'localhost',\n // http is the only supported protocol on native.\n url: `http://localhost:${options.port}`,\n protocol: 'http',\n },\n middleware: {},\n messageSocket: {\n broadcast: () => {\n throw new CommandError('HEADLESS_SERVER', 'Cannot broadcast messages to headless server');\n },\n },\n };\n }\n\n /**\n * Runs after the `startAsync` function, performing any additional common operations.\n * You can assume the dev server is started by the time this function is called.\n */\n protected async postStartAsync(options: BundlerStartOptions) {\n if (\n options.location.hostType === 'tunnel' &&\n !env.EXPO_OFFLINE &&\n // This is a hack to prevent using tunnel on web since we block it upstream for some reason.\n this.isTargetingNative()\n ) {\n await this._startTunnelAsync();\n }\n\n if (!options.isExporting) {\n await this.startDevSessionAsync();\n this.watchConfig();\n }\n }\n\n protected abstract getConfigModuleIds(): string[];\n\n protected watchConfig() {\n this.notifier?.stopObserving();\n this.notifier = new FileNotifier(this.projectRoot, this.getConfigModuleIds());\n this.notifier.startObserving();\n }\n\n /** Create ngrok instance and start the tunnel server. Exposed for testing. */\n public async _startTunnelAsync(): Promise<AsyncNgrok | null> {\n const port = this.getInstance()?.location.port;\n if (!port) return null;\n debug('[ngrok] connect to port: ' + port);\n this.ngrok = new AsyncNgrok(this.projectRoot, port);\n await this.ngrok.startAsync();\n return this.ngrok;\n }\n\n protected async startDevSessionAsync() {\n // This is used to make Expo Go open the project in either Expo Go, or the web browser.\n // Must come after ngrok (`startTunnelAsync`) setup.\n this.devSession?.stopNotifying?.();\n this.devSession = new DevelopmentSession(\n this.projectRoot,\n // This URL will be used on external devices so the computer IP won't be relevant.\n this.isTargetingNative()\n ? this.getNativeRuntimeUrl()\n : this.getDevServerUrl({ hostType: 'localhost' }),\n () => {\n // TODO: This appears to be happening consistently after an hour.\n // We should investigate why this is happening and fix it on our servers.\n // Log.error(\n // chalk.red(\n // '\\nAn unexpected error occurred while updating the Dev Session API. This project will not appear in the \"Development servers\" section of the Expo Go app until this process has been restarted.'\n // )\n // );\n // Log.exception(error);\n this.devSession?.closeAsync().catch((error) => {\n debug('[dev-session] error closing: ' + error.message);\n });\n }\n );\n\n await this.devSession.startAsync({\n runtime: this.isTargetingNative() ? 'native' : 'web',\n });\n }\n\n public isTargetingNative() {\n // Temporary hack while we implement multi-bundler dev server proxy.\n return true;\n }\n\n public isTargetingWeb() {\n return this.platformBundlers.web === this.name;\n }\n\n /**\n * Sends a message over web sockets to any connected device,\n * does nothing when the dev server is not running.\n *\n * @param method name of the command. In RN projects `reload`, and `devMenu` are available. In Expo Go, `sendDevCommand` is available.\n * @param params\n */\n public broadcastMessage(\n method: 'reload' | 'devMenu' | 'sendDevCommand',\n params?: Record<string, any>\n ) {\n this.getInstance()?.messageSocket.broadcast(method, params);\n }\n\n /** Get the running dev server instance. */\n public getInstance() {\n return this.instance;\n }\n\n /** Stop the running dev server instance. */\n async stopAsync() {\n // Stop file watching.\n this.notifier?.stopObserving();\n\n // Stop the dev session timer and tell Expo API to remove dev session.\n await this.devSession?.closeAsync();\n\n // Stop ngrok if running.\n await this.ngrok?.stopAsync().catch((e) => {\n Log.error(`Error stopping ngrok:`);\n Log.exception(e);\n });\n\n return resolveWithTimeout(\n () =>\n new Promise<void>((resolve, reject) => {\n // Close the server.\n debug(`Stopping dev server (bundler: ${this.name})`);\n\n if (this.instance?.server) {\n // Check if server is even running.\n this.instance.server.close((error) => {\n debug(`Stopped dev server (bundler: ${this.name})`);\n this.instance = null;\n if (error) {\n if ('code' in error && error.code === 'ERR_SERVER_NOT_RUNNING') {\n resolve();\n } else {\n reject(error);\n }\n } else {\n resolve();\n }\n });\n } else {\n debug(`Stopped dev server (bundler: ${this.name})`);\n this.instance = null;\n resolve();\n }\n }),\n {\n // NOTE(Bacon): Metro dev server doesn't seem to be closing in time.\n timeout: 1000,\n errorMessage: `Timeout waiting for '${this.name}' dev server to close`,\n }\n );\n }\n\n public getUrlCreator(options: Partial<Pick<BundlerStartOptions, 'port' | 'location'>> = {}) {\n if (!this.urlCreator) {\n assert(options?.port, 'Dev server instance not found');\n this.urlCreator = new UrlCreator(options.location, {\n port: options.port,\n getTunnelUrl: this.getTunnelUrl.bind(this),\n });\n }\n return this.urlCreator;\n }\n\n public getNativeRuntimeUrl(opts: Partial<CreateURLOptions> = {}) {\n return this.isDevClient\n ? this.getUrlCreator().constructDevClientUrl(opts) ?? this.getDevServerUrl()\n : this.getUrlCreator().constructUrl({ ...opts, scheme: 'exp' });\n }\n\n /** Get the URL for the running instance of the dev server. */\n public getDevServerUrl(options: { hostType?: 'localhost' } = {}): string | null {\n const instance = this.getInstance();\n if (!instance?.location) {\n return null;\n }\n const { location } = instance;\n if (options.hostType === 'localhost') {\n return `${location.protocol}://localhost:${location.port}`;\n }\n return location.url ?? null;\n }\n\n /** Get the base URL for JS inspector */\n public getJsInspectorBaseUrl(): string {\n if (this.name !== 'metro') {\n throw new CommandError(\n 'DEV_SERVER',\n `Cannot get the JS inspector base url - bundler[${this.name}]`\n );\n }\n return this.getUrlCreator().constructUrl({ scheme: 'http' });\n }\n\n /** Get the tunnel URL from ngrok. */\n public getTunnelUrl(): string | null {\n return this.ngrok?.getActiveUrl() ?? null;\n }\n\n /** Open the dev server in a runtime. */\n public async openPlatformAsync(\n launchTarget: keyof typeof PLATFORM_MANAGERS | 'desktop',\n resolver: BaseResolveDeviceProps<any> = {}\n ) {\n if (launchTarget === 'desktop') {\n const serverUrl = this.getDevServerUrl({ hostType: 'localhost' });\n // Allow opening the tunnel URL when using Metro web.\n const url = this.name === 'metro' ? this.getTunnelUrl() ?? serverUrl : serverUrl;\n await openBrowserAsync(url!);\n return { url };\n }\n\n const runtime = this.isTargetingNative() ? (this.isDevClient ? 'custom' : 'expo') : 'web';\n const manager = await this.getPlatformManagerAsync(launchTarget);\n return manager.openAsync({ runtime }, resolver);\n }\n\n /** Open the dev server in a runtime. */\n public async openCustomRuntimeAsync(\n launchTarget: keyof typeof PLATFORM_MANAGERS,\n launchProps: Partial<BaseOpenInCustomProps> = {},\n resolver: BaseResolveDeviceProps<any> = {}\n ) {\n const runtime = this.isTargetingNative() ? (this.isDevClient ? 'custom' : 'expo') : 'web';\n if (runtime !== 'custom') {\n throw new CommandError(\n `dev server cannot open custom runtimes either because it does not target native platforms or because it is not targeting dev clients. (target: ${runtime})`\n );\n }\n\n const manager = await this.getPlatformManagerAsync(launchTarget);\n return manager.openAsync({ runtime: 'custom', props: launchProps }, resolver);\n }\n\n /** Get the URL for opening in Expo Go. */\n protected getExpoGoUrl(): string {\n return this.getUrlCreator().constructUrl({ scheme: 'exp' });\n }\n\n /** Should use the interstitial page for selecting which runtime to use. */\n protected isRedirectPageEnabled(): boolean {\n return (\n !env.EXPO_NO_REDIRECT_PAGE &&\n // if user passed --dev-client flag, skip interstitial page\n !this.isDevClient &&\n // Checks if dev client is installed.\n !!resolveFrom.silent(this.projectRoot, 'expo-dev-client')\n );\n }\n\n /** Get the redirect URL when redirecting is enabled. */\n public getRedirectUrl(platform: keyof typeof PLATFORM_MANAGERS | null = null): string | null {\n if (!this.isRedirectPageEnabled()) {\n debug('Redirect page is disabled');\n return null;\n }\n\n return (\n this.getUrlCreator().constructLoadingUrl(\n {},\n platform === 'emulator' ? 'android' : platform === 'simulator' ? 'ios' : null\n ) ?? null\n );\n }\n\n public getReactDevToolsUrl(): string {\n return new URL(\n '_expo/react-devtools',\n this.getUrlCreator().constructUrl({ scheme: 'http' })\n ).toString();\n }\n\n protected async getPlatformManagerAsync(platform: keyof typeof PLATFORM_MANAGERS) {\n if (!this.platformManagers[platform]) {\n const Manager = PLATFORM_MANAGERS[platform]();\n const port = this.getInstance()?.location.port;\n if (!port || !this.urlCreator) {\n throw new CommandError(\n 'DEV_SERVER',\n 'Cannot interact with native platforms until dev server has started'\n );\n }\n debug(`Creating platform manager (platform: ${platform}, port: ${port})`);\n this.platformManagers[platform] = new Manager(this.projectRoot, port, {\n getCustomRuntimeUrl: this.urlCreator.constructDevClientUrl.bind(this.urlCreator),\n getExpoGoUrl: this.getExpoGoUrl.bind(this),\n getRedirectUrl: this.getRedirectUrl.bind(this, platform),\n getDevServerUrl: this.getDevServerUrl.bind(this, { hostType: 'localhost' }),\n });\n }\n return this.platformManagers[platform];\n }\n}\n"],"names":["BundlerDevServer","debug","require","PLATFORM_MANAGERS","simulator","ApplePlatformManager","emulator","AndroidPlatformManager","constructor","projectRoot","platformBundlers","options","ngrok","devSession","instance","platformManagers","urlCreator","notifier","devToolsPluginManager","DevToolsPluginManager","isDevClient","setInstance","getManifestMiddlewareAsync","Middleware","ExpoGoManifestHandlerMiddleware","getUrlCreator","middleware","constructUrl","bind","mode","minify","isNativeWebpack","name","isTargetingNative","privateKeyPath","startAsync","stopAsync","headless","startHeadlessAsync","startImplementationAsync","postStartAsync","waitForTypeScriptAsync","watchEnvironmentVariables","port","CommandError","server","close","addListener","location","host","url","protocol","messageSocket","broadcast","hostType","env","EXPO_OFFLINE","_startTunnelAsync","isExporting","startDevSessionAsync","watchConfig","stopObserving","FileNotifier","getConfigModuleIds","startObserving","getInstance","AsyncNgrok","stopNotifying","DevelopmentSession","getNativeRuntimeUrl","getDevServerUrl","closeAsync","catch","error","message","runtime","isTargetingWeb","web","broadcastMessage","method","params","e","Log","exception","resolveWithTimeout","Promise","resolve","reject","code","timeout","errorMessage","assert","UrlCreator","getTunnelUrl","opts","constructDevClientUrl","scheme","getJsInspectorBaseUrl","getActiveUrl","openPlatformAsync","launchTarget","resolver","serverUrl","openBrowserAsync","manager","getPlatformManagerAsync","openAsync","openCustomRuntimeAsync","launchProps","props","getExpoGoUrl","isRedirectPageEnabled","EXPO_NO_REDIRECT_PAGE","resolveFrom","silent","getRedirectUrl","platform","constructLoadingUrl","getReactDevToolsUrl","URL","toString","Manager","getCustomRuntimeUrl"],"mappings":"AAAA;;;;+BAwFsBA,kBAAgB;;aAAhBA,gBAAgB;;;8DAxFnB,QAAQ;;;;;;;8DACH,cAAc;;;;;;4BAEX,cAAc;4EACP,yBAAyB;oCACxB,sBAAsB;4BACZ,cAAc;2DAEtC,WAAW;8BACH,0BAA0B;uBACpB,mBAAmB;qBAClC,iBAAiB;wBACR,oBAAoB;sBAChB,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOnD,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,6BAA6B,CAAC,AAAsB,AAAC;AA2DpF,MAAMC,iBAAiB,GAAG;IACxBC,SAAS,EAAE,IACTF,OAAO,CAAC,uCAAuC,CAAC,CAC7CG,oBAAoB,AAA+E;IACxGC,QAAQ,EAAE,IACRJ,OAAO,CAAC,6CAA6C,CAAC,CACnDK,sBAAsB,AAAuF;CACnH,AAAC;AAEK,MAAeP,gBAAgB;IAmBpCQ,YAESC,WAAmB,EAEnBC,gBAAkC,EACzC,qBAAqB,GACrBC,OAQC,CACD;QAbOF,mBAAAA,WAAmB,CAAA;QAEnBC,wBAAAA,gBAAkC,CAAA;aAlBjCE,KAAK,GAAsB,IAAI;aAE/BC,UAAU,GAA8B,IAAI;aAE5CC,QAAQ,GAA6B,IAAI;aAE3CC,gBAAgB,GAAyC,EAAE;aAEzDC,UAAU,GAAuB,IAAI;aAEvCC,QAAQ,GAAwB,IAAI;YAqBxCN,GAA8B;QADhC,IAAI,CAACO,qBAAqB,GACxBP,CAAAA,GAA8B,GAA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QAAQ,CAAC;gBACxD9C,eAAe,EAAE,IAAI,CAACA,eAAe,CAAC1C,IAAI,CAAC,IAAI,EAAE;oBAAE0B,QAAQ,EAAE,WAAW;iBAAE,CAAC;aAC5E,CAAC,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAACvC,gBAAgB,CAACqG,QAAQ,CAAC,CAAC;IACzC;CACD"}
1
+ {"version":3,"sources":["../../../../src/start/server/BundlerDevServer.ts"],"sourcesContent":["import assert from 'assert';\nimport resolveFrom from 'resolve-from';\n\nimport { AsyncNgrok } from './AsyncNgrok';\nimport DevToolsPluginManager from './DevToolsPluginManager';\nimport { DevelopmentSession } from './DevelopmentSession';\nimport { CreateURLOptions, UrlCreator } from './UrlCreator';\nimport { PlatformBundlers } from './platformBundlers';\nimport * as Log from '../../log';\nimport { FileNotifier } from '../../utils/FileNotifier';\nimport { resolveWithTimeout } from '../../utils/delay';\nimport { env } from '../../utils/env';\nimport { CommandError } from '../../utils/errors';\nimport { openBrowserAsync } from '../../utils/open';\nimport {\n BaseOpenInCustomProps,\n BaseResolveDeviceProps,\n PlatformManager,\n} from '../platforms/PlatformManager';\n\nconst debug = require('debug')('expo:start:server:devServer') as typeof console.log;\n\nexport type MessageSocket = {\n broadcast: (method: string, params?: Record<string, any> | undefined) => void;\n};\n\nexport type ServerLike = {\n close(callback?: (err?: Error) => void): void;\n addListener?(event: string, listener: (...args: any[]) => void): unknown;\n};\n\nexport type DevServerInstance = {\n /** Bundler dev server instance. */\n server: ServerLike;\n /** Dev server URL location properties. */\n location: {\n url: string;\n port: number;\n protocol: 'http' | 'https';\n host?: string;\n };\n /** Additional middleware that's attached to the `server`. */\n middleware: any;\n /** Message socket for communicating with the runtime. */\n messageSocket: MessageSocket;\n};\n\nexport interface BundlerStartOptions {\n /** Should the dev server use `https` protocol. */\n https?: boolean;\n /** Should start the dev servers in development mode (minify). */\n mode?: 'development' | 'production';\n /** Is dev client enabled. */\n devClient?: boolean;\n /** Should run dev servers with clean caches. */\n resetDevServer?: boolean;\n /** Code signing private key path (defaults to same directory as certificate) */\n privateKeyPath?: string;\n\n /** Max amount of workers (threads) to use with Metro bundler, defaults to undefined for max workers. */\n maxWorkers?: number;\n /** Port to start the dev server on. */\n port?: number;\n\n /** Should start a headless dev server e.g. mock representation to approximate info from a server running in a different process. */\n headless?: boolean;\n /** Should instruct the bundler to create minified bundles. */\n minify?: boolean;\n\n /** Will the bundler be used for exporting. NOTE: This is an odd option to pass to the dev server. */\n isExporting?: boolean;\n\n // Webpack options\n /** Should modify and create PWA icons. */\n isImageEditingEnabled?: boolean;\n\n location: CreateURLOptions;\n}\n\nconst PLATFORM_MANAGERS = {\n simulator: () =>\n require('../platforms/ios/ApplePlatformManager')\n .ApplePlatformManager as typeof import('../platforms/ios/ApplePlatformManager').ApplePlatformManager,\n emulator: () =>\n require('../platforms/android/AndroidPlatformManager')\n .AndroidPlatformManager as typeof import('../platforms/android/AndroidPlatformManager').AndroidPlatformManager,\n};\n\nexport abstract class BundlerDevServer {\n /** Name of the bundler. */\n abstract get name(): string;\n\n /** Ngrok instance for managing tunnel connections. */\n protected ngrok: AsyncNgrok | null = null;\n /** Interfaces with the Expo 'Development Session' API. */\n protected devSession: DevelopmentSession | null = null;\n /** Http server and related info. */\n protected instance: DevServerInstance | null = null;\n /** Native platform interfaces for opening projects. */\n private platformManagers: Record<string, PlatformManager<any>> = {};\n /** Manages the creation of dev server URLs. */\n protected urlCreator?: UrlCreator | null = null;\n\n private notifier: FileNotifier | null = null;\n protected readonly devToolsPluginManager: DevToolsPluginManager;\n public isDevClient: boolean;\n\n constructor(\n /** Project root folder. */\n public projectRoot: string,\n /** A mapping of bundlers to platforms. */\n public platformBundlers: PlatformBundlers,\n /** Advanced options */\n options?: {\n /**\n * The instance of DevToolsPluginManager\n * @default new DevToolsPluginManager(projectRoot)\n */\n devToolsPluginManager?: DevToolsPluginManager;\n // TODO: Replace with custom scheme maybe...\n isDevClient?: boolean;\n }\n ) {\n this.devToolsPluginManager =\n options?.devToolsPluginManager ?? new DevToolsPluginManager(projectRoot);\n this.isDevClient = options?.isDevClient ?? false;\n }\n\n protected setInstance(instance: DevServerInstance) {\n this.instance = instance;\n }\n\n /** Get the manifest middleware function. */\n protected async getManifestMiddlewareAsync(\n options: Pick<BundlerStartOptions, 'minify' | 'mode' | 'privateKeyPath'> = {}\n ) {\n const Middleware = require('./middleware/ExpoGoManifestHandlerMiddleware')\n .ExpoGoManifestHandlerMiddleware as typeof import('./middleware/ExpoGoManifestHandlerMiddleware').ExpoGoManifestHandlerMiddleware;\n\n const urlCreator = this.getUrlCreator();\n const middleware = new Middleware(this.projectRoot, {\n constructUrl: urlCreator.constructUrl.bind(urlCreator),\n mode: options.mode,\n minify: options.minify,\n isNativeWebpack: this.name === 'webpack' && this.isTargetingNative(),\n privateKeyPath: options.privateKeyPath,\n });\n return middleware;\n }\n\n /** Start the dev server using settings defined in the start command. */\n public async startAsync(options: BundlerStartOptions): Promise<DevServerInstance> {\n await this.stopAsync();\n\n let instance: DevServerInstance;\n if (options.headless) {\n instance = await this.startHeadlessAsync(options);\n } else {\n instance = await this.startImplementationAsync(options);\n }\n\n this.setInstance(instance);\n await this.postStartAsync(options);\n return instance;\n }\n\n protected abstract startImplementationAsync(\n options: BundlerStartOptions\n ): Promise<DevServerInstance>;\n\n public async waitForTypeScriptAsync(): Promise<boolean> {\n return false;\n }\n\n public abstract startTypeScriptServices(): Promise<void>;\n\n public async watchEnvironmentVariables(): Promise<void> {\n // noop -- We've only implemented this functionality in Metro.\n }\n\n /**\n * Creates a mock server representation that can be used to estimate URLs for a server started in another process.\n * This is used for the run commands where you can reuse the server from a previous run.\n */\n private async startHeadlessAsync(options: BundlerStartOptions): Promise<DevServerInstance> {\n if (!options.port)\n throw new CommandError('HEADLESS_SERVER', 'headless dev server requires a port option');\n this.urlCreator = this.getUrlCreator(options);\n\n return {\n // Create a mock server\n server: {\n close: (callback: () => void) => {\n this.instance = null;\n callback?.();\n },\n addListener() {},\n },\n location: {\n // The port is the main thing we want to send back.\n port: options.port,\n // localhost isn't always correct.\n host: 'localhost',\n // http is the only supported protocol on native.\n url: `http://localhost:${options.port}`,\n protocol: 'http',\n },\n middleware: {},\n messageSocket: {\n broadcast: () => {\n throw new CommandError('HEADLESS_SERVER', 'Cannot broadcast messages to headless server');\n },\n },\n };\n }\n\n /**\n * Runs after the `startAsync` function, performing any additional common operations.\n * You can assume the dev server is started by the time this function is called.\n */\n protected async postStartAsync(options: BundlerStartOptions) {\n if (\n options.location.hostType === 'tunnel' &&\n !env.EXPO_OFFLINE &&\n // This is a hack to prevent using tunnel on web since we block it upstream for some reason.\n this.isTargetingNative()\n ) {\n await this._startTunnelAsync();\n }\n\n if (!options.isExporting) {\n await this.startDevSessionAsync();\n this.watchConfig();\n }\n }\n\n protected abstract getConfigModuleIds(): string[];\n\n protected watchConfig() {\n this.notifier?.stopObserving();\n this.notifier = new FileNotifier(this.projectRoot, this.getConfigModuleIds());\n this.notifier.startObserving();\n }\n\n /** Create ngrok instance and start the tunnel server. Exposed for testing. */\n public async _startTunnelAsync(): Promise<AsyncNgrok | null> {\n const port = this.getInstance()?.location.port;\n if (!port) return null;\n debug('[ngrok] connect to port: ' + port);\n this.ngrok = new AsyncNgrok(this.projectRoot, port);\n await this.ngrok.startAsync();\n return this.ngrok;\n }\n\n protected async startDevSessionAsync() {\n // This is used to make Expo Go open the project in either Expo Go, or the web browser.\n // Must come after ngrok (`startTunnelAsync`) setup.\n this.devSession?.stopNotifying?.();\n this.devSession = new DevelopmentSession(\n this.projectRoot,\n // This URL will be used on external devices so the computer IP won't be relevant.\n this.isTargetingNative()\n ? this.getNativeRuntimeUrl()\n : this.getDevServerUrl({ hostType: 'localhost' }),\n () => {\n // TODO: This appears to be happening consistently after an hour.\n // We should investigate why this is happening and fix it on our servers.\n // Log.error(\n // chalk.red(\n // '\\nAn unexpected error occurred while updating the Dev Session API. This project will not appear in the \"Development servers\" section of the Expo Go app until this process has been restarted.'\n // )\n // );\n // Log.exception(error);\n this.devSession?.closeAsync().catch((error) => {\n debug('[dev-session] error closing: ' + error.message);\n });\n }\n );\n\n await this.devSession.startAsync({\n runtime: this.isTargetingNative() ? 'native' : 'web',\n });\n }\n\n public isTargetingNative() {\n // Temporary hack while we implement multi-bundler dev server proxy.\n return true;\n }\n\n public isTargetingWeb() {\n return this.platformBundlers.web === this.name;\n }\n\n /**\n * Sends a message over web sockets to any connected device,\n * does nothing when the dev server is not running.\n *\n * @param method name of the command. In RN projects `reload`, and `devMenu` are available. In Expo Go, `sendDevCommand` is available.\n * @param params\n */\n public broadcastMessage(\n method: 'reload' | 'devMenu' | 'sendDevCommand',\n params?: Record<string, any>\n ) {\n this.getInstance()?.messageSocket.broadcast(method, params);\n }\n\n /** Get the running dev server instance. */\n public getInstance() {\n return this.instance;\n }\n\n /** Stop the running dev server instance. */\n async stopAsync() {\n // Stop file watching.\n this.notifier?.stopObserving();\n\n // Stop the dev session timer and tell Expo API to remove dev session.\n await this.devSession?.closeAsync();\n\n // Stop ngrok if running.\n await this.ngrok?.stopAsync().catch((e) => {\n Log.error(`Error stopping ngrok:`);\n Log.exception(e);\n });\n\n return resolveWithTimeout(\n () =>\n new Promise<void>((resolve, reject) => {\n // Close the server.\n debug(`Stopping dev server (bundler: ${this.name})`);\n\n if (this.instance?.server) {\n // Check if server is even running.\n this.instance.server.close((error) => {\n debug(`Stopped dev server (bundler: ${this.name})`);\n this.instance = null;\n if (error) {\n if ('code' in error && error.code === 'ERR_SERVER_NOT_RUNNING') {\n resolve();\n } else {\n reject(error);\n }\n } else {\n resolve();\n }\n });\n } else {\n debug(`Stopped dev server (bundler: ${this.name})`);\n this.instance = null;\n resolve();\n }\n }),\n {\n // NOTE(Bacon): Metro dev server doesn't seem to be closing in time.\n timeout: 1000,\n errorMessage: `Timeout waiting for '${this.name}' dev server to close`,\n }\n );\n }\n\n public getUrlCreator(options: Partial<Pick<BundlerStartOptions, 'port' | 'location'>> = {}) {\n if (!this.urlCreator) {\n assert(options?.port, 'Dev server instance not found');\n this.urlCreator = new UrlCreator(options.location, {\n port: options.port,\n getTunnelUrl: this.getTunnelUrl.bind(this),\n });\n }\n return this.urlCreator;\n }\n\n public getNativeRuntimeUrl(opts: Partial<CreateURLOptions> = {}) {\n return this.isDevClient\n ? this.getUrlCreator().constructDevClientUrl(opts) ?? this.getDevServerUrl()\n : this.getUrlCreator().constructUrl({ ...opts, scheme: 'exp' });\n }\n\n /** Get the URL for the running instance of the dev server. */\n public getDevServerUrl(options: { hostType?: 'localhost' } = {}): string | null {\n const instance = this.getInstance();\n if (!instance?.location) {\n return null;\n }\n const { location } = instance;\n if (options.hostType === 'localhost') {\n return `${location.protocol}://localhost:${location.port}`;\n }\n return location.url ?? null;\n }\n\n /** Get the base URL for JS inspector */\n public getJsInspectorBaseUrl(): string {\n if (this.name !== 'metro') {\n throw new CommandError(\n 'DEV_SERVER',\n `Cannot get the JS inspector base url - bundler[${this.name}]`\n );\n }\n return this.getUrlCreator().constructUrl({ scheme: 'http' });\n }\n\n /** Get the tunnel URL from ngrok. */\n public getTunnelUrl(): string | null {\n return this.ngrok?.getActiveUrl() ?? null;\n }\n\n /** Open the dev server in a runtime. */\n public async openPlatformAsync(\n launchTarget: keyof typeof PLATFORM_MANAGERS | 'desktop',\n resolver: BaseResolveDeviceProps<any> = {}\n ) {\n if (launchTarget === 'desktop') {\n const serverUrl = this.getDevServerUrl({ hostType: 'localhost' });\n // Allow opening the tunnel URL when using Metro web.\n const url = this.name === 'metro' ? this.getTunnelUrl() ?? serverUrl : serverUrl;\n await openBrowserAsync(url!);\n return { url };\n }\n\n const runtime = this.isTargetingNative() ? (this.isDevClient ? 'custom' : 'expo') : 'web';\n const manager = await this.getPlatformManagerAsync(launchTarget);\n return manager.openAsync({ runtime }, resolver);\n }\n\n /** Open the dev server in a runtime. */\n public async openCustomRuntimeAsync(\n launchTarget: keyof typeof PLATFORM_MANAGERS,\n launchProps: Partial<BaseOpenInCustomProps> = {},\n resolver: BaseResolveDeviceProps<any> = {}\n ) {\n const runtime = this.isTargetingNative() ? (this.isDevClient ? 'custom' : 'expo') : 'web';\n if (runtime !== 'custom') {\n throw new CommandError(\n `dev server cannot open custom runtimes either because it does not target native platforms or because it is not targeting dev clients. (target: ${runtime})`\n );\n }\n\n const manager = await this.getPlatformManagerAsync(launchTarget);\n return manager.openAsync({ runtime: 'custom', props: launchProps }, resolver);\n }\n\n /** Get the URL for opening in Expo Go. */\n protected getExpoGoUrl(): string {\n return this.getUrlCreator().constructUrl({ scheme: 'exp' });\n }\n\n /** Should use the interstitial page for selecting which runtime to use. */\n protected isRedirectPageEnabled(): boolean {\n return (\n !env.EXPO_NO_REDIRECT_PAGE &&\n // if user passed --dev-client flag, skip interstitial page\n !this.isDevClient &&\n // Checks if dev client is installed.\n !!resolveFrom.silent(this.projectRoot, 'expo-dev-client')\n );\n }\n\n /** Get the redirect URL when redirecting is enabled. */\n public getRedirectUrl(platform: keyof typeof PLATFORM_MANAGERS | null = null): string | null {\n if (!this.isRedirectPageEnabled()) {\n debug('Redirect page is disabled');\n return null;\n }\n\n return (\n this.getUrlCreator().constructLoadingUrl(\n {},\n platform === 'emulator' ? 'android' : platform === 'simulator' ? 'ios' : null\n ) ?? null\n );\n }\n\n public getReactDevToolsUrl(): string {\n return new URL(\n '_expo/react-devtools',\n this.getUrlCreator().constructUrl({ scheme: 'http' })\n ).toString();\n }\n\n protected async getPlatformManagerAsync(platform: keyof typeof PLATFORM_MANAGERS) {\n if (!this.platformManagers[platform]) {\n const Manager = PLATFORM_MANAGERS[platform]();\n const port = this.getInstance()?.location.port;\n if (!port || !this.urlCreator) {\n throw new CommandError(\n 'DEV_SERVER',\n 'Cannot interact with native platforms until dev server has started'\n );\n }\n debug(`Creating platform manager (platform: ${platform}, port: ${port})`);\n this.platformManagers[platform] = new Manager(this.projectRoot, port, {\n getCustomRuntimeUrl: this.urlCreator.constructDevClientUrl.bind(this.urlCreator),\n getExpoGoUrl: this.getExpoGoUrl.bind(this),\n getRedirectUrl: this.getRedirectUrl.bind(this, platform),\n getDevServerUrl: this.getDevServerUrl.bind(this, { hostType: 'localhost' }),\n });\n }\n return this.platformManagers[platform];\n }\n}\n"],"names":["BundlerDevServer","debug","require","PLATFORM_MANAGERS","simulator","ApplePlatformManager","emulator","AndroidPlatformManager","constructor","projectRoot","platformBundlers","options","ngrok","devSession","instance","platformManagers","urlCreator","notifier","devToolsPluginManager","DevToolsPluginManager","isDevClient","setInstance","getManifestMiddlewareAsync","Middleware","ExpoGoManifestHandlerMiddleware","getUrlCreator","middleware","constructUrl","bind","mode","minify","isNativeWebpack","name","isTargetingNative","privateKeyPath","startAsync","stopAsync","headless","startHeadlessAsync","startImplementationAsync","postStartAsync","waitForTypeScriptAsync","watchEnvironmentVariables","port","CommandError","server","close","callback","addListener","location","host","url","protocol","messageSocket","broadcast","hostType","env","EXPO_OFFLINE","_startTunnelAsync","isExporting","startDevSessionAsync","watchConfig","stopObserving","FileNotifier","getConfigModuleIds","startObserving","getInstance","AsyncNgrok","stopNotifying","DevelopmentSession","getNativeRuntimeUrl","getDevServerUrl","closeAsync","catch","error","message","runtime","isTargetingWeb","web","broadcastMessage","method","params","e","Log","exception","resolveWithTimeout","Promise","resolve","reject","code","timeout","errorMessage","assert","UrlCreator","getTunnelUrl","opts","constructDevClientUrl","scheme","getJsInspectorBaseUrl","getActiveUrl","openPlatformAsync","launchTarget","resolver","serverUrl","openBrowserAsync","manager","getPlatformManagerAsync","openAsync","openCustomRuntimeAsync","launchProps","props","getExpoGoUrl","isRedirectPageEnabled","EXPO_NO_REDIRECT_PAGE","resolveFrom","silent","getRedirectUrl","platform","constructLoadingUrl","getReactDevToolsUrl","URL","toString","Manager","getCustomRuntimeUrl"],"mappings":"AAAA;;;;+BAwFsBA,kBAAgB;;aAAhBA,gBAAgB;;;8DAxFnB,QAAQ;;;;;;;8DACH,cAAc;;;;;;4BAEX,cAAc;4EACP,yBAAyB;oCACxB,sBAAsB;4BACZ,cAAc;2DAEtC,WAAW;8BACH,0BAA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  ci: _ciInfo().isCI ? {
85
85
  name: _ciInfo().name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/cli",
3
- "version": "0.18.25",
3
+ "version": "0.18.27",
4
4
  "description": "The Expo CLI",
5
5
  "main": "build/bin/cli",
6
6
  "bin": {
@@ -149,6 +149,7 @@
149
149
  "@types/progress": "^2.0.5",
150
150
  "@types/prompts": "^2.0.6",
151
151
  "@types/resolve": "^1.20.2",
152
+ "@types/semver": "^7.5.8",
152
153
  "@types/send": "^0.17.1",
153
154
  "@types/tar": "^6.1.1",
154
155
  "@types/text-table": "^0.2.1",
@@ -172,5 +173,5 @@
172
173
  "tree-kill": "^1.2.2",
173
174
  "tsd": "^0.28.1"
174
175
  },
175
- "gitHead": "55fc9ea429eee18c2d3aad434834f8d2b50b2d39"
176
+ "gitHead": "e3eef0d33a4cf869112bc0d7922ee9c7fd35a642"
176
177
  }
@@ -0,0 +1,4 @@
1
+ // https://docs.expo.dev/guides/using-eslint/
2
+ module.exports = {
3
+ extends: 'expo',
4
+ };