Skip to content

Commit

Permalink
chore: some suggestions for repo setup (#12)
Browse files Browse the repository at this point in the history
* chore(deps): switch to yarn v4 which has version plugin included

* chore: reduce number of tsconfigs

* chore: set release strategy

* chore: only export types from types.ts
  • Loading branch information
rflechtner authored May 29, 2024
1 parent 9ad141b commit 8de358b
Show file tree
Hide file tree
Showing 18 changed files with 2,642 additions and 3,167 deletions.
550 changes: 0 additions & 550 deletions .yarn/plugins/@yarnpkg/plugin-version.cjs

This file was deleted.

874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.1.cjs

This file was deleted.

894 changes: 894 additions & 0 deletions .yarn/releases/yarn-4.2.2.cjs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .yarn/versions/02453743.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
releases:
"@kiltprotocol/dip-sdk": patch
10 changes: 5 additions & 5 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
compressionLevel: mixed

enableGlobalCache: false

nodeLinker: node-modules

npmPublishAccess: public

npmPublishRegistry: "https://registry.npmjs.org"

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"

yarnPath: .yarn/releases/yarn-3.6.1.cjs
yarnPath: .yarn/releases/yarn-4.2.2.cjs
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
"license": "BSD-4-Clause",
"main": "./dist/cjs/index.js",
"name": "@kiltprotocol/dip-sdk",
"packageManager": "yarn@3.6.1",
"packageManager": "yarn@4.2.2",
"repository": "github:kiltprotocol/dip-sdk",
"scripts": {
"build": "yarn build:cjs && yarn build:esm",
"build:cjs": "run -T tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json",
"build:docs": "typedoc --theme default --out docs/api --tsconfig tsconfig.docs.json && touch docs/.nojekyll",
"build:esm": "run -T tsc -p tsconfig.esm.json && echo '{\"type\": \"module\"}' > ./dist/esm/package.json",
"check": "tsc -p tsconfig.json",
"check": "tsc -p tsconfig.json --noEmit",
"clean": "yarn rimraf -g */{cjs,esm}",
"clean:docs": "rimraf docs/api",
"lint": "eslint --ext .ts .",
Expand All @@ -60,4 +60,4 @@
"type": "module",
"types": "./dist/cjs/index.d.ts",
"version": "0.0.0"
}
}
2 changes: 0 additions & 2 deletions src/dipProof/extensions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@
* found in the LICENSE file in the root directory of this source tree.
*/

export type * from "./types.js"

export * as timeBoundDidSignature from "./timeBoundDidSignature.js"
7 changes: 6 additions & 1 deletion src/dipProof/extensions/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@
* found in the LICENSE file in the root directory of this source tree.
*/

export type * from "./timeBoundDidSignature.js"
export type {
TimeBoundDidSignatureConsumerOpts,
TimeBoundDidSignatureOpts,
TimeBoundDidSignatureProviderOpts,
TimeBoundDidSignatureRes,
} from "./timeBoundDidSignature.js"
2 changes: 0 additions & 2 deletions src/dipProof/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@
* found in the LICENSE file in the root directory of this source tree.
*/

export type * from "./types.js"

export * from "./subjectIdentity.js"
export * as extensions from "./extensions/index.js"
5 changes: 4 additions & 1 deletion src/dipProof/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
* found in the LICENSE file in the root directory of this source tree.
*/

export type * from "./subjectIdentity.js"
export type {
DipIdentityProofOpts,
DipIdentityProofRes,
} from "./subjectIdentity.js"
export type * from "./extensions/types.js"
2 changes: 0 additions & 2 deletions src/stateProof/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@
* found in the LICENSE file in the root directory of this source tree.
*/

export type * from "./types.js"

export * from "./providerStateRoot.js"
export * from "./subjectDipCommitment.js"
10 changes: 8 additions & 2 deletions src/stateProof/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@
* found in the LICENSE file in the root directory of this source tree.
*/

export type * from "./providerStateRoot.js"
export type * from "./subjectDipCommitment.js"
export type {
ProviderStateRootProofOpts,
ProviderStateRootProofRes,
} from "./providerStateRoot.js"
export type {
DipCommitmentProofOpts,
DipCommitmentProofRes,
} from "./subjectDipCommitment.js"
10 changes: 7 additions & 3 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
* found in the LICENSE file in the root directory of this source tree.
*/

export type * from "./stateProof/index.js"
export type * from "./dipProof/index.js"
export type * from "./sibling.js"
export type * from "./stateProof/types.js"
export type * from "./dipProof/types.js"
export type {
DipSiblingBaseProofInput,
DipSiblingBaseProofRes,
GenerateDipSubmittableExtrinsicInput,
} from "./sibling.js"
17 changes: 0 additions & 17 deletions tsconfig.base.json

This file was deleted.

3 changes: 1 addition & 2 deletions tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "dist/cjs",
"module": "CommonJS",
"declaration": true
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules"]
}
3 changes: 1 addition & 2 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "dist/esm",
"module": "Node16",
"declaration": true
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules"]
}
16 changes: 13 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"module": "Node16",
"moduleResolution": "Node16",
"noEmit": true
"target": "ES2020",
"strict": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"sourceMap": false,
"declarationMap": false,
"esModuleInterop": false,
"skipLibCheck": true
},
"exclude": ["node_modules", "dist"],
"include": ["tests/**/*.ts", "src/**/*.ts"]
}
Loading

0 comments on commit 8de358b

Please sign in to comment.