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: ➕ add types #28

Merged
merged 15 commits into from
Aug 16, 2021
Merged

feat: ➕ add types #28

merged 15 commits into from
Aug 16, 2021

Conversation

Beraliv
Copy link
Contributor

@Beraliv Beraliv commented Aug 13, 2021

Fixes #27

build/scroller.d.ts Outdated Show resolved Hide resolved
build/scroller.d.ts Outdated Show resolved Hide resolved
@Beraliv
Copy link
Contributor Author

Beraliv commented Aug 13, 2021

@bespoyasov please have a look!

From my perspective, it's ready for pre-release, we may test it in different environments now (I have 2-3 project to do that)

Copy link
Owner

@bespoyasov bespoyasov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's awesome! Thanks a lot ^_^

I left a couple of ideas on how to improve the typings but except for that, the PR is ready to be merged 🚀

I will be able to create a new release the next week right after we merge this PR.

build/scroller.d.ts Show resolved Hide resolved
build/scroller.d.ts Outdated Show resolved Hide resolved
build/scroller.d.ts Outdated Show resolved Hide resolved
build/scroller.d.ts Outdated Show resolved Hide resolved
build/scroller.d.ts Outdated Show resolved Hide resolved
tsconfig.json Show resolved Hide resolved
Copy link
Owner

@bespoyasov bespoyasov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥☄️

Will merge this as soon as I can ^_^

@Beraliv
Copy link
Contributor Author

Beraliv commented Aug 13, 2021

@bespoyasov don't rush, I also couldn't add peerDependency quick, as npm i isn't working for me and it crushed with a lot of errors:

beraliv@Alexeys-MBP scroller % npm i 

> node-sass@3.13.1 install /Users/beraliv/Documents/Code/scroller/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v3.13.1/darwin-x64-72_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.1/darwin-x64-72_binding.node": 

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g. 

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> node-sass@3.13.1 postinstall /Users/beraliv/Documents/Code/scroller/node_modules/node-sass
> node scripts/build.js

Building: /usr/local/bin/node /Users/beraliv/Documents/Code/scroller/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   '/usr/local/bin/node',
gyp verb cli   '/Users/beraliv/Documents/Code/scroller/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library='
gyp verb cli ]
gyp info using node-gyp@3.6.2
gyp info using node@12.16.1 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 /usr/local/bin/python2
gyp verb check python version `/usr/local/bin/python2 -c "import platform; print(platform.python_version());"` returned: "2.7.16\n"
gyp verb get node dir no --target version specified, falling back to host node version: 12.16.1
gyp verb command install [ '12.16.1' ]
gyp verb install input version string "12.16.1"
gyp verb install installing version: 12.16.1
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 12.16.1
gyp verb build dir attempting to create "build" dir: /Users/beraliv/Documents/Code/scroller/node_modules/node-sass/build
gyp verb build dir "build" dir needed to be created? /Users/beraliv/Documents/Code/scroller/node_modules/node-sass/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /Users/beraliv/Documents/Code/scroller/node_modules/node-sass/build/config.gypi
gyp verb config.gypi checking for gypi file: /Users/beraliv/Documents/Code/scroller/node_modules/node-sass/config.gypi
gyp verb common.gypi checking for gypi file: /Users/beraliv/Documents/Code/scroller/node_modules/node-sass/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /usr/local/bin/python2
gyp info spawn args [
gyp info spawn args   '/Users/beraliv/Documents/Code/scroller/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/beraliv/Documents/Code/scroller/node_modules/node-sass/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/beraliv/Documents/Code/scroller/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/beraliv/.node-gyp/12.16.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/beraliv/.node-gyp/12.16.1',
gyp info spawn args   '-Dnode_gyp_dir=/Users/beraliv/Documents/Code/scroller/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/beraliv/.node-gyp/12.16.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/beraliv/Documents/Code/scroller/node_modules/node-sass',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512
Traceback (most recent call last):
  File "/Users/beraliv/Documents/Code/scroller/node_modules/node-gyp/gyp/gyp_main.py", line 16, in <module>
    sys.exit(gyp.script_main())
  File "/Users/beraliv/Documents/Code/scroller/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 545, in script_main
    return main(sys.argv[1:])
  File "/Users/beraliv/Documents/Code/scroller/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 538, in main
    return gyp_main(args)
  File "/Users/beraliv/Documents/Code/scroller/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 514, in gyp_main
    options.duplicate_basename_check)
  File "/Users/beraliv/Documents/Code/scroller/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 98, in Load
    generator.CalculateVariables(default_variables, params)
  File "/Users/beraliv/Documents/Code/scroller/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 77, in CalculateVariables
    import gyp.generator.xcode as xcode_generator
  File "/Users/beraliv/Documents/Code/scroller/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py", line 7, in <module>
    import gyp.xcodeproj_file
  File "/Users/beraliv/Documents/Code/scroller/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py", line 152, in <module>
    _new_sha1 = hashlib.sha1
AttributeError: 'module' object has no attribute 'sha1'
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/beraliv/Documents/Code/scroller/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack     at ChildProcess.emit (events.js:311:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 20.6.0
gyp ERR! command "/usr/local/bin/node" "/Users/beraliv/Documents/Code/scroller/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/beraliv/Documents/Code/scroller/node_modules/node-sass
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
Build failed with error code: 1
npm WARN prokrutchik@2.3.9 requires a peer of typescript@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN browserify-shim@2.0.10 requires a peer of browserify@>= 2.3.0 < 4 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/beraliv/.npm/_logs/2021-08-13T12_45_37_028Z-debug.log

Do you know what can be a problem?

@bespoyasov
Copy link
Owner

bespoyasov commented Aug 13, 2021

Oh, my bad.

It is from one of the unused packages. I cleaned up package.json a bit for now, though the project desperately needs refactoring 😞

@Beraliv
Copy link
Contributor Author

Beraliv commented Aug 14, 2021

Oh, my bad.

It is from one of the unused packages. I cleaned up package.json a bit for now, though the project desperately needs refactoring 😞

All good, that's why I asked 😅

@bespoyasov
Copy link
Owner

Thank you!
I will merge this and create a new release on npm on Monday :–)

@Beraliv
Copy link
Contributor Author

Beraliv commented Aug 15, 2021

@bespoyasov thank you for helping me with all the comments

@bespoyasov bespoyasov merged commit f2446d5 into bespoyasov:master Aug 16, 2021
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.

Add TS annotations
2 participants