diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea998de..29a9cdb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,21 +1,25 @@ name: CI + on: push: branches: [master] + paths: pull_request: - branches: [master] + jobs: build: + name: Run tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v4 + - uses: tree-sitter/setup-action@v1 + with: + install-lib: false + - run: npm i + - run: tree-sitter generate + - uses: tree-sitter/parser-test-action@v1.2 with: - node-version: '16' - - name: Install dependencies - run: npm ci - - name: Run tests - run: npm test + test-library: true - name: Parse Petalisp run: | git submodule init @@ -30,5 +34,3 @@ jobs: else echo "Successfully parsed Sly" fi - - name: Run tests - run: npm test diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..ae6ba35 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,15 @@ +name: Publish package + +on: + push: + tags: ["*"] + +jobs: + npm: + uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main + secrets: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + crates: + uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main + secrets: + CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_TOKEN}} diff --git a/Cargo.lock b/Cargo.lock index e7186ad..5fa51f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,39 +4,30 @@ version = 3 [[package]] name = "aho-corasick" -version = "1.0.4" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "cc" -version = "1.0.83" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] - -[[package]] -name = "libc" -version = "0.2.147" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "regex" -version = "1.9.3" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", @@ -46,9 +37,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.6" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", @@ -57,9 +48,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "tree-sitter" diff --git a/bindings/node/binding.cc b/bindings/node/binding.cc index 0695ec3..25265d8 100644 --- a/bindings/node/binding.cc +++ b/bindings/node/binding.cc @@ -4,7 +4,7 @@ using namespace v8; -extern "C" TSLanguage * tree_sitter_jinja2(); +extern "C" TSLanguage * tree_sitter_commonlisp(); namespace { @@ -17,12 +17,12 @@ void Init(Local exports, Local module) { Local constructor = Nan::GetFunction(tpl).ToLocalChecked(); Local instance = constructor->NewInstance(Nan::GetCurrentContext()).ToLocalChecked(); - Nan::SetInternalFieldPointer(instance, 0, tree_sitter_jinja2()); + Nan::SetInternalFieldPointer(instance, 0, tree_sitter_commonlisp()); - Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("jinja2").ToLocalChecked()); + Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("commonlisp").ToLocalChecked()); Nan::Set(module, Nan::New("exports").ToLocalChecked(), instance); } -NODE_MODULE(tree_sitter_jinja2_binding, Init) +NODE_MODULE(tree_sitter_commonlisp_binding, Init) } // namespace diff --git a/bindings/node/index.js b/bindings/node/index.js index 4eff491..8d6fb0d 100644 --- a/bindings/node/index.js +++ b/bindings/node/index.js @@ -1,11 +1,11 @@ try { - module.exports = require("../../build/Release/tree_sitter_jinja2_binding"); + module.exports = require("../../build/Release/tree_sitter_commonlisp_binding"); } catch (error1) { if (error1.code !== 'MODULE_NOT_FOUND') { throw error1; } try { - module.exports = require("../../build/Debug/tree_sitter_jinja2_binding"); + module.exports = require("../../build/Debug/tree_sitter_commonlisp_binding"); } catch (error2) { if (error2.code !== 'MODULE_NOT_FOUND') { throw error2; diff --git a/bindings/rust/lib.rs b/bindings/rust/lib.rs index 22462bc..8993d9b 100644 --- a/bindings/rust/lib.rs +++ b/bindings/rust/lib.rs @@ -1,4 +1,4 @@ -//! This crate provides jinja2 language support for the [tree-sitter][] parsing library. +//! This crate provides commonlisp language support for the [tree-sitter][] parsing library. //! //! Typically, you will use the [language][language func] function to add this language to a //! tree-sitter [Parser][], and then use the parser to parse some code: @@ -6,7 +6,7 @@ //! ``` //! let code = ""; //! let mut parser = tree_sitter::Parser::new(); -//! parser.set_language(tree_sitter_commonlisp::language()).expect("Error loading jinja2 grammar"); +//! parser.set_language(tree_sitter_commonlisp::language()).expect("Error loading commonlisp grammar"); //! let tree = parser.parse(code, None).unwrap(); //! ``` //! diff --git a/package-lock.json b/package-lock.json index b9c05ea..7ce8e33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,7 +1,7 @@ { "name": "tree-sitter-commonlisp", "version": "0.3.1", - "lockfileVersion": 2, + "lockfileVersion": 3, "requires": true, "packages": { "": { @@ -17,9 +17,9 @@ } }, "node_modules/nan": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz", - "integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==" + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.19.0.tgz", + "integrity": "sha512-nO1xXxfh/RWNxfd/XPfbIfFk5vgLsAxUR9y5O0cHMJu/AW9U95JLXqthYHjEp+8gQ5p96K9jUp8nbVOxCdRbtw==" }, "node_modules/tree-sitter-cli": { "version": "0.20.8", @@ -50,39 +50,5 @@ "resolved": "https://registry.npmjs.org/web-tree-sitter/-/web-tree-sitter-0.19.1.tgz", "integrity": "sha512-Wlveh+zdegmNdK733B18pf+NmliKs2t5+Aid8IOFIBV2MqJmnYVo3AdukbdZJ+iIxzBnIreYFKfcFFCWVEf4AA==" } - }, - "dependencies": { - "nan": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz", - "integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==" - }, - "tree-sitter-cli": { - "version": "0.20.8", - "resolved": "https://registry.npmjs.org/tree-sitter-cli/-/tree-sitter-cli-0.20.8.tgz", - "integrity": "sha512-XjTcS3wdTy/2cc/ptMLc/WRyOLECRYcMTrSWyhZnj1oGSOWbHLTklgsgRICU3cPfb0vy+oZCC33M43u6R1HSCA==", - "dev": true - }, - "tree-sitter-clojure": { - "version": "git+ssh://git@github.com/theHamsta/tree-sitter-clojure-1.git#95c7959c461406381b42113dcf4591008c663d21", - "integrity": "sha512-h8iD1D2l7Qfrktam6y2KAU5K2SRI4lGHL2NCbJG9bmqiY8yTylkK6iJCwkoGLYapjVgxWUDAgaR9tRW5k3q1+g==", - "from": "tree-sitter-clojure@git@github.com:theHamsta/tree-sitter-clojure-1.git#95c7959c461406381b42113dcf4591008c663d21", - "requires": { - "nan": "2.14.2", - "web-tree-sitter": "0.19.1" - }, - "dependencies": { - "nan": { - "version": "2.14.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", - "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==" - } - } - }, - "web-tree-sitter": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/web-tree-sitter/-/web-tree-sitter-0.19.1.tgz", - "integrity": "sha512-Wlveh+zdegmNdK733B18pf+NmliKs2t5+Aid8IOFIBV2MqJmnYVo3AdukbdZJ+iIxzBnIreYFKfcFFCWVEf4AA==" - } } } diff --git a/package.json b/package.json index ca76a7b..1f9902b 100644 --- a/package.json +++ b/package.json @@ -17,14 +17,14 @@ "author": "Stephan Seitz", "license": "MIT", "dependencies": { - "nan": "^2.17.0", - "tree-sitter-clojure": "git@github.com:theHamsta/tree-sitter-clojure-1.git#95c7959c461406381b42113dcf4591008c663d21" + "nan": "^2.17.0" }, "repository": { "type": "git", "url": "git://github.com/theHamsta/tree-sitter-commonlisp" }, "devDependencies": { - "tree-sitter-cli": "^0.20.8" + "tree-sitter-cli": "^0.20.8", + "tree-sitter-clojure": "git@github.com:theHamsta/tree-sitter-clojure.git#commonlisp" } }