Skip to content

Commit

Permalink
release fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
terrablue committed Aug 5, 2024
1 parent adebfca commit ac8cdf6
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 20 deletions.
18 changes: 3 additions & 15 deletions docs/blog/release-032.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,24 +231,11 @@ export default {
};
```

You can apply the following command in your routes directory to convert
You can apply a [route migration script] your routes directory to convert
all routes to the new format.

```sh
find . -type f -exec sed -i 's/import { view } from "primate"/import view from "primate\/handler\/view"/g' {} + &&
find . -type f -exec sed -i "s/import { view } from 'primate'/import view from 'primate\/handler\/view'/g" {} + &&
find . -type f -exec sed -i 's/import { error } from "primate"/import error from "primate\/handler\/error"/g' {} + &&
find . -type f -exec sed -i "s/import { error } from 'primate'/import error from 'primate\/handler\/error'/g" {} + &&
find . -type f -exec sed -i 's/import { redirect } from "primate"/import redirect from "primate\/handler\/redirect "/g' {} + &&
find . -type f -exec sed -i "s/import { redirect } from 'primate'/import redirect from 'primate\/handler\/redirect'/g" {} + &&
find . -type f -exec sed -i 's/import { ws } from "primate"/import ws from "primate\/handler\/ws"/g' {} + &&
find . -type f -exec sed -i "s/import { ws } from 'primate'/import ws from 'primate\/handler\/ws'/g" {} + &&
find . -type f -exec sed -i 's/import { sse } from "primate"/import sse from "primate\/handler\/sse"/g' {} + &&
find . -type f -exec sed -i "s/import { sse } from 'primate'/import sse from 'primate\/handler\/sse'/g" {} +
```

!!!
Note that this command won't convert combined imports of the form
Note that the script won't convert combined imports of the form
`import { view, redirect } from "primate";`.
!!!

Expand Down Expand Up @@ -312,3 +299,4 @@ Otherwise, have a blast with the new version!
[Voby]: https://github.com/vobyjs/voby
[discord]: https://discord.gg/RSg4NNwM4f
[HTML frontend]: /modules/html
[route migration script]: https://github.com/primatejs/primate/tree/master/docs/migrations/0.32/routes.sh
11 changes: 11 additions & 0 deletions docs/migrations/0.32/routes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
find . -type f -exec sed -i 's/import view from "primate/handler/view"/import view from "primate\/handler\/view"/g' {} + &&
find . -type f -exec sed -i "s/import view from 'primate/handler/view'/import view from 'primate\/handler\/view'/g" {} + &&
find . -type f -exec sed -i 's/import error from "primate/handler/error"/import error from "primate\/handler\/error"/g' {} + &&
find . -type f -exec sed -i "s/import error from 'primate/handler/error'/import error from 'primate\/handler\/error'/g" {} + &&
find . -type f -exec sed -i 's/import redirect from "primate/handler/redirect "/import redirect from "primate\/handler\/redirect "/g' {} + &&
find . -type f -exec sed -i "s/import redirect from 'primate/handler/redirect'/import redirect from 'primate\/handler\/redirect'/g" {} + &&
find . -type f -exec sed -i 's/import ws from "primate/handler/ws"/import ws from "primate\/handler\/ws"/g' {} + &&
find . -type f -exec sed -i "s/import ws from 'primate/handler/ws'/import ws from 'primate\/handler\/ws'/g" {} + &&
find . -type f -exec sed -i 's/import sse from "primate/handler/sse"/import sse from "primate\/handler\/sse"/g' {} + &&
find . -type f -exec sed -i "s/import sse from 'primate/handler/sse'/import sse from 'primate\/handler\/sse'/g" {} +
2 changes: 1 addition & 1 deletion packages/html/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@primate/html",
"version": "0.1.0",
"version": "0.10.0",
"description": "Primate HTML frontend",
"homepage": "https://primatejs.com/modules/html",
"bugs": "https://github.com/primatejs/primate/issues",
Expand Down
1 change: 1 addition & 0 deletions packages/native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"directory": "packages/native"
},
"dependencies": {
"@primate/core": "workspace:^",
"@rcompat/cli": "^0.5.1",
"@rcompat/fs": "^0.4.0",
"@rcompat/stdio": "^0.4.0",
Expand Down
7 changes: 3 additions & 4 deletions packages/primate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@
"type": "module",
"types": "./types/index.d.ts",
"exports": {
"./handler/*": "./src/handlers/*.js"
},
"scripts": {
"prepublishOnly": "dts-buddy"
"./handler/*": {
"default": "./src/handlers/*.js"
}
}
}

0 comments on commit ac8cdf6

Please sign in to comment.