Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve to ESM by default #392

Merged
merged 5 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

env:
dummy: 1 # change to force cache invalidation
node_version: 14.16.0
node_version: 18.14.2

jobs:
dependencies:
Expand Down
2 changes: 1 addition & 1 deletion examples/eSealing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"live-server": "^1.2.2",
"process": "^0.11.10",
"ts-node": "^10.8.0",
"typescript": "^4.7.2"
"typescript": "^5.2.2"
},
"scripts": {
"build": "node --loader ts-node/esm ./esbuild.config.ts; cp ./src/assets/* ./dist",
Expand Down
2 changes: 1 addition & 1 deletion examples/nft-minting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"esbuild-plugin-svgr": "^1.0.1",
"live-server": "^1.2.2",
"ts-node": "^10.8.0",
"typescript": "^4.8.3"
"typescript": "^5.2.2"
},
"scripts": {
"build": "node --loader ts-node/esm ./esbuild.config.ts",
Expand Down
2 changes: 1 addition & 1 deletion examples/piggybank/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"esbuild-plugin-svgr": "^1.0.1",
"live-server": "^1.2.2",
"ts-node": "^10.8.0",
"typescript": "^4.7.2"
"typescript": "^5.2.2"
},
"scripts": {
"build": "node --loader ts-node/esm ./esbuild.config.ts",
Expand Down
2 changes: 1 addition & 1 deletion examples/voting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"esbuild-plugin-svgr": "^1.0.1",
"express": "^4.18.1",
"ts-node": "^10.8.0",
"typescript": "^4.7.2"
"typescript": "^5.2.2"
},
"resolutions": {
"@concordium/web-sdk": "^6.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/wCCD/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"live-server": "^1.2.2",
"process": "^0.11.10",
"ts-node": "^10.8.0",
"typescript": "^4.7.2"
"typescript": "^5.2.2"
},
"scripts": {
"build": "NETWORK='testnet' node --loader ts-node/esm ./esbuild.config.ts; cp ./src/assets/* ./dist",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"@types/jest": "^28.1.7",
"@types/node": "^17.0.25",
"@types/pbkdf2": "^3.1.0",
"@typescript-eslint/eslint-plugin": "^5.20.0",
"@typescript-eslint/parser": "^5.20.0",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"eslint": "7",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
Expand All @@ -61,6 +61,6 @@
"ts-node": "^10.7.0",
"tsc-files": "^1.1.3",
"tsconfig-paths": "^3.14.1",
"typescript": "^4.6.3"
"typescript": "^5.2.2"
}
}
11 changes: 10 additions & 1 deletion packages/browser-wallet-api-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
"main": "lib/index.js",
"browser": "lib/concordiumHelpers.min.js",
"types": "lib/index.d.ts",
"cdn": "lib/concordiumHelpers.min.js",
"exports": {
".": {
"browser": "./lib/index.js",
"import": "./lib/index.js",
"types": "./lib/index.d.ts",
"default": "./lib/index.js"
}
},
"files": [
"/lib/**/*"
],
Expand All @@ -26,7 +35,7 @@
"@babel/plugin-transform-modules-commonjs": "^7.12.1",
"@babel/plugin-transform-runtime": "^7.12.1",
"@babel/preset-env": "^7.12.1",
"typescript": "^4.3.5",
"typescript": "^5.2.2",
"webpack": "^5.72.0",
"webpack-cli": "^4.9.2"
},
Expand Down
1 change: 1 addition & 0 deletions packages/browser-wallet-api-helpers/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './wallet-api-types';
export * from './util';
export { detectConcordiumProvider } from './detector';
2 changes: 1 addition & 1 deletion packages/browser-wallet-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"devDependencies": {
"@types/json-bigint": "^1.0.1",
"typescript": "^4.3.5"
"typescript": "^5.2.2"
},
"scripts": {
"build": "tsc"
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@
"style-loader": "^3.3.1",
"ts-jest": "^29.0.5",
"tsconfig-paths-webpack-plugin": "^3.5.2",
"typescript": "^4.3.5"
"typescript": "^5.2.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ import {
getCredentialRegistryContractAddress,
withIdRemovedFromSchema,
} from '@shared/utils/verifiable-credential-helpers';
import { APIVerifiableCredential } from '@concordium/browser-wallet-api-helpers';
import { APIVerifiableCredential, MetadataUrl } from '@concordium/browser-wallet-api-helpers';
import { grpcClientAtom, networkConfigurationAtom } from '@popup/store/settings';
import { MetadataUrl } from '@concordium/browser-wallet-api-helpers/lib/wallet-api-types';
import { parse } from '@shared/utils/payload-helpers';
import { logError } from '@shared/utils/log-helpers';
import { addToastAtom } from '@popup/state';
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-wallet/src/popup/shared/Form/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const useForm = <TFormValues extends FieldValues = FieldValues>(
props?: UseFormProps<TFormValues>
): UseFormReturn<TFormValues> => useFormLib<TFormValues>({ ...useFormDefaults, ...props });

type FormProps<TFormValues> = ClassName & {
type FormProps<TFormValues extends FieldValues = FieldValues> = ClassName & {
soerenbf marked this conversation as resolved.
Show resolved Hide resolved
/**
* Submit handler, receiving the values of the form as arg.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const makeUncontrolled = <E, P extends RequiredUncontrolledFieldProps<E>>
// Filter away all props required for form registration, leaving the props for the input '<Field />'
const { name, rules, register, onChange: ownOnChange = noOp, onBlur: ownOnBlur = noOp, ...ownProps } = props;
const registerProps = register(name, rules);
const { errors, touchedFields, isSubmitted } = useFormState<TFieldValues>(name);
const { errors, touchedFields, isSubmitted } = useFormState<TFieldValues>({ name });
soerenbf marked this conversation as resolved.
Show resolved Hide resolved

const error = errors[name];
const isTouched = touchedFields[name];
Expand Down
5 changes: 1 addition & 4 deletions packages/browser-wallet/src/shared/utils/types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/* eslint-disable @typescript-eslint/ban-types */
import {
SchemaWithContext,
SmartContractParameters,
} from '@concordium/browser-wallet-api-helpers/lib/wallet-api-types';
import { SchemaWithContext, SmartContractParameters } from '@concordium/browser-wallet-api-helpers';
import type { SchemaVersion, AccountTransactionType } from '@concordium/web-sdk';
import { RefAttributes } from 'react';
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-wallet/test/wallet-api.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LaxNumberEnumValue } from '@concordium/browser-wallet-api-helpers/src/util';
import { LaxNumberEnumValue } from '@concordium/browser-wallet-api-helpers';

enum Enum {
One = 1,
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"strict": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"downlevelIteration": true,
Expand Down
Loading
Loading