Skip to content

Commit

Permalink
chore: remove ./x and Makefile and replace them with npm scripts (#2825)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyf0 authored and IWANABETHATGUY committed Apr 19, 2023
1 parent ccae141 commit 227a0ed
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 347 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bench-history.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: |
corepack enable
pnpm i
./x build cli:release
pnpm -w build:cli:release
export ROOT_DIR=$(pwd) && cd benchcases/react-refresh && pnpm dev
- name: Store benchmark result
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Build
run: |
set -e
USE_ZIG=1 ./x build cli:release:all
USE_ZIG=1 pnpm -w build:cli:release:all
- name: Release
uses: modern-js-dev/actions@v2
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,5 @@ To make releasing easier, Rspack use github action to automate creating versioni

1. Install `go install github.com/go-delve/delve/cmd/dlv@latest`
2. Install vscode extension [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) and [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb)
3. build `@rspack/cli` and napi binding by run `./x build cli:debug`
3. build `@rspack/cli` and napi binding by run `pnpm -w build:cli:debug`
4. In Vscode's `Run and Debug` tab, select `debug-rspack` to start debugging the initial launch of `@rspack/cli`, This task is configured in `.vscode/launch.json`, which launch node debugger and rust debugger together. so you can debug both rust and nodejs code.
61 changes: 0 additions & 61 deletions Makefile

This file was deleted.

23 changes: 10 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,17 @@
"scripts": {
"dev": "pnpm --filter @rspack/cli run dev",
"clean": "pnpm --filter @rspack/cli run clean",
"init": "./x i",
"setup": "./x i && ./x build binding",
"build:js": "./x build js",
"build:cli:debug": "./x build cli:debug",
"build:cli:release": "./x build cli:release",
"build:cli:release:all": "./x build cli:release:all",
"build:webpack": "./x build webpack",
"test:js": "./x test js",
"format:rs": "./x format rs",
"format:js": "./x format js",
"format-ci:toml": "./x format toml",
"build:js": "pnpm --filter \"@rspack/*\" build",
"build:cli:debug": "pnpm --filter @rspack/binding build:debug && pnpm --filter \"@rspack/*\" build",
"build:cli:release": "pnpm --filter @rspack/binding build:release && pnpm --filter \"@rspack/*\" build",
"build:cli:release:all": "pnpm --filter @rspack/binding build:release:all && pnpm --filter \"@rspack/*\" build",
"test:js": "pnpm -r run test",
"format:rs": "pnpm --filter @rspack/core... build",
"format:js": "npx prettier \"packages/**/*.{ts,js}\" \"crates/rspack_plugin_runtime/**/*.{ts,js}\" --check --write",
"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": "./x lint js",
"lint:rs": "./x lint rs",
"lint:js": "npx prettier \"packages/**/*.{ts,js}\" --check",
"lint:rs": "node ./scripts/check_rust_dependency.js",
"build:binding:debug": "pnpm --filter @rspack/binding run build:debug",
"build:binding:release": "pnpm --filter @rspack/binding run build:release",
"version:snapshot": "changeset version --snapshot",
Expand Down
11 changes: 11 additions & 0 deletions scripts/check_rust_dependency.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
// @ts-nocheck

// The code checks for multiple version dependencies in Rust crates.
// It reads the Cargo.toml files of all crates in a specified directory and extracts the dependencies.
// It then uses the cargo tree command to get a list of all dependencies and their versions and
// checks if any of the dependencies have multiple versions.
// If a crate has multiple version dependencies, an error message is pushed to an array. Finally,
// if there are any error messages, they are logged to the console along with a command to run for more information.

// This is a best effort checking. It's possible that some dependencies may be missed, especially if
// they are not listed in the Cargo.toml file or if they are not direct dependencies of the crate.

const path = require("path");
const fs = require("fs");
const child_process = require("child_process");
Expand Down
262 changes: 0 additions & 262 deletions scripts/cmd.js

This file was deleted.

Loading

0 comments on commit 227a0ed

Please sign in to comment.