Skip to content

Commit

Permalink
Merge branch 'master' into windows-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot authored Apr 15, 2024
2 parents 9867849 + 20bd8c3 commit b022252
Show file tree
Hide file tree
Showing 886 changed files with 12,593 additions and 155,104 deletions.
55 changes: 28 additions & 27 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
version: 2.1

defaults: &defaults
default-job: &default-job
working_directory: /tmp/mui-toolpad
resource_class: medium
docker:
- image: cimg/node:18.17.1
- image: cimg/node:18.19.1
environment:
# Keep in sync with "Save playwright cache"
PLAYWRIGHT_BROWSERS_PATH: /tmp/pw-browsers

default-context: &default-context
context:
- org-global

# CircleCI has disabled the cache across forks for security reasons.
# Following their official statement, it was a quick solution, they
# are working on providing this feature back with appropriate security measures.
Expand All @@ -20,14 +28,9 @@ commands:
browsers:
type: boolean
default: false
description: 'Set to true if you intend to use any browser (e.g. with playwright).'
description: 'Set to true if you intend to use any browser (for example with playwright).'

steps:
- restore_cache:
name: Restore pnpm Package Cache
keys:
- pnpm-packages-{{ checksum "pnpm-lock.yaml" }}

- when:
condition: << parameters.browsers >>
steps:
Expand Down Expand Up @@ -66,17 +69,7 @@ commands:
- run:
name: Install playwright browsers
command: pnpm playwright install --with-deps
environment:
PLAYWRIGHT_BROWSERS_PATH: /tmp/pw-browsers

- save_cache:
name: Save pnpm Package Cache
key: pnpm-packages-{{ checksum "pnpm-lock.yaml" }}
paths:
- node_modules
- when:
condition: << parameters.browsers >>
steps:
- save_cache:
name: Save playwright cache
key: v5-playwright-{{ arch }}-{{ checksum "/tmp/playwright_info.json" }}
Expand All @@ -87,7 +80,7 @@ commands:

jobs:
checkout:
<<: *defaults
<<: *default-job
steps:
- checkout
- install_js
Expand All @@ -97,15 +90,16 @@ jobs:
- run:
name: Check for duplicated packages
command: |
if [[ $(git diff --name-status master | grep pnpm.lock) == "" ]];
# #default-branch-switch
if [[ $(git diff --name-status master | grep -E 'pnpm-workspace\.yaml|pnpm-lock.yaml|package\.json') == "" ]];
then
echo "no changes to dependencies detected, skipping..."
else
pnpm dedupe --check
fi
test_lint:
<<: *defaults
<<: *default-job
steps:
- checkout
- install_js
Expand All @@ -119,15 +113,15 @@ jobs:
name: Lint Markdown
command: pnpm markdownlint
test_types:
<<: *defaults
<<: *default-job
steps:
- checkout
- install_js
- run:
name: Check Typescript types
command: pnpm check-types
test_static:
<<: *defaults
<<: *default-job
steps:
- checkout
- install_js
Expand All @@ -148,7 +142,7 @@ jobs:
pnpm check-changes
test_unit:
<<: *defaults
<<: *default-job

steps:
- checkout
Expand All @@ -162,14 +156,15 @@ jobs:
command: pnpm test

test_integration:
<<: *defaults
<<: *default-job
resource_class: 'large'
parallelism: 2
docker:
- image: mcr.microsoft.com/playwright:v1.41.2-focal
- image: mcr.microsoft.com/playwright:v1.43.1-focal
environment:
NODE_ENV: test
TOOLPAD_TEST_RETRIES: 1
EXPERIMENTAL_INLINE_CANVAS: 1

steps:
- checkout
Expand All @@ -193,19 +188,25 @@ jobs:
workflows:
pipeline:
jobs:
- checkout
- checkout:
<<: *default-context
- test_lint:
<<: *default-context
requires:
- checkout
- test_types:
<<: *default-context
requires:
- checkout
- test_static:
<<: *default-context
requires:
- checkout
- test_unit:
<<: *default-context
requires:
- checkout
- test_integration:
<<: *default-context
requires:
- checkout
5 changes: 3 additions & 2 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"node": "18",
"packages": [
"packages/create-toolpad-app",
"packages/toolpad-app",
"packages/toolpad-components",
"packages/toolpad-core",
"packages/toolpad-studio",
"packages/toolpad-studio-components",
"packages/toolpad-studio-runtime",
"packages/toolpad-utils"
],
"silent": true
Expand Down
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pnpm-lock.yaml
/docs/export
/docs/schemas
/packages/**/dist
/packages/toolpad-app/.next
/packages/toolpad-app/public
/packages/toolpad-studio/.next
/packages/toolpad-studio/public

/examples/*/toolpad.yml

Expand Down
31 changes: 16 additions & 15 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ module.exports = {
'error',
{
// https://github.com/import-js/eslint-plugin-import/issues/1739
ignore: ['\\.md\\?@mui/markdown$'],
ignore: ['\\.md\\?muiMarkdown$'],
},
],
'import/no-restricted-paths': [
Expand All @@ -87,8 +87,8 @@ module.exports = {
zones: [
{
// Don't leak the internal runtime abstraction. It's on its way to be moved towards a separate package
target: './packages/toolpad-app/src/runtime',
from: './packages/toolpad-app/src/',
target: './packages/toolpad-studio/src/runtime',
from: './packages/toolpad-studio/src/',
except: ['./runtime'],
},
],
Expand All @@ -110,11 +110,11 @@ module.exports = {
{
files: [
'packages/create-toolpad-app/**/*',
'packages/toolpad/**/*',
'packages/toolpad-app/**/*',
'packages/toolpad-utils/**/*',
'packages/toolpad-core/**/*',
'packages/toolpad-components/**/*',
'packages/toolpad-studio/**/*',
'packages/toolpad-studio-components/**/*',
'packages/toolpad-studio-runtime/**/*',
'packages/toolpad-utils/**/*',
],
excludedFiles: ['tsup.config.ts', '*.spec.ts', '*.spec.tsx', 'vitest.config.ts'],
rules: {
Expand All @@ -127,9 +127,9 @@ module.exports = {
* Basically all code that is guaranteed being bundled for the client side and never used on serverside code
* can be dev dependencies to reduce the size of the published package
*/
'packages/toolpad-app/src/components/**/*',
'packages/toolpad-app/src/toolpad/**/*',
'packages/toolpad-app/src/runtime/**/*',
'packages/toolpad-studio/src/components/**/*',
'packages/toolpad-studio/src/toolpad/**/*',
'packages/toolpad-studio/src/runtime/**/*',
],
excludedFiles: ['*.spec.ts', '*.spec.tsx'],
rules: {
Expand All @@ -140,18 +140,19 @@ module.exports = {
// Starting small, we will progressively expand this to more packages.
files: [
// 'packages/create-toolpad-app/**/*',
// 'packages/toolpad/**/*',
// 'packages/toolpad-app/**/*',
'packages/toolpad-utils/**/*',
// 'packages/toolpad-core/**/*',
// 'packages/toolpad-components/**/*',
// 'packages/toolpad-studio/**/*',
// 'packages/toolpad-studio/**/*',
'packages/toolpad-utils/**/*',
// 'packages/toolpad-studio-runtime/**/*',
// 'packages/toolpad-studio-components/**/*',
],
rules: {
'@typescript-eslint/no-explicit-any': ['error'],
},
},
{
files: ['packages/toolpad-app/pages/**/*'],
files: ['packages/toolpad-studio/pages/**/*'],
rules: {
// The pattern is useful to type Next.js pages
'react/function-component-definition': 'off',
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/1.bug.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Bug report 🐛
description: Create a bug report for MUI Toolpad.
description: Create a bug report for Toolpad.
labels: ['status: waiting for maintainer']
body:
- type: markdown
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/2.feature.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Feature request 💄
description: Suggest a new idea for MUI Toolpad.
description: Suggest a new idea for Toolpad.
labels: ['status: waiting for maintainer']
body:
- type: markdown
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/4.docs-feedback.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Docs feedback
description: Improve documentation about MUI Toolpad.
description: Improve documentation about Toolpad.
labels: ['status: waiting for maintainer', 'support: docs-feedback']
title: '[docs] '
body:
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
contact_links:
- name: Support ❔
url: https://mui.com/getting-started/support/
about: I need support with MUI Toolpad.
url: https://mui.com/toolpad/studio/getting-started/support/
about: I need support with Toolpad.
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@379614612a29c9e28f31f39a59013eb8012a51f0 # v3.24.3
uses: github/codeql-action/init@4355270be187e1b672a7a1c7c7bae5afdc1ab94a # v3.24.10
with:
languages: typescript
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -29,4 +29,4 @@ jobs:
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@379614612a29c9e28f31f39a59013eb8012a51f0 # v3.24.3
uses: github/codeql-action/analyze@4355270be187e1b672a7a1c7c7bae5afdc1ab94a # v3.24.10
2 changes: 1 addition & 1 deletion .github/workflows/maintenance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
steps:
- run: echo "${{ github.actor }}"
- name: check if prs are dirty
uses: eps1lon/actions-label-merge-conflict@fd1f295ee7443d13745804bc49fe158e240f6c6e # v2.1.0
uses: eps1lon/actions-label-merge-conflict@e62d7a53ff8be8b97684bffb6cfbbf3fc1115e2e # v3.0.0
with:
dirtyLabel: 'PR: out-of-date'
removeOnDirtyLabel: 'PR: ready to ship'
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/no-response.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ on:
issue_comment:
types: [created]
schedule:
# Schedule for five minutes after the hour, every hour
- cron: '5 * * * *'
# These runs in our repos are spread evenly throughout the day to avoid hitting rate limits.
# If you change this schedule, consider changing the remaining repositories as well.
# Runs at 6 am, 6 pm
- cron: '0 6,18 * * *'

permissions: {}

Expand All @@ -20,7 +22,7 @@ jobs:
contents: read
issues: write
steps:
- uses: MBilalShafi/no-response-add-label@629add01d7b6f8e120811f978c42703736098947
- uses: MBilalShafi/no-response-add-label@8336c12292902f27b931154c34ba4670cb9899a2
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Number of days of inactivity before an Issue is closed for lack of response
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: Upload to code-scanning
uses: github/codeql-action/upload-sarif@379614612a29c9e28f31f39a59013eb8012a51f0 # v3.24.3
uses: github/codeql-action/upload-sarif@4355270be187e1b672a7a1c7c7bae5afdc1ab94a # v3.24.10
with:
sarif_file: results.sarif
23 changes: 23 additions & 0 deletions .github/workflows/vale-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Vale action

on: [pull_request]

permissions: {}

jobs:
vale:
name: runner / vale
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: errata-ai/vale-action@38bf078c328061f59879b347ca344a718a736018 # v2.1.0
with:
reporter: github-pr-review
files: docs/data
env:
# Required, set by GitHub actions automatically:
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
15 changes: 10 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ node_modules
out/

# production
/build
build

# typescript
tsconfig.tsbuildinfo
*.tsbuildinfo

# misc
.DS_Store
Expand Down Expand Up @@ -49,9 +49,9 @@ lerna-debug.log

dist/

packages/toolpad-app/public/web_modules
packages/toolpad-app/public/runtime
packages/toolpad-app/public/typings.json
packages/toolpad-studio/public/web_modules
packages/toolpad-studio/public/runtime
packages/toolpad-studio/public/typings.json
examples/*/yarn.lock

test-results
Expand All @@ -60,3 +60,8 @@ test-results
.yarn-playwright-cache

/test/regressions/screenshots/**

# vale downloaded config
.github/styles/Google
.github/styles/MUI
.github/styles/.vale-config
Loading

0 comments on commit b022252

Please sign in to comment.