Skip to content

Commit

Permalink
Renames NPM package/folder and updates its version (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
raugfer authored Sep 12, 2024
1 parent 62aa4e7 commit 08f01b9
Show file tree
Hide file tree
Showing 25 changed files with 30 additions and 30 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build and check for changes in generated code
working-directory: tools/npm/garaga_rs
working-directory: tools/npm/garaga_ts
run: |
docker compose up --build --exit-code-from app
git status --porcelain
Expand All @@ -40,7 +40,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: npm-package
path: tools/npm/garaga_rs/*.tgz
path: tools/npm/garaga_ts/*.tgz
if-no-files-found: error

test-integration:
Expand All @@ -63,11 +63,11 @@ jobs:
uses: actions/download-artifact@v4
with:
name: npm-package
path: tools/npm/garaga_rs
path: tools/npm/garaga_ts
- name: Build and tests integration test packages
working-directory: tools/npm/integration-test-suite
run: |
cp ../garaga_rs/garaga_rs-*.tgz garaga_rs.tgz
cp ../garaga_ts/garaga-*.tgz garaga.tgz
npm i
npm run build
npx puppeteer browsers install
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file (along with docker-compose.yml) helps creating reproducible builds
# - It must be manually triggered whenever the Rust code is changed
# - It will update the code generated under src/wasm/pkg
# - It will update the code generated under src/wasm/pkg
# Usage: docker compose up --build && docker compose down

FROM rust:1.80.1
Expand All @@ -13,6 +13,6 @@ ENV HOME="/root/"
ENV N_PREFIX="$HOME/n"
ENV PATH="$HOME/n/bin/:$PATH"

WORKDIR /garaga/tools/npm/garaga_rs
WORKDIR /garaga/tools/npm/garaga_ts

CMD npm ci && npm run build && npm pack && ./fix-chown.sh ../..
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file (along with Dockerfile) helps creating reproducible builds
# - It must be manually triggered whenever the Rust code is changed
# - It will update the code generated under src/wasm/pkg
# - It will update the code generated under src/wasm/pkg
# Usage: docker compose up --build && docker compose down

services:
Expand Down
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "module",
"name": "garaga_rs",
"version": "0.1.0",
"name": "garaga",
"version": "0.13.3",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
Expand All @@ -10,7 +10,7 @@
"./dist/"
],
"scripts": {
"build:wasm": "cd ../../garaga_rs && wasm-pack build --target web --out-dir ../npm/garaga_rs/src/wasm/pkg --release --no-default-features",
"build:wasm": "cd ../../garaga_rs && wasm-pack build --target web --out-dir ../npm/garaga_ts/src/wasm/pkg --release --no-default-features",
"patch:wasm": "node patch.wasm.cjs",
"build:node": "tsc && rollup -c",
"build": "npm run build:wasm && npm run patch:wasm && npm run build:node",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"test": "node dist/index.js > .output.txt && diff .output.txt output.txt"
},
"dependencies": {
"garaga_rs": "file:../../garaga_rs.tgz"
"garaga": "file:../../garaga.tgz"
},
"devDependencies": {
"typescript": "^5.5.4"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as garaga_rs from 'garaga_rs';
import * as garaga from 'garaga';

async function main(): Promise<void> {
await garaga_rs.init();
const result = garaga_rs.msmCalldataBuilder([[1n, 2n]], [10n], garaga_rs.CurveId.BN254);
await garaga.init();
const result = garaga.msmCalldataBuilder([[1n, 2n]], [10n], garaga.CurveId.BN254);
const json = JSON.stringify(result, (key, value) => typeof value === 'bigint' ? value + 'n' : value, 2);
const message = 'Output of msm_calldata_builder: ' + json;
console.log(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"test": "node dist/index.js > .output.txt && diff .output.txt output.txt"
},
"dependencies": {
"garaga_rs": "file:../../garaga_rs.tgz"
"garaga": "file:../../garaga.tgz"
},
"devDependencies": {
"typescript": "^5.5.4"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as garaga_rs from 'garaga_rs';
import * as garaga from 'garaga';

async function main(): Promise<void> {
await garaga_rs.init();
const result = garaga_rs.msmCalldataBuilder([[1n, 2n]], [10n], garaga_rs.CurveId.BN254);
await garaga.init();
const result = garaga.msmCalldataBuilder([[1n, 2n]], [10n], garaga.CurveId.BN254);
const json = JSON.stringify(result, (key, value) => typeof value === 'bigint' ? value + 'n' : value, 2);
const message = 'Output of msm_calldata_builder: ' + json;
console.log(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"test": "npm run start-bg && node scrape.cjs > .output.txt; npm run stop-bg; diff .output.txt output.txt"
},
"dependencies": {
"garaga_rs": "file:../../garaga_rs.tgz",
"garaga": "file:../../garaga.tgz",
"next": "14.2.8",
"react": "^18",
"react-dom": "^18"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { useState, useEffect } from 'react';
import * as garaga_rs from 'garaga_rs';
import * as garaga from 'garaga';

export default function Home() {
const [loading, setLoading] = useState(true);
Expand All @@ -10,8 +10,8 @@ export default function Home() {

useEffect(async () => {
try {
await garaga_rs.init();
const result = garaga_rs.msmCalldataBuilder([[1n, 2n]], [10n], garaga_rs.CurveId.BN254);
await garaga.init();
const result = garaga.msmCalldataBuilder([[1n, 2n]], [10n], garaga.CurveId.BN254);
const json = JSON.stringify(result, (key, value) => typeof value === 'bigint' ? value + 'n' : value, 2);
const message = 'Output of msm_calldata_builder: ' + json;
setData(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"devDependencies": {
"copy-webpack-plugin": "^12.0.2",
"garaga_rs": "file:../../garaga_rs.tgz",
"garaga": "file:../../garaga.tgz",
"puppeteer": "^23.3.0",
"webpack": "^5.94.0",
"webpack-cli": "^5.1.4",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as garaga_rs from 'garaga_rs';
import * as garaga from 'garaga';

async function main() {
await garaga_rs.init();
const result = garaga_rs.msmCalldataBuilder([[1n, 2n]], [10n], garaga_rs.CurveId.BN254);
await garaga.init();
const result = garaga.msmCalldataBuilder([[1n, 2n]], [10n], garaga.CurveId.BN254);
const json = JSON.stringify(result, (key, value) => typeof value === 'bigint' ? value + 'n' : value, 2);
const message = 'Output of msm_calldata_builder: ' + json;
const element = document.createElement('pre');
Expand Down

0 comments on commit 08f01b9

Please sign in to comment.