Skip to content

Commit

Permalink
Create Submodule (#381)
Browse files Browse the repository at this point in the history
* create submodule

* update ci

* updates

* update readme

* Update README.md

Co-authored-by: Diane Huxley <[email protected]>

* Update README.md

Co-authored-by: Diane Huxley <[email protected]>

* Update README.md

Co-authored-by: Diane Huxley <[email protected]>

---------

Co-authored-by: Diane Huxley <[email protected]>
  • Loading branch information
nitro-neal and Diane Huxley authored Jan 19, 2024
1 parent 474cc47 commit 25f1d03
Show file tree
Hide file tree
Showing 16 changed files with 49 additions and 638 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/tests-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
with:
submodules: true

- name: Set up Node.js
uses: actions/setup-node@5ef044f9d09786428e6e895be6be17937becee3a #v4.0.0
Expand Down Expand Up @@ -113,6 +115,8 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
with:
submodules: true

- name: Set up Node.js
uses: actions/setup-node@5ef044f9d09786428e6e895be6be17937becee3a #v4.0.0
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "web5-spec"]
path = web5-spec
url = https://github.com/TBD54566975/web5-spec
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,23 @@ Interested in contributing instantly? You can make your updates directly without

[![Button to click and edit code in CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/github/TBD54566975/web5-js/main)


## Prerequisites

### Cloning
This repository uses git submodules. To clone this repo with submodules
```sh
git clone --recurse-submodules [email protected]:TBD54566975/web5-js.git
```
Or to add submodules after cloning
```sh
git submodule update --init
```
We recommend this config which will only checkout the files relevant to web5-js
```sh
git -C web5-spec sparse-checkout set test-vectors
```

## Installation

_NPM_
Expand Down Expand Up @@ -477,6 +494,24 @@ The `create` method under the `did` object enables generation of DIDs for a supp
const myDid = await Web5.did.create("ion");
```

## Working with the `web5-spec` submodule

### Pulling
You may need to update the `web5-spec` submodule after pulling.
```sh
git pull
git submodule update
```

### Pushing
If you have made changes to the `web5-spec` submodule, you should push your changes to the `web5-spec` remote as well as pushing changes to `web5-js`.
```sh
cd web5-spec
git push
cd ..
git push
```

## Project Resources

| Resource | Description |
Expand Down
2 changes: 1 addition & 1 deletion packages/credentials/tests/presentation-exchange.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { Validated, PresentationDefinitionV2 } from '../src/presentation-ex

import { VerifiableCredential } from '../src/verifiable-credential.js';
import { PresentationExchange } from '../src/presentation-exchange.js';
import PresentationExchangeSelectCredentialsTestVector from '../../../test-vectors/presentation_exchange/select_credentials.json' assert { type: 'json' };
import PresentationExchangeSelectCredentialsTestVector from '../../../web5-spec/test-vectors/presentation_exchange/select_credentials.json' assert { type: 'json' };


class BitcoinCredential {
Expand Down
2 changes: 1 addition & 1 deletion packages/credentials/tests/verifiable-credential.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { DidDhtMethod, DidKeyMethod, DidIonMethod } from '@web5/dids';

import { Jwt } from '../src/jwt.js';
import { VerifiableCredential } from '../src/verifiable-credential.js';
import CredentialsVerifyTestVector from '../../../test-vectors/credentials/verify.json' assert { type: 'json' };
import CredentialsVerifyTestVector from '../../../web5-spec/test-vectors/credentials/verify.json' assert { type: 'json' };

describe('Verifiable Credential Tests', () => {
let issuerDid: PortableDid;
Expand Down
4 changes: 2 additions & 2 deletions packages/crypto/tests/primitives/ed25519.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import chaiAsPromised from 'chai-as-promised';

import type { Jwk, JwkParamsOkpPrivate } from '../../src/jose/jwk.js';

import CryptoEd25519SignTestVector from '../../../../test-vectors/crypto_ed25519/sign.json' assert { type: 'json' };
import CryptoEd25519SignTestVector from '../../../../web5-spec/test-vectors/crypto_ed25519/sign.json' assert { type: 'json' };
import ed25519ComputePublicKey from '../fixtures/test-vectors/ed25519/compute-public-key.json' assert { type: 'json' };
import CryptoEd25519VerifyTestVector from '../../../../test-vectors/crypto_ed25519/verify.json' assert { type: 'json' };
import CryptoEd25519VerifyTestVector from '../../../../web5-spec/test-vectors/crypto_ed25519/verify.json' assert { type: 'json' };
import ed25519BytesToPublicKey from '../fixtures/test-vectors/ed25519/bytes-to-public-key.json' assert { type: 'json' };
import ed25519PublicKeyToBytes from '../fixtures/test-vectors/ed25519/public-key-to-bytes.json' assert { type: 'json' };
import ed25519BytesToPrivateKey from '../fixtures/test-vectors/ed25519/bytes-to-private-key.json' assert { type: 'json' };
Expand Down
4 changes: 2 additions & 2 deletions packages/crypto/tests/primitives/secp256k1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import chaiAsPromised from 'chai-as-promised';

import type { Jwk, JwkParamsEcPrivate } from '../../src/jose/jwk.js';

import CryptoEs256kSignTestVector from '../../../../test-vectors/crypto_es256k/sign.json' assert { type: 'json' };
import CryptoEs256kVerifyTestVector from '../../../../test-vectors/crypto_es256k/verify.json' assert { type: 'json' };
import CryptoEs256kSignTestVector from '../../../../web5-spec/test-vectors/crypto_es256k/sign.json' assert { type: 'json' };
import CryptoEs256kVerifyTestVector from '../../../../web5-spec/test-vectors/crypto_es256k/verify.json' assert { type: 'json' };
import secp256k1GetCurvePoints from '../fixtures/test-vectors/secp256k1/get-curve-points.json' assert { type: 'json' };
import secp256k1BytesToPublicKey from '../fixtures/test-vectors/secp256k1/bytes-to-public-key.json' assert { type: 'json' };
import secp256k1PublicKeyToBytes from '../fixtures/test-vectors/secp256k1/public-key-to-bytes.json' assert { type: 'json' };
Expand Down
45 changes: 0 additions & 45 deletions test-vectors/credentials/verify.json

This file was deleted.

58 changes: 0 additions & 58 deletions test-vectors/crypto_ed25519/README.md

This file was deleted.

78 changes: 0 additions & 78 deletions test-vectors/crypto_ed25519/sign.json

This file was deleted.

Loading

0 comments on commit 25f1d03

Please sign in to comment.