Skip to content

Commit

Permalink
Move package.json file to give it access to all cargo packages
Browse files Browse the repository at this point in the history
  • Loading branch information
fordN committed Dec 6, 2023
1 parent 3367d76 commit a96b53c
Show file tree
Hide file tree
Showing 5 changed files with 548 additions and 526 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ jobs:
env:
NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_BUILD_TARGET: ${{ matrix.system.target }}
working-directory: ./node-plugin
working-directory: ./
run: yarn build-test-pack-publish
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
node-plugin/native/target
node-plugin/native/index.node
node-plugin/native/artifacts.json
**/node_modules
/target
**/.DS_Store
.idea
Cargo.lock
6 changes: 0 additions & 6 deletions node-plugin/.gitignore

This file was deleted.

17 changes: 9 additions & 8 deletions node-plugin/package.json → package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
"name": "@graphprotocol/cost-model",
"version": "0.1.16",
"description": "Cost model",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"main": "node-plugin/lib/index.js",
"types": "/node-plugin/lib/index.d.ts",
"files": [
"/lib",
"/src",
"Cargo.toml"
"/node-plugin/lib",
"/node-plugin/src",
"/node-plugin/Cargo.toml",
"/lang/"
],
"repository": {
"type": "git",
Expand All @@ -25,7 +26,7 @@
"arm64"
],
"scripts": {
"build": "cargo-cp-artifact -a cdylib node_plugin ./native/index.node -- cargo build --message-format=json-render-diagnostics",
"build": "cargo-cp-artifact -a cdylib node_plugin ./node-plugin/native/index.node -- cargo build --message-format=json-render-diagnostics",
"build-debug": "yarn build --",
"build-release": "yarn build --release",
"package": "node-pre-gyp package",
Expand All @@ -34,7 +35,7 @@
"build-test-pack-publish": "yarn build-release && yarn test && yarn package && yarn publish-github",
"install": "node-pre-gyp install --fallback-to-build=false --update-binary || yarn build-release",
"test": "jest",
"clean": "cargo clean && rm -rf ./native ./build ./node_modules"
"clean": "cargo clean && rm -rf ./node-plugin/native ./build ./node_modules"
},
"dependencies": {
"@mapbox/node-pre-gyp": "1.0.9",
Expand All @@ -46,7 +47,7 @@
},
"binary": {
"module_name": "index",
"module_path": "./native",
"module_path": "./node-plugin/native",
"host": "https://github.com/graphprotocol/agora/releases/download/",
"remote_path": "v{version}",
"package_name": "graphprotocol-agora-plugin-v{version}-{node_abi}-{platform}-{arch}.tar.gz"
Expand Down
Loading

0 comments on commit a96b53c

Please sign in to comment.