Skip to content

Commit

Permalink
chore: remove remaining yarn references (#5132)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimBeyer committed Sep 25, 2023
1 parent c500c2d commit af1a493
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 35 deletions.
45 changes: 19 additions & 26 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,27 +81,20 @@ If you are an [asdf](https://asdf-vm.com/) user, running `./scripts/install-asdf
Install Node modules for the root package, and `core` package:

```sh
yarn install # To install root dependencies
yarn run bootstrap # To bootstrap packages
npm install # To install root dependencies
npm run bootstrap # To bootstrap packages
```

from the root directory

You may need to install the Node modules in the core package manually due to [lerna/lerna#1457](https://github.com/lerna/lerna/issues/1457).

```sh
cd core
yarn
```

## Developing Garden

### Initial build

Before running Garden for the first time, you need to do an initial build by running

```sh
yarn build
npm run build
```

from the root directory.
Expand All @@ -111,7 +104,7 @@ from the root directory.
To develop the CLI, run the `dev` command in your console:

```sh
yarn dev
npm run dev
```

This will link it to your global `node_modules` folder, and then watch for
Expand All @@ -126,7 +119,7 @@ alias k='kubectl'

### Formatting

We use [Prettier](https://prettier.io) for automated formatting. We highly recommend installing the appropriate plugin for your editor to automate formatting as you work on your code. You can also run `yarn run fix-format` to fix formatting across the codebase.
We use [Prettier](https://prettier.io) for automated formatting. We highly recommend installing the appropriate plugin for your editor to automate formatting as you work on your code. You can also run `npm run fix-format` to fix formatting across the codebase.

### Debugging

Expand Down Expand Up @@ -154,7 +147,7 @@ You should now be able to inspect the code at run time in the **Console** tab of
You can build the release binaries using the command

```
yarn dist
npm run dist
```

You can then find the release binaries and archives under `dist/`.
Expand All @@ -165,7 +158,7 @@ The Docker containers meant to be used directly by the general public are define

When making changes to the `Dockerfile` definitions in `support/` it is helpful to build the containers on your local machine.

For that, first run `yarn dist`, and then run `docker buildx bake` like so:
For that, first run `npm run dist`, and then run `docker buildx bake` like so:

```
MAJOR_VERSION=0 MINOR_VERSION=13 PATCH_VERSION=0 CODENAME=bonsai \
Expand All @@ -174,23 +167,23 @@ MAJOR_VERSION=0 MINOR_VERSION=13 PATCH_VERSION=0 CODENAME=bonsai \

The environment variables will influence the tags that `buildx bake` will create on your local machine (e.g. stable release tags, prerelease tags, version number, etc.).

To run the tests on your local machine, first run `yarn dist` (if not already done so), and then run
To run the tests on your local machine, first run `npm run dist` (if not already done so), and then run
```
bash support/docker-bake-test.sh
```

### Tests

Unit tests are run using `mocha` via `yarn test` from the directory of the package you want to test. To run a specific test, you can grep the test description with the `-g` flag.:
Unit tests are run using `mocha` via `npm run test` from the directory of the package you want to test. To run a specific test, you can grep the test description with the `-g` flag.:

```sh
cd core
yarn test # run all unit tests
yarn test -- -g "taskGraph" # run only tests with descriptions matching "taskGraph"
npm run test # run all unit tests
npm run test -- -g "taskGraph" # run only tests with descriptions matching "taskGraph"
```

#### ARM64 compatibility
On ARM64 platforms (like Mac machines with M1 chips) the `yarn test` command may fail with the following error:
On ARM64 platforms (like Mac machines with M1 chips) the `npm run test` command may fail with the following error:
```sh
FATAL ERROR: wasm code commit Allocation failed - process out of memory
```
Expand All @@ -200,19 +193,19 @@ In order to fix it, the terminal must be running in the **Rosetta** mode, the de
Integration tests are run with:

```sh
yarn integ-local
npm run integ-local
```

End-to-end tests are run with:

```sh
yarn run e2e
npm run e2e
```

You can also run the end-to-end tests for a specific example project using:

```sh
yarn run e2e-project -- --project=<example project name>
npm run e2e-project -- --project=<example project name>
```

End-to-end tests are run in CI by using Garden itself to test the project defined in `./core/test/e2e/garden.yml`. Cf. the appropriate job in `circleci/config.yml` for details.
Expand Down Expand Up @@ -242,19 +235,19 @@ When generating the changelog, we only include the following types: **feat**, **
We have scripts for checking licenses, docs, linting and more. These can all be run with a single command:

```sh
yarn run check-all
npm run check-all
```

If the checks fail because of bad formatting, run:

```sh
yarn run fix-format
npm run fix-format
```

If the checks fail because of missing docs, run:

```sh
yarn run generate-docs
npm run generate-docs
```

### Pre-push hook
Expand Down Expand Up @@ -283,7 +276,7 @@ We use [Circle CI](https://circleci.com) for integration and end-to-end testing.
## License/copyright headers

Every source file must include the contents of `support/license-header.txt` at the top. This is
automatically checked during CI. You can run the check with `yarn run check-licenses`.
automatically checked during CI. You can run the check with `npm run check-licenses`.

## Release process

Expand Down
2 changes: 1 addition & 1 deletion RELEASE_PROCESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The [release script](https://github.com/garden-io/garden/blob/main/scripts/relea
and does the following:

- Checks out a branch named `release-<version>`.
- Updates `core/package.json`, `core/yarn.lock` and `CHANGELOG.md`.
- Updates `core/package.json`, `core/package-lock.json` and `CHANGELOG.md`.
- Commits the changes, tags the commit, and pushes the tag and branch.
- Pushing the tag triggers a CI process that creates the release artifacts and publishes them to GitHub. If the release is not a pre-release, we create a draft instead of actually publishing.

Expand Down
6 changes: 3 additions & 3 deletions docs/other-plugins/exec.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ actions right away.

It's great for running auth scripts as well as executing various scaffolding scripts that need to run "locally".

It can also be used to start applications locally (e.g. by executing commands like `yarn dev`).
It can also be used to start applications locally (e.g. by executing commands like `npm run dev`).

This can be very useful for hybrid environments where you have, say, your backend running in a remote production-like
environment but your frontend running locally.
Expand Down Expand Up @@ -78,7 +78,7 @@ name: db-init
type: exec
dependencies: [ run.auth, run.prepare-data ]
spec:
command: [ yarn, run, db-init ]
command: [ npm, run, db-init ]
```

It's also possible to reference the output from `exec` actions:
Expand Down Expand Up @@ -108,7 +108,7 @@ name: web-local
type: exec
spec:
persistent: true
deployCommand: [ "yarn", "run", "dev" ] # <--- This is the command Garden runs to start the process in persistent mode.
deployCommand: [ "npm", "run", "dev" ] # <--- This is the command Garden runs to start the process in persistent mode.
```

Set `spec.persistent: true` if the `spec.deployCommand` is not expected to return, and should run until the Garden
Expand Down
6 changes: 3 additions & 3 deletions docs/using-garden/variables-and-templating.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,17 @@ kind: Module
...
variables:
commonArgs:
- yarn
- npm
- test
- -g
tests:
- name: test-a
# resolves to [yarn, test, -g, suite-a]
# resolves to [npm, test, -g, suite-a]
args:
- $concat: ${var.commonArgs}
- suite-a
- name: test-b
# resolves to [yarn, test, -g, suite-b]
# resolves to [npm, test, -g, suite-b]
args:
- $concat: ${var.commonArgs}
- suite-b
Expand Down
4 changes: 2 additions & 2 deletions e2e/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# End to end Tests

To run the end to end test suite against the given example project, use `yarn e2e-project --project <example project name>` from the repo root. This runs `test/e2e/e2e-project.ts`.
To run the end to end test suite against the given example project, use `npm run e2e-project -- --project <example project name>` from the repo root. This runs `test/e2e/e2e-project.ts`.

The script performs the following cleanup operations befor running the tests:

Expand All @@ -20,5 +20,5 @@ The `e2e-project` script supports the following options:
For example:

```sh
yarn e2e-project --binPath=/some/path/garden-bin --project=tasks
npm run e2e-project -- --binPath=/some/path/garden-bin --project=tasks
```
1 change: 1 addition & 0 deletions plugins/pulumi/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.d.ts
*.js
build

0 comments on commit af1a493

Please sign in to comment.