Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: dependencies
packages:
- "@azure-tools/typespec-java"
---

[Java] Remove unused `js-yaml` and `lodash` dependencies.
43 changes: 37 additions & 6 deletions packages/typespec-java/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,48 @@ refresh `core.patch` if its context no longer applies.
## Build

```bash
# Full build: build:generator (emitter.jar via Maven + core.patch, requires JDK 11+
# and Maven) then build:emitter (copy sources from core + tsc).
pnpm build
# From the repo root, install workspace dependencies.
pnpm install

# Just the TypeScript half (no jar; fast):
pnpm build:emitter
# From the repo root, build the dependencies first. The ^... filter builds
# @azure-tools/typespec-java dependencies without building typespec-java itself.
pnpm turbo run --filter "@azure-tools/typespec-java^..." build

# Build and pack a .tgz (what emitter-tests consumes):
# Then build and pack @azure-tools/typespec-java. This builds the generator
# (emitter.jar via Maven + core.patch, requires JDK 11+ and Maven), builds the
# emitter TypeScript, and packs the .tgz consumed by emitter-tests.
cd packages/typespec-java
pwsh ./Build-TypeSpec.ps1
```

### Pinning the core commit (`core-commit.json`)

`Copy-Sources.ps1` copies the emitter sources from the `core/` submodule's current checkout. The
optional `core-commit.json` pins a specific upstream `core` commit to copy from instead:

```json
{ "sha": "3cb616e4e8c3d5b6954bac9832b97445450a71af" }
```

The pinned SHA is fetched if needed and used only when it is **newer** than the current checkout (the
submodule never moves backwards). The submodule is checked out transiently for the copy, then always
restored to its original SHA, keeping `pnpm build` and CI git-status checks clean. To advance the pin,
update the `sha`.

### Troubleshooting

If `pnpm turbo ...` fails with `'turbo' is not recognized as an internal or external command`
after `pnpm install`, the local install tree is missing Turbo's binary shim. From the repo root,
force pnpm to refresh the local install state and rerun the command:

```powershell
pnpm install --force
pnpm turbo run --filter "@azure-tools/typespec-java^..." build
```

Changing the npm registry has been observed to clear this symptom, possibly because
pnpm re-resolves packages or relinks local binaries after the registry setting changes.

## Before making a Pull request

Make sure to run the following commands:
Expand Down
4 changes: 0 additions & 4 deletions packages/typespec-java/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@
"dependencies": {
"@autorest/codemodel": "catalog:",
"@azure-tools/codegen": "catalog:",
"js-yaml": "catalog:",
"lodash": "catalog:",
"yaml": "catalog:"
},
"devDependencies": {
Expand All @@ -76,8 +74,6 @@
"@azure-tools/typespec-client-generator-core": "workspace:^",
"@azure-tools/typespec-liftr-base": "catalog:",
"@azure-tools/openai-typespec": "catalog:",
"@types/js-yaml": "catalog:",
"@types/lodash": "catalog:",
"@types/node": "catalog:",
"@typespec/compiler": "workspace:^",
"@typespec/events": "workspace:^",
Expand Down
29 changes: 0 additions & 29 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ catalog:
"@types/debounce": ^1.2.4
"@types/express": ^5.0.6
"@types/hast": ^3.0.4
"@types/js-yaml": ~4.0.9
"@types/lodash": ~4.17.24
"@types/micromatch": ^4.0.10
"@types/morgan": ^1.9.10
"@types/multer": ^2.1.0
Expand Down Expand Up @@ -142,8 +140,6 @@ catalog:
happy-dom: ^20.9.0
hast-util-to-html: ^9.0.5
is-unicode-supported: ^2.1.0
js-yaml: ^4.2.0
lodash: ~4.18.1
log-symbols: ^7.0.1
lzutf8: "0.6.3"
micromatch: ^4.0.8
Expand Down
Loading