Skip to content

Commit

Permalink
chore: release v0.20.0 (#800)
Browse files Browse the repository at this point in the history
* chore: release v0.20.0
  • Loading branch information
krpeacock authored Nov 14, 2023
1 parent f17886c commit 0d73ffd
Show file tree
Hide file tree
Showing 27 changed files with 15,047 additions and 7,548 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ jobs:
- run: npm install -g npm

- run: npm install
- run: pushd e2e/browser && npm install && popd
- run: pushd e2e/node && npm install && popd

# build monorepo incl. each subpackage
- run: npm run build --workspaces --if-present
Expand Down
8 changes: 4 additions & 4 deletions demos/sample-javascript/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@dfinity/ic-agent-sample-javascript-app",
"private": true,
"version": "0.19.3",
"version": "0.20.0",
"scripts": {
"build": "webpack",
"develop": "webpack-dev-server",
Expand All @@ -10,9 +10,9 @@
"test": ""
},
"dependencies": {
"@dfinity/agent": "^0.19.3",
"@dfinity/identity": "^0.19.3",
"@dfinity/principal": "^0.19.3"
"@dfinity/agent": "^0.20.0",
"@dfinity/identity": "^0.20.0",
"@dfinity/principal": "^0.20.0"
},
"devDependencies": {
"assert": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion e2e/browser/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { defineConfig } = require('cypress');
module.exports = defineConfig({
video: false,
e2e: {
setupNodeEvents(on, config) {
setupNodeEvents() {
// implement node event listeners here
},
},
Expand Down
4 changes: 2 additions & 2 deletions e2e/browser/cypress/e2e/ecdsa.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ const setup = async () => {
describe('ECDSAKeyIdentity tests with SubtleCrypto', () => {
it('generates a new identity', () => {
cy.visit('http://localhost:1234');
cy.window().then(async window => {
cy.window().then(async () => {
const { principal1 } = await setup();
const str = principal1.toString();
expect(str).to.be.an('string');
});
});
it('can persist an identity in indexeddb', () => {
cy.visit('http://localhost:1234');
cy.window().then(async window => {
cy.window().then(async () => {
const { principal1, identity1 } = await setup();
const str = principal1.toString();
expect(str).to.be.an('string');
Expand Down
8 changes: 4 additions & 4 deletions e2e/browser/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@do-not-publish/ic-cypress-e2e-tests",
"version": "0.19.3",
"version": "0.20.0",
"scripts": {
"ci": "npm run e2e",
"setup": "dfx deploy; dfx generate; pm2 --name parcel start npm -- start",
Expand All @@ -27,9 +27,9 @@
"size-limit": "^8.1.0"
},
"dependencies": {
"@dfinity/agent": "^0.19.3",
"@dfinity/identity": "^0.19.3",
"@dfinity/principal": "^0.19.3",
"@dfinity/agent": "^0.20.0",
"@dfinity/identity": "^0.20.0",
"@dfinity/principal": "^0.20.0",
"idb-keyval": "^6.2.0"
}
}
2 changes: 1 addition & 1 deletion e2e/node/basic/assets.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import agent from '../utils/agent';
import { Actor } from '@dfinity/agent';
import { Principal } from '@dfinity/principal';
import { AssetManager } from '@dfinity/assets';
import { test, describe, it, expect, beforeAll, afterEach } from 'vitest';
import { describe, it, expect, beforeAll, afterEach } from 'vitest';

/**
* Create (pseudo) random bytes Readable
Expand Down
3 changes: 0 additions & 3 deletions e2e/node/basic/basic.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/**
* @jest-environment node
*/
import { ActorMethod, Certificate, getManagementCanister } from '@dfinity/agent';
import { IDL } from '@dfinity/candid';
import { Principal } from '@dfinity/principal';
Expand Down
3 changes: 2 additions & 1 deletion e2e/node/basic/identity.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { Actor, HttpAgent, SignIdentity } from '@dfinity/agent';
import { Actor, SignIdentity } from '@dfinity/agent';
import { IDL } from '@dfinity/candid';
import { Principal } from '@dfinity/principal';
import {
Expand Down Expand Up @@ -62,6 +62,7 @@ async function createEcdsaIdentityActor(
idl: IDL.InterfaceFactory,
identity?: SignIdentity,
): Promise<any> {
global.crypto;
let effectiveIdentity: SignIdentity;
if (identity) {
effectiveIdentity = identity;
Expand Down
2 changes: 1 addition & 1 deletion e2e/node/basic/mainnet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Actor, AnonymousIdentity, HttpAgent, Identity, CanisterStatus } from '@
import { IDL } from '@dfinity/candid';
import { Ed25519KeyIdentity } from '@dfinity/identity';
import { Principal } from '@dfinity/principal';
import { describe, it, expect, test, vi } from 'vitest';
import { describe, it, expect, vi } from 'vitest';
import { makeAgent } from '../utils/agent';

const createWhoamiActor = async (identity: Identity) => {
Expand Down
4 changes: 2 additions & 2 deletions e2e/node/basic/mitm.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createActor } from '../canisters/declarations/counter/index';
import { test, expect } from 'vitest';
import { test, expect, TestAPI } from 'vitest';
import { makeAgent } from '../utils/agent';

let mitmTest: any = test;
let mitmTest: TestAPI | typeof test.skip = test;
if (!process.env['MITM']) {
mitmTest = test.skip;
}
Expand Down
7 changes: 4 additions & 3 deletions e2e/node/canisters/counter.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Actor, HttpAgentOptions } from '@dfinity/agent';
import { Actor, ActorSubclass, HttpAgentOptions } from '@dfinity/agent';
import { IDL } from '@dfinity/candid';
import { Principal } from '@dfinity/principal';
import { readFileSync } from 'fs';
import path from 'path';
import agent, { identity, makeAgent } from '../utils/agent';
import agent, { makeAgent } from '../utils/agent';
import { _SERVICE } from './declarations/counter';

let cache: {
canisterId: Principal;
Expand Down Expand Up @@ -61,5 +62,5 @@ export const createActor = async (options?: HttpAgentOptions) => {

const canisterId = await Actor.createCanister({ agent });
await Actor.install({ module }, { canisterId, agent });
return Actor.createActor(idl, { canisterId, agent }) as any;
return Actor.createActor(idl, { canisterId, agent }) as ActorSubclass<_SERVICE>;
};
1 change: 0 additions & 1 deletion e2e/node/canisters/declarations/counter/counter.did.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { Principal } from '@dfinity/principal';
import type { ActorMethod } from '@dfinity/agent';

export interface _SERVICE {
Expand Down
3 changes: 0 additions & 3 deletions e2e/node/canisters/declarations/counter/counter.did.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,3 @@ export const idlFactory = ({ IDL }) => {
write: IDL.Func([IDL.Nat], [], []),
});
};
export const init = ({ IDL }) => {
return [];
};
11 changes: 6 additions & 5 deletions e2e/node/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"private": true,
"name": "@do-not-publish/ic-node-e2e-tests",
"version": "0.19.3",
"version": "0.20.0",
"type": "module",
"scripts": {
"ci": "npm run e2e",
"e2e": "vitest",
Expand All @@ -15,10 +16,10 @@
"test": ""
},
"dependencies": {
"@dfinity/agent": "^0.19.3",
"@dfinity/assets": "^0.19.3",
"@dfinity/identity": "^0.19.3",
"@dfinity/principal": "^0.19.3",
"@dfinity/agent": "^0.20.0",
"@dfinity/assets": "^0.20.0",
"@dfinity/identity": "^0.20.0",
"@dfinity/principal": "^0.20.0",
"whatwg-fetch": "^3.6.2"
},
"devDependencies": {
Expand Down
21 changes: 10 additions & 11 deletions e2e/node/test-setup.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
// This file may be used to polyfill features that aren't available in the test
// environment, i.e. JSDom.
//
Expand All @@ -7,19 +8,17 @@
// Note that we can use webpack configuration to make some features available to

// Node.js in a similar way.
import { TextEncoder, TextDecoder } from 'text-encoding'; // eslint-disable-line
// import fetch from 'isomorphic-fetch';
// global.crypto = crypto as unknown as Crypto;
// console.log('subtle', crypto['subtle']); // eslint-disable-line
global.TextDecoder = TextDecoder; // eslint-disable-line
import { TextEncoder, TextDecoder } from 'text-encoding';
global.TextDecoder = TextDecoder;
global.TextEncoder = TextEncoder;

// global.TextDecoder = TextDecoder; // eslint-disable-line
// (global.fetch as any) = fetch;
import fetch from 'isomorphic-fetch';
global.fetch = fetch;
import * as crypto from 'crypto';

(global as any).crypto = {
subtle: (crypto.webcrypto as any).subtle,
};
import { subtle } from 'crypto';

// make global.crypto writeable
Object.defineProperty(global, 'crypto', {
writable: true,
value: { ...global.crypto, subtle },
});
Loading

0 comments on commit 0d73ffd

Please sign in to comment.