Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react-native/ReactNativeApi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<d85687fceb0705d7e07b3a0b4529a17f>>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keen for us to validate this header, rather than delete it. We should prevent humans or agents from manually modifying this file. And it's an added level of intentionality — this file, and the API, isn't (quite) changed every day.

It's indeed a little inconvenient for merge conflicts, but agents are instructed to handle this (and in my use, do so transparently now).

- JavaScript sources are typed with Flow, and the public API is exported from `packages/react-native/index.js`. TypeScript types are generated from those sources, and `packages/react-native/ReactNativeApi.d.ts` is a committed snapshot of that API — run `yarn build-types` to regenerate both whenever the public API changes, then `yarn test-generated-typescript` to type-check the result.

* @generated
*
* This file was generated by scripts/js-api/build-types/index.js.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@
* @format
*/

const signedsource = require('signedsource');

function apiSnapshotTemplate(source: string): string {
return signedsource.signFile(
`/**
return `/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* ${signedsource.getSigningToken()}
* @generated
*
* This file was generated by scripts/js-api/build-types/index.js.
*/
Expand All @@ -36,8 +33,7 @@ function apiSnapshotTemplate(source: string): string {
/* eslint-disable redundant-undefined/redundant-undefined */

${source}
`,
);
`;
}

module.exports = apiSnapshotTemplate;
Loading