Skip to content

Commit

Permalink
feat(conflicter): move mem-fs to peer dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Oct 11, 2023
1 parent 8ddeddb commit ca73310
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
7 changes: 5 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions workspaces/conflicter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"dateformat": "^5.0.3",
"diff": "^5.1.0",
"isbinaryfile": "^5.0.0",
"mem-fs": "^3.0.0",
"mem-fs-editor": "^10.0.2",
"minimatch": "^9.0.0",
"p-transform": "^4.0.5",
Expand All @@ -57,13 +56,17 @@
"slash": "^5.1.0"
},
"peerDependencies": {
"@yeoman/types": "^1.0.0"
"@yeoman/types": "^1.0.0",
"mem-fs": "^3.0.0"
},
"engines": {
"node": "^16.13.0 || >=18.12.0"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"acceptDependencies": {
"mem-fs": ">=3.0.0"
}
}
6 changes: 3 additions & 3 deletions workspaces/conflicter/src/conflicter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export type ConflictedFile = ConflicterFile & {
changesDetected: true;
};

export type ConflicterOptions = {
memFs?: Store;
export type ConflicterOptions<File extends { path: string } = MemFsEditorFile> = {
memFs?: Store<File>;
force?: boolean;
bail?: boolean;
ignoreWhitespace?: boolean;
Expand Down Expand Up @@ -82,7 +82,7 @@ export class Conflicter {

constructor(private readonly adapter: InputOutputAdapter, options?: ConflicterOptions) {
if (options?.memFs) {
this.fs = createMemFsEditor(options?.memFs as Store<MemFsEditorFile>) as MemFsEditor<MemFsEditorFile>;
this.fs = createMemFsEditor(options?.memFs);
}

this.force = options?.force ?? false;
Expand Down

0 comments on commit ca73310

Please sign in to comment.