Skip to content

Commit

Permalink
chore: update build scripts to produce more reliable caching
Browse files Browse the repository at this point in the history
  • Loading branch information
moldy530 committed Nov 14, 2024
1 parent e1fddd8 commit 46463d0
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
name: Build and Test
runs-on: ubuntu-latest
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
API_KEY: ${{ secrets.API_KEY }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
name: Build and Publish
runs-on: ubuntu-latest
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}

Expand Down Expand Up @@ -68,5 +69,4 @@ jobs:
if: inputs.publish
env:
API_KEY: ${{ secrets.API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: yarn install --force && yarn lerna publish --conventional-commits --no-private --yes --no-verify-access
1 change: 0 additions & 1 deletion account-kit/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"prebuild": "npx tsx ./inject-version.ts",
"dev": "storybook dev",
"build": "yarn clean && yarn build:esm && yarn build:types",
"build:dev": "lerna watch --scope='@account-kit/react' --include-dependencies -- lerna run build --scope=@account-kit/react",
"build:esm": "tsc --project tsconfig.build.json --outDir ./dist/esm",
"build:types": "tsc --project tsconfig.build.json --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
"docs:gen": "node ../../doc-gen/dist/esm/cli.js generate --in ./src/index.ts --out ../../site/pages/reference/account-kit/react",
Expand Down
11 changes: 11 additions & 0 deletions account-kit/react/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": ["//"],
"tasks": {
"dev": {
"dependsOn": ["^build", "build"],
"persistent": true,
"cache": false,
"interruptible": false
}
}
}
3 changes: 2 additions & 1 deletion account-kit/smart-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"./package.json": "./package.json"
},
"scripts": {
"generate": "npx tsx ../plugingen/src/cli.ts generate",
"generate": "npx tsx ../plugingen/src/cli.ts generate && yarn _lint:generated",
"_lint:generated": "dotenv -e ../../.env -- eslint . --fix --config ../../.eslintrc --ignore-path ../../.prettierignore && prettier --write --ignore-path ../../.prettierignore .",
"build": "yarn clean && yarn build:esm && yarn build:types",
"build:esm": "tsc --project tsconfig.build.json --outDir ./dist/esm",
"build:types": "tsc --project tsconfig.build.json --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
Expand Down
17 changes: 17 additions & 0 deletions account-kit/smart-contracts/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": ["//"],
"tasks": {
"generate": {
"env": ["OPENAI_API_KEY"],
"inputs": ["plugindefs/**"],
"dependsOn": ["@account-kit/plugingen#build"],
"outputs": ["src/**/plugins/**/plugin.ts"]
},
"build": {
"dependsOn": ["^build", "generate"],
"outputs": ["dist/**"],
"inputs": ["$TURBO_DEFAULT$", "src/**", "!src/**/plugins/**/plugin.ts"],
"cache": true
}
}
}
5 changes: 5 additions & 0 deletions examples/ui-demo/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"dependsOn": ["^build"],
"outputs": [".next/**", "!.next/cache/**"],
"env": ["API_KEY", "ALCHEMY_API_URL", "ALCHEMY_RPC_URL"]
},
"dev": {
"dependsOn": ["^build"],
"interruptible": false,
"persistent": true
}
}
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
"clean": "yarn clean:turbo && yarn clean:node_modules",
"clean:turbo": "turbo run clean",
"clean:node_modules": "lerna clean -y && rm -rf node_modules",
"dev:ui": "turbo watch dev --filter='@account-kit/react' --filter=ui-demo",
"dev:docs": "turbo watch dev --filter=docs",
"docs:gen": "turbo run docs:gen",
"test": "vitest dev",
"test:ci": "vitest run",
Expand All @@ -49,6 +51,7 @@
"@types/prettier": "^2.7.3",
"add": "^2.0.6",
"ak-docgen": "*",
"dotenv-cli": "^7.4.2",
"eslint": "^8.39.0",
"eslint-config-react-app": "^7.0.1",
"eslint-formatter-github": "^1.1.4",
Expand Down
6 changes: 6 additions & 0 deletions site/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
"outputs": ["dist/**", "sidebar/**"],
"dependsOn": ["^build", "^docs:gen"],
"cache": false
},
"dev": {
"dependsOn": ["^build"],
"persistent": true,
"cache": false,
"interruptible": true
}
}
}
8 changes: 4 additions & 4 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://turbo.build/schema.json",
"tasks": {
"build": {
"dependsOn": ["^build", "generate"],
"dependsOn": ["^build"],
"outputs": [".next/**", "!.next/cache/**", "dist/**"],
"cache": true
},
Expand All @@ -24,10 +24,10 @@
"dependsOn": ["ak-docgen#build"],
"outputs": ["../../site/pages/reference/**"]
},
"generate": {
"dev": {
"dependsOn": ["^build"],
"outputs": ["src/**/plugins/**"],
"cache": true
"persistent": true,
"cache": false
}
}
}
12 changes: 11 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10985,12 +10985,22 @@ dot-prop@^5.1.0:
dependencies:
is-obj "^2.0.0"

dotenv-cli@^7.4.2:
version "7.4.2"
resolved "https://registry.yarnpkg.com/dotenv-cli/-/dotenv-cli-7.4.2.tgz#c158a818de08e1fbc51d310f628cbace9075b734"
integrity sha512-SbUj8l61zIbzyhIbg0FwPJq6+wjbzdn9oEtozQpZ6kW2ihCcapKVZj49oCT3oPM+mgQm+itgvUQcG5szxVrZTA==
dependencies:
cross-spawn "^7.0.3"
dotenv "^16.3.0"
dotenv-expand "^10.0.0"
minimist "^1.2.6"

dotenv-expand@^10.0.0, dotenv-expand@~10.0.0:
version "10.0.0"
resolved "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-10.0.0.tgz"
integrity sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==

dotenv@^16.0.0, dotenv@^16.4.5:
dotenv@^16.0.0, dotenv@^16.3.0, dotenv@^16.4.5:
version "16.4.5"
resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz"
integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==
Expand Down

0 comments on commit 46463d0

Please sign in to comment.