@react-native/codegen 0.72.6 → 0.72.8

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.
@@ -14,6 +14,7 @@
14
14
  const combine = require('./combine-js-to-schema');
15
15
  const fs = require('fs');
16
16
  const glob = require('glob');
17
+ const path = require('path');
17
18
  const _require = require('./combine-utils'),
18
19
  parseArgs = _require.parseArgs,
19
20
  filterJSFile = _require.filterJSFile;
@@ -24,9 +25,14 @@ const _parseArgs = parseArgs(process.argv),
24
25
  const allFiles = [];
25
26
  fileList.forEach(file => {
26
27
  if (fs.lstatSync(file).isDirectory()) {
28
+ const filePattern = path.sep === '\\' ? file.replace(/\\/g, '/') : file;
27
29
  const dirFiles = glob
28
- .sync(`${file}/**/*.{js,ts,tsx}`, {
30
+ .sync(`${filePattern}/**/*.{js,ts,tsx}`, {
29
31
  nodir: true,
32
+ // TODO: This will remove the need of slash substitution above for Windows,
33
+ // but it requires glob@v9+; with the package currenlty relying on
34
+ // glob@7.1.1; and flow-typed repo not having definitions for glob@9+.
35
+ // windowsPathsNoEscape: true,
30
36
  })
31
37
  .filter(element => filterJSFile(element, platform));
32
38
  allFiles.push(...dirFiles);
@@ -14,6 +14,7 @@
14
14
  const combine = require('./combine-js-to-schema');
15
15
  const fs = require('fs');
16
16
  const glob = require('glob');
17
+ const path = require('path');
17
18
  const {parseArgs, filterJSFile} = require('./combine-utils');
18
19
 
19
20
  const {platform, outfile, fileList} = parseArgs(process.argv);
@@ -21,9 +22,14 @@ const {platform, outfile, fileList} = parseArgs(process.argv);
21
22
  const allFiles = [];
22
23
  fileList.forEach(file => {
23
24
  if (fs.lstatSync(file).isDirectory()) {
25
+ const filePattern = path.sep === '\\' ? file.replace(/\\/g, '/') : file;
24
26
  const dirFiles = glob
25
- .sync(`${file}/**/*.{js,ts,tsx}`, {
27
+ .sync(`${filePattern}/**/*.{js,ts,tsx}`, {
26
28
  nodir: true,
29
+ // TODO: This will remove the need of slash substitution above for Windows,
30
+ // but it requires glob@v9+; with the package currenlty relying on
31
+ // glob@7.1.1; and flow-typed repo not having definitions for glob@9+.
32
+ // windowsPathsNoEscape: true,
27
33
  })
28
34
  .filter(element => filterJSFile(element, platform));
29
35
  allFiles.push(...dirFiles);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native/codegen",
3
- "version": "0.72.6",
3
+ "version": "0.72.8",
4
4
  "description": "⚛️ Code generation tools for React Native",
5
5
  "homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/react-native-codegen",
6
6
  "repository": {
@@ -20,7 +20,10 @@
20
20
  "dependencies": {
21
21
  "@babel/parser": "^7.20.0",
22
22
  "flow-parser": "^0.206.0",
23
+ "glob": "^7.1.1",
24
+ "invariant": "^2.2.4",
23
25
  "jscodeshift": "^0.14.0",
26
+ "mkdirp": "^0.5.1",
24
27
  "nullthrows": "^1.1.1"
25
28
  },
26
29
  "devDependencies": {
@@ -35,10 +38,7 @@
35
38
  "@babel/plugin-transform-flow-strip-types": "^7.20.0",
36
39
  "@babel/preset-env": "^7.20.0",
37
40
  "chalk": "^4.0.0",
38
- "glob": "^7.1.1",
39
- "invariant": "^2.2.4",
40
41
  "micromatch": "^4.0.4",
41
- "mkdirp": "^0.5.1",
42
42
  "prettier": "^2.4.1",
43
43
  "rimraf": "^3.0.2"
44
44
  },