Skip to content

Commit

Permalink
Merge pull request #258 from berendsliedrecht/fix-build-issue-js-wrapper
Browse files Browse the repository at this point in the history
fixed build issue for JS wrappers
  • Loading branch information
berendsliedrecht authored Oct 26, 2023
2 parents a3e5a86 + ce1318a commit 9be638a
Show file tree
Hide file tree
Showing 16 changed files with 74 additions and 65 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,12 @@ jobs:
if: |
github.event_name == 'release' ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.publish-wrappers == 'true')
run: npx lerna publish from-package --no-push --no-private --yes --no-git-tag-version
run: |
if [[ $(cat lerna.json | grep version | head -1 | grep dev) ]]; then
npx lerna publish from-package --no-push --no-private --yes --no-git-tag-version --dist-tag=alpha
else
npx lerna publish from-package --no-push --no-private --yes --no-git-tag-version
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion wrappers/javascript/lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "0.2.0-dev.2",
"version": "0.2.0-dev.3",
"npmClient": "pnpm",
"command": {
"version": {
Expand Down
6 changes: 3 additions & 3 deletions wrappers/javascript/packages/anoncreds-nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperledger/anoncreds-nodejs",
"version": "0.2.0-dev.2",
"version": "0.2.0-dev.3",
"license": "Apache-2.0",
"description": "Nodejs wrapper for Anoncreds",
"main": "build/index",
Expand All @@ -23,8 +23,8 @@
"check-types": "pnpm compile --noEmit",
"build": "pnpm clean && pnpm compile",
"clean": "rimraf -rf ./build",
"compile": "tsc",
"install": "node-pre-gyp install --target_arch=$(node scripts/arch.js) --target_platform=$(node scripts/platform.js)"
"compile": "tsc -p ./tsconfig.build.json",
"install": "node scripts/install.js"
},
"dependencies": {
"@2060.io/ffi-napi": "4.0.8",
Expand Down
22 changes: 0 additions & 22 deletions wrappers/javascript/packages/anoncreds-nodejs/scripts/arch.js

This file was deleted.

14 changes: 14 additions & 0 deletions wrappers/javascript/packages/anoncreds-nodejs/scripts/install.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const { execSync } = require('node:child_process')
const { arch, platform } = require('os')

const archTable = {
x64: 'x86_64',
arm64: 'aarch64'
}

const targetPlatform = platform === 'win32' ? 'windows' : platform
const targetArchitecture = archTable[arch()]

const command = `node-pre-gyp install --target_arch=${targetArchitecture} --target_platform=${targetPlatform}`

execSync(command)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../../tsconfig.build.json",
"compilerOptions": {
"outDir": "./build",
"types": ["node"]
},
"include": ["src"]
}
6 changes: 2 additions & 4 deletions wrappers/javascript/packages/anoncreds-nodejs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"extends": "../../tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "build",
"types": ["node"]
},
"include": ["src"]
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperledger/anoncreds-react-native",
"version": "0.2.0-dev.2",
"version": "0.2.0-dev.3",
"license": "Apache-2.0",
"description": "React Native wrapper for Anoncreds",
"main": "build/index",
Expand Down Expand Up @@ -32,7 +32,7 @@
"check-types": "pnpm compile --noEmit",
"build": "pnpm clean && pnpm compile",
"clean": "rimraf -rf ./build",
"compile": "tsc",
"compile": "tsc -p ./tsconfig.build.json",
"install": "node-pre-gyp install"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.build.json",
"compilerOptions": {
"outDir": "./build",
"skipLibCheck": true,
"types": ["react-native"]
},
"include": ["src"]
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../../tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./build",
"skipLibCheck": true,
"types": ["react-native"]
},
"include": ["src"]
Expand Down
4 changes: 2 additions & 2 deletions wrappers/javascript/packages/anoncreds-shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperledger/anoncreds-shared",
"version": "0.2.0-dev.2",
"version": "0.2.0-dev.3",
"license": "Apache-2.0",
"description": "Anoncreds wrapper library with NodeJS and React Native",
"main": "build/index",
Expand All @@ -21,7 +21,7 @@
"check-types": "pnpm compile --noEmit",
"build": "pnpm clean && pnpm compile",
"clean": "rimraf -rf ./build",
"compile": "tsc"
"compile": "tsc -p ./tsconfig.build.json"
},
"devDependencies": {
"rimraf": "3.0.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.build.json",
"compilerOptions": {
"outDir": "./build"
},
"include": ["src"]
}
7 changes: 1 addition & 6 deletions wrappers/javascript/packages/anoncreds-shared/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"outDir": "./build"
},
"include": ["src"]
"extends": "../../tsconfig.json"
}
17 changes: 17 additions & 0 deletions wrappers/javascript/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "ES2017",
"declaration": true,
"sourceMap": true,
"strict": true,
"noEmitOnError": true,
"lib": ["ESNext"],
"types": [],
"esModuleInterop": true,
"resolveJsonModule": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": "."
},
"exclude": ["node_modules", "build", "**/build/**", "tests", "**/tests/**"]
}
14 changes: 1 addition & 13 deletions wrappers/javascript/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
{
"extends": "./tsconfig.build.json",
"compilerOptions": {
"module": "commonjs",
"target": "ES2017",
"declaration": true,
"sourceMap": true,
"strict": true,
"noEmitOnError": true,
"lib": ["ESNext"],
"types": [],
"esModuleInterop": true,
"resolveJsonModule": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"@hyperledger/*": ["packages/*/src"]
}
},
"exclude": ["node_modules", "build", "**/build/**", "tests", "**/tests/**"],
"ts-node": {
"require": ["tsconfig-paths/register"],
"files": true
Expand Down

0 comments on commit 9be638a

Please sign in to comment.