| 1 | /** |
| 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | * |
| 4 | * This source code is licensed under the MIT license found in the |
| 5 | * LICENSE file in the root directory of this source tree. |
| 6 | */ |
| 7 | |
| 8 | import path from 'path'; |
| 9 | |
| 10 | export const PROJECT_ROOT = path.join(process.cwd(), '..', '..'); |
| 11 | |
| 12 | // We assume this is run from `babel-plugin-react-compiler` |
| 13 | export const BABEL_PLUGIN_ROOT = path.normalize( |
| 14 | path.join(PROJECT_ROOT, 'packages', 'babel-plugin-react-compiler'), |
| 15 | ); |
| 16 | |
| 17 | export const BABEL_PLUGIN_SRC = path.normalize( |
| 18 | path.join(BABEL_PLUGIN_ROOT, 'dist', 'index.js'), |
| 19 | ); |
| 20 | export const PRINT_HIR_IMPORT = 'printFunctionWithOutlined'; |
| 21 | export const PRINT_REACTIVE_IR_IMPORT = 'printReactiveFunction'; |
| 22 | export const PARSE_CONFIG_PRAGMA_IMPORT = 'parseConfigPragmaForTests'; |
| 23 | export const FIXTURES_PATH = path.join( |
| 24 | BABEL_PLUGIN_ROOT, |
| 25 | 'src', |
| 26 | '__tests__', |
| 27 | 'fixtures', |
| 28 | 'compiler', |
| 29 | ); |
| 30 | export const SNAPSHOT_EXTENSION = '.expect.md'; |
| 31 | |
| 32 | export const BABEL_PLUGIN_RUST_ROOT = path.normalize( |
| 33 | path.join(PROJECT_ROOT, 'packages', 'babel-plugin-react-compiler-rust'), |
| 34 | ); |
| 35 | export const BABEL_PLUGIN_RUST_SRC = path.normalize( |
| 36 | path.join(BABEL_PLUGIN_RUST_ROOT, 'dist', 'index.js'), |
| 37 | ); |
| 38 | export const CRATES_PATH = path.normalize( |
| 39 | path.join(PROJECT_ROOT, '..', 'crates'), |
| 40 | ); |