Skip to content

Commit

Permalink
docs(website): set sidebar collapse to false
Browse files Browse the repository at this point in the history
  • Loading branch information
bcabanes authored and vsavkin committed Jul 7, 2022
1 parent c567a29 commit 0e976bf
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 92 deletions.
6 changes: 1 addition & 5 deletions lerna.json
Expand Up @@ -15,11 +15,7 @@
"message": "chore(release): %s"
}
},
"ignoreChanges": [
"**/__fixtures__/**",
"**/__tests__/**",
"**/*.md"
],
"ignoreChanges": ["**/__fixtures__/**", "**/__tests__/**", "**/*.md"],
"useWorkspaces": true,
"useNx": true,
"version": "5.1.8"
Expand Down
72 changes: 26 additions & 46 deletions website/docs/configuration.md
Expand Up @@ -17,7 +17,7 @@ the `useWorksapces: true` in `lerna.json`.

```json title="lerna.json"
{
"useWorkspaces": true
"useWorkspaces": true
}
```

Expand All @@ -26,7 +26,7 @@ look for `package.json` files.

```json title="lerna.json"
{
"packages": ["packages/*"]
"packages": ["packages/*"]
}
```

Expand All @@ -37,15 +37,15 @@ be published using the same version. The last published version is recorded in `

```json title="lerna.json"
{
"version": "1.2.0"
"version": "1.2.0"
}
```

When using the independent mode, every package is versioned separately, and `lerna.json` will look as follows:

```json title="lerna.json"
{
"version": "independent"
"version": "independent"
}
```

Expand Down Expand Up @@ -76,41 +76,22 @@ This configuration is only relevant is you have `useNx: true` in your `lerna.jso
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": [
"build",
"test"
]
"cacheableOperations": ["build", "test"]
}
}
},
"namedInputs": {
"default": [
"{projectRoot}/**/*"
],
"prod": [
"!{projectRoot}/**/*.spec.tsx"
]
"default": ["{projectRoot}/**/*"],
"prod": ["!{projectRoot}/**/*.spec.tsx"]
},
"targetDefaults": {
"build": {
"dependsOn": [
"prebuild",
"^build"
],
"inputs": [
"prod",
"^prod"
],
"outputs": [
"{projectRoot}/dist"
]
"dependsOn": ["prebuild", "^build"],
"inputs": ["prod", "^prod"],
"outputs": ["{projectRoot}/dist"]
},
"test": {
"inputs": [
"default",
"^prod",
"{workspaceRoot}/jest.config.ts"
]
"inputs": ["default", "^prod", "{workspaceRoot}/jest.config.ts"]
}
}
}
Expand Down Expand Up @@ -146,37 +127,37 @@ project and the build script of all the dependencies to run first.
The `inputs` array tells Nx what to consider to determine whether a particular invocation of a script should be a cache
hit or not. There are three types of inputs:

*Filesets*
_Filesets_

Examples:

* `{projectRoot}/**.*.ts`
* same as `{fileset: "{projectRoot}/**/*.ts"}`
* `{workspaceRoot}/jest.config.ts`
* same as `{fileset: "{workspaceRoot}/jest.config.ts}`
- `{projectRoot}/**.*.ts`
- same as `{fileset: "{projectRoot}/**/*.ts"}`
- `{workspaceRoot}/jest.config.ts`
- same as `{fileset: "{workspaceRoot}/jest.config.ts}`

*Runtime Inputs*
_Runtime Inputs_

Examples:

* `{runtime: "node -v"}`
- `{runtime: "node -v"}`

Node the result value is hashed, so it is never displayed.

*Env Variables*
_Env Variables_

Examples:

* `{env: "MY_ENV_VAR"}`
- `{env: "MY_ENV_VAR"}`

Node the result value is hashed, so it is never displayed.

*Named Inputs*
_Named Inputs_

Examples:

* `inputs: ["prod"]`
* same as `inputs: [{input: "prod", projects: "self"}]`
- `inputs: ["prod"]`
- same as `inputs: [{input: "prod", projects: "self"}]`

Often the same glob will appear in many places (e.g., prod fileset will exclude spec files for all projects).. Because
keeping them in sync is error-prone, we recommend defining named inputs, which you can then reference in all of those
Expand All @@ -186,8 +167,8 @@ places.

Examples:

* `inputs: ["^prod"]`
* same as `inputs: [{input: "prod", projects: "dependencies"}]`
- `inputs: ["^prod"]`
- same as `inputs: [{input: "prod", projects: "dependencies"}]`

Similar to `dependsOn`, the "^" symbols means "dependencies". This is a very important idea, so let's illustrate it with
an example.
Expand Down Expand Up @@ -254,8 +235,7 @@ useful to have a project-specific configuration, which is placed in the project'
Note, the `namedInputs` and `targetDefaults` defined in `nx.json` are simply defaults. If you take that configuration
and copy it into every project's `package.json` file, the results will be the same.

In other words, every project has a set of named inputs, and it's defined as: `{...namedInputsFromNxJson,
...namedInputsFromProjectsPackageJson}`. Every target/script's `dependsOn` is defined
In other words, every project has a set of named inputs, and it's defined as: `{...namedInputsFromNxJson, ...namedInputsFromProjectsPackageJson}`. Every target/script's `dependsOn` is defined
as `dependsOnFromProjectsPackageJson || dependsOnFromNxJson`. The same applies to `inputs` and `outputs`.

### inputs & namedInputs
Expand Down
34 changes: 7 additions & 27 deletions website/docs/core-concepts/caching.md
Expand Up @@ -71,26 +71,15 @@ We can define a more precise configuration as follows:
```json title="nx.json"
{
"namedInputs": {
"default": [
"{projectRoot}/**/*"
],
"prod": [
"!{projectRoot}/**/*.spec.tsx"
]
"default": ["{projectRoot}/**/*"],
"prod": ["!{projectRoot}/**/*.spec.tsx"]
},
"targetDefaults": {
"build": {
"inputs": [
"prod",
"^prod"
]
"inputs": ["prod", "^prod"]
},
"test": {
"inputs": [
"default",
"^prod",
"{workspaceRoot}/jest.config.ts"
]
"inputs": ["default", "^prod", "{workspaceRoot}/jest.config.ts"]
}
}
}
Expand All @@ -108,10 +97,7 @@ Your targets can also depend on runtime values.
{
"targetDefaults": {
"build": {
"inputs": [
{ "env": "MY_ENV_NAME" },
{ "runtime": "node -v"}
]
"inputs": [{ "env": "MY_ENV_NAME" }, { "runtime": "node -v" }]
}
}
}
Expand Down Expand Up @@ -164,10 +150,7 @@ project's `package.json`:
"nx": {
"targets": {
"build": {
"outputs": [
"{projectRoot}/build",
"{projectRoot}/public/build"
]
"outputs": ["{projectRoot}/build", "{projectRoot}/public/build"]
}
}
}
Expand Down Expand Up @@ -217,10 +200,7 @@ option for the task runner in `nx.json`:
"tasksRunnerOptions": {
"default": {
"options": {
"cacheableOperations": [
"build",
"test"
],
"cacheableOperations": ["build", "test"],
"cacheDirectory": "/tmp/mycache"
}
}
Expand Down
10 changes: 2 additions & 8 deletions website/docs/getting-started.md
Expand Up @@ -221,10 +221,7 @@ Second, let's mark `build` and `test` to be cacheable operations.
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": [
"build",
"test"
]
"cacheableOperations": ["build", "test"]
}
}
}
Expand Down Expand Up @@ -268,10 +265,7 @@ building the Remix app we need to help it by adding the following section to `pa
"nx": {
"targets": {
"build": {
"outputs": [
"{projectRoot}/build",
"{projectRoot}/public/build"
]
"outputs": ["{projectRoot}/build", "{projectRoot}/public/build"]
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions website/docs/guides/hoisting.md
Expand Up @@ -25,17 +25,17 @@ directory instead.
that ideally does not require any other modifications to a project.
When the `--hoist` flag is used:

* Common dependencies will be installed _only_ to the top-level
- Common dependencies will be installed _only_ to the top-level
`node_modules`, and omitted from individual package `node_modules`.
* Mostly-common dependencies are still hoisted, but outlier packages
- Mostly-common dependencies are still hoisted, but outlier packages
with different versions will get a normal, local `node_modules`
installation of the necessary dependencies.
* In this instance, `lerna bootstrap` will always use `npm install`
- In this instance, `lerna bootstrap` will always use `npm install`
with the `--global-style` flag, regardless of client configuration.
* Binaries from those common packages are symlinked to individual
- Binaries from those common packages are symlinked to individual
package `node_modules/.bin` directories, so that `package.json`
scripts continue to work unmodified.
* Well-behaved Node-based software should continue to work unmodified.
- Well-behaved Node-based software should continue to work unmodified.

## Disadvantages with hoisting

Expand Down
2 changes: 1 addition & 1 deletion website/docusaurus.config.js
Expand Up @@ -34,9 +34,9 @@ const config = {
({
docs: {
sidebarPath: require.resolve("./sidebars.js"),
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl: "https://github.com/lerna/lerna/tree/main/website/",
sidebarCollapsed: false,
},
theme: {
customCss: [require.resolve("./src/css/custom.css"), require.resolve("./src/css/helpers.css")],
Expand Down

0 comments on commit 0e976bf

Please sign in to comment.