Skip to content

Commit

Permalink
build with turborepo
Browse files Browse the repository at this point in the history
  • Loading branch information
zapaz committed Jan 22, 2024
1 parent 8c60565 commit ddd3343
Show file tree
Hide file tree
Showing 33 changed files with 334 additions and 208 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
.DS_Store
.env*
.turbo
2 changes: 1 addition & 1 deletion common/lib/apis/api-alchemy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BigNumber } from "ethers";
import type { CollectionFilterType, CollectionType, NftType } from "@lib/common/types";
import type { FetchResponse } from "@lib/common/fetch";
import { fetchJson, FETCH_LIMIT } from "@lib/common/fetch";
import { getChecksumAddress, isAddressNotZero } from "@lib/common/config";
import { getChecksumAddress, isAddressNotZero } from "@lib/common/config";
import { keyCollections, keyNft } from "@lib/common/keys";
import { constants } from "ethers";
import { networks } from "@lib/common/networks";
Expand Down
2 changes: 1 addition & 1 deletion common/lib/apis/api-thegraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const thegraphCollections = async (chainId: number, account: string): Promise<Ma
// console.log(`thegraphCollections ${keyCollections(chainId, account)}\n`);

const collections: Map<string, CollectionType> = new Map();
const network = networks.get(chainId);
const network = networks.get(chainId);

if (account) {
const query = `
Expand Down
2 changes: 1 addition & 1 deletion common/lib/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Fragment, Interface } from "@ethersproject/abi";
import type { CollectionType, NftType, RefPageType, AddressesType } from "@lib/common/types";

import config from "@config/config.json";
import addressesRaw from "@contracts/addresses.json";
import addressesRaw from "@kredeum/contracts/addresses.json";

import { formatEther } from "ethers/lib/utils";
import { networks } from "./networks";
Expand Down
5 changes: 1 addition & 4 deletions common/lib/common/ens-get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import { JsonRpcProvider } from "@ethersproject/providers";
import config from "@config/config.json";

const ens = (() => {
let ensProvider: JsonRpcProvider;
const ensProvider: JsonRpcProvider = new providers.JsonRpcProvider(config.ens.rpcUrl);

const getName = async (address: string): Promise<string> => {
ensProvider ||= new providers.JsonRpcProvider(config.ens.rpcUrl);
console.log("getName ~ ensProvider:", ensProvider);
let name = "";

try {
Expand All @@ -21,7 +19,6 @@ const ens = (() => {
};

const getAvatar = async (address: string): Promise<string> => {
ensProvider ||= new providers.JsonRpcProvider(config.ens.rpcUrl);
let avatar = "";

try {
Expand Down
2 changes: 1 addition & 1 deletion common/lib/nft/nft-get-metadata.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { NftType, NftMetadata } from "@lib/common/types";
import { fetchJson } from "@lib/common/fetch";
import { getChecksumAddress } from "@lib/common/config";
import { getChecksumAddress } from "@lib/common/config";
import { keyNft } from "@lib/common/keys";
import { constants } from "ethers";
import { swarmGatewayUrl, swarmGetLink } from "./storage/swarm";
Expand Down
1 change: 0 additions & 1 deletion common/lib/nft/nft-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { alchemyActive, alchemyNftList } from "@lib/apis/api-alchemy";
import { covalentActive, covalentNftList } from "@lib/apis/api-covalent";
import { thegraphActive, thegraphNftList } from "@lib/apis/api-thegraph";


import { FETCH_LIMIT } from "@lib/common/fetch";
import { networks } from "@lib/common/networks";

Expand Down
2 changes: 1 addition & 1 deletion common/lib/resolver/resolver-conv-collection-infos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { constants, BigNumber } from "ethers";
import type { IOpenNFTsInfos, IERCNftInfos } from "@soltypes/OpenNFTsResolver";

import type { CollectionType, ReceiverType } from "@lib/common/types";
import { getChecksumAddress, DEFAULT_NAME, DEFAULT_SYMBOL } from "@lib/common/config";
import { getChecksumAddress, DEFAULT_NAME, DEFAULT_SYMBOL } from "@lib/common/config";
import { resolverConvSupports } from "@lib/resolver/resolver-conv-supports";
import { networks } from "@lib/common/networks";

Expand Down
2 changes: 1 addition & 1 deletion common/lib/resolver/resolver-conv-nft-infos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { BigNumber, constants } from "ethers";

import type { IERCNftInfos, IOpenNFTsInfos } from "@soltypes/IOpenNFTsResolver";
import type { NftType, CollectionType, ReceiverType } from "@lib/common/types";
import { getChecksumAddress } from "@lib/common/config";
import { getChecksumAddress } from "@lib/common/config";
import { networks } from "@lib/common/networks";

const resolverConvNftInfos = (
Expand Down
17 changes: 10 additions & 7 deletions common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "common",
"version": "2.0.0",
"name": "@kredeum/common",
"version": "1.4.0",
"description": "",
"main": "index.js",
"directories": {
Expand All @@ -27,10 +27,10 @@
"@ipld/dag-pb": "^4.0.8",
"@types/findup-sync": "^4.0.4",
"@types/fs-extra": "^11.0.4",
"@types/node": "^20.11.0",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
"dotenv": "^16.3.1",
"@types/node": "^20.11.5",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"dotenv": "^16.3.2",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"ethers": "^5.7.2",
Expand All @@ -39,9 +39,12 @@
"handlebars": "^4.7.8",
"multiformats": "^12.1.3",
"pdfjs-dist": "^3.11.174",
"prettier": "^3.2.1",
"prettier": "^3.2.4",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.3.3"
},
"dependencies": {
"@kredeum/contracts": "workspace:^"
}
}
3 changes: 1 addition & 2 deletions common/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"@utils/*": ["common/utils/*"],
"@config/*": ["common/config/*"],
"@soltypes/*": ["contracts/types/*"],
"@artifacts/*": ["contracts/out/*"],
"@contracts/*": ["contracts/*"]
"@artifacts/*": ["contracts/out/*"]
}
},
"include": ["**/*.ts"],
Expand Down
17 changes: 17 additions & 0 deletions common/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": ["//"],
"pipeline": {
"build": {
"inputs": [
"config/config.handlebars.json",
"config/mainnets.handlebars.json",
"config/testnets.handlebars.json"
],
"outputs": [
"config/config.json",
"config/mainnets.json",
"config/testnets.json"
]
}
}
}
1 change: 0 additions & 1 deletion contracts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
node_modules

# SOLIDITY
artifacts
cache
docs
out
Expand Down
6 changes: 3 additions & 3 deletions contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"name": "@kredeum/contracts",
"version": "1.4.0",
"author": "Kredeum",
"description": "",
"devDependencies": {
Expand All @@ -20,7 +22,6 @@
"keywords": [],
"license": "ISC",
"main": "index.js",
"name": "contracts",
"scripts": {
"all": " pnpm install && pnpm install-all && pnpm build && pnpm check && pnpm tests",
"install:foundry": "curl -L https://foundry.paradigm.xyz | bash && export PATH=$PATH:$HOME/.foundry/bin && foundryup && pnpm foundry:init && pnpm foundry:update",
Expand All @@ -46,6 +47,5 @@
"foundry:types": "pnpx typechain --out-dir types --target ethers-v5 out/**/*.json",
"tests": "pnpm tests:forge",
"tests:forge": "forge test"
},
"version": "2.0.0"
}
}
10 changes: 10 additions & 0 deletions contracts/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": ["//"],
"pipeline": {
"build": {
"inputs": ["src/**/*.sol"],
"outputs": ["out/**", "types/**"]
},
"deploy": { "dependsOn": ["build"], "outputs": ["addresses.json"] }
}
}
2 changes: 1 addition & 1 deletion gulp/html/connexion.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<link rel="manifest" href="/site.webmanifest" />
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
<meta name="msapplication-TileColor" content="#da532c" />
<meta name="theme-color" content="#ffffff" />
<meta name="theme-color" content="#ffffff"/>
</head>

<body>
Expand Down
10 changes: 5 additions & 5 deletions gulp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gulp",
"version": "1.0.0",
"name": "@kredeum/gulp",
"version": "1.4.0",
"description": "",
"main": "gulpfile.js",
"scripts": {
Expand All @@ -12,10 +12,10 @@
"license": "ISC",
"devDependencies": {
"-": "^0.0.1",
"autoprefixer": "^10.4.16",
"autoprefixer": "^10.4.17",
"cssnano": "^6.0.3",
"del": "^6.1.1",
"dotenv": "^16.3.1",
"dotenv": "^16.3.2",
"gulp": "^4.0.2",
"gulp-if": "^3.0.0",
"gulp-imagemin": "^7.1.0",
Expand All @@ -28,6 +28,6 @@
"gulp-sourcemaps": "^3.0.0",
"gulp-uglify": "^3.0.2",
"postcss": "^8.4.33",
"sass": "^1.69.7"
"sass": "^1.70.0"
}
}
13 changes: 13 additions & 0 deletions gulp/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": [
"//"
],
"pipeline": {
"build": {
"outputs": [
"../web/dapp/**",
"../wordpress/plugins/kredeum-nfts/lib/**"
]
}
}
}
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
{
"name": "kredeum",
"version": "1.0.0",
"version": "1.4.0",
"main": "index.js",
"scripts": {
"all": "pnpm clean-all && pnpm install-all && pnpm build-all && pnpm format-all && pnpm check-all && pnpm tests-all",
"clean-all": "rm -rf node_modules && rm -f pnpm-lock.yaml && pnpm -r clean",
"install-foundry": "pnpm -F contracts install:foundry",
"install-wordpress": "pnpm -F wordpress install:wordpress",
"install-all": "pnpm install && pnpm install-foundry && pnpm install-wordpress",
"build-all": "pnpm build1 && pnpm build2 && pnpm build3 && pnpm build4",
"build-all": "pnpm build1 && pnpm build2 && pnpm build3",
"format-all": "pnpm -r format",
"check-all": "pnpm -r check",
"update-all": "pnpm -r update",
"tests-all": "pnpm -r tests",
"build1": "pnpm -F common build",
"build2": "pnpm -F contracts -F gulp build",
"build3": "pnpm -F svelte build",
"build4": "pnpm -F wordpress build",
"build-dapp": "pnpm build1 && pnpm build2 && pnpm build3",
"build-plugin": "pnpm build1 && pnpm build2 && pnpm build3 && pnpm build4",
"build-plugin": "pnpm build1 && pnpm build2 && pnpm build3",
"deploy-dapp": "export PATH=$PATH:$HOME/.foundry/bin && pnpm install && pnpm install-foundry && pnpm build-dapp",
"deploy-plugin": "pnpm install && pnpm install-wordpress && pnpm build-plugin"
},
"keywords": [],
"keywords": [
"Kredeum",
"NFT",
"Factory"
],
"author": "kredeum",
"license": "MIT",
"engines": {
"node": "^18",
"pnpm": "^8"
},
"pnpm": {
"peerDependencyRules": {
"allowedVersions": {
"@nomiclabs/hardhat-ethers": "0.3.0-beta.13"
}
}
"devDependencies": {
"turbo": "^1.11.3"
}
}
Loading

0 comments on commit ddd3343

Please sign in to comment.