@expo/cli 0.19.4 → 0.19.5
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 +1 -1
- package/build/src/install/utils/autoAddConfigPlugins.js +1 -1
- package/build/src/install/utils/autoAddConfigPlugins.js.map +1 -1
- package/build/src/utils/modifyConfigPlugins.js +4 -7
- package/build/src/utils/modifyConfigPlugins.js.map +1 -1
- package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
- package/build/src/utils/telemetry/utils/context.js +1 -1
- package/package.json +2 -2
package/build/bin/cli
CHANGED
|
@@ -80,7 +80,7 @@ async function autoAddConfigPluginsAsync(projectRoot, exp, packages) {
|
|
|
80
80
|
}
|
|
81
81
|
return !!plugin;
|
|
82
82
|
});
|
|
83
|
-
await (0, _modifyConfigPlugins.attemptAddingPluginsAsync)(projectRoot,
|
|
83
|
+
await (0, _modifyConfigPlugins.attemptAddingPluginsAsync)(projectRoot, plugins);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
//# sourceMappingURL=autoAddConfigPlugins.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/install/utils/autoAddConfigPlugins.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config';\nimport {\n normalizeStaticPlugin,\n resolveConfigPluginFunctionWithInfo,\n} from '@expo/config-plugins/build/utils/plugin-resolver';\nimport { getAutoPlugins } from '@expo/prebuild-config';\n\nimport { attemptAddingPluginsAsync } from '../../utils/modifyConfigPlugins';\n\nconst debug = require('debug')('expo:install:config-plugins') as typeof console.log;\n\nconst AUTO_PLUGINS = getAutoPlugins();\n\n/**\n * Resolve if a package has a config plugin.\n * For sanity, we'll only support config plugins that use the `app.config.js` entry file,\n * this is because a package like `lodash` could be a \"valid\" config plugin and break the prebuild process.\n *\n * @param projectRoot\n * @param packageName\n * @returns\n */\nfunction packageHasConfigPlugin(projectRoot: string, packageName: string) {\n try {\n const info = resolveConfigPluginFunctionWithInfo(projectRoot, packageName);\n if (info.isPluginFile) {\n return info.plugin;\n }\n } catch {}\n return false;\n}\n\n/**\n * Get a list of plugins that were are supplied as string module IDs.\n * @example\n * ```json\n * {\n * \"plugins\": [\n * \"expo-camera\",\n * [\"react-native-firebase\", ...]\n * ]\n * }\n * ```\n * ↓ ↓ ↓ ↓ ↓ ↓\n *\n * `['expo-camera', 'react-native-firebase']`\n *\n */\nexport function getNamedPlugins(plugins: NonNullable<ExpoConfig['plugins']>): string[] {\n const namedPlugins: string[] = [];\n for (const plugin of plugins) {\n try {\n // @ts-ignore\n const [normal] = normalizeStaticPlugin(plugin);\n if (typeof normal === 'string') {\n namedPlugins.push(normal);\n }\n } catch {\n // ignore assertions\n }\n }\n return namedPlugins;\n}\n\n/** Attempts to ensure that non-auto plugins are added to the `app.json` `plugins` array when modules with Expo Config Plugins are installed. */\nexport async function autoAddConfigPluginsAsync(\n projectRoot: string,\n exp: Pick<ExpoConfig, 'plugins'>,\n packages: string[]\n) {\n debug('Checking config plugins...');\n\n const currentPlugins = exp.plugins || [];\n const normalized = getNamedPlugins(currentPlugins);\n\n debug(`Existing plugins: ${normalized.join(', ')}`);\n\n const plugins = packages.filter((pkg) => {\n if (normalized.includes(pkg)) {\n // already included in plugins array\n return false;\n }\n // Check if the package has a valid plugin. Must be a well-made plugin for it to work with this.\n const plugin = packageHasConfigPlugin(projectRoot, pkg);\n\n debug(`Package \"${pkg}\" has plugin: ${!!plugin}` + (plugin ? ` (args: ${plugin.length})` : ''));\n\n if (AUTO_PLUGINS.includes(pkg)) {\n debug(`Package \"${pkg}\" is an auto plugin, skipping...`);\n return false;\n }\n\n return !!plugin;\n });\n\n await attemptAddingPluginsAsync(projectRoot,
|
|
1
|
+
{"version":3,"sources":["../../../../src/install/utils/autoAddConfigPlugins.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config';\nimport {\n normalizeStaticPlugin,\n resolveConfigPluginFunctionWithInfo,\n} from '@expo/config-plugins/build/utils/plugin-resolver';\nimport { getAutoPlugins } from '@expo/prebuild-config';\n\nimport { attemptAddingPluginsAsync } from '../../utils/modifyConfigPlugins';\n\nconst debug = require('debug')('expo:install:config-plugins') as typeof console.log;\n\nconst AUTO_PLUGINS = getAutoPlugins();\n\n/**\n * Resolve if a package has a config plugin.\n * For sanity, we'll only support config plugins that use the `app.config.js` entry file,\n * this is because a package like `lodash` could be a \"valid\" config plugin and break the prebuild process.\n *\n * @param projectRoot\n * @param packageName\n * @returns\n */\nfunction packageHasConfigPlugin(projectRoot: string, packageName: string) {\n try {\n const info = resolveConfigPluginFunctionWithInfo(projectRoot, packageName);\n if (info.isPluginFile) {\n return info.plugin;\n }\n } catch {}\n return false;\n}\n\n/**\n * Get a list of plugins that were are supplied as string module IDs.\n * @example\n * ```json\n * {\n * \"plugins\": [\n * \"expo-camera\",\n * [\"react-native-firebase\", ...]\n * ]\n * }\n * ```\n * ↓ ↓ ↓ ↓ ↓ ↓\n *\n * `['expo-camera', 'react-native-firebase']`\n *\n */\nexport function getNamedPlugins(plugins: NonNullable<ExpoConfig['plugins']>): string[] {\n const namedPlugins: string[] = [];\n for (const plugin of plugins) {\n try {\n // @ts-ignore\n const [normal] = normalizeStaticPlugin(plugin);\n if (typeof normal === 'string') {\n namedPlugins.push(normal);\n }\n } catch {\n // ignore assertions\n }\n }\n return namedPlugins;\n}\n\n/** Attempts to ensure that non-auto plugins are added to the `app.json` `plugins` array when modules with Expo Config Plugins are installed. */\nexport async function autoAddConfigPluginsAsync(\n projectRoot: string,\n exp: Pick<ExpoConfig, 'plugins'>,\n packages: string[]\n) {\n debug('Checking config plugins...');\n\n const currentPlugins = exp.plugins || [];\n const normalized = getNamedPlugins(currentPlugins);\n\n debug(`Existing plugins: ${normalized.join(', ')}`);\n\n const plugins = packages.filter((pkg) => {\n if (normalized.includes(pkg)) {\n // already included in plugins array\n return false;\n }\n // Check if the package has a valid plugin. Must be a well-made plugin for it to work with this.\n const plugin = packageHasConfigPlugin(projectRoot, pkg);\n\n debug(`Package \"${pkg}\" has plugin: ${!!plugin}` + (plugin ? ` (args: ${plugin.length})` : ''));\n\n if (AUTO_PLUGINS.includes(pkg)) {\n debug(`Package \"${pkg}\" is an auto plugin, skipping...`);\n return false;\n }\n\n return !!plugin;\n });\n\n await attemptAddingPluginsAsync(projectRoot, plugins);\n}\n"],"names":["getNamedPlugins","autoAddConfigPluginsAsync","debug","require","AUTO_PLUGINS","getAutoPlugins","packageHasConfigPlugin","projectRoot","packageName","info","resolveConfigPluginFunctionWithInfo","isPluginFile","plugin","plugins","namedPlugins","normal","normalizeStaticPlugin","push","exp","packages","currentPlugins","normalized","join","filter","pkg","includes","length","attemptAddingPluginsAsync"],"mappings":"AAAA;;;;;;;;;;;IAgDgBA,eAAe,MAAfA,eAAe;IAiBTC,yBAAyB,MAAzBA,yBAAyB;;;yBA7DxC,kDAAkD;;;;;;;yBAC1B,uBAAuB;;;;;;qCAEZ,iCAAiC;AAE3E,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,6BAA6B,CAAC,AAAsB,AAAC;AAEpF,MAAMC,YAAY,GAAGC,IAAAA,eAAc,EAAA,eAAA,GAAE,AAAC;AAEtC;;;;;;;;CAQC,GACD,SAASC,sBAAsB,CAACC,WAAmB,EAAEC,WAAmB,EAAE;IACxE,IAAI;QACF,MAAMC,IAAI,GAAGC,IAAAA,eAAmC,EAAA,oCAAA,EAACH,WAAW,EAAEC,WAAW,CAAC,AAAC;QAC3E,IAAIC,IAAI,CAACE,YAAY,EAAE;YACrB,OAAOF,IAAI,CAACG,MAAM,CAAC;QACrB,CAAC;IACH,EAAE,OAAM,CAAC,CAAC;IACV,OAAO,KAAK,CAAC;AACf,CAAC;AAkBM,SAASZ,eAAe,CAACa,OAA2C,EAAY;IACrF,MAAMC,YAAY,GAAa,EAAE,AAAC;IAClC,KAAK,MAAMF,MAAM,IAAIC,OAAO,CAAE;QAC5B,IAAI;YACF,aAAa;YACb,MAAM,CAACE,MAAM,CA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AK,CAAC;QACf,CAAC;QAED,OAAO,CAAC,CAACZ,MAAM,CAAC;IAClB,CAAC,CAAC,AAAC;IAEH,MAAMe,IAAAA,oBAAyB,0BAAA,EAACpB,WAAW,EAAEM,OAAO,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -54,14 +54,11 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
54
54
|
}
|
|
55
55
|
return newObj;
|
|
56
56
|
}
|
|
57
|
-
async function attemptAddingPluginsAsync(projectRoot,
|
|
57
|
+
async function attemptAddingPluginsAsync(projectRoot, plugins) {
|
|
58
58
|
if (!plugins.length) return;
|
|
59
|
-
const
|
|
60
|
-
plugins
|
|
61
|
-
|
|
62
|
-
]
|
|
63
|
-
};
|
|
64
|
-
const modification = await (0, _config().modifyConfigAsync)(projectRoot, edits, {
|
|
59
|
+
const modification = await (0, _config().modifyConfigAsync)(projectRoot, {
|
|
60
|
+
plugins
|
|
61
|
+
}, {
|
|
65
62
|
skipSDKVersionRequirement: true,
|
|
66
63
|
skipPlugins: true
|
|
67
64
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/modifyConfigPlugins.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/modifyConfigPlugins.ts"],"sourcesContent":["import { modifyConfigAsync } from '@expo/config';\n\nimport { warnAboutConfigAndThrow } from './modifyConfigAsync';\nimport * as Log from '../log';\n\nexport async function attemptAddingPluginsAsync(\n projectRoot: string,\n plugins: string[]\n): Promise<void> {\n if (!plugins.length) return;\n\n const modification = await modifyConfigAsync(\n projectRoot,\n { plugins },\n {\n skipSDKVersionRequirement: true,\n skipPlugins: true,\n }\n );\n if (modification.type === 'success') {\n Log.log(`\\u203A Added config plugin${plugins.length === 1 ? '' : 's'}: ${plugins.join(', ')}`);\n } else {\n const exactEdits = {\n plugins,\n };\n warnAboutConfigAndThrow(modification.type, modification.message!, exactEdits);\n }\n}\n"],"names":["attemptAddingPluginsAsync","projectRoot","plugins","length","modification","modifyConfigAsync","skipSDKVersionRequirement","skipPlugins","type","Log","log","join","exactEdits","warnAboutConfigAndThrow","message"],"mappings":"AAAA;;;;+BAKsBA,2BAAyB;;aAAzBA,yBAAyB;;;yBALb,cAAc;;;;;;mCAER,qBAAqB;2DACxC,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtB,eAAeA,yBAAyB,CAC7CC,WAAmB,EACnBC,OAAiB,EACF;IACf,IAAI,CAACA,OAAO,CAACC,MAAM,EAAE,OAAO;IAE5B,MAAMC,YAAY,GAAG,MAAMC,IAAAA,OAAiB,EAAA,kBAAA,EAC1CJ,WAAW,EACX;QAAEC,OAAO;KAAE,EACX;QACEI,yBAAyB,EAAE,IAAI;QAC/BC,WAAW,EAAE,IAAI;KAClB,CACF,AAAC;IACF,IAAIH,YAAY,CAACI,IAAI,KAAK,SAAS,EAAE;QACnCC,IAAG,CAACC,GAAG,CAAC,CAAC,0BAA0B,EAAER,OAAO,CAACC,MAAM,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,EAAE,EAAED,OAAO,CAACS,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACjG,OAAO;QACL,MAAMC,UAAU,GAAG;YACjBV,OAAO;SACR,AAAC;QACFW,IAAAA,kBAAuB,wBAAA,EAACT,YAAY,CAACI,IAAI,EAAEJ,YAAY,CAACU,OAAO,EAAGF,UAAU,CAAC,CAAC;IAChF,CAAC;AACH,CAAC"}
|
|
@@ -31,7 +31,7 @@ class FetchClient {
|
|
|
31
31
|
this.headers = {
|
|
32
32
|
accept: "application/json",
|
|
33
33
|
"content-type": "application/json",
|
|
34
|
-
"user-agent": `expo-cli/${"0.19.
|
|
34
|
+
"user-agent": `expo-cli/${"0.19.5"}`,
|
|
35
35
|
authorization: "Basic " + _nodeBuffer().Buffer.from(`${target}:`).toString("base64")
|
|
36
36
|
};
|
|
37
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/cli",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.5",
|
|
4
4
|
"description": "The Expo CLI",
|
|
5
5
|
"main": "build/bin/cli",
|
|
6
6
|
"bin": {
|
|
@@ -167,5 +167,5 @@
|
|
|
167
167
|
"tree-kill": "^1.2.2",
|
|
168
168
|
"tsd": "^0.28.1"
|
|
169
169
|
},
|
|
170
|
-
"gitHead": "
|
|
170
|
+
"gitHead": "8b9f5addf49cb5ef7598ca27ff60c0accff6a1c3"
|
|
171
171
|
}
|