Skip to content

Commit

Permalink
chore: define pnpm and nodejs versions + update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartones committed May 15, 2024
1 parent 789b6f2 commit 2d75895
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# recommended for projects using rules_js
# @see https://docs.aspect.build/rules/aspect_rules_js/docs/pnpm/#hoisting
hoist=false

lockfile-include-tarball-url=true
# for pnpm
lockfile-include-tarball-url=true
# warn about invalid node version, but not fail
engine-strict=false
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,16 @@ Each time dependencies change/get updated, run `pnpm install` (toolchains use `p
- [pnpm](https://pnpm.io)
- [typescript](https://www.typescriptlang.org/)

Note: `package.json` maximum versions are mandated from the toolchains. Check the [WORKSPACE](WORKSPACE) file for more details.

For `pnpm`, alternatively can use the `rules_js` provisioned one, e.g.:

```bash
bazelisk run -- @pnpm//:pnpm --dir $PWD list
```

But note that you'll need to instruct it extra configuration (runs from a sandbox).

### Recommendations

- [Bazel plugin for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=BazelBuild.vscode-bazel)
Expand Down
4 changes: 4 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@ http_archive(

# ------------------------

# pnpm version dependant on rules_js
# https://github.com/aspect-build/rules_js/releases/latest -> npm/private/versions.bzl
load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()

# TypeScript version dependant on rules_ts
# https://github.com/aspect-build/rules_ts/releases/latest -> ts/private/versions.bzl
# check always latest version *released*
load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies")
Expand All @@ -59,6 +62,7 @@ rules_ts_dependencies(ts_version_from = "//:package.json")
load("@bazel_features//:deps.bzl", "bazel_features_deps")
bazel_features_deps()

# NodeJS version dependant on rules_nodejs
# https://github.com/bazelbuild/rules_nodejs/releases/latest -> nodejs/private/node_versions.bzl
# check always latest version *released*
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
"scripts": {
"test": "bazel test //..."
},
"engines": {
"node": "20.12.1"
},
"packageManager": "[email protected]",
"dependencies": {
},
"devDependencies": {
Expand Down

0 comments on commit 2d75895

Please sign in to comment.