Skip to content
Merged
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 compiler/apps/playground/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
2 changes: 1 addition & 1 deletion compiler/apps/playground/playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default defineConfig({
// Test directory
testDir: path.join(__dirname, '__tests__/e2e'),
// If a test fails, retry it additional 2 times
retries: 2,
retries: 3,
// Artifacts folder where screenshots, videos, and traces are stored.
outputDir: 'test-results/',
// Note: we only use text snapshots, so its safe to omit the host environment name
Expand Down
1 change: 1 addition & 0 deletions compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"prettier-plugin-hermes-parser": "^0.26.0",
"prompt-promise": "^1.0.3",
"rimraf": "^5.0.10",
"tsup": "^8.4.0",
"typescript": "^5.4.3",
"wait-on": "^7.2.0",
"yargs": "^17.7.2"
Expand Down
4 changes: 2 additions & 2 deletions compiler/packages/babel-plugin-react-compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"!*.tsbuildinfo"
],
"scripts": {
"build": "rimraf dist && scripts/build.js",
"build": "rimraf dist && tsup",
"test": "./scripts/link-react-compiler-runtime.sh && yarn snap:ci",
"jest": "yarn build && ts-node node_modules/.bin/jest",
"snap": "node ../snap/dist/main.js",
"snap:build": "yarn workspace snap run build",
"snap:ci": "yarn snap:build && yarn snap",
"ts:analyze-trace": "scripts/ts-analyze-trace.sh",
"lint": "yarn eslint src",
"watch": "scripts/build.js --watch"
"watch": "yarn build --watch"
},
"dependencies": {
"@babel/types": "^7.19.0"
Expand Down
61 changes: 0 additions & 61 deletions compiler/packages/babel-plugin-react-compiler/scripts/build.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import {hasOwnProperty} from '../Utils/utils';
import {PluginOptions} from './Options';

function hasModule(name: string): boolean {
if (typeof require === 'undefined') {
return false;
}
try {
return !!require.resolve(name);
} catch (error: any) {
Expand Down
3 changes: 0 additions & 3 deletions compiler/packages/babel-plugin-react-compiler/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
"moduleResolution": "Bundler",
"rootDir": "src",
"outDir": "dist",
// https://github.com/microsoft/TypeScript/issues/30925
"tsBuildInfoFile": "dist/tsconfig.tsbuildinfo",
"jsx": "react-jsxdev",
// weaken strictness from preset
"importsNotUsedAsValues": "remove",
Expand All @@ -16,7 +14,6 @@
"target": "ES2015",
// ideally turn off only during dev, or on a per-file basis
"noUnusedLocals": false,
"composite": true,
"removeComments": true
},
"exclude": [
Expand Down
29 changes: 29 additions & 0 deletions compiler/packages/babel-plugin-react-compiler/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import {defineConfig} from 'tsup';

export default defineConfig({
entry: ['./src/index.ts'],
outDir: './dist',
external: ['@babel/types'],
splitting: false,
sourcemap: false,
dts: false,
bundle: true,
format: 'cjs',
platform: 'node',
banner: {
js: `/**
* 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.
*
* @lightSyntaxTransform
* @noflow
* @nolint
* @preventMunge
* @preserve-invariant-messages
*/

"use no memo";`,
},
});
6 changes: 3 additions & 3 deletions compiler/packages/eslint-plugin-react-compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"description": "ESLint plugin to display errors found by the React compiler.",
"main": "dist/index.js",
"scripts": {
"build": "rimraf dist && scripts/build.js",
"test": "tsc && jest",
"watch": "scripts/build.js --watch"
"build": "rimraf dist && tsup",
"test": "jest",
"watch": "yarn build --watch"
},
"files": [
"dist"
Expand Down
67 changes: 0 additions & 67 deletions compiler/packages/eslint-plugin-react-compiler/scripts/build.js

This file was deleted.

33 changes: 19 additions & 14 deletions compiler/packages/eslint-plugin-react-compiler/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,27 @@

import ReactCompilerRule from './rules/ReactCompilerRule';

module.exports = {
rules: {
'react-compiler': ReactCompilerRule,
},
configs: {
recommended: {
plugins: {
'react-compiler': {
rules: {
'react-compiler': ReactCompilerRule,
},
const meta = {
name: 'eslint-plugin-react-compiler',
};

const rules = {
'react-compiler': ReactCompilerRule,
};

const configs = {
recommended: {
plugins: {
'react-compiler': {
rules: {
'react-compiler': ReactCompilerRule,
},
},
rules: {
'react-compiler/react-compiler': 'error',
},
},
rules: {
'react-compiler/react-compiler': 'error',
},
},
};

export {configs, rules, meta};
3 changes: 0 additions & 3 deletions compiler/packages/eslint-plugin-react-compiler/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
"rootDir": "../",
"noEmit": true,
"jsx": "react-jsxdev",
"paths": {
"*": ["./src/types/*"]
},

// weaken strictness from preset
"importsNotUsedAsValues": "remove",
Expand Down
35 changes: 35 additions & 0 deletions compiler/packages/eslint-plugin-react-compiler/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import {defineConfig} from 'tsup';

export default defineConfig({
entry: ['./src/index.ts'],
outDir: './dist',
external: [
'@babel/core',
'@babel/plugin-proposal-private-methods',
'hermes-parser',
'zod',
'zod-validation-error',
],
splitting: false,
sourcemap: false,
dts: false,
bundle: true,
format: 'cjs',
platform: 'node',
banner: {
js: `/**
* 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.
*
* @lightSyntaxTransform
* @noflow
* @nolint
* @preventMunge
* @preserve-invariant-messages
*/

"use no memo";`,
},
});
4 changes: 2 additions & 2 deletions compiler/packages/make-read-only-util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"src"
],
"scripts": {
"build": "rimraf dist && scripts/build.js",
"build": "rimraf dist && tsup",
"test": "jest src",
"watch": "scripts/build.js --watch"
"watch": "yarn build --watch"
},
"dependencies": {
"invariant": "^2.2.4",
Expand Down
Loading
Loading