Skip to content

Commit

Permalink
fix: hmr turbo (#937)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustav-Eikaas authored Apr 23, 2024
1 parent 791721f commit ffcae54
Show file tree
Hide file tree
Showing 36 changed files with 88 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pnpm build # Build monorepo in parallel 🚨 NB: Sometimes fails due to internal
pnpm ci:build # Build sequentially
```

⚠️ [Hot module replacement](https://webpack.js.org/guides/hot-module-replacement/) is disabled due to an error in dependency resolution resulting in massive bundle sizes. To apply changes stop the server and run `pnpm serve <app>`.
[Hot module replacement](https://webpack.js.org/guides/hot-module-replacement/) is supported when using the watch command

🛡️ In order to login to the apps you need to authenticate using an Equinor account with access to a valid context/project in ProCoSys.

Expand Down
2 changes: 2 additions & 0 deletions libs/handoverapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
Expand Down
2 changes: 1 addition & 1 deletion libs/handoverapp/src/lib/ui-garden/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const HandoverGardenHeader = (props: CustomHeaderView) => {
return (
<HeaderContent>
<div>
{header.name}
{header.name}
</div>
<Count>({header.count})</Count>
</HeaderContent>
Expand Down
2 changes: 2 additions & 0 deletions libs/handovershared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
Expand Down
2 changes: 2 additions & 0 deletions libs/handoversidesheet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
Expand Down
4 changes: 3 additions & 1 deletion libs/heattraceapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"build": "tsc -b"
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
"main": "./dist/src/index.js",
Expand Down
4 changes: 3 additions & 1 deletion libs/heattraceshared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"build": "tsc -b"
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
"main": "./dist/src/index.js",
Expand Down
4 changes: 3 additions & 1 deletion libs/heattracesidesheet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"build": "tsc -b"
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
"main": "./dist/src/index.js",
Expand Down
2 changes: 2 additions & 0 deletions libs/loopapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
Expand Down
2 changes: 2 additions & 0 deletions libs/loopshared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
Expand Down
4 changes: 3 additions & 1 deletion libs/loopsidesheet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
Expand All @@ -13,4 +15,4 @@
"@cc-components/shared": "workspace:^",
"@cc-components/sharedcomponents": "workspace:^"
}
}
}
2 changes: 2 additions & 0 deletions libs/mechanicalcompletionapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
Expand Down
2 changes: 2 additions & 0 deletions libs/mechanicalcompletionshared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
Expand Down
2 changes: 2 additions & 0 deletions libs/mechanicalcompletionsidesheet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
Expand Down
2 changes: 2 additions & 0 deletions libs/modelviewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"module": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f",
"test": "vitest",
"test:silent": "vitest --silent --run",
Expand Down
4 changes: 3 additions & 1 deletion libs/pipingapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"build": "tsc -b"
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
"main": "./dist/src/index.js",
Expand Down
4 changes: 3 additions & 1 deletion libs/pipingshared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"build": "tsc -b"
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
"main": "./dist/src/index.js",
Expand Down
4 changes: 3 additions & 1 deletion libs/pipingsidesheet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"build": "tsc -b"
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
"main": "./dist/src/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
Expand Down
2 changes: 2 additions & 0 deletions libs/punchapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
Expand Down
4 changes: 3 additions & 1 deletion libs/punchshared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
Expand All @@ -11,4 +13,4 @@
"dependencies": {
"@cc-components/shared": "workspace:^"
}
}
}
2 changes: 2 additions & 0 deletions libs/punchsidesheet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
Expand Down
5 changes: 3 additions & 2 deletions libs/scopechangerequestapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"dependencies": {
"@cc-components/shared": "workspace:^",
"@cc-components/scopechangerequestshared" : "workspace:^",
"@cc-components/scopechangerequestshared": "workspace:^",
"@cc-components/scopechangerequestsidesheet": "workspace:^"

}
}
2 changes: 2 additions & 0 deletions libs/scopechangerequestshared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
Expand Down
2 changes: 2 additions & 0 deletions libs/scopechangerequestsidesheet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
Expand Down
2 changes: 2 additions & 0 deletions libs/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"module": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"sideEffects": false,
Expand Down
2 changes: 2 additions & 0 deletions libs/sharedcomponents/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"type": "module",
"private": true,
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
Expand Down
2 changes: 2 additions & 0 deletions libs/swcrapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
Expand Down
2 changes: 2 additions & 0 deletions libs/swcrshared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
Expand Down
2 changes: 2 additions & 0 deletions libs/swcrsidesheet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
Expand Down
4 changes: 3 additions & 1 deletion libs/workorderapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"build": "tsc -b -f "
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"module": "./dist/src/index.js",
"main": "./dist/src/index.js",
Expand Down
2 changes: 2 additions & 0 deletions libs/workordershared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"module": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"dependencies": {
Expand Down
2 changes: 2 additions & 0 deletions libs/workordersidesheet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"module": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"scripts": {
"dev": "npm run build -- --watch",
"dev:local": "npm run dev -- --watch",
"build": "tsc -b -f"
},
"dependencies": {
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"build:libs": "turbo run build --filter ./libs/* --parallel --output-logs errors-only",
"new:app": "nx generate @cc-components/plugins:fusion-app-generator",
"new:report": "nx generate @cc-components/plugins:fusion-report-generator",
"watch": "node ./run_watch.js dev",
"watch:local": "node ./run_watch.js dev:local",
"link:workspace": "tsx ./github-action/src/link-ff.ts link",
"unlink:workspace": "tsx ./github-action/src/link-ff.ts unlink"
},
Expand Down
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

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

3 changes: 3 additions & 0 deletions run_watch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { execSync } from 'child_process';
// This script can be deleted as soon as https://github.com/vercel/turbo/issues/986 is merged
execSync(`turbo run ${process.argv[2]} --filter ${process.argv[3]}...`, { stdio: "inherit" })

0 comments on commit ffcae54

Please sign in to comment.