Skip to content

Commit 8e773b9

Browse files
jasonLasterdarkwing
authored andcommitted
[flow] add flow-typed libs + move to static immutable checks (firefox-devtools#6518)
1 parent 7a9a8b3 commit 8e773b9

File tree

158 files changed

+8760
-890
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+8760
-890
lines changed

.babel/transform-mc.js

+5-12
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ const VENDORS = [
2424
"devtools-splitter",
2525
"devtools-utils",
2626
"fuzzaldrin-plus",
27+
"lodash-move",
2728
"react-transition-group/Transition",
2829
"reselect",
2930
"Svg",
30-
"url",
31+
"url"
3132
];
3233

3334
/**
@@ -66,14 +67,9 @@ module.exports = function({ types: t }) {
6667
// -> require("devtools/client/shared/vendor/lodash").escapeRegExp
6768
if (value.startsWith("lodash/")) {
6869
const lodashSubModule = value.split("/").pop();
69-
path.replaceWith(
70-
t.stringLiteral(mappings.lodash)
71-
);
70+
path.replaceWith(t.stringLiteral(mappings.lodash));
7271
path.parentPath.replaceWith(
73-
t.memberExpression(
74-
path.parent,
75-
t.identifier(lodashSubModule)
76-
)
72+
t.memberExpression(path.parent, t.identifier(lodashSubModule))
7773
);
7874
return;
7975
}
@@ -97,10 +93,7 @@ module.exports = function({ types: t }) {
9793
// Append `.vendored["some-module"]` after the require().
9894
path.parentPath.replaceWith(
9995
t.memberExpression(
100-
t.memberExpression(
101-
path.parent,
102-
t.identifier("vendored")
103-
),
96+
t.memberExpression(path.parent, t.identifier("vendored")),
10497
t.stringLiteral(value),
10598
true
10699
)

.flowconfig

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
[ignore]
2-
.*node_modules/documentation.*
3-
.*node_modules/devtools-mc-assets/.*
4-
.*node_modules/immutable/dist/immutable.js.flow
5-
.*node_modules/reselect/lib/reselect.d.ts
6-
.*node_modules/stylelint.*
2+
.*node_modules/.*
73
<PROJECT_ROOT>/firefox/.*
84
.*mozilla-central/.*
95
.*flow-coverage-report/.*
106
.*custom_format_broken.json
7+
.*packages/devtools-reps/src/object-inspector/.*
118
<PROJECT_ROOT>/webpack-stats/.*
129

10+
[include]
11+
./node_modules/source-map/source-map.js
12+
1313
[libs]
1414
./src/global-types.js
1515

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
4+
5+
declare module "devtools-contextmenu" {
6+
declare module.exports: any;
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
4+
5+
declare module "devtools-modules" {
6+
declare module.exports: any;
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
4+
5+
declare module "@babel/generator" {
6+
declare module.exports: any;
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// flow-typed signature: 50d0b93478f122b130040c04d56690fe
2+
// flow-typed version: <<STUB>>/@babel/plugin-proposal-object-rest-spread_v^7.0.0-beta.46/flow_v0.74.0
3+
4+
/**
5+
* This is an autogenerated libdef stub for:
6+
*
7+
* '@babel/plugin-proposal-object-rest-spread'
8+
*
9+
* Fill this stub out by replacing all the `any` types.
10+
*
11+
* Once filled out, we encourage you to share your work with the
12+
* community by sending a pull request to:
13+
* https://github.com/flowtype/flow-typed
14+
*/
15+
16+
declare module '@babel/plugin-proposal-object-rest-spread' {
17+
declare module.exports: any;
18+
}
19+
20+
/**
21+
* We include stubs for each file inside this npm package in case you need to
22+
* require those files directly. Feel free to delete any files that aren't
23+
* needed.
24+
*/
25+
declare module '@babel/plugin-proposal-object-rest-spread/lib/index' {
26+
declare module.exports: any;
27+
}
28+
29+
// Filename aliases
30+
declare module '@babel/plugin-proposal-object-rest-spread/lib/index.js' {
31+
declare module.exports: $Exports<'@babel/plugin-proposal-object-rest-spread/lib/index'>;
32+
}

flow-typed/npm/@babel/types.vx.x.x.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
4+
5+
declare module "@babel/types" {
6+
declare module.exports: any;
7+
}

flow-typed/npm/babel-eslint_vx.x.x.js

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
// flow-typed signature: 28c2a7b2278f5607aaa32bef5f3c8e92
2+
// flow-typed version: <<STUB>>/babel-eslint_v^8.2.1/flow_v0.74.0
3+
4+
/**
5+
* This is an autogenerated libdef stub for:
6+
*
7+
* 'babel-eslint'
8+
*
9+
* Fill this stub out by replacing all the `any` types.
10+
*
11+
* Once filled out, we encourage you to share your work with the
12+
* community by sending a pull request to:
13+
* https://github.com/flowtype/flow-typed
14+
*/
15+
16+
declare module 'babel-eslint' {
17+
declare module.exports: any;
18+
}
19+
20+
/**
21+
* We include stubs for each file inside this npm package in case you need to
22+
* require those files directly. Feel free to delete any files that aren't
23+
* needed.
24+
*/
25+
declare module 'babel-eslint/lib/analyze-scope' {
26+
declare module.exports: any;
27+
}
28+
29+
declare module 'babel-eslint/lib/babylon-to-espree/attachComments' {
30+
declare module.exports: any;
31+
}
32+
33+
declare module 'babel-eslint/lib/babylon-to-espree/convertComments' {
34+
declare module.exports: any;
35+
}
36+
37+
declare module 'babel-eslint/lib/babylon-to-espree/convertTemplateType' {
38+
declare module.exports: any;
39+
}
40+
41+
declare module 'babel-eslint/lib/babylon-to-espree/index' {
42+
declare module.exports: any;
43+
}
44+
45+
declare module 'babel-eslint/lib/babylon-to-espree/toAST' {
46+
declare module.exports: any;
47+
}
48+
49+
declare module 'babel-eslint/lib/babylon-to-espree/toToken' {
50+
declare module.exports: any;
51+
}
52+
53+
declare module 'babel-eslint/lib/babylon-to-espree/toTokens' {
54+
declare module.exports: any;
55+
}
56+
57+
declare module 'babel-eslint/lib/index' {
58+
declare module.exports: any;
59+
}
60+
61+
declare module 'babel-eslint/lib/parse-with-patch' {
62+
declare module.exports: any;
63+
}
64+
65+
declare module 'babel-eslint/lib/parse-with-scope' {
66+
declare module.exports: any;
67+
}
68+
69+
declare module 'babel-eslint/lib/parse' {
70+
declare module.exports: any;
71+
}
72+
73+
declare module 'babel-eslint/lib/patch-eslint-scope' {
74+
declare module.exports: any;
75+
}
76+
77+
declare module 'babel-eslint/lib/visitor-keys' {
78+
declare module.exports: any;
79+
}
80+
81+
// Filename aliases
82+
declare module 'babel-eslint/lib/analyze-scope.js' {
83+
declare module.exports: $Exports<'babel-eslint/lib/analyze-scope'>;
84+
}
85+
declare module 'babel-eslint/lib/babylon-to-espree/attachComments.js' {
86+
declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/attachComments'>;
87+
}
88+
declare module 'babel-eslint/lib/babylon-to-espree/convertComments.js' {
89+
declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/convertComments'>;
90+
}
91+
declare module 'babel-eslint/lib/babylon-to-espree/convertTemplateType.js' {
92+
declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/convertTemplateType'>;
93+
}
94+
declare module 'babel-eslint/lib/babylon-to-espree/index.js' {
95+
declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/index'>;
96+
}
97+
declare module 'babel-eslint/lib/babylon-to-espree/toAST.js' {
98+
declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/toAST'>;
99+
}
100+
declare module 'babel-eslint/lib/babylon-to-espree/toToken.js' {
101+
declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/toToken'>;
102+
}
103+
declare module 'babel-eslint/lib/babylon-to-espree/toTokens.js' {
104+
declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/toTokens'>;
105+
}
106+
declare module 'babel-eslint/lib/index.js' {
107+
declare module.exports: $Exports<'babel-eslint/lib/index'>;
108+
}
109+
declare module 'babel-eslint/lib/parse-with-patch.js' {
110+
declare module.exports: $Exports<'babel-eslint/lib/parse-with-patch'>;
111+
}
112+
declare module 'babel-eslint/lib/parse-with-scope.js' {
113+
declare module.exports: $Exports<'babel-eslint/lib/parse-with-scope'>;
114+
}
115+
declare module 'babel-eslint/lib/parse.js' {
116+
declare module.exports: $Exports<'babel-eslint/lib/parse'>;
117+
}
118+
declare module 'babel-eslint/lib/patch-eslint-scope.js' {
119+
declare module.exports: $Exports<'babel-eslint/lib/patch-eslint-scope'>;
120+
}
121+
declare module 'babel-eslint/lib/visitor-keys.js' {
122+
declare module.exports: $Exports<'babel-eslint/lib/visitor-keys'>;
123+
}

flow-typed/npm/babel-jest_vx.x.x.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// flow-typed signature: 160b36770abbe0b9068a9cafd67abda7
2+
// flow-typed version: <<STUB>>/babel-jest_v^22.4.3/flow_v0.74.0
3+
4+
/**
5+
* This is an autogenerated libdef stub for:
6+
*
7+
* 'babel-jest'
8+
*
9+
* Fill this stub out by replacing all the `any` types.
10+
*
11+
* Once filled out, we encourage you to share your work with the
12+
* community by sending a pull request to:
13+
* https://github.com/flowtype/flow-typed
14+
*/
15+
16+
declare module 'babel-jest' {
17+
declare module.exports: any;
18+
}
19+
20+
/**
21+
* We include stubs for each file inside this npm package in case you need to
22+
* require those files directly. Feel free to delete any files that aren't
23+
* needed.
24+
*/
25+
declare module 'babel-jest/build/index' {
26+
declare module.exports: any;
27+
}
28+
29+
// Filename aliases
30+
declare module 'babel-jest/build/index.js' {
31+
declare module.exports: $Exports<'babel-jest/build/index'>;
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// flow-typed signature: 1baa177a6c4eae594b60010d241ad23d
2+
// flow-typed version: <<STUB>>/babel-plugin-syntax-trailing-function-commas_v^6.22.0/flow_v0.74.0
3+
4+
/**
5+
* This is an autogenerated libdef stub for:
6+
*
7+
* 'babel-plugin-syntax-trailing-function-commas'
8+
*
9+
* Fill this stub out by replacing all the `any` types.
10+
*
11+
* Once filled out, we encourage you to share your work with the
12+
* community by sending a pull request to:
13+
* https://github.com/flowtype/flow-typed
14+
*/
15+
16+
declare module 'babel-plugin-syntax-trailing-function-commas' {
17+
declare module.exports: any;
18+
}
19+
20+
/**
21+
* We include stubs for each file inside this npm package in case you need to
22+
* require those files directly. Feel free to delete any files that aren't
23+
* needed.
24+
*/
25+
declare module 'babel-plugin-syntax-trailing-function-commas/lib/index' {
26+
declare module.exports: any;
27+
}
28+
29+
// Filename aliases
30+
declare module 'babel-plugin-syntax-trailing-function-commas/lib/index.js' {
31+
declare module.exports: $Exports<'babel-plugin-syntax-trailing-function-commas/lib/index'>;
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// flow-typed signature: 767a7d3bf2a66c090e5050cb6c19194d
2+
// flow-typed version: <<STUB>>/babel-plugin-transform-class-properties_v^6.24.1/flow_v0.74.0
3+
4+
/**
5+
* This is an autogenerated libdef stub for:
6+
*
7+
* 'babel-plugin-transform-class-properties'
8+
*
9+
* Fill this stub out by replacing all the `any` types.
10+
*
11+
* Once filled out, we encourage you to share your work with the
12+
* community by sending a pull request to:
13+
* https://github.com/flowtype/flow-typed
14+
*/
15+
16+
declare module 'babel-plugin-transform-class-properties' {
17+
declare module.exports: any;
18+
}
19+
20+
/**
21+
* We include stubs for each file inside this npm package in case you need to
22+
* require those files directly. Feel free to delete any files that aren't
23+
* needed.
24+
*/
25+
declare module 'babel-plugin-transform-class-properties/lib/index' {
26+
declare module.exports: any;
27+
}
28+
29+
// Filename aliases
30+
declare module 'babel-plugin-transform-class-properties/lib/index.js' {
31+
declare module.exports: $Exports<'babel-plugin-transform-class-properties/lib/index'>;
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// flow-typed signature: 7821899f0bd8a6e39338f44e881539e1
2+
// flow-typed version: <<STUB>>/babel-plugin-transform-es2015-modules-commonjs_v^6.26.0/flow_v0.74.0
3+
4+
/**
5+
* This is an autogenerated libdef stub for:
6+
*
7+
* 'babel-plugin-transform-es2015-modules-commonjs'
8+
*
9+
* Fill this stub out by replacing all the `any` types.
10+
*
11+
* Once filled out, we encourage you to share your work with the
12+
* community by sending a pull request to:
13+
* https://github.com/flowtype/flow-typed
14+
*/
15+
16+
declare module 'babel-plugin-transform-es2015-modules-commonjs' {
17+
declare module.exports: any;
18+
}
19+
20+
/**
21+
* We include stubs for each file inside this npm package in case you need to
22+
* require those files directly. Feel free to delete any files that aren't
23+
* needed.
24+
*/
25+
declare module 'babel-plugin-transform-es2015-modules-commonjs/lib/index' {
26+
declare module.exports: any;
27+
}
28+
29+
// Filename aliases
30+
declare module 'babel-plugin-transform-es2015-modules-commonjs/lib/index.js' {
31+
declare module.exports: $Exports<'babel-plugin-transform-es2015-modules-commonjs/lib/index'>;
32+
}

0 commit comments

Comments
 (0)