Skip to content

Commit bec0c46

Browse files
committed
Release v18.0.0
1 parent ba25309 commit bec0c46

File tree

9 files changed

+211
-118
lines changed

9 files changed

+211
-118
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6+
## 18.0.0
7+
8+
## Breaking Changes
9+
10+
- Nx support starts at 18.0.0
11+
- Nx issue [https://github.com/nrwl/nx/issues/20689](#20689) requires us to set `skipLibCheck: true` inside the `tsconfig.json` of `nx-remotecache-*` packages.
12+
613
## 17.1.1
714

815
### Chore

lib/create-custom-runner.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { Task } from "nx/src/config/task-graph";
2-
import type { RemoteCache } from "nx/src/tasks-runner/default-tasks-runner";
31
import defaultTasksRunner from "nx/tasks-runners/default";
42
import { createRemoteCacheRetrieve } from "./create-remote-cache-retrieve";
53
import { createRemoteCacheStore } from "./create-remote-cache-store";
64
import { getSafeRemoteCacheImplementation } from "./get-safe-remote-cache-implementation";
75
import * as log from "./log";
86
import { CustomRunnerOptions } from "./types/custom-runner-options";
7+
import { NxRemoteCache, NxTask } from "./types/nx";
98
import { RemoteCacheImplementation } from "./types/remote-cache-implementation";
109

1110
type DefaultTasksRunner = typeof defaultTasksRunner;
@@ -15,7 +14,7 @@ const cacheNoop = async () => false;
1514
const createRemoteCache = (
1615
implementation: Promise<RemoteCacheImplementation>,
1716
options: CustomRunnerOptions
18-
): RemoteCache => {
17+
): NxRemoteCache => {
1918
const read = process.env.NXCACHE_READ
2019
? process.env.NXCACHE_READ !== "false"
2120
: options.read ?? true;
@@ -50,7 +49,7 @@ export const createCustomRunner =
5049
<T extends Object>(
5150
setup: (
5251
options: CustomRunnerOptions<T>,
53-
tasks: Task[]
52+
tasks: NxTask[]
5453
) => Promise<RemoteCacheImplementation>
5554
): DefaultTasksRunner =>
5655
(tasks, options, context) =>

lib/create-remote-cache-retrieve.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { mkdir, writeFile } from "fs/promises";
2-
import type { RemoteCache } from "nx/src/tasks-runner/default-tasks-runner";
2+
33
import { join } from "path";
44
import { Readable } from "stream";
55
import { pipeline } from "stream/promises";
66
import { extract } from "tar";
77
import { createFilterSourceFile } from "./create-filter-source-file";
88
import { getFileNameFromHash } from "./get-file-name-from-hash";
9+
import { NxRemoteCache } from "./types/nx";
910
import { SafeRemoteCacheImplementation } from "./types/safe-remote-cache-implementation";
1011

1112
const COMMIT_FILE_EXTENSION = ".commit";
@@ -35,7 +36,7 @@ const writeCommitFile = (destination: string) => {
3536
export const createRemoteCacheRetrieve =
3637
(
3738
safeImplementation: Promise<SafeRemoteCacheImplementation | null>
38-
): RemoteCache["retrieve"] =>
39+
): NxRemoteCache["retrieve"] =>
3940
async (hash, cacheDirectory) => {
4041
const implementation = await safeImplementation;
4142

lib/create-remote-cache-store.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import type { RemoteCache } from "nx/src/tasks-runner/default-tasks-runner";
21
import { Readable } from "stream";
32
import { create } from "tar";
43
import { createFilterSourceFile } from "./create-filter-source-file";
54
import { getFileNameFromHash } from "./get-file-name-from-hash";
5+
import { NxRemoteCache } from "./types/nx";
66
import { SafeRemoteCacheImplementation } from "./types/safe-remote-cache-implementation";
77

88
const archiveFolder = (cwd: string, hash: string): Readable =>
@@ -13,7 +13,7 @@ const archiveFolder = (cwd: string, hash: string): Readable =>
1313
export const createRemoteCacheStore =
1414
(
1515
safeImplementation: Promise<SafeRemoteCacheImplementation | null>
16-
): RemoteCache["store"] =>
16+
): NxRemoteCache["store"] =>
1717
async (hash, cacheDirectory) => {
1818
const implementation = await safeImplementation;
1919

lib/types/custom-runner-options.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import type { DefaultTasksRunnerOptions } from "nx/src/tasks-runner/default-tasks-runner";
1+
import { NxDefaultTasksRunnerOptions } from "./nx";
22

33
export type CustomRunnerOptions<T extends Object = Object> = T &
4-
DefaultTasksRunnerOptions & {
4+
NxDefaultTasksRunnerOptions & {
55
/**
66
* Sets task runner name for logging.
77
*/

lib/types/nx.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Re-export types here to avoid needing to update "private" paths everywhere
2+
3+
import { Task } from "nx/src/config/task-graph";
4+
import type {
5+
DefaultTasksRunnerOptions,
6+
RemoteCache,
7+
} from "nx/src/tasks-runner/default-tasks-runner";
8+
9+
export type NxDefaultTasksRunnerOptions = DefaultTasksRunnerOptions;
10+
export type NxRemoteCache = RemoteCache;
11+
export type NxTask = Task;

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nx-remotecache-custom",
3-
"version": "17.1.1",
3+
"version": "18.0.0",
44
"description": "Build custom caching for @nrwl/nx in a few lines of code",
55
"main": "index.js",
66
"typings": "index.d.ts",
@@ -31,7 +31,7 @@
3131
"devDependencies": {
3232
"@types/tar": "^6.1.3",
3333
"@types/yargs": "^17.0.13",
34-
"nx": "^17.0.0",
34+
"nx": "^18.0.0",
3535
"typescript": "^5.1.0"
3636
},
3737
"dependencies": {
@@ -40,6 +40,6 @@
4040
"tar": "^6.1.12"
4141
},
4242
"peerDependencies": {
43-
"nx": "^17.0.0"
43+
"nx": "^18.0.0"
4444
}
45-
}
45+
}

0 commit comments

Comments
 (0)