Skip to content

Commit

Permalink
Move // @flow to before license header (cruise-automation#3)
Browse files Browse the repository at this point in the history
Babel seems to not strip out Flow types (specifically generics) properly otherwise!
  • Loading branch information
janpaul123 authored Dec 12, 2018
1 parent 4f3e2b7 commit 8f13ccf
Show file tree
Hide file tree
Showing 38 changed files with 76 additions and 42 deletions.
3 changes: 2 additions & 1 deletion docs/src/jsx/Switch.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
import * as React from 'react';
import styled from 'styled-components';

Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/Worldview.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
import * as React from 'react';
import mapValues from 'lodash/mapValues';
import pickBy from 'lodash/pickBy';
Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/WorldviewContext.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
import createREGL from 'regl';
import debounce from 'lodash/debounce';
import Command from './commands/Command';
Expand Down
4 changes: 2 additions & 2 deletions packages/regl-worldview/src/WorldviewReactContext.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow

import React from 'react';
import { type WorldviewContextType } from './WorldviewContext';

Expand Down
4 changes: 2 additions & 2 deletions packages/regl-worldview/src/camera/CameraListener.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow

import * as React from 'react';
import normalizeWheel from 'normalize-wheel';

Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/camera/CameraStore.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
import { vec3, quat } from 'gl-matrix';
import isEqual from 'lodash/isEqual';
import selectors from './cameraStateSelectors';
Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/camera/CameraStore.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
import { vec3, quat } from 'gl-matrix';
import CameraStore, { selectors } from './CameraStore';

Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/camera/camera.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
import { mat4 } from 'gl-matrix';
import project from './cameraProject';

Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/camera/cameraProject.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
// Copied from Jam3/camera-project
// in order to replace gl-vec4 dependency with gl-matrix

Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/camera/cameraProject.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
// Copied from Jam3/camera-project
// in order to replace gl-vec4 dependency with gl-matrix
import { vec3, mat4 } from 'gl-matrix';
Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/camera/cameraStateSelectors.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
import { createSelector } from 'reselect';
import { vec3, quat, mat4 } from 'gl-matrix';
import { fromSpherical } from '../utils/commandUtils';
Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/camera/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
export { default as camera } from './camera';
export { default as CameraListener } from './CameraListener';
export { default as cameraProject } from './cameraProject';
Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/commands/Arrows.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
import * as React from 'react';
import { vec3, quat } from 'gl-matrix';

Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/commands/Axes.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
import React from 'react';
import Lines from './Lines';
import type { Pose, Color, Scale, Point, Vec3 } from '../types';
Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/commands/Cones.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
import { SimpleCommand, makeCommand } from './Command';
import fromGeometry from '../utils/fromGeometry';
import type { BaseShape } from '../types';
Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/commands/Cubes.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
import { SimpleCommand, makeCommand } from './Command';
import type { Cube } from '../types';
import fromGeometry from '../utils/fromGeometry';
Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/commands/Cylinders.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
import { SimpleCommand, makeCommand } from './Command';
import fromGeometry from '../utils/fromGeometry';
import type { Cylinder } from '../types';
Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/commands/FilledPolygons.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
import React from 'react';
import earcut from 'earcut';
import type { Vec3, Point, PolygonType, TriangleList } from '../types';
Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/commands/Grid.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
import Command from './Command';
import { withPose } from '../utils/commandUtils';

Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/commands/Lines.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
import { SimpleCommand, makeCommand } from './Command';
import { blend, withPose, toRGBA, shouldConvert, pointToVec3 } from '../utils/commandUtils';
import type { Line } from '../types';
Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/commands/Overlay.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
import * as React from 'react';
import WorldviewReactContext from '../WorldviewReactContext';
import { type WorldviewContextType } from '../WorldviewContext';
Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/commands/Points.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
import { SimpleCommand, makeCommand } from './Command';
import { withPose, pointToVec3, getVertexColors } from '../utils/commandUtils';
import type { PointType, Regl } from '../types';
Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/commands/Spheres.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
import { SimpleCommand, makeCommand } from './Command';
import fromGeometry from '../utils/fromGeometry';
import type { SphereList } from '../types';
Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/commands/Text.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
import React from 'react';
import styled from 'styled-components';
import WorldviewReactContext from '../WorldviewReactContext';
Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/commands/Triangles.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
import { SimpleCommand, makeCommand } from './Command';
import { blend, pointToVec3Array, withPose, getVertexColors, shouldConvert, toRGBA } from '../utils/commandUtils';
import type { TriangleList, Regl } from '../types';
Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/commands/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
export { default as Command, SimpleCommand, makeCommand } from './Command';

// Primitives
Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
import Worldview from './Worldview';
export { default as Bounds } from './utils/Bounds';
export { selectors as cameraStateSelectors, CameraStore, DEFAULT_CAMERA_STATE } from './camera/index';
Expand Down
3 changes: 2 additions & 1 deletion packages/regl-worldview/src/stories/Text.stories.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow
import React from 'react';
import { storiesOf } from '@storybook/react';

Expand Down
4 changes: 2 additions & 2 deletions packages/regl-worldview/src/stories/cameraState.stories.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow

import * as React from 'react';
import { quat, vec3 } from 'gl-matrix';
import { storiesOf } from '@storybook/react';
Expand Down
4 changes: 2 additions & 2 deletions packages/regl-worldview/src/stories/hitmap.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// @flow

// Copyright (c) 2018-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.

// @flow

import React from 'react';
import styled from 'styled-components';

Expand Down
Loading

0 comments on commit 8f13ccf

Please sign in to comment.