Skip to content

Commit

Permalink
fix: coordinator build working after rename (#46)
Browse files Browse the repository at this point in the history
* fix: coordinator build working after rename

* chore: use npm ci for ci build
  • Loading branch information
robertshuford authored Mar 11, 2024
1 parent d438a58 commit 1b85ef6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ module.exports = {
- add our module file(s) (e.g. `src/clients.ts`) and test file(s) (e.g. `src/clients.test.ts`)
- NOTE: when these files were copied over, they came from caravan when not all files were converted to typescript. A `transform` field needed to be added to the jest config as well as `babel-jest` package to handle js transformations for those older files.
- You should now be able to run `turbo run test --scope=@caravan/clients` and `turbo run build --scope=@caravan/clients` to test and build
- To start using this in another package, say `@caravan/coordinator` simply add it to the package.json with a `*`:
- To start using this in another package, say `caravan-coordinator` simply add it to the package.json with a `*`:
```json
{
"dependencies": {
Expand Down Expand Up @@ -314,4 +314,3 @@ instead of
```ts
import { reverseBuffer } from "bitcoinjs-lib/src/bufferutils.js";
```

6 changes: 3 additions & 3 deletions apps/coordinator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN npm install -g turbo
COPY . .
# Optimize caching with docker
# https://turbo.build/repo/docs/handbook/deploying-with-docker
RUN turbo prune @caravan/coordinator --docker
RUN turbo prune caravan-coordinator --docker

# Add lockfile and package.json's of isolated subworkspace
FROM base AS installer
Expand All @@ -24,13 +24,13 @@ WORKDIR /app
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/package-lock.json ./package-lock.json
RUN npm install
RUN npm ci

# Build the project
COPY --from=builder /app/out/full/ .
ENV NODE_OPTIONS=--max-old-space-size=32768

RUN npx turbo run build --filter=coordinator...
RUN npx turbo run build --filter=caravan-coordinator...

# Serve the production build files via nginx (will be served at http://localhost:80/#
# in docker vm. Map port 80 to a different port on the host machine to access the app)
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"scripts": {
"build": "turbo build",
"build:coordinator": "turbo build --filter=@caravan/coordinator",
"build:coordinator": "turbo build --filter=caravan-coordinator",
"changeset": "changeset",
"ci": "turbo run build lint test",
"dev": "turbo dev",
Expand All @@ -12,7 +12,7 @@
"lint": "turbo lint",
"version": "turbo run build && turbo lint test && changeset version",
"release": "turbo run build && turbo lint test && changeset publish",
"dev:coordinator": "turbo run dev --filter=@caravan/coordinator",
"dev:coordinator": "turbo run dev --filter=caravan-coordinator",
"publish-tags": "changeset tag && git push --follow-tags"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/caravan-wallets/src/trezor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const TREZOR = "trezor";
* What's going on with this TrezorConnect import?
* For some reason the way trezor/connect and trezor/connect-web export their default
* export gets ignored from some build systems (it might be a webpack issue, but we haven't been
* able to narrow it down exactly). In @caravan/coordinator, the vite build is able to find
* able to narrow it down exactly). In caravan-coordinator, the vite build is able to find
* the default export correctly. In builds that don't respect the built @trezor/connect code,
* the exports.default value and instead falls back to the tsbuild.__exportStar exports. When
* this happens we need to pull the `TrezorConnect` object from the default property of the module.
Expand Down

0 comments on commit 1b85ef6

Please sign in to comment.