Skip to content

Commit

Permalink
chore(format): run prettier format (#8295)
Browse files Browse the repository at this point in the history
chore: run prettier format
  • Loading branch information
SoonIter authored Oct 31, 2024
1 parent 8b1eea6 commit ae45e1e
Show file tree
Hide file tree
Showing 20 changed files with 197 additions and 232 deletions.
80 changes: 40 additions & 40 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
// For format details, see https://aka.ms/devcontainer.json.
{
"name": "Rust",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"build": {
"dockerfile": "Dockerfile"
},
// Use 'mounts' to make the cargo cache persistent in a Docker Volume.
// "mounts": [
// {
// "source": "devcontainer-cargo-cache-${devcontainerId}",
// "target": "/usr/local/cargo",
// "type": "volume"
// }
// ]
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
// install node 16 and pnpm by nvm, hover on the feature to get more info.
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"version": "16.18.0"
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "rustc --version",
"postAttachCommand": "pnpm run init",
// Configure tool-specific properties.
// Add extensions for vscode
"customizations": {
"vscode": {
"extensions": [
"EditorConfig.EditorConfig", // to respect .editorConfig files
"mutantdino.resourcemonitor", // watch resource usage
"rust-lang.rust-analyzer"
]
}
},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
"name": "Rust",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"build": {
"dockerfile": "Dockerfile"
},
// Use 'mounts' to make the cargo cache persistent in a Docker Volume.
// "mounts": [
// {
// "source": "devcontainer-cargo-cache-${devcontainerId}",
// "target": "/usr/local/cargo",
// "type": "volume"
// }
// ]
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
// install node 16 and pnpm by nvm, hover on the feature to get more info.
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"version": "16.18.0"
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "rustc --version",
"postAttachCommand": "pnpm run init",
// Configure tool-specific properties.
// Add extensions for vscode
"customizations": {
"vscode": {
"extensions": [
"EditorConfig.EditorConfig", // to respect .editorConfig files
"mutantdino.resourcemonitor", // watch resource usage
"rust-lang.rust-analyzer"
]
}
}
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
24 changes: 12 additions & 12 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
- Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand Down Expand Up @@ -105,7 +105,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
Expand All @@ -124,4 +124,4 @@ enforcement ladder](https://github.com/mozilla/diversity).

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
https://www.contributor-covenant.org/translations.
2 changes: 1 addition & 1 deletion biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@
"clientKind": "git",
"useIgnoreFile": true
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"test:js": "pnpm -r run test",
"format:rs": "pnpm --filter @rspack/core... build",
"format:js": "pnpm run format-ci:js --write",
"format-ci:js": "node ./node_modules/prettier/bin/prettier.cjs \"packages/**/src/**/*.{ts,tsx,js}\" \"crates/rspack_plugin_runtime/**/*.{ts,js}\" \"x.mjs\" --check",
"format-ci:js": "node ./node_modules/prettier/bin/prettier.cjs \"packages/**/src/**/*.{ts,tsx,js}\" \"crates/rspack_plugin_runtime/**/*.{ts,js}\" \"scripts/**/*.{cjs,mjs,js}\" \"x.mjs\" \"x\" --check",
"format-ci:toml": "npx @taplo/cli format --check '.cargo/*.toml' './crates/**/Cargo.toml' './Cargo.toml'",
"format:toml": "npx @taplo/cli format '.cargo/*.toml' './crates/**/Cargo.toml' './Cargo.toml'",
"lint:js": "pnpm run lint-ci:js --write",
Expand Down
2 changes: 1 addition & 1 deletion packages/rspack-cli/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"path": "../rspack/tsconfig.build.json"
}
]
}
}
6 changes: 2 additions & 4 deletions packages/rspack-cli/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"extends": "../../tsconfig.base.json",
"include": [
"src"
],
"include": ["src"],
"compilerOptions": {
"outDir": "dist",
"rootDir": "src"
Expand All @@ -15,4 +13,4 @@
"ts-node": {
"transpileOnly": true
}
}
}
22 changes: 5 additions & 17 deletions packages/rspack-test-tools/tsconfig.assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,14 @@
"strict": true,
"target": "ES6",
"outDir": "./dist",
"lib": [
"dom",
"es5",
"es2015.collection",
"es2015.promise"
],
"lib": ["dom", "es5", "es2015.collection", "es2015.promise"],
"types": [],
"baseUrl": "./node_modules",
"jsx": "preserve",
"esModuleInterop": true,
"typeRoots": [
"node_modules/@types"
],
"typeRoots": ["node_modules/@types"],
"paths": {}
},
"include": [
"viewer/**/*",
"src/type.ts"
],
"exclude": [
"node_modules"
]
}
"include": ["viewer/**/*", "src/type.ts"],
"exclude": ["node_modules"]
}
10 changes: 3 additions & 7 deletions packages/rspack-test-tools/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@
"outDir": "dist",
"rootDir": "src"
},
"include": [
"src"
],
"exclude": [
"viewer"
],
"include": ["src"],
"exclude": ["viewer"],
"references": [
{
"path": "../rspack"
}
]
}
}
10 changes: 4 additions & 6 deletions packages/rspack-test-tools/viewer/entries/diff.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import { DiffReportPage } from '../pages/diff-report';
import React from "react";
import { createRoot } from "react-dom/client";
import { DiffReportPage } from "../pages/diff-report";
import "@arco-design/web-react/dist/css/arco.css";

const root = document.getElementById('root');
const root = document.getElementById("root");
if (root) {
createRoot(root).render(
<React.StrictMode>
<DiffReportPage />
</React.StrictMode>
);
}


25 changes: 11 additions & 14 deletions packages/rspack-test-tools/viewer/templates/diff.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
<!DOCTYPE html>
<!doctype html>
<html>

<head>
<meta charset="utf-8" />
<title>Rspack Diff Viewer</title>
<script id="$$RSPACK_DIFF_STATS_PLACEHOLDER$$"></script>
</head>

<body>

<div id="root"></div>
</body>

</html>
<head>
<meta charset="utf-8" />
<title>Rspack Diff Viewer</title>
<script id="$$RSPACK_DIFF_STATS_PLACEHOLDER$$"></script>
</head>

<body>
<div id="root"></div>
</body>
</html>
2 changes: 1 addition & 1 deletion packages/rspack/api-extractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
"enabled": true,
"includeForgottenExports": true
}
}
}
2 changes: 1 addition & 1 deletion packages/rspack/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"sourceMap": false,
"declarationMap": false
}
}
}
40 changes: 10 additions & 30 deletions packages/rspack/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,21 @@
"resolveJsonModule": true,
"emitDeclarationOnly": true,
"paths": {
"zod": [
"../compiled/zod"
],
"watchpack": [
"../compiled/watchpack"
],
"@swc/types": [
"../compiled/@swc/types"
],
"graceful-fs": [
"../compiled/graceful-fs"
],
"browserslist": [
"../compiled/browserslist"
],
"enhanced-resolve": [
"../compiled/enhanced-resolve"
],
"zod": ["../compiled/zod"],
"watchpack": ["../compiled/watchpack"],
"@swc/types": ["../compiled/@swc/types"],
"graceful-fs": ["../compiled/graceful-fs"],
"browserslist": ["../compiled/browserslist"],
"enhanced-resolve": ["../compiled/enhanced-resolve"],
"enhanced-resolve/lib/CachedInputFileSystem": [
"../compiled/enhanced-resolve/CachedInputFileSystem"
],
"webpack-sources": [
"../compiled/webpack-sources"
]
"webpack-sources": ["../compiled/webpack-sources"]
}
},
"include": [
"src",
"src/**/*.json"
],
"exclude": [
"src/config/schema.check.js",
"src/container/default.runtime.js"
],
"include": ["src", "src/**/*.json"],
"exclude": ["src/config/schema.check.js", "src/container/default.runtime.js"],
"ts-node": {
"transpileOnly": true
}
}
}
2 changes: 1 addition & 1 deletion scripts/release/version.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export async function version_handler(version, options) {
nextVersion = semver.inc(lastVersion, "prerelease", pre);
} else {
// different pre tag
nextVersion = `${lastVersion.split(existsPreTag)[0]}${pre}.0`
nextVersion = `${lastVersion.split(existsPreTag)[0]}${pre}.0`;
}
} else {
nextVersion = semver.inc(lastVersion, `pre${version}`, pre);
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/diff.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const CONTENT_COMPARATOR = async (p, a, b) => {
};
aa = await format(aa, o);
bb = await format(bb, o);
} catch (e) { }
} catch (e) {}
return aa === bb;
};

Expand Down
Loading

2 comments on commit ae45e1e

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Benchmark detail: Open

Name Base (2024-10-31 02f0c85) Current Change
10000_big_production-mode + exec 49.3 s ± 1.56 s 47.9 s ± 1.64 s -2.86 %
10000_development-mode + exec 2.12 s ± 33 ms 2.08 s ± 23 ms -1.92 %
10000_development-mode_hmr + exec 638 ms ± 4.3 ms 646 ms ± 8.8 ms +1.23 %
10000_production-mode + exec 2.69 s ± 41 ms 2.65 s ± 29 ms -1.41 %
arco-pro_development-mode + exec 1.79 s ± 73 ms 1.76 s ± 57 ms -1.66 %
arco-pro_development-mode_hmr + exec 428 ms ± 1.1 ms 428 ms ± 1.3 ms -0.05 %
arco-pro_production-mode + exec 3.21 s ± 130 ms 3.19 s ± 87 ms -0.73 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.25 s ± 68 ms 3.28 s ± 97 ms +0.65 %
threejs_development-mode_10x + exec 1.62 s ± 20 ms 1.63 s ± 26 ms +0.42 %
threejs_development-mode_10x_hmr + exec 770 ms ± 13 ms 778 ms ± 12 ms +1.07 %
threejs_production-mode_10x + exec 5.01 s ± 27 ms 5.03 s ± 30 ms +0.50 %

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Ran ecosystem CI: Open

suite result
modernjs ✅ success
_selftest ✅ success
rspress ✅ success
rslib ✅ success
rsbuild ✅ success
examples ❌ failure
devserver ✅ success

Please sign in to comment.