mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-29 05:34:21 +08:00
This generates project settings for DevTools-on-DevTools, using a v5 UUID with a pre-defined namespace, to ensure that builds remain deterministic. Fixed: 399502654 Bug: 395562934, 395037775 Change-Id: Ifa7c217eb9e5d0558b99c0e46085330bad9f8888 Doc: https://goo.gle/devtools-json-design Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6304926 Reviewed-by: Simon Zünd <szuend@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Commit-Queue: Simon Zünd <szuend@chromium.org> Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
28 lines
783 B
JavaScript
28 lines
783 B
JavaScript
// Copyright 2025 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
const path = require('path');
|
|
const {v5} = require('uuid');
|
|
|
|
const {writeIfChanged} = require('./ninja/write-if-changed.js');
|
|
|
|
const [, , outputLocation] = process.argv;
|
|
|
|
const root = path.join(path.dirname(path.dirname(__dirname)), 'front_end');
|
|
|
|
// We use a pre-generated v4 UUID for the namespace
|
|
const NAMESPACE = '2ba62548-f4e9-11ef-9cd2-0242ac120002';
|
|
|
|
// Generate a v5 UUID with the root path as name.
|
|
const uuid = v5(root, NAMESPACE);
|
|
|
|
// Construct and write the `devtools.json`.
|
|
const devtools = {
|
|
workspace: {
|
|
root,
|
|
uuid,
|
|
},
|
|
};
|
|
writeIfChanged(outputLocation, JSON.stringify(devtools, null, 2));
|