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

feat: Start migration to typescript #18

Draft
wants to merge 68 commits into
base: refactor/ts-migration
Choose a base branch
from

Conversation

Maks1mS
Copy link
Contributor

@Maks1mS Maks1mS commented Aug 10, 2020

Introduction

I started the migration to Typescript because you have written this in your TODO in README. I changed the main files for working with autocomplete and static types for props.
изображение

Changes

  • added rollup for optimizing bundle with babel and typescript definitions;
  • changed rm -rf to rimraf for working from Windows;
  • removed some unused dependencies which I handle with depcheck;
    Also can be removed:
    изображение

Current known flaws/bugs:

  • can't handle useAliases: false;
  • can't throw an error, when incorrect props set, like in styled-components;
    изображение
  • change string to string literal
    For example:
font-weight: number | string

to

font-weight: "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "bold" | "normal" | (number & {}) | "bolder" | "lighter"

Some details

I set type for keys of dict object to keyof CSS.PropertiesHyphen from csstype, but some CSS properties were not found (some of this I can't find in MDN!).
Also I changed mistype 'outline-width|thin|medium|thick' to 'outline-width'.

For generating valid types of dict(full name and aliases) I create a script, which you can run

$ npm run dict

I don’t know if it’s the best way, but I haven’t come up with another solution.

TODO

I am describing this task for all contributors because I do not know if I will do it.

  • Fix all bugs and flaws
    • can't handle useAliases: false
    • can't throw an error, when incorrect props set, like in styled-components;
  • Change type from string to string literals.
  • Change other files to typescript
  • Remove all 'any'
  • Update tests for typescript

P.S.

I think that this pull request need be merged into 'feat/typescript' for additional changes instead 'master', but I can't do this, because 'feat/typescript' doesn't exist.

@Maks1mS Maks1mS marked this pull request as ready for review August 10, 2020 10:20
@eddort
Copy link
Member

eddort commented Aug 11, 2020

Hi, thank you for your contribution.
Today we're working on a new big patch at quarkly.io.
In a couple of days, I'm gonna start working on atomize and we're will merge this PR to the master.

@Mobydack Mobydack changed the base branch from master to refactor/ts-migration April 15, 2021 09:30
dependabot bot and others added 16 commits May 11, 2021 15:43
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.19...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>
…de-fetch-2.6.1

build(deps): bump node-fetch from 2.6.0 to 2.6.1
…i-1.3.8

build(deps): bump ini from 1.3.5 to 1.3.8
…sted-git-info-2.8.9

build(deps): bump hosted-git-info from 2.8.8 to 2.8.9
dependabot bot and others added 26 commits June 11, 2021 10:56
Bumps [normalize-url](https://github.com/sindresorhus/normalize-url) from 4.5.0 to 4.5.1.
- [Release notes](https://github.com/sindresorhus/normalize-url/releases)
- [Commits](https://github.com/sindresorhus/normalize-url/commits)

---
updated-dependencies:
- dependency-name: normalize-url
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
…rmalize-url-4.5.1

build(deps): bump normalize-url from 4.5.0 to 4.5.1
Support for custom validators for forwarding properties.
FEAT: support flag for the skip style property
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)

---
updated-dependencies:
- dependency-name: tmpl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
…th-parse-1.0.7

build(deps): bump path-parse from 1.0.6 to 1.0.7
…pl-1.0.5

build(deps): bump tmpl from 1.0.4 to 1.0.5
@Maks1mS Maks1mS marked this pull request as draft July 28, 2023 14:57
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.

5 participants