Skip to content

Commit d82f255

Browse files
voideanvaluefacebook-github-bot
authored andcommitted
Replace @provides with @providesModule
Reviewed By: davidaurelio Differential Revision: D4494624 fbshipit-source-id: 192cc77126a99b3a3baeb806ed605c2194c4713a
1 parent 0ed31eb commit d82f255

File tree

11 files changed

+15
-42
lines changed

11 files changed

+15
-42
lines changed

Examples/UIExplorer/js/ListViewPagingExample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1919
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2020
*
21-
* @provides ListViewPagingExample
21+
* @providesModule ListViewPagingExample
2222
* @flow
2323
*/
2424
'use strict';

packager/src/Resolver/polyfills/Array.es6.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree. An additional grant
77
* of patent rights can be found in the PATENTS file in the same directory.
88
*
9-
* @provides Array.es6
9+
* @providesModule Array.es6
1010
* @polyfill
1111
*/
1212

packager/src/Resolver/polyfills/Array.prototype.es6.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree. An additional grant
77
* of patent rights can be found in the PATENTS file in the same directory.
88
*
9-
* @provides Array.prototype.es6
9+
* @providesModule Array.prototype.es6
1010
* @polyfill
1111
*/
1212

packager/src/Resolver/polyfills/Number.es6.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree. An additional grant
77
* of patent rights can be found in the PATENTS file in the same directory.
88
*
9-
* @provides Number.es6
9+
* @providesModule Number.es6
1010
* @polyfill
1111
*/
1212

packager/src/Resolver/polyfills/Object.es7.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree. An additional grant
77
* of patent rights can be found in the PATENTS file in the same directory.
88
*
9-
* @provides Object.es7
9+
* @providesModule Object.es7
1010
* @polyfill
1111
*/
1212

packager/src/Resolver/polyfills/String.prototype.es6.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree. An additional grant
77
* of patent rights can be found in the PATENTS file in the same directory.
88
*
9-
* @provides String.prototype.es6
9+
* @providesModule String.prototype.es6
1010
* @polyfill
1111
*/
1212

packager/src/Resolver/polyfills/console.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree. An additional grant
77
* of patent rights can be found in the PATENTS file in the same directory.
88
*
9-
* @provides console
9+
* @providesModule console
1010
* @polyfill
1111
* @nolint
1212
*/

packager/src/Resolver/polyfills/polyfills.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree. An additional grant
77
* of patent rights can be found in the PATENTS file in the same directory.
88
*
9-
* @provides Object.es6
9+
* @providesModule Object.es6
1010
* @polyfill
1111
*/
1212

packager/src/node-haste/Module.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,11 @@ class Module {
184184
// modules, such as react-haste, fbjs-haste, or react-native or with non-dependency,
185185
// project-specific code that is using @providesModule.
186186
const moduleDocBlock = docblock.parseAsObject(docBlock);
187-
const provides = moduleDocBlock.providesModule || moduleDocBlock.provides;
187+
const providesModule = moduleDocBlock.providesModule;
188188

189-
const id = provides && !this._depGraphHelpers.isNodeModulesDir(this.path)
190-
? /^\S+/.exec(provides)[0]
189+
const id =
190+
providesModule && !this._depGraphHelpers.isNodeModulesDir(this.path)
191+
? /^\S+/.exec(providesModule)[0]
191192
: undefined;
192193
return {id, moduleDocBlock};
193194
}

packager/src/node-haste/__tests__/Module-test.js

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -125,34 +125,6 @@ describe('Module', () => {
125125
});
126126
});
127127

128-
describe('@provides annotations', () => {
129-
beforeEach(() => {
130-
mockIndexFile(source.replace(/@providesModule/, '@provides'));
131-
});
132-
133-
it('extracts the module name from the header if it has a @provides annotation', () =>
134-
module.getName().then(name => expect(name).toEqual(moduleId))
135-
);
136-
137-
it('identifies the module as haste module', () =>
138-
module.isHaste().then(isHaste => expect(isHaste).toBe(true))
139-
);
140-
141-
it('does not transform the file in order to access the name', () => {
142-
const transformCode =
143-
jest.genMockFn().mockReturnValue(Promise.resolve());
144-
return createModule({transformCode}).getName()
145-
.then(() => expect(transformCode).not.toBeCalled());
146-
});
147-
148-
it('does not transform the file in order to access the haste status', () => {
149-
const transformCode =
150-
jest.genMockFn().mockReturnValue(Promise.resolve());
151-
return createModule({transformCode}).isHaste()
152-
.then(() => expect(transformCode).not.toBeCalled());
153-
});
154-
});
155-
156128
describe('no annotation', () => {
157129
beforeEach(() => {
158130
mockIndexFile('arbitrary(code);');

0 commit comments

Comments
 (0)