Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into nested-bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
apedroferreira committed Jun 6, 2023
2 parents fa46fa2 + 1c303ba commit 1599b63
Show file tree
Hide file tree
Showing 49 changed files with 1,667 additions and 945 deletions.
6 changes: 3 additions & 3 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"installCommand": "install",
"buildCommand": "release:build",
"node": "16.4",
"node": "16",
"packages": [
"packages/create-toolpad-app",
"packages/toolpad",
"packages/toolpad-app",
"packages/toolpad-components",
"packages/toolpad-core",
"packages/toolpad-utils"
]
],
"silent": true
}
20 changes: 0 additions & 20 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,25 +118,5 @@ module.exports = {
'import/no-cycle': ['error', { ignoreExternal: true }],
},
},
{
files: ['packages/toolpad-core/**/*', 'packages/toolpad-components/**/*'],
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
{
// Running into issues with @mui/icons-material not being an ESM package, while the
// toolpad-core package is. This makes Next.js try to load @mui/icons-material/* as ESM
// We'll just avoid importing icons in these packages
// Remove restriction after https://github.com/mui/material-ui/pull/30510 gets resolved
group: ['@mui/icons-material', '@mui/icons-material/*'],
message: "Don't use @mui/icons-material in these packages for now.",
},
],
},
],
},
},
],
};
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

- [ ] I've read and followed the [contributing guide](https://github.com/mui/mui-toolpad/blob/master/CONTRIBUTING.md#sending-a-pull-request) on how to create great pull requests.
- [ ] I've updated the relevant documentation for any new or updated feature
- [ ] I've linked relevant Github issue with "Closes #<issue id>"
- [ ] I've linked relevant GitHub issue with "Closes #<issue id>"
- [ ] I've added a visual demonstration under the form of a screenshot or video
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@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@0225834cc549ee0ca93cb085b92954821a145866 # v2.3.5
uses: github/codeql-action/init@83f0fe6c4988d98a455712a27f0255212bba9bd4 # v2.3.6
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@0225834cc549ee0ca93cb085b92954821a145866 # v2.3.5
uses: github/codeql-action/analyze@83f0fe6c4988d98a455712a27f0255212bba9bd4 # v2.3.6
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: Upload to code-scanning
uses: github/codeql-action/upload-sarif@0225834cc549ee0ca93cb085b92954821a145866 # v2.3.5
uses: github/codeql-action/upload-sarif@83f0fe6c4988d98a455712a27f0255212bba9bd4 # v2.3.6
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion docs/data/toolpad/building-ui/theming.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ In the theme options you can:

The theme used in a project is configured by an auto-generated `theme.yml` file inside the `toolpad` folder.

For a detailed look at the schema for this file and the different options it supports, please check out the [Schema Reference](/toolpad/schema-reference/#file-Theme) for theme files.
For a detailed look at the schema for this file and the different options it supports, please check out the [Schema Reference](/toolpad/reference/file-schema/#file-Theme) for theme files.
12 changes: 6 additions & 6 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@emotion/server": "11.11.0",
"@emotion/styled": "11.11.0",
"@mui/icons-material": "5.11.16",
"@mui/material": "5.13.3",
"@mui/material": "5.13.4",
"@mui/monorepo": "https://github.com/mui/material-ui.git",
"@mui/styles": "5.13.2",
"@mui/utils": "5.13.1",
Expand Down Expand Up @@ -59,19 +59,19 @@
"jss-rtl": "0.3.0",
"lodash": "4.17.21",
"lz-string": "1.5.0",
"markdown-to-jsx": "7.2.0",
"markdown-to-jsx": "7.2.1",
"marked": "4.3.0",
"next": "13.4.4",
"next-transpile-modules": "10.0.0",
"nprogress": "0.2.0",
"postcss": "8.4.23",
"postcss": "8.4.24",
"prismjs": "1.29.0",
"prop-types": "15.8.1",
"raw-loader": "4.0.2",
"react": "18.2.0",
"react-docgen": "5.4.3",
"react-dom": "18.2.0",
"react-hook-form": "7.44.1",
"react-hook-form": "7.44.3",
"react-is": "18.2.0",
"react-router": "6.4.4",
"react-router-dom": "6.4.4",
Expand All @@ -84,7 +84,7 @@
"stylis": "4.2.0",
"stylis-plugin-rtl": "npm:stylis-plugin-rtl@^2.1.1",
"stylis-plugin-rtl-sc": "npm:stylis-plugin-rtl@^2.1.1",
"webpack-bundle-analyzer": "4.8.0"
"webpack-bundle-analyzer": "4.9.0"
},
"devDependencies": {
"@babel/plugin-transform-react-constant-elements": "7.22.3",
Expand All @@ -95,7 +95,7 @@
"cpy-cli": "4.2.0",
"cross-fetch": "3.1.6",
"gm": "1.25.0",
"typescript": "5.0.4",
"typescript": "5.1.3",
"typescript-to-proptypes": "2.2.1"
}
}
2 changes: 1 addition & 1 deletion docs/pages/toolpad/reference/file-schema/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function Page(props: SchemaReferenceProps) {
return (
<SchemaReference
disableAd
location="/docs/pages/toolpad/schema-reference/index.tsx"
location="/docs/pages/toolpad/reference/file-schema/index.tsx"
{...props}
/>
);
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@
"@testing-library/react": "14.0.0",
"@types/archiver": "5.3.2",
"@types/gtag.js": "0.0.12",
"@types/jest": "29.5.1",
"@types/jest": "29.5.2",
"@types/node": "20.2.5",
"@types/react-inspector": "4.0.2",
"@types/rimraf": "3.0.2",
"@typescript-eslint/eslint-plugin": "5.59.7",
"@typescript-eslint/parser": "5.59.7",
"@typescript-eslint/eslint-plugin": "5.59.8",
"@typescript-eslint/parser": "5.59.8",
"babel-plugin-transform-rename-import": "2.3.0",
"chalk": "5.2.0",
"eslint": "8.41.0",
"eslint": "8.42.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-airbnb-typescript": "17.0.0",
"eslint-config-prettier": "8.8.0",
Expand All @@ -88,14 +88,14 @@
"regenerator-runtime": "0.13.11",
"rimraf": "5.0.1",
"ts-jest": "29.1.0",
"typescript": "5.0.4",
"typescript": "5.1.3",
"yarn-deduplicate": "6.0.2"
},
"dependencies": {
"archiver": "5.3.1",
"cross-env": "7.0.3",
"dotenv-cli": "7.2.1",
"inquirer": "9.2.6",
"inquirer": "9.2.7",
"lodash": "4.17.21",
"semver": "7.5.1",
"ts-node": "10.9.1",
Expand Down
3 changes: 2 additions & 1 deletion packages/create-toolpad-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"@mui/toolpad-utils": "0.1.14",
"chalk": "5.2.0",
"execa": "7.1.1",
"inquirer": "9.2.6"
"inquirer": "9.2.7",
"semver": "7.5.1"
},
"devDependencies": {
"@types/inquirer": "9.0.3"
Expand Down
129 changes: 129 additions & 0 deletions packages/create-toolpad-app/public/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
27 changes: 26 additions & 1 deletion packages/create-toolpad-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import inquirer from 'inquirer';
import chalk from 'chalk';
import { errorFrom } from '@mui/toolpad-utils/errors';
import { execaCommand } from 'execa';
import { satisfies } from 'semver';
import { readJsonFile } from './util';
import { PackageJson } from './packageType';

type PackageManager = 'npm' | 'pnpm' | 'yarn';
declare global {
Expand Down Expand Up @@ -109,7 +112,7 @@ const scaffoldProject = async (absolutePath: string, installFlag: boolean): Prom
// eslint-disable-next-line no-console
console.log();

const packageJson = {
const packageJson: PackageJson = {
name: path.basename(absolutePath),
version: '0.1.0',
private: true,
Expand All @@ -123,8 +126,18 @@ const scaffoldProject = async (absolutePath: string, installFlag: boolean): Prom
},
};

const DEFAULT_GENERATED_GITIGNORE_FILE = '.gitignore';
// eslint-disable-next-line no-console
console.log(`${chalk.blue('info')} - Initializing package.json file`);
await fs.writeFile(path.join(absolutePath, 'package.json'), JSON.stringify(packageJson, null, 2));

// eslint-disable-next-line no-console
console.log(`${chalk.blue('info')} - Initializing .gitignore file`);
await fs.copyFile(
path.resolve(__dirname, `./${DEFAULT_GENERATED_GITIGNORE_FILE}`),
path.join(absolutePath, DEFAULT_GENERATED_GITIGNORE_FILE),
);

if (installFlag) {
// eslint-disable-next-line no-console
console.log(
Expand All @@ -150,6 +163,18 @@ const scaffoldProject = async (absolutePath: string, installFlag: boolean): Prom

// Run the CLI interaction with Inquirer.js
const run = async () => {
const pj = await readJsonFile(path.resolve(__dirname, `../package.json`));
// check the node version before create
if (!satisfies(process.version, pj.engines?.node)) {
// eslint-disable-next-line no-console
console.log(
`${chalk.red('error')} - Your node version ${
process.version
} is unsupported. Please upgrade it to at least ${pj.engines?.node}`,
);
process.exit(1);
}

const args = await yargs(process.argv.slice(2))
.scriptName('create-toolpad-app')
.usage('$0 [path] [options]')
Expand Down
Loading

0 comments on commit 1599b63

Please sign in to comment.