Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add strict types to sdk #1308

Merged
merged 30 commits into from
Feb 15, 2024
Merged

Add strict types to sdk #1308

merged 30 commits into from
Feb 15, 2024

Conversation

longzheng
Copy link
Contributor

@longzheng longzheng commented Feb 11, 2024

Enable TypeScript strict for sdk/types

Enable TypeScript strict strict for sdk

Fix various type-related issues

Add build-sdk GitHub Actions workflow to ensure SDK builds and doesn't have errors

sdk/src/index.ts Outdated Show resolved Hide resolved
@longzheng

This comment was marked as resolved.

sdk/src/storage-settings.ts Outdated Show resolved Hide resolved
@longzheng

This comment was marked as resolved.

sdk/types/tsconfig.json Outdated Show resolved Hide resolved
sdk/src/index.ts Outdated Show resolved Hide resolved
sdk/src/index.ts Outdated Show resolved Hide resolved
sdk/src/index.ts Outdated Show resolved Hide resolved
sdk/types/src/types.input.ts Outdated Show resolved Hide resolved
sdk/src/index.ts Outdated Show resolved Hide resolved
sdk/src/index.ts Outdated Show resolved Hide resolved
sdk/src/index.ts Outdated Show resolved Hide resolved
sdk/src/index.ts Outdated Show resolved Hide resolved
@koush
Copy link
Owner

koush commented Feb 14, 2024

getting closer, I added some changes to accommodate some things your change pointed out.

@longzheng
Copy link
Contributor Author

I merge in fixes from #1321 so that should be merged first.

@koush
Copy link
Owner

koush commented Feb 15, 2024

merged that, but conflicts on this for some reason

@longzheng
Copy link
Contributor Author

@koush resolved the conflicts

sdk/src/index.ts Outdated Show resolved Hide resolved
sdk/src/storage-settings.ts Outdated Show resolved Hide resolved
@koush koush merged commit dd7d920 into koush:main Feb 15, 2024
1 check passed
rustyd0g pushed a commit to rustyd0g/scrypted that referenced this pull request Feb 17, 2024
* Enable strict mode

* Add @types/node

Remove @types/rimraf

* Fix `include` path to be actual `src`

* Add strict to `sdk`

* Assert `getItem`

* Fix types in SDK

* Refactor SDK function to be type safe

* parseValue handle value null or undefined

* Fix types tsconfig

* Make getDeviceConsole required

* Add build-sdk workflow

* Set working directory

* Assert not undefined

* Remove optionals

* Undo addScryptedInterfaceProperties, revert to self executing function

* Use different type

* Make _deviceState private and add ts-ignore

* Remove unused function

* Remove non-null asserts

* Add tsconfig for sdk/types/src

* Get property isOptional from schema

Use typedoc types

* Type fixes

* Fix type

* Fix type

* Revert change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants