flow-api-translator 0.37.0 → 0.327.0

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.
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.createTranslationContext = createTranslationContext;
7
-
8
7
  function createTranslationContext(code, scopeManager, {
9
8
  recoverFromErrors,
10
9
  mungeUnderscores = true
@@ -12,18 +11,15 @@ function createTranslationContext(code, scopeManager, {
12
11
  const referenceMap = new Map();
13
12
  const variableMap = new Map();
14
13
  const moduleScope = scopeManager.globalScope.childScopes[0];
15
-
16
14
  if (moduleScope == null || moduleScope.type !== 'module') {
17
15
  throw new Error('createTranslationContext: Module scope not found');
18
16
  }
19
-
20
17
  for (const variable of moduleScope.variables) {
21
18
  for (const reference of variable.references) {
22
19
  referenceMap.set(reference.identifier, variable);
23
20
  variableMap.set(variable.name, variable);
24
21
  }
25
22
  }
26
-
27
23
  return {
28
24
  scopeManager,
29
25
  referenceMap,
@@ -10,8 +10,8 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- import type {Identifier, JSXIdentifier} from 'hermes-estree';
14
- import type {ScopeManager, Variable} from 'hermes-eslint';
13
+ import type {Identifier, JSXIdentifier} from 'flow-estree';
14
+ import type {ScopeManager, Variable} from 'flow-eslint';
15
15
 
16
16
  export type Dep = string;
17
17
  export type TranslationOptions = {
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "flow-api-translator",
3
- "version": "0.37.0",
3
+ "version": "0.327.0",
4
4
  "description": "Toolkit for creating Flow and TypeScript compatible libraries from Flow source code.",
5
- "main": "dist/index.js",
5
+ "homepage": "https://flow.org",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/facebook/hermes.git",
10
- "directory": "tools/hermes-parser/js/flow-api-translator"
9
+ "url": "https://github.com/facebook/flow.git"
11
10
  },
11
+ "main": "dist/index.js",
12
12
  "dependencies": {
13
13
  "@babel/code-frame": "^7.16.0",
14
14
  "@typescript-eslint/parser": "8.38.0",
15
15
  "@typescript-eslint/visitor-keys": "8.38.0",
16
16
  "flow-enums-runtime": "^0.0.6",
17
- "hermes-eslint": "0.37.0",
18
- "hermes-estree": "0.37.0",
19
- "hermes-parser": "0.37.0",
20
- "hermes-transform": "0.37.0",
17
+ "flow-eslint": "0.327.0",
18
+ "flow-estree": "0.327.0",
19
+ "flow-parser": "0.327.0",
20
+ "flow-transform": "0.327.0",
21
21
  "typescript": "5.3.2"
22
22
  },
23
23
  "peerDependencies": {
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "files": [
27
27
  "dist",
28
- "LICENCE",
28
+ "LICENSE",
29
29
  "README.md"
30
30
  ]
31
31
  }