Skip to content

Commit a793b9b

Browse files
committed
Clean up builds for better support
1 parent d87a081 commit a793b9b

File tree

26 files changed

+90
-208
lines changed

26 files changed

+90
-208
lines changed

Diff for: .changeset/loose-carrots-marry.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
"@plexinc/react-native-lightning-components": minor
3+
"@plexinc/react-native-lightning-example": minor
4+
"@plexinc/react-lightning-components": minor
5+
"@plexinc/react-native-lightning": minor
6+
"@plexinc/react-lightning-plugin-css-transform": minor
7+
"@plexinc/react-lightning-example": minor
8+
"@plexinc/react-lightning-plugin-flexbox-lite": minor
9+
"@plexinc/react-lightning-plugin-reanimated": minor
10+
"@repo/typescript-config": minor
11+
"@plexinc/react-lightning": minor
12+
"@plexinc/react-lightning-plugin-flexbox": minor
13+
"@repo/rollup-config": minor
14+
"@plexinc/react-lightning-storybook": minor
15+
---
16+
17+
Clean up build configs for better support

Diff for: apps/react-lightning-example/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"extends": "@repo/typescript-config/react-library.json",
33
"compilerOptions": {
44
"outDir": "dist",
5-
"types": ["vite/client"]
5+
"types": ["node", "vite/client"]
66
},
77
"include": ["src"],
88
"exclude": ["node_modules", "dist"]

Diff for: apps/react-lightning-example/vite.config.mjs

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ const config = {
3434
force: true,
3535
},
3636
define: {
37-
__DEV__: JSON.stringify(process.env.NODE_ENV === 'development'),
37+
'process.env': JSON.stringify({
38+
NODE_ENV: process.env.NODE_ENV,
39+
}),
3840
},
3941
};
4042

Diff for: apps/react-native-lightning-example/vite.config.mjs

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const config = defineConfig({
2424
'process.env': JSON.stringify({
2525
NODE_ENV: process.env.NODE_ENV,
2626
}),
27-
__DEV__: JSON.stringify(process.env.NODE_ENV === 'development'),
2827
},
2928
});
3029

Diff for: apps/storybook/.storybook/main.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ const config: StorybookConfig = {
1515
options: {},
1616
},
1717
viteFinal(config) {
18-
config.define = {
19-
__DEV__: JSON.stringify(process.env.NODE_ENV === 'development'),
20-
};
18+
// config.define = {
19+
// 'process.env': JSON.stringify({
20+
// NODE_ENV: process.env.NODE_ENV,
21+
// }),
22+
// };
2123

2224
config.plugins = [
2325
reactNativeLightningPlugin(),

Diff for: apps/storybook/tsconfig.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
"extends": "@repo/typescript-config/react-library.json",
33
"compilerOptions": {
44
"outDir": "dist",
5-
"types": ["vite/client", "@plexinc/react-lightning-plugin-flexbox/jsx"]
5+
"types": [
6+
"node",
7+
"vite/client",
8+
"@plexinc/react-lightning-plugin-flexbox/jsx"
9+
]
610
},
711
"include": ["src"],
812
"exclude": ["node_modules", "dist"]

Diff for: package.json

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"@repo/typescript-config": "workspace:*",
3434
"@rollup/wasm-node": "4.34.8",
3535
"@swc/core": "1.10.17",
36+
"@types/node": "22.13.4",
3637
"del-cli": "6.0.0",
3738
"depcheck": "1.4.7",
3839
"glob": "11.0.1",

Diff for: packages/plugin-css-transform/rollup.config.mjs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
import createRollupConfig from '@repo/rollup-config';
22

3-
export default createRollupConfig({
4-
useClient: true,
5-
external: [],
6-
});
3+
export default createRollupConfig();

Diff for: packages/plugin-flexbox-lite/rollup.config.mjs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
import createRollupConfig from '@repo/rollup-config';
22

3-
export default createRollupConfig({
4-
useClient: true,
5-
});
3+
export default createRollupConfig();

Diff for: packages/plugin-flexbox/rollup.config.mjs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import createRollupConfig from '@repo/rollup-config';
22

33
export default createRollupConfig({
4-
useClient: true,
54
external: ['yoga-layout/load'],
65
});

Diff for: packages/plugin-reanimated/rollup.config.mjs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import createRollupConfig from '@repo/rollup-config';
22

33
export default createRollupConfig({
4-
useClient: true,
54
outputExports: 'named',
65
external: [
76
'react/jsx-runtime',

Diff for: packages/react-lightning-components/rollup.config.mjs

+2-18
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,10 @@ const configs = exportFiles.map((file) => {
88
const outputDir = dirname(file.replace('src/exports', ''));
99

1010
return createRollupConfig({
11-
useClient: true,
1211
input: file,
13-
output: [
14-
{
15-
dir: `./dist/esm${outputDir}`,
16-
entryFileNames: '[name].mjs',
17-
assetFileNames: ({ name }) => name?.replace(/^src\//, '') ?? '',
18-
format: 'esm',
19-
exports: 'auto',
20-
},
21-
{
22-
dir: `./dist/cjs${outputDir}`,
23-
entryFileNames: '[name].js',
24-
assetFileNames: ({ name }) => name?.replace(/^src\//, '') ?? '',
25-
format: 'cjs',
26-
exports: 'auto',
27-
},
28-
],
12+
outputDir: (format) => `./dist/${format}${outputDir}`,
2913
external: ['@plexinc/react-lightning', 'react', 'react/jsx-runtime'],
3014
});
3115
});
3216

33-
export default configs;
17+
export default configs.flat();

Diff for: packages/react-lightning-components/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"rootDir": "src",
55
"declaration": false,
66
"declarationMap": false,
7-
"types": ["@plexinc/react-lightning-plugin-flexbox/jsx"]
7+
"types": ["node", "@plexinc/react-lightning-plugin-flexbox/jsx"]
88
},
99
"include": ["src", "../../types/*.d.ts"],
1010
"exclude": ["node_modules", "dist"]

Diff for: packages/react-lightning/rollup.config.mjs

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import createRollupConfig from '@repo/rollup-config';
22

33
export default createRollupConfig({
4-
useClient: true,
5-
createDevBuilds: true,
64
external: [
75
'@lightningjs/renderer',
86
'@lightningjs/renderer/webgl',

Diff for: packages/react-lightning/src/element/LightningViewElement.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ export class LightningViewElement<
247247

248248
this.node = this._createNode(lngProps);
249249

250-
if (__DEV__) {
250+
if (process.env.NODE_ENV !== 'production') {
251251
this.node.__reactNode = this;
252252
this.node.__reactFiber = fiber;
253253
}

Diff for: packages/react-lightning/src/render/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export async function createRoot(
122122
target,
123123
);
124124

125-
if (__DEV__) {
125+
if (process.env.NODE_ENV !== 'production') {
126126
window.__LIGHTNINGJS_DEVTOOLS__ = {
127127
renderer,
128128
features: ['react-lightning'],

Diff for: packages/react-native-lightning-components/rollup.config.mjs

+2-18
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,8 @@ const configs = exportFiles.map((file) => {
88
const outputDir = dirname(file.replace('src/exports', ''));
99

1010
return createRollupConfig({
11-
useClient: true,
1211
input: file,
13-
output: [
14-
{
15-
dir: `./dist/esm${outputDir}`,
16-
entryFileNames: '[name].mjs',
17-
assetFileNames: ({ name }) => name?.replace(/^src\//, '') ?? '',
18-
format: 'esm',
19-
exports: 'auto',
20-
},
21-
{
22-
dir: `./dist/cjs${outputDir}`,
23-
entryFileNames: '[name].js',
24-
assetFileNames: ({ name }) => name?.replace(/^src\//, '') ?? '',
25-
format: 'cjs',
26-
exports: 'auto',
27-
},
28-
],
12+
outputDir: (format) => `./dist/${format}${outputDir}`,
2913
external: [
3014
'@plexinc/react-lightning',
3115
'@plexinc/react-native-lightning',
@@ -38,4 +22,4 @@ const configs = exportFiles.map((file) => {
3822
});
3923
});
4024

41-
export default configs;
25+
export default configs.flat();

Diff for: packages/react-native-lightning-components/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"rootDir": "src",
55
"declaration": false,
66
"declarationMap": false,
7-
"types": ["@plexinc/react-lightning-plugin-flexbox/jsx"]
7+
"types": ["node", "@plexinc/react-lightning-plugin-flexbox/jsx"]
88
},
99
"include": ["src", "../../types/*.d.ts"],
1010
"exclude": ["node_modules", "dist"]

Diff for: packages/react-native-lightning/rollup.config.mjs

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import createRollupConfig from '@repo/rollup-config';
22

33
export default createRollupConfig({
4-
useClient: true,
5-
createDevBuilds: true,
64
external: [
75
'react/jsx-runtime',
86
'react',
-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +0,0 @@
1-
declare module '*.png' {
2-
const path: string;
3-
export default path;
4-
}
5-
6-
type AddMissingProps<T, U> = Omit<U, keyof T> & T;

0 commit comments

Comments
 (0)