Skip to content

Commit 2377929

Browse files
committed
fix changes that broke our new publishing guarantees
1 parent 179f622 commit 2377929

6 files changed

Lines changed: 29 additions & 9 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"include": [
4+
"../src/**/*.ts",
5+
"../src/**/*.tsx",
6+
"../src/**/*.json",
7+
"../../path-store/src/**/*.ts"
8+
],
9+
"compilerOptions": {
10+
"rootDir": "../../.."
11+
}
12+
}

packages/trees/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export type {
6868
FileTreeControllerBaseOptions,
6969
FileTreeControllerListener,
7070
FileTreeControllerOptions,
71+
FileTreeDirectoryLoadState,
7172
FileTreeDirectoryHandle,
7273
FileTreeDragAndDropConfig,
7374
FileTreeDropContext,

packages/trees/src/model/loading/reveal.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { PathStore } from '@pierre/path-store';
2-
import type { PathStoreOptions } from '@pierre/path-store';
32

4-
import type { FileTreeRevealDirectorySnapshot } from '../types';
3+
import type {
4+
FileTreeRevealDirectorySnapshot,
5+
FileTreeSortComparator,
6+
} from '../types';
57

68
export interface PreparedRevealDirectorySnapshot {
79
childDirectoryKnownChildCountByPath: ReadonlyMap<string, number>;
@@ -55,7 +57,7 @@ export function prepareRevealDirectorySnapshot({
5557
directoryPath: string;
5658
onCustomSort: () => void;
5759
snapshot: FileTreeRevealDirectorySnapshot;
58-
sort: PathStoreOptions['sort'] | undefined;
60+
sort: 'default' | FileTreeSortComparator | undefined;
5961
}): PreparedRevealDirectorySnapshot {
6062
const childPaths = [...snapshot.children];
6163
const hintSidecar = snapshot.childDirectoryKnownChildCounts;

packages/trees/src/model/types.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import type { PathStoreDirectoryLoadState } from '@pierre/path-store';
2-
31
import type { FileTreeIcons, RemappedIcon } from '../iconConfig';
42
import type { FileTreePreparedInput } from '../preparedInput';
53
import type {
@@ -47,6 +45,12 @@ export type FileTreeSortComparator = (
4745

4846
export type FileTreeInitialExpansion = 'closed' | 'open' | number;
4947

48+
export type FileTreeDirectoryLoadState =
49+
| 'unloaded'
50+
| 'loading'
51+
| 'loaded'
52+
| 'error';
53+
5054
export interface FileTreeRemoveOptions {
5155
recursive?: boolean;
5256
}
@@ -430,7 +434,7 @@ export interface FileTreeRevealLoadingInfo {
430434
errorMessage?: string;
431435
knownChildCount?: number;
432436
path: FileTreePublicId;
433-
state: PathStoreDirectoryLoadState;
437+
state: FileTreeDirectoryLoadState;
434438
}
435439

436440
export interface FileTreeRevealLoadingStartedEvent {

packages/trees/src/preparedInput.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { PathStore } from '@pierre/path-store';
2-
import type { PathStorePreparedInput } from '@pierre/path-store';
32

43
import type { FileTreeSortComparator } from './model/types';
54

@@ -32,6 +31,6 @@ export function preparePresortedFileTreeInput(
3231

3332
export function toPathStorePreparedInput(
3433
preparedInput: FileTreePreparedInput
35-
): PathStorePreparedInput {
36-
return preparedInput as unknown as PathStorePreparedInput;
34+
): { paths: readonly string[] } {
35+
return preparedInput;
3736
}

packages/trees/tsdown.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ const config: UserConfig = defineConfig([
1212
tsconfig: './tsconfig.json',
1313
clean: true,
1414
dts: {
15+
cwd: '../..',
1516
sourcemap: true,
17+
tsconfig: 'packages/trees/scripts/tsconfig.dts.json',
1618
tsgo: true,
1719
},
1820
unbundle: true,

0 commit comments

Comments
 (0)