Skip to content

Commit

Permalink
fix: binary builds type to existing directory in npm package
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziothh committed Nov 16, 2023
1 parent aaeb356 commit 3249efc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fn write_node_modules_types(
) -> anyhow::Result<()> {
std::fs::write(
project_path.join(format!(
"node_modules/{}/generated/routes.d.ts",
"node_modules/{}/npm/generated/routes.d.ts",
NODE_LIBRARY_NAME
)),
[
Expand Down
4 changes: 2 additions & 2 deletions lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next-typed-routes/lib",
"version": "0.0.2-rc.1",
"version": "0.0.2-rc.2",
"private": false,
"publishConfig": {
"access": "public"
Expand All @@ -24,7 +24,7 @@
"ntr": "npm/bin/run.mjs"
},
"scripts": {
"build": "tsc && (rm -rf npm/package.json || '')",
"build": "cat ./scripts/build.sh | $SHELL",
"postinstall": "node npm/bin/install.mjs",
"postuninstall": "node npm/bin/uninstall.mjs"
},
Expand Down
5 changes: 5 additions & 0 deletions lib/scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
tsc
cp -r ./generated ./npm/generated
rm -rf ./npm/types
cp -r ./types ./npm/types
(rm -rf npm/package.json || '')

0 comments on commit 3249efc

Please sign in to comment.