Skip to content

Commit

Permalink
[code-infra] Update package layout for better ESM support (#43264)
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Potoms <[email protected]>
Co-authored-by: Olivier Tassinari <[email protected]>
  • Loading branch information
Janpot and oliviertassinari authored Feb 5, 2025
1 parent d89d6b3 commit ec7db42
Show file tree
Hide file tree
Showing 108 changed files with 25,706 additions and 641 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ jobs:
git add -f packages/mui-material/build || echo '/material declarations do not exist'
git add -f packages/mui-lab/build || echo '/lab declarations do not exist'
git add -f packages/mui-utils/build || echo '/utils declarations do not exist'
pnpm -r build:types
pnpm -r build:stable && pnpm -r build:types
git --no-pager diff
- run:
name: Any defect declaration files?
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- run: pnpm install
- run: pnpm build:ci
env:
NODE_OPTIONS: --max_old_space_size=4096
NODE_OPTIONS: --max_old_space_size=6144
- run: pnpm release:changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions apps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

To test Pigment CSS demo apps, you can directly run -

`pnpm nx run @app/vite-app:preview` to start vite demo or `pnpm nx run @app/next-app:preview` to start nextjs demo after building automatically.
`pnpm nx run @app/pigment-css-vite-app:preview` to start vite demo or `pnpm nx run @app/pigment-css-next-app:preview` to start nextjs demo after building automatically.

To start either of the apps in dev mode, just run -

`pnpm nx run @app/vite-app:dev` or `pnpm nx run @app/next-app:dev`
`pnpm nx run @app/pigment-css-vite-app:dev` or `pnpm nx run @app/pigment-css-next-app:dev`
9 changes: 9 additions & 0 deletions apps/bare-next-app/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": ["plugin:react/jsx-runtime"],
"rules": {
"import/prefer-default-export": "off",
"import/extensions": "off",
"import/no-unresolved": "off",
"react/no-unknown-property": ["error", { "ignore": ["sx"] }],
},
}
35 changes: 35 additions & 0 deletions apps/bare-next-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
9 changes: 9 additions & 0 deletions apps/bare-next-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# bare next app

_date: 2025-02-04_

This is a copy of `apps/pigment-css-next-app` which currently suffers from heavy slow down in GitHub actions on MacOs for its `build` command. This copy removes Pigment CSS but keeps the rest of the app intact to serve as an integration test during `pnpm build:ci`.

Feel free to remove once the pigmenbt version works in predictable time again on MacOs GitHub actions.

See also [#43264](https://github.com/mui/material-ui/pull/43264)
13 changes: 13 additions & 0 deletions apps/bare-next-app/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/** @type {import('@pigment-css/nextjs-plugin').NextConfig} */
export default {
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
devIndicators: {
buildActivity: true,
buildActivityPosition: 'bottom-right',
},
};
42 changes: 42 additions & 0 deletions apps/bare-next-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "@app/next-app",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"preview": "next start",
"clean": "rimraf .next"
},
"dependencies": {
"@emotion/cache": "latest",
"@mui/base": "workspace:^",
"@mui/icons-material": "workspace:^",
"@mui/lab": "workspace:^",
"@mui/material": "workspace:^",
"@mui/material-nextjs": "workspace:^",
"@mui/material-pigment-css": "workspace:^",
"@mui/system": "workspace:^",
"@mui/utils": "workspace:^",
"next": "latest",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@pigment-css/nextjs-plugin": "0.0.30",
"@types/node": "^20.17.16",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"eslint": "^8.57.1",
"typescript": "^5.7.3"
},
"nx": {
"targets": {
"preview": {
"dependsOn": [
"^build"
]
}
}
}
}
1 change: 1 addition & 0 deletions apps/bare-next-app/public/next.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/bare-next-app/public/vercel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/bare-next-app/src/app/favicon.ico
Binary file not shown.
20 changes: 20 additions & 0 deletions apps/bare-next-app/src/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@layer reset, mui;

@layer reset {
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}

html,
body {
max-width: 100vw;
overflow-x: hidden;
}

a {
color: inherit;
text-decoration: none;
}
}
Loading

0 comments on commit ec7db42

Please sign in to comment.