@react-native-community/cli-config 11.3.1 → 11.3.3
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/loadConfig.d.ts.map +1 -1
- package/build/loadConfig.js +22 -17
- package/build/loadConfig.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadConfig.d.ts","sourceRoot":"","sources":["../src/loadConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,MAAM,EACP,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"loadConfig.d.ts","sourceRoot":"","sources":["../src/loadConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,MAAM,EACP,MAAM,mCAAmC,CAAC;AAmE3C;;GAEG;AACH,iBAAS,UAAU,CAAC,WAAW,GAAE,MAA0B,GAAG,MAAM,CAiFnE;AAED,eAAe,UAAU,CAAC"}
|
package/build/loadConfig.js
CHANGED
|
@@ -38,6 +38,25 @@ function getDependencyConfig(root, dependencyName, finalConfig, config, userConf
|
|
|
38
38
|
}, userConfig.dependencies[dependencyName] || {});
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
// Try our best to figure out what version of React Native we're running. This is
|
|
42
|
+
// currently being used to get our deeplinks working, so it's only worried with
|
|
43
|
+
// the major and minor version.
|
|
44
|
+
function getReactNativeVersion(reactNativePath) {
|
|
45
|
+
try {
|
|
46
|
+
let semver = _cliTools().version.current(reactNativePath);
|
|
47
|
+
if (semver) {
|
|
48
|
+
// Retain only these version, since they correspond with our documentation.
|
|
49
|
+
return `${semver.major}.${semver.minor}`;
|
|
50
|
+
}
|
|
51
|
+
} catch (e) {
|
|
52
|
+
// If we don't seem to be in a well formed project, give up quietly.
|
|
53
|
+
if (!(e instanceof _cliTools().UnknownProjectError)) {
|
|
54
|
+
throw e;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return 'unknown';
|
|
58
|
+
}
|
|
59
|
+
|
|
41
60
|
/**
|
|
42
61
|
* Loads CLI configuration
|
|
43
62
|
*/
|
|
@@ -49,7 +68,9 @@ function loadConfig(projectRoot = (0, _cliTools().findProjectRoot)()) {
|
|
|
49
68
|
get reactNativePath() {
|
|
50
69
|
return userConfig.reactNativePath ? _path().default.resolve(projectRoot, userConfig.reactNativePath) : (0, _resolveReactNativePath.default)(projectRoot);
|
|
51
70
|
},
|
|
52
|
-
reactNativeVersion
|
|
71
|
+
get reactNativeVersion() {
|
|
72
|
+
return getReactNativeVersion(initialConfig.reactNativePath);
|
|
73
|
+
},
|
|
53
74
|
dependencies: userConfig.dependencies,
|
|
54
75
|
commands: userConfig.commands,
|
|
55
76
|
healthChecks: [],
|
|
@@ -68,22 +89,6 @@ function loadConfig(projectRoot = (0, _cliTools().findProjectRoot)()) {
|
|
|
68
89
|
return lazyProject;
|
|
69
90
|
}
|
|
70
91
|
};
|
|
71
|
-
|
|
72
|
-
// Try our best to figure out what version of React Native we're running. This is
|
|
73
|
-
// currently being used to get our deeplinks working, so it's only worried with
|
|
74
|
-
// the major and minor version.
|
|
75
|
-
try {
|
|
76
|
-
let semver = _cliTools().version.current(initialConfig.reactNativePath);
|
|
77
|
-
if (semver) {
|
|
78
|
-
// Retain only these version, since they correspond with our documentation.
|
|
79
|
-
initialConfig.reactNativeVersion = `${semver.major}.${semver.minor}`;
|
|
80
|
-
}
|
|
81
|
-
} catch (e) {
|
|
82
|
-
// If we don't seem to be in a well formed project, give up quietly.
|
|
83
|
-
if (!(e instanceof _cliTools().UnknownProjectError)) {
|
|
84
|
-
throw e;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
92
|
const finalConfig = Array.from(new Set([...Object.keys(userConfig.dependencies), ...(0, _findDependencies.default)(projectRoot)])).reduce((acc, dependencyName) => {
|
|
88
93
|
const localDependencyRoot = userConfig.dependencies[dependencyName] && userConfig.dependencies[dependencyName].root;
|
|
89
94
|
try {
|
package/build/loadConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getDependencyConfig","root","dependencyName","finalConfig","config","userConfig","isPlatform","merge","name","platforms","Object","keys","reduce","dependency","platform","platformConfig","dependencyConfig","dependencies","
|
|
1
|
+
{"version":3,"names":["getDependencyConfig","root","dependencyName","finalConfig","config","userConfig","isPlatform","merge","name","platforms","Object","keys","reduce","dependency","platform","platformConfig","dependencyConfig","dependencies","getReactNativeVersion","reactNativePath","semver","version","current","major","minor","e","UnknownProjectError","loadConfig","projectRoot","findProjectRoot","lazyProject","readConfigFromDisk","initialConfig","path","resolve","resolveReactNativePath","reactNativeVersion","commands","healthChecks","project","projectConfig","Array","from","Set","findDependencies","acc","localDependencyRoot","resolveNodeModuleDir","readDependencyConfigFromDisk","length","assign"],"sources":["../src/loadConfig.ts"],"sourcesContent":["import path from 'path';\nimport {\n UserDependencyConfig,\n ProjectConfig,\n DependencyConfig,\n UserConfig,\n Config,\n} from '@react-native-community/cli-types';\nimport {\n findProjectRoot,\n version,\n resolveNodeModuleDir,\n UnknownProjectError,\n} from '@react-native-community/cli-tools';\nimport findDependencies from './findDependencies';\nimport resolveReactNativePath from './resolveReactNativePath';\nimport {\n readConfigFromDisk,\n readDependencyConfigFromDisk,\n} from './readConfigFromDisk';\nimport assign from './assign';\nimport merge from './merge';\n\nfunction getDependencyConfig(\n root: string,\n dependencyName: string,\n finalConfig: Config,\n config: UserDependencyConfig,\n userConfig: UserConfig,\n isPlatform: boolean,\n): DependencyConfig {\n return merge(\n {\n root,\n name: dependencyName,\n platforms: Object.keys(finalConfig.platforms).reduce(\n (dependency, platform) => {\n const platformConfig = finalConfig.platforms[platform];\n dependency[platform] =\n // Linking platforms is not supported\n isPlatform || !platformConfig\n ? null\n : platformConfig.dependencyConfig(\n root,\n config.dependency.platforms[platform],\n );\n return dependency;\n },\n {} as Config['platforms'],\n ),\n },\n userConfig.dependencies[dependencyName] || {},\n ) as DependencyConfig;\n}\n\n// Try our best to figure out what version of React Native we're running. This is\n// currently being used to get our deeplinks working, so it's only worried with\n// the major and minor version.\nfunction getReactNativeVersion(reactNativePath: string) {\n try {\n let semver = version.current(reactNativePath);\n if (semver) {\n // Retain only these version, since they correspond with our documentation.\n return `${semver.major}.${semver.minor}`;\n }\n } catch (e) {\n // If we don't seem to be in a well formed project, give up quietly.\n if (!(e instanceof UnknownProjectError)) {\n throw e;\n }\n }\n return 'unknown';\n}\n\n/**\n * Loads CLI configuration\n */\nfunction loadConfig(projectRoot: string = findProjectRoot()): Config {\n let lazyProject: ProjectConfig;\n const userConfig = readConfigFromDisk(projectRoot);\n\n const initialConfig: Config = {\n root: projectRoot,\n get reactNativePath() {\n return userConfig.reactNativePath\n ? path.resolve(projectRoot, userConfig.reactNativePath)\n : resolveReactNativePath(projectRoot);\n },\n get reactNativeVersion() {\n return getReactNativeVersion(initialConfig.reactNativePath);\n },\n dependencies: userConfig.dependencies,\n commands: userConfig.commands,\n healthChecks: [],\n platforms: userConfig.platforms,\n get project() {\n if (lazyProject) {\n return lazyProject;\n }\n\n lazyProject = {};\n for (const platform in finalConfig.platforms) {\n const platformConfig = finalConfig.platforms[platform];\n if (platformConfig) {\n lazyProject[platform] = platformConfig.projectConfig(\n projectRoot,\n userConfig.project[platform] || {},\n );\n }\n }\n\n return lazyProject;\n },\n };\n\n const finalConfig = Array.from(\n new Set([\n ...Object.keys(userConfig.dependencies),\n ...findDependencies(projectRoot),\n ]),\n ).reduce((acc: Config, dependencyName) => {\n const localDependencyRoot =\n userConfig.dependencies[dependencyName] &&\n userConfig.dependencies[dependencyName].root;\n try {\n let root =\n localDependencyRoot ||\n resolveNodeModuleDir(projectRoot, dependencyName);\n let config = readDependencyConfigFromDisk(root, dependencyName);\n\n const isPlatform = Object.keys(config.platforms).length > 0;\n\n return assign({}, acc, {\n dependencies: assign({}, acc.dependencies, {\n get [dependencyName](): DependencyConfig {\n return getDependencyConfig(\n root,\n dependencyName,\n finalConfig,\n config,\n userConfig,\n isPlatform,\n );\n },\n }),\n commands: [...acc.commands, ...config.commands],\n platforms: {\n ...acc.platforms,\n ...config.platforms,\n },\n healthChecks: [...acc.healthChecks, ...config.healthChecks],\n }) as Config;\n } catch {\n return acc;\n }\n }, initialConfig);\n\n return finalConfig;\n}\n\nexport default loadConfig;\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAQA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAMA;AACA;AACA;AAIA;AACA;AAA4B;AAE5B,SAASA,mBAAmB,CAC1BC,IAAY,EACZC,cAAsB,EACtBC,WAAmB,EACnBC,MAA4B,EAC5BC,UAAsB,EACtBC,UAAmB,EACD;EAClB,OAAO,IAAAC,cAAK,EACV;IACEN,IAAI;IACJO,IAAI,EAAEN,cAAc;IACpBO,SAAS,EAAEC,MAAM,CAACC,IAAI,CAACR,WAAW,CAACM,SAAS,CAAC,CAACG,MAAM,CAClD,CAACC,UAAU,EAAEC,QAAQ,KAAK;MACxB,MAAMC,cAAc,GAAGZ,WAAW,CAACM,SAAS,CAACK,QAAQ,CAAC;MACtDD,UAAU,CAACC,QAAQ,CAAC;MAClB;MACAR,UAAU,IAAI,CAACS,cAAc,GACzB,IAAI,GACJA,cAAc,CAACC,gBAAgB,CAC7Bf,IAAI,EACJG,MAAM,CAACS,UAAU,CAACJ,SAAS,CAACK,QAAQ,CAAC,CACtC;MACP,OAAOD,UAAU;IACnB,CAAC,EACD,CAAC,CAAC;EAEN,CAAC,EACDR,UAAU,CAACY,YAAY,CAACf,cAAc,CAAC,IAAI,CAAC,CAAC,CAC9C;AACH;;AAEA;AACA;AACA;AACA,SAASgB,qBAAqB,CAACC,eAAuB,EAAE;EACtD,IAAI;IACF,IAAIC,MAAM,GAAGC,mBAAO,CAACC,OAAO,CAACH,eAAe,CAAC;IAC7C,IAAIC,MAAM,EAAE;MACV;MACA,OAAQ,GAAEA,MAAM,CAACG,KAAM,IAAGH,MAAM,CAACI,KAAM,EAAC;IAC1C;EACF,CAAC,CAAC,OAAOC,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CAAC,CAAC,MAAM;MACN,OAAOO,GAAG;IACZ;EACF,CAAC,EAAEb,aAAa,CAAC;EAEjB,OAAO7B,WAAW;AACpB;AAAC,eAEcwB,UAAU;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-community/cli-config",
|
|
3
|
-
"version": "11.3.
|
|
3
|
+
"version": "11.3.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"types": "build/index.d.ts",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@react-native-community/cli-tools": "11.3.
|
|
11
|
+
"@react-native-community/cli-tools": "11.3.3",
|
|
12
12
|
"chalk": "^4.1.2",
|
|
13
13
|
"cosmiconfig": "^5.1.0",
|
|
14
14
|
"deepmerge": "^4.3.0",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"!*.map"
|
|
22
22
|
],
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@react-native-community/cli-types": "11.3.
|
|
24
|
+
"@react-native-community/cli-types": "11.3.3",
|
|
25
25
|
"@types/cosmiconfig": "^5.0.3",
|
|
26
26
|
"@types/glob": "^7.1.1"
|
|
27
27
|
},
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"url": "https://github.com/react-native-community/cli.git",
|
|
32
32
|
"directory": "packages/cli-config"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "00f83bbc8983cf53783de724f2aba02d2643c0fd"
|
|
35
35
|
}
|