Skip to content

Commit

Permalink
chore(core): change enableDbCache to useLegacyCache
Browse files Browse the repository at this point in the history
  • Loading branch information
Cammisuli committed Oct 3, 2024
1 parent 5dd58f9 commit 7c600f1
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 26 deletions.
18 changes: 9 additions & 9 deletions docs/generated/devkit/NxJsonConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Nx.json configuration
- [cli](../../devkit/documents/NxJsonConfiguration#cli): Object
- [defaultBase](../../devkit/documents/NxJsonConfiguration#defaultbase): string
- [defaultProject](../../devkit/documents/NxJsonConfiguration#defaultproject): string
- [enableDbCache](../../devkit/documents/NxJsonConfiguration#enabledbcache): boolean
- [extends](../../devkit/documents/NxJsonConfiguration#extends): string
- [generators](../../devkit/documents/NxJsonConfiguration#generators): Object
- [implicitDependencies](../../devkit/documents/NxJsonConfiguration#implicitdependencies): ImplicitDependencyEntry<T>
Expand All @@ -43,6 +42,7 @@ Nx.json configuration
- [tasksRunnerOptions](../../devkit/documents/NxJsonConfiguration#tasksrunneroptions): Object
- [useDaemonProcess](../../devkit/documents/NxJsonConfiguration#usedaemonprocess): boolean
- [useInferencePlugins](../../devkit/documents/NxJsonConfiguration#useinferenceplugins): boolean
- [useLegacyCache](../../devkit/documents/NxJsonConfiguration#uselegacycache): boolean
- [workspaceLayout](../../devkit/documents/NxJsonConfiguration#workspacelayout): Object

## Properties
Expand Down Expand Up @@ -99,14 +99,6 @@ will be used. Convenient for small workspaces with one main application.

---

### enableDbCache

`Optional` **enableDbCache**: `boolean`

Enable the new experimental db based cache

---

### extends

`Optional` **extends**: `string`
Expand Down Expand Up @@ -297,6 +289,14 @@ Set this to false to disable adding inference plugins when generating new projec

---

### useLegacyCache

`Optional` **useLegacyCache**: `boolean`

Use the legacy file system cache instead of the db cache

---

### workspaceLayout

`Optional` **workspaceLayout**: `Object`
Expand Down
26 changes: 13 additions & 13 deletions docs/generated/devkit/Workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use ProjectsConfigurations or NxJsonConfiguration
- [cli](../../devkit/documents/Workspace#cli): Object
- [defaultBase](../../devkit/documents/Workspace#defaultbase): string
- [defaultProject](../../devkit/documents/Workspace#defaultproject): string
- [enableDbCache](../../devkit/documents/Workspace#enabledbcache): boolean
- [extends](../../devkit/documents/Workspace#extends): string
- [generators](../../devkit/documents/Workspace#generators): Object
- [implicitDependencies](../../devkit/documents/Workspace#implicitdependencies): ImplicitDependencyEntry<string[] | "\*">
Expand All @@ -42,6 +41,7 @@ use ProjectsConfigurations or NxJsonConfiguration
- [tasksRunnerOptions](../../devkit/documents/Workspace#tasksrunneroptions): Object
- [useDaemonProcess](../../devkit/documents/Workspace#usedaemonprocess): boolean
- [useInferencePlugins](../../devkit/documents/Workspace#useinferenceplugins): boolean
- [useLegacyCache](../../devkit/documents/Workspace#uselegacycache): boolean
- [version](../../devkit/documents/Workspace#version): number
- [workspaceLayout](../../devkit/documents/Workspace#workspacelayout): Object

Expand Down Expand Up @@ -119,18 +119,6 @@ will be used. Convenient for small workspaces with one main application.

---

### enableDbCache

`Optional` **enableDbCache**: `boolean`

Enable the new experimental db based cache

#### Inherited from

[NxJsonConfiguration](../../devkit/documents/NxJsonConfiguration).[enableDbCache](../../devkit/documents/NxJsonConfiguration#enabledbcache)

---

### extends

`Optional` **extends**: `string`
Expand Down Expand Up @@ -409,6 +397,18 @@ Set this to false to disable adding inference plugins when generating new projec

---

### useLegacyCache

`Optional` **useLegacyCache**: `boolean`

Use the legacy file system cache instead of the db cache

#### Inherited from

[NxJsonConfiguration](../../devkit/documents/NxJsonConfiguration).[useLegacyCache](../../devkit/documents/NxJsonConfiguration#uselegacycache)

---

### version

**version**: `number`
Expand Down
2 changes: 1 addition & 1 deletion packages/nx/src/adapter/compat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const allowedWorkspaceExtensions = [
'useInferencePlugins',
'neverConnectToCloud',
'sync',
'enableDbCache',
'useLegacyCache',
] as const;

if (!patched) {
Expand Down
4 changes: 2 additions & 2 deletions packages/nx/src/config/nx-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,9 +517,9 @@ export interface NxJsonConfiguration<T = '*' | string[]> {
sync?: NxSyncConfiguration;

/**
* Enable the new experimental db based cache
* Use the legacy file system cache instead of the db cache
*/
enableDbCache?: boolean;
useLegacyCache?: boolean;
}

export type PluginConfiguration = string | ExpandedPluginConfiguration;
Expand Down
3 changes: 2 additions & 1 deletion packages/nx/src/tasks-runner/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export type TaskWithCachedResult = { task: Task; cachedResult: CachedResult };
export function dbCacheEnabled(nxJson: NxJsonConfiguration = readNxJson()) {
return (
process.env.NX_DISABLE_DB !== 'true' &&
(nxJson.enableDbCache === true || process.env.NX_DB_CACHE === 'true')
nxJson.useLegacyCache !== true &&
process.env.NX_DB_CACHE !== 'false'
);
}

Expand Down

0 comments on commit 7c600f1

Please sign in to comment.