Skip to content

Commit

Permalink
Testing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
brijeshb42 committed Jul 9, 2024
1 parent 69aa126 commit da0ee4a
Show file tree
Hide file tree
Showing 22 changed files with 303 additions and 249 deletions.
6 changes: 0 additions & 6 deletions apps/local-ui-lib/.eslintrc

This file was deleted.

9 changes: 0 additions & 9 deletions apps/local-ui-lib/index.d.ts

This file was deleted.

30 changes: 0 additions & 30 deletions apps/local-ui-lib/index.js

This file was deleted.

8 changes: 0 additions & 8 deletions apps/local-ui-lib/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions apps/local-ui-lib/tsconfig.json

This file was deleted.

30 changes: 1 addition & 29 deletions apps/pigment-css-next-app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,44 +97,16 @@ theme.getColorSchemeSelector = (colorScheme) => {
};
theme.toRuntimeSource = stringifyTheme;

function innerNoop() {
return null;
}
function outerNoop() {
return innerNoop;
}

/**
* @type {PigmentOptions}
*/
const pigmentOptions = {
theme,
transformLibraries: ['local-ui-lib'],
sourceMap: true,
displayName: true,
overrideContext: (context) => {
if (!context.$RefreshSig$) {
context.$RefreshSig$ = outerNoop;
}
return {
...context,
require: (id) => {
if (id === '@mui/styled-engine' || id === '@mui/styled-engine-sc') {
return {
__esModule: true,
default: () => () => () => null,
internal_processStyles: () => {},
keyframes: () => '',
css: () => '',
};
}
return context.require(id);
},
};
},
};

/** @type {import('next').NextConfig} */
/** @type {import('@pigment-css/nextjs-plugin').NextConfig} */
const nextConfig = {
eslint: {
ignoreDuringBuilds: true,
Expand Down
5 changes: 2 additions & 3 deletions apps/pigment-css-next-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"clean": "rimraf .next"
},
"dependencies": {
"@pigment-css/react": "^0.0.16",
"@mui/material-pigment-css": "workspace:^",
"@mui/utils": "workspace:^",
"@mui/base": "workspace:^",
"@mui/icons-material": "workspace:^",
Expand All @@ -18,13 +18,12 @@
"@mui/material-nextjs": "workspace:^",
"@mui/system": "workspace:^",
"@emotion/cache": "latest",
"local-ui-lib": "workspace:^",
"next": "latest",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@pigment-css/nextjs-plugin": "^0.0.16",
"@pigment-css/nextjs-plugin": "https://pkg.csb.dev/mui/pigment-css/commit/747b907d/@pigment-css/nextjs-plugin",
"@types/node": "^20.5.7",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
Expand Down
4 changes: 1 addition & 3 deletions apps/pigment-css-vite-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"build": "vite build"
},
"dependencies": {
"@pigment-css/react": "^0.0.16",
"@mui/material-pigment-css": "workspace:^",
"@mui/utils": "workspace:^",
"@mui/base": "workspace:^",
Expand All @@ -18,7 +17,6 @@
"@mui/material": "workspace:^",
"@mui/system": "workspace:^",
"clsx": "^2.1.1",
"local-ui-lib": "workspace:^",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-error-boundary": "^4.0.13",
Expand All @@ -28,7 +26,7 @@
"devDependencies": {
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@pigment-css/vite-plugin": "^0.0.16",
"@pigment-css/vite-plugin": "https://pkg.csb.dev/mui/pigment-css/commit/747b907d/@pigment-css/vite-plugin",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
Expand Down
15 changes: 4 additions & 11 deletions apps/pigment-css-vite-app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig, splitVendorChunkPlugin } from 'vite';
import reactPlugin from '@vitejs/plugin-react';
import Pages from 'vite-plugin-pages';
import { pigment } from '@pigment-css/vite-plugin';
import { extendTheme } from '@mui/material/styles';
import { extendTheme, stringifyTheme } from '@mui/material/styles';

const theme = extendTheme({
getSelector: function getSelector(colorScheme, css) {
Expand All @@ -20,6 +20,8 @@ const theme = extendTheme({
theme.getColorSchemeSelector = (colorScheme) => {
return `@media (prefers-color-scheme: ${colorScheme})`;
};
// @ts-ignore
theme.toRuntimeSource = stringifyTheme;

export default defineConfig({
plugins: [
Expand All @@ -39,7 +41,7 @@ export default defineConfig({
}),
pigment({
theme,
transformLibraries: ['local-ui-lib', '@mui/material'],
transformLibraries: ['@mui/material'],
sourceMap: true,
displayName: true,
}),
Expand All @@ -52,15 +54,6 @@ export default defineConfig({
find: /^@mui\/icons-material\/(.*)/,
replacement: '@mui/icons-material/esm/$1',
},
{
find: /^@pigment-css\/react$/,
// There is a weird issue on the CI where Vite/Rollup isn't able to resolve
// the path for pigment-css/react in this monodrep. This is a temporary workaround. It does not
// affect local development or end-user projects.
replacement: path.resolve(
path.join(process.cwd(), 'node_modules/@pigment-css/react/build/index.mjs'),
),
},
],
},
});
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,11 @@
"@types/node": "^18.19.39",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"cross-fetch": "^4.0.0"
"cross-fetch": "^4.0.0",
"@pigment-css/react": "https://pkg.csb.dev/mui/pigment-css/commit/747b907d/@pigment-css/react",
"@pigment-css/unplugin": "https://pkg.csb.dev/mui/pigment-css/commit/747b907d/@pigment-css/unplugin",
"@pigment-css/nextjs-plugin": "https://pkg.csb.dev/mui/pigment-css/commit/747b907d/@pigment-css/nextjs-plugin",
"@pigment-css/vite-plugin": "https://pkg.csb.dev/mui/pigment-css/commit/747b907d/@pigment-css/vite-plugin"
},
"nyc": {
"include": [
Expand Down
4 changes: 4 additions & 0 deletions packages/mui-lab/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"@emotion/react": "^11.5.0",
"@emotion/styled": "^11.3.0",
"@mui/material": "workspace:^",
"@mui/material-pigment-css": "workspace:^",
"@types/react": "^17.0.0 || ^18.0.0",
"react": "^17.0.0 || ^18.0.0",
"react-dom": "^17.0.0 || ^18.0.0"
Expand All @@ -78,6 +79,9 @@
},
"@emotion/styled": {
"optional": true
},
"@mui/material-pigment-css": {
"optional": true
}
},
"sideEffects": false,
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-material-pigment-css/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Material Pigment CSS
# Material Pigment CSS

A wrapper over Pigment CSS that provides similar theming and styling APIs as @mui/system.
A wrapper over Pigment CSS that provides similar theming and styling APIs as @mui/system.
2 changes: 1 addition & 1 deletion packages/mui-material-pigment-css/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"typescript:module-augmentation": "node scripts/testModuleAugmentation.js"
},
"dependencies": {
"@pigment-css/react": "^0.0.16"
"@pigment-css/react": "https://pkg.csb.dev/mui/pigment-css/commit/747b907d/@pigment-css/react"
},
"sideEffects": false,
"publishConfig": {
Expand Down
3 changes: 3 additions & 0 deletions packages/mui-material-pigment-css/src/Box.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Box from '@pigment-css/react/Box';

export default Box;
4 changes: 3 additions & 1 deletion packages/mui-material-pigment-css/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"noEmit": false,
"emitDeclarationOnly": true,
"outDir": "build",
"rootDir": "./src"
"rootDir": "./src",
"moduleResolution": "NodeNext",
"module": "NodeNext"
},
"include": ["./src/**/*.ts*"],
"exclude": ["src/**/*.spec.ts*", "src/**/*.test.ts*"]
Expand Down
4 changes: 0 additions & 4 deletions packages/mui-material-pigment-css/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"moduleResolution": "NodeNext",
"module": "NodeNext"
},
"include": ["src/**/*", "test/**/*"]
}
4 changes: 2 additions & 2 deletions packages/mui-material/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"peerDependencies": {
"@emotion/react": "^11.5.0",
"@emotion/styled": "^11.3.0",
"@pigment-css/react": "^0.0.16",
"@mui/material-pigment-css": "workspace:^",
"@types/react": "^17.0.0 || ^18.0.0",
"react": "^17.0.0 || ^18.0.0",
"react-dom": "^17.0.0 || ^18.0.0"
Expand All @@ -93,7 +93,7 @@
"@emotion/styled": {
"optional": true
},
"@pigment-css/react": {
"@mui/material-pigment-css": {
"optional": true
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const PigmentContainer = React.forwardRef(function PigmentContainer(
disableGutters={disableGutters}
fixed={fixed}
maxWidth={maxWidth}
{...props}
{...(props as any)}
// @ts-ignore
ref={ref}
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/PigmentGrid/PigmentGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const PigmentGrid = React.forwardRef(function PigmentGrid(props, ref) {

const classes = useUtilityClasses(props);

return <Grid ref={ref} className={clsx(classes.root, className)} {...other} />;
return <Grid ref={ref} className={clsx(classes.root, className)} {...(other as any)} />;
}) as OverridableComponent<GridTypeMap>;

PigmentGrid.propTypes /* remove-proptypes */ = {
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/PigmentStack/PigmentStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const useUtilityClasses = () => {
*/
const PigmentStack = React.forwardRef(function PigmentStack({ className, ...props }, ref) {
const classes = useUtilityClasses();
return <Stack ref={ref} className={clsx(classes.root, className)} {...props} />;
return <Stack ref={ref} className={clsx(classes.root, className)} {...(props as any)} />;
}) as OverridableComponent<PigmentStackTypeMap>;

PigmentStack.propTypes /* remove-proptypes */ = {
Expand Down
4 changes: 3 additions & 1 deletion packages/mui-material/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"noEmit": false,
"emitDeclarationOnly": true,
"outDir": "build",
"rootDir": "./src"
"rootDir": "./src",
"moduleResolution": "Node16",
"module": "Node16"
},
"include": ["./src/**/*.ts*"],
"exclude": ["src/**/*.spec.ts*", "src/**/*.test.ts*"],
Expand Down
Loading

0 comments on commit da0ee4a

Please sign in to comment.