Skip to content

Commit

Permalink
Remove postinstall script (#54)
Browse files Browse the repository at this point in the history
Having a postinstall script that runs typescript has proven to be problematic for multiple reasons. The first one being that not all projects use typescript, which forced us to use npx in our build script. The next problem to surface is that @types/node doesn't exist in the install since it's a dev dependency of this repo. I don't consider adding @types/node to the dependencies of this package to be a good solution, so I'd prefer to just unwind the problem by not having a postinstall script at all.

This just means that developers in this repo should now run the build script after cloning and installing it.
  • Loading branch information
trevor-scheer authored Oct 12, 2022
1 parent 35a00b9 commit aa0fa97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/gold-snakes-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@apollo/datasource-rest': patch
---

Fix installation into non-TS repositories
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@
"node": ">=14.0"
},
"scripts": {
"//": "#use npx here to ensure that non-TS users triggering the postinstall script don't need to install TypeScript globally or in their project",
"build": "npx -p typescript tsc --build tsconfig.build.json",
"build": "tsc --build tsconfig.build.json",
"clean": "git clean -dfqX",
"install-with-npm-8.5": "npm i -g npm@^8.5.0 && npm i",
"postinstall": "npm run build",
"prettier-check": "prettier --check .",
"prettier-fix": "prettier --write .",
"publish-changeset": "changeset publish",
Expand Down

0 comments on commit aa0fa97

Please sign in to comment.