-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- fixes #1085 - include core, extensions, platform-bible-utils, platform-bible-react - fix existing type checking errors - add typecheck to pre-commit - use `noImplicitReturns` instead of `consistent-return` - also make VS Code use the repo TS version - remember to remove the patch and the type overrides when the BNF types are fixed
- Loading branch information
1 parent
74e11c2
commit fef702e
Showing
44 changed files
with
162 additions
and
337 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
echo "Running Lint check..." | ||
|
||
echo "Lint checking..." | ||
# generate papi.d.ts as part of lint:staged | ||
npm run lint:staged | ||
echo "Lint check finished" | ||
|
||
echo "Type checking..." | ||
npm run typecheck | ||
echo "Type check finished" | ||
|
||
echo "If the following fails run npm run editor:unlink" | ||
npx yalc check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
extensions/src/hello-world/src/web-views/hello-world.web-view.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
...ons/src/platform-scripture-editor/src/types/@biblionexus-foundation__platform-editor.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/** | ||
* Work-around until the `@biblionexus-foundation/platform-editor` package fully includes its types. | ||
* Note there is also a patch that should be removed when this is fixed. | ||
*/ | ||
|
||
declare module 'shared-react/annotation/selection.model' { | ||
type UsjLocation = { | ||
jsonPath: string; | ||
offset: number; | ||
}; | ||
|
||
export type SelectionRange = { | ||
start: UsjLocation; | ||
end?: UsjLocation; | ||
}; | ||
|
||
export type AnnotationRange = { | ||
start: UsjLocation; | ||
end: UsjLocation; | ||
}; | ||
} | ||
|
||
declare module 'shared-react/nodes/scripture/usj/ImmutableNoteCallerNode' { | ||
export const immutableNoteCallerNodeName = 'ImmutableNoteCallerNode'; | ||
} | ||
|
||
declare module 'shared-react/plugins/logger-basic.model' { | ||
export type LoggerBasic = { | ||
error(message: string): void; | ||
warn(message: string): void; | ||
info(message: string): void; | ||
}; | ||
} | ||
|
||
declare module 'shared-react/plugins/text-direction.model' { | ||
/** Left-to-right or Right-to-left or Automatically determined from the content. */ | ||
export type TextDirection = 'ltr' | 'rtl' | 'auto'; | ||
} | ||
|
||
declare module 'shared-react/nodes/scripture/usj/usj-node-options.model' { | ||
import { SyntheticEvent } from 'react'; | ||
|
||
/** Option properties to use with each node. */ | ||
type NodeOptions = { [nodeClassName: string]: { [prop: string]: unknown } | undefined }; | ||
type OnClick = (event: SyntheticEvent) => void; | ||
const immutableNoteCallerNodeName = 'ImmutableNoteCallerNode'; | ||
|
||
export const MarkNodeName = 'MarkNode'; | ||
|
||
export type AddMissingComments = (usjCommentIds: string[]) => void; | ||
|
||
/** Options for each editor node. */ | ||
export interface UsjNodeOptions extends NodeOptions { | ||
[immutableNoteCallerNodeName]?: { | ||
/** Possible note callers to use when caller is '+'. */ | ||
noteCallers?: string[]; | ||
/** Click handler method. */ | ||
onClick?: OnClick; | ||
}; | ||
[MarkNodeName]?: { | ||
/** Method to add missing comments. */ | ||
addMissingComments?: AddMissingComments; | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
{ | ||
"extends": "./tsconfig", | ||
"files": [".eslintrc.cjs", "edit-papi-d-ts.ts", "papi.d.ts"] | ||
"extends": "../../tsconfig", | ||
"compilerOptions": { | ||
"module": "ESNext", | ||
"baseUrl": "./", | ||
"noEmit": true | ||
}, | ||
"include": [".eslintrc.cjs", "edit-papi-d-ts.ts", "papi.d.ts"], | ||
"exclude": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
patches/@biblionexus-foundation+platform-editor+0.6.4.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/node_modules/@biblionexus-foundation/platform-editor/dist/index.d.ts b/node_modules/@biblionexus-foundation/platform-editor/dist/index.d.ts | ||
index fae3dbf..471303c 100644 | ||
--- a/node_modules/@biblionexus-foundation/platform-editor/dist/index.d.ts | ||
+++ b/node_modules/@biblionexus-foundation/platform-editor/dist/index.d.ts | ||
@@ -5,7 +5,7 @@ import { LoggerBasic } from 'shared-react/plugins/logger-basic.model'; | ||
import { ScriptureReference } from 'platform-bible-utils'; | ||
import { SelectionRange } from 'shared-react/annotation/selection.model'; | ||
import { TextDirection } from 'shared-react/plugins/text-direction.model'; | ||
-import { Usj } from '../../../utilities/src'; | ||
+import { Usj } from '@biblionexus-foundation/scripture-utilities'; | ||
import { UsjNodeOptions } from 'shared-react/nodes/scripture/usj/usj-node-options.model'; | ||
|
||
declare type Comment_2 = { |
Oops, something went wrong.