asgerf / dts-tree-sitter Goto Github PK
View Code? Open in Web Editor NEWGenerate TypeScript .d.ts files for using tree-sitter grammars.
License: MIT License
Generate TypeScript .d.ts files for using tree-sitter grammars.
License: MIT License
I receive an error when attempting to install this via npm. The error is pasted below (sensitive information redacted).
~/...... % npm i @asgerf/dts-tree-sitter npm ERR! code 1 npm ERR! path ~/....../node_modules/@asgerf/dts-tree-sitter/node_modules/tree-sitter npm ERR! command failed npm ERR! command sh -c prebuild-install || node-gyp rebuild npm ERR! CC(target) Release/obj.target/tree_sitter/vendor/tree-sitter/lib/src/lib.o npm ERR! LIBTOOL-STATIC Release/tree_sitter.a npm ERR! CXX(target) Release/obj.target/tree_sitter_runtime_binding/src/binding.o npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using [email protected] npm ERR! gyp info using [email protected] | darwin | x64 npm ERR! gyp info find Python using Python version 3.8.2 found at "/Library/Developer/CommandLineTools/usr/bin/python3" npm ERR! (node:58019) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only. npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created) npm ERR! gyp info spawn /Library/Developer/CommandLineTools/usr/bin/python3 npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '~/.npm-global/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py', npm ERR! gyp info spawn args 'binding.gyp', npm ERR! gyp info spawn args '-f', npm ERR! gyp info spawn args 'make', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '~/....../node_modules/@asgerf/dts-tree-sitter/node_modules/tree-sitter/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '~/.npm-global/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '~/Library/Caches/node-gyp/16.4.1/include/node/common.gypi', npm ERR! gyp info spawn args '-Dlibrary=shared_library', npm ERR! gyp info spawn args '-Dvisibility=default', npm ERR! gyp info spawn args '-Dnode_root_dir=~/Library/Caches/node-gyp/16.4.1', npm ERR! gyp info spawn args '-Dnode_gyp_dir=~/.npm-global/lib/node_modules/npm/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=~/Library/Caches/node-gyp/16.4.1/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=~/....../node_modules/@asgerf/dts-tree-sitter/node_modules/tree-sitter', npm ERR! gyp info spawn args '-Dnode_engine=v8', npm ERR! gyp info spawn args '--depth=.', npm ERR! gyp info spawn args '--no-parallel', npm ERR! gyp info spawn args '--generator-output', npm ERR! gyp info spawn args 'build', npm ERR! gyp info spawn args '-Goutput_dir=.' npm ERR! gyp info spawn args ] npm ERR! gyp info spawn make npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] npm ERR! In file included from ../src/binding.cc:1: npm ERR! In file included from ~/Library/Caches/node-gyp/16.4.1/include/node/node.h:63: npm ERR! In file included from ~/Library/Caches/node-gyp/16.4.1/include/node/v8.h:30: npm ERR! ~/Library/Caches/node-gyp/16.4.1/include/node/v8-internal.h:454:38: error: no template named 'remove_cv_t' in namespace 'std'; did you mean 'remove_cv'? npm ERR! !std::is_same>::value>::Perform(data); npm ERR! ~~~~~^~~~~~~~~~~ npm ERR! remove_cv npm ERR! /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/type_traits:710:50: note: 'remove_cv' declared here npm ERR! template struct _LIBCPP_TEMPLATE_VIS remove_cv npm ERR! ^ npm ERR! 1 error generated. npm ERR! make: *** [Release/obj.target/tree_sitter_runtime_binding/src/binding.o] Error 1 npm ERR! gyp ERR! build error npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2 npm ERR! gyp ERR! stack at ChildProcess.onExit (~/.npm-global/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:394:28) npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12) npm ERR! gyp ERR! System Darwin 20.6.0 npm ERR! gyp ERR! command "~/.npm-global/bin/node" "~/.npm-global/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd ~/....../node_modules/@asgerf/dts-tree-sitter/node_modules/tree-sitter npm ERR! gyp ERR! node -v v16.4.1 npm ERR! gyp ERR! node-gyp -v v7.1.2 npm ERR! gyp ERR! not ok
I'm not sure why, but might be due to the dependencies locking this down.
Running npm install
with this dependency causes it to fail due to node-gyp.
Please see elm-tooling/tree-sitter-elm#122 for more context
Was wondering if this could also be a step up to unparsing existing code. I.e generate a visitor on top of this, that can put the ast back into javascript (that kinda is similar)? Any ideas/thoughts on this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.