build(cargo): move workspaces manifest to top level (#48198)
<!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation or adding/fixing Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### How? Closes NEXT- Fixes # --> ### What? This PR changes to the `root` of the cargo workspace to the root of repo itself, allows next-swc and other rust codebase can use repo root as workspace root. ### Why? Currently cargo manifest for the next-swc is not placed under the root of the repo, which makes invocation to the tool requires to change cwd / or set cwd. Similarly needs to open editor to the root of the cargo manifest separately to able to utilize language server kicks in. Moving manifest to the root consolidates those, so can invoke either cli / or editor to the same root of the repo.
This commit is contained in:
parent
7b6e336bc5
commit
9f5463dc9a
10 changed files with 28 additions and 24 deletions
4
.github/CODEOWNERS
vendored
4
.github/CODEOWNERS
vendored
|
@ -28,3 +28,7 @@
|
|||
/packages/next/src/build/ @timneutkens @ijjk @shuding @vercel/web-tooling @huozhi
|
||||
/packages/next/src/telemetry/ @timneutkens @ijjk @shuding @padmaia
|
||||
/packages/next-swc/ @timneutkens @ijjk @shuding @vercel/web-tooling
|
||||
Cargo.toml @timneutkens @ijjk @shuding @vercel/web-tooling
|
||||
Cargo.lock @timneutkens @ijjk @shuding @vercel/web-tooling
|
||||
/.cargo/config.toml @timneutkens @ijjk @shuding @vercel/web-tooling
|
||||
/.config/nextest.toml @timneutkens @ijjk @shuding @vercel/web-tooling
|
1
.github/workflows/build_test_deploy.yml
vendored
1
.github/workflows/build_test_deploy.yml
vendored
|
@ -191,7 +191,6 @@ jobs:
|
|||
cargo fmt -- --check
|
||||
cargo clippy --all -- -D warnings -A deprecated
|
||||
cargo check -p next-dev --no-default-features --features cli,custom_allocator,rustls-tls,__internal_nextjs_integration_test
|
||||
working-directory: packages/next-swc
|
||||
|
||||
checkPrecompiled:
|
||||
name: Check Pre-compiled
|
||||
|
|
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
|
@ -58,8 +58,6 @@
|
|||
"*.ts": "$(capture).test.ts, $(capture).test.tsx",
|
||||
"*.tsx": "$(capture).test.ts, $(capture).test.tsx"
|
||||
},
|
||||
// Allow to find the cargo project for rust-analyzer.
|
||||
"rust-analyzer.linkedProjects": ["packages/next-swc/Cargo.toml"],
|
||||
// Compile rust-analyzer in a separate directory to avoid conflicts with the main project.
|
||||
"rust-analyzer.checkOnSave.extraEnv": {
|
||||
"CARGO_TARGET_DIR": "target/rust-analyzer"
|
||||
|
@ -68,6 +66,9 @@
|
|||
"CARGO_TARGET_DIR": "target/rust-analyzer",
|
||||
"RUST_BACKTRACE": "0"
|
||||
},
|
||||
"rust-analyzer.cargo.extraEnv": {
|
||||
"CARGO_TARGET_DIR": "target/rust_analyzer"
|
||||
},
|
||||
"cSpell.words": [
|
||||
"Entrypoints",
|
||||
"napi",
|
||||
|
|
0
packages/next-swc/Cargo.lock → Cargo.lock
generated
0
packages/next-swc/Cargo.lock → Cargo.lock
generated
|
@ -1,16 +1,16 @@
|
|||
[workspace]
|
||||
|
||||
members = [
|
||||
"crates/core",
|
||||
"crates/napi",
|
||||
"crates/wasm",
|
||||
"crates/next-build",
|
||||
"crates/next-core",
|
||||
"crates/next-dev",
|
||||
"crates/next-dev-tests",
|
||||
"crates/next-transform-font",
|
||||
"crates/next-transform-dynamic",
|
||||
"crates/next-transform-strip-page-exports",
|
||||
"packages/next-swc/crates/core",
|
||||
"packages/next-swc/crates/napi",
|
||||
"packages/next-swc/crates/wasm",
|
||||
"packages/next-swc/crates/next-build",
|
||||
"packages/next-swc/crates/next-core",
|
||||
"packages/next-swc/crates/next-dev",
|
||||
"packages/next-swc/crates/next-dev-tests",
|
||||
"packages/next-swc/crates/next-transform-font",
|
||||
"packages/next-swc/crates/next-transform-dynamic",
|
||||
"packages/next-swc/crates/next-transform-strip-page-exports",
|
||||
]
|
||||
|
||||
[profile.dev.package.swc_css_prefixer]
|
||||
|
@ -25,15 +25,15 @@ lto = true
|
|||
|
||||
[workspace.dependencies]
|
||||
# Workspace crates
|
||||
next-build = { path = "crates/next-build" }
|
||||
next-core = { path = "crates/next-core", default-features = false }
|
||||
next-dev = { path = "crates/next-dev", default-features = false, features = [
|
||||
next-build = { path = "packages/next-swc/crates/next-build" }
|
||||
next-core = { path = "packages/next-swc/crates/next-core", default-features = false }
|
||||
next-dev = { path = "packages/next-swc/crates/next-dev", default-features = false, features = [
|
||||
"serializable",
|
||||
] }
|
||||
next-dev-tests = { path = "crates/next-dev-tests" }
|
||||
next-transform-font = { path = "crates/next-transform-font" }
|
||||
next-transform-dynamic = { path = "crates/next-transform-dynamic" }
|
||||
next-transform-strip-page-exports = { path = "crates/next-transform-strip-page-exports" }
|
||||
next-dev-tests = { path = "packages/next-swc/crates/next-dev-tests" }
|
||||
next-transform-font = { path = "packages/next-swc/crates/next-transform-font" }
|
||||
next-transform-dynamic = { path = "packages/next-swc/crates/next-transform-dynamic" }
|
||||
next-transform-strip-page-exports = { path = "packages/next-swc/crates/next-transform-strip-page-exports" }
|
||||
|
||||
# SWC crates
|
||||
# Keep consistent with preset_env_base through swc_core
|
|
@ -4,10 +4,10 @@
|
|||
"private": true,
|
||||
"scripts": {
|
||||
"clean": "rm -rf ./native/*",
|
||||
"build-native": "napi build --platform -p next-swc-napi --cargo-name next_swc_napi --features plugin,rustls-tls --js false native",
|
||||
"build-native-woa": "napi build --platform -p next-swc-napi --cargo-name next_swc_napi --cargo-flags=--no-default-features --features plugin,native-tls --js false native",
|
||||
"build-native-no-plugin": "napi build --platform -p next-swc-napi --cargo-name next_swc_napi --js false native",
|
||||
"build-native-no-plugin-woa": "napi build --platform -p next-swc-napi --cargo-name next_swc_napi --cargo-flags=--no-default-features --features native-tls --js false native",
|
||||
"build-native": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --features plugin,rustls-tls --js false native",
|
||||
"build-native-woa": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --cargo-flags=--no-default-features --features plugin,native-tls --js false native",
|
||||
"build-native-no-plugin": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --js false native",
|
||||
"build-native-no-plugin-woa": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --cargo-flags=--no-default-features --features native-tls --js false native",
|
||||
"build-wasm": "wasm-pack build crates/wasm --scope=next",
|
||||
"cache-build-native": "echo $(ls native)"
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue